@transferwise/components 46.98.0 → 46.99.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/build/body/Body.js +2 -1
- package/build/body/Body.js.map +1 -1
- package/build/body/Body.mjs +2 -1
- package/build/body/Body.mjs.map +1 -1
- package/build/dateInput/DateInput.js +4 -4
- package/build/dateInput/DateInput.js.map +1 -1
- package/build/dateInput/DateInput.mjs +4 -4
- package/build/dateInput/DateInput.mjs.map +1 -1
- package/build/dateLookup/DateLookup.js +4 -4
- package/build/dateLookup/DateLookup.js.map +1 -1
- package/build/dateLookup/DateLookup.mjs +4 -4
- package/build/dateLookup/DateLookup.mjs.map +1 -1
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.js +3 -3
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.js.map +1 -1
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.mjs +3 -3
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.mjs.map +1 -1
- package/build/i18n/cs.json +0 -2
- package/build/i18n/cs.json.js +0 -2
- package/build/i18n/cs.json.js.map +1 -1
- package/build/i18n/cs.json.mjs +0 -2
- package/build/i18n/cs.json.mjs.map +1 -1
- package/build/i18n/de.json +0 -2
- package/build/i18n/de.json.js +0 -2
- package/build/i18n/de.json.js.map +1 -1
- package/build/i18n/de.json.mjs +0 -2
- package/build/i18n/de.json.mjs.map +1 -1
- package/build/i18n/en.json +0 -2
- package/build/i18n/en.json.js +0 -2
- package/build/i18n/en.json.js.map +1 -1
- package/build/i18n/en.json.mjs +0 -2
- package/build/i18n/en.json.mjs.map +1 -1
- package/build/i18n/es.json +0 -2
- package/build/i18n/es.json.js +0 -2
- package/build/i18n/es.json.js.map +1 -1
- package/build/i18n/es.json.mjs +0 -2
- package/build/i18n/es.json.mjs.map +1 -1
- package/build/i18n/fr.json +0 -2
- package/build/i18n/fr.json.js +0 -2
- package/build/i18n/fr.json.js.map +1 -1
- package/build/i18n/fr.json.mjs +0 -2
- package/build/i18n/fr.json.mjs.map +1 -1
- package/build/i18n/hu.json +0 -2
- package/build/i18n/hu.json.js +0 -2
- package/build/i18n/hu.json.js.map +1 -1
- package/build/i18n/hu.json.mjs +0 -2
- package/build/i18n/hu.json.mjs.map +1 -1
- package/build/i18n/id.json +0 -2
- package/build/i18n/id.json.js +0 -2
- package/build/i18n/id.json.js.map +1 -1
- package/build/i18n/id.json.mjs +0 -2
- package/build/i18n/id.json.mjs.map +1 -1
- package/build/i18n/it.json +0 -2
- package/build/i18n/it.json.js +0 -2
- package/build/i18n/it.json.js.map +1 -1
- package/build/i18n/it.json.mjs +0 -2
- package/build/i18n/it.json.mjs.map +1 -1
- package/build/i18n/ja.json +0 -2
- package/build/i18n/ja.json.js +0 -2
- package/build/i18n/ja.json.js.map +1 -1
- package/build/i18n/ja.json.mjs +0 -2
- package/build/i18n/ja.json.mjs.map +1 -1
- package/build/i18n/nl.json +0 -2
- package/build/i18n/pl.json +0 -2
- package/build/i18n/pl.json.js +0 -2
- package/build/i18n/pl.json.js.map +1 -1
- package/build/i18n/pl.json.mjs +0 -2
- package/build/i18n/pl.json.mjs.map +1 -1
- package/build/i18n/pt.json +0 -2
- package/build/i18n/pt.json.js +0 -2
- package/build/i18n/pt.json.js.map +1 -1
- package/build/i18n/pt.json.mjs +0 -2
- package/build/i18n/pt.json.mjs.map +1 -1
- package/build/i18n/ro.json +0 -2
- package/build/i18n/ro.json.js +0 -2
- package/build/i18n/ro.json.js.map +1 -1
- package/build/i18n/ro.json.mjs +0 -2
- package/build/i18n/ro.json.mjs.map +1 -1
- package/build/i18n/ru.json +0 -2
- package/build/i18n/ru.json.js +0 -2
- package/build/i18n/ru.json.js.map +1 -1
- package/build/i18n/ru.json.mjs +0 -2
- package/build/i18n/ru.json.mjs.map +1 -1
- package/build/i18n/th.json +0 -2
- package/build/i18n/th.json.js +0 -2
- package/build/i18n/th.json.js.map +1 -1
- package/build/i18n/th.json.mjs +0 -2
- package/build/i18n/th.json.mjs.map +1 -1
- package/build/i18n/tr.json +0 -2
- package/build/i18n/tr.json.js +0 -2
- package/build/i18n/tr.json.js.map +1 -1
- package/build/i18n/tr.json.mjs +0 -2
- package/build/i18n/tr.json.mjs.map +1 -1
- package/build/i18n/zh-CN.json +0 -2
- package/build/i18n/zh-CN.json.js +0 -2
- package/build/i18n/zh-CN.json.js.map +1 -1
- package/build/i18n/zh-CN.json.mjs +0 -2
- package/build/i18n/zh-CN.json.mjs.map +1 -1
- package/build/i18n/zh-HK.json +0 -2
- package/build/i18n/zh-HK.json.js +0 -2
- package/build/i18n/zh-HK.json.js.map +1 -1
- package/build/i18n/zh-HK.json.mjs +0 -2
- package/build/i18n/zh-HK.json.mjs.map +1 -1
- package/build/index.js +0 -2
- package/build/index.js.map +1 -1
- package/build/index.mjs +0 -1
- package/build/index.mjs.map +1 -1
- package/build/instructionsList/InstructionsList.js +1 -0
- package/build/instructionsList/InstructionsList.js.map +1 -1
- package/build/instructionsList/InstructionsList.mjs +1 -0
- package/build/instructionsList/InstructionsList.mjs.map +1 -1
- package/build/main.css +16 -45
- package/build/moneyInput/MoneyInput.js +2 -2
- package/build/moneyInput/MoneyInput.js.map +1 -1
- package/build/moneyInput/MoneyInput.mjs +2 -2
- package/build/moneyInput/MoneyInput.mjs.map +1 -1
- package/build/snackbar/Snackbar.js +1 -1
- package/build/snackbar/Snackbar.js.map +1 -1
- package/build/snackbar/Snackbar.mjs +1 -1
- package/build/snackbar/Snackbar.mjs.map +1 -1
- package/build/styles/body/Body.css +3 -0
- package/build/styles/dateInput/DateInput.css +13 -1
- package/build/styles/main.css +16 -45
- package/build/tabs/Tabs.js +3 -3
- package/build/tabs/Tabs.js.map +1 -1
- package/build/tabs/Tabs.mjs +3 -3
- package/build/tabs/Tabs.mjs.map +1 -1
- package/build/test-utils/assets/apple-pay-logo.svg +84 -0
- package/build/typeahead/Typeahead.js +2 -2
- package/build/typeahead/Typeahead.js.map +1 -1
- package/build/typeahead/Typeahead.mjs +2 -2
- package/build/typeahead/Typeahead.mjs.map +1 -1
- package/build/typeahead/typeaheadInput/TypeaheadInput.js +2 -2
- package/build/typeahead/typeaheadInput/TypeaheadInput.js.map +1 -1
- package/build/typeahead/typeaheadInput/TypeaheadInput.mjs +2 -2
- package/build/typeahead/typeaheadInput/TypeaheadInput.mjs.map +1 -1
- package/build/types/body/Body.d.ts +5 -0
- package/build/types/body/Body.d.ts.map +1 -1
- package/build/types/index.d.ts +0 -2
- package/build/types/index.d.ts.map +1 -1
- package/build/types/test-utils/fake-data.d.ts +2 -0
- package/build/types/test-utils/fake-data.d.ts.map +1 -1
- package/build/types/test-utils/index.d.ts +0 -4
- package/build/types/test-utils/index.d.ts.map +1 -1
- package/build/types/uploadInput/UploadInput.d.ts.map +1 -1
- package/build/upload/Upload.js +2 -2
- package/build/upload/Upload.js.map +1 -1
- package/build/upload/Upload.mjs +2 -2
- package/build/upload/Upload.mjs.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.js.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs.map +1 -1
- package/build/uploadInput/UploadInput.js +0 -1
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.mjs +0 -1
- package/build/uploadInput/UploadInput.mjs.map +1 -1
- package/package.json +14 -14
- package/src/body/Body.css +3 -0
- package/src/body/Body.less +3 -0
- package/src/body/Body.spec.tsx +8 -0
- package/src/body/Body.story.tsx +12 -0
- package/src/body/Body.tsx +11 -2
- package/src/dateInput/DateInput.css +13 -1
- package/src/dateInput/DateInput.less +20 -3
- package/src/dateInput/DateInput.tests.story.tsx +14 -3
- package/src/dateInput/DateInput.tsx +4 -4
- package/src/i18n/cs.json +0 -2
- package/src/i18n/de.json +0 -2
- package/src/i18n/en.json +0 -2
- package/src/i18n/es.json +0 -2
- package/src/i18n/fr.json +0 -2
- package/src/i18n/hu.json +0 -2
- package/src/i18n/id.json +0 -2
- package/src/i18n/it.json +0 -2
- package/src/i18n/ja.json +0 -2
- package/src/i18n/nl.json +0 -2
- package/src/i18n/pl.json +0 -2
- package/src/i18n/pt.json +0 -2
- package/src/i18n/ro.json +0 -2
- package/src/i18n/ru.json +0 -2
- package/src/i18n/th.json +0 -2
- package/src/i18n/tr.json +0 -2
- package/src/i18n/zh-CN.json +0 -2
- package/src/i18n/zh-HK.json +0 -2
- package/src/index.ts +0 -2
- package/src/instructionsList/InstructionsList.story.tsx +35 -37
- package/src/instructionsList/InstructionsList.tsx +1 -1
- package/src/legacylistItem/LegacyListItem.story.tsx +5 -5
- package/src/legacylistItem/LegacyListItem.tests.story.tsx +6 -6
- package/src/main.css +16 -45
- package/src/main.less +1 -1
- package/src/ssr.spec.tsx +0 -1
- package/src/test-utils/assets/apple-pay-logo.svg +84 -0
- package/src/test-utils/fake-data.ts +5 -0
- package/src/uploadInput/UploadInput.tsx +4 -13
- package/build/selectOption/SelectOption.js +0 -131
- package/build/selectOption/SelectOption.js.map +0 -1
- package/build/selectOption/SelectOption.messages.js +0 -17
- package/build/selectOption/SelectOption.messages.js.map +0 -1
- package/build/selectOption/SelectOption.messages.mjs +0 -13
- package/build/selectOption/SelectOption.messages.mjs.map +0 -1
- package/build/selectOption/SelectOption.mjs +0 -127
- package/build/selectOption/SelectOption.mjs.map +0 -1
- package/build/styles/selectOption/SelectOption.css +0 -44
- package/build/types/selectOption/SelectOption.d.ts +0 -21
- package/build/types/selectOption/SelectOption.d.ts.map +0 -1
- package/build/types/selectOption/SelectOption.messages.d.ts +0 -12
- package/build/types/selectOption/SelectOption.messages.d.ts.map +0 -1
- package/build/types/selectOption/index.d.ts +0 -3
- package/build/types/selectOption/index.d.ts.map +0 -1
- package/src/selectOption/SelectOption.css +0 -44
- package/src/selectOption/SelectOption.less +0 -40
- package/src/selectOption/SelectOption.messages.ts +0 -12
- package/src/selectOption/SelectOption.spec.tsx +0 -83
- package/src/selectOption/SelectOption.story.tsx +0 -277
- package/src/selectOption/SelectOption.tsx +0 -151
- package/src/selectOption/index.ts +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadInput.mjs","sources":["../../src/uploadInput/UploadInput.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useEffect, useRef, useState } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport Button from '../button';\nimport { CommonProps, ControlType, Priority, Status } from '../common';\nimport { useInputAttributes } from '../inputs/contexts';\nimport Modal from '../modal';\nimport { isSizeValid } from '../upload/utils/isSizeValid';\nimport { isTypeValid } from '../upload/utils/isTypeValid';\n\nimport MESSAGES from './UploadInput.messages';\nimport { UploadedFile, UploadError, UploadResponse } from './types';\nimport UploadButton, { UploadButtonProps } from './uploadButton/UploadButton';\nimport { DEFAULT_SIZE_LIMIT, imageFileTypes } from './uploadButton/defaults';\nimport UploadItem, { UploadItemProps } from './uploadItem/UploadItem';\n\nexport type UploadInputProps = {\n /**\n * List of already existing, failed or in progress files\n */\n files?: readonly UploadedFile[];\n\n /**\n * The key of the file in the returned FormData object (default: file)\n */\n fileInputName?: string;\n\n /**\n * Callback that handles form submission\n *\n * @param formData\n */\n onUploadFile: (formData: FormData) => Promise<UploadResponse>;\n\n /**\n * Provide a callback if the file can be removed/deleted from the server\n * Your app is responsible for reloading the uploaded files list and updating the component to ensure that the file has in fact been deleted successfully\n *\n * @param id\n */\n onDeleteFile?: (id: string | number) => Promise<any>;\n\n /**\n * Provide a callback to trigger on validation error\n *\n * @param file\n */\n onValidationError?: (file: UploadedFile) => void;\n\n /**\n * Provide a callback to trigger on change whenever the files are updated\n *\n * @param files\n */\n onFilesChange?: (files: UploadedFile[]) => void;\n\n /**\n * Confirmation modal displayed on delete\n */\n deleteConfirm?: {\n /**\n * The title of the confirmation modal on delete\n */\n title?: string;\n\n /**\n * The body of the confirmation modal on delete\n */\n body?: React.ReactNode;\n\n /**\n * The confirm button text of the confirmation modal on delete\n */\n confirmText?: string;\n\n /**\n * The cancel button text of the confirmation modal on delete\n */\n cancelText?: string;\n };\n\n /**\n * Maximum number of files allowed, if provided, shows error below file item\n */\n maxFiles?: number;\n\n /**\n * Error message to show when the maximum number of files are uploaded already\n */\n maxFilesErrorMessage?: string;\n\n /**\n * Error message to show when files over a allowed size limit are uploaded\n */\n sizeLimitErrorMessage?: string;\n} & Pick<\n UploadButtonProps,\n 'disabled' | 'multiple' | 'fileTypes' | 'sizeLimit' | 'description' | 'id' | 'uploadButtonTitle'\n> & { onDownload?: UploadItemProps['onDownload'] } & CommonProps;\n\n/**\n * Interface representing a reference to an UploadItem component.\n * Provides a method to focus the UploadItem.\n */\ninterface UploadItemRef {\n /**\n * Focuses the UploadItem component.\n */\n focus: () => void;\n\n /**\n * Required id of the UploadItem component.\n */\n id: string | number;\n\n /**\n * Optional status of the UploadItem component.\n */\n status?: string;\n}\n\n/**\n * Generates a unique ID for a file based on its name, size, and the current timestamp\n */\nfunction generateFileId(file: File) {\n const { name, size } = file;\n const uploadTimeStamp = new Date().getTime();\n return `${name}_${size}_${uploadTimeStamp}`;\n}\n\n/**\n * The component allows users to upload files, manage the list of uploaded files,\n * and handle file validation and deletion.\n *\n * @param {UploadInputProps} props - The properties for the UploadInput component.\n *\n * @see {@link UploadInput} for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/forms-uploadinput--docs|Storybook Wise Design}\n */\nconst UploadInput = ({\n files = [],\n fileInputName = 'file',\n className,\n deleteConfirm,\n disabled,\n multiple = false,\n fileTypes = imageFileTypes,\n sizeLimit = DEFAULT_SIZE_LIMIT,\n description,\n onUploadFile,\n onDeleteFile,\n onValidationError,\n onFilesChange,\n onDownload,\n maxFiles,\n maxFilesErrorMessage,\n id,\n sizeLimitErrorMessage,\n uploadButtonTitle,\n}: UploadInputProps) => {\n const inputAttributes = useInputAttributes({ nonLabelable: true });\n const [markedFileForDelete, setMarkedFileForDelete] = useState<UploadedFile | null>(null);\n const [lastAttemptedDeleteId, setLastAttemptedDeleteId] = useState<string | number | null>(null);\n const [mounted, setMounted] = useState(false);\n const { formatMessage } = useIntl();\n const uploadInputRef = useRef<HTMLInputElement | null>(null);\n let fileRefs: (HTMLDivElement | UploadItemRef | null)[] = [];\n\n const PROGRESS_STATUSES = new Set([Status.PENDING, Status.PROCESSING]);\n\n const [uploadedFiles, setUploadedFiles] = useState<readonly UploadedFile[]>(\n multiple || files.length === 0 ? files : [files[0]],\n );\n\n const uploadedFilesListReference = useRef(multiple || files.length === 0 ? files : [files[0]]);\n\n function updateFileList(updateFn: (list: readonly UploadedFile[]) => readonly UploadedFile[]) {\n setUploadedFiles(updateFn);\n uploadedFilesListReference.current = updateFn(uploadedFilesListReference.current);\n }\n\n function addFileToList(recentUploadedFile: UploadedFile) {\n updateFileList((list) => [...list, recentUploadedFile]);\n }\n\n function removeFileFromList(file: UploadedFile) {\n updateFileList((list) =>\n list.filter((fileInList) => file !== fileInList && file.id !== fileInList.id),\n );\n fileRefs = fileRefs.filter((ref) => ref && ref.id !== file.id);\n }\n\n function modifyFileInList(file: UploadedFile, updates: Partial<UploadedFile>) {\n updateFileList((list) =>\n list.map((fileInList) =>\n fileInList === file || fileInList.id === file.id ? { ...file, ...updates } : fileInList,\n ),\n );\n }\n\n const removeFile = async (file: UploadedFile) => {\n const { id, status } = file;\n fileRefs = fileRefs.filter((item) => item && item.id !== file.id);\n\n if (status === Status.FAILED) {\n removeFileFromList(file);\n return Promise.resolve();\n }\n\n if (onDeleteFile && id) {\n modifyFileInList(file, { status: Status.PROCESSING, error: undefined });\n\n return onDeleteFile(id)\n .then(() => {\n removeFileFromList(file);\n })\n .catch((error) => {\n modifyFileInList(file, { error: error as UploadError });\n });\n }\n };\n\n function handleFileUploadFailure(file: File, failureMessage: string) {\n const { name } = file;\n\n const failedUpload = {\n id: generateFileId(file),\n filename: name,\n status: Status.FAILED,\n error: failureMessage,\n };\n\n addFileToList(failedUpload);\n\n if (onValidationError) {\n onValidationError(failedUpload);\n }\n }\n\n function getNumberOfFilesUploaded() {\n const uploadInitiatedStatus = new Set([Status.SUCCEEDED, Status.PENDING]);\n const validFiles = uploadedFilesListReference.current.filter(\n (file) => file.status && uploadInitiatedStatus.has(file.status),\n );\n return validFiles.length;\n }\n\n function areMaximumFilesUploadedAlready() {\n if (!maxFiles) {\n return false;\n }\n\n const numberOfValidFiles = getNumberOfFilesUploaded();\n return numberOfValidFiles >= maxFiles;\n }\n\n const addFiles = (selectedFiles: FileList) => {\n for (let i = 0; i < selectedFiles.length; i += 1) {\n const file = selectedFiles.item(i);\n\n const formData = new FormData();\n\n if (file) {\n const allowedFileTypes = typeof fileTypes === 'string' ? fileTypes : fileTypes.join(',');\n\n if (!isTypeValid(file, allowedFileTypes)) {\n handleFileUploadFailure(file, formatMessage(MESSAGES.fileTypeNotSupported));\n continue;\n }\n\n if (!isSizeValid(file, sizeLimit * 1000)) {\n const failureMessage = sizeLimitErrorMessage || formatMessage(MESSAGES.fileIsTooLarge);\n handleFileUploadFailure(file, failureMessage);\n continue;\n }\n\n if (areMaximumFilesUploadedAlready()) {\n const failureMessage =\n maxFilesErrorMessage ||\n formatMessage(MESSAGES.maximumFilesAlreadyUploaded, { maxFilesAllowed: maxFiles });\n handleFileUploadFailure(file, failureMessage);\n continue;\n }\n\n const existingFile = uploadedFiles.find((f) => f.filename === file.name);\n if (existingFile) {\n removeFileFromList(existingFile);\n }\n\n formData.append(fileInputName, file);\n const pendingFile = {\n id: generateFileId(file),\n filename: file.name,\n status: Status.PENDING,\n };\n\n addFileToList(pendingFile);\n\n onUploadFile(formData)\n .then(({ id, url, error }: UploadResponse) => {\n modifyFileInList(pendingFile, { id, url, error, status: Status.SUCCEEDED });\n })\n .catch((error) => {\n modifyFileInList(pendingFile, { error: error as UploadError, status: Status.FAILED });\n });\n\n if (!multiple) {\n break;\n }\n }\n }\n };\n\n useEffect(() => {\n setMounted(true);\n }, []);\n\n useEffect(() => {\n if (onFilesChange && mounted) {\n onFilesChange([...uploadedFiles]);\n }\n }, [onFilesChange, uploadedFiles]); // eslint-disable-line react-hooks/exhaustive-deps\n\n type NextFocusable =\n | HTMLDivElement\n | UploadItemRef\n | { ref: HTMLDivElement | UploadItemRef; target: 'button' | 'link' }\n | null;\n\n const [nextFocusable, setNextFocusable] = useState<NextFocusable>(\n uploadInputRef.current,\n );\n\n const handleFocus = (fileId: string | number) => {\n fileRefs = fileRefs.filter((ref) => {\n return ref && ref.id !== markedFileForDelete?.id;\n });\n\n const filesCount = fileRefs.length;\n let next: UploadItemRef | HTMLDivElement | null = uploadInputRef.current;\n let focusTarget: 'button' | 'link' = 'button';\n\n // If there will be no files left after deletion, focus the upload button\n if (filesCount === 1) {\n next = uploadInputRef.current;\n setNextFocusable(next);\n return;\n }\n\n if (filesCount > 1) {\n const currentFileIndex = fileRefs.findIndex((file) => file?.id === fileId);\n const currentFileId = fileRefs?.[currentFileIndex]?.id;\n const lastFileId = fileRefs?.[filesCount - 1]?.id;\n\n // if last file, select a previous one\n if (currentFileId === lastFileId) {\n next = fileRefs[filesCount - 2];\n } else {\n next = fileRefs[currentFileIndex + 1];\n }\n\n // If next is an UploadItemRef, check if it has a URL (succeeded)\n if (next && 'status' in next) {\n // Find the file object for this ref\n const fileObj = uploadedFiles.find(f => f.id === next?.id);\n if (\n fileObj &&\n (fileObj.status === Status.SUCCEEDED || fileObj.status === Status.DONE) &&\n fileObj.url\n ) {\n focusTarget = 'link';\n }\n }\n setNextFocusable(() => {\n if (next && typeof (next as UploadItemRef).focus === 'function') {\n return { ref: next, target: focusTarget };\n }\n return next;\n });\n }\n };\n\n const handleRefocus = () => {\n const focusTarget = nextFocusable;\n if (lastAttemptedDeleteId) {\n setLastAttemptedDeleteId(null);\n return;\n }\n if (focusTarget) {\n // If there are no files left, focus the upload button\n if (\n uploadedFiles.length === 0 &&\n uploadInputRef.current &&\n typeof uploadInputRef.current.focus === 'function'\n ) {\n setTimeout(() => {\n uploadInputRef.current!.focus();\n }, 0);\n } else if (\n typeof focusTarget === 'object' &&\n 'ref' in focusTarget &&\n focusTarget.ref &&\n typeof focusTarget.ref.focus === 'function'\n ) {\n setTimeout(() => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n if (\n focusTarget.ref &&\n typeof (focusTarget.ref as UploadItemRef).focus === 'function'\n ) {\n // @ts-expect-error: focus may not exist on all possible ref types, but is safe here\n (focusTarget.ref as UploadItemRef).focus(focusTarget.target);\n }\n }, 0);\n } else if (\n focusTarget &&\n typeof (focusTarget as UploadItemRef).focus === 'function'\n ) {\n setTimeout(() => {\n (focusTarget as UploadItemRef).focus();\n }, 0);\n }\n }\n };\n\n return (\n <>\n <div\n role=\"group\"\n className={clsx('np-upload-input', className, { disabled })}\n {...inputAttributes}\n >\n <div\n className=\"np-upload-input__section\"\n aria-live=\"polite\"\n aria-relevant=\"all\"\n role=\"region\"\n >\n {uploadedFiles.map((file, index) => (\n <UploadItem\n key={file.id}\n ref={(el: UploadItemRef | null) => {\n if (\n el &&\n el.id !== markedFileForDelete?.id &&\n !fileRefs.some((ref) => ref && ref.id === el.id) &&\n el.status !== 'processing'\n ) {\n fileRefs.push(el);\n }\n }}\n file={file}\n singleFileUpload={!multiple}\n canDelete={\n (!!onDeleteFile || file.status === Status.FAILED) &&\n (!file.status || !PROGRESS_STATUSES.has(file.status))\n }\n onDelete={\n file.status === Status.FAILED\n ? async () => {\n setLastAttemptedDeleteId(file.id);\n await removeFile(file);\n handleRefocus();\n }\n : () => {\n setLastAttemptedDeleteId(file.id);\n setMarkedFileForDelete(file);\n }\n }\n onDownload={onDownload}\n onFocus={() => handleFocus(file.id)}\n />\n ))}\n </div>\n {(multiple || (!multiple && !uploadedFiles.length)) && (\n <div className=\"np-upload-input__section np-upload-input__section--uploader\">\n <UploadButton\n ref={uploadInputRef}\n id={id}\n uploadButtonTitle={uploadButtonTitle}\n disabled={areMaximumFilesUploadedAlready() || disabled}\n multiple={multiple}\n fileTypes={fileTypes}\n sizeLimit={sizeLimit}\n description={description}\n maxFiles={maxFiles}\n withEntries={Boolean(uploadedFiles.length)}\n onChange={addFiles}\n />\n </div>\n )}\n </div>\n <Modal\n title={\n deleteConfirm?.title !== undefined\n ? deleteConfirm.title\n : formatMessage(MESSAGES.deleteModalTitle)\n }\n body={\n deleteConfirm?.body !== undefined\n ? deleteConfirm.body\n : formatMessage(MESSAGES.deleteModalBody)\n }\n open={!!markedFileForDelete}\n footer={\n <>\n <Button\n block\n onClick={() => {\n setMarkedFileForDelete(null);\n }}\n >\n {deleteConfirm?.cancelText || formatMessage(MESSAGES.deleteModalCancelButtonText)}\n </Button>\n <Button\n block\n priority={Priority.SECONDARY}\n type={ControlType.NEGATIVE}\n tabIndex={markedFileForDelete ? 0 : -1}\n onClick={() => {\n if (markedFileForDelete) {\n void removeFile(markedFileForDelete);\n }\n setMarkedFileForDelete(null);\n setLastAttemptedDeleteId(null);\n }}\n >\n {deleteConfirm?.confirmText || formatMessage(MESSAGES.deleteModalConfirmButtonText)}\n </Button>\n </>\n }\n onUnmount={handleRefocus}\n onClose={() => {\n setMarkedFileForDelete(null);\n }}\n />\n </>\n );\n};\n\nexport default UploadInput;\n"],"names":["generateFileId","file","name","size","uploadTimeStamp","Date","getTime","UploadInput","files","fileInputName","className","deleteConfirm","disabled","multiple","fileTypes","imageFileTypes","sizeLimit","DEFAULT_SIZE_LIMIT","description","onUploadFile","onDeleteFile","onValidationError","onFilesChange","onDownload","maxFiles","maxFilesErrorMessage","id","sizeLimitErrorMessage","uploadButtonTitle","inputAttributes","useInputAttributes","nonLabelable","markedFileForDelete","setMarkedFileForDelete","useState","lastAttemptedDeleteId","setLastAttemptedDeleteId","mounted","setMounted","formatMessage","useIntl","uploadInputRef","useRef","fileRefs","PROGRESS_STATUSES","Set","Status","PENDING","PROCESSING","uploadedFiles","setUploadedFiles","length","uploadedFilesListReference","updateFileList","updateFn","current","addFileToList","recentUploadedFile","list","removeFileFromList","filter","fileInList","ref","modifyFileInList","updates","map","removeFile","status","item","FAILED","Promise","resolve","error","undefined","then","catch","handleFileUploadFailure","failureMessage","failedUpload","filename","getNumberOfFilesUploaded","uploadInitiatedStatus","SUCCEEDED","validFiles","has","areMaximumFilesUploadedAlready","numberOfValidFiles","addFiles","selectedFiles","i","formData","FormData","allowedFileTypes","join","isTypeValid","MESSAGES","fileTypeNotSupported","isSizeValid","fileIsTooLarge","maximumFilesAlreadyUploaded","maxFilesAllowed","existingFile","find","f","append","pendingFile","url","useEffect","nextFocusable","setNextFocusable","handleFocus","fileId","filesCount","next","focusTarget","currentFileIndex","findIndex","currentFileId","lastFileId","fileObj","DONE","focus","target","handleRefocus","setTimeout","_jsxs","_Fragment","children","role","clsx","_jsx","index","UploadItem","el","some","push","singleFileUpload","canDelete","onDelete","onFocus","UploadButton","withEntries","Boolean","onChange","Modal","title","deleteModalTitle","body","deleteModalBody","open","footer","Button","block","onClick","cancelText","deleteModalCancelButtonText","priority","Priority","SECONDARY","type","ControlType","NEGATIVE","tabIndex","confirmText","deleteModalConfirmButtonText","onUnmount","onClose"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6HA,SAASA,cAAcA,CAACC,IAAU,EAAA;EAChC,MAAM;IAAEC,IAAI;AAAEC,IAAAA;AAAM,GAAA,GAAGF,IAAI;EAC3B,MAAMG,eAAe,GAAG,IAAIC,IAAI,EAAE,CAACC,OAAO,EAAE;AAC5C,EAAA,OAAO,GAAGJ,IAAI,CAAA,CAAA,EAAIC,IAAI,CAAA,CAAA,EAAIC,eAAe,CAAE,CAAA;AAC7C;AAEA;;;;;;;;AAQG;AACGG,MAAAA,WAAW,GAAGA,CAAC;AACnBC,EAAAA,KAAK,GAAG,EAAE;AACVC,EAAAA,aAAa,GAAG,MAAM;EACtBC,SAAS;EACTC,aAAa;EACbC,QAAQ;AACRC,EAAAA,QAAQ,GAAG,KAAK;AAChBC,EAAAA,SAAS,GAAGC,cAAc;AAC1BC,EAAAA,SAAS,GAAGC,kBAAkB;EAC9BC,WAAW;EACXC,YAAY;EACZC,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aAAa,EAAEwJ,WAAW,IAAI5H,aAAa,CAACwD,QAAQ,CAACqE,4BAA4B;AAAC,SAC7E,CACV;AAAA,OAAA,CACD;AACDC,MAAAA,SAAS,EAAE1C,aAAc;MACzB2C,OAAO,EAAEA,MAAK;QACZrI,sBAAsB,CAAC,IAAI,CAAC;AAC9B;AAAE,KAEN,CAAA;AAAA,GAAA,CAAG;AAEP;;;;"}
|
|
1
|
+
{"version":3,"file":"UploadInput.mjs","sources":["../../src/uploadInput/UploadInput.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useEffect, useRef, useState } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport Button from '../button';\nimport { CommonProps, ControlType, Priority, Status } from '../common';\nimport { useInputAttributes } from '../inputs/contexts';\nimport Modal from '../modal';\nimport { isSizeValid } from '../upload/utils/isSizeValid';\nimport { isTypeValid } from '../upload/utils/isTypeValid';\n\nimport MESSAGES from './UploadInput.messages';\nimport { UploadedFile, UploadError, UploadResponse } from './types';\nimport UploadButton, { UploadButtonProps } from './uploadButton/UploadButton';\nimport { DEFAULT_SIZE_LIMIT, imageFileTypes } from './uploadButton/defaults';\nimport UploadItem, { UploadItemProps } from './uploadItem/UploadItem';\n\nexport type UploadInputProps = {\n /**\n * List of already existing, failed or in progress files\n */\n files?: readonly UploadedFile[];\n\n /**\n * The key of the file in the returned FormData object (default: file)\n */\n fileInputName?: string;\n\n /**\n * Callback that handles form submission\n *\n * @param formData\n */\n onUploadFile: (formData: FormData) => Promise<UploadResponse>;\n\n /**\n * Provide a callback if the file can be removed/deleted from the server\n * Your app is responsible for reloading the uploaded files list and updating the component to ensure that the file has in fact been deleted successfully\n *\n * @param id\n */\n onDeleteFile?: (id: string | number) => Promise<any>;\n\n /**\n * Provide a callback to trigger on validation error\n *\n * @param file\n */\n onValidationError?: (file: UploadedFile) => void;\n\n /**\n * Provide a callback to trigger on change whenever the files are updated\n *\n * @param files\n */\n onFilesChange?: (files: UploadedFile[]) => void;\n\n /**\n * Confirmation modal displayed on delete\n */\n deleteConfirm?: {\n /**\n * The title of the confirmation modal on delete\n */\n title?: string;\n\n /**\n * The body of the confirmation modal on delete\n */\n body?: React.ReactNode;\n\n /**\n * The confirm button text of the confirmation modal on delete\n */\n confirmText?: string;\n\n /**\n * The cancel button text of the confirmation modal on delete\n */\n cancelText?: string;\n };\n\n /**\n * Maximum number of files allowed, if provided, shows error below file item\n */\n maxFiles?: number;\n\n /**\n * Error message to show when the maximum number of files are uploaded already\n */\n maxFilesErrorMessage?: string;\n\n /**\n * Error message to show when files over a allowed size limit are uploaded\n */\n sizeLimitErrorMessage?: string;\n} & Pick<\n UploadButtonProps,\n 'disabled' | 'multiple' | 'fileTypes' | 'sizeLimit' | 'description' | 'id' | 'uploadButtonTitle'\n> & { onDownload?: UploadItemProps['onDownload'] } & CommonProps;\n\n/**\n * Interface representing a reference to an UploadItem component.\n * Provides a method to focus the UploadItem.\n */\ninterface UploadItemRef {\n /**\n * Focuses the UploadItem component.\n */\n focus: () => void;\n\n /**\n * Required id of the UploadItem component.\n */\n id: string | number;\n\n /**\n * Optional status of the UploadItem component.\n */\n status?: string;\n}\n\n/**\n * Generates a unique ID for a file based on its name, size, and the current timestamp\n */\nfunction generateFileId(file: File) {\n const { name, size } = file;\n const uploadTimeStamp = new Date().getTime();\n return `${name}_${size}_${uploadTimeStamp}`;\n}\n\n/**\n * The component allows users to upload files, manage the list of uploaded files,\n * and handle file validation and deletion.\n *\n * @param {UploadInputProps} props - The properties for the UploadInput component.\n *\n * @see {@link UploadInput} for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/forms-uploadinput--docs|Storybook Wise Design}\n */\nconst UploadInput = ({\n files = [],\n fileInputName = 'file',\n className,\n deleteConfirm,\n disabled,\n multiple = false,\n fileTypes = imageFileTypes,\n sizeLimit = DEFAULT_SIZE_LIMIT,\n description,\n onUploadFile,\n onDeleteFile,\n onValidationError,\n onFilesChange,\n onDownload,\n maxFiles,\n maxFilesErrorMessage,\n id,\n sizeLimitErrorMessage,\n uploadButtonTitle,\n}: UploadInputProps) => {\n const inputAttributes = useInputAttributes({ nonLabelable: true });\n const [markedFileForDelete, setMarkedFileForDelete] = useState<UploadedFile | null>(null);\n const [lastAttemptedDeleteId, setLastAttemptedDeleteId] = useState<string | number | null>(null);\n const [mounted, setMounted] = useState(false);\n const { formatMessage } = useIntl();\n const uploadInputRef = useRef<HTMLInputElement | null>(null);\n let fileRefs: (HTMLDivElement | UploadItemRef | null)[] = [];\n\n const PROGRESS_STATUSES = new Set([Status.PENDING, Status.PROCESSING]);\n\n const [uploadedFiles, setUploadedFiles] = useState<readonly UploadedFile[]>(\n multiple || files.length === 0 ? files : [files[0]],\n );\n\n const uploadedFilesListReference = useRef(multiple || files.length === 0 ? files : [files[0]]);\n\n function updateFileList(updateFn: (list: readonly UploadedFile[]) => readonly UploadedFile[]) {\n setUploadedFiles(updateFn);\n uploadedFilesListReference.current = updateFn(uploadedFilesListReference.current);\n }\n\n function addFileToList(recentUploadedFile: UploadedFile) {\n updateFileList((list) => [...list, recentUploadedFile]);\n }\n\n function removeFileFromList(file: UploadedFile) {\n updateFileList((list) =>\n list.filter((fileInList) => file !== fileInList && file.id !== fileInList.id),\n );\n fileRefs = fileRefs.filter((ref) => ref && ref.id !== file.id);\n }\n\n function modifyFileInList(file: UploadedFile, updates: Partial<UploadedFile>) {\n updateFileList((list) =>\n list.map((fileInList) =>\n fileInList === file || fileInList.id === file.id ? { ...file, ...updates } : fileInList,\n ),\n );\n }\n\n const removeFile = async (file: UploadedFile) => {\n const { id, status } = file;\n fileRefs = fileRefs.filter((item) => item && item.id !== file.id);\n\n if (status === Status.FAILED) {\n removeFileFromList(file);\n return Promise.resolve();\n }\n\n if (onDeleteFile && id) {\n modifyFileInList(file, { status: Status.PROCESSING, error: undefined });\n\n return onDeleteFile(id)\n .then(() => {\n removeFileFromList(file);\n })\n .catch((error) => {\n modifyFileInList(file, { error: error as UploadError });\n });\n }\n };\n\n function handleFileUploadFailure(file: File, failureMessage: string) {\n const { name } = file;\n\n const failedUpload = {\n id: generateFileId(file),\n filename: name,\n status: Status.FAILED,\n error: failureMessage,\n };\n\n addFileToList(failedUpload);\n\n if (onValidationError) {\n onValidationError(failedUpload);\n }\n }\n\n function getNumberOfFilesUploaded() {\n const uploadInitiatedStatus = new Set([Status.SUCCEEDED, Status.PENDING]);\n const validFiles = uploadedFilesListReference.current.filter(\n (file) => file.status && uploadInitiatedStatus.has(file.status),\n );\n return validFiles.length;\n }\n\n function areMaximumFilesUploadedAlready() {\n if (!maxFiles) {\n return false;\n }\n\n const numberOfValidFiles = getNumberOfFilesUploaded();\n return numberOfValidFiles >= maxFiles;\n }\n\n const addFiles = (selectedFiles: FileList) => {\n for (let i = 0; i < selectedFiles.length; i += 1) {\n const file = selectedFiles.item(i);\n\n const formData = new FormData();\n\n if (file) {\n const allowedFileTypes = typeof fileTypes === 'string' ? fileTypes : fileTypes.join(',');\n\n if (!isTypeValid(file, allowedFileTypes)) {\n handleFileUploadFailure(file, formatMessage(MESSAGES.fileTypeNotSupported));\n continue;\n }\n\n if (!isSizeValid(file, sizeLimit * 1000)) {\n const failureMessage = sizeLimitErrorMessage || formatMessage(MESSAGES.fileIsTooLarge);\n handleFileUploadFailure(file, failureMessage);\n continue;\n }\n\n if (areMaximumFilesUploadedAlready()) {\n const failureMessage =\n maxFilesErrorMessage ||\n formatMessage(MESSAGES.maximumFilesAlreadyUploaded, { maxFilesAllowed: maxFiles });\n handleFileUploadFailure(file, failureMessage);\n continue;\n }\n\n const existingFile = uploadedFiles.find((f) => f.filename === file.name);\n if (existingFile) {\n removeFileFromList(existingFile);\n }\n\n formData.append(fileInputName, file);\n const pendingFile = {\n id: generateFileId(file),\n filename: file.name,\n status: Status.PENDING,\n };\n\n addFileToList(pendingFile);\n\n onUploadFile(formData)\n .then(({ id, url, error }: UploadResponse) => {\n modifyFileInList(pendingFile, { id, url, error, status: Status.SUCCEEDED });\n })\n .catch((error) => {\n modifyFileInList(pendingFile, { error: error as UploadError, status: Status.FAILED });\n });\n\n if (!multiple) {\n break;\n }\n }\n }\n };\n\n useEffect(() => {\n setMounted(true);\n }, []);\n\n useEffect(() => {\n if (onFilesChange && mounted) {\n onFilesChange([...uploadedFiles]);\n }\n }, [onFilesChange, uploadedFiles]); // eslint-disable-line react-hooks/exhaustive-deps\n\n type NextFocusable =\n | HTMLDivElement\n | UploadItemRef\n | { ref: HTMLDivElement | UploadItemRef; target: 'button' | 'link' }\n | null;\n\n const [nextFocusable, setNextFocusable] = useState<NextFocusable>(uploadInputRef.current);\n\n const handleFocus = (fileId: string | number) => {\n fileRefs = fileRefs.filter((ref) => {\n return ref && ref.id !== markedFileForDelete?.id;\n });\n\n const filesCount = fileRefs.length;\n let next: UploadItemRef | HTMLDivElement | null = uploadInputRef.current;\n let focusTarget: 'button' | 'link' = 'button';\n\n // If there will be no files left after deletion, focus the upload button\n if (filesCount === 1) {\n next = uploadInputRef.current;\n setNextFocusable(next);\n return;\n }\n\n if (filesCount > 1) {\n const currentFileIndex = fileRefs.findIndex((file) => file?.id === fileId);\n const currentFileId = fileRefs?.[currentFileIndex]?.id;\n const lastFileId = fileRefs?.[filesCount - 1]?.id;\n\n // if last file, select a previous one\n if (currentFileId === lastFileId) {\n next = fileRefs[filesCount - 2];\n } else {\n next = fileRefs[currentFileIndex + 1];\n }\n\n // If next is an UploadItemRef, check if it has a URL (succeeded)\n if (next && 'status' in next) {\n // Find the file object for this ref\n const fileObj = uploadedFiles.find((f) => f.id === next?.id);\n if (\n fileObj &&\n (fileObj.status === Status.SUCCEEDED || fileObj.status === Status.DONE) &&\n fileObj.url\n ) {\n focusTarget = 'link';\n }\n }\n setNextFocusable(() => {\n if (next && typeof (next as UploadItemRef).focus === 'function') {\n return { ref: next, target: focusTarget };\n }\n return next;\n });\n }\n };\n\n const handleRefocus = () => {\n const focusTarget = nextFocusable;\n if (lastAttemptedDeleteId) {\n setLastAttemptedDeleteId(null);\n return;\n }\n if (focusTarget) {\n // If there are no files left, focus the upload button\n if (\n uploadedFiles.length === 0 &&\n uploadInputRef.current &&\n typeof uploadInputRef.current.focus === 'function'\n ) {\n setTimeout(() => {\n uploadInputRef.current!.focus();\n }, 0);\n } else if (\n typeof focusTarget === 'object' &&\n 'ref' in focusTarget &&\n focusTarget.ref &&\n typeof focusTarget.ref.focus === 'function'\n ) {\n setTimeout(() => {\n if (focusTarget.ref && typeof (focusTarget.ref as UploadItemRef).focus === 'function') {\n // @ts-expect-error: focus may not exist on all possible ref types, but is safe here\n (focusTarget.ref as UploadItemRef).focus(focusTarget.target);\n }\n }, 0);\n } else if (focusTarget && typeof (focusTarget as UploadItemRef).focus === 'function') {\n setTimeout(() => {\n (focusTarget as UploadItemRef).focus();\n }, 0);\n }\n }\n };\n\n return (\n <>\n <div\n role=\"group\"\n className={clsx('np-upload-input', className, { disabled })}\n {...inputAttributes}\n >\n <div\n className=\"np-upload-input__section\"\n aria-live=\"polite\"\n aria-relevant=\"all\"\n role=\"region\"\n >\n {uploadedFiles.map((file, index) => (\n <UploadItem\n key={file.id}\n ref={(el: UploadItemRef | null) => {\n if (\n el &&\n el.id !== markedFileForDelete?.id &&\n !fileRefs.some((ref) => ref && ref.id === el.id) &&\n el.status !== 'processing'\n ) {\n fileRefs.push(el);\n }\n }}\n file={file}\n singleFileUpload={!multiple}\n canDelete={\n (!!onDeleteFile || file.status === Status.FAILED) &&\n (!file.status || !PROGRESS_STATUSES.has(file.status))\n }\n onDelete={\n file.status === Status.FAILED\n ? async () => {\n setLastAttemptedDeleteId(file.id);\n await removeFile(file);\n handleRefocus();\n }\n : () => {\n setLastAttemptedDeleteId(file.id);\n setMarkedFileForDelete(file);\n }\n }\n onDownload={onDownload}\n onFocus={() => handleFocus(file.id)}\n />\n ))}\n </div>\n {(multiple || (!multiple && !uploadedFiles.length)) && (\n <div className=\"np-upload-input__section np-upload-input__section--uploader\">\n <UploadButton\n ref={uploadInputRef}\n id={id}\n uploadButtonTitle={uploadButtonTitle}\n disabled={areMaximumFilesUploadedAlready() || disabled}\n multiple={multiple}\n fileTypes={fileTypes}\n sizeLimit={sizeLimit}\n description={description}\n maxFiles={maxFiles}\n withEntries={Boolean(uploadedFiles.length)}\n onChange={addFiles}\n />\n </div>\n )}\n </div>\n <Modal\n title={\n deleteConfirm?.title !== undefined\n ? deleteConfirm.title\n : formatMessage(MESSAGES.deleteModalTitle)\n }\n body={\n deleteConfirm?.body !== undefined\n ? deleteConfirm.body\n : formatMessage(MESSAGES.deleteModalBody)\n }\n open={!!markedFileForDelete}\n footer={\n <>\n <Button\n block\n onClick={() => {\n setMarkedFileForDelete(null);\n }}\n >\n {deleteConfirm?.cancelText || formatMessage(MESSAGES.deleteModalCancelButtonText)}\n </Button>\n <Button\n block\n priority={Priority.SECONDARY}\n type={ControlType.NEGATIVE}\n tabIndex={markedFileForDelete ? 0 : -1}\n onClick={() => {\n if (markedFileForDelete) {\n void removeFile(markedFileForDelete);\n }\n setMarkedFileForDelete(null);\n setLastAttemptedDeleteId(null);\n }}\n >\n {deleteConfirm?.confirmText || formatMessage(MESSAGES.deleteModalConfirmButtonText)}\n </Button>\n </>\n }\n onUnmount={handleRefocus}\n onClose={() => {\n setMarkedFileForDelete(null);\n }}\n />\n </>\n );\n};\n\nexport default UploadInput;\n"],"names":["generateFileId","file","name","size","uploadTimeStamp","Date","getTime","UploadInput","files","fileInputName","className","deleteConfirm","disabled","multiple","fileTypes","imageFileTypes","sizeLimit","DEFAULT_SIZE_LIMIT","description","onUploadFile","onDeleteFile","onValidationError","onFilesChange","onDownload","maxFiles","maxFilesErrorMessage","id","sizeLimitErrorMessage","uploadButtonTitle","inputAttributes","useInputAttributes","nonLabelable","markedFileForDelete","setMarkedFileForDelete","useState","lastAttemptedDeleteId","setLastAttemptedDeleteId","mounted","setMounted","formatMessage","useIntl","uploadInputRef","useRef","fileRefs","PROGRESS_STATUSES","Set","Status","PENDING","PROCESSING","uploadedFiles","setUploadedFiles","length","uploadedFilesListReference","updateFileList","updateFn","current","addFileToList","recentUploadedFile","list","removeFileFromList","filter","fileInList","ref","modifyFileInList","updates","map","removeFile","status","item","FAILED","Promise","resolve","error","undefined","then","catch","handleFileUploadFailure","failureMessage","failedUpload","filename","getNumberOfFilesUploaded","uploadInitiatedStatus","SUCCEEDED","validFiles","has","areMaximumFilesUploadedAlready","numberOfValidFiles","addFiles","selectedFiles","i","formData","FormData","allowedFileTypes","join","isTypeValid","MESSAGES","fileTypeNotSupported","isSizeValid","fileIsTooLarge","maximumFilesAlreadyUploaded","maxFilesAllowed","existingFile","find","f","append","pendingFile","url","useEffect","nextFocusable","setNextFocusable","handleFocus","fileId","filesCount","next","focusTarget","currentFileIndex","findIndex","currentFileId","lastFileId","fileObj","DONE","focus","target","handleRefocus","setTimeout","_jsxs","_Fragment","children","role","clsx","_jsx","index","UploadItem","el","some","push","singleFileUpload","canDelete","onDelete","onFocus","UploadButton","withEntries","Boolean","onChange","Modal","title","deleteModalTitle","body","deleteModalBody","open","footer","Button","block","onClick","cancelText","deleteModalCancelButtonText","priority","Priority","SECONDARY","type","ControlType","NEGATIVE","tabIndex","confirmText","deleteModalConfirmButtonText","onUnmount","onClose"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6HA,SAASA,cAAcA,CAACC,IAAU,EAAA;EAChC,MAAM;IAAEC,IAAI;AAAEC,IAAAA;AAAM,GAAA,GAAGF,IAAI;EAC3B,MAAMG,eAAe,GAAG,IAAIC,IAAI,EAAE,CAACC,OAAO,EAAE;AAC5C,EAAA,OAAO,GAAGJ,IAAI,CAAA,CAAA,EAAIC,IAAI,CAAA,CAAA,EAAIC,eAAe,CAAE,CAAA;AAC7C;AAEA;;;;;;;;AAQG;AACGG,MAAAA,WAAW,GAAGA,CAAC;AACnBC,EAAAA,KAAK,GAAG,EAAE;AACVC,EAAAA,aAAa,GAAG,MAAM;EACtBC,SAAS;EACTC,aAAa;EACbC,QAAQ;AACRC,EAAAA,QAAQ,GAAG,KAAK;AAChBC,EAAAA,SAAS,GAA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,CAAC,IAAI,CAAC;YAC5BG,wBAAwB,CAAC,IAAI,CAAC;WAC9B;UAAA2F,QAAA,EAEDpH,aAAa,EAAEwJ,WAAW,IAAI5H,aAAa,CAACwD,QAAQ,CAACqE,4BAA4B;AAAC,SAC7E,CACV;AAAA,OAAA,CACD;AACDC,MAAAA,SAAS,EAAE1C,aAAc;MACzB2C,OAAO,EAAEA,MAAK;QACZrI,sBAAsB,CAAC,IAAI,CAAC;AAC9B;AAAE,KAEN,CAAA;AAAA,GAAA,CAAG;AAEP;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transferwise/components",
|
|
3
|
-
"version": "46.
|
|
3
|
+
"version": "46.99.0",
|
|
4
4
|
"description": "Neptune React components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
"!**/*.tsbuildinfo"
|
|
39
39
|
],
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@babel/core": "^7.27.
|
|
42
|
-
"@babel/plugin-transform-runtime": "^7.27.
|
|
41
|
+
"@babel/core": "^7.27.4",
|
|
42
|
+
"@babel/plugin-transform-runtime": "^7.27.4",
|
|
43
43
|
"@babel/preset-env": "^7.27.2",
|
|
44
44
|
"@babel/preset-react": "^7.27.1",
|
|
45
45
|
"@babel/preset-typescript": "^7.27.1",
|
|
46
|
-
"@formatjs/cli": "^6.7.
|
|
46
|
+
"@formatjs/cli": "^6.7.2",
|
|
47
47
|
"@rollup/plugin-babel": "^6.0.4",
|
|
48
48
|
"@rollup/plugin-json": "^6.1.0",
|
|
49
49
|
"@rollup/plugin-node-resolve": "^15.3.1",
|
|
@@ -78,23 +78,23 @@
|
|
|
78
78
|
"@types/react": "^18.3.23",
|
|
79
79
|
"@types/react-dom": "^18.3.7",
|
|
80
80
|
"@types/react-transition-group": "4.4.12",
|
|
81
|
-
"@wise/art": "^2.21.
|
|
81
|
+
"@wise/art": "^2.21.2",
|
|
82
82
|
"@wise/eslint-config": "^12.3.0",
|
|
83
|
-
"babel-plugin-formatjs": "^10.5.
|
|
83
|
+
"babel-plugin-formatjs": "^10.5.39",
|
|
84
84
|
"eslint": "^9.27.0",
|
|
85
|
-
"gulp": "^5.0.
|
|
85
|
+
"gulp": "^5.0.1",
|
|
86
86
|
"jest": "^29.7.0",
|
|
87
87
|
"jest-environment-jsdom": "^29.7.0",
|
|
88
88
|
"jest-fetch-mock": "^3.0.3",
|
|
89
89
|
"lodash.times": "^4.3.2",
|
|
90
90
|
"react-intl": "^7.1.11",
|
|
91
|
-
"rollup": "^4.
|
|
91
|
+
"rollup": "^4.43.0",
|
|
92
92
|
"rollup-preserve-directives": "^1.1.3",
|
|
93
93
|
"storybook": "^8.6.14",
|
|
94
94
|
"@transferwise/less-config": "3.1.2",
|
|
95
|
-
"@
|
|
95
|
+
"@transferwise/neptune-css": "14.24.4",
|
|
96
96
|
"@wise/wds-configs": "0.0.0",
|
|
97
|
-
"@
|
|
97
|
+
"@wise/components-theming": "1.6.3"
|
|
98
98
|
},
|
|
99
99
|
"peerDependencies": {
|
|
100
100
|
"@transferwise/icons": "^3.22.0",
|
|
@@ -106,18 +106,18 @@
|
|
|
106
106
|
"react-intl": "^5.10.0 || ^6"
|
|
107
107
|
},
|
|
108
108
|
"dependencies": {
|
|
109
|
-
"@babel/runtime": "^7.27.
|
|
109
|
+
"@babel/runtime": "^7.27.6",
|
|
110
110
|
"@floating-ui/react": "^0.27.9",
|
|
111
111
|
"@headlessui/react": "^1.7.19",
|
|
112
112
|
"@popperjs/core": "^2.11.8",
|
|
113
|
-
"@react-aria/focus": "^3.20.
|
|
114
|
-
"@react-aria/overlays": "^3.27.
|
|
113
|
+
"@react-aria/focus": "^3.20.5",
|
|
114
|
+
"@react-aria/overlays": "^3.27.3",
|
|
115
115
|
"@react-spring/web": "~10.0.1",
|
|
116
116
|
"@transferwise/formatting": "^2.13.1",
|
|
117
117
|
"@transferwise/neptune-validation": "^3.3.0",
|
|
118
118
|
"clsx": "^2.1.1",
|
|
119
119
|
"commonmark": "^0.31.2",
|
|
120
|
-
"core-js": "^3.
|
|
120
|
+
"core-js": "^3.43.0",
|
|
121
121
|
"lodash.clamp": "^4.0.3",
|
|
122
122
|
"lodash.debounce": "^4.0.8",
|
|
123
123
|
"merge-props": "^6.0.0",
|
package/src/body/Body.spec.tsx
CHANGED
|
@@ -32,6 +32,14 @@ describe('Body', () => {
|
|
|
32
32
|
expect(copy).toHaveAttribute('role', 'banner');
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
+
it('renders newlines as line breaks when preserveNewlines is true', () => {
|
|
36
|
+
render(<Body preserveNewlines>{'Line 1.\nLine 2'}</Body>);
|
|
37
|
+
const copy = screen.getByText(/Line 1\.\s*Line 2/);
|
|
38
|
+
expect(copy).toHaveClass('np-text--pre-line');
|
|
39
|
+
expect(copy).toHaveTextContent('Line 1.');
|
|
40
|
+
expect(copy).toHaveTextContent('Line 2');
|
|
41
|
+
});
|
|
42
|
+
|
|
35
43
|
it('handles unsupported typography type', () => {
|
|
36
44
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
37
45
|
// @ts-expect-error
|
package/src/body/Body.story.tsx
CHANGED
|
@@ -18,6 +18,9 @@ export const Basic = () => {
|
|
|
18
18
|
We’re building the world’s most <strong>international account</strong>. We’re building the
|
|
19
19
|
world’s most <b>international account</b>.
|
|
20
20
|
</Body>
|
|
21
|
+
<Body as="p" type={Typography.BODY_LARGE_BOLD} preserveNewlines>
|
|
22
|
+
{'This is line one.\nThis is line two.'}
|
|
23
|
+
</Body>
|
|
21
24
|
<Body as="p" type={Typography.BODY_LARGE_BOLD}>
|
|
22
25
|
Ми будуємо найбільш <strong>міжнародний рахунок у світі</strong>. Ми будуємо найбільш{' '}
|
|
23
26
|
<b>міжнародний рахунок у світі</b>.
|
|
@@ -40,6 +43,9 @@ export const Basic = () => {
|
|
|
40
43
|
We’re building the world’s most <strong>international account</strong>. We’re building the
|
|
41
44
|
world’s most <b>international account</b>.
|
|
42
45
|
</Body>
|
|
46
|
+
<Body as="p" preserveNewlines>
|
|
47
|
+
{'This is line one.\nThis is line two.'}
|
|
48
|
+
</Body>
|
|
43
49
|
<Body as="p" type={Typography.BODY_DEFAULT}>
|
|
44
50
|
Ми будуємо найбільш <strong>міжнародний рахунок у світі</strong>. Ми будуємо найбільш{' '}
|
|
45
51
|
<b>міжнародний рахунок у світі</b>.
|
|
@@ -62,6 +68,9 @@ export const Basic = () => {
|
|
|
62
68
|
We’re building the world’s most <strong>international account</strong>. We’re building the
|
|
63
69
|
world’s most <b>international account</b>.
|
|
64
70
|
</Body>
|
|
71
|
+
<Body as="p" type={Typography.BODY_DEFAULT_BOLD} preserveNewlines>
|
|
72
|
+
{'This is line one.\nThis is line two.'}
|
|
73
|
+
</Body>
|
|
65
74
|
<Body as="p" type={Typography.BODY_DEFAULT_BOLD}>
|
|
66
75
|
Ми будуємо найбільш <strong>міжнародний рахунок у світі</strong>. Ми будуємо найбільш{' '}
|
|
67
76
|
<b>міжнародний рахунок у світі</b>.
|
|
@@ -84,6 +93,9 @@ export const Basic = () => {
|
|
|
84
93
|
We’re building the world’s most <strong>international account</strong>. We’re building the
|
|
85
94
|
world’s most <b>international account</b>.
|
|
86
95
|
</Body>
|
|
96
|
+
<Body as="p" type={Typography.BODY_LARGE} preserveNewlines>
|
|
97
|
+
{'This is line one.\nThis is line two.'}
|
|
98
|
+
</Body>
|
|
87
99
|
<Body as="p" type={Typography.BODY_LARGE}>
|
|
88
100
|
Ми будуємо найбільш <strong>міжнародний рахунок у світі</strong>. Ми будуємо найбільш{' '}
|
|
89
101
|
<b>міжнародний рахунок у світі</b>.
|
package/src/body/Body.tsx
CHANGED
|
@@ -21,10 +21,15 @@ type Props = HTMLAttributes<HTMLSpanElement | HTMLParagraphElement> & {
|
|
|
21
21
|
* Default value: `div`
|
|
22
22
|
*/
|
|
23
23
|
as?: 'span' | 'p' | 'div';
|
|
24
|
+
/**
|
|
25
|
+
* When true, preserves newline characters in the text
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
preserveNewlines?: boolean;
|
|
24
29
|
};
|
|
25
30
|
|
|
26
31
|
const Body = forwardRef(function Body(
|
|
27
|
-
{ as: Element = 'div', type = DEFAULT_TYPE, className, ...props }: Props,
|
|
32
|
+
{ as: Element = 'div', type = DEFAULT_TYPE, className, preserveNewlines, ...props }: Props,
|
|
28
33
|
reference: React.ForwardedRef<
|
|
29
34
|
| {
|
|
30
35
|
[key in typeof Element]: React.ElementRef<key>;
|
|
@@ -39,7 +44,11 @@ const Body = forwardRef(function Body(
|
|
|
39
44
|
// @ts-expect-error TODO: Remove when component could be rewritten with generics
|
|
40
45
|
// See: https://fettblog.eu/typescript-react-generic-forward-refs/
|
|
41
46
|
ref={reference}
|
|
42
|
-
className={clsx(
|
|
47
|
+
className={clsx(
|
|
48
|
+
`np-text-${isTypeSupported ? type : DEFAULT_TYPE}`,
|
|
49
|
+
preserveNewlines && 'np-text--pre-line',
|
|
50
|
+
className,
|
|
51
|
+
)}
|
|
43
52
|
/>
|
|
44
53
|
);
|
|
45
54
|
});
|
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
.
|
|
1
|
+
.tw-date label {
|
|
2
2
|
width: 100%;
|
|
3
|
+
}
|
|
4
|
+
.tw-date .tw-date--year label {
|
|
5
|
+
margin-bottom: 0;
|
|
6
|
+
}
|
|
7
|
+
.tw-date .tw-date--year,
|
|
8
|
+
.tw-date .tw-date--month,
|
|
9
|
+
.tw-date .tw-date--day {
|
|
3
10
|
margin-bottom: 0;
|
|
4
11
|
}
|
|
12
|
+
@media (min-width: 576px) {
|
|
13
|
+
.np-theme-personal .tw-date label {
|
|
14
|
+
margin-bottom: 0;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -1,8 +1,25 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
1
|
+
.tw-date {
|
|
2
|
+
label {
|
|
3
|
+
width: 100%;
|
|
4
|
+
}
|
|
5
|
+
.tw-date--year {
|
|
3
6
|
label {
|
|
4
|
-
width: 100%;
|
|
5
7
|
margin-bottom: 0;
|
|
6
8
|
}
|
|
7
9
|
}
|
|
10
|
+
.tw-date--year,
|
|
11
|
+
.tw-date--month,
|
|
12
|
+
.tw-date--day {
|
|
13
|
+
margin-bottom: 0;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@media (--screen-sm) {
|
|
18
|
+
.np-theme-personal {
|
|
19
|
+
.tw-date {
|
|
20
|
+
label {
|
|
21
|
+
margin-bottom: 0;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
8
25
|
}
|
|
@@ -48,11 +48,22 @@ export const WithLabel: Story = {
|
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
export const InputError: Story = {
|
|
51
|
-
...Basic,
|
|
52
51
|
render: (args) => (
|
|
53
|
-
|
|
52
|
+
<>
|
|
53
|
+
pure date input:
|
|
54
54
|
<DateInput {...args} value={new Date('2010-04-05')} />
|
|
55
|
-
|
|
55
|
+
<div className="p-b-3">show padding right below</div>
|
|
56
|
+
date input wrapped in Field:
|
|
57
|
+
<Field>
|
|
58
|
+
<DateInput {...args} value={new Date('2010-04-05')} />
|
|
59
|
+
</Field>
|
|
60
|
+
<div className="p-b-3">show padding right below</div>
|
|
61
|
+
error date input wrapped in Field:
|
|
62
|
+
<Field sentiment="negative" message={lorem10}>
|
|
63
|
+
<DateInput {...args} value={new Date('2010-04-05')} />
|
|
64
|
+
</Field>
|
|
65
|
+
<div className="p-b-3">show padding right below</div>
|
|
66
|
+
</>
|
|
56
67
|
),
|
|
57
68
|
};
|
|
58
69
|
|
|
@@ -242,8 +242,8 @@ const DateInput = ({
|
|
|
242
242
|
const monthYearOnly = mode === DateMode.MONTH_YEAR;
|
|
243
243
|
|
|
244
244
|
const monthWidth = clsx({
|
|
245
|
-
'col-sm-8': monthYearOnly,
|
|
246
|
-
'col-sm-5': !monthYearOnly,
|
|
245
|
+
'col-sm-8 tw-date--month': monthYearOnly,
|
|
246
|
+
'col-sm-5 tw-date--month': !monthYearOnly,
|
|
247
247
|
});
|
|
248
248
|
|
|
249
249
|
const getMonth = () => {
|
|
@@ -252,7 +252,7 @@ const DateInput = ({
|
|
|
252
252
|
|
|
253
253
|
const getDay = () => {
|
|
254
254
|
return (
|
|
255
|
-
<div className="col-sm-3">
|
|
255
|
+
<div className="col-sm-3 tw-date--day">
|
|
256
256
|
<label>
|
|
257
257
|
<Body type={Typography.BODY_DEFAULT}>{dayLabel}</Body>
|
|
258
258
|
<div className={`input-group input-group-${size}`}>
|
|
@@ -279,7 +279,7 @@ const DateInput = ({
|
|
|
279
279
|
|
|
280
280
|
const getYear = () => {
|
|
281
281
|
return (
|
|
282
|
-
<div className="col-sm-4">
|
|
282
|
+
<div className="col-sm-4 tw-date--year">
|
|
283
283
|
<label>
|
|
284
284
|
<Body type={Typography.BODY_DEFAULT}>{yearLabel}</Body>
|
|
285
285
|
<div className={`input-group input-group-${size}`}>
|
package/src/i18n/cs.json
CHANGED
|
@@ -28,8 +28,6 @@
|
|
|
28
28
|
"neptune.PhoneNumberInput.phoneNumberLabel": "Telefonní číslo",
|
|
29
29
|
"neptune.Select.searchPlaceholder": "Hledat...",
|
|
30
30
|
"neptune.SelectInput.noResultsFound": "Nebyly nalezeny žádné výsledky",
|
|
31
|
-
"neptune.SelectOption.action.label": "Vybrat",
|
|
32
|
-
"neptune.SelectOption.selected.action.label": "Změnit zvolenou možnost",
|
|
33
31
|
"neptune.StatusIcon.iconLabel.error": "Chyba:",
|
|
34
32
|
"neptune.StatusIcon.iconLabel.information": "Informace:",
|
|
35
33
|
"neptune.StatusIcon.iconLabel.pending": "Vyřizuje se:",
|
package/src/i18n/de.json
CHANGED
|
@@ -28,8 +28,6 @@
|
|
|
28
28
|
"neptune.PhoneNumberInput.phoneNumberLabel": "Telefonnummer",
|
|
29
29
|
"neptune.Select.searchPlaceholder": "Wird gesucht...",
|
|
30
30
|
"neptune.SelectInput.noResultsFound": "Keine Ergebnisse gefunden",
|
|
31
|
-
"neptune.SelectOption.action.label": "Auswählen",
|
|
32
|
-
"neptune.SelectOption.selected.action.label": "Ausgewählte Option ändern",
|
|
33
31
|
"neptune.StatusIcon.iconLabel.error": "Fehler:",
|
|
34
32
|
"neptune.StatusIcon.iconLabel.information": "Auskünfte:",
|
|
35
33
|
"neptune.StatusIcon.iconLabel.pending": "Ausstehend:",
|
package/src/i18n/en.json
CHANGED
|
@@ -28,8 +28,6 @@
|
|
|
28
28
|
"neptune.PhoneNumberInput.phoneNumberLabel": "Phone number",
|
|
29
29
|
"neptune.Select.searchPlaceholder": "Search...",
|
|
30
30
|
"neptune.SelectInput.noResultsFound": "No results found",
|
|
31
|
-
"neptune.SelectOption.action.label": "Choose",
|
|
32
|
-
"neptune.SelectOption.selected.action.label": "Change chosen option",
|
|
33
31
|
"neptune.StatusIcon.iconLabel.error": "Error:",
|
|
34
32
|
"neptune.StatusIcon.iconLabel.information": "Information:",
|
|
35
33
|
"neptune.StatusIcon.iconLabel.pending": "Pending:",
|
package/src/i18n/es.json
CHANGED
|
@@ -28,8 +28,6 @@
|
|
|
28
28
|
"neptune.PhoneNumberInput.phoneNumberLabel": "Número de teléfono",
|
|
29
29
|
"neptune.Select.searchPlaceholder": "Buscar...",
|
|
30
30
|
"neptune.SelectInput.noResultsFound": "No se han encontrado resultados",
|
|
31
|
-
"neptune.SelectOption.action.label": "Elegir",
|
|
32
|
-
"neptune.SelectOption.selected.action.label": "Cambiar opción elegida",
|
|
33
31
|
"neptune.StatusIcon.iconLabel.error": "Error:",
|
|
34
32
|
"neptune.StatusIcon.iconLabel.information": "Información:",
|
|
35
33
|
"neptune.StatusIcon.iconLabel.pending": "Pendiente:",
|
package/src/i18n/fr.json
CHANGED
|
@@ -28,8 +28,6 @@
|
|
|
28
28
|
"neptune.PhoneNumberInput.phoneNumberLabel": "Numéro de téléphone",
|
|
29
29
|
"neptune.Select.searchPlaceholder": "Recherche...",
|
|
30
30
|
"neptune.SelectInput.noResultsFound": "Aucun résultat trouvé",
|
|
31
|
-
"neptune.SelectOption.action.label": "Sélectionner",
|
|
32
|
-
"neptune.SelectOption.selected.action.label": "Modifier l'option choisie",
|
|
33
31
|
"neptune.StatusIcon.iconLabel.error": "Erreur :",
|
|
34
32
|
"neptune.StatusIcon.iconLabel.information": "Informations :",
|
|
35
33
|
"neptune.StatusIcon.iconLabel.pending": "En attente :",
|
package/src/i18n/hu.json
CHANGED
|
@@ -28,8 +28,6 @@
|
|
|
28
28
|
"neptune.PhoneNumberInput.phoneNumberLabel": "Telefonszám",
|
|
29
29
|
"neptune.Select.searchPlaceholder": "Keresés...",
|
|
30
30
|
"neptune.SelectInput.noResultsFound": "Nincs találat",
|
|
31
|
-
"neptune.SelectOption.action.label": "Kiválasztás",
|
|
32
|
-
"neptune.SelectOption.selected.action.label": "Kiválasztott opció módosítása",
|
|
33
31
|
"neptune.StatusIcon.iconLabel.error": "Hiba:",
|
|
34
32
|
"neptune.StatusIcon.iconLabel.information": "Információ:",
|
|
35
33
|
"neptune.StatusIcon.iconLabel.pending": "Függőben:",
|
package/src/i18n/id.json
CHANGED
|
@@ -28,8 +28,6 @@
|
|
|
28
28
|
"neptune.PhoneNumberInput.phoneNumberLabel": "Nomor telepon",
|
|
29
29
|
"neptune.Select.searchPlaceholder": "Cari...",
|
|
30
30
|
"neptune.SelectInput.noResultsFound": "Hasil tidak ditemukan",
|
|
31
|
-
"neptune.SelectOption.action.label": "Pilih",
|
|
32
|
-
"neptune.SelectOption.selected.action.label": "Ubah opsi yang dipilih",
|
|
33
31
|
"neptune.StatusIcon.iconLabel.error": "Kesalahan:",
|
|
34
32
|
"neptune.StatusIcon.iconLabel.information": "Informasi:",
|
|
35
33
|
"neptune.StatusIcon.iconLabel.pending": "Tertunda:",
|
package/src/i18n/it.json
CHANGED
|
@@ -28,8 +28,6 @@
|
|
|
28
28
|
"neptune.PhoneNumberInput.phoneNumberLabel": "Numero di telefono",
|
|
29
29
|
"neptune.Select.searchPlaceholder": "Cerca...",
|
|
30
30
|
"neptune.SelectInput.noResultsFound": "Nessun risultato trovato",
|
|
31
|
-
"neptune.SelectOption.action.label": "Scegli",
|
|
32
|
-
"neptune.SelectOption.selected.action.label": "Modifica l'opzione scelta",
|
|
33
31
|
"neptune.StatusIcon.iconLabel.error": "Errore:",
|
|
34
32
|
"neptune.StatusIcon.iconLabel.information": "Informazioni:",
|
|
35
33
|
"neptune.StatusIcon.iconLabel.pending": "In attesa:",
|
package/src/i18n/ja.json
CHANGED
|
@@ -28,8 +28,6 @@
|
|
|
28
28
|
"neptune.PhoneNumberInput.phoneNumberLabel": "電話番号",
|
|
29
29
|
"neptune.Select.searchPlaceholder": "検索する... ",
|
|
30
30
|
"neptune.SelectInput.noResultsFound": "結果が見つかりませんでした",
|
|
31
|
-
"neptune.SelectOption.action.label": "選択してください",
|
|
32
|
-
"neptune.SelectOption.selected.action.label": "選択したオプションを変更する",
|
|
33
31
|
"neptune.StatusIcon.iconLabel.error": "エラー:",
|
|
34
32
|
"neptune.StatusIcon.iconLabel.information": "情報:",
|
|
35
33
|
"neptune.StatusIcon.iconLabel.pending": "保留中:",
|
package/src/i18n/nl.json
CHANGED
|
@@ -28,8 +28,6 @@
|
|
|
28
28
|
"neptune.PhoneNumberInput.phoneNumberLabel": "Telefoonnummer",
|
|
29
29
|
"neptune.Select.searchPlaceholder": "Zoeken...",
|
|
30
30
|
"neptune.SelectInput.noResultsFound": "Geen resultaten gevonden",
|
|
31
|
-
"neptune.SelectOption.action.label": "Kiezen",
|
|
32
|
-
"neptune.SelectOption.selected.action.label": "Gekozen optie wijzigen",
|
|
33
31
|
"neptune.StatusIcon.iconLabel.error": "Fout:",
|
|
34
32
|
"neptune.StatusIcon.iconLabel.information": "Informatie:",
|
|
35
33
|
"neptune.StatusIcon.iconLabel.pending": "In behandeling:",
|
package/src/i18n/pl.json
CHANGED
|
@@ -28,8 +28,6 @@
|
|
|
28
28
|
"neptune.PhoneNumberInput.phoneNumberLabel": "Numer telefonu",
|
|
29
29
|
"neptune.Select.searchPlaceholder": "Wyszukaj...",
|
|
30
30
|
"neptune.SelectInput.noResultsFound": "Nie znaleziono wyników",
|
|
31
|
-
"neptune.SelectOption.action.label": "Wybierz",
|
|
32
|
-
"neptune.SelectOption.selected.action.label": "Zmień wybraną opcję",
|
|
33
31
|
"neptune.StatusIcon.iconLabel.error": "Błąd:",
|
|
34
32
|
"neptune.StatusIcon.iconLabel.information": "Informacje:",
|
|
35
33
|
"neptune.StatusIcon.iconLabel.pending": "W toku:",
|
package/src/i18n/pt.json
CHANGED
|
@@ -28,8 +28,6 @@
|
|
|
28
28
|
"neptune.PhoneNumberInput.phoneNumberLabel": "Número de telefone",
|
|
29
29
|
"neptune.Select.searchPlaceholder": "Buscar...",
|
|
30
30
|
"neptune.SelectInput.noResultsFound": "Nenhum resultado encontrado",
|
|
31
|
-
"neptune.SelectOption.action.label": "Selecionar",
|
|
32
|
-
"neptune.SelectOption.selected.action.label": "Altere a opção escolhida",
|
|
33
31
|
"neptune.StatusIcon.iconLabel.error": "Erro:",
|
|
34
32
|
"neptune.StatusIcon.iconLabel.information": "Informação:",
|
|
35
33
|
"neptune.StatusIcon.iconLabel.pending": "Pendente:",
|
package/src/i18n/ro.json
CHANGED
|
@@ -28,8 +28,6 @@
|
|
|
28
28
|
"neptune.PhoneNumberInput.phoneNumberLabel": "Număr de telefon",
|
|
29
29
|
"neptune.Select.searchPlaceholder": "Caută...",
|
|
30
30
|
"neptune.SelectInput.noResultsFound": "Nu s-a găsit niciun rezultat",
|
|
31
|
-
"neptune.SelectOption.action.label": "Alege",
|
|
32
|
-
"neptune.SelectOption.selected.action.label": "Schimbă opțiunea aleasă",
|
|
33
31
|
"neptune.StatusIcon.iconLabel.error": "Eroare:",
|
|
34
32
|
"neptune.StatusIcon.iconLabel.information": "Informații:",
|
|
35
33
|
"neptune.StatusIcon.iconLabel.pending": "În așteptare:",
|
package/src/i18n/ru.json
CHANGED
|
@@ -28,8 +28,6 @@
|
|
|
28
28
|
"neptune.PhoneNumberInput.phoneNumberLabel": "Номер телефона",
|
|
29
29
|
"neptune.Select.searchPlaceholder": "Поиск...",
|
|
30
30
|
"neptune.SelectInput.noResultsFound": "Ничего не найдено",
|
|
31
|
-
"neptune.SelectOption.action.label": "Выбрать",
|
|
32
|
-
"neptune.SelectOption.selected.action.label": "Изменить выбранный вариант",
|
|
33
31
|
"neptune.StatusIcon.iconLabel.error": "Ошибка:",
|
|
34
32
|
"neptune.StatusIcon.iconLabel.information": "Информация:",
|
|
35
33
|
"neptune.StatusIcon.iconLabel.pending": "В ожидании:",
|
package/src/i18n/th.json
CHANGED
|
@@ -28,8 +28,6 @@
|
|
|
28
28
|
"neptune.PhoneNumberInput.phoneNumberLabel": "หมายเลขโทรศัพท์",
|
|
29
29
|
"neptune.Select.searchPlaceholder": "ค้นหา...",
|
|
30
30
|
"neptune.SelectInput.noResultsFound": "ไม่พบผลลัพธ์",
|
|
31
|
-
"neptune.SelectOption.action.label": "เลือก",
|
|
32
|
-
"neptune.SelectOption.selected.action.label": "เปลี่ยนตัวเลือกที่เลือกไว้",
|
|
33
31
|
"neptune.StatusIcon.iconLabel.error": "ข้อผิดพลาด:",
|
|
34
32
|
"neptune.StatusIcon.iconLabel.information": "ข้อมูล:",
|
|
35
33
|
"neptune.StatusIcon.iconLabel.pending": "รอดำเนินการ:",
|
package/src/i18n/tr.json
CHANGED
|
@@ -28,8 +28,6 @@
|
|
|
28
28
|
"neptune.PhoneNumberInput.phoneNumberLabel": "Telefon numarası",
|
|
29
29
|
"neptune.Select.searchPlaceholder": "Ara...",
|
|
30
30
|
"neptune.SelectInput.noResultsFound": "Sonuç bulunamadı",
|
|
31
|
-
"neptune.SelectOption.action.label": "Seç",
|
|
32
|
-
"neptune.SelectOption.selected.action.label": "Seçilen opsiyonu değiştir",
|
|
33
31
|
"neptune.StatusIcon.iconLabel.error": "Hata:",
|
|
34
32
|
"neptune.StatusIcon.iconLabel.information": "Bilgi:",
|
|
35
33
|
"neptune.StatusIcon.iconLabel.pending": "Bekliyor:",
|
package/src/i18n/zh-CN.json
CHANGED
|
@@ -28,8 +28,6 @@
|
|
|
28
28
|
"neptune.PhoneNumberInput.phoneNumberLabel": "电话号码",
|
|
29
29
|
"neptune.Select.searchPlaceholder": "搜索",
|
|
30
30
|
"neptune.SelectInput.noResultsFound": "找不到结果",
|
|
31
|
-
"neptune.SelectOption.action.label": "选择",
|
|
32
|
-
"neptune.SelectOption.selected.action.label": "更改所选选项",
|
|
33
31
|
"neptune.StatusIcon.iconLabel.error": "错误:",
|
|
34
32
|
"neptune.StatusIcon.iconLabel.information": "信息:",
|
|
35
33
|
"neptune.StatusIcon.iconLabel.pending": "待处理:",
|
package/src/i18n/zh-HK.json
CHANGED
|
@@ -28,8 +28,6 @@
|
|
|
28
28
|
"neptune.PhoneNumberInput.phoneNumberLabel": "電話號碼",
|
|
29
29
|
"neptune.Select.searchPlaceholder": "搜尋…",
|
|
30
30
|
"neptune.SelectInput.noResultsFound": "找不到任何結果",
|
|
31
|
-
"neptune.SelectOption.action.label": "選擇",
|
|
32
|
-
"neptune.SelectOption.selected.action.label": "更改已選選項",
|
|
33
31
|
"neptune.StatusIcon.iconLabel.error": "錯誤:",
|
|
34
32
|
"neptune.StatusIcon.iconLabel.information": "資訊:",
|
|
35
33
|
"neptune.StatusIcon.iconLabel.pending": "處理中:",
|