@transferwise/components 0.0.0-experimental-5b64b75 → 0.0.0-experimental-702e2d3

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.
Files changed (612) hide show
  1. package/build/es/no-polyfill/accordion/Accordion.js +1 -1
  2. package/build/es/no-polyfill/accordion/Accordion.story.js +1 -1
  3. package/build/es/no-polyfill/accordion/AccordionItem/AccordionItem.js +1 -1
  4. package/build/es/no-polyfill/actionButton/ActionButton.js +1 -1
  5. package/build/es/no-polyfill/actionButton/ActionButton.spec.js +1 -1
  6. package/build/es/no-polyfill/actionButton/ActionButton.story.js +1 -1
  7. package/build/es/no-polyfill/actionOption/ActionOption.js +1 -1
  8. package/build/es/no-polyfill/actionOption/ActionOption.story.js +1 -1
  9. package/build/es/no-polyfill/alert/Alert.js +1 -1
  10. package/build/es/no-polyfill/alert/Alert.story.js +1 -1
  11. package/build/es/no-polyfill/alert/inlineMarkdown/InlineMarkdown.js +1 -1
  12. package/build/es/no-polyfill/alert/withArrow/alertArrowPositions.js +1 -1
  13. package/build/es/no-polyfill/alert/withArrow/withArrow.js +1 -1
  14. package/build/es/no-polyfill/avatar/Avatar.js +1 -1
  15. package/build/es/no-polyfill/avatar/Avatar.story.js +1 -1
  16. package/build/es/no-polyfill/avatar/avatarTypes.js +1 -1
  17. package/build/es/no-polyfill/avatar/colors/colors.js +2 -2
  18. package/build/es/no-polyfill/avatarWrapper/AvatarWrapper.js +1 -1
  19. package/build/es/no-polyfill/avatarWrapper/AvatarWrapper.story.js +1 -1
  20. package/build/es/no-polyfill/badge/Badge.js +1 -1
  21. package/build/es/no-polyfill/body/Body.js +2 -2
  22. package/build/es/no-polyfill/body/Body.spec.js +1 -1
  23. package/build/es/no-polyfill/body/Body.story.js +1 -1
  24. package/build/es/no-polyfill/button/Button.js +5 -5
  25. package/build/es/no-polyfill/button/Button.story.js +1 -1
  26. package/build/es/no-polyfill/button/classMap.js +1 -1
  27. package/build/es/no-polyfill/button/legacyUtils/legacyUtils.js +2 -2
  28. package/build/es/no-polyfill/card/Card.js +1 -1
  29. package/build/es/no-polyfill/checkbox/Checkbox.js +1 -1
  30. package/build/es/no-polyfill/checkbox/Checkbox.story.js +1 -1
  31. package/build/es/no-polyfill/checkboxButton/CheckboxButton.js +1 -1
  32. package/build/es/no-polyfill/checkboxButton/CheckboxButton.spec.js +1 -1
  33. package/build/es/no-polyfill/checkboxButton/CheckboxButton.story.js +2 -2
  34. package/build/es/no-polyfill/checkboxOption/CheckboxOption.js +1 -1
  35. package/build/es/no-polyfill/checkboxOption/CheckboxOption.spec.js +1 -1
  36. package/build/es/no-polyfill/checkboxOption/CheckboxOption.story.js +1 -1
  37. package/build/es/no-polyfill/chevron/Chevron.js +1 -1
  38. package/build/es/no-polyfill/chevron/Chevron.story.js +1 -1
  39. package/build/es/no-polyfill/chips/Chip.js +1 -1
  40. package/build/es/no-polyfill/chips/Chips.js +1 -1
  41. package/build/es/no-polyfill/chips/Chips.spec.js +1 -1
  42. package/build/es/no-polyfill/chips/Chips.story.js +1 -1
  43. package/build/es/no-polyfill/circularButton/CircularButton.js +1 -1
  44. package/build/es/no-polyfill/common/DOMOperations/DOMOperations.js +3 -3
  45. package/build/es/no-polyfill/common/Option/Option.js +1 -1
  46. package/build/es/no-polyfill/common/RadioButton/RadioButton.js +1 -1
  47. package/build/es/no-polyfill/common/bottomSheet/BottomSheet.js +4 -4
  48. package/build/es/no-polyfill/common/bottomSheet/BottomSheet.spec.js +1 -1
  49. package/build/es/no-polyfill/common/bottomSheet/BottomSheet.story.js +2 -2
  50. package/build/es/no-polyfill/common/closeButton/CloseButton.js +1 -1
  51. package/build/es/no-polyfill/common/dateUtils/getDayNames/getDayNames.js +2 -2
  52. package/build/es/no-polyfill/common/dateUtils/getMonthNames/getMonthNames.js +1 -1
  53. package/build/es/no-polyfill/common/dateUtils/isDateValid/isDateValid.js +1 -1
  54. package/build/es/no-polyfill/common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.js +1 -1
  55. package/build/es/no-polyfill/common/deviceDetection/deviceDetection.js +1 -1
  56. package/build/es/no-polyfill/common/direction.js +1 -1
  57. package/build/es/no-polyfill/common/domHelpers/index.js +1 -1
  58. package/build/es/no-polyfill/common/fakeEvents.js +1 -1
  59. package/build/es/no-polyfill/common/fileType.js +1 -1
  60. package/build/es/no-polyfill/common/flowHeader/FlowHeader.js +1 -1
  61. package/build/es/no-polyfill/common/focusBoundary/FocusBoundary.js +1 -1
  62. package/build/es/no-polyfill/common/focusBoundary/FocusBoundary.spec.js +1 -1
  63. package/build/es/no-polyfill/common/focusBoundary/utils/getFocusableElements.js +2 -2
  64. package/build/es/no-polyfill/common/focusBoundary/utils/resetFocus.js +1 -1
  65. package/build/es/no-polyfill/common/historyNavigator/historyNavigator.js +1 -1
  66. package/build/es/no-polyfill/common/hooks/useClientWidth/useClientWidth.js +3 -3
  67. package/build/es/no-polyfill/common/hooks/useConditionalListener/useConditionalListener.js +1 -1
  68. package/build/es/no-polyfill/common/hooks/useDirection/useDirection.js +1 -1
  69. package/build/es/no-polyfill/common/hooks/useHasIntersected/useHasIntersected.js +2 -2
  70. package/build/es/no-polyfill/common/hooks/useLayout/useLayout.js +1 -1
  71. package/build/es/no-polyfill/common/key.js +1 -1
  72. package/build/es/no-polyfill/common/locale/index.js +7 -7
  73. package/build/es/no-polyfill/common/panel/Panel.js +6 -6
  74. package/build/es/no-polyfill/common/propsValues/breakpoint.js +1 -1
  75. package/build/es/no-polyfill/common/propsValues/control.js +1 -1
  76. package/build/es/no-polyfill/common/propsValues/dateMode.js +1 -1
  77. package/build/es/no-polyfill/common/propsValues/layouts.js +1 -1
  78. package/build/es/no-polyfill/common/propsValues/markdownNodeType.js +1 -1
  79. package/build/es/no-polyfill/common/propsValues/monthFormat.js +1 -1
  80. package/build/es/no-polyfill/common/propsValues/position.js +1 -1
  81. package/build/es/no-polyfill/common/propsValues/profileType.js +1 -1
  82. package/build/es/no-polyfill/common/propsValues/scroll.js +1 -1
  83. package/build/es/no-polyfill/common/propsValues/sentiment.js +1 -1
  84. package/build/es/no-polyfill/common/propsValues/size.js +1 -1
  85. package/build/es/no-polyfill/common/propsValues/status.js +1 -1
  86. package/build/es/no-polyfill/common/propsValues/type.js +1 -1
  87. package/build/es/no-polyfill/common/propsValues/typography.js +1 -1
  88. package/build/es/no-polyfill/common/propsValues/variant.js +1 -1
  89. package/build/es/no-polyfill/common/propsValues/width.js +1 -1
  90. package/build/es/no-polyfill/common/requirements.js +2 -2
  91. package/build/es/no-polyfill/common/responsivePanel/ResponsivePanel.js +1 -1
  92. package/build/es/no-polyfill/common/textFormat/formatWithPattern/formatWithPattern.js +2 -2
  93. package/build/es/no-polyfill/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.js +1 -1
  94. package/build/es/no-polyfill/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js +1 -1
  95. package/build/es/no-polyfill/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js +1 -1
  96. package/build/es/no-polyfill/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js +1 -1
  97. package/build/es/no-polyfill/common/textFormat/unformatWithPattern/unformatWithPattern.js +1 -1
  98. package/build/es/no-polyfill/common/theme.js +1 -1
  99. package/build/es/no-polyfill/criticalBanner/CriticalCommsBanner.js +1 -1
  100. package/build/es/no-polyfill/criticalBanner/CriticalCommsBanner.story.js +1 -1
  101. package/build/es/no-polyfill/dateInput/DateInput.js +4 -10
  102. package/build/es/no-polyfill/dateInput/DateInput.story.js +1 -1
  103. package/build/es/no-polyfill/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.js +1 -1
  104. package/build/es/no-polyfill/dateInput/utils/explodeDate/explodeDate.js +1 -1
  105. package/build/es/no-polyfill/dateLookup/DateLookup.js +3 -4
  106. package/build/es/no-polyfill/dateLookup/dateHeader/DateHeader.js +1 -1
  107. package/build/es/no-polyfill/dateLookup/dateTrigger/DateTrigger.js +1 -1
  108. package/build/es/no-polyfill/dateLookup/dayCalendar/DayCalendar.js +1 -1
  109. package/build/es/no-polyfill/dateLookup/dayCalendar/table/DayCalendarTable.js +4 -5
  110. package/build/es/no-polyfill/dateLookup/monthCalendar/MonthCalendar.js +1 -1
  111. package/build/es/no-polyfill/dateLookup/monthCalendar/table/MonthCalendarTable.js +1 -1
  112. package/build/es/no-polyfill/dateLookup/tableLink/TableLink.js +1 -1
  113. package/build/es/no-polyfill/dateLookup/yearCalendar/YearCalendar.js +1 -1
  114. package/build/es/no-polyfill/dateLookup/yearCalendar/table/YearCalendarTable.js +1 -1
  115. package/build/es/no-polyfill/decision/Decision.js +5 -5
  116. package/build/es/no-polyfill/decision/decisionEnums.js +2 -2
  117. package/build/es/no-polyfill/definitionList/DefinitionList.js +1 -1
  118. package/build/es/no-polyfill/dimmer/Dimmer.js +3 -3
  119. package/build/es/no-polyfill/dimmer/Dimmer.story.js +2 -2
  120. package/build/es/no-polyfill/dimmer/dimmerManager/DimmerManager.js +3 -3
  121. package/build/es/no-polyfill/display/Display.js +1 -1
  122. package/build/es/no-polyfill/display/Display.story.js +2 -2
  123. package/build/es/no-polyfill/drawer/Drawer.js +1 -1
  124. package/build/es/no-polyfill/dropFade/DropFade.js +3 -3
  125. package/build/es/no-polyfill/dropFade/DropFade.story.js +1 -1
  126. package/build/es/no-polyfill/dynamicFieldDefinitionList/DynamicFieldDefinitionList.js +1 -1
  127. package/build/es/no-polyfill/dynamicFieldDefinitionList/FormattedValue/FormattedValue.js +1 -1
  128. package/build/es/no-polyfill/dynamicFieldDefinitionList/utils/createDefinitions.js +2 -2
  129. package/build/es/no-polyfill/dynamicFieldDefinitionList/utils/text-format.js +1 -1
  130. package/build/es/no-polyfill/emphasis/Emphasis.js +2 -2
  131. package/build/es/no-polyfill/emphasis/Emphasis.story.js +1 -1
  132. package/build/es/no-polyfill/emphasis/EmphasisHtmlTransformer.js +2 -2
  133. package/build/es/no-polyfill/flowNavigation/FlowNavigation.js +2 -2
  134. package/build/es/no-polyfill/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
  135. package/build/es/no-polyfill/flowNavigation/backButton/BackButton.js +1 -1
  136. package/build/es/no-polyfill/header/Header.js +2 -2
  137. package/build/es/no-polyfill/header/Header.spec.js +1 -1
  138. package/build/es/no-polyfill/header/Header.story.js +2 -1
  139. package/build/es/no-polyfill/i18n/index.js +1 -1
  140. package/build/es/no-polyfill/image/Image.js +2 -2
  141. package/build/es/no-polyfill/info/Info.js +1 -1
  142. package/build/es/no-polyfill/info/Info.story.js +1 -1
  143. package/build/es/no-polyfill/info/infoPresentations.js +1 -1
  144. package/build/es/no-polyfill/inlineAlert/InlineAlert.js +1 -1
  145. package/build/es/no-polyfill/inputWithDisplayFormat/InputWithDisplayFormat.js +1 -1
  146. package/build/es/no-polyfill/inputs/Input.js +1 -1
  147. package/build/es/no-polyfill/inputs/TextArea.js +1 -1
  148. package/build/es/no-polyfill/inputs/_common.js +2 -2
  149. package/build/es/no-polyfill/instructionsList/InstructionsList.js +3 -3
  150. package/build/es/no-polyfill/link/Link.js +2 -2
  151. package/build/es/no-polyfill/link/Link.spec.js +1 -1
  152. package/build/es/no-polyfill/link/Link.story.js +1 -1
  153. package/build/es/no-polyfill/listItem/ListItem.js +1 -1
  154. package/build/es/no-polyfill/listItem/ListItem.spec.js +1 -1
  155. package/build/es/no-polyfill/listItem/ListItem.story.js +1 -1
  156. package/build/es/no-polyfill/loader/Loader.js +2 -2
  157. package/build/es/no-polyfill/loader/Loader.story.js +1 -1
  158. package/build/es/no-polyfill/logo/Logo.js +1 -1
  159. package/build/es/no-polyfill/logo/Logo.story.js +1 -1
  160. package/build/es/no-polyfill/logo/logoTypes.js +1 -1
  161. package/build/es/no-polyfill/markdown/Markdown.js +1 -1
  162. package/build/es/no-polyfill/markdown/Markdown.story.js +1 -1
  163. package/build/es/no-polyfill/modal/Modal.js +1 -1
  164. package/build/es/no-polyfill/modal/Modal.story.js +2 -2
  165. package/build/es/no-polyfill/money/Money.js +1 -1
  166. package/build/es/no-polyfill/money/Money.story.js +1 -1
  167. package/build/es/no-polyfill/moneyInput/MoneyInput.js +1 -1
  168. package/build/es/no-polyfill/moneyInput/MoneyInput.story.js +1 -1
  169. package/build/es/no-polyfill/moneyInput/currencyFormatting.js +2 -2
  170. package/build/es/no-polyfill/navigationOption/NavigationOption.js +1 -1
  171. package/build/es/no-polyfill/navigationOptionsList/NavigationOptionsList.js +1 -1
  172. package/build/es/no-polyfill/nudge/Nudge.js +1 -1
  173. package/build/es/no-polyfill/overlayHeader/OverlayHeader.js +1 -1
  174. package/build/es/no-polyfill/phoneNumberInput/PhoneNumberInput.js +1 -1
  175. package/build/es/no-polyfill/phoneNumberInput/data/countries.js +1 -1
  176. package/build/es/no-polyfill/phoneNumberInput/utils/cleanNumber/cleanNumber.js +1 -1
  177. package/build/es/no-polyfill/phoneNumberInput/utils/excludeCountries/excludeCountries.js +2 -2
  178. package/build/es/no-polyfill/phoneNumberInput/utils/explodeNumberModel/index.js +1 -1
  179. package/build/es/no-polyfill/phoneNumberInput/utils/filterOptionsForQuery/index.js +1 -1
  180. package/build/es/no-polyfill/phoneNumberInput/utils/findCountryByCode/index.js +1 -1
  181. package/build/es/no-polyfill/phoneNumberInput/utils/findCountryByPrefix/index.js +1 -1
  182. package/build/es/no-polyfill/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.js +1 -1
  183. package/build/es/no-polyfill/phoneNumberInput/utils/isOptionAndFitsQuery/isOptionAndFitsQuery.js +1 -1
  184. package/build/es/no-polyfill/phoneNumberInput/utils/isStringNumeric/isStringNumeric.js +1 -1
  185. package/build/es/no-polyfill/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js +1 -1
  186. package/build/es/no-polyfill/phoneNumberInput/utils/longestMatchingPrefix/index.js +1 -1
  187. package/build/es/no-polyfill/phoneNumberInput/utils/setDefaultPrefix/index.js +2 -2
  188. package/build/es/no-polyfill/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.js +2 -2
  189. package/build/es/no-polyfill/popover/Popover.js +2 -2
  190. package/build/es/no-polyfill/processIndicator/ProcessIndicator.js +4 -4
  191. package/build/es/no-polyfill/processIndicator/ProcessIndicator.story.js +1 -1
  192. package/build/es/no-polyfill/progress/Progress.js +1 -1
  193. package/build/es/no-polyfill/progress/Progress.story.js +1 -1
  194. package/build/es/no-polyfill/progressBar/ProgressBar.js +1 -1
  195. package/build/es/no-polyfill/progressBar/ProgressBar.story.js +1 -1
  196. package/build/es/no-polyfill/provider/Provider.js +1 -1
  197. package/build/es/no-polyfill/provider/Provider.spec.js +1 -1
  198. package/build/es/no-polyfill/provider/Provider.story.js +1 -1
  199. package/build/es/no-polyfill/provider/direction/DirectionProvider.js +1 -1
  200. package/build/es/no-polyfill/provider/direction/DirectionProvider.spec.js +1 -1
  201. package/build/es/no-polyfill/provider/language/LanguageProvider.js +1 -1
  202. package/build/es/no-polyfill/provider/language/LanguageProvider.spec.js +1 -1
  203. package/build/es/no-polyfill/radio/Radio.js +1 -1
  204. package/build/es/no-polyfill/radioGroup/RadioGroup.js +2 -2
  205. package/build/es/no-polyfill/radioOption/RadioOption.js +1 -1
  206. package/build/es/no-polyfill/section/Section.js +1 -1
  207. package/build/es/no-polyfill/section/Section.spec.js +1 -1
  208. package/build/es/no-polyfill/section/Section.story.js +1 -1
  209. package/build/es/no-polyfill/select/Select.js +8 -9
  210. package/build/es/no-polyfill/select/option/Option.js +1 -1
  211. package/build/es/no-polyfill/select/searchBox/SearchBox.js +1 -1
  212. package/build/es/no-polyfill/sizeSwapper/SizeSwapper.js +3 -3
  213. package/build/es/no-polyfill/slidingPanel/SlidingPanel.js +1 -1
  214. package/build/es/no-polyfill/snackbar/Snackbar.js +1 -1
  215. package/build/es/no-polyfill/snackbar/SnackbarContext.js +1 -1
  216. package/build/es/no-polyfill/snackbar/SnackbarProvider.js +1 -1
  217. package/build/es/no-polyfill/snackbar/useSnackbar.js +1 -1
  218. package/build/es/no-polyfill/statusIcon/StatusIcon.js +1 -1
  219. package/build/es/no-polyfill/statusIcon/StatusIcon.story.js +1 -1
  220. package/build/es/no-polyfill/stepper/Stepper.js +1 -1
  221. package/build/es/no-polyfill/stepper/deviceDetection.js +2 -2
  222. package/build/es/no-polyfill/sticky/Sticky.js +1 -1
  223. package/build/es/no-polyfill/summary/Summary.js +1 -1
  224. package/build/es/no-polyfill/switch/Switch.js +1 -1
  225. package/build/es/no-polyfill/switch/Switch.story.js +1 -1
  226. package/build/es/no-polyfill/switchOption/SwitchOption.js +1 -1
  227. package/build/es/no-polyfill/switchOption/SwitchOption.story.js +1 -1
  228. package/build/es/no-polyfill/tabs/Tab.js +1 -1
  229. package/build/es/no-polyfill/tabs/TabList.js +1 -1
  230. package/build/es/no-polyfill/tabs/TabPanel.js +1 -1
  231. package/build/es/no-polyfill/tabs/Tabs.js +1 -5
  232. package/build/es/no-polyfill/tabs/utils.js +2 -2
  233. package/build/es/no-polyfill/textareaWithDisplayFormat/TextareaWithDisplayFormat.js +1 -1
  234. package/build/es/no-polyfill/tile/Tile.js +1 -1
  235. package/build/es/no-polyfill/title/Title.js +1 -1
  236. package/build/es/no-polyfill/title/Title.spec.js +1 -1
  237. package/build/es/no-polyfill/title/Title.story.js +1 -1
  238. package/build/es/no-polyfill/tooltip/Tooltip.js +7 -7
  239. package/build/es/no-polyfill/tooltip/Tooltip.spec.js +1 -1
  240. package/build/es/no-polyfill/tooltip/Tooltip.story.js +1 -1
  241. package/build/es/no-polyfill/typeahead/Typeahead.js +1 -1
  242. package/build/es/no-polyfill/typeahead/typeaheadInput/TypeaheadInput.js +1 -1
  243. package/build/es/no-polyfill/typeahead/typeaheadOption/TypeaheadOption.js +1 -1
  244. package/build/es/no-polyfill/typeahead/util/highlight.js +1 -1
  245. package/build/es/no-polyfill/upload/Upload.js +2 -6
  246. package/build/es/no-polyfill/upload/steps/completeStep/completeStep.js +1 -1
  247. package/build/es/no-polyfill/upload/steps/mediaUploadStep/mediaUploadStep.js +1 -1
  248. package/build/es/no-polyfill/upload/steps/processingStep/processingStep.js +1 -1
  249. package/build/es/no-polyfill/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
  250. package/build/es/no-polyfill/upload/uploadSteps.js +1 -1
  251. package/build/es/no-polyfill/upload/utils/asyncFileRead/asyncFileRead.js +1 -1
  252. package/build/es/no-polyfill/upload/utils/getFileType/getFileType.js +1 -1
  253. package/build/es/no-polyfill/upload/utils/getSupportedSpotMimeTypes/getSupportedSpotMimeTypes.js +1 -1
  254. package/build/es/no-polyfill/upload/utils/isSizeValid/isSizeValid.js +1 -1
  255. package/build/es/no-polyfill/upload/utils/isTypeValid/isTypeValid.js +1 -1
  256. package/build/es/no-polyfill/upload/utils/postData/postData.js +1 -1
  257. package/build/es/no-polyfill/upload/utils/requestMedia/requestMedia.js +1 -1
  258. package/build/es/no-polyfill/uploadInput/UploadInput.js +7 -7
  259. package/build/es/no-polyfill/uploadInput/UploadInput.spec.js +1 -1
  260. package/build/es/no-polyfill/uploadInput/UploadInput.story.js +1 -1
  261. package/build/es/no-polyfill/uploadInput/uploadButton/UploadButton.js +1 -1
  262. package/build/es/no-polyfill/uploadInput/uploadButton/UploadButton.spec.js +3 -3
  263. package/build/es/no-polyfill/uploadInput/uploadButton/defaults.js +1 -1
  264. package/build/es/no-polyfill/uploadInput/uploadButton/getAllowedFileTypes.js +3 -3
  265. package/build/es/no-polyfill/uploadInput/uploadButton/getAllowedFileTypes.spec.js +1 -1
  266. package/build/es/no-polyfill/uploadInput/uploadItem/UploadItem.js +2 -2
  267. package/build/es/no-polyfill/uploadInput/uploadItem/UploadItem.spec.js +1 -1
  268. package/build/es/no-polyfill/uploadInput/uploadItem/UploadItemBody.js +1 -1
  269. package/build/es/no-polyfill/utilities/deprecatedProperty/deprecatedProperty.js +1 -1
  270. package/build/es/no-polyfill/withDisplayFormat/WithDisplayFormat.js +3 -4
  271. package/build/es/no-polyfill/withNextPortal/withNextPortal.js +1 -1
  272. package/build/es/polyfill/accordion/Accordion.js +1 -1
  273. package/build/es/polyfill/accordion/Accordion.story.js +1 -1
  274. package/build/es/polyfill/accordion/AccordionItem/AccordionItem.js +1 -1
  275. package/build/es/polyfill/actionButton/ActionButton.js +1 -1
  276. package/build/es/polyfill/actionButton/ActionButton.spec.js +1 -1
  277. package/build/es/polyfill/actionButton/ActionButton.story.js +1 -1
  278. package/build/es/polyfill/actionOption/ActionOption.js +1 -1
  279. package/build/es/polyfill/actionOption/ActionOption.story.js +1 -1
  280. package/build/es/polyfill/alert/Alert.js +1 -1
  281. package/build/es/polyfill/alert/Alert.story.js +1 -1
  282. package/build/es/polyfill/alert/inlineMarkdown/InlineMarkdown.js +1 -1
  283. package/build/es/polyfill/alert/withArrow/alertArrowPositions.js +1 -1
  284. package/build/es/polyfill/alert/withArrow/withArrow.js +1 -1
  285. package/build/es/polyfill/avatar/Avatar.js +1 -1
  286. package/build/es/polyfill/avatar/Avatar.story.js +1 -1
  287. package/build/es/polyfill/avatar/avatarTypes.js +1 -1
  288. package/build/es/polyfill/avatar/colors/colors.js +2 -2
  289. package/build/es/polyfill/avatarWrapper/AvatarWrapper.js +1 -1
  290. package/build/es/polyfill/avatarWrapper/AvatarWrapper.story.js +1 -1
  291. package/build/es/polyfill/badge/Badge.js +1 -1
  292. package/build/es/polyfill/body/Body.js +2 -2
  293. package/build/es/polyfill/body/Body.spec.js +1 -1
  294. package/build/es/polyfill/body/Body.story.js +1 -1
  295. package/build/es/polyfill/button/Button.js +5 -5
  296. package/build/es/polyfill/button/Button.story.js +1 -1
  297. package/build/es/polyfill/button/classMap.js +1 -1
  298. package/build/es/polyfill/button/legacyUtils/legacyUtils.js +2 -2
  299. package/build/es/polyfill/card/Card.js +1 -1
  300. package/build/es/polyfill/checkbox/Checkbox.js +1 -1
  301. package/build/es/polyfill/checkbox/Checkbox.story.js +1 -1
  302. package/build/es/polyfill/checkboxButton/CheckboxButton.js +1 -1
  303. package/build/es/polyfill/checkboxButton/CheckboxButton.spec.js +1 -1
  304. package/build/es/polyfill/checkboxButton/CheckboxButton.story.js +2 -2
  305. package/build/es/polyfill/checkboxOption/CheckboxOption.js +1 -1
  306. package/build/es/polyfill/checkboxOption/CheckboxOption.spec.js +1 -1
  307. package/build/es/polyfill/checkboxOption/CheckboxOption.story.js +1 -1
  308. package/build/es/polyfill/chevron/Chevron.js +1 -1
  309. package/build/es/polyfill/chevron/Chevron.story.js +1 -1
  310. package/build/es/polyfill/chips/Chip.js +1 -1
  311. package/build/es/polyfill/chips/Chips.js +1 -1
  312. package/build/es/polyfill/chips/Chips.spec.js +1 -1
  313. package/build/es/polyfill/chips/Chips.story.js +1 -1
  314. package/build/es/polyfill/circularButton/CircularButton.js +1 -1
  315. package/build/es/polyfill/common/DOMOperations/DOMOperations.js +3 -3
  316. package/build/es/polyfill/common/Option/Option.js +1 -1
  317. package/build/es/polyfill/common/RadioButton/RadioButton.js +1 -1
  318. package/build/es/polyfill/common/bottomSheet/BottomSheet.js +4 -4
  319. package/build/es/polyfill/common/bottomSheet/BottomSheet.spec.js +1 -1
  320. package/build/es/polyfill/common/bottomSheet/BottomSheet.story.js +2 -2
  321. package/build/es/polyfill/common/closeButton/CloseButton.js +1 -1
  322. package/build/es/polyfill/common/dateUtils/getDayNames/getDayNames.js +2 -2
  323. package/build/es/polyfill/common/dateUtils/getMonthNames/getMonthNames.js +1 -1
  324. package/build/es/polyfill/common/dateUtils/isDateValid/isDateValid.js +1 -1
  325. package/build/es/polyfill/common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.js +1 -1
  326. package/build/es/polyfill/common/deviceDetection/deviceDetection.js +1 -1
  327. package/build/es/polyfill/common/direction.js +1 -1
  328. package/build/es/polyfill/common/domHelpers/index.js +1 -1
  329. package/build/es/polyfill/common/fakeEvents.js +1 -1
  330. package/build/es/polyfill/common/fileType.js +1 -1
  331. package/build/es/polyfill/common/flowHeader/FlowHeader.js +1 -1
  332. package/build/es/polyfill/common/focusBoundary/FocusBoundary.js +1 -1
  333. package/build/es/polyfill/common/focusBoundary/FocusBoundary.spec.js +1 -1
  334. package/build/es/polyfill/common/focusBoundary/utils/getFocusableElements.js +2 -2
  335. package/build/es/polyfill/common/focusBoundary/utils/resetFocus.js +1 -1
  336. package/build/es/polyfill/common/historyNavigator/historyNavigator.js +1 -1
  337. package/build/es/polyfill/common/hooks/useClientWidth/useClientWidth.js +3 -3
  338. package/build/es/polyfill/common/hooks/useConditionalListener/useConditionalListener.js +1 -1
  339. package/build/es/polyfill/common/hooks/useDirection/useDirection.js +1 -1
  340. package/build/es/polyfill/common/hooks/useHasIntersected/useHasIntersected.js +2 -2
  341. package/build/es/polyfill/common/hooks/useLayout/useLayout.js +1 -1
  342. package/build/es/polyfill/common/key.js +1 -1
  343. package/build/es/polyfill/common/locale/index.js +7 -7
  344. package/build/es/polyfill/common/panel/Panel.js +6 -6
  345. package/build/es/polyfill/common/propsValues/breakpoint.js +1 -1
  346. package/build/es/polyfill/common/propsValues/control.js +1 -1
  347. package/build/es/polyfill/common/propsValues/dateMode.js +1 -1
  348. package/build/es/polyfill/common/propsValues/layouts.js +1 -1
  349. package/build/es/polyfill/common/propsValues/markdownNodeType.js +1 -1
  350. package/build/es/polyfill/common/propsValues/monthFormat.js +1 -1
  351. package/build/es/polyfill/common/propsValues/position.js +1 -1
  352. package/build/es/polyfill/common/propsValues/profileType.js +1 -1
  353. package/build/es/polyfill/common/propsValues/scroll.js +1 -1
  354. package/build/es/polyfill/common/propsValues/sentiment.js +1 -1
  355. package/build/es/polyfill/common/propsValues/size.js +1 -1
  356. package/build/es/polyfill/common/propsValues/status.js +1 -1
  357. package/build/es/polyfill/common/propsValues/type.js +1 -1
  358. package/build/es/polyfill/common/propsValues/typography.js +1 -1
  359. package/build/es/polyfill/common/propsValues/variant.js +1 -1
  360. package/build/es/polyfill/common/propsValues/width.js +1 -1
  361. package/build/es/polyfill/common/requirements.js +2 -2
  362. package/build/es/polyfill/common/responsivePanel/ResponsivePanel.js +1 -1
  363. package/build/es/polyfill/common/textFormat/formatWithPattern/formatWithPattern.js +2 -2
  364. package/build/es/polyfill/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.js +1 -1
  365. package/build/es/polyfill/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js +1 -1
  366. package/build/es/polyfill/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js +1 -1
  367. package/build/es/polyfill/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js +1 -1
  368. package/build/es/polyfill/common/textFormat/unformatWithPattern/unformatWithPattern.js +1 -1
  369. package/build/es/polyfill/common/theme.js +1 -1
  370. package/build/es/polyfill/criticalBanner/CriticalCommsBanner.js +1 -1
  371. package/build/es/polyfill/criticalBanner/CriticalCommsBanner.story.js +1 -1
  372. package/build/es/polyfill/dateInput/DateInput.js +4 -10
  373. package/build/es/polyfill/dateInput/DateInput.story.js +1 -1
  374. package/build/es/polyfill/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.js +1 -1
  375. package/build/es/polyfill/dateInput/utils/explodeDate/explodeDate.js +1 -1
  376. package/build/es/polyfill/dateLookup/DateLookup.js +3 -4
  377. package/build/es/polyfill/dateLookup/dateHeader/DateHeader.js +1 -1
  378. package/build/es/polyfill/dateLookup/dateTrigger/DateTrigger.js +1 -1
  379. package/build/es/polyfill/dateLookup/dayCalendar/DayCalendar.js +1 -1
  380. package/build/es/polyfill/dateLookup/dayCalendar/table/DayCalendarTable.js +4 -5
  381. package/build/es/polyfill/dateLookup/monthCalendar/MonthCalendar.js +1 -1
  382. package/build/es/polyfill/dateLookup/monthCalendar/table/MonthCalendarTable.js +1 -1
  383. package/build/es/polyfill/dateLookup/tableLink/TableLink.js +1 -1
  384. package/build/es/polyfill/dateLookup/yearCalendar/YearCalendar.js +1 -1
  385. package/build/es/polyfill/dateLookup/yearCalendar/table/YearCalendarTable.js +1 -1
  386. package/build/es/polyfill/decision/Decision.js +5 -5
  387. package/build/es/polyfill/decision/decisionEnums.js +2 -2
  388. package/build/es/polyfill/definitionList/DefinitionList.js +1 -1
  389. package/build/es/polyfill/dimmer/Dimmer.js +3 -3
  390. package/build/es/polyfill/dimmer/Dimmer.story.js +2 -2
  391. package/build/es/polyfill/dimmer/dimmerManager/DimmerManager.js +3 -3
  392. package/build/es/polyfill/display/Display.js +1 -1
  393. package/build/es/polyfill/display/Display.story.js +2 -2
  394. package/build/es/polyfill/drawer/Drawer.js +1 -1
  395. package/build/es/polyfill/dropFade/DropFade.js +3 -3
  396. package/build/es/polyfill/dropFade/DropFade.story.js +1 -1
  397. package/build/es/polyfill/dynamicFieldDefinitionList/DynamicFieldDefinitionList.js +1 -1
  398. package/build/es/polyfill/dynamicFieldDefinitionList/FormattedValue/FormattedValue.js +2 -2
  399. package/build/es/polyfill/dynamicFieldDefinitionList/utils/createDefinitions.js +2 -2
  400. package/build/es/polyfill/dynamicFieldDefinitionList/utils/text-format.js +1 -1
  401. package/build/es/polyfill/emphasis/Emphasis.js +2 -2
  402. package/build/es/polyfill/emphasis/Emphasis.story.js +1 -1
  403. package/build/es/polyfill/emphasis/EmphasisHtmlTransformer.js +2 -2
  404. package/build/es/polyfill/flowNavigation/FlowNavigation.js +2 -2
  405. package/build/es/polyfill/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
  406. package/build/es/polyfill/flowNavigation/backButton/BackButton.js +1 -1
  407. package/build/es/polyfill/header/Header.js +2 -2
  408. package/build/es/polyfill/header/Header.spec.js +1 -1
  409. package/build/es/polyfill/header/Header.story.js +2 -1
  410. package/build/es/polyfill/i18n/index.js +1 -1
  411. package/build/es/polyfill/image/Image.js +2 -2
  412. package/build/es/polyfill/info/Info.js +1 -1
  413. package/build/es/polyfill/info/Info.story.js +1 -1
  414. package/build/es/polyfill/info/infoPresentations.js +1 -1
  415. package/build/es/polyfill/inlineAlert/InlineAlert.js +1 -1
  416. package/build/es/polyfill/inputWithDisplayFormat/InputWithDisplayFormat.js +1 -1
  417. package/build/es/polyfill/inputs/Input.js +1 -1
  418. package/build/es/polyfill/inputs/TextArea.js +1 -1
  419. package/build/es/polyfill/inputs/_common.js +2 -2
  420. package/build/es/polyfill/instructionsList/InstructionsList.js +3 -3
  421. package/build/es/polyfill/link/Link.js +2 -2
  422. package/build/es/polyfill/link/Link.spec.js +1 -1
  423. package/build/es/polyfill/link/Link.story.js +1 -1
  424. package/build/es/polyfill/listItem/ListItem.js +1 -1
  425. package/build/es/polyfill/listItem/ListItem.spec.js +1 -1
  426. package/build/es/polyfill/listItem/ListItem.story.js +1 -1
  427. package/build/es/polyfill/loader/Loader.js +2 -2
  428. package/build/es/polyfill/loader/Loader.story.js +1 -1
  429. package/build/es/polyfill/logo/Logo.js +1 -1
  430. package/build/es/polyfill/logo/Logo.story.js +1 -1
  431. package/build/es/polyfill/logo/logoTypes.js +1 -1
  432. package/build/es/polyfill/markdown/Markdown.js +1 -1
  433. package/build/es/polyfill/markdown/Markdown.story.js +1 -1
  434. package/build/es/polyfill/modal/Modal.js +1 -1
  435. package/build/es/polyfill/modal/Modal.story.js +2 -2
  436. package/build/es/polyfill/money/Money.js +1 -1
  437. package/build/es/polyfill/money/Money.story.js +1 -1
  438. package/build/es/polyfill/moneyInput/MoneyInput.js +1 -1
  439. package/build/es/polyfill/moneyInput/MoneyInput.story.js +1 -1
  440. package/build/es/polyfill/moneyInput/currencyFormatting.js +2 -2
  441. package/build/es/polyfill/navigationOption/NavigationOption.js +1 -1
  442. package/build/es/polyfill/navigationOptionsList/NavigationOptionsList.js +1 -1
  443. package/build/es/polyfill/nudge/Nudge.js +1 -1
  444. package/build/es/polyfill/overlayHeader/OverlayHeader.js +1 -1
  445. package/build/es/polyfill/phoneNumberInput/PhoneNumberInput.js +1 -1
  446. package/build/es/polyfill/phoneNumberInput/data/countries.js +1 -1
  447. package/build/es/polyfill/phoneNumberInput/utils/cleanNumber/cleanNumber.js +1 -1
  448. package/build/es/polyfill/phoneNumberInput/utils/excludeCountries/excludeCountries.js +3 -3
  449. package/build/es/polyfill/phoneNumberInput/utils/explodeNumberModel/index.js +2 -2
  450. package/build/es/polyfill/phoneNumberInput/utils/filterOptionsForQuery/index.js +2 -2
  451. package/build/es/polyfill/phoneNumberInput/utils/findCountryByCode/index.js +1 -1
  452. package/build/es/polyfill/phoneNumberInput/utils/findCountryByPrefix/index.js +1 -1
  453. package/build/es/polyfill/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.js +1 -1
  454. package/build/es/polyfill/phoneNumberInput/utils/isOptionAndFitsQuery/isOptionAndFitsQuery.js +2 -2
  455. package/build/es/polyfill/phoneNumberInput/utils/isStringNumeric/isStringNumeric.js +1 -1
  456. package/build/es/polyfill/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js +2 -2
  457. package/build/es/polyfill/phoneNumberInput/utils/longestMatchingPrefix/index.js +1 -1
  458. package/build/es/polyfill/phoneNumberInput/utils/setDefaultPrefix/index.js +2 -2
  459. package/build/es/polyfill/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.js +2 -2
  460. package/build/es/polyfill/popover/Popover.js +2 -2
  461. package/build/es/polyfill/processIndicator/ProcessIndicator.js +4 -4
  462. package/build/es/polyfill/processIndicator/ProcessIndicator.story.js +1 -1
  463. package/build/es/polyfill/progress/Progress.js +1 -1
  464. package/build/es/polyfill/progress/Progress.story.js +1 -1
  465. package/build/es/polyfill/progressBar/ProgressBar.js +1 -1
  466. package/build/es/polyfill/progressBar/ProgressBar.story.js +1 -1
  467. package/build/es/polyfill/provider/Provider.js +1 -1
  468. package/build/es/polyfill/provider/Provider.spec.js +1 -1
  469. package/build/es/polyfill/provider/Provider.story.js +1 -1
  470. package/build/es/polyfill/provider/direction/DirectionProvider.js +1 -1
  471. package/build/es/polyfill/provider/direction/DirectionProvider.spec.js +1 -1
  472. package/build/es/polyfill/provider/language/LanguageProvider.js +1 -1
  473. package/build/es/polyfill/provider/language/LanguageProvider.spec.js +1 -1
  474. package/build/es/polyfill/radio/Radio.js +1 -1
  475. package/build/es/polyfill/radioGroup/RadioGroup.js +2 -2
  476. package/build/es/polyfill/radioOption/RadioOption.js +1 -1
  477. package/build/es/polyfill/section/Section.js +1 -1
  478. package/build/es/polyfill/section/Section.spec.js +1 -1
  479. package/build/es/polyfill/section/Section.story.js +1 -1
  480. package/build/es/polyfill/select/Select.js +8 -9
  481. package/build/es/polyfill/select/option/Option.js +2 -2
  482. package/build/es/polyfill/select/searchBox/SearchBox.js +1 -1
  483. package/build/es/polyfill/sizeSwapper/SizeSwapper.js +3 -3
  484. package/build/es/polyfill/slidingPanel/SlidingPanel.js +1 -1
  485. package/build/es/polyfill/snackbar/Snackbar.js +1 -1
  486. package/build/es/polyfill/snackbar/SnackbarContext.js +1 -1
  487. package/build/es/polyfill/snackbar/SnackbarProvider.js +1 -1
  488. package/build/es/polyfill/snackbar/useSnackbar.js +1 -1
  489. package/build/es/polyfill/statusIcon/StatusIcon.js +1 -1
  490. package/build/es/polyfill/statusIcon/StatusIcon.story.js +1 -1
  491. package/build/es/polyfill/stepper/Stepper.js +1 -1
  492. package/build/es/polyfill/stepper/deviceDetection.js +2 -2
  493. package/build/es/polyfill/sticky/Sticky.js +1 -1
  494. package/build/es/polyfill/summary/Summary.js +1 -1
  495. package/build/es/polyfill/switch/Switch.js +1 -1
  496. package/build/es/polyfill/switch/Switch.story.js +1 -1
  497. package/build/es/polyfill/switchOption/SwitchOption.js +1 -1
  498. package/build/es/polyfill/switchOption/SwitchOption.story.js +1 -1
  499. package/build/es/polyfill/tabs/Tab.js +1 -1
  500. package/build/es/polyfill/tabs/TabList.js +1 -1
  501. package/build/es/polyfill/tabs/TabPanel.js +1 -1
  502. package/build/es/polyfill/tabs/Tabs.js +1 -5
  503. package/build/es/polyfill/tabs/utils.js +2 -2
  504. package/build/es/polyfill/textareaWithDisplayFormat/TextareaWithDisplayFormat.js +1 -1
  505. package/build/es/polyfill/tile/Tile.js +1 -1
  506. package/build/es/polyfill/title/Title.js +1 -1
  507. package/build/es/polyfill/title/Title.spec.js +1 -1
  508. package/build/es/polyfill/title/Title.story.js +1 -1
  509. package/build/es/polyfill/tooltip/Tooltip.js +7 -7
  510. package/build/es/polyfill/tooltip/Tooltip.spec.js +1 -1
  511. package/build/es/polyfill/tooltip/Tooltip.story.js +1 -1
  512. package/build/es/polyfill/typeahead/Typeahead.js +1 -1
  513. package/build/es/polyfill/typeahead/typeaheadInput/TypeaheadInput.js +1 -1
  514. package/build/es/polyfill/typeahead/typeaheadOption/TypeaheadOption.js +1 -1
  515. package/build/es/polyfill/typeahead/util/highlight.js +1 -1
  516. package/build/es/polyfill/upload/Upload.js +2 -6
  517. package/build/es/polyfill/upload/steps/completeStep/completeStep.js +1 -1
  518. package/build/es/polyfill/upload/steps/mediaUploadStep/mediaUploadStep.js +1 -1
  519. package/build/es/polyfill/upload/steps/processingStep/processingStep.js +1 -1
  520. package/build/es/polyfill/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
  521. package/build/es/polyfill/upload/uploadSteps.js +1 -1
  522. package/build/es/polyfill/upload/utils/asyncFileRead/asyncFileRead.js +1 -1
  523. package/build/es/polyfill/upload/utils/getFileType/getFileType.js +1 -1
  524. package/build/es/polyfill/upload/utils/getSupportedSpotMimeTypes/getSupportedSpotMimeTypes.js +2 -2
  525. package/build/es/polyfill/upload/utils/isSizeValid/isSizeValid.js +1 -1
  526. package/build/es/polyfill/upload/utils/isTypeValid/isTypeValid.js +1 -1
  527. package/build/es/polyfill/upload/utils/postData/postData.js +1 -1
  528. package/build/es/polyfill/upload/utils/requestMedia/requestMedia.js +1 -1
  529. package/build/es/polyfill/uploadInput/UploadInput.js +7 -7
  530. package/build/es/polyfill/uploadInput/UploadInput.spec.js +1 -1
  531. package/build/es/polyfill/uploadInput/UploadInput.story.js +1 -1
  532. package/build/es/polyfill/uploadInput/uploadButton/UploadButton.js +1 -1
  533. package/build/es/polyfill/uploadInput/uploadButton/UploadButton.spec.js +3 -3
  534. package/build/es/polyfill/uploadInput/uploadButton/defaults.js +1 -1
  535. package/build/es/polyfill/uploadInput/uploadButton/getAllowedFileTypes.js +3 -3
  536. package/build/es/polyfill/uploadInput/uploadButton/getAllowedFileTypes.spec.js +1 -1
  537. package/build/es/polyfill/uploadInput/uploadItem/UploadItem.js +2 -2
  538. package/build/es/polyfill/uploadInput/uploadItem/UploadItem.spec.js +1 -1
  539. package/build/es/polyfill/uploadInput/uploadItem/UploadItemBody.js +1 -1
  540. package/build/es/polyfill/utilities/deprecatedProperty/deprecatedProperty.js +1 -1
  541. package/build/es/polyfill/withDisplayFormat/WithDisplayFormat.js +3 -4
  542. package/build/es/polyfill/withNextPortal/withNextPortal.js +1 -1
  543. package/build/main.css +1 -4194
  544. package/build/styles/accordion/Accordion.css +1 -59
  545. package/build/styles/actionButton/ActionButton.css +1 -36
  546. package/build/styles/avatar/Avatar.css +1 -239
  547. package/build/styles/badge/Badge.css +1 -67
  548. package/build/styles/button/Button.css +1 -17
  549. package/build/styles/card/Card.css +1 -88
  550. package/build/styles/checkboxButton/CheckboxButton.css +1 -21
  551. package/build/styles/chips/Chip.css +1 -169
  552. package/build/styles/circularButton/CircularButton.css +1 -175
  553. package/build/styles/common/Option/Option.css +1 -74
  554. package/build/styles/common/RadioButton/RadioButton.css +1 -3
  555. package/build/styles/common/bottomSheet/BottomSheet.css +1 -44
  556. package/build/styles/common/closeButton/CloseButton.css +1 -44
  557. package/build/styles/common/panel/Panel.css +1 -67
  558. package/build/styles/criticalBanner/CriticalCommsBanner.css +1 -73
  559. package/build/styles/dateInput/DateInput.css +1 -3
  560. package/build/styles/dateLookup/DateLookup.css +1 -80
  561. package/build/styles/dateLookup/dateTrigger/DateTrigger.css +1 -53
  562. package/build/styles/decision/Decision.css +1 -69
  563. package/build/styles/definitionList/DefinitionList.css +1 -48
  564. package/build/styles/dimmer/Dimmer.css +1 -68
  565. package/build/styles/drawer/Drawer.css +1 -77
  566. package/build/styles/dropFade/DropFade.css +1 -19
  567. package/build/styles/dynamicFieldDefinitionList/FormattedValue/FormattedValue.css +1 -4
  568. package/build/styles/emphasis/Emphasis.css +1 -25
  569. package/build/styles/flowNavigation/FlowNavigation.css +1 -85
  570. package/build/styles/flowNavigation/animatedLabel/AnimatedLabel.css +1 -26
  571. package/build/styles/flowNavigation/backButton/BackButton.css +1 -28
  572. package/build/styles/header/Header.css +1 -19
  573. package/build/styles/image/Image.css +1 -13
  574. package/build/styles/info/Info.css +1 -37
  575. package/build/styles/inputs/Input.css +1 -53
  576. package/build/styles/inputs/TextArea.css +1 -59
  577. package/build/styles/instructionsList/InstructionsList.css +1 -30
  578. package/build/styles/link/Link.css +1 -12
  579. package/build/styles/listItem/ListItem.css +1 -6
  580. package/build/styles/loader/Loader.css +1 -295
  581. package/build/styles/logo/Logo.css +1 -10
  582. package/build/styles/main.css +1 -4194
  583. package/build/styles/modal/Modal.css +1 -133
  584. package/build/styles/moneyInput/MoneyInput.css +1 -128
  585. package/build/styles/navigationOption/NavigationOption.css +1 -61
  586. package/build/styles/navigationOptionsList/NavigationOptionsList.css +1 -12
  587. package/build/styles/nudge/Nudge.css +1 -138
  588. package/build/styles/overlayHeader/OverlayHeader.css +1 -31
  589. package/build/styles/phoneNumberInput/PhoneNumberInput.css +1 -17
  590. package/build/styles/popover/Popover.css +1 -36
  591. package/build/styles/progress/Progress.css +1 -35
  592. package/build/styles/progressBar/ProgressBar.css +1 -9
  593. package/build/styles/section/Section.css +1 -8
  594. package/build/styles/select/Select.css +1 -319
  595. package/build/styles/slidingPanel/SlidingPanel.css +1 -96
  596. package/build/styles/snackbar/Snackbar.css +1 -84
  597. package/build/styles/statusIcon/StatusIcon.css +1 -50
  598. package/build/styles/stepper/Stepper.css +1 -108
  599. package/build/styles/summary/Summary.css +1 -86
  600. package/build/styles/switch/Switch.css +1 -64
  601. package/build/styles/tabs/Tabs.css +1 -104
  602. package/build/styles/tile/Tile.css +1 -58
  603. package/build/styles/tooltip/Tooltip.css +1 -38
  604. package/build/styles/typeahead/Typeahead.css +1 -167
  605. package/build/styles/typeahead/typeaheadOption/TypeaheadOption.css +1 -6
  606. package/build/styles/upload/Upload.css +1 -15
  607. package/build/styles/uploadInput/UploadInput.css +1 -53
  608. package/build/styles/uploadInput/uploadButton/UploadButton.css +1 -44
  609. package/build/styles/uploadInput/uploadItem/UploadItem.css +1 -60
  610. package/build/umd/no-polyfill/main.js +1 -1
  611. package/build/umd/polyfill/main.js +1 -1
  612. package/package.json +1 -1
@@ -1 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"core-js/modules/es.symbol.description.js";import"core-js/modules/web.dom-collections.iterator.js";import{PlusCircle as PlusIcon,Upload as UploadIcon}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import{useRef,useState}from"react";import{useIntl}from"react-intl";import Body from"../../body";import{Typography}from"../../common";import{useDirection}from"../../common/hooks";import MESSAGES from"./UploadButton.messages";import{DEFAULT_SIZE_LIMIT,imageFileTypes}from"./defaults";import getAllowedFileTypes from"./getAllowedFileTypes";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export let TEST_IDS=/*#__PURE__*/function(a){return a.uploadInput="uploadInput",a.mediaBody="mediaBody",a}({});const onDragOver=a=>{a.preventDefault()},DEFAULT_FILE_INPUT_ID="np-upload-button",UploadButton=a=>{function b(){if(e)return e;const a=u(),b="*"===a?o(MESSAGES.allFileTypes):a;return o(MESSAGES.instructions,{fileTypes:b,size:Math.round(k/1e3)})}let{disabled:c,multiple:d,description:e,fileTypes:j=imageFileTypes,sizeLimit:k=DEFAULT_SIZE_LIMIT,maxFiles:f,onChange:g,id:l=DEFAULT_FILE_INPUT_ID,uploadButtonTitle:h,multipleFileInputWithFilesAdded:i}=a;const{isModern:m}=useTheme(),{isRTL:n}=useDirection(),{formatMessage:o}=useIntl(),p=useRef(null),[q,r]=useState(!1),s=useRef(0),t=()=>{s.current=0,r(!1)},u=()=>"*"===j?j:Array.isArray(j)?getAllowedFileTypes(j).join(", "):getAllowedFileTypes([j]).join(", ");return/*#__PURE__*/_jsxs("div",_objectSpread(_objectSpread({className:classNames("np-upload-button-container","droppable",{"droppable-dropping":q})},!c&&{onDragEnter:a=>{a.preventDefault(),s.current+=1,1===s.current&&r(!0)},onDragLeave:a=>{a.preventDefault(),s.current-=1,0===s.current&&r(!1)},onDrop:a=>{a.preventDefault(),t(),a.dataTransfer&&a.dataTransfer.files&&a.dataTransfer.files[0]&&g(a.dataTransfer.files)},onDragOver}),{},{children:[/*#__PURE__*/_jsx("input",_objectSpread(_objectSpread(_objectSpread({ref:p,id:l,type:"file"},function(){const a="*"===u();return a?null:Array.isArray(j)?{accept:j.join(",")}:{accept:j}}()),d&&{multiple:!0}),{},{className:"tw-droppable-input",disabled:c,name:"file-upload","data-testid":TEST_IDS.uploadInput,onChange:a=>{const{files:b}=a.target;b&&(g(b),p.current&&(p.current.value=""))}})),/*#__PURE__*/_jsx("label",{htmlFor:l,className:classNames("btn","np-upload-accent","np-upload-button",{disabled:c,"np-upload-input--square-top":i}),children:/*#__PURE__*/_jsxs("div",{className:"media",children:[/*#__PURE__*/_jsx("div",{className:"np-upload-icon media-left",children:/*#__PURE__*/_jsx(UploadIcon,{size:24,className:"text-link"})}),/*#__PURE__*/_jsxs("div",{className:"media-body text-xs-left","data-testid":TEST_IDS.mediaBody,children:[/*#__PURE__*/_jsx(Body,{type:Typography.BODY_LARGE_BOLD,className:"d-block",children:function(){return h?h:o(d?MESSAGES.uploadFiles:MESSAGES.uploadFile)}()}),function(){return/*#__PURE__*/_jsx(_Fragment,{children:/*#__PURE__*/_jsxs(Body,{className:classNames({"text-primary":!c,small:!m,"font-weight-normal":!m}),children:[b(),f&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("br",{}),"Maximum ".concat(f," files.")]})]})})}()]})]})}),q&&/*#__PURE__*/_jsxs("div",{className:classNames("droppable-card","droppable-dropping-card","droppable-card-content",{"np-upload-input--square-top":i}),children:[/*#__PURE__*/_jsx(PlusIcon,{className:"m-x-1",size:24}),/*#__PURE__*/_jsx("div",{children:o(MESSAGES.dropFile)})]})]}))};export default UploadButton;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"core-js/modules/es.symbol.js";import"core-js/modules/es.symbol.description.js";import"core-js/modules/es.array.join.js";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";import{PlusCircle as PlusIcon,Upload as UploadIcon}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import{useRef,useState}from"react";import{useIntl}from"react-intl";import Body from"../../body";import{Typography}from"../../common";import{useDirection}from"../../common/hooks";import MESSAGES from"./UploadButton.messages";import{DEFAULT_SIZE_LIMIT,imageFileTypes}from"./defaults";import getAllowedFileTypes from"./getAllowedFileTypes";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export var TEST_IDS=/*#__PURE__*/function(a){return a.uploadInput="uploadInput",a.mediaBody="mediaBody",a}({});var onDragOver=function(a){a.preventDefault()},DEFAULT_FILE_INPUT_ID="np-upload-button",UploadButton=function(a){function b(){if(e)return e;var a=C(),b="*"===a?u(MESSAGES.allFileTypes):a;return u(MESSAGES.instructions,{fileTypes:b,size:Math.round(i/1e3)})}var c=a.disabled,d=a.multiple,e=a.description,f=a.fileTypes,g=void 0===f?imageFileTypes:f,h=a.sizeLimit,i=void 0===h?DEFAULT_SIZE_LIMIT:h,j=a.maxFiles,k=a.onChange,l=a.id,m=void 0===l?DEFAULT_FILE_INPUT_ID:l,n=a.uploadButtonTitle,o=a.multipleFileInputWithFilesAdded,p=useTheme(),q=p.isModern,r=useDirection(),s=r.isRTL,t=useIntl(),u=t.formatMessage,v=useRef(null),w=useState(!1),x=_slicedToArray(w,2),y=x[0],z=x[1],A=useRef(0),B=function(){A.current=0,z(!1)},C=function(){return"*"===g?g:Array.isArray(g)?getAllowedFileTypes(g).join(", "):getAllowedFileTypes([g]).join(", ")};return/*#__PURE__*/_jsxs("div",_objectSpread(_objectSpread({className:classNames("np-upload-button-container","droppable",{"droppable-dropping":y})},!c&&{onDragEnter:function onDragEnter(a){a.preventDefault(),A.current+=1,1===A.current&&z(!0)},onDragLeave:function onDragLeave(a){a.preventDefault(),A.current-=1,0===A.current&&z(!1)},onDrop:function onDrop(a){a.preventDefault(),B(),a.dataTransfer&&a.dataTransfer.files&&a.dataTransfer.files[0]&&k(a.dataTransfer.files)},onDragOver:onDragOver}),{},{children:[/*#__PURE__*/_jsx("input",_objectSpread(_objectSpread(_objectSpread({ref:v,id:m,type:"file"},function(){var a="*"===C();return a?null:Array.isArray(g)?{accept:g.join(",")}:{accept:g}}()),d&&{multiple:!0}),{},{className:"tw-droppable-input",disabled:c,name:"file-upload","data-testid":TEST_IDS.uploadInput,onChange:function filesSelected(a){var b=a.target.files;b&&(k(b),v.current&&(v.current.value=""))}})),/*#__PURE__*/_jsx("label",{htmlFor:m,className:classNames("btn","np-upload-accent","np-upload-button",{disabled:c,"np-upload-input--square-top":o}),children:/*#__PURE__*/_jsxs("div",{className:"media",children:[/*#__PURE__*/_jsx("div",{className:"np-upload-icon media-left",children:/*#__PURE__*/_jsx(UploadIcon,{size:24,className:"text-link"})}),/*#__PURE__*/_jsxs("div",{className:"media-body text-xs-left","data-testid":TEST_IDS.mediaBody,children:[/*#__PURE__*/_jsx(Body,{type:Typography.BODY_LARGE_BOLD,className:"d-block",children:function(){return n?n:u(d?MESSAGES.uploadFiles:MESSAGES.uploadFile)}()}),function(){return/*#__PURE__*/_jsx(_Fragment,{children:/*#__PURE__*/_jsxs(Body,{className:classNames({"text-primary":!c,small:!q,"font-weight-normal":!q}),children:[b(),j&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("br",{}),"Maximum ".concat(j," files.")]})]})})}()]})]})}),y&&/*#__PURE__*/_jsxs("div",{className:classNames("droppable-card","droppable-dropping-card","droppable-card-content",{"np-upload-input--square-top":o}),children:[/*#__PURE__*/_jsx(PlusIcon,{className:"m-x-1",size:24}),/*#__PURE__*/_jsx("div",{children:u(MESSAGES.dropFile)})]})]}))};export default UploadButton;
@@ -1,3 +1,3 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{render,screen,userEvent}from"../../test-utils";import UploadButton,{TEST_IDS}from"./UploadButton";import{imageFileTypes}from"./defaults";import{jsx as _jsx}from"react/jsx-runtime";describe("UploadButton",()=>{const a=new File(["foo"],"foo.png",{type:"image/png"}),b=new File(["foo"],"foo.jpg",{type:"image/jpg"}),c={onChange:jest.fn(),multipleFileInputWithFilesAdded:!0},d=function(){let a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:c;return render(/*#__PURE__*/_jsx(UploadButton,_objectSpread({},a)))};describe("single file upload",()=>{beforeEach(()=>{d()}),it("should render the file input form",()=>{expect(screen.getByText("Upload file")).toBeInTheDocument()}),it("should render the file input button with title, if provided",()=>{d(_objectSpread(_objectSpread({},c),{},{uploadButtonTitle:"Upload your id"})),expect(screen.getByText("Upload your id")).toBeInTheDocument()}),it("should set accept to imageTypes",()=>{expect(screen.getByTestId(TEST_IDS.uploadInput)).toHaveAttribute("accept",imageFileTypes.join(","))}),it("trigger onChange callback with a FileList",()=>{const d=screen.getByTestId(TEST_IDS.uploadInput);// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
2
- userEvent.upload(d,[a,b]),expect(c.onChange).toHaveBeenCalledTimes(1),expect(c.onChange.mock.calls[0][0]).toHaveLength(1)})}),describe("multiple file upload",()=>{beforeEach(()=>{c.onChange.mockClear(),d(_objectSpread(_objectSpread({},c),{},{multiple:!0}))}),it("should disable the file input",()=>{expect(screen.getByTestId(TEST_IDS.uploadInput)).toHaveAttribute("multiple")}),it("trigger onChange callback with a FileList",()=>{const d=screen.getByTestId(TEST_IDS.uploadInput);// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
3
- userEvent.upload(d,[a,b]),expect(c.onChange).toHaveBeenCalledTimes(1),expect(c.onChange.mock.calls[0][0]).toHaveLength(2)})}),describe("disabled state",()=>{beforeEach(()=>{d(_objectSpread(_objectSpread({},c),{},{disabled:!0}))}),it("should disable the file input",()=>{expect(screen.getByTestId(TEST_IDS.uploadInput)).toBeDisabled()})}),describe("accept all file types",()=>{beforeEach(()=>{d(_objectSpread(_objectSpread({},c),{},{fileTypes:["*"]}))}),it("should not add accept attribute to file input",()=>{expect(screen.getByTestId(TEST_IDS.uploadInput)).not.toHaveAttribute("accept")})}),describe("description for the button",()=>{it("should show default description based on the default file types provided",()=>{d(_objectSpread({},c)),expect(screen.getByText("PDF, JPG, JPEG, PNG, less than 5MB")).toBeInTheDocument()}),it("should show default all files allowed description if all files are accepted",()=>{d(_objectSpread(_objectSpread({},c),{},{fileTypes:["*"]})),expect(screen.getByText("All file types, less than 5MB")).toBeInTheDocument()}),it("should show custom description if provided",()=>{d(_objectSpread(_objectSpread({},c),{},{fileTypes:["*"],description:"Test description"})),expect(screen.getByText("Test description")).toBeInTheDocument()}),it("should show maxFiles next to the description, if provided",()=>{d(_objectSpread(_objectSpread({},c),{},{fileTypes:["*"],maxFiles:5})),expect(screen.getByText(/Maximum 5 files\./)).toBeInTheDocument()})})});
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";import"core-js/modules/es.array.join.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{render,screen,userEvent}from"../../test-utils";import UploadButton,{TEST_IDS}from"./UploadButton";import{imageFileTypes}from"./defaults";import{jsx as _jsx}from"react/jsx-runtime";describe("UploadButton",function(){var a=new File(["foo"],"foo.png",{type:"image/png"}),b=new File(["foo"],"foo.jpg",{type:"image/jpg"}),c={onChange:jest.fn(),multipleFileInputWithFilesAdded:!0},d=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:c;return render(/*#__PURE__*/_jsx(UploadButton,_objectSpread({},a)))};describe("single file upload",function(){beforeEach(function(){d()}),it("should render the file input form",function(){expect(screen.getByText("Upload file")).toBeInTheDocument()}),it("should render the file input button with title, if provided",function(){d(_objectSpread(_objectSpread({},c),{},{uploadButtonTitle:"Upload your id"})),expect(screen.getByText("Upload your id")).toBeInTheDocument()}),it("should set accept to imageTypes",function(){expect(screen.getByTestId(TEST_IDS.uploadInput)).toHaveAttribute("accept",imageFileTypes.join(","))}),it("trigger onChange callback with a FileList",function(){var d=screen.getByTestId(TEST_IDS.uploadInput);// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
2
+ userEvent.upload(d,[a,b]),expect(c.onChange).toHaveBeenCalledTimes(1),expect(c.onChange.mock.calls[0][0]).toHaveLength(1)})}),describe("multiple file upload",function(){beforeEach(function(){c.onChange.mockClear(),d(_objectSpread(_objectSpread({},c),{},{multiple:!0}))}),it("should disable the file input",function(){expect(screen.getByTestId(TEST_IDS.uploadInput)).toHaveAttribute("multiple")}),it("trigger onChange callback with a FileList",function(){var d=screen.getByTestId(TEST_IDS.uploadInput);// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
3
+ userEvent.upload(d,[a,b]),expect(c.onChange).toHaveBeenCalledTimes(1),expect(c.onChange.mock.calls[0][0]).toHaveLength(2)})}),describe("disabled state",function(){beforeEach(function(){d(_objectSpread(_objectSpread({},c),{},{disabled:!0}))}),it("should disable the file input",function(){expect(screen.getByTestId(TEST_IDS.uploadInput)).toBeDisabled()})}),describe("accept all file types",function(){beforeEach(function(){d(_objectSpread(_objectSpread({},c),{},{fileTypes:["*"]}))}),it("should not add accept attribute to file input",function(){expect(screen.getByTestId(TEST_IDS.uploadInput)).not.toHaveAttribute("accept")})}),describe("description for the button",function(){it("should show default description based on the default file types provided",function(){d(_objectSpread({},c)),expect(screen.getByText("PDF, JPG, JPEG, PNG, less than 5MB")).toBeInTheDocument()}),it("should show default all files allowed description if all files are accepted",function(){d(_objectSpread(_objectSpread({},c),{},{fileTypes:["*"]})),expect(screen.getByText("All file types, less than 5MB")).toBeInTheDocument()}),it("should show custom description if provided",function(){d(_objectSpread(_objectSpread({},c),{},{fileTypes:["*"],description:"Test description"})),expect(screen.getByText("Test description")).toBeInTheDocument()}),it("should show maxFiles next to the description, if provided",function(){d(_objectSpread(_objectSpread({},c),{},{fileTypes:["*"],maxFiles:5})),expect(screen.getByText(/Maximum 5 files\./)).toBeInTheDocument()})})});
@@ -1 +1 @@
1
- import{FileType}from"../../common";export const DEFAULT_SIZE_LIMIT=5e3;export const imageFileTypes=[FileType.PDF,FileType.JPG,FileType.PNG];
1
+ import{FileType}from"../../common";export var DEFAULT_SIZE_LIMIT=5e3;export var imageFileTypes=[FileType.PDF,FileType.JPG,FileType.PNG];
@@ -1,3 +1,3 @@
1
- import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.replace.js";const getAllowedFileTypes=a=>a.map(a=>a.split(",").filter(a=>!a.includes("/"))// Filter out mime types
2
- .map(a=>a.replace(".","").toUpperCase())// Remove dot and convert extensions to uppercase to be displayed in the instructions
3
- .join(", "));export default getAllowedFileTypes;
1
+ import"core-js/modules/es.array.map.js";import"core-js/modules/es.array.join.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.replace.js";var getAllowedFileTypes=function(a){return a.map(function(a){return a.split(",").filter(function(a){return!a.includes("/")})// Filter out mime types
2
+ .map(function(a){return a.replace(".","").toUpperCase()})// Remove dot and convert extensions to uppercase to be displayed in the instructions
3
+ .join(", ")})};export default getAllowedFileTypes;
@@ -1 +1 @@
1
- import{FileType}from"../../common";import getAllowedFileTypes from"./getAllowedFileTypes";describe("getAllowedFileTypes",()=>{let a;describe("using predefined FileTypes",()=>{beforeAll(()=>{a=getAllowedFileTypes([FileType.PNG,FileType.JPG])}),it("parses allowed file extensions from FileType[] array",()=>{expect(a).toStrictEqual(["PNG","JPG, JPEG"])})}),describe("using custom file extensions and mime types",()=>{beforeAll(()=>{a=getAllowedFileTypes([".xls,.xlm,application/vnd.ms-excel",".docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document",".doc,application/msword"])}),it("parses allowed file extensions from FileType[] array",()=>{expect(a).toStrictEqual(["XLS, XLM","DOCX","DOC"])})}),describe("when all file types are allowed",()=>{beforeAll(()=>{a=getAllowedFileTypes(["*"])}),it("should return the wildcard character",()=>{expect(a).toStrictEqual(["*"])})})});
1
+ import{FileType}from"../../common";import getAllowedFileTypes from"./getAllowedFileTypes";describe("getAllowedFileTypes",function(){var a;describe("using predefined FileTypes",function(){beforeAll(function(){a=getAllowedFileTypes([FileType.PNG,FileType.JPG])}),it("parses allowed file extensions from FileType[] array",function(){expect(a).toStrictEqual(["PNG","JPG, JPEG"])})}),describe("using custom file extensions and mime types",function(){beforeAll(function(){a=getAllowedFileTypes([".xls,.xlm,application/vnd.ms-excel",".docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document",".doc,application/msword"])}),it("parses allowed file extensions from FileType[] array",function(){expect(a).toStrictEqual(["XLS, XLM","DOCX","DOC"])})}),describe("when all file types are allowed",function(){beforeAll(function(){a=getAllowedFileTypes(["*"])}),it("should return the wildcard character",function(){expect(a).toStrictEqual(["*"])})})});
@@ -1,2 +1,2 @@
1
- import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import{AlertCircle,CrossCircleFill}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import{useIntl}from"react-intl";import Body from"../../body";import{Size,Status,Typography,Sentiment}from"../../common";import ProcessIndicator from"../../processIndicator/ProcessIndicator";import StatusIcon from"../../statusIcon/StatusIcon";import MESSAGES from"./UploadItem.messages";import{UploadItemBody}from"./UploadItemBody";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export let TEST_IDS=/*#__PURE__*/function(a){return a.uploadItem="uploadItem",a.mediaBody="mediaBody",a}({});const UploadItem=a=>{let{file:b,canDelete:c,onDelete:d,onDownload:e,singleFileUpload:f}=a;const{formatMessage:g}=useIntl(),{status:h,filename:i,error:j,url:k}=b,{isModern:l}=useTheme(),m=[Status.SUCCEEDED,void 0].includes(h)&&!!k,n=()=>"object"==typeof j&&j.message||j||g(MESSAGES.uploadingFailed);return/*#__PURE__*/_jsx("div",{className:classNames("np-upload-item",{"np-upload-item__link":m}),"data-testid":TEST_IDS.uploadItem,children:/*#__PURE__*/_jsxs("div",{className:"np-upload-item__body",children:[/*#__PURE__*/_jsx(UploadItemBody,{url:m?k:void 0,singleFileUpload:f,onDownload:a=>{e&&(a.preventDefault(),e(b))},children:/*#__PURE__*/_jsx("div",{className:"np-upload-button",children:/*#__PURE__*/_jsxs("div",{className:"media",children:[/*#__PURE__*/_jsx("div",{className:"np-upload-icon media-left",children:(()=>{if(j||h===Status.FAILED)return l?/*#__PURE__*/_jsx(StatusIcon,{size:Size.SMALL,sentiment:Sentiment.NEGATIVE}):/*#__PURE__*/_jsx(AlertCircle,{size:24,className:"text-negative"});let a;switch(h){case Status.PROCESSING:case Status.PENDING:a=/*#__PURE__*/_jsx(ProcessIndicator,{size:Size.EXTRA_SMALL,status:Status.PROCESSING});break;case Status.SUCCEEDED:case Status.DONE:default:a=l?/*#__PURE__*/_jsx(StatusIcon,{size:Size.SMALL,sentiment:Sentiment.POSITIVE}):/*#__PURE__*/_jsx(ProcessIndicator,{size:Size.EXTRA_SMALL,status:Status.SUCCEEDED});}return l?a:/*#__PURE__*/_jsx("span",{style:{transform:"scale(0.8335)"},children:a});// Scale down ProcessIndicator to be 20px*20px to match `icons`
2
- })()}),/*#__PURE__*/_jsxs("div",{className:"media-body text-xs-left","data-testid":TEST_IDS.mediaBody,children:[/*#__PURE__*/_jsx(Body,{className:"text-word-break d-block text-primary",children:(()=>i||g(MESSAGES.uploadedFile))()}),(()=>{if(j||h===Status.FAILED)return/*#__PURE__*/_jsx(Body,{type:Typography.BODY_DEFAULT_BOLD,className:"text-negative",children:n()});switch(h){case Status.PENDING:return/*#__PURE__*/_jsx(Body,{type:Typography.BODY_DEFAULT_BOLD,children:g(MESSAGES.uploading)});case Status.PROCESSING:return/*#__PURE__*/_jsx(Body,{children:g(MESSAGES.deleting)});case Status.SUCCEEDED:case Status.DONE:default:return/*#__PURE__*/_jsx(Body,{type:Typography.BODY_DEFAULT_BOLD,className:"text-positive",children:g(MESSAGES.uploaded)});}})()]})]})})}),c&&/*#__PURE__*/_jsx("button",{"aria-label":g(MESSAGES.removeFile,{filename:i}),className:classNames("btn","np-upload-item__remove-button","media-left",{"np-upload-item--single-file":f}),type:"button",onClick:()=>d(),children:/*#__PURE__*/_jsx(CrossCircleFill,{size:16})})]})})};export default UploadItem;
1
+ import _typeof from"@babel/runtime/helpers/typeof";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import{AlertCircle,CrossCircleFill}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import{useIntl}from"react-intl";import Body from"../../body";import{Size,Status,Typography,Sentiment}from"../../common";import ProcessIndicator from"../../processIndicator/ProcessIndicator";import StatusIcon from"../../statusIcon/StatusIcon";import MESSAGES from"./UploadItem.messages";import{UploadItemBody}from"./UploadItemBody";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export var TEST_IDS=/*#__PURE__*/function(a){return a.uploadItem="uploadItem",a.mediaBody="mediaBody",a}({});var UploadItem=function(a){var b=a.file,c=a.canDelete,d=a.onDelete,e=a.onDownload,f=a.singleFileUpload,g=useIntl(),h=g.formatMessage,i=b.status,j=b.filename,k=b.error,l=b.url,m=useTheme(),n=m.isModern,o=[Status.SUCCEEDED,void 0].includes(i)&&!!l,p=function(){return"object"===_typeof(k)&&k.message||k||h(MESSAGES.uploadingFailed)};return/*#__PURE__*/_jsx("div",{className:classNames("np-upload-item",{"np-upload-item__link":o}),"data-testid":TEST_IDS.uploadItem,children:/*#__PURE__*/_jsxs("div",{className:"np-upload-item__body",children:[/*#__PURE__*/_jsx(UploadItemBody,{url:o?l:void 0,singleFileUpload:f,onDownload:function onDownloadFile(a){e&&(a.preventDefault(),e(b))},children:/*#__PURE__*/_jsx("div",{className:"np-upload-button",children:/*#__PURE__*/_jsxs("div",{className:"media",children:[/*#__PURE__*/_jsx("div",{className:"np-upload-icon media-left",children:function getIcon(){if(k||i===Status.FAILED)return n?/*#__PURE__*/_jsx(StatusIcon,{size:Size.SMALL,sentiment:Sentiment.NEGATIVE}):/*#__PURE__*/_jsx(AlertCircle,{size:24,className:"text-negative"});var a;switch(i){case Status.PROCESSING:case Status.PENDING:a=/*#__PURE__*/_jsx(ProcessIndicator,{size:Size.EXTRA_SMALL,status:Status.PROCESSING});break;case Status.SUCCEEDED:case Status.DONE:default:a=n?/*#__PURE__*/_jsx(StatusIcon,{size:Size.SMALL,sentiment:Sentiment.POSITIVE}):/*#__PURE__*/_jsx(ProcessIndicator,{size:Size.EXTRA_SMALL,status:Status.SUCCEEDED});}return n?a:/*#__PURE__*/_jsx("span",{style:{transform:"scale(0.8335)"},children:a});// Scale down ProcessIndicator to be 20px*20px to match `icons`
2
+ }()}),/*#__PURE__*/_jsxs("div",{className:"media-body text-xs-left","data-testid":TEST_IDS.mediaBody,children:[/*#__PURE__*/_jsx(Body,{className:"text-word-break d-block text-primary",children:function getTitle(){return j||h(MESSAGES.uploadedFile)}()}),function getDescription(){if(k||i===Status.FAILED)return/*#__PURE__*/_jsx(Body,{type:Typography.BODY_DEFAULT_BOLD,className:"text-negative",children:p()});switch(i){case Status.PENDING:return/*#__PURE__*/_jsx(Body,{type:Typography.BODY_DEFAULT_BOLD,children:h(MESSAGES.uploading)});case Status.PROCESSING:return/*#__PURE__*/_jsx(Body,{children:h(MESSAGES.deleting)});case Status.SUCCEEDED:case Status.DONE:default:return/*#__PURE__*/_jsx(Body,{type:Typography.BODY_DEFAULT_BOLD,className:"text-positive",children:h(MESSAGES.uploaded)});}}()]})]})})}),c&&/*#__PURE__*/_jsx("button",{"aria-label":h(MESSAGES.removeFile,{filename:j}),className:classNames("btn","np-upload-item__remove-button","media-left",{"np-upload-item--single-file":f}),type:"button",onClick:function onClick(){return d()},children:/*#__PURE__*/_jsx(CrossCircleFill,{size:16})})]})})};export default UploadItem;
@@ -1 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import userEvent from"@testing-library/user-event";import{Status}from"../../common";import{render,screen}from"../../test-utils";import UploadItem from"./UploadItem";import{jsx as _jsx}from"react/jsx-runtime";describe("UploadItem",()=>{const a={file:{id:1,filename:"purchase-receipt.pdf",status:Status.SUCCEEDED,url:"https://wise.com"},canDelete:!0,onDelete:jest.fn(),singleFileUpload:!0},b=function(){let b=0<arguments.length&&arguments[0]!==void 0?arguments[0]:a;return render(/*#__PURE__*/_jsx(UploadItem,_objectSpread({},b)))};describe("filename",()=>{it("should display the filename",()=>{b(),expect(screen.getByText(a.file.filename)).toBeInTheDocument()}),it("should display the default filename when it is missing",()=>{b(_objectSpread(_objectSpread({},a),{},{file:_objectSpread(_objectSpread({},a.file),{},{filename:void 0})})),expect(screen.getByText("Uploaded file")).toBeInTheDocument()})}),describe("description",()=>{it("should display the default uploading copy while file upload is in progress",()=>{b(_objectSpread(_objectSpread({},a),{},{file:_objectSpread(_objectSpread({},a.file),{},{status:Status.PENDING})})),expect(screen.getByText("Uploading...")).toBeInTheDocument()}),it("should display the default deleting copy while file deletion is in progress",()=>{b(_objectSpread(_objectSpread({},a),{},{file:_objectSpread(_objectSpread({},a.file),{},{status:Status.PROCESSING})})),expect(screen.getByText("Deleting...")).toBeInTheDocument()}),it("should display the default success copy when file upload is complete",()=>{b(_objectSpread(_objectSpread({},a),{},{file:_objectSpread(_objectSpread({},a.file),{},{status:Status.SUCCEEDED})})),expect(screen.getByText("Uploaded")).toBeInTheDocument()})}),describe("failed uploads",()=>{it("should display the error.message from an API response",()=>{b(_objectSpread(_objectSpread({},a),{},{file:_objectSpread(_objectSpread({},a.file),{},{status:Status.FAILED,error:{message:"An API error object with message field"}})})),expect(screen.getByText("An API error object with message field")).toBeInTheDocument()}),it("should display the error if it is supplied as a string",()=>{b(_objectSpread(_objectSpread({},a),{},{file:_objectSpread(_objectSpread({},a.file),{},{status:Status.FAILED,error:"An API error string"})})),expect(screen.getByText("An API error string")).toBeInTheDocument()}),it("should display default error message when error is missing but status is FAILED",()=>{b(_objectSpread(_objectSpread({},a),{},{file:_objectSpread(_objectSpread({},a.file),{},{status:Status.FAILED})})),expect(screen.getByText("Uploading failed")).toBeInTheDocument()}),it("should display the error even if status is missing",()=>{b(_objectSpread(_objectSpread({},a),{},{file:_objectSpread(_objectSpread({},a.file),{},{error:"An API error string without status"})})),expect(screen.getByText("An API error string without status")).toBeInTheDocument()})}),describe("file deletion",()=>{it("should render the remove file button when deleteFile prop is supplied",()=>{b(),expect(screen.getByLabelText("Remove file ",{exact:!1})).toBeInTheDocument()}),it("should not render the remove file button when canDelete prop is false",()=>{b(_objectSpread(_objectSpread({},a),{},{canDelete:!1})),expect(screen.queryByLabelText("Remove file ",{exact:!1})).not.toBeInTheDocument()})}),describe("manual file download handler",()=>{it("calls onDownload handler provided through props",()=>{const c=jest.fn();b(_objectSpread(_objectSpread({},a),{},{onDownload:c})),userEvent.click(screen.getAllByRole("link")[0]),expect(c).toHaveBeenCalledTimes(1),expect(c).toHaveBeenCalledWith(a.file)})})});
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import userEvent from"@testing-library/user-event";import{Status}from"../../common";import{render,screen}from"../../test-utils";import UploadItem from"./UploadItem";import{jsx as _jsx}from"react/jsx-runtime";describe("UploadItem",function(){var a={file:{id:1,filename:"purchase-receipt.pdf",status:Status.SUCCEEDED,url:"https://wise.com"},canDelete:!0,onDelete:jest.fn(),singleFileUpload:!0},b=function(){var b=0<arguments.length&&arguments[0]!==void 0?arguments[0]:a;return render(/*#__PURE__*/_jsx(UploadItem,_objectSpread({},b)))};describe("filename",function(){it("should display the filename",function(){b(),expect(screen.getByText(a.file.filename)).toBeInTheDocument()}),it("should display the default filename when it is missing",function(){b(_objectSpread(_objectSpread({},a),{},{file:_objectSpread(_objectSpread({},a.file),{},{filename:void 0})})),expect(screen.getByText("Uploaded file")).toBeInTheDocument()})}),describe("description",function(){it("should display the default uploading copy while file upload is in progress",function(){b(_objectSpread(_objectSpread({},a),{},{file:_objectSpread(_objectSpread({},a.file),{},{status:Status.PENDING})})),expect(screen.getByText("Uploading...")).toBeInTheDocument()}),it("should display the default deleting copy while file deletion is in progress",function(){b(_objectSpread(_objectSpread({},a),{},{file:_objectSpread(_objectSpread({},a.file),{},{status:Status.PROCESSING})})),expect(screen.getByText("Deleting...")).toBeInTheDocument()}),it("should display the default success copy when file upload is complete",function(){b(_objectSpread(_objectSpread({},a),{},{file:_objectSpread(_objectSpread({},a.file),{},{status:Status.SUCCEEDED})})),expect(screen.getByText("Uploaded")).toBeInTheDocument()})}),describe("failed uploads",function(){it("should display the error.message from an API response",function(){b(_objectSpread(_objectSpread({},a),{},{file:_objectSpread(_objectSpread({},a.file),{},{status:Status.FAILED,error:{message:"An API error object with message field"}})})),expect(screen.getByText("An API error object with message field")).toBeInTheDocument()}),it("should display the error if it is supplied as a string",function(){b(_objectSpread(_objectSpread({},a),{},{file:_objectSpread(_objectSpread({},a.file),{},{status:Status.FAILED,error:"An API error string"})})),expect(screen.getByText("An API error string")).toBeInTheDocument()}),it("should display default error message when error is missing but status is FAILED",function(){b(_objectSpread(_objectSpread({},a),{},{file:_objectSpread(_objectSpread({},a.file),{},{status:Status.FAILED})})),expect(screen.getByText("Uploading failed")).toBeInTheDocument()}),it("should display the error even if status is missing",function(){b(_objectSpread(_objectSpread({},a),{},{file:_objectSpread(_objectSpread({},a.file),{},{error:"An API error string without status"})})),expect(screen.getByText("An API error string without status")).toBeInTheDocument()})}),describe("file deletion",function(){it("should render the remove file button when deleteFile prop is supplied",function(){b(),expect(screen.getByLabelText("Remove file ",{exact:!1})).toBeInTheDocument()}),it("should not render the remove file button when canDelete prop is false",function(){b(_objectSpread(_objectSpread({},a),{},{canDelete:!1})),expect(screen.queryByLabelText("Remove file ",{exact:!1})).not.toBeInTheDocument()})}),describe("manual file download handler",function(){it("calls onDownload handler provided through props",function(){var c=jest.fn();b(_objectSpread(_objectSpread({},a),{},{onDownload:c})),userEvent.click(screen.getAllByRole("link")[0]),expect(c).toHaveBeenCalledTimes(1),expect(c).toHaveBeenCalledWith(a.file)})})});
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";export const UploadItemBody=a=>{let{children:b,url:c,onDownload:d,singleFileUpload:e}=a;return c?/*#__PURE__*/_jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:e?"np-upload-item--single-file":"",onClick:d,children:b}):/*#__PURE__*/_jsx("div",{children:b})};
1
+ import{jsx as _jsx}from"react/jsx-runtime";export var UploadItemBody=function(a){var b=a.children,c=a.url,d=a.onDownload,e=a.singleFileUpload;return c?/*#__PURE__*/_jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:e?"np-upload-item--single-file":"",onClick:d,children:b}):/*#__PURE__*/_jsx("div",{children:b})};
@@ -1 +1 @@
1
- import"core-js/modules/web.dom-collections.iterator.js";import{logActionRequired}from"../logActionRequired";const deprecatedMessage=a=>{let{component:b,propName:c,message:d,expiryDate:e}=a;const f=["".concat(b," has deprecated the use of ").concat(c,".")];return d&&f.push(d),e&&f.push("".concat(c," will be removed on or after ").concat(e.toLocaleString("en-GB",{year:"numeric",month:"numeric",day:"numeric"}))),f.join(" ")},deprecated=(a,b)=>{let{component:c,message:d="",newProp:e=null,expiryDate:f=null}=b;return function(b,g){const h=e?"Please use ".concat(e," instead."):d;null!=b[g]&&"undefined"!=typeof b[g]&&logActionRequired(deprecatedMessage({component:c,propName:g,message:h,expiryDate:f}));for(var i=arguments.length,j=Array(2<i?i-2:0),k=2;k<i;k++)j[k-2]=arguments[k];return a(b,g,...j)}};export default deprecated;
1
+ import"core-js/modules/es.array.concat.js";import"core-js/modules/es.array.join.js";import{logActionRequired}from"../logActionRequired";var deprecatedMessage=function(a){var b=a.component,c=a.propName,d=a.message,e=a.expiryDate,f=["".concat(b," has deprecated the use of ").concat(c,".")];return d&&f.push(d),e&&f.push("".concat(c," will be removed on or after ").concat(e.toLocaleString("en-GB",{year:"numeric",month:"numeric",day:"numeric"}))),f.join(" ")},deprecated=function(a,b){var c=b.component,d=b.message,e=void 0===d?"":d,f=b.newProp,g=void 0===f?null:f,h=b.expiryDate,i=void 0===h?null:h;return function(b,d){var f=g?"Please use ".concat(g," instead."):e;null!=b[d]&&"undefined"!=typeof b[d]&&logActionRequired(deprecatedMessage({component:c,propName:d,message:f,expiryDate:i}));for(var h=arguments.length,j=Array(2<h?h-2:0),k=2;k<h;k++)j[k-2]=arguments[k];return a.apply(void 0,[b,d].concat(j))}};export default deprecated;
@@ -1,8 +1,7 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import"core-js/modules/web.dom-collections.iterator.js";import PropTypes from"prop-types";import{Component}from"react";import{HistoryNavigator}from"../common";import{formatWithPattern,getCountOfSymbolsInSelection,getCursorPositionAfterKeystroke,unformatWithPattern,getDistanceToPreviousSymbol,getDistanceToNextSymbol}from"../common/textFormat";class WithDisplayFormat extends Component{constructor(a){super(a),_defineProperty(this,"getUserAction",a=>{const{triggerEvent:b,triggerType:c,value:d}=this.state,{displayPattern:e}=this.props,f=String.fromCharCode(b.which).toLowerCase();return"Paste"===c||"Cut"===c?c:(b.ctrlKey||b.metaKey)&&"z"===f?b.shiftKey?"Redo":"Undo":b.ctrlKey&&"d"===f?"Delete":"undefined"==typeof b.key&&a.length<=unformatWithPattern(d,e).length?"Backspace":b.key;// Detect mouse event redo
1
+ import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.reflect.construct.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import"core-js/modules/es.array.splice.js";import"core-js/modules/es.array.join.js";import"core-js/modules/es.function.name.js";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import PropTypes from"prop-types";import{Component}from"react";import{HistoryNavigator}from"../common";import{formatWithPattern,getCountOfSymbolsInSelection,getCursorPositionAfterKeystroke,unformatWithPattern,getDistanceToPreviousSymbol,getDistanceToNextSymbol}from"../common/textFormat";var WithDisplayFormat=/*#__PURE__*/function(a){function b(a){var d;_classCallCheck(this,b),d=c.call(this,a),_defineProperty(_assertThisInitialized(d),"getUserAction",function(a){var b=d.state,c=b.triggerEvent,e=b.triggerType,f=b.value,g=d.props.displayPattern,h=String.fromCharCode(c.which).toLowerCase();return"Paste"===e||"Cut"===e?e:(c.ctrlKey||c.metaKey)&&"z"===h?c.shiftKey?"Redo":"Undo":c.ctrlKey&&"d"===h?"Delete":"undefined"==typeof c.key&&a.length<=unformatWithPattern(f,g).length?"Backspace":c.key;// Detect mouse event redo
2
2
  // Android Fix.
3
- }),_defineProperty(this,"resetEvent",()=>{this.setState({triggerType:null,triggerEvent:null,pastedLength:0})}),_defineProperty(this,"detectUndoRedo",a=>{const b=String.fromCharCode(a.which).toLowerCase();return(a.ctrlKey||a.metaKey)&&"z"===b?a.shiftKey?"Redo":"Undo":null}),_defineProperty(this,"handleOnKeyDown",a=>{a.persist();const{selectionStart:b,selectionEnd:c}=a.target,{historyNavigator:d}=this.state,{displayPattern:e}=this.props;// Unfortunately Undo and Redo don't trigger OnChange event so we need to handle some value logic here.
4
- let f="";"Undo"===this.detectUndoRedo(a)?(f=formatWithPattern(d.undo(),e),this.setState({value:f,triggerType:"Undo"})):"Redo"===this.detectUndoRedo(a)?(f=formatWithPattern(d.redo(),e),this.setState({value:f,triggerType:"Redo"})):this.setState({triggerEvent:a,triggerType:"KeyDown",selectionStart:b,selectionEnd:c})}),_defineProperty(this,"handleOnPaste",a=>{const{displayPattern:b}=this.props,c=unformatWithPattern(a.clipboardData.getData("Text"),b).length;this.setState({triggerType:"Paste",pastedLength:c})}),_defineProperty(this,"handleOnCut",()=>{this.setState({triggerType:"Cut"})}),_defineProperty(this,"isKeyAllowed",a=>{const{displayPattern:b}=this.props,c=b.split("").filter(a=>"*"!==a);return!c.includes(a)}),_defineProperty(this,"handleOnChange",a=>{const{historyNavigator:b,triggerEvent:c,triggerType:d}=this.state,{displayPattern:e,onChange:f}=this.props,{value:g}=a.target;let h=unformatWithPattern(g,e);const i=null===c?// triggerEvent can be null only in case of "autofilling" (via password manager extension or browser build-in one) events
5
- "Paste":this.getUserAction(h);if(this.isKeyAllowed(i)&&"Undo"!==d&&"Redo"!==d){("Backspace"===i||"Delete"===i)&&(h=this.handleDelete(h,i));const a=formatWithPattern(h,e);b.add(h),this.handleCursorPositioning(i);const c=unformatWithPattern(a,e);this.setState({value:a},this.resetEvent(),f(c))}}),_defineProperty(this,"handleOnBlur",a=>{const{displayPattern:b,onBlur:c}=this.props;c&&c(unformatWithPattern(a.target.value,b))}),_defineProperty(this,"handleOnFocus",a=>{const{displayPattern:b,onFocus:c}=this.props;c&&(this.handleOnChange(a),c(unformatWithPattern(a.target.value,b)))}),_defineProperty(this,"handleDelete",(a,b)=>{const{displayPattern:c}=this.props,{selectionStart:d,selectionEnd:e}=this.state,f=[...a];if(d===e){let a=d-getCountOfSymbolsInSelection(0,d,c),e=0,g=getDistanceToNextSymbol(d,c);"Backspace"===b&&(a-=1,g=getDistanceToPreviousSymbol(d,c)),0<=a&&g&&(e=1),f.splice(a,e)}return f.join("")}),_defineProperty(this,"handleCursorPositioning",a=>{const{displayPattern:b}=this.props,{triggerEvent:c,selectionStart:d,selectionEnd:e,pastedLength:f}=this.state,g=getCursorPositionAfterKeystroke(a,d,e,b,f);setTimeout(()=>{c&&c.target.setSelectionRange(g,g),this.setState({selectionStart:g,selectionEnd:g})},0)});const{value:b,displayPattern:c}=a,d=unformatWithPattern(b,c);this.state={value:formatWithPattern(d,c),historyNavigator:new HistoryNavigator,prevDisplayPattern:a.displayPattern,triggerType:null,triggerEvent:null}}static getDerivedStateFromProps(a,b){const{displayPattern:c}=a,{prevDisplayPattern:d}=b;if(b.prevDisplayPattern!==c){const{value:a,historyNavigator:e}=b,f=unformatWithPattern(a,d);return e.reset(),{prevDisplayPattern:c,value:formatWithPattern(f,c),triggerType:null,triggerEvent:null,pastedLength:0}}return null}render(){const{type:a,inputMode:b,className:c,id:d,name:e,placeholder:f,readOnly:g,required:h,minLength:i,maxLength:j,disabled:k,autoComplete:l}=this.props,{value:m}=this.state,n={type:a,inputMode:b,className:c,id:d,name:e,placeholder:f,readOnly:g,required:h,minLength:i,maxLength:j,disabled:k,autoComplete:l,value:m,onFocus:this.handleOnFocus,onBlur:this.handleOnBlur,onPaste:this.handleOnPaste,onKeyDown:this.handleOnKeyDown,onChange:this.handleOnChange,onCut:this.handleOnCut};return this.props.render(n)}}WithDisplayFormat.propTypes={/**
3
+ }),_defineProperty(_assertThisInitialized(d),"resetEvent",function(){d.setState({triggerType:null,triggerEvent:null,pastedLength:0})}),_defineProperty(_assertThisInitialized(d),"detectUndoRedo",function(a){var b=String.fromCharCode(a.which).toLowerCase();return(a.ctrlKey||a.metaKey)&&"z"===b?a.shiftKey?"Redo":"Undo":null}),_defineProperty(_assertThisInitialized(d),"handleOnKeyDown",function(a){a.persist();var b=a.target,c=b.selectionStart,e=b.selectionEnd,f=d.state.historyNavigator,g=d.props.displayPattern,h="";"Undo"===d.detectUndoRedo(a)?(h=formatWithPattern(f.undo(),g),d.setState({value:h,triggerType:"Undo"})):"Redo"===d.detectUndoRedo(a)?(h=formatWithPattern(f.redo(),g),d.setState({value:h,triggerType:"Redo"})):d.setState({triggerEvent:a,triggerType:"KeyDown",selectionStart:c,selectionEnd:e})}),_defineProperty(_assertThisInitialized(d),"handleOnPaste",function(a){var b=d.props.displayPattern,c=unformatWithPattern(a.clipboardData.getData("Text"),b).length;d.setState({triggerType:"Paste",pastedLength:c})}),_defineProperty(_assertThisInitialized(d),"handleOnCut",function(){d.setState({triggerType:"Cut"})}),_defineProperty(_assertThisInitialized(d),"isKeyAllowed",function(a){var b=d.props.displayPattern,c=b.split("").filter(function(a){return"*"!==a});return!c.includes(a)}),_defineProperty(_assertThisInitialized(d),"handleOnChange",function(a){var b=d.state,c=b.historyNavigator,e=b.triggerEvent,f=b.triggerType,g=d.props,h=g.displayPattern,i=g.onChange,j=a.target.value,k=unformatWithPattern(j,h),l=null===e?// triggerEvent can be null only in case of "autofilling" (via password manager extension or browser build-in one) events
4
+ "Paste":d.getUserAction(k);if(d.isKeyAllowed(l)&&"Undo"!==f&&"Redo"!==f){("Backspace"===l||"Delete"===l)&&(k=d.handleDelete(k,l));var m=formatWithPattern(k,h);c.add(k),d.handleCursorPositioning(l);var n=unformatWithPattern(m,h);d.setState({value:m},d.resetEvent(),i(n))}}),_defineProperty(_assertThisInitialized(d),"handleOnBlur",function(a){var b=d.props,c=b.displayPattern,e=b.onBlur;e&&e(unformatWithPattern(a.target.value,c))}),_defineProperty(_assertThisInitialized(d),"handleOnFocus",function(a){var b=d.props,c=b.displayPattern,e=b.onFocus;e&&(d.handleOnChange(a),e(unformatWithPattern(a.target.value,c)))}),_defineProperty(_assertThisInitialized(d),"handleDelete",function(a,b){var c=d.props.displayPattern,e=d.state,f=e.selectionStart,g=e.selectionEnd,h=_toConsumableArray(a);if(f===g){var i=f-getCountOfSymbolsInSelection(0,f,c),j=0,k=getDistanceToNextSymbol(f,c);"Backspace"===b&&(i-=1,k=getDistanceToPreviousSymbol(f,c)),0<=i&&k&&(j=1),h.splice(i,j)}return h.join("")}),_defineProperty(_assertThisInitialized(d),"handleCursorPositioning",function(a){var b=d.props.displayPattern,c=d.state,e=c.triggerEvent,f=c.selectionStart,g=c.selectionEnd,h=c.pastedLength,i=getCursorPositionAfterKeystroke(a,f,g,b,h);setTimeout(function(){e&&e.target.setSelectionRange(i,i),d.setState({selectionStart:i,selectionEnd:i})},0)});var e=a.value,f=a.displayPattern,g=unformatWithPattern(e,f);return d.state={value:formatWithPattern(g,f),historyNavigator:new HistoryNavigator,prevDisplayPattern:a.displayPattern,triggerType:null,triggerEvent:null},d}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this.props,b=a.type,c=a.inputMode,d=a.className,e=a.id,f=a.name,g=a.placeholder,h=a.readOnly,i=a.required,j=a.minLength,k=a.maxLength,l=a.disabled,m=a.autoComplete,n=this.state.value,o={type:b,inputMode:c,className:d,id:e,name:f,placeholder:g,readOnly:h,required:i,minLength:j,maxLength:k,disabled:l,autoComplete:m,value:n,onFocus:this.handleOnFocus,onBlur:this.handleOnBlur,onPaste:this.handleOnPaste,onKeyDown:this.handleOnKeyDown,onChange:this.handleOnChange,onCut:this.handleOnCut};return this.props.render(o)}}],[{key:"getDerivedStateFromProps",value:function getDerivedStateFromProps(a,b){var c=a.displayPattern,d=b.prevDisplayPattern;if(b.prevDisplayPattern!==c){var e=b.value,f=b.historyNavigator,g=unformatWithPattern(e,d);return f.reset(),{prevDisplayPattern:c,value:formatWithPattern(g,c),triggerType:null,triggerEvent:null,pastedLength:0}}return null}}]),b}(Component);WithDisplayFormat.propTypes={/**
6
5
  * autocomplete hides our form help so we need to disable it when help text
7
6
  * is present. Chrome ignores autocomplete=off, the only way to disable it is
8
7
  * to provide an 'invalid' value, for which 'disabled' serves.
@@ -1 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"core-js/modules/web.dom-collections.iterator.js";import{useState,useEffect}from"react";import{createPortal}from"react-dom";import{jsx as _jsx}from"react/jsx-runtime";export default function withNextPortalWrapper(a){return function(b){const[c,d]=useState(!1);return useEffect(()=>{d(!0)},[d]),c?/*#__PURE__*/createPortal(/*#__PURE__*/_jsx(a,_objectSpread({},b)),document.body):null}}
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{useState,useEffect}from"react";import{createPortal}from"react-dom";import{jsx as _jsx}from"react/jsx-runtime";export default function withNextPortalWrapper(a){return function(b){var c=useState(!1),d=_slicedToArray(c,2),e=d[0],f=d[1];return useEffect(function(){f(!0)},[f]),e?/*#__PURE__*/createPortal(/*#__PURE__*/_jsx(a,_objectSpread({},b)),document.body):null}}