@transferwise/components 0.0.0-experimental-5e2f01a → 0.0.0-experimental-d8ad171

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 (611) 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 +1 -1
  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/EmphasisHtmlTransformer.js +2 -2
  132. package/build/es/no-polyfill/flowNavigation/FlowNavigation.js +2 -2
  133. package/build/es/no-polyfill/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
  134. package/build/es/no-polyfill/flowNavigation/backButton/BackButton.js +1 -1
  135. package/build/es/no-polyfill/header/Header.js +2 -2
  136. package/build/es/no-polyfill/header/Header.spec.js +1 -1
  137. package/build/es/no-polyfill/header/Header.story.js +2 -1
  138. package/build/es/no-polyfill/i18n/index.js +1 -1
  139. package/build/es/no-polyfill/image/Image.js +2 -2
  140. package/build/es/no-polyfill/info/Info.js +1 -1
  141. package/build/es/no-polyfill/info/Info.story.js +1 -1
  142. package/build/es/no-polyfill/info/infoPresentations.js +1 -1
  143. package/build/es/no-polyfill/inlineAlert/InlineAlert.js +1 -1
  144. package/build/es/no-polyfill/inputWithDisplayFormat/InputWithDisplayFormat.js +1 -1
  145. package/build/es/no-polyfill/inputs/Input.js +1 -1
  146. package/build/es/no-polyfill/inputs/TextArea.js +1 -1
  147. package/build/es/no-polyfill/inputs/_common.js +2 -2
  148. package/build/es/no-polyfill/instructionsList/InstructionsList.js +3 -3
  149. package/build/es/no-polyfill/link/Link.js +2 -2
  150. package/build/es/no-polyfill/link/Link.spec.js +1 -1
  151. package/build/es/no-polyfill/link/Link.story.js +1 -1
  152. package/build/es/no-polyfill/listItem/ListItem.js +1 -1
  153. package/build/es/no-polyfill/listItem/ListItem.spec.js +1 -1
  154. package/build/es/no-polyfill/listItem/ListItem.story.js +1 -1
  155. package/build/es/no-polyfill/loader/Loader.js +2 -2
  156. package/build/es/no-polyfill/loader/Loader.story.js +1 -1
  157. package/build/es/no-polyfill/logo/Logo.js +1 -1
  158. package/build/es/no-polyfill/logo/Logo.story.js +1 -1
  159. package/build/es/no-polyfill/logo/logoTypes.js +1 -1
  160. package/build/es/no-polyfill/markdown/Markdown.js +1 -1
  161. package/build/es/no-polyfill/modal/Modal.js +1 -1
  162. package/build/es/no-polyfill/modal/Modal.story.js +2 -2
  163. package/build/es/no-polyfill/money/Money.js +1 -1
  164. package/build/es/no-polyfill/money/Money.story.js +1 -1
  165. package/build/es/no-polyfill/moneyInput/MoneyInput.js +1 -1
  166. package/build/es/no-polyfill/moneyInput/MoneyInput.story.js +1 -1
  167. package/build/es/no-polyfill/moneyInput/currencyFormatting.js +2 -2
  168. package/build/es/no-polyfill/navigationOption/NavigationOption.js +1 -1
  169. package/build/es/no-polyfill/navigationOptionsList/NavigationOptionsList.js +1 -1
  170. package/build/es/no-polyfill/nudge/Nudge.js +1 -1
  171. package/build/es/no-polyfill/overlayHeader/OverlayHeader.js +1 -1
  172. package/build/es/no-polyfill/phoneNumberInput/PhoneNumberInput.js +1 -1
  173. package/build/es/no-polyfill/phoneNumberInput/data/countries.js +1 -1
  174. package/build/es/no-polyfill/phoneNumberInput/utils/cleanNumber/cleanNumber.js +1 -1
  175. package/build/es/no-polyfill/phoneNumberInput/utils/excludeCountries/excludeCountries.js +2 -2
  176. package/build/es/no-polyfill/phoneNumberInput/utils/explodeNumberModel/index.js +1 -1
  177. package/build/es/no-polyfill/phoneNumberInput/utils/filterOptionsForQuery/index.js +1 -1
  178. package/build/es/no-polyfill/phoneNumberInput/utils/findCountryByCode/index.js +1 -1
  179. package/build/es/no-polyfill/phoneNumberInput/utils/findCountryByPrefix/index.js +1 -1
  180. package/build/es/no-polyfill/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.js +1 -1
  181. package/build/es/no-polyfill/phoneNumberInput/utils/isOptionAndFitsQuery/isOptionAndFitsQuery.js +1 -1
  182. package/build/es/no-polyfill/phoneNumberInput/utils/isStringNumeric/isStringNumeric.js +1 -1
  183. package/build/es/no-polyfill/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js +1 -1
  184. package/build/es/no-polyfill/phoneNumberInput/utils/longestMatchingPrefix/index.js +1 -1
  185. package/build/es/no-polyfill/phoneNumberInput/utils/setDefaultPrefix/index.js +3 -3
  186. package/build/es/no-polyfill/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.js +2 -2
  187. package/build/es/no-polyfill/popover/Popover.js +2 -2
  188. package/build/es/no-polyfill/processIndicator/ProcessIndicator.js +4 -4
  189. package/build/es/no-polyfill/progress/Progress.js +1 -1
  190. package/build/es/no-polyfill/progress/Progress.story.js +1 -1
  191. package/build/es/no-polyfill/progressBar/ProgressBar.js +1 -1
  192. package/build/es/no-polyfill/progressBar/ProgressBar.story.js +1 -1
  193. package/build/es/no-polyfill/provider/Provider.js +1 -1
  194. package/build/es/no-polyfill/provider/Provider.spec.js +1 -1
  195. package/build/es/no-polyfill/provider/Provider.story.js +1 -1
  196. package/build/es/no-polyfill/provider/direction/DirectionProvider.js +1 -1
  197. package/build/es/no-polyfill/provider/direction/DirectionProvider.spec.js +1 -1
  198. package/build/es/no-polyfill/provider/language/LanguageProvider.js +1 -1
  199. package/build/es/no-polyfill/provider/language/LanguageProvider.spec.js +1 -1
  200. package/build/es/no-polyfill/radio/Radio.js +1 -1
  201. package/build/es/no-polyfill/radioGroup/RadioGroup.js +2 -2
  202. package/build/es/no-polyfill/radioOption/RadioOption.js +1 -1
  203. package/build/es/no-polyfill/section/Section.js +1 -1
  204. package/build/es/no-polyfill/section/Section.spec.js +1 -1
  205. package/build/es/no-polyfill/section/Section.story.js +1 -1
  206. package/build/es/no-polyfill/select/Select.js +8 -9
  207. package/build/es/no-polyfill/select/option/Option.js +1 -1
  208. package/build/es/no-polyfill/select/searchBox/SearchBox.js +1 -1
  209. package/build/es/no-polyfill/sizeSwapper/SizeSwapper.js +3 -3
  210. package/build/es/no-polyfill/slidingPanel/SlidingPanel.js +2 -2
  211. package/build/es/no-polyfill/snackbar/Snackbar.js +1 -1
  212. package/build/es/no-polyfill/snackbar/SnackbarContext.js +1 -1
  213. package/build/es/no-polyfill/snackbar/SnackbarProvider.js +1 -1
  214. package/build/es/no-polyfill/snackbar/useSnackbar.js +1 -1
  215. package/build/es/no-polyfill/statusIcon/StatusIcon.js +1 -1
  216. package/build/es/no-polyfill/statusIcon/StatusIcon.story.js +1 -1
  217. package/build/es/no-polyfill/stepper/Stepper.js +1 -1
  218. package/build/es/no-polyfill/stepper/deviceDetection.js +2 -2
  219. package/build/es/no-polyfill/sticky/Sticky.js +1 -1
  220. package/build/es/no-polyfill/summary/Summary.js +1 -1
  221. package/build/es/no-polyfill/switch/Switch.js +1 -1
  222. package/build/es/no-polyfill/switch/Switch.story.js +1 -1
  223. package/build/es/no-polyfill/switchOption/SwitchOption.js +1 -1
  224. package/build/es/no-polyfill/switchOption/SwitchOption.story.js +1 -1
  225. package/build/es/no-polyfill/tabs/Tab.js +1 -1
  226. package/build/es/no-polyfill/tabs/TabList.js +1 -1
  227. package/build/es/no-polyfill/tabs/TabPanel.js +1 -1
  228. package/build/es/no-polyfill/tabs/Tabs.js +1 -5
  229. package/build/es/no-polyfill/tabs/utils.js +2 -2
  230. package/build/es/no-polyfill/textareaWithDisplayFormat/TextareaWithDisplayFormat.js +1 -1
  231. package/build/es/no-polyfill/tile/Tile.js +1 -1
  232. package/build/es/no-polyfill/title/Title.js +1 -1
  233. package/build/es/no-polyfill/title/Title.spec.js +1 -1
  234. package/build/es/no-polyfill/title/Title.story.js +1 -1
  235. package/build/es/no-polyfill/tooltip/Tooltip.js +7 -7
  236. package/build/es/no-polyfill/tooltip/Tooltip.spec.js +1 -1
  237. package/build/es/no-polyfill/tooltip/Tooltip.story.js +1 -1
  238. package/build/es/no-polyfill/typeahead/Typeahead.js +1 -1
  239. package/build/es/no-polyfill/typeahead/typeaheadInput/TypeaheadInput.js +1 -1
  240. package/build/es/no-polyfill/typeahead/typeaheadOption/TypeaheadOption.js +1 -1
  241. package/build/es/no-polyfill/typeahead/util/highlight.js +1 -1
  242. package/build/es/no-polyfill/upload/Upload.js +2 -6
  243. package/build/es/no-polyfill/upload/steps/completeStep/completeStep.js +1 -1
  244. package/build/es/no-polyfill/upload/steps/mediaUploadStep/mediaUploadStep.js +1 -1
  245. package/build/es/no-polyfill/upload/steps/processingStep/processingStep.js +1 -1
  246. package/build/es/no-polyfill/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
  247. package/build/es/no-polyfill/upload/uploadSteps.js +1 -1
  248. package/build/es/no-polyfill/upload/utils/asyncFileRead/asyncFileRead.js +1 -1
  249. package/build/es/no-polyfill/upload/utils/getFileType/getFileType.js +1 -1
  250. package/build/es/no-polyfill/upload/utils/getSupportedSpotMimeTypes/getSupportedSpotMimeTypes.js +1 -1
  251. package/build/es/no-polyfill/upload/utils/isSizeValid/isSizeValid.js +1 -1
  252. package/build/es/no-polyfill/upload/utils/isTypeValid/isTypeValid.js +1 -1
  253. package/build/es/no-polyfill/upload/utils/postData/postData.js +1 -1
  254. package/build/es/no-polyfill/upload/utils/requestMedia/requestMedia.js +1 -1
  255. package/build/es/no-polyfill/uploadInput/UploadInput.js +7 -7
  256. package/build/es/no-polyfill/uploadInput/UploadInput.spec.js +1 -1
  257. package/build/es/no-polyfill/uploadInput/UploadInput.story.js +1 -1
  258. package/build/es/no-polyfill/uploadInput/uploadButton/UploadButton.js +1 -1
  259. package/build/es/no-polyfill/uploadInput/uploadButton/UploadButton.spec.js +3 -3
  260. package/build/es/no-polyfill/uploadInput/uploadButton/defaults.js +1 -1
  261. package/build/es/no-polyfill/uploadInput/uploadButton/getAllowedFileTypes.js +3 -3
  262. package/build/es/no-polyfill/uploadInput/uploadButton/getAllowedFileTypes.spec.js +1 -1
  263. package/build/es/no-polyfill/uploadInput/uploadItem/UploadItem.js +2 -2
  264. package/build/es/no-polyfill/uploadInput/uploadItem/UploadItem.spec.js +1 -1
  265. package/build/es/no-polyfill/uploadInput/uploadItem/UploadItemBody.js +1 -1
  266. package/build/es/no-polyfill/utilities/deprecatedProperty/deprecatedProperty.js +1 -1
  267. package/build/es/no-polyfill/utilities/logActionRequired.js +1 -1
  268. package/build/es/no-polyfill/withDisplayFormat/WithDisplayFormat.js +3 -4
  269. package/build/es/no-polyfill/withNextPortal/withNextPortal.js +1 -1
  270. package/build/es/polyfill/accordion/Accordion.js +1 -1
  271. package/build/es/polyfill/accordion/Accordion.story.js +1 -1
  272. package/build/es/polyfill/accordion/AccordionItem/AccordionItem.js +1 -1
  273. package/build/es/polyfill/actionButton/ActionButton.js +1 -1
  274. package/build/es/polyfill/actionButton/ActionButton.spec.js +1 -1
  275. package/build/es/polyfill/actionButton/ActionButton.story.js +1 -1
  276. package/build/es/polyfill/actionOption/ActionOption.js +1 -1
  277. package/build/es/polyfill/actionOption/ActionOption.story.js +1 -1
  278. package/build/es/polyfill/alert/Alert.js +1 -1
  279. package/build/es/polyfill/alert/Alert.story.js +1 -1
  280. package/build/es/polyfill/alert/inlineMarkdown/InlineMarkdown.js +1 -1
  281. package/build/es/polyfill/alert/withArrow/alertArrowPositions.js +1 -1
  282. package/build/es/polyfill/alert/withArrow/withArrow.js +1 -1
  283. package/build/es/polyfill/avatar/Avatar.js +1 -1
  284. package/build/es/polyfill/avatar/Avatar.story.js +1 -1
  285. package/build/es/polyfill/avatar/avatarTypes.js +1 -1
  286. package/build/es/polyfill/avatar/colors/colors.js +2 -2
  287. package/build/es/polyfill/avatarWrapper/AvatarWrapper.js +1 -1
  288. package/build/es/polyfill/avatarWrapper/AvatarWrapper.story.js +1 -1
  289. package/build/es/polyfill/badge/Badge.js +1 -1
  290. package/build/es/polyfill/body/Body.js +2 -2
  291. package/build/es/polyfill/body/Body.spec.js +1 -1
  292. package/build/es/polyfill/body/Body.story.js +1 -1
  293. package/build/es/polyfill/button/Button.js +5 -5
  294. package/build/es/polyfill/button/Button.story.js +1 -1
  295. package/build/es/polyfill/button/classMap.js +1 -1
  296. package/build/es/polyfill/button/legacyUtils/legacyUtils.js +2 -2
  297. package/build/es/polyfill/card/Card.js +1 -1
  298. package/build/es/polyfill/checkbox/Checkbox.js +1 -1
  299. package/build/es/polyfill/checkbox/Checkbox.story.js +1 -1
  300. package/build/es/polyfill/checkboxButton/CheckboxButton.js +1 -1
  301. package/build/es/polyfill/checkboxButton/CheckboxButton.spec.js +1 -1
  302. package/build/es/polyfill/checkboxButton/CheckboxButton.story.js +1 -1
  303. package/build/es/polyfill/checkboxOption/CheckboxOption.js +1 -1
  304. package/build/es/polyfill/checkboxOption/CheckboxOption.spec.js +1 -1
  305. package/build/es/polyfill/checkboxOption/CheckboxOption.story.js +1 -1
  306. package/build/es/polyfill/chevron/Chevron.js +1 -1
  307. package/build/es/polyfill/chevron/Chevron.story.js +1 -1
  308. package/build/es/polyfill/chips/Chip.js +1 -1
  309. package/build/es/polyfill/chips/Chips.js +1 -1
  310. package/build/es/polyfill/chips/Chips.spec.js +1 -1
  311. package/build/es/polyfill/chips/Chips.story.js +1 -1
  312. package/build/es/polyfill/circularButton/CircularButton.js +1 -1
  313. package/build/es/polyfill/common/DOMOperations/DOMOperations.js +3 -3
  314. package/build/es/polyfill/common/Option/Option.js +1 -1
  315. package/build/es/polyfill/common/RadioButton/RadioButton.js +1 -1
  316. package/build/es/polyfill/common/bottomSheet/BottomSheet.js +4 -4
  317. package/build/es/polyfill/common/bottomSheet/BottomSheet.spec.js +1 -1
  318. package/build/es/polyfill/common/bottomSheet/BottomSheet.story.js +2 -2
  319. package/build/es/polyfill/common/closeButton/CloseButton.js +1 -1
  320. package/build/es/polyfill/common/dateUtils/getDayNames/getDayNames.js +2 -2
  321. package/build/es/polyfill/common/dateUtils/getMonthNames/getMonthNames.js +1 -1
  322. package/build/es/polyfill/common/dateUtils/isDateValid/isDateValid.js +1 -1
  323. package/build/es/polyfill/common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.js +1 -1
  324. package/build/es/polyfill/common/deviceDetection/deviceDetection.js +1 -1
  325. package/build/es/polyfill/common/direction.js +1 -1
  326. package/build/es/polyfill/common/domHelpers/index.js +1 -1
  327. package/build/es/polyfill/common/fakeEvents.js +1 -1
  328. package/build/es/polyfill/common/fileType.js +1 -1
  329. package/build/es/polyfill/common/flowHeader/FlowHeader.js +1 -1
  330. package/build/es/polyfill/common/focusBoundary/FocusBoundary.js +1 -1
  331. package/build/es/polyfill/common/focusBoundary/FocusBoundary.spec.js +1 -1
  332. package/build/es/polyfill/common/focusBoundary/utils/getFocusableElements.js +2 -2
  333. package/build/es/polyfill/common/focusBoundary/utils/resetFocus.js +1 -1
  334. package/build/es/polyfill/common/historyNavigator/historyNavigator.js +1 -1
  335. package/build/es/polyfill/common/hooks/useClientWidth/useClientWidth.js +3 -3
  336. package/build/es/polyfill/common/hooks/useConditionalListener/useConditionalListener.js +1 -1
  337. package/build/es/polyfill/common/hooks/useDirection/useDirection.js +1 -1
  338. package/build/es/polyfill/common/hooks/useHasIntersected/useHasIntersected.js +2 -2
  339. package/build/es/polyfill/common/hooks/useLayout/useLayout.js +1 -1
  340. package/build/es/polyfill/common/key.js +1 -1
  341. package/build/es/polyfill/common/locale/index.js +8 -8
  342. package/build/es/polyfill/common/panel/Panel.js +6 -6
  343. package/build/es/polyfill/common/propsValues/breakpoint.js +1 -1
  344. package/build/es/polyfill/common/propsValues/control.js +1 -1
  345. package/build/es/polyfill/common/propsValues/dateMode.js +1 -1
  346. package/build/es/polyfill/common/propsValues/layouts.js +1 -1
  347. package/build/es/polyfill/common/propsValues/markdownNodeType.js +1 -1
  348. package/build/es/polyfill/common/propsValues/monthFormat.js +1 -1
  349. package/build/es/polyfill/common/propsValues/position.js +1 -1
  350. package/build/es/polyfill/common/propsValues/profileType.js +1 -1
  351. package/build/es/polyfill/common/propsValues/scroll.js +1 -1
  352. package/build/es/polyfill/common/propsValues/sentiment.js +1 -1
  353. package/build/es/polyfill/common/propsValues/size.js +1 -1
  354. package/build/es/polyfill/common/propsValues/status.js +1 -1
  355. package/build/es/polyfill/common/propsValues/type.js +1 -1
  356. package/build/es/polyfill/common/propsValues/typography.js +1 -1
  357. package/build/es/polyfill/common/propsValues/variant.js +1 -1
  358. package/build/es/polyfill/common/propsValues/width.js +1 -1
  359. package/build/es/polyfill/common/requirements.js +2 -2
  360. package/build/es/polyfill/common/responsivePanel/ResponsivePanel.js +1 -1
  361. package/build/es/polyfill/common/textFormat/formatWithPattern/formatWithPattern.js +2 -2
  362. package/build/es/polyfill/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.js +1 -1
  363. package/build/es/polyfill/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js +1 -1
  364. package/build/es/polyfill/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js +1 -1
  365. package/build/es/polyfill/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js +1 -1
  366. package/build/es/polyfill/common/textFormat/unformatWithPattern/unformatWithPattern.js +1 -1
  367. package/build/es/polyfill/common/theme.js +1 -1
  368. package/build/es/polyfill/criticalBanner/CriticalCommsBanner.js +1 -1
  369. package/build/es/polyfill/criticalBanner/CriticalCommsBanner.story.js +1 -1
  370. package/build/es/polyfill/dateInput/DateInput.js +4 -10
  371. package/build/es/polyfill/dateInput/DateInput.story.js +1 -1
  372. package/build/es/polyfill/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.js +1 -1
  373. package/build/es/polyfill/dateInput/utils/explodeDate/explodeDate.js +1 -1
  374. package/build/es/polyfill/dateLookup/DateLookup.js +3 -4
  375. package/build/es/polyfill/dateLookup/dateHeader/DateHeader.js +1 -1
  376. package/build/es/polyfill/dateLookup/dateTrigger/DateTrigger.js +1 -1
  377. package/build/es/polyfill/dateLookup/dayCalendar/DayCalendar.js +1 -1
  378. package/build/es/polyfill/dateLookup/dayCalendar/table/DayCalendarTable.js +4 -5
  379. package/build/es/polyfill/dateLookup/monthCalendar/MonthCalendar.js +1 -1
  380. package/build/es/polyfill/dateLookup/monthCalendar/table/MonthCalendarTable.js +1 -1
  381. package/build/es/polyfill/dateLookup/tableLink/TableLink.js +1 -1
  382. package/build/es/polyfill/dateLookup/yearCalendar/YearCalendar.js +1 -1
  383. package/build/es/polyfill/dateLookup/yearCalendar/table/YearCalendarTable.js +1 -1
  384. package/build/es/polyfill/decision/Decision.js +5 -5
  385. package/build/es/polyfill/decision/decisionEnums.js +2 -2
  386. package/build/es/polyfill/definitionList/DefinitionList.js +1 -1
  387. package/build/es/polyfill/dimmer/Dimmer.js +3 -3
  388. package/build/es/polyfill/dimmer/Dimmer.story.js +2 -2
  389. package/build/es/polyfill/dimmer/dimmerManager/DimmerManager.js +3 -3
  390. package/build/es/polyfill/display/Display.js +1 -1
  391. package/build/es/polyfill/display/Display.story.js +2 -2
  392. package/build/es/polyfill/drawer/Drawer.js +1 -1
  393. package/build/es/polyfill/dropFade/DropFade.js +3 -3
  394. package/build/es/polyfill/dropFade/DropFade.story.js +1 -1
  395. package/build/es/polyfill/dynamicFieldDefinitionList/DynamicFieldDefinitionList.js +1 -1
  396. package/build/es/polyfill/dynamicFieldDefinitionList/FormattedValue/FormattedValue.js +2 -2
  397. package/build/es/polyfill/dynamicFieldDefinitionList/utils/createDefinitions.js +2 -2
  398. package/build/es/polyfill/dynamicFieldDefinitionList/utils/text-format.js +1 -1
  399. package/build/es/polyfill/emphasis/Emphasis.js +2 -2
  400. package/build/es/polyfill/emphasis/EmphasisHtmlTransformer.js +2 -2
  401. package/build/es/polyfill/flowNavigation/FlowNavigation.js +2 -2
  402. package/build/es/polyfill/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
  403. package/build/es/polyfill/flowNavigation/backButton/BackButton.js +1 -1
  404. package/build/es/polyfill/header/Header.js +2 -2
  405. package/build/es/polyfill/header/Header.spec.js +1 -1
  406. package/build/es/polyfill/header/Header.story.js +2 -1
  407. package/build/es/polyfill/i18n/index.js +1 -1
  408. package/build/es/polyfill/image/Image.js +2 -2
  409. package/build/es/polyfill/info/Info.js +1 -1
  410. package/build/es/polyfill/info/Info.story.js +1 -1
  411. package/build/es/polyfill/info/infoPresentations.js +1 -1
  412. package/build/es/polyfill/inlineAlert/InlineAlert.js +1 -1
  413. package/build/es/polyfill/inputWithDisplayFormat/InputWithDisplayFormat.js +1 -1
  414. package/build/es/polyfill/inputs/Input.js +1 -1
  415. package/build/es/polyfill/inputs/TextArea.js +1 -1
  416. package/build/es/polyfill/inputs/_common.js +2 -2
  417. package/build/es/polyfill/instructionsList/InstructionsList.js +3 -3
  418. package/build/es/polyfill/link/Link.js +2 -2
  419. package/build/es/polyfill/link/Link.spec.js +1 -1
  420. package/build/es/polyfill/link/Link.story.js +1 -1
  421. package/build/es/polyfill/listItem/ListItem.js +1 -1
  422. package/build/es/polyfill/listItem/ListItem.spec.js +1 -1
  423. package/build/es/polyfill/listItem/ListItem.story.js +1 -1
  424. package/build/es/polyfill/loader/Loader.js +2 -2
  425. package/build/es/polyfill/loader/Loader.story.js +1 -1
  426. package/build/es/polyfill/logo/Logo.js +1 -1
  427. package/build/es/polyfill/logo/Logo.story.js +1 -1
  428. package/build/es/polyfill/logo/logoTypes.js +1 -1
  429. package/build/es/polyfill/markdown/Markdown.js +1 -1
  430. package/build/es/polyfill/modal/Modal.js +1 -1
  431. package/build/es/polyfill/modal/Modal.story.js +2 -2
  432. package/build/es/polyfill/money/Money.js +1 -1
  433. package/build/es/polyfill/money/Money.story.js +1 -1
  434. package/build/es/polyfill/moneyInput/MoneyInput.js +1 -1
  435. package/build/es/polyfill/moneyInput/MoneyInput.story.js +1 -1
  436. package/build/es/polyfill/moneyInput/currencyFormatting.js +3 -3
  437. package/build/es/polyfill/navigationOption/NavigationOption.js +1 -1
  438. package/build/es/polyfill/navigationOptionsList/NavigationOptionsList.js +1 -1
  439. package/build/es/polyfill/nudge/Nudge.js +1 -1
  440. package/build/es/polyfill/overlayHeader/OverlayHeader.js +1 -1
  441. package/build/es/polyfill/phoneNumberInput/PhoneNumberInput.js +1 -1
  442. package/build/es/polyfill/phoneNumberInput/data/countries.js +1 -1
  443. package/build/es/polyfill/phoneNumberInput/utils/cleanNumber/cleanNumber.js +1 -1
  444. package/build/es/polyfill/phoneNumberInput/utils/excludeCountries/excludeCountries.js +3 -3
  445. package/build/es/polyfill/phoneNumberInput/utils/explodeNumberModel/index.js +2 -2
  446. package/build/es/polyfill/phoneNumberInput/utils/filterOptionsForQuery/index.js +2 -2
  447. package/build/es/polyfill/phoneNumberInput/utils/findCountryByCode/index.js +1 -1
  448. package/build/es/polyfill/phoneNumberInput/utils/findCountryByPrefix/index.js +1 -1
  449. package/build/es/polyfill/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.js +1 -1
  450. package/build/es/polyfill/phoneNumberInput/utils/isOptionAndFitsQuery/isOptionAndFitsQuery.js +2 -2
  451. package/build/es/polyfill/phoneNumberInput/utils/isStringNumeric/isStringNumeric.js +1 -1
  452. package/build/es/polyfill/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js +2 -2
  453. package/build/es/polyfill/phoneNumberInput/utils/longestMatchingPrefix/index.js +1 -1
  454. package/build/es/polyfill/phoneNumberInput/utils/setDefaultPrefix/index.js +3 -3
  455. package/build/es/polyfill/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.js +2 -2
  456. package/build/es/polyfill/popover/Popover.js +2 -2
  457. package/build/es/polyfill/processIndicator/ProcessIndicator.js +4 -4
  458. package/build/es/polyfill/progress/Progress.js +1 -1
  459. package/build/es/polyfill/progress/Progress.story.js +1 -1
  460. package/build/es/polyfill/progressBar/ProgressBar.js +1 -1
  461. package/build/es/polyfill/progressBar/ProgressBar.story.js +1 -1
  462. package/build/es/polyfill/provider/Provider.js +1 -1
  463. package/build/es/polyfill/provider/Provider.spec.js +1 -1
  464. package/build/es/polyfill/provider/Provider.story.js +1 -1
  465. package/build/es/polyfill/provider/direction/DirectionProvider.js +1 -1
  466. package/build/es/polyfill/provider/direction/DirectionProvider.spec.js +1 -1
  467. package/build/es/polyfill/provider/language/LanguageProvider.js +1 -1
  468. package/build/es/polyfill/provider/language/LanguageProvider.spec.js +1 -1
  469. package/build/es/polyfill/radio/Radio.js +1 -1
  470. package/build/es/polyfill/radioGroup/RadioGroup.js +2 -2
  471. package/build/es/polyfill/radioOption/RadioOption.js +1 -1
  472. package/build/es/polyfill/section/Section.js +1 -1
  473. package/build/es/polyfill/section/Section.spec.js +1 -1
  474. package/build/es/polyfill/section/Section.story.js +1 -1
  475. package/build/es/polyfill/select/Select.js +8 -9
  476. package/build/es/polyfill/select/option/Option.js +2 -2
  477. package/build/es/polyfill/select/searchBox/SearchBox.js +1 -1
  478. package/build/es/polyfill/sizeSwapper/SizeSwapper.js +3 -3
  479. package/build/es/polyfill/slidingPanel/SlidingPanel.js +2 -2
  480. package/build/es/polyfill/snackbar/Snackbar.js +1 -1
  481. package/build/es/polyfill/snackbar/SnackbarContext.js +1 -1
  482. package/build/es/polyfill/snackbar/SnackbarProvider.js +1 -1
  483. package/build/es/polyfill/snackbar/useSnackbar.js +1 -1
  484. package/build/es/polyfill/statusIcon/StatusIcon.js +1 -1
  485. package/build/es/polyfill/statusIcon/StatusIcon.story.js +1 -1
  486. package/build/es/polyfill/stepper/Stepper.js +1 -1
  487. package/build/es/polyfill/stepper/deviceDetection.js +2 -2
  488. package/build/es/polyfill/sticky/Sticky.js +1 -1
  489. package/build/es/polyfill/summary/Summary.js +1 -1
  490. package/build/es/polyfill/switch/Switch.js +1 -1
  491. package/build/es/polyfill/switch/Switch.story.js +1 -1
  492. package/build/es/polyfill/switchOption/SwitchOption.js +1 -1
  493. package/build/es/polyfill/switchOption/SwitchOption.story.js +1 -1
  494. package/build/es/polyfill/tabs/Tab.js +1 -1
  495. package/build/es/polyfill/tabs/TabList.js +1 -1
  496. package/build/es/polyfill/tabs/TabPanel.js +1 -1
  497. package/build/es/polyfill/tabs/Tabs.js +1 -5
  498. package/build/es/polyfill/tabs/utils.js +2 -2
  499. package/build/es/polyfill/textareaWithDisplayFormat/TextareaWithDisplayFormat.js +1 -1
  500. package/build/es/polyfill/tile/Tile.js +1 -1
  501. package/build/es/polyfill/title/Title.js +1 -1
  502. package/build/es/polyfill/title/Title.spec.js +1 -1
  503. package/build/es/polyfill/title/Title.story.js +1 -1
  504. package/build/es/polyfill/tooltip/Tooltip.js +7 -7
  505. package/build/es/polyfill/tooltip/Tooltip.spec.js +1 -1
  506. package/build/es/polyfill/tooltip/Tooltip.story.js +1 -1
  507. package/build/es/polyfill/typeahead/Typeahead.js +1 -1
  508. package/build/es/polyfill/typeahead/typeaheadInput/TypeaheadInput.js +1 -1
  509. package/build/es/polyfill/typeahead/typeaheadOption/TypeaheadOption.js +1 -1
  510. package/build/es/polyfill/typeahead/util/highlight.js +1 -1
  511. package/build/es/polyfill/upload/Upload.js +2 -6
  512. package/build/es/polyfill/upload/steps/completeStep/completeStep.js +1 -1
  513. package/build/es/polyfill/upload/steps/mediaUploadStep/mediaUploadStep.js +1 -1
  514. package/build/es/polyfill/upload/steps/processingStep/processingStep.js +1 -1
  515. package/build/es/polyfill/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
  516. package/build/es/polyfill/upload/uploadSteps.js +1 -1
  517. package/build/es/polyfill/upload/utils/asyncFileRead/asyncFileRead.js +1 -1
  518. package/build/es/polyfill/upload/utils/getFileType/getFileType.js +1 -1
  519. package/build/es/polyfill/upload/utils/getSupportedSpotMimeTypes/getSupportedSpotMimeTypes.js +2 -2
  520. package/build/es/polyfill/upload/utils/isSizeValid/isSizeValid.js +1 -1
  521. package/build/es/polyfill/upload/utils/isTypeValid/isTypeValid.js +1 -1
  522. package/build/es/polyfill/upload/utils/postData/postData.js +1 -1
  523. package/build/es/polyfill/upload/utils/requestMedia/requestMedia.js +1 -1
  524. package/build/es/polyfill/uploadInput/UploadInput.js +7 -7
  525. package/build/es/polyfill/uploadInput/UploadInput.spec.js +1 -1
  526. package/build/es/polyfill/uploadInput/UploadInput.story.js +1 -1
  527. package/build/es/polyfill/uploadInput/uploadButton/UploadButton.js +1 -1
  528. package/build/es/polyfill/uploadInput/uploadButton/UploadButton.spec.js +3 -3
  529. package/build/es/polyfill/uploadInput/uploadButton/defaults.js +1 -1
  530. package/build/es/polyfill/uploadInput/uploadButton/getAllowedFileTypes.js +3 -3
  531. package/build/es/polyfill/uploadInput/uploadButton/getAllowedFileTypes.spec.js +1 -1
  532. package/build/es/polyfill/uploadInput/uploadItem/UploadItem.js +2 -2
  533. package/build/es/polyfill/uploadInput/uploadItem/UploadItem.spec.js +1 -1
  534. package/build/es/polyfill/uploadInput/uploadItem/UploadItemBody.js +1 -1
  535. package/build/es/polyfill/utilities/deprecatedProperty/deprecatedProperty.js +1 -1
  536. package/build/es/polyfill/utilities/logActionRequired.js +1 -1
  537. package/build/es/polyfill/withDisplayFormat/WithDisplayFormat.js +3 -4
  538. package/build/es/polyfill/withNextPortal/withNextPortal.js +1 -1
  539. package/build/main.css +1 -4236
  540. package/build/styles/accordion/Accordion.css +1 -59
  541. package/build/styles/actionButton/ActionButton.css +1 -41
  542. package/build/styles/avatar/Avatar.css +1 -240
  543. package/build/styles/badge/Badge.css +1 -66
  544. package/build/styles/button/Button.css +1 -17
  545. package/build/styles/card/Card.css +1 -88
  546. package/build/styles/checkboxButton/CheckboxButton.css +1 -21
  547. package/build/styles/chips/Chip.css +1 -169
  548. package/build/styles/circularButton/CircularButton.css +1 -175
  549. package/build/styles/common/Option/Option.css +1 -74
  550. package/build/styles/common/RadioButton/RadioButton.css +1 -3
  551. package/build/styles/common/bottomSheet/BottomSheet.css +1 -44
  552. package/build/styles/common/closeButton/CloseButton.css +1 -44
  553. package/build/styles/common/panel/Panel.css +1 -67
  554. package/build/styles/criticalBanner/CriticalCommsBanner.css +1 -73
  555. package/build/styles/dateInput/DateInput.css +1 -3
  556. package/build/styles/dateLookup/DateLookup.css +1 -80
  557. package/build/styles/dateLookup/dateTrigger/DateTrigger.css +1 -53
  558. package/build/styles/decision/Decision.css +1 -69
  559. package/build/styles/definitionList/DefinitionList.css +1 -48
  560. package/build/styles/dimmer/Dimmer.css +1 -68
  561. package/build/styles/drawer/Drawer.css +1 -77
  562. package/build/styles/dropFade/DropFade.css +1 -19
  563. package/build/styles/dynamicFieldDefinitionList/FormattedValue/FormattedValue.css +1 -4
  564. package/build/styles/emphasis/Emphasis.css +1 -25
  565. package/build/styles/flowNavigation/FlowNavigation.css +1 -85
  566. package/build/styles/flowNavigation/animatedLabel/AnimatedLabel.css +1 -26
  567. package/build/styles/flowNavigation/backButton/BackButton.css +1 -28
  568. package/build/styles/header/Header.css +1 -20
  569. package/build/styles/image/Image.css +1 -12
  570. package/build/styles/info/Info.css +1 -37
  571. package/build/styles/inputs/Input.css +1 -53
  572. package/build/styles/inputs/TextArea.css +1 -59
  573. package/build/styles/instructionsList/InstructionsList.css +1 -30
  574. package/build/styles/link/Link.css +1 -12
  575. package/build/styles/listItem/ListItem.css +1 -6
  576. package/build/styles/loader/Loader.css +1 -294
  577. package/build/styles/logo/Logo.css +1 -10
  578. package/build/styles/main.css +1 -4236
  579. package/build/styles/modal/Modal.css +1 -133
  580. package/build/styles/moneyInput/MoneyInput.css +1 -128
  581. package/build/styles/navigationOption/NavigationOption.css +1 -61
  582. package/build/styles/navigationOptionsList/NavigationOptionsList.css +1 -12
  583. package/build/styles/nudge/Nudge.css +1 -138
  584. package/build/styles/overlayHeader/OverlayHeader.css +1 -31
  585. package/build/styles/phoneNumberInput/PhoneNumberInput.css +1 -17
  586. package/build/styles/popover/Popover.css +1 -40
  587. package/build/styles/progress/Progress.css +1 -35
  588. package/build/styles/progressBar/ProgressBar.css +1 -9
  589. package/build/styles/section/Section.css +1 -8
  590. package/build/styles/select/Select.css +1 -322
  591. package/build/styles/slidingPanel/SlidingPanel.css +1 -96
  592. package/build/styles/snackbar/Snackbar.css +1 -85
  593. package/build/styles/statusIcon/StatusIcon.css +1 -50
  594. package/build/styles/stepper/Stepper.css +1 -139
  595. package/build/styles/summary/Summary.css +1 -86
  596. package/build/styles/switch/Switch.css +1 -64
  597. package/build/styles/tabs/Tabs.css +1 -104
  598. package/build/styles/tile/Tile.css +1 -58
  599. package/build/styles/tooltip/Tooltip.css +1 -37
  600. package/build/styles/typeahead/Typeahead.css +1 -167
  601. package/build/styles/typeahead/typeaheadOption/TypeaheadOption.css +1 -6
  602. package/build/styles/upload/Upload.css +1 -15
  603. package/build/styles/uploadInput/UploadInput.css +1 -53
  604. package/build/styles/uploadInput/uploadButton/UploadButton.css +1 -44
  605. package/build/styles/uploadInput/uploadItem/UploadItem.css +1 -60
  606. package/build/types/actionButton/ActionButton.d.ts +3 -0
  607. package/build/types/actionButton/ActionButton.story.d.ts +1 -0
  608. package/build/types/button/Button.story.d.ts +24 -24
  609. package/build/umd/no-polyfill/main.js +1 -1
  610. package/build/umd/polyfill/main.js +1 -1
  611. package/package.json +1 -1
@@ -1 +1 @@
1
- import classnames from"classnames";import{useEffect,useState}from"react";import{jsxs as _jsxs}from"react/jsx-runtime";const Progress=a=>{let{className:b,id:c,progress:d}=a;const[e,f]=useState(0);return useEffect(()=>{f(d.value)}),/*#__PURE__*/_jsxs("progress",{id:c,className:classnames("np-progress d-block",b),...d,value:e,children:[e,"%"]})};export default Progress;
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 classnames from"classnames";import{useEffect,useState}from"react";import{jsxs as _jsxs}from"react/jsx-runtime";var Progress=function(a){var b=a.className,c=a.id,d=a.progress,e=useState(0),f=_slicedToArray(e,2),g=f[0],h=f[1];return useEffect(function(){h(d.value)}),/*#__PURE__*/_jsxs("progress",_objectSpread(_objectSpread({id:c,className:classnames("np-progress d-block",b)},d),{},{value:g,children:[g,"%"]}))};export default Progress;
@@ -1 +1 @@
1
- import Progress from"./Progress";export default{component:Progress,title:"Other/Progress"};export const Basic={args:{progress:{value:50,max:100}}};
1
+ import Progress from"./Progress";export default{component:Progress,title:"Other/Progress"};export var Basic={args:{progress:{value:50,max:100}}};
@@ -1 +1 @@
1
- import{useTheme}from"@wise/components-theming";import classNames from"classnames";import Body from"../body";import{Typography}from"../common";import Progress from"../progress";import Title from"../title/Title";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const ProgressBar=a=>{let{className:b,description:c,id:d,title:e,progress:f,textEnd:g}=a;const{isModern:h}=useTheme();return/*#__PURE__*/_jsxs("div",{className:classNames("np-progress-bar",b),children:[/*#__PURE__*/_jsxs("label",{className:"np-progress-bar__title m-b-1",htmlFor:d,children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_BODY,className:h?`m-b-1 text-primary`:`text-primary`,children:e}),c&&/*#__PURE__*/_jsx(Body,{children:c})]}),/*#__PURE__*/_jsx(Progress,{id:d,progress:f}),/*#__PURE__*/_jsx(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,className:"d-flex justify-content-end text-primary m-b-0",children:g})]})};export default ProgressBar;
1
+ import"core-js/modules/es.symbol.js";import"core-js/modules/es.symbol.description.js";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import Body from"../body";import{Typography}from"../common";import Progress from"../progress";import Title from"../title/Title";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var ProgressBar=function(a){var b=a.className,c=a.description,d=a.id,e=a.title,f=a.progress,g=a.textEnd,h=useTheme(),i=h.isModern;return/*#__PURE__*/_jsxs("div",{className:classNames("np-progress-bar",b),children:[/*#__PURE__*/_jsxs("label",{className:"np-progress-bar__title m-b-1",htmlFor:d,children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_BODY,className:i?"m-b-1 text-primary":"text-primary",children:e}),c&&/*#__PURE__*/_jsx(Body,{children:c})]}),/*#__PURE__*/_jsx(Progress,{id:d,progress:f}),/*#__PURE__*/_jsx(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,className:"d-flex justify-content-end text-primary m-b-0",children:g})]})};export default ProgressBar;
@@ -1 +1 @@
1
- import ProgressBar from"./ProgressBar";export default{component:ProgressBar,title:"Content/ProgressBar",tags:["autodocs"]};export const Basic={args:{description:"You have 3 days to reach your goal.",id:"progress-bar-id",title:"Send 5,550 GBP",progress:{value:50,max:100},textEnd:"200 GBP to go"}};
1
+ import ProgressBar from"./ProgressBar";export default{component:ProgressBar,title:"Content/ProgressBar",tags:["autodocs"]};export var Basic={args:{description:"You have 3 days to reach your goal.",id:"progress-bar-id",title:"Send 5,550 GBP",progress:{value:50,max:100},textEnd:"200 GBP to go"}};
@@ -1 +1 @@
1
- import PropTypes from"prop-types";import{IntlProvider}from"react-intl";import{adjustLocale,DEFAULT_LOCALE,getDirectionFromLocale}from"../common";import en from"../i18n/en.json";import{DirectionProvider}from"./direction";import{LanguageProvider}from"./language";import{jsx as _jsx}from"react/jsx-runtime";const Provider=a=>{let{i18n:b,children:c}=a;const{locale:d,messages:e,defaultRichTextElements:f}=b,g=adjustLocale(d);let h;return null===g?(console.warn(`Unsupported locale value was provided: '${d}', defaulting to '${DEFAULT_LOCALE}'`),h={locale:DEFAULT_LOCALE,messages:{...en,...e}}):h={locale:g,messages:e},/*#__PURE__*/_jsx(DirectionProvider,{direction:getDirectionFromLocale(d),children:/*#__PURE__*/_jsx(LanguageProvider,{locale:d,children:/*#__PURE__*/_jsx(IntlProvider,{defaultLocale:DEFAULT_LOCALE,locale:h.locale,messages:h.messages,defaultRichTextElements:f,children:c})})})};Provider.propTypes={i18n:PropTypes.shape({locale:PropTypes.string.isRequired,messages:PropTypes.shape({}).isRequired,defaultRichTextElements:PropTypes.shape({})}).isRequired,children:PropTypes.node},Provider.defaultProps={children:void 0};export default Provider;
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"core-js/modules/es.array.concat.js";import PropTypes from"prop-types";import{IntlProvider}from"react-intl";import{adjustLocale,DEFAULT_LOCALE,getDirectionFromLocale}from"../common";import en from"../i18n/en.json";import{DirectionProvider}from"./direction";import{LanguageProvider}from"./language";import{jsx as _jsx}from"react/jsx-runtime";var Provider=function(a){var b,c=a.i18n,d=a.children,e=c.locale,f=c.messages,g=c.defaultRichTextElements,h=adjustLocale(e);return null===h?(console.warn("Unsupported locale value was provided: '".concat(e,"', defaulting to '").concat(DEFAULT_LOCALE,"'")),b={locale:DEFAULT_LOCALE,messages:_objectSpread(_objectSpread({},en),f)}):b={locale:h,messages:f},/*#__PURE__*/_jsx(DirectionProvider,{direction:getDirectionFromLocale(e),children:/*#__PURE__*/_jsx(LanguageProvider,{locale:e,children:/*#__PURE__*/_jsx(IntlProvider,{defaultLocale:DEFAULT_LOCALE,locale:b.locale,messages:b.messages,defaultRichTextElements:g,children:d})})})};Provider.propTypes={i18n:PropTypes.shape({locale:PropTypes.string.isRequired,messages:PropTypes.shape({}).isRequired,defaultRichTextElements:PropTypes.shape({})}).isRequired,children:PropTypes.node},Provider.defaultProps={children:void 0};export default Provider;
@@ -1 +1 @@
1
- import{render,waitFor,screen}from"@testing-library/react";import{FormattedMessage,useIntl}from"react-intl";import closeButtonMessages from"../common/closeButton/CloseButton.messages";import Provider from".";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";describe("Provider",()=>{beforeAll(()=>{jest.spyOn(console,"error").mockImplementation(()=>jest.fn()),jest.spyOn(console,"error").mockImplementation(()=>jest.fn()),jest.spyOn(console,"warn").mockImplementation(()=>jest.fn())}),afterAll(()=>{jest.restoreAllMocks()}),it("does not add any elements in the DOM",async()=>{const a=await import(`../i18n/${"en"}.json`),{container:b}=render(/*#__PURE__*/_jsx(Provider,{i18n:{locale:"en",messages:a}}));expect(b).toBeEmptyDOMElement()}),it.each([["zh-HK","zh-HK"],["ru","ru"],["en-GB","en-GB"],["en-US","en-US"],["en_US","en-US"],["en_GB","en-GB"],["ja","ja"],["ja-JP","ja-JP"],["","en-GB"],[" ","en-GB"],[null,"en-GB"],[void 0,"en-GB"]])("check locale value \"%s\"",(a,b)=>{const{container:c}=render(/*#__PURE__*/_jsx(Provider,{i18n:{locale:a,messages:{}},children:/*#__PURE__*/_jsx(()=>{const a=useIntl();return/*#__PURE__*/_jsxs(_Fragment,{children:["locale: ",a.locale]})},{})}));expect(c).toHaveTextContent(`locale: ${b}`)}),it.each([["ru","\u0417\u0430\u043A\u0440\u044B\u0442\u044C"],["en","Close"]])("switching locale (%s)",async(a,b)=>{expect(document.body).toBeEmptyDOMElement();const c=await import(`../i18n/${a}.json`);render(/*#__PURE__*/_jsx(Provider,{i18n:{locale:a,messages:c},children:/*#__PURE__*/_jsx(FormattedMessage,{...closeButtonMessages.ariaLabel})})),await waitFor(()=>{expect(screen.getByText(b)).toBeInTheDocument()})}),it("does not override passed in messages if parsing locale fails",async()=>{expect(document.body).toBeEmptyDOMElement();const a="Boop";Object.defineProperty(Intl,"Locale",{value:void 0}),render(/*#__PURE__*/_jsxs(Provider,{i18n:{locale:"en-GB",messages:{"some.message.that.was.passed.in":a}},children:[/*#__PURE__*/_jsx("span",{children:/*#__PURE__*/_jsx(FormattedMessage,{id:"some.message.that.was.passed.in"})}),/*#__PURE__*/_jsx("span",{children:/*#__PURE__*/_jsx(FormattedMessage,{...closeButtonMessages.ariaLabel})})]})),expect(await screen.findByText(a)).toBeInTheDocument(),expect(screen.getByText("Close")).toBeInTheDocument()})});
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";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 _regeneratorRuntime from"@babel/runtime/regenerator";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.promise.js";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.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{render,waitFor,screen}from"@testing-library/react";import{FormattedMessage,useIntl}from"react-intl";import closeButtonMessages from"../common/closeButton/CloseButton.messages";import Provider from".";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";describe("Provider",function(){beforeAll(function(){jest.spyOn(console,"error").mockImplementation(function(){return jest.fn()}),jest.spyOn(console,"error").mockImplementation(function(){return jest.fn()}),jest.spyOn(console,"warn").mockImplementation(function(){return jest.fn()})}),afterAll(function(){jest.restoreAllMocks()}),it("does not add any elements in the DOM",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function a(){var b,c,d,e;return _regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return b="en",a.next=3,import("../i18n/".concat(b,".json"));case 3:c=a.sent,d=render(/*#__PURE__*/_jsx(Provider,{i18n:{locale:b,messages:c}})),e=d.container,expect(e).toBeEmptyDOMElement();case 6:case"end":return a.stop();}},a)}))),it.each([["zh-HK","zh-HK"],["ru","ru"],["en-GB","en-GB"],["en-US","en-US"],["en_US","en-US"],["en_GB","en-GB"],["ja","ja"],["ja-JP","ja-JP"],["","en-GB"],[" ","en-GB"],[null,"en-GB"],[void 0,"en-GB"]])("check locale value \"%s\"",function(a,b){var c=render(/*#__PURE__*/_jsx(Provider,{i18n:{locale:a,messages:{}},children:/*#__PURE__*/_jsx(function TestComponent(){var a=useIntl();return/*#__PURE__*/_jsxs(_Fragment,{children:["locale: ",a.locale]})},{})})),d=c.container;expect(d).toHaveTextContent("locale: ".concat(b))}),it.each([["ru","\u0417\u0430\u043A\u0440\u044B\u0442\u044C"],["en","Close"]])("switching locale (%s)",/*#__PURE__*/function(){var a=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function c(a,b){var d;return _regeneratorRuntime.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return expect(document.body).toBeEmptyDOMElement(),c.next=3,import("../i18n/".concat(a,".json"));case 3:return d=c.sent,render(/*#__PURE__*/_jsx(Provider,{i18n:{locale:a,messages:d},children:/*#__PURE__*/_jsx(FormattedMessage,_objectSpread({},closeButtonMessages.ariaLabel))})),c.next=7,waitFor(function(){expect(screen.getByText(b)).toBeInTheDocument()});case 7:case"end":return c.stop();}},c)}));return function(){return a.apply(this,arguments)}}()),it("does not override passed in messages if parsing locale fails",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function a(){var b,c,d,e;return _regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return expect(document.body).toBeEmptyDOMElement(),b="some.message.that.was.passed.in",c="Boop",d="en-GB",e=_defineProperty({},b,c),Object.defineProperty(Intl,"Locale",{value:void 0}),render(/*#__PURE__*/_jsxs(Provider,{i18n:{locale:d,messages:e},children:[/*#__PURE__*/_jsx("span",{children:/*#__PURE__*/_jsx(FormattedMessage,{id:b})}),/*#__PURE__*/_jsx("span",{children:/*#__PURE__*/_jsx(FormattedMessage,_objectSpread({},closeButtonMessages.ariaLabel))})]})),a.t0=expect,a.next=10,screen.findByText(c);case 10:a.t1=a.sent,(0,a.t0)(a.t1).toBeInTheDocument(),expect(screen.getByText("Close")).toBeInTheDocument();case 13:case"end":return a.stop();}},a)})))});
@@ -1 +1 @@
1
- import{FormattedMessage}from"react-intl";import{Provider}from"..";import closeButtonMessages from"../common/closeButton/CloseButton.messages";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 default{component:Provider,title:"Other/Provider"};export const Basic={render:()=>/*#__PURE__*/_jsxs(_Fragment,{children:["Translated message: ",/*#__PURE__*/_jsx(FormattedMessage,{...closeButtonMessages.ariaLabel})]})};
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{FormattedMessage}from"react-intl";import{Provider}from"..";import closeButtonMessages from"../common/closeButton/CloseButton.messages";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 default{component:Provider,title:"Other/Provider"};export var Basic={render:function render(){return/*#__PURE__*/_jsxs(_Fragment,{children:["Translated message: ",/*#__PURE__*/_jsx(FormattedMessage,_objectSpread({},closeButtonMessages.ariaLabel))]})}};
@@ -1 +1 @@
1
- import{createContext}from"react";import{Direction}from"../../common/direction";import{jsx as _jsx}from"react/jsx-runtime";export const DirectionContext=/*#__PURE__*/createContext(Direction.LTR);export const DirectionProvider=a=>{let{direction:b,children:c}=a;return/*#__PURE__*/_jsx(DirectionContext.Provider,{value:b,children:c})};
1
+ import{createContext}from"react";import{Direction}from"../../common/direction";import{jsx as _jsx}from"react/jsx-runtime";export var DirectionContext=/*#__PURE__*/createContext(Direction.LTR);export var DirectionProvider=function(a){var b=a.direction,c=a.children;return/*#__PURE__*/_jsx(DirectionContext.Provider,{value:b,children:c})};
@@ -1 +1 @@
1
- import{Direction}from"../../common";import{useDirection}from"../../common/hooks";import{render}from"../../test-utils";import{DirectionProvider}from".";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsx as _jsx}from"react/jsx-runtime";describe("DirectionProvider",()=>{beforeEach(()=>{document.documentElement.removeAttribute("dir")}),it.each([[Direction.LTR,!1],[Direction.RTL,!0]])("store direction %s in React Context",(a,b)=>{let c=null;render(/*#__PURE__*/_jsx(DirectionProvider,{direction:a,children:/*#__PURE__*/_jsx(()=>(c=useDirection(),/*#__PURE__*/_jsx(_Fragment,{})),{})})),expect(c).not.toBeNull(),expect(c).toHaveProperty("direction",a),expect(c).toHaveProperty("isRTL",b)})});
1
+ import{Direction}from"../../common";import{useDirection}from"../../common/hooks";import{render}from"../../test-utils";import{DirectionProvider}from".";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsx as _jsx}from"react/jsx-runtime";describe("DirectionProvider",function(){beforeEach(function(){document.documentElement.removeAttribute("dir")}),it.each([[Direction.LTR,!1],[Direction.RTL,!0]])("store direction %s in React Context",function(a,b){var c=null;render(/*#__PURE__*/_jsx(DirectionProvider,{direction:a,children:/*#__PURE__*/_jsx(function TestComponent(){return c=useDirection(),/*#__PURE__*/_jsx(_Fragment,{})},{})})),expect(c).not.toBeNull(),expect(c).toHaveProperty("direction",a),expect(c).toHaveProperty("isRTL",b)})});
@@ -1 +1 @@
1
- import{createContext}from"react";import{DEFAULT_LOCALE}from"../../common/locale";import{jsx as _jsx}from"react/jsx-runtime";export const LanguageContext=/*#__PURE__*/createContext(DEFAULT_LOCALE);export const LanguageProvider=a=>{let{locale:b,children:c}=a;return/*#__PURE__*/_jsx(LanguageContext.Provider,{value:b,children:c})};
1
+ import{createContext}from"react";import{DEFAULT_LOCALE}from"../../common/locale";import{jsx as _jsx}from"react/jsx-runtime";export var LanguageContext=/*#__PURE__*/createContext(DEFAULT_LOCALE);export var LanguageProvider=function(a){var b=a.locale,c=a.children;return/*#__PURE__*/_jsx(LanguageContext.Provider,{value:b,children:c})};
@@ -1 +1 @@
1
- import{render}from"../../test-utils";import{LanguageProvider}from".";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{jsx as _jsx}from"react/jsx-runtime";describe("LanguageProvider",()=>{beforeEach(()=>{document.documentElement.removeAttribute("lang")}),it.each([["en"],["ru"],["ja"]])("store language %s in React Context",a=>{const{container:b}=render(/*#__PURE__*/_jsx(LanguageProvider,{locale:a,children:/*#__PURE__*/_jsx(()=>/*#__PURE__*/_jsxs(_Fragment,{children:["locale: ",a]}),{})}));expect(b).toHaveTextContent(`locale: ${a}`)})});
1
+ import{render}from"../../test-utils";import{LanguageProvider}from".";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{jsx as _jsx}from"react/jsx-runtime";describe("LanguageProvider",function(){beforeEach(function(){document.documentElement.removeAttribute("lang")}),it.each([["en"],["ru"],["ja"]])("store language %s in React Context",function(a){var b=render(/*#__PURE__*/_jsx(LanguageProvider,{locale:a,children:/*#__PURE__*/_jsx(function TestComponent(){return/*#__PURE__*/_jsxs(_Fragment,{children:["locale: ",a]})},{})})),c=b.container;expect(c).toHaveTextContent("locale: ".concat(a))})});
@@ -1 +1 @@
1
- import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import Body from"../body/Body";import{Typography}from"../common";import RadioButton from"../common/RadioButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const Radio=a=>{let{label:b,id:c,disabled:d,className:e,avatar:f,secondary:g,...h}=a;const{isModern:i}=useTheme();return/*#__PURE__*/_jsx("div",{className:classNames("radio np-radio",{"radio-lg":g,disabled:i&&d},e),children:/*#__PURE__*/_jsxs("label",{className:classNames({disabled:d}),htmlFor:c,children:[/*#__PURE__*/_jsx("span",{className:classNames(i?"m-r-2":"p-r-2","np-radio-button"),children:/*#__PURE__*/_jsx(RadioButton,{id:c,disabled:d,...h})}),/*#__PURE__*/_jsxs(Body,{as:"span",type:g?Typography.BODY_LARGE_BOLD:Typography.BODY_LARGE,className:"np-radio__text",children:[b,g&&/*#__PURE__*/_jsx(Body,{as:"span",className:classNames({secondary:!i}),children:g})]}),f&&/*#__PURE__*/_jsx("span",{className:"np-radio__avatar m-l-auto",children:f})]})})};Radio.propTypes={avatar:PropTypes.element,checked:PropTypes.bool,disabled:PropTypes.bool,id:PropTypes.string,label:PropTypes.string.isRequired,name:PropTypes.string.isRequired,onChange:PropTypes.func.isRequired,secondary:PropTypes.string,value:PropTypes.oneOfType([PropTypes.number,PropTypes.string]),className:PropTypes.string},Radio.defaultProps={avatar:void 0,checked:!1,disabled:!1,id:null,secondary:null,value:"",className:void 0};export default Radio;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["label","id","disabled","className","avatar","secondary"];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{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import Body from"../body/Body";import{Typography}from"../common";import RadioButton from"../common/RadioButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Radio=function(a){var b=a.label,c=a.id,d=a.disabled,e=a.className,f=a.avatar,g=a.secondary,h=_objectWithoutProperties(a,_excluded),i=useTheme(),j=i.isModern;return/*#__PURE__*/_jsx("div",{className:classNames("radio np-radio",{"radio-lg":g,disabled:j&&d},e),children:/*#__PURE__*/_jsxs("label",{className:classNames({disabled:d}),htmlFor:c,children:[/*#__PURE__*/_jsx("span",{className:classNames(j?"m-r-2":"p-r-2","np-radio-button"),children:/*#__PURE__*/_jsx(RadioButton,_objectSpread({id:c,disabled:d},h))}),/*#__PURE__*/_jsxs(Body,{as:"span",type:g?Typography.BODY_LARGE_BOLD:Typography.BODY_LARGE,className:"np-radio__text",children:[b,g&&/*#__PURE__*/_jsx(Body,{as:"span",className:classNames({secondary:!j}),children:g})]}),f&&/*#__PURE__*/_jsx("span",{className:"np-radio__avatar m-l-auto",children:f})]})})};Radio.propTypes={avatar:PropTypes.element,checked:PropTypes.bool,disabled:PropTypes.bool,id:PropTypes.string,label:PropTypes.string.isRequired,name:PropTypes.string.isRequired,onChange:PropTypes.func.isRequired,secondary:PropTypes.string,value:PropTypes.oneOfType([PropTypes.number,PropTypes.string]),className:PropTypes.string},Radio.defaultProps={avatar:void 0,checked:!1,disabled:!1,id:null,secondary:null,value:"",className:void 0};export default Radio;
@@ -1,2 +1,2 @@
1
- import PropTypes from"prop-types";import{Component}from"react";import Radio from"../radio";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";class RadioGroup extends Component{constructor(a){super(a),this.state={selectedValue:a.selectedValue}}handleOnChange=a=>{const{onChange:b}=this.props;this.setState({selectedValue:a},b&&b(a))};render(){const{radios:a,name:b}=this.props,{selectedValue:c}=this.state;return a&&1<a.length?/*#__PURE__*/_jsx(_Fragment,{children:a.map((a,d)=>{let{id:e,avatar:f,value:g,label:h,disabled:i,secondary:j,readOnly:k}=a;return/*#__PURE__*/_jsx(Radio// eslint-disable-next-line react/no-array-index-key
2
- ,{id:e,value:g,label:h,name:b,disabled:i,checked:c===g,secondary:j,readOnly:k,avatar:f,onChange:a=>this.handleOnChange(a)},d)})}):null}}RadioGroup.propTypes={radios:PropTypes.arrayOf(PropTypes.shape({id:PropTypes.string,avatar:PropTypes.element,value:PropTypes.oneOfType([PropTypes.number,PropTypes.string]),secondary:PropTypes.string,label:PropTypes.string.isRequired,disabled:PropTypes.bool,readOnly:PropTypes.bool})).isRequired,onChange:PropTypes.func.isRequired,selectedValue:PropTypes.oneOfType([PropTypes.number,PropTypes.string]),name:PropTypes.string.isRequired},RadioGroup.defaultProps={selectedValue:null};export default RadioGroup;
1
+ 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.object.to-string.js";import"core-js/modules/es.reflect.construct.js";import"core-js/modules/es.function.name.js";import"core-js/modules/es.array.map.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 Radio from"../radio";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";var RadioGroup=/*#__PURE__*/function(a){function b(a){var d;return _classCallCheck(this,b),d=c.call(this,a),_defineProperty(_assertThisInitialized(d),"handleOnChange",function(a){var b=d.props.onChange;d.setState({selectedValue:a},b&&b(a))}),d.state={selectedValue:a.selectedValue},d}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this,b=this.props,c=b.radios,d=b.name,e=this.state.selectedValue;return c&&1<c.length?/*#__PURE__*/_jsx(_Fragment,{children:c.map(function(b,c){var f=b.id,g=b.avatar,h=b.value,i=b.label,j=b.disabled,k=b.secondary,l=b.readOnly;return/*#__PURE__*/_jsx(Radio// eslint-disable-next-line react/no-array-index-key
2
+ ,{id:f,value:h,label:i,name:d,disabled:j,checked:e===h,secondary:k,readOnly:l,avatar:g,onChange:function onChange(b){return a.handleOnChange(b)}},c)})}):null}}]),b}(Component);RadioGroup.propTypes={radios:PropTypes.arrayOf(PropTypes.shape({id:PropTypes.string,avatar:PropTypes.element,value:PropTypes.oneOfType([PropTypes.number,PropTypes.string]),secondary:PropTypes.string,label:PropTypes.string.isRequired,disabled:PropTypes.bool,readOnly:PropTypes.bool})).isRequired,onChange:PropTypes.func.isRequired,selectedValue:PropTypes.oneOfType([PropTypes.number,PropTypes.string]),name:PropTypes.string.isRequired},RadioGroup.defaultProps={selectedValue:null};export default RadioGroup;
@@ -1 +1 @@
1
- import PropTypes from"prop-types";import Option from"../common/Option";import RadioButton from"../common/RadioButton";import{jsx as _jsx}from"react/jsx-runtime";const RadioOption=a=>{let{"aria-label":b,media:c,title:d,content:e,id:f,name:g,checked:h,onChange:i,complex:j,disabled:k,value:l,showMediaCircle:m,showMediaAtAllSizes:n,isContainerAligned:o}=a;return/*#__PURE__*/_jsx(Option,{...{"aria-label":b,media:c,title:d,content:e,name:g,complex:j,disabled:k,showMediaCircle:m,showMediaAtAllSizes:n,isContainerAligned:o},button:/*#__PURE__*/_jsx(RadioButton,{id:f,name:g,checked:h,disabled:k,value:l,onChange:i})})};RadioOption.propTypes={"aria-label":PropTypes.string,media:PropTypes.node,id:PropTypes.string.isRequired,name:PropTypes.string.isRequired,title:PropTypes.node.isRequired,content:PropTypes.node,checked:PropTypes.bool,onChange:PropTypes.func.isRequired,complex:PropTypes.bool,disabled:PropTypes.bool,value:PropTypes.string,showMediaCircle:PropTypes.bool,showMediaAtAllSizes:PropTypes.bool,isContainerAligned:PropTypes.bool},RadioOption.defaultProps={"aria-label":void 0,media:null,content:null,checked:!1,complex:!1,disabled:!1,showMediaCircle:!0,showMediaAtAllSizes:!1,isContainerAligned:!1,value:""};export default RadioOption;
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"core-js/modules/es.function.name.js";import PropTypes from"prop-types";import Option from"../common/Option";import RadioButton from"../common/RadioButton";import{jsx as _jsx}from"react/jsx-runtime";var RadioOption=function(a){var b=a["aria-label"],c=a.media,d=a.title,e=a.content,f=a.id,g=a.name,h=a.checked,i=a.onChange,j=a.complex,k=a.disabled,l=a.value,m=a.showMediaCircle,n=a.showMediaAtAllSizes,o=a.isContainerAligned;return/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},{"aria-label":b,media:c,title:d,content:e,name:g,complex:j,disabled:k,showMediaCircle:m,showMediaAtAllSizes:n,isContainerAligned:o}),{},{button:/*#__PURE__*/_jsx(RadioButton,{id:f,name:g,checked:h,disabled:k,value:l,onChange:i})}))};RadioOption.propTypes={"aria-label":PropTypes.string,media:PropTypes.node,id:PropTypes.string.isRequired,name:PropTypes.string.isRequired,title:PropTypes.node.isRequired,content:PropTypes.node,checked:PropTypes.bool,onChange:PropTypes.func.isRequired,complex:PropTypes.bool,disabled:PropTypes.bool,value:PropTypes.string,showMediaCircle:PropTypes.bool,showMediaAtAllSizes:PropTypes.bool,isContainerAligned:PropTypes.bool},RadioOption.defaultProps={"aria-label":void 0,media:null,content:null,checked:!1,complex:!1,disabled:!1,showMediaCircle:!0,showMediaAtAllSizes:!1,isContainerAligned:!1,value:""};export default RadioOption;
@@ -2,4 +2,4 @@ import classNames from"classnames";import{jsx as _jsx}from"react/jsx-runtime";/*
2
2
  *
3
3
  * Neptune Web: https://transferwise.github.io/neptune-web/components/content/Section
4
4
  *
5
- */const Section=a=>{let{children:b,className:c,withHorizontalPadding:d=!1}=a;return/*#__PURE__*/_jsx("div",{className:classNames("np-section",c,{"np-section--with-horizontal-padding":d}),children:b})};export default Section;
5
+ */var Section=function(a){var b=a.children,c=a.className,d=a.withHorizontalPadding;return/*#__PURE__*/_jsx("div",{className:classNames("np-section",c,{"np-section--with-horizontal-padding":void 0!==d&&d}),children:b})};export default Section;
@@ -1 +1 @@
1
- import{render,screen}from"../test-utils";import Section from".";import{jsx as _jsx}from"react/jsx-runtime";describe("Section",()=>{it("can render children",()=>{render(/*#__PURE__*/_jsx(Section,{children:"Children here"})),expect(screen.getByText("Children here")).toBeInTheDocument()})});
1
+ import{render,screen}from"../test-utils";import Section from".";import{jsx as _jsx}from"react/jsx-runtime";describe("Section",function(){it("can render children",function(){render(/*#__PURE__*/_jsx(Section,{children:"Children here"})),expect(screen.getByText("Children here")).toBeInTheDocument()})});
@@ -1 +1 @@
1
- import{FastFlag as FastFlagIcon}from"@transferwise/icons";import{useState}from"react";import Accordion from"../accordion";import Card from"../card";import Header from"../header";import NavigationOption from"../navigationOption";import Section from"./Section";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 default{component:Section,title:"Content/Section"};export const Basic=()=>/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Section,{children:"Section 1 content"}),/*#__PURE__*/_jsx(Section,{children:"Section 2 content"})]});export const WithHeader=()=>/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs(Section,{children:[/*#__PURE__*/_jsx(Header,{title:"Section 1 title"}),"Section 1 content"]}),/*#__PURE__*/_jsxs(Section,{children:[/*#__PURE__*/_jsx(Header,{title:"Section 2 title"}),"Section 2 content"]})]});export const withAccordion=()=>{const a=[{id:"Item 1",title:"If you have a deadline, set up your transfer early",content:"Most large transfers take around 2\u20134 working days from start to finish. So set up your transfer early if you have a deadline coming up.",icon:/*#__PURE__*/_jsx(FastFlagIcon,{size:24})},{id:"Item 2",title:"Have documents on hand to speed things up",content:"When you set up your transfer, we might ask for documents that show where your money comes from. Documents you might need (opens in a new tab)",icon:/*#__PURE__*/_jsx(FastFlagIcon,{size:24})},{id:"Item 3",title:"Lorem ipsum",content:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed scelerisque velit nec ex rutrum efficitur sit amet at enim. Nam a neque magna. Nullam est urna, dignissim nec erat id, euismod aliquet nulla.",icon:/*#__PURE__*/_jsx(FastFlagIcon,{size:24})}];return/*#__PURE__*/_jsxs(Section,{children:[/*#__PURE__*/_jsx(Header,{title:"Section with accordion"}),/*#__PURE__*/_jsx(Accordion,{items:a,indexOpen:0})]})};export const WithCards=()=>{const[a,b]=useState(null),c=c=>a===c?b(null):void b(c);return/*#__PURE__*/_jsxs(Section,{children:[/*#__PURE__*/_jsx(Header,{title:"Section with cards"}),/*#__PURE__*/_jsx(Card,{title:"What's in the box?!",details:"Click me to reveal.",icon:/*#__PURE__*/_jsx(FastFlagIcon,{size:24}),isExpanded:0===a,onClick:()=>c(0),children:/*#__PURE__*/_jsx("div",{children:"Hello there!"})}),/*#__PURE__*/_jsx(Card,{title:"What's in the box?!",details:"Click me to reveal.",icon:/*#__PURE__*/_jsx(FastFlagIcon,{size:24}),isExpanded:1===a,onClick:()=>c(1),children:/*#__PURE__*/_jsx("div",{children:"Hello there!"})})]})};export const WithNavigationOptions=()=>/*#__PURE__*/_jsxs(Section,{children:[/*#__PURE__*/_jsx(Header,{title:"Section with options"}),/*#__PURE__*/_jsx(NavigationOption,{title:"Option 1",onClick:()=>alert("Option 1")}),/*#__PURE__*/_jsx(NavigationOption,{title:"Option 2",onClick:()=>alert("Option 2")})]});
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import{FastFlag as FastFlagIcon}from"@transferwise/icons";import{useState}from"react";import Accordion from"../accordion";import Card from"../card";import Header from"../header";import NavigationOption from"../navigationOption";import Section from"./Section";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 default{component:Section,title:"Content/Section"};export var Basic=function(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Section,{children:"Section 1 content"}),/*#__PURE__*/_jsx(Section,{children:"Section 2 content"})]})};export var WithHeader=function(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs(Section,{children:[/*#__PURE__*/_jsx(Header,{title:"Section 1 title"}),"Section 1 content"]}),/*#__PURE__*/_jsxs(Section,{children:[/*#__PURE__*/_jsx(Header,{title:"Section 2 title"}),"Section 2 content"]})]})};export var withAccordion=function(){var a=[{id:"Item 1",title:"If you have a deadline, set up your transfer early",content:"Most large transfers take around 2\u20134 working days from start to finish. So set up your transfer early if you have a deadline coming up.",icon:/*#__PURE__*/_jsx(FastFlagIcon,{size:24})},{id:"Item 2",title:"Have documents on hand to speed things up",content:"When you set up your transfer, we might ask for documents that show where your money comes from. Documents you might need (opens in a new tab)",icon:/*#__PURE__*/_jsx(FastFlagIcon,{size:24})},{id:"Item 3",title:"Lorem ipsum",content:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed scelerisque velit nec ex rutrum efficitur sit amet at enim. Nam a neque magna. Nullam est urna, dignissim nec erat id, euismod aliquet nulla.",icon:/*#__PURE__*/_jsx(FastFlagIcon,{size:24})}];return/*#__PURE__*/_jsxs(Section,{children:[/*#__PURE__*/_jsx(Header,{title:"Section with accordion"}),/*#__PURE__*/_jsx(Accordion,{items:a,indexOpen:0})]})};export var WithCards=function(){var a=useState(null),b=_slicedToArray(a,2),c=b[0],d=b[1],e=function(a){return c===a?d(null):void d(a)};return/*#__PURE__*/_jsxs(Section,{children:[/*#__PURE__*/_jsx(Header,{title:"Section with cards"}),/*#__PURE__*/_jsx(Card,{title:"What's in the box?!",details:"Click me to reveal.",icon:/*#__PURE__*/_jsx(FastFlagIcon,{size:24}),isExpanded:0===c,onClick:function onClick(){return e(0)},children:/*#__PURE__*/_jsx("div",{children:"Hello there!"})}),/*#__PURE__*/_jsx(Card,{title:"What's in the box?!",details:"Click me to reveal.",icon:/*#__PURE__*/_jsx(FastFlagIcon,{size:24}),isExpanded:1===c,onClick:function onClick(){return e(1)},children:/*#__PURE__*/_jsx("div",{children:"Hello there!"})})]})};export var WithNavigationOptions=function(){return/*#__PURE__*/_jsxs(Section,{children:[/*#__PURE__*/_jsx(Header,{title:"Section with options"}),/*#__PURE__*/_jsx(NavigationOption,{title:"Option 1",onClick:function onClick(){return alert("Option 1")}}),/*#__PURE__*/_jsx(NavigationOption,{title:"Option 2",onClick:function onClick(){return alert("Option 2")}})]})};
@@ -1,13 +1,12 @@
1
- import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import{useState,useEffect,useRef,useMemo}from"react";import{useIntl}from"react-intl";import Button from"../button";import Chevron from"../chevron";import{Position,getSimpleRandomId}from"../common";import BottomSheet from"../common/bottomSheet";import{stopPropagation}from"../common/domHelpers";import{useLayout}from"../common/hooks";import KeyCodes from"../common/keyCodes";import Panel from"../common/panel";import Drawer from"../drawer";import messages from"./Select.messages";import Option from"./option";import SearchBox from"./searchBox";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const DEFAULT_SEARCH_VALUE="",DEFAULT_OPTIONS_PAGE_SIZE=1e3,includesString=(a,b)=>a.toLowerCase().includes(b.toLowerCase());function defaultFilterFunction(a,b){if(isPlaceholderOption(a))return!0;const{label:c,note:d,secondary:e,currency:f,searchStrings:g}=a;return!!c&&includesString(c,b)||!!d&&includesString(d,b)||!!e&&includesString(e,b)||!!f&&includesString(f,b)||!!g&&g.some(a=>includesString(a,b))}function isActionableOption(a){return!a.header&&!a.separator&&!a.disabled}function isHeaderOption(a){return null!=a&&"header"in a}function isSeparatorOption(a){return null!=a&&"separator"in a}function clamp(a,b,c){return Math.max(Math.min(b,c),a)}/**
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.array.includes.js";import"core-js/modules/es.string.includes.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.replace.js";import"core-js/modules/es.array.concat.js";import"core-js/modules/es.string.search.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.array.reduce.js";import"core-js/modules/es.number.is-nan.js";import"core-js/modules/es.number.constructor.js";import"core-js/modules/es.array.map.js";import"core-js/modules/es.array.slice.js";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.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{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import{useState,useEffect,useRef,useMemo}from"react";import{useIntl}from"react-intl";import Button from"../button";import Chevron from"../chevron";import{Position,getSimpleRandomId}from"../common";import BottomSheet from"../common/bottomSheet";import{stopPropagation}from"../common/domHelpers";import{useLayout}from"../common/hooks";import KeyCodes from"../common/keyCodes";import Panel from"../common/panel";import Drawer from"../drawer";import messages from"./Select.messages";import Option from"./option";import SearchBox from"./searchBox";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var DEFAULT_SEARCH_VALUE="",DEFAULT_OPTIONS_PAGE_SIZE=1e3,includesString=function(a,b){return a.toLowerCase().includes(b.toLowerCase())};function defaultFilterFunction(a,b){if(isPlaceholderOption(a))return!0;var c=a.label,d=a.note,e=a.secondary,f=a.currency,g=a.searchStrings;return!!c&&includesString(c,b)||!!d&&includesString(d,b)||!!e&&includesString(e,b)||!!f&&includesString(f,b)||!!g&&g.some(function(a){return includesString(a,b)})}function isActionableOption(a){return!a.header&&!a.separator&&!a.disabled}function isHeaderOption(a){return null!=a&&"header"in a}function isSeparatorOption(a){return null!=a&&"separator"in a}function clamp(a,b,c){return Math.max(Math.min(b,c),a)}/**
2
2
  * No option or placeholder option is selected
3
- */const DEFAULT_SELECTED_OPTION=null;function isPlaceholderOption(a){return a===DEFAULT_SELECTED_OPTION||"placeholder"in a}function isSearchableOption(a){return!isHeaderOption(a)&&!isSeparatorOption(a)&&!isPlaceholderOption(a)}const getUniqueIdForOption=function(){let a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"",b=1<arguments.length?arguments[1]:void 0;if(null!=b){const c=b.value||(b.label?.replace(/\s/g,"")??"");return`option-${a}-${c}`}};export default function Select(a){function b(){null!=O&&0<aa.length&&e(aa[O])}function c(a){const b=aa.reduce((a,b,c)=>null==a?k(v,b)?c:null:a,null),c=R.current??-1;let d=c;-1===c&&(null==b?P(0):d=b);const e=d+a,f=clamp(0,aa.length-1,e);P(f)}function d(a){return b=>{stopPropagation(b),e(a)}}function e(a){x(isPlaceholderOption(a)?DEFAULT_SELECTED_OPTION:a),ha()}function f(){let{className:a}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};const b=classNames(K("np-dropdown-menu"),{[K("np-dropdown-menu-desktop")]:!fa,[K(`np-dropdown-menu-${r}`)]:!fa&&!Z},K(a));return/*#__PURE__*/_jsxs("ul",{ref:X,id:da,role:"listbox",tabIndex:"-1",className:b,...G,children:[!o&&!Y&&!!m&&/*#__PURE__*/_jsx(h,{}),Y&&/*#__PURE__*/_jsx(SearchBox,{ref:U,id:ea,classNames:E,value:C||M,placeholder:D||I(messages.searchPlaceholder),focusedOptionId:getUniqueIdForOption(n,ba),onChange:ga,onClick:stopPropagation}),_.slice(0,S).map(ia),S<_.length&&/*#__PURE__*/_jsx(g,{})]})}function g(){function a(a){stopPropagation(a),T(S+DEFAULT_OPTIONS_PAGE_SIZE)}return/*#__PURE__*/ (/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */_jsx("li",{className:classNames(K("clickable"),K("border-bottom"),K("show-more")),onClick:a,onKeyPress:a,children:/*#__PURE__*/_jsx("a",{children:"..."})}))}function h(){const a={placeholder:m};return/*#__PURE__*/ (/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */_jsx("li",{className:classNames(K("clickable"),K("border-bottom")),onClick:d(a),onKeyPress:d(a),children:/*#__PURE__*/_jsx("a",{children:m})}))}// eslint-disable-next-line react/prop-types
4
- function i(){return/*#__PURE__*/_jsx("li",{className:K("np-separator"),"aria-hidden":!0})}// eslint-disable-next-line react/prop-types
5
- function j(a){let{children:b}=a;return/*#__PURE__*/_jsx("li",{// eslint-disable-line jsx-a11y/no-noninteractive-element-interactions
6
- className:classNames(K("np-dropdown-header"),K("np-text-title-group")),onClick:stopPropagation,onKeyPress:stopPropagation,children:b})}function k(a,b){return a?.value===b?.value}function l(a){return _.reduce((b,c,d)=>d<a&&isActionableOption(c)?b+1:b,0)}let{placeholder:m,id:n,required:o,disabled:p,inverse:q,dropdownWidth:r,size:t,block:u,selected:v,search:w,onChange:x,onFocus:y,onBlur:z,options:A,onSearchChange:B,searchValue:C,searchPlaceholder:D,// eslint-disable-next-line unicorn/prevent-abbreviations
7
- classNames:E,dropdownUp:F,dropdownProps:G,buttonProps:H}=a;const{formatMessage:I}=useIntl(),{isModern:J}=useTheme(),K=a=>E[a]||a,[s,L]=useState(!1),[M,N]=useState(DEFAULT_SEARCH_VALUE),[O,P]=useState(null),Q=useRef(),R=useRef(),[S,T]=useState(DEFAULT_OPTIONS_PAGE_SIZE),U=useRef(null),V=useRef(null),W=useRef(null),X=useRef(null),Y=!!B||!!w,Z=null==r,$=useMemo(()=>getSimpleRandomId("np-select-"),[]),_=useMemo(()=>w&&M?A.filter(isSearchableOption).filter(a=>"function"==typeof w?w(a,M):defaultFilterFunction(a,M)):A,[A,w,M]),aa=useMemo(()=>_.filter(isActionableOption),[_]),ba=aa[O],ca=n||$,da=`${ca}-listbox`,ea=`${ca}-searchbox`,{isMobile:fa}=useLayout();useEffect(()=>{let a;if(0<=O)return requestAnimationFrame(()=>{a||(Y?Q.current?.scrollIntoView?.({block:"center"}):Q.current?.focus())}),()=>{a=!0}},[O,Y]);const ga=a=>{T(DEFAULT_OPTIONS_PAGE_SIZE),N(a.target.value),B&&B(a.target.value)};useEffect(()=>{s?((!fa||M)&&(Y&&!!U.current&&U.current.focus(),!Y&&X.current&&(null==R.current||Number.isNaN(R.current))&&X.current.focus()),R.current=O):R.current=null},[s,M,Y,fa,O]);const ha=()=>{L(!1),P(null),W.current&&W.current.focus()},ia=(a,b)=>{const c=a;if(isSeparatorOption(c)&&c?.separator)return/*#__PURE__*/_jsx(i,{},b);const e=a;if(isHeaderOption(e)&&e.header)return/*#__PURE__*/_jsx(j,{children:e.header},b);const f=k(v,a),g=a,h=!g.disabled&&O===l(b),m=classNames(K("np-dropdown-item"),g.disabled?[K("disabled")]:K("clickable"),{[K("active")]:f,[K("np-dropdown-item--focused")]:h}),o=g.disabled?stopPropagation:d(g);return/*#__PURE__*/ (/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */_jsx("li",{ref:h?Q:void 0,id:getUniqueIdForOption(n,a),"aria-selected":f,"aria-disabled":a.disabled,role:"option",tabIndex:"-1",className:m,onClick:o,onKeyPress:o,children:/*#__PURE__*/_jsx("a",{disabled:g.disabled,children:/*#__PURE__*/_jsx(Option,{...g,classNames:E})})},b))},ja=!!A.length;return s&&(C||M)&&(ja&&null==O&&P(0),!ja&&null!=O&&P(null)),/*#__PURE__*/_jsxs("div",{// eslint-disable-line jsx-a11y/no-static-element-interactions
8
- ref:V,className:classNames(K("np-select"),u?K("btn-block"):null,K("btn-group")),onKeyDown:a=>{switch(a.keyCode){case KeyCodes.UP:case KeyCodes.DOWN:s?c(a.keyCode===KeyCodes.UP?-1:1):L(!0),stopPropagation(a);break;case KeyCodes.SPACE:a.target!==U.current&&(s?b():L(!0),stopPropagation(a));break;case KeyCodes.ENTER:s?b():L(!0),stopPropagation(a);break;case KeyCodes.ESCAPE:ha(),stopPropagation(a);break;case KeyCodes.TAB:s&&b();break;default:}},onTouchMove:a=>{a.currentTarget===a.target&&s&&ha()},onFocus:a=>{y&&y(a)},onBlur:a=>{const{nativeEvent:b}=a;if(b){const c=b.relatedTarget,d=a.currentTarget;if(d&&c&&d.contains(c))return}z&&z(a)},children:[/*#__PURE__*/_jsxs(Button,{ref:W,id:ca,block:u,size:t,htmlType:"button",className:classNames(K("np-dropdown-toggle"),K("np-text-body-large"),q?K("np-dropdown-toggle-navy"):null)// reset Button's styles
9
- ,type:null,priority:null,disabled:p,role:"combobox","aria-controls":da,"aria-expanded":s,"aria-autocomplete":"none",onClick:()=>{L(!0)},...H,children:[v?/*#__PURE__*/_jsx(Option,{...v,classNames:E,selected:!0}):/*#__PURE__*/_jsx("span",{className:K("form-control-placeholder"),children:m}),/*#__PURE__*/_jsx(Chevron// disabled={disabled}
10
- ,{className:classNames(K("tw-icon"),K("tw-chevron-up-icon"),K("tw-chevron"),K("bottom"),K("np-select-chevron"))})]}),fa?Y?/*#__PURE__*/_jsx(Drawer,{open:s,headerTitle:D||I(messages.searchPlaceholder),onClose:ha,children:f()}):/*#__PURE__*/_jsx(BottomSheet,{open:s,onClose:ha,children:f({className:J?"":"p-a-1"})}):/*#__PURE__*/_jsx(Panel,{open:s,flip:!1,altAxis:!0,anchorRef:V,anchorWidth:Z,position:F?Position.TOP:Position.BOTTOM,onClose:ha,children:f({className:"p-a-1"})})]})}Select.propTypes={placeholder:PropTypes.string,id:PropTypes.string,required:PropTypes.bool,disabled:PropTypes.bool,inverse:PropTypes.bool,dropdownRight:PropTypes.oneOf(["xs","sm","md","lg","xl"]),dropdownWidth:PropTypes.oneOf(["sm","md","lg"]),size:PropTypes.oneOf(["sm","md","lg"]),block:PropTypes.bool,selected:PropTypes.shape({value:PropTypes.any.isRequired,label:PropTypes.node,icon:PropTypes.node,currency:PropTypes.string,note:PropTypes.node,secondary:PropTypes.node}),/**
3
+ */var DEFAULT_SELECTED_OPTION=null;function isPlaceholderOption(a){return a===DEFAULT_SELECTED_OPTION||"placeholder"in a}function isSearchableOption(a){return!isHeaderOption(a)&&!isSeparatorOption(a)&&!isPlaceholderOption(a)}var getUniqueIdForOption=function(){var a,b,c=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"",d=1<arguments.length?arguments[1]:void 0;if(null!=d){var e=d.value||(null!==(a=null===(b=d.label)||void 0===b?void 0:b.replace(/\s/g,""))&&void 0!==a?a:"");return"option-".concat(c,"-").concat(e)}};export default function Select(a){function b(){null!=W&&0<ka.length&&e(ka[W])}function c(a){var b,c=ka.reduce(function(a,b,c){return null==a?k(v,b)?c:null:a},null),d=null!==(b=Z.current)&&void 0!==b?b:-1,e=d;-1===d&&(null==c?X(0):e=c);var f=e+a,g=clamp(0,ka.length-1,f);X(g)}function d(a){return function(b){stopPropagation(b),e(a)}}function e(a){x(isPlaceholderOption(a)?DEFAULT_SELECTED_OPTION:a),sa()}function f(){var a,b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},c=b.className,d=classNames(M("np-dropdown-menu"),(a={},_defineProperty(a,M("np-dropdown-menu-desktop"),!qa),_defineProperty(a,M("np-dropdown-menu-".concat(r)),!qa&&!ha),a),M(c));return/*#__PURE__*/_jsxs("ul",_objectSpread(_objectSpread({ref:fa,id:na,role:"listbox",tabIndex:"-1",className:d},G),{},{children:[!o&&!ga&&!!m&&/*#__PURE__*/_jsx(h,{}),ga&&/*#__PURE__*/_jsx(SearchBox,{ref:ca,id:oa,classNames:E,value:C||S,placeholder:D||J(messages.searchPlaceholder),focusedOptionId:getUniqueIdForOption(n,la),onChange:ra,onClick:stopPropagation}),ja.slice(0,aa).map(ta),aa<ja.length&&/*#__PURE__*/_jsx(g,{})]}))}function g(){function a(a){stopPropagation(a),ba(aa+DEFAULT_OPTIONS_PAGE_SIZE)}return/*#__PURE__*/ (/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */_jsx("li",{className:classNames(M("clickable"),M("border-bottom"),M("show-more")),onClick:a,onKeyPress:a,children:/*#__PURE__*/_jsx("a",{children:"..."})}))}function h(){var a={placeholder:m};return/*#__PURE__*/ (/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */_jsx("li",{className:classNames(M("clickable"),M("border-bottom")),onClick:d(a),onKeyPress:d(a),children:/*#__PURE__*/_jsx("a",{children:m})}))}// eslint-disable-next-line react/prop-types
4
+ function i(){return/*#__PURE__*/_jsx("li",{className:M("np-separator"),"aria-hidden":!0})}// eslint-disable-next-line react/prop-types
5
+ function j(a){var b=a.children;return/*#__PURE__*/_jsx("li",{// eslint-disable-line jsx-a11y/no-noninteractive-element-interactions
6
+ className:classNames(M("np-dropdown-header"),M("np-text-title-group")),onClick:stopPropagation,onKeyPress:stopPropagation,children:b})}function k(a,b){return(null===a||void 0===a?void 0:a.value)===(null===b||void 0===b?void 0:b.value)}function l(a){return ja.reduce(function(b,c,d){return d<a&&isActionableOption(c)?b+1:b},0)}var m=a.placeholder,n=a.id,o=a.required,p=a.disabled,q=a.inverse,r=a.dropdownWidth,t=a.size,u=a.block,v=a.selected,w=a.search,x=a.onChange,y=a.onFocus,z=a.onBlur,A=a.options,B=a.onSearchChange,C=a.searchValue,D=a.searchPlaceholder,E=a.classNames,F=a.dropdownUp,G=a.dropdownProps,H=a.buttonProps,I=useIntl(),J=I.formatMessage,K=useTheme(),L=K.isModern,M=function(a){return E[a]||a},s=useState(!1),N=_slicedToArray(s,2),O=N[0],P=N[1],Q=useState(DEFAULT_SEARCH_VALUE),R=_slicedToArray(Q,2),S=R[0],T=R[1],U=useState(null),V=_slicedToArray(U,2),W=V[0],X=V[1],Y=useRef(),Z=useRef(),$=useState(DEFAULT_OPTIONS_PAGE_SIZE),_=_slicedToArray($,2),aa=_[0],ba=_[1],ca=useRef(null),da=useRef(null),ea=useRef(null),fa=useRef(null),ga=!!B||!!w,ha=null==r,ia=useMemo(function(){return getSimpleRandomId("np-select-")},[]),ja=useMemo(function(){return w&&S?A.filter(isSearchableOption).filter(function(a){return"function"==typeof w?w(a,S):defaultFilterFunction(a,S)}):A},[A,w,S]),ka=useMemo(function(){return ja.filter(isActionableOption)},[ja]),la=ka[W],ma=n||ia,na="".concat(ma,"-listbox"),oa="".concat(ma,"-searchbox"),pa=useLayout(),qa=pa.isMobile;useEffect(function(){var a;if(0<=W)return requestAnimationFrame(function(){if(!a)if(ga){var b,c;null===(b=Y.current)||void 0===b||null===(c=b.scrollIntoView)||void 0===c?void 0:c.call(b,{block:"center"})}else{var d;null===(d=Y.current)||void 0===d?void 0:d.focus()}}),function(){a=!0}},[W,ga]);var ra=function(a){ba(DEFAULT_OPTIONS_PAGE_SIZE),T(a.target.value),B&&B(a.target.value)};useEffect(function(){O?((!qa||S)&&(ga&&!!ca.current&&ca.current.focus(),!ga&&fa.current&&(null==Z.current||Number.isNaN(Z.current))&&fa.current.focus()),Z.current=W):Z.current=null},[O,S,ga,qa,W]);var sa=function(){P(!1),X(null),ea.current&&ea.current.focus()},ta=function(a,b){var c,e=a;if(isSeparatorOption(e)&&null!==e&&void 0!==e&&e.separator)return/*#__PURE__*/_jsx(i,{},b);var f=a;if(isHeaderOption(f)&&f.header)return/*#__PURE__*/_jsx(j,{children:f.header},b);var g=k(v,a),h=a,m=!h.disabled&&W===l(b),o=classNames(M("np-dropdown-item"),h.disabled?[M("disabled")]:M("clickable"),(c={},_defineProperty(c,M("active"),g),_defineProperty(c,M("np-dropdown-item--focused"),m),c)),p=h.disabled?stopPropagation:d(h);return/*#__PURE__*/ (/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */_jsx("li",{ref:m?Y:void 0,id:getUniqueIdForOption(n,a),"aria-selected":g,"aria-disabled":a.disabled,role:"option",tabIndex:"-1",className:o,onClick:p,onKeyPress:p,children:/*#__PURE__*/_jsx("a",{disabled:h.disabled,children:/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},h),{},{classNames:E}))})},b))},ua=!!A.length;return O&&(C||S)&&(ua&&null==W&&X(0),!ua&&null!=W&&X(null)),/*#__PURE__*/_jsxs("div",{// eslint-disable-line jsx-a11y/no-static-element-interactions
7
+ ref:da,className:classNames(M("np-select"),u?M("btn-block"):null,M("btn-group")),onKeyDown:function handleKeyDown(a){switch(a.keyCode){case KeyCodes.UP:case KeyCodes.DOWN:O?c(a.keyCode===KeyCodes.UP?-1:1):P(!0),stopPropagation(a);break;case KeyCodes.SPACE:a.target!==ca.current&&(O?b():P(!0),stopPropagation(a));break;case KeyCodes.ENTER:O?b():P(!0),stopPropagation(a);break;case KeyCodes.ESCAPE:sa(),stopPropagation(a);break;case KeyCodes.TAB:O&&b();break;default:}},onTouchMove:function handleTouchStart(a){a.currentTarget===a.target&&O&&sa()},onFocus:function handleOnFocus(a){y&&y(a)},onBlur:function handleOnBlur(a){var b=a.nativeEvent;if(b){var c=b.relatedTarget,d=a.currentTarget;if(d&&c&&d.contains(c))return}z&&z(a)},children:[/*#__PURE__*/_jsxs(Button,_objectSpread(_objectSpread({ref:ea,id:ma,block:u,size:t,htmlType:"button",className:classNames(M("np-dropdown-toggle"),M("np-text-body-large"),q?M("np-dropdown-toggle-navy"):null)// reset Button's styles
8
+ ,type:null,priority:null,disabled:p,role:"combobox","aria-controls":na,"aria-expanded":O,"aria-autocomplete":"none",onClick:function handleOnClick(){P(!0)}},H),{},{children:[v?/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},v),{},{classNames:E,selected:!0})):/*#__PURE__*/_jsx("span",{className:M("form-control-placeholder"),children:m}),/*#__PURE__*/_jsx(Chevron// disabled={disabled}
9
+ ,{className:classNames(M("tw-icon"),M("tw-chevron-up-icon"),M("tw-chevron"),M("bottom"),M("np-select-chevron"))})]})),qa?ga?/*#__PURE__*/_jsx(Drawer,{open:O,headerTitle:D||J(messages.searchPlaceholder),onClose:sa,children:f()}):/*#__PURE__*/_jsx(BottomSheet,{open:O,onClose:sa,children:f({className:L?"":"p-a-1"})}):/*#__PURE__*/_jsx(Panel,{open:O,flip:!1,altAxis:!0,anchorRef:da,anchorWidth:ha,position:F?Position.TOP:Position.BOTTOM,onClose:sa,children:f({className:"p-a-1"})})]})}Select.propTypes={placeholder:PropTypes.string,id:PropTypes.string,required:PropTypes.bool,disabled:PropTypes.bool,inverse:PropTypes.bool,dropdownRight:PropTypes.oneOf(["xs","sm","md","lg","xl"]),dropdownWidth:PropTypes.oneOf(["sm","md","lg"]),size:PropTypes.oneOf(["sm","md","lg"]),block:PropTypes.bool,selected:PropTypes.shape({value:PropTypes.any.isRequired,label:PropTypes.node,icon:PropTypes.node,currency:PropTypes.string,note:PropTypes.node,secondary:PropTypes.node}),/**
11
10
  * Search toggle
12
11
  * if `true` default search functionality being enabled (not case sensitive search in option labels & currency props)
13
12
  * if `function` you can define your own search function to implement custom search experience. This search function used while filtering the options array. The custom search function takes two parameters. First is the option the second is the keyword.
@@ -1,2 +1,2 @@
1
- // Option.tsx NEW
2
- import{useTheme}from"@wise/components-theming";import{cloneElement}from"react";import Body from"../../body";import{Typography}from"../../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";function Option(a){let{label:b,currency:d="",note:e="",secondary:f="",icon:c,classNames:g={},selected:h=!1}=a;const{isModern:i}=useTheme(),j=d?(a=>a.map(a=>g[a]||a).join(" "))(["currency-flag",`currency-flag-${d.toLowerCase()}`]):void 0,k=c?/*#__PURE__*/cloneElement(c,{size:24,className:"tw-icon"}):d&&/*#__PURE__*/_jsx("i",{className:j}),l=/*#__PURE__*/_jsxs(Body,{as:"span",type:Typography.BODY_LARGE,className:h?"text-ellipsis":void 0,children:[b,e&&/*#__PURE__*/_jsx(Body,{as:"span",className:i?"m-l-1":"m-l-1 body-2",children:e})]}),m=f&&/*#__PURE__*/_jsx(Body,{className:(()=>{let a;return h&&(a="text-ellipsis"),i?a:`${a?a+" ":""}body-2`})(),children:f});return k?/*#__PURE__*/_jsxs("div",{className:"d-flex np-option-content",children:[/*#__PURE__*/_jsx("div",{className:`d-flex flex-column${h?" justify-content-center":""}`,children:k}),/*#__PURE__*/_jsxs("div",{className:"d-flex flex-column justify-content-center",children:[l,m]})]}):/*#__PURE__*/_jsxs(_Fragment,{children:[k,l,m]})}export default Option;
1
+ import"core-js/modules/es.array.join.js";import"core-js/modules/es.array.map.js";// Option.tsx NEW
2
+ import{useTheme}from"@wise/components-theming";import{cloneElement}from"react";import Body from"../../body";import{Typography}from"../../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";function Option(a){var b=a.label,c=a.currency,d=void 0===c?"":c,e=a.note,f=void 0===e?"":e,g=a.secondary,h=void 0===g?"":g,i=a.icon,j=a.classNames,k=void 0===j?{}:j,l=a.selected,m=void 0!==l&&l,n=useTheme(),o=n.isModern,p=d?function style(a){return a.map(function(a){return k[a]||a}).join(" ")}(["currency-flag","currency-flag-".concat(d.toLowerCase())]):void 0,q=i?/*#__PURE__*/cloneElement(i,{size:24,className:"tw-icon"}):d&&/*#__PURE__*/_jsx("i",{className:p}),r=/*#__PURE__*/_jsxs(Body,{as:"span",type:Typography.BODY_LARGE,className:m?"text-ellipsis":void 0,children:[b,f&&/*#__PURE__*/_jsx(Body,{as:"span",className:o?"m-l-1":"m-l-1 body-2",children:f})]}),s=h&&/*#__PURE__*/_jsx(Body,{className:function secondaryElementClassNames(){var a;return m&&(a="text-ellipsis"),o?a:"".concat(a?a+" ":"","body-2")}(),children:h});return q?/*#__PURE__*/_jsxs("div",{className:"d-flex np-option-content",children:[/*#__PURE__*/_jsx("div",{className:"d-flex flex-column".concat(m?" justify-content-center":""),children:q}),/*#__PURE__*/_jsxs("div",{className:"d-flex flex-column justify-content-center",children:[r,s]})]}):/*#__PURE__*/_jsxs(_Fragment,{children:[q,r,s]})}export default Option;
@@ -1 +1 @@
1
- import{Search as SearchIcon}from"@transferwise/icons";import classnames from"classnames";import{forwardRef}from"react";import{Input}from"../../inputs/Input";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const SearchBox=/*#__PURE__*/forwardRef((a,b)=>{let{id:c,classNames:g={},focusedOptionId:d,onChange:e,onClick:f,placeholder:h=void 0,value:i=""}=a;const j=a=>g[a]||a;return/*#__PURE__*/_jsx("li",{className:j("border-bottom"),children:/*#__PURE__*/_jsx("a",{className:`${j("np-select-filter-link")} ${j("p-a-0")}`,children:/*#__PURE__*/_jsxs("div",{className:j("input-group"),children:[/*#__PURE__*/_jsx("span",{className:classnames("input-group-addon","input-group-addon--search"),children:/*#__PURE__*/_jsx(SearchIcon,{className:classnames(j("tw-icon"),j("tw-icon-search")),size:24})}),/*#__PURE__*/_jsx(Input,{ref:b,id:c,className:classnames(j("np-select-filter")),placeholder:h,value:i,spellCheck:"false","aria-activedescendant":d,onChange:e,onClick:f})]})})})});export default SearchBox;
1
+ import"core-js/modules/es.array.concat.js";import{Search as SearchIcon}from"@transferwise/icons";import classnames from"classnames";import{forwardRef}from"react";import{Input}from"../../inputs/Input";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var SearchBox=/*#__PURE__*/forwardRef(function(a,b){var c=a.id,d=a.classNames,e=void 0===d?{}:d,f=a.focusedOptionId,g=a.onChange,h=a.onClick,i=a.placeholder,j=void 0===i?void 0:i,k=a.value,l=void 0===k?"":k,m=function(a){return e[a]||a};return/*#__PURE__*/_jsx("li",{className:m("border-bottom"),children:/*#__PURE__*/_jsx("a",{className:"".concat(m("np-select-filter-link")," ").concat(m("p-a-0")),children:/*#__PURE__*/_jsxs("div",{className:m("input-group"),children:[/*#__PURE__*/_jsx("span",{className:classnames("input-group-addon","input-group-addon--search"),children:/*#__PURE__*/_jsx(SearchIcon,{className:classnames(m("tw-icon"),m("tw-icon-search")),size:24})}),/*#__PURE__*/_jsx(Input,{ref:b,id:c,className:classnames(m("np-select-filter")),placeholder:j,value:l,spellCheck:"false","aria-activedescendant":f,onChange:g,onClick:h})]})})})});export default SearchBox;
@@ -1,5 +1,5 @@
1
- import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef,useRef}from"react";import{Breakpoint}from"../common";import{useClientWidth}from"../common/hooks";import{jsx as _jsx}from"react/jsx-runtime";const Layout={COLUMN:"COLUMN"},SizeSwapper=/*#__PURE__*/forwardRef((a,b)=>{let{items:c,inline:d}=a;const e=useRef(null),[f]=useClientWidth({ref:b||e});if(!c||0===c.length)return null;// If all breakpoints are specified and clientWidth never > breakpoint itemsToRender can be undefined.
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.array.map.js";import"core-js/modules/es.object.values.js";import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef,useRef}from"react";import{Breakpoint}from"../common";import{useClientWidth}from"../common/hooks";import{jsx as _jsx}from"react/jsx-runtime";var Layout={COLUMN:"COLUMN"},SizeSwapper=/*#__PURE__*/forwardRef(function(a,b){var c=a.items,d=a.inline,e=useRef(null),f=useClientWidth({ref:b||e}),g=_slicedToArray(f,1),h=g[0];if(!c||0===c.length)return null;// If all breakpoints are specified and clientWidth never > breakpoint itemsToRender can be undefined.
2
2
  // Do not use deconstruct here to get items and layout.
3
- let g=[];// Always return parent container even if there are no items to display to
3
+ var i=[];// Always return parent container even if there are no items to display to
4
4
  // keep the ref on DOM and let clientWidth be calculated properly.
5
- return f?g=c.filter(a=>{let{breakpoint:b=0}=a;return f>=b}).pop():g.items=c.map(a=>{let{items:b}=a;return Object.values(b)}),/*#__PURE__*/_jsx("div",{ref:e,className:classNames("np-size-swapper",{"d-flex":!d,"d-inline-flex":d,"flex-column":g&&g.layout===Layout.COLUMN,"flex-wrap":g&&g.wrap}),style:{visibility:f?"visible":"hidden"},children:g&&g.items})});SizeSwapper.Breakpoint=Breakpoint,SizeSwapper.Layout=Layout,SizeSwapper.propTypes={inline:PropTypes.bool,/** List of items that will appear at the specified breakpoint and presented in row or columns depending on layout */items:PropTypes.arrayOf(PropTypes.shape({items:PropTypes.arrayOf(PropTypes.element),breakpoint:PropTypes.number,layout:PropTypes.oneOf([SizeSwapper.Layout.COLUMN]),wrap:PropTypes.bool})).isRequired},SizeSwapper.defaultProps={inline:!1};export default SizeSwapper;
5
+ return h?i=c.filter(function(a){var b=a.breakpoint,c=void 0===b?0:b;return h>=c}).pop():i.items=c.map(function(a){var b=a.items;return Object.values(b)}),/*#__PURE__*/_jsx("div",{ref:e,className:classNames("np-size-swapper",{"d-flex":!d,"d-inline-flex":d,"flex-column":i&&i.layout===Layout.COLUMN,"flex-wrap":i&&i.wrap}),style:{visibility:h?"visible":"hidden"},children:i&&i.items})});SizeSwapper.Breakpoint=Breakpoint,SizeSwapper.Layout=Layout,SizeSwapper.propTypes={inline:PropTypes.bool,/** List of items that will appear at the specified breakpoint and presented in row or columns depending on layout */items:PropTypes.arrayOf(PropTypes.shape({items:PropTypes.arrayOf(PropTypes.element),breakpoint:PropTypes.number,layout:PropTypes.oneOf([SizeSwapper.Layout.COLUMN]),wrap:PropTypes.bool})).isRequired},SizeSwapper.defaultProps={inline:!1};export default SizeSwapper;
@@ -1,2 +1,2 @@
1
- import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef,useRef}from"react";import mergeRefs from"react-merge-refs";import CSSTransition from"react-transition-group/CSSTransition";import{jsx as _jsx}from"react/jsx-runtime";export const EXIT_ANIMATION=350;const SlidingPanel=/*#__PURE__*/forwardRef((a,b)=>{let{children:c,className:d,open:e,position:f,showSlidingPanelBorder:g,slidingPanelPositionFixed:h,...i}=a;/** @type {RefObject<HTMLDivElement>} */const j=useRef(null);return/*#__PURE__*/_jsx(CSSTransition,{...i,nodeRef:j,in:e// Wait for animation to finish before unmount.
2
- ,timeout:{enter:0,exit:EXIT_ANIMATION},classNames:classNames(`sliding-panel--open-${f}`,g&&`sliding-panel--border-${f}`,{"sliding-panel--fixed":h},"sliding-panel"),appear:!0,unmountOnExit:!0,children:/*#__PURE__*/_jsx("div",{ref:mergeRefs([b,j]),className:classNames("sliding-panel",`sliding-panel--open-${f}`,d),children:c})})});SlidingPanel.propTypes={children:PropTypes.node,className:PropTypes.string,open:PropTypes.bool,position:PropTypes.oneOf(["top","bottom","left","right"]),showSlidingPanelBorder:PropTypes.bool,slidingPanelPositionFixed:PropTypes.bool},SlidingPanel.defaultProps={children:null,className:void 0,open:!1,position:"left",showSlidingPanelBorder:!1,slidingPanelPositionFixed:!1};export default SlidingPanel;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["children","className","open","position","showSlidingPanelBorder","slidingPanelPositionFixed"];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 classNames from"classnames";import PropTypes from"prop-types";import{forwardRef,useRef}from"react";import mergeRefs from"react-merge-refs";import CSSTransition from"react-transition-group/CSSTransition";import{jsx as _jsx}from"react/jsx-runtime";export var EXIT_ANIMATION=350;var SlidingPanel=/*#__PURE__*/forwardRef(function(a,b){var c=a.children,d=a.className,e=a.open,f=a.position,g=a.showSlidingPanelBorder,h=a.slidingPanelPositionFixed,i=_objectWithoutProperties(a,_excluded),j=useRef(null);return/*#__PURE__*/_jsx(CSSTransition,_objectSpread(_objectSpread({},i),{},{nodeRef:j,in:e// Wait for animation to finish before unmount.
2
+ ,timeout:{enter:0,exit:EXIT_ANIMATION},classNames:classNames("sliding-panel--open-".concat(f),g&&"sliding-panel--border-".concat(f),{"sliding-panel--fixed":h},"sliding-panel"),appear:!0,unmountOnExit:!0,children:/*#__PURE__*/_jsx("div",{ref:mergeRefs([b,j]),className:classNames("sliding-panel","sliding-panel--open-".concat(f),d),children:c})}))});SlidingPanel.propTypes={children:PropTypes.node,className:PropTypes.string,open:PropTypes.bool,position:PropTypes.oneOf(["top","bottom","left","right"]),showSlidingPanelBorder:PropTypes.bool,slidingPanelPositionFixed:PropTypes.bool},SlidingPanel.defaultProps={children:null,className:void 0,open:!1,position:"left",showSlidingPanelBorder:!1,slidingPanelPositionFixed:!1};export default SlidingPanel;
@@ -1 +1 @@
1
- import PropTypes from"prop-types";import{Component,createRef}from"react";import CSSTransition from"react-transition-group/CSSTransition";import ActionButton from"../actionButton";import Body from"../body";import{Theme}from"../common";import{DirectionContext}from"../provider/direction";import withNextPortal from"../withNextPortal/withNextPortal";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export const CSS_TRANSITION_DURATION=400;export class Snackbar extends Component{/** @type {RefObject<HTMLSpanElement>} */bodyRef=/*#__PURE__*/createRef();constructor(){super(),this.state={visible:!1,text:""}}componentWillUnmount(){clearTimeout(this.timeout),clearTimeout(this.transitionTimeout)}shouldComponentUpdate(a,b){return!!a.text&&(a.timestamp!==this.props.timestamp||b.visible!==this.state.visible||b.text!==this.state.text)}setLeaveTimeout=()=>{const{timeout:a}=this.props;this.timeout=setTimeout(()=>{this.setState({visible:!1})},a)};componentDidUpdate(a){const{action:b,text:c,theme:d,timestamp:e}=this.props;a.text?a.timestamp!==e&&(clearTimeout(this.timeout),this.state.visible?this.setState({visible:!1},()=>{this.transitionTimeout=setTimeout(()=>{this.setState({visible:!0,action:b,text:c,theme:d}),this.setLeaveTimeout()},CSS_TRANSITION_DURATION)}):(this.setState({visible:!0,action:b,text:c,theme:d}),this.setLeaveTimeout())):this.setState({visible:!0,action:b,text:c,theme:d},()=>{this.setLeaveTimeout()})}render(){const{action:a,text:b,theme:c,visible:d}=this.state,{timeout:e}=this.props;return/*#__PURE__*/_jsx("div",{className:"snackbar",children:/*#__PURE__*/_jsx(CSSTransition,{nodeRef:this.bodyRef,in:d,classNames:"snackbar__text-container",timeout:{appear:0,enter:e,exit:CSS_TRANSITION_DURATION},unmountOnExit:!0,children:/*#__PURE__*/_jsxs(Body,{ref:this.bodyRef,as:"span",className:`snackbar__text snackbar__text--${c}`,children:[b,a?/*#__PURE__*/_jsx(ActionButton,{className:"snackbar__text__action",onClick:a.onClick,children:a.label}):null]})})})}}Snackbar.contextType=DirectionContext,Snackbar.propTypes={action:PropTypes.shape({label:PropTypes.string.isRequired,onClick:PropTypes.func.isRequired}),text:PropTypes.node.isRequired,theme:PropTypes.oneOf(["light","dark"]),timeout:PropTypes.number.isRequired,timestamp:PropTypes.number.isRequired},Snackbar.defaultProps={action:null,theme:Theme.LIGHT};export default withNextPortal(Snackbar);
1
+ 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.object.to-string.js";import"core-js/modules/es.reflect.construct.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,createRef}from"react";import CSSTransition from"react-transition-group/CSSTransition";import ActionButton from"../actionButton";import Body from"../body";import{Theme}from"../common";import{DirectionContext}from"../provider/direction";import withNextPortal from"../withNextPortal/withNextPortal";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export var CSS_TRANSITION_DURATION=400;export var Snackbar=/*#__PURE__*/function(a){/** @type {RefObject<HTMLSpanElement>} */function b(){var a;return _classCallCheck(this,b),a=c.call(this),_defineProperty(_assertThisInitialized(a),"bodyRef",/*#__PURE__*/createRef()),_defineProperty(_assertThisInitialized(a),"setLeaveTimeout",function(){var b=a.props.timeout;a.timeout=setTimeout(function(){a.setState({visible:!1})},b)}),a.state={visible:!1,text:""},a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"componentWillUnmount",value:function componentWillUnmount(){clearTimeout(this.timeout),clearTimeout(this.transitionTimeout)}},{key:"shouldComponentUpdate",value:function shouldComponentUpdate(a,b){return!!a.text&&(a.timestamp!==this.props.timestamp||b.visible!==this.state.visible||b.text!==this.state.text)}},{key:"componentDidUpdate",value:function componentDidUpdate(a){var b=this,c=this.props,d=c.action,e=c.text,f=c.theme,g=c.timestamp;a.text?a.timestamp!==g&&(clearTimeout(this.timeout),this.state.visible?this.setState({visible:!1},function(){b.transitionTimeout=setTimeout(function(){b.setState({visible:!0,action:d,text:e,theme:f}),b.setLeaveTimeout()},CSS_TRANSITION_DURATION)}):(this.setState({visible:!0,action:d,text:e,theme:f}),this.setLeaveTimeout())):this.setState({visible:!0,action:d,text:e,theme:f},function(){b.setLeaveTimeout()})}},{key:"render",value:function render(){var a=this.state,b=a.action,c=a.text,d=a.theme,e=a.visible,f=this.props.timeout;return/*#__PURE__*/_jsx("div",{className:"snackbar",children:/*#__PURE__*/_jsx(CSSTransition,{nodeRef:this.bodyRef,in:e,classNames:"snackbar__text-container",timeout:{appear:0,enter:f,exit:CSS_TRANSITION_DURATION},unmountOnExit:!0,children:/*#__PURE__*/_jsxs(Body,{ref:this.bodyRef,as:"span",className:"snackbar__text snackbar__text--".concat(d),children:[c,b?/*#__PURE__*/_jsx(ActionButton,{className:"snackbar__text__action",onClick:b.onClick,children:b.label}):null]})})})}}]),b}(Component);Snackbar.contextType=DirectionContext,Snackbar.propTypes={action:PropTypes.shape({label:PropTypes.string.isRequired,onClick:PropTypes.func.isRequired}),text:PropTypes.node.isRequired,theme:PropTypes.oneOf(["light","dark"]),timeout:PropTypes.number.isRequired,timestamp:PropTypes.number.isRequired},Snackbar.defaultProps={action:null,theme:Theme.LIGHT};export default withNextPortal(Snackbar);
@@ -1 +1 @@
1
- import{createContext}from"react";export const SnackbarContext=/*#__PURE__*/createContext();export const SnackbarConsumer=SnackbarContext.Consumer;
1
+ import{createContext}from"react";export var SnackbarContext=/*#__PURE__*/createContext();export var SnackbarConsumer=SnackbarContext.Consumer;
@@ -1 +1 @@
1
- import PropTypes from"prop-types";import{Component}from"react";import SnackbarPortal from"./Snackbar";import{SnackbarContext}from"./SnackbarContext";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";class SnackbarProvider extends Component{constructor(){super(),this.state={text:"",timestamp:0}}create=a=>{let{action:b,text:c,theme:d}=a;this.setState({action:b,text:c,theme:d,timestamp:Date.now()})};render(){const{action:a,text:b,theme:c,timestamp:d}=this.state;return/*#__PURE__*/_jsxs(SnackbarContext.Provider,{value:{createSnackbar:this.create},children:[/*#__PURE__*/_jsx(SnackbarPortal,{action:a,text:b,timestamp:d,timeout:this.props.timeout,theme:c}),this.props.children]})}}SnackbarProvider.propTypes={children:PropTypes.node.isRequired,timeout:PropTypes.number},SnackbarProvider.defaultProps={timeout:4500};export default SnackbarProvider;
1
+ 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.object.to-string.js";import"core-js/modules/es.reflect.construct.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 SnackbarPortal from"./Snackbar";import{SnackbarContext}from"./SnackbarContext";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var SnackbarProvider=/*#__PURE__*/function(a){function b(){var a;return _classCallCheck(this,b),a=c.call(this),_defineProperty(_assertThisInitialized(a),"create",function(b){var c=b.action,d=b.text,e=b.theme;a.setState({action:c,text:d,theme:e,timestamp:Date.now()})}),a.state={text:"",timestamp:0},a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this.state,b=a.action,c=a.text,d=a.theme,e=a.timestamp;return/*#__PURE__*/_jsxs(SnackbarContext.Provider,{value:{createSnackbar:this.create},children:[/*#__PURE__*/_jsx(SnackbarPortal,{action:b,text:c,timestamp:e,timeout:this.props.timeout,theme:d}),this.props.children]})}}]),b}(Component);SnackbarProvider.propTypes={children:PropTypes.node.isRequired,timeout:PropTypes.number},SnackbarProvider.defaultProps={timeout:4500};export default SnackbarProvider;
@@ -1 +1 @@
1
- import{useContext}from"react";import{SnackbarContext}from"./SnackbarContext";function useSnackbar(){const{createSnackbar:a}=useContext(SnackbarContext);return a}export default useSnackbar;
1
+ import{useContext}from"react";import{SnackbarContext}from"./SnackbarContext";function useSnackbar(){var a=useContext(SnackbarContext),b=a.createSnackbar;return b}export default useSnackbar;
@@ -1 +1 @@
1
- import{Info,Alert,Cross,Check,ClockBorderless}from"@transferwise/icons";import classNames from"classnames";import{Sentiment}from"../common";import{jsx as _jsx}from"react/jsx-runtime";const StatusIcon=a=>{let{sentiment:c=Sentiment.NEUTRAL,size:b}=a;const d={[Sentiment.POSITIVE]:Check,[Sentiment.NEUTRAL]:Info,[Sentiment.WARNING]:Alert,[Sentiment.NEGATIVE]:Cross,[Sentiment.PENDING]:ClockBorderless,[Sentiment.INFO]:Info,[Sentiment.ERROR]:Cross,[Sentiment.SUCCESS]:Check},e=[Sentiment.WARNING,Sentiment.PENDING].includes(c)?"dark":"light",f=d[c];return/*#__PURE__*/_jsx("span",{"data-testid":"status-icon",className:classNames("status-circle","status-circle-"+b,c),children:/*#__PURE__*/_jsx(f,{className:classNames("status-icon",e)})})};export default StatusIcon;
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{Info,Alert,Cross,Check,ClockBorderless}from"@transferwise/icons";import classNames from"classnames";import{Sentiment}from"../common";import{jsx as _jsx}from"react/jsx-runtime";var StatusIcon=function(a){var b,c=a.sentiment,d=void 0===c?Sentiment.NEUTRAL:c,e=a.size,f=(b={},_defineProperty(b,Sentiment.POSITIVE,Check),_defineProperty(b,Sentiment.NEUTRAL,Info),_defineProperty(b,Sentiment.WARNING,Alert),_defineProperty(b,Sentiment.NEGATIVE,Cross),_defineProperty(b,Sentiment.PENDING,ClockBorderless),_defineProperty(b,Sentiment.INFO,Info),_defineProperty(b,Sentiment.ERROR,Cross),_defineProperty(b,Sentiment.SUCCESS,Check),b),g=[Sentiment.WARNING,Sentiment.PENDING].includes(d)?"dark":"light",h=f[d];return/*#__PURE__*/_jsx("span",{"data-testid":"status-icon",className:classNames("status-circle","status-circle-"+e,d),children:/*#__PURE__*/_jsx(h,{className:classNames("status-icon",g)})})};export default StatusIcon;
@@ -1 +1 @@
1
- import{Size,Sentiment}from"../common";import StatusIcon from"./StatusIcon";import{jsx as _jsx}from"react/jsx-runtime";export default{component:StatusIcon,title:"Other/StatusIcon"};export const Basic={render:a=>/*#__PURE__*/_jsx("span",{style:{display:"flex"},children:/*#__PURE__*/_jsx(StatusIcon,{...a})})};export const Variants={render:()=>/*#__PURE__*/_jsx("span",{style:{display:"flex",justifyContent:"space-between",maxWidth:"400px"},children:[Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING].map(a=>/*#__PURE__*/_jsx("span",{style:{display:"flex",justifyContent:"space-between",flexDirection:"column",minHeight:"150px",alignItems:"center"},children:[Size.SMALL,Size.MEDIUM,Size.LARGE].map(b=>/*#__PURE__*/_jsx(StatusIcon,{size:b,sentiment:a},b))},a))})};
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.map.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{Size,Sentiment}from"../common";import StatusIcon from"./StatusIcon";import{jsx as _jsx}from"react/jsx-runtime";export default{component:StatusIcon,title:"Other/StatusIcon"};export var Basic={render:function render(a){return/*#__PURE__*/_jsx("span",{style:{display:"flex"},children:/*#__PURE__*/_jsx(StatusIcon,_objectSpread({},a))})}};export var Variants={render:function render(){return/*#__PURE__*/_jsx("span",{style:{display:"flex",justifyContent:"space-between",maxWidth:"400px"},children:[Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING].map(function(a){return/*#__PURE__*/_jsx("span",{style:{display:"flex",justifyContent:"space-between",flexDirection:"column",minHeight:"150px",alignItems:"center"},children:[Size.SMALL,Size.MEDIUM,Size.LARGE].map(function(b){return/*#__PURE__*/_jsx(StatusIcon,{size:b,sentiment:a},b)})},a)})})}};
@@ -1 +1 @@
1
- import classNames from"classnames";import PropTypes from"prop-types";import Body from"../body/Body";import{Position}from"../common";import{useDirection}from"../common/hooks";import Tooltip from"../tooltip";import{isTouchDevice}from"./deviceDetection";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";function clamp(a,b,c){return Math.max(Math.min(b,c),a)}/* eslint-disable react/no-array-index-key */const Stepper=a=>{let{steps:b,activeStep:c,className:d}=a;const{isRTL:e}=useDirection();if(0===b.length)return null;const f=clamp(0,b.length-1,c),g=1/(b.length-1),h=f/(b.length-1),i=Math.max(h-g,0),j=Math.min(f,1)*g;return/*#__PURE__*/_jsxs("div",{className:classNames("tw-stepper",d),children:[/*#__PURE__*/_jsxs("div",{className:"progress",children:[/*#__PURE__*/_jsx("div",{className:"progress-bar-filler",style:{width:`${100*i}%`}}),/*#__PURE__*/_jsx("div",{className:"progress-bar-ending",style:{width:`${100*j}%`}})]}),/*#__PURE__*/_jsx("ul",{className:"tw-stepper-steps p-t-1 m-b-0",children:b.map((a,b)=>{const c=b===f,d=a.onClick&&!c,h=d?/*#__PURE__*/_jsx("button",{type:"button",className:"btn-unstyled tw-stepper__step-label",onClick:()=>d&&a.onClick(),children:/*#__PURE__*/_jsx("small",{children:a.label})}):/*#__PURE__*/_jsx(Body,{as:"span",className:"tw-stepper__step-label small",children:a.label});return/*#__PURE__*/_jsx("li",{className:classNames("hidden-xs","tw-stepper__step",c&&"tw-stepper__step--active",d&&"tw-stepper__step--clickable",a.hoverLabel&&"tw-stepper__step--has-tooltip"),style:e?{right:`${100*(b*g)}%`}:{left:`${100*(b*g)}%`},children:a.hoverLabel&&!isTouchDevice()?/*#__PURE__*/_jsx(Tooltip,{position:Position.BOTTOM,label:a.hoverLabel,children:h}):h},b)})})]})};/* eslint-enable react/no-array-index-key */Stepper.propTypes={steps:PropTypes.arrayOf(PropTypes.shape({label:PropTypes.node.isRequired,onClick:PropTypes.func,hoverLabel:PropTypes.node})).isRequired,activeStep:PropTypes.number,className:PropTypes.string},Stepper.defaultProps={activeStep:0,className:void 0};export default Stepper;
1
+ import"core-js/modules/es.array.map.js";import classNames from"classnames";import PropTypes from"prop-types";import Body from"../body/Body";import{Position}from"../common";import{useDirection}from"../common/hooks";import Tooltip from"../tooltip";import{isTouchDevice}from"./deviceDetection";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";function clamp(a,b,c){return Math.max(Math.min(b,c),a)}/* eslint-disable react/no-array-index-key */var Stepper=function(a){var b=a.steps,c=a.activeStep,d=a.className,e=useDirection(),f=e.isRTL;if(0===b.length)return null;var g=clamp(0,b.length-1,c),h=1/(b.length-1),i=g/(b.length-1),j=Math.max(i-h,0),k=Math.min(g,1)*h;return/*#__PURE__*/_jsxs("div",{className:classNames("tw-stepper",d),children:[/*#__PURE__*/_jsxs("div",{className:"progress",children:[/*#__PURE__*/_jsx("div",{className:"progress-bar-filler",style:{width:"".concat(100*j,"%")}}),/*#__PURE__*/_jsx("div",{className:"progress-bar-ending",style:{width:"".concat(100*k,"%")}})]}),/*#__PURE__*/_jsx("ul",{className:"tw-stepper-steps p-t-1 m-b-0",children:b.map(function renderStep(a,b){var c=b===g,d=a.onClick&&!c,e=d?/*#__PURE__*/_jsx("button",{type:"button",className:"btn-unstyled tw-stepper__step-label",onClick:function onClick(){return d&&a.onClick()},children:/*#__PURE__*/_jsx("small",{children:a.label})}):/*#__PURE__*/_jsx(Body,{as:"span",className:"tw-stepper__step-label small",children:a.label});return/*#__PURE__*/_jsx("li",{className:classNames("hidden-xs","tw-stepper__step",c&&"tw-stepper__step--active",d&&"tw-stepper__step--clickable",a.hoverLabel&&"tw-stepper__step--has-tooltip"),style:f?{right:"".concat(100*(b*h),"%")}:{left:"".concat(100*(b*h),"%")},children:a.hoverLabel&&!isTouchDevice()?/*#__PURE__*/_jsx(Tooltip,{position:Position.BOTTOM,label:a.hoverLabel,children:e}):e},b)})})]})};/* eslint-enable react/no-array-index-key */Stepper.propTypes={steps:PropTypes.arrayOf(PropTypes.shape({label:PropTypes.node.isRequired,onClick:PropTypes.func,hoverLabel:PropTypes.node})).isRequired,activeStep:PropTypes.number,className:PropTypes.string},Stepper.defaultProps={activeStep:0,className:void 0};export default Stepper;
@@ -1,4 +1,4 @@
1
- function supportsTouchEvents(){const a="undefined"!=typeof window&&window.ontouchstart!==void 0,b="undefined"!=typeof navigator&&navigator.maxTouchPoints,c="undefined"!=typeof window&&window.DocumentTouch&&document instanceof window.DocumentTouch;// eslint-disable-next-line compat/compat
2
- return!!(a||b||c)}function userAgentSuggestsTouchDevice(){const a=["android","iemobile","iphone","ipad","ipod","blackberry","bada"].map(a=>`(${a})`).join("|"),b=new RegExp(a,"ig");return"undefined"!=typeof navigator&&!!navigator.userAgent.match(b)}// Important: this is not fool-proof! It gives false positives and negatives, and will be outdated.
1
+ import"core-js/modules/es.array.join.js";import"core-js/modules/es.array.map.js";import"core-js/modules/es.regexp.constructor.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.regexp.to-string.js";import"core-js/modules/es.string.match.js";function supportsTouchEvents(){var a="undefined"!=typeof window&&window.ontouchstart!==void 0,b="undefined"!=typeof navigator&&navigator.maxTouchPoints,c="undefined"!=typeof window&&window.DocumentTouch&&document instanceof window.DocumentTouch;// eslint-disable-next-line compat/compat
2
+ return!!(a||b||c)}function userAgentSuggestsTouchDevice(){var a=["android","iemobile","iphone","ipad","ipod","blackberry","bada"].map(function(a){return"(".concat(a,")")}).join("|"),b=new RegExp(a,"ig");return"undefined"!=typeof navigator&&!!navigator.userAgent.match(b)}// Important: this is not fool-proof! It gives false positives and negatives, and will be outdated.
3
3
  // Only use this for small vanity changes where it still works either way.
4
4
  export function isTouchDevice(){return supportsTouchEvents()||userAgentSuggestsTouchDevice()}
@@ -1 +1 @@
1
- import PropTypes from"prop-types";import SlidingPanel from"../slidingPanel";import{jsx as _jsx}from"react/jsx-runtime";const Sticky=a=>{let{open:b,position:c,children:d}=a;return/*#__PURE__*/_jsx(SlidingPanel,{open:b,position:c,slidingPanelPositionFixed:!0,showSlidingPanelBorder:!0,children:d})};Sticky.propTypes={open:PropTypes.bool,position:PropTypes.oneOf(["top","bottom"]),children:PropTypes.node},Sticky.defaultProps={open:!0,position:"bottom",children:null};export default Sticky;
1
+ import PropTypes from"prop-types";import SlidingPanel from"../slidingPanel";import{jsx as _jsx}from"react/jsx-runtime";var Sticky=function(a){var b=a.open,c=a.position,d=a.children;return/*#__PURE__*/_jsx(SlidingPanel,{open:b,position:c,slidingPanelPositionFixed:!0,showSlidingPanelBorder:!0,children:d})};Sticky.propTypes={open:PropTypes.bool,position:PropTypes.oneOf(["top","bottom"]),children:PropTypes.node},Sticky.defaultProps={open:!0,position:"bottom",children:null};export default Sticky;
@@ -1 +1 @@
1
- import{CheckCircleFill as CheckCircleIcon,ClockFill as PendingCircleIcon}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement}from"react";import{useIntl}from"react-intl";import requiredIf from"react-required-if";import Body from"../body";import{Status,Size,Typography,Sentiment}from"../common";import Info from"../info";import Link from"../link/Link";import StatusIcon from"../statusIcon";import{deprecated}from"../utilities";import messages from"./Summary.messages";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const BadgeIcons={done:CheckCircleIcon,pending:PendingCircleIcon},statusLabels={[Status.NOT_DONE]:"statusNotDone",[Status.DONE]:"statusDone",[Status.PENDING]:"statusPending"},statusMapping={[Status.DONE]:Sentiment.POSITIVE,[Status.PENDING]:Sentiment.PENDING},expiryDate=new Date("03-01-2021"),Summary=a=>{let{action:b,as:c,className:d,content:e,description:k=e,help:f,icon:g,illustration:h,info:l=f,status:i,title:j}=a;const{isModern:m}=useTheme(),n=useIntl();let o=h;if(g){const a=g?.props?.size;o=24===a?g:/*#__PURE__*/cloneElement(g,{size:24})}const p=i&&BadgeIcons[i];return/*#__PURE__*/_jsxs(c,{className:classNames("np-summary d-flex align-items-start",d),"aria-label":i&&n.formatMessage(messages[statusLabels[i]]),children:[/*#__PURE__*/_jsxs("div",{className:"np-summary__icon",children:[o,p&&(m?/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(StatusIcon,{size:Size.SMALL,sentiment:statusMapping[i]})}):/*#__PURE__*/_jsx(p,{size:16,className:`np-summary-icon__${i}`}))]}),/*#__PURE__*/_jsxs("div",{className:"np-summary__body m-l-2",children:[/*#__PURE__*/_jsxs("div",{className:"np-summary__title d-flex",children:[/*#__PURE__*/_jsx(Body,{as:"span",type:Typography.BODY_LARGE_BOLD,className:"text-primary m-b-1",children:j}),l&&/*#__PURE__*/_jsx(Info,{"aria-label":l["aria-label"],className:"m-l-1 hidden-xs",content:l.content,presentation:l.presentation,size:m?Size.LARGE:Size.SMALL,title:l.title,onClick:l.onClick})]}),k&&/*#__PURE__*/_jsx(Body,{as:"span",type:Typography.BODY_DEFAULT,className:"d-block np-summary__description",children:k}),b&&/*#__PURE__*/_jsx(Link,{href:b.href,target:b.target,className:"np-summary__action","aria-label":b["aria-label"],onClick:b.onClick,children:b.text})]}),l&&/*#__PURE__*/_jsx(Info,{"aria-label":l["aria-label"],className:"m-l-2 hidden-sm hidden-md hidden-lg hidden-xl",content:l.content,presentation:l.presentation,size:m?Size.LARGE:Size.SMALL,title:l.title,onClick:l.onClick})]})};Summary.propTypes={/** Action displayed at the bottom of the Summary */action:PropTypes.shape({text:PropTypes.node.isRequired,href:PropTypes.string.isRequired,"aria-label":PropTypes.string,target:PropTypes.string,onClick:PropTypes.func}),/** Decides which html element should wrap the Summary */as:PropTypes.string,/** Extra classes applied to Summary */className:PropTypes.string,/** @deprecated please use description instead */content:deprecated(PropTypes.node,{component:"Summary",newProp:"description",expiryDate}),/** Summary description */description:PropTypes.node,/** @deprecated please use info instead */help:deprecated(PropTypes.shape({content:PropTypes.node.isRequired,title:PropTypes.node}),{component:"Summary",newProp:"info",expiryDate}),/** Infos displayed on help Icon click inside Popover or Modal */info:PropTypes.shape({"aria-label":PropTypes.string.isRequired,content:PropTypes.node.isRequired,onClick:PropTypes.func,presentation:PropTypes.oneOf(["POPOVER","MODAL"]),title:PropTypes.node}),/** @deprecated please use icon instead */illustration:deprecated(PropTypes.node,{component:"Summary",newProp:"icon",expiryDate}),/** Main Summary Icon */icon:requiredIf(PropTypes.node,a=>{let{illustration:b}=a;return!b}),/** Decides the badge applied to Icon */status:PropTypes.oneOf(["notDone","done","pending"]),/** Summary title */title:PropTypes.node.isRequired},Summary.defaultProps={action:null,as:"div",className:null,content:null,help:null,illustration:null,status:null};export default Summary;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";var _statusLabels,_statusMapping;import"core-js/modules/es.symbol.js";import"core-js/modules/es.symbol.description.js";import{CheckCircleFill as CheckCircleIcon,ClockFill as PendingCircleIcon}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement}from"react";import{useIntl}from"react-intl";import requiredIf from"react-required-if";import Body from"../body";import{Status,Size,Typography,Sentiment}from"../common";import Info from"../info";import Link from"../link/Link";import StatusIcon from"../statusIcon";import{deprecated}from"../utilities";import messages from"./Summary.messages";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var BadgeIcons={done:CheckCircleIcon,pending:PendingCircleIcon},statusLabels=(_statusLabels={},_defineProperty(_statusLabels,Status.NOT_DONE,"statusNotDone"),_defineProperty(_statusLabels,Status.DONE,"statusDone"),_defineProperty(_statusLabels,Status.PENDING,"statusPending"),_statusLabels),statusMapping=(_statusMapping={},_defineProperty(_statusMapping,Status.DONE,Sentiment.POSITIVE),_defineProperty(_statusMapping,Status.PENDING,Sentiment.PENDING),_statusMapping),expiryDate=new Date("03-01-2021"),Summary=function(a){var b=a.action,c=a.as,d=a.className,e=a.content,f=a.description,g=void 0===f?e:f,h=a.help,i=a.icon,j=a.illustration,k=a.info,l=void 0===k?h:k,m=a.status,n=a.title,o=useTheme(),p=o.isModern,q=useIntl(),r=j;if(i){var s,t=null===i||void 0===i||null===(s=i.props)||void 0===s?void 0:s.size;r=24===t?i:/*#__PURE__*/cloneElement(i,{size:24})}var u=m&&BadgeIcons[m];return/*#__PURE__*/_jsxs(c,{className:classNames("np-summary d-flex align-items-start",d),"aria-label":m&&q.formatMessage(messages[statusLabels[m]]),children:[/*#__PURE__*/_jsxs("div",{className:"np-summary__icon",children:[r,u&&(p?/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(StatusIcon,{size:Size.SMALL,sentiment:statusMapping[m]})}):/*#__PURE__*/_jsx(u,{size:16,className:"np-summary-icon__".concat(m)}))]}),/*#__PURE__*/_jsxs("div",{className:"np-summary__body m-l-2",children:[/*#__PURE__*/_jsxs("div",{className:"np-summary__title d-flex",children:[/*#__PURE__*/_jsx(Body,{as:"span",type:Typography.BODY_LARGE_BOLD,className:"text-primary m-b-1",children:n}),l&&/*#__PURE__*/_jsx(Info,{"aria-label":l["aria-label"],className:"m-l-1 hidden-xs",content:l.content,presentation:l.presentation,size:p?Size.LARGE:Size.SMALL,title:l.title,onClick:l.onClick})]}),g&&/*#__PURE__*/_jsx(Body,{as:"span",type:Typography.BODY_DEFAULT,className:"d-block np-summary__description",children:g}),b&&/*#__PURE__*/_jsx(Link,{href:b.href,target:b.target,className:"np-summary__action","aria-label":b["aria-label"],onClick:b.onClick,children:b.text})]}),l&&/*#__PURE__*/_jsx(Info,{"aria-label":l["aria-label"],className:"m-l-2 hidden-sm hidden-md hidden-lg hidden-xl",content:l.content,presentation:l.presentation,size:p?Size.LARGE:Size.SMALL,title:l.title,onClick:l.onClick})]})};Summary.propTypes={/** Action displayed at the bottom of the Summary */action:PropTypes.shape({text:PropTypes.node.isRequired,href:PropTypes.string.isRequired,"aria-label":PropTypes.string,target:PropTypes.string,onClick:PropTypes.func}),/** Decides which html element should wrap the Summary */as:PropTypes.string,/** Extra classes applied to Summary */className:PropTypes.string,/** @deprecated please use description instead */content:deprecated(PropTypes.node,{component:"Summary",newProp:"description",expiryDate:expiryDate}),/** Summary description */description:PropTypes.node,/** @deprecated please use info instead */help:deprecated(PropTypes.shape({content:PropTypes.node.isRequired,title:PropTypes.node}),{component:"Summary",newProp:"info",expiryDate:expiryDate}),/** Infos displayed on help Icon click inside Popover or Modal */info:PropTypes.shape({"aria-label":PropTypes.string.isRequired,content:PropTypes.node.isRequired,onClick:PropTypes.func,presentation:PropTypes.oneOf(["POPOVER","MODAL"]),title:PropTypes.node}),/** @deprecated please use icon instead */illustration:deprecated(PropTypes.node,{component:"Summary",newProp:"icon",expiryDate:expiryDate}),/** Main Summary Icon */icon:requiredIf(PropTypes.node,function(a){var b=a.illustration;return!b}),/** Decides the badge applied to Icon */status:PropTypes.oneOf(["notDone","done","pending"]),/** Summary title */title:PropTypes.node.isRequired},Summary.defaultProps={action:null,as:"div",className:null,content:null,help:null,illustration:null,status:null};export default Summary;
@@ -1 +1 @@
1
- import{CheckCircleFill,CrossCircleFill}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classnames from"classnames";import KeyCodes from"../common/keyCodes";import{logActionRequiredIf}from"../utilities";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const Switch=a=>{const{isModern:b}=useTheme(),{checked:c,className:d,id:e,onClick:f,disabled:g}=a,h=a["aria-label"],i=h?void 0:a["aria-labelledby"];return logActionRequiredIf("Switch now expects either `aria-label` or `aria-labelledby`, and will soon make these props required. Please update your usage to provide one or the other.",!h&&!i),/*#__PURE__*/_jsxs("span",{className:classnames("np-switch",{"np-switch--unchecked":!c,"np-switch--checked":c,disabled:g},d),tabIndex:0,role:"switch","aria-checked":c,"aria-label":h,"aria-labelledby":i,id:e,"aria-disabled":g,onClick:g?void 0:f,onKeyDown:g?void 0:a=>{("32"===a.code||a.keyCode===KeyCodes.SPACE)&&(a.preventDefault(),f())},children:[(()=>b?/*#__PURE__*/_jsx("span",{className:"np-switch--thumb"}):c?/*#__PURE__*/_jsx("span",{className:"np-switch--thumb",children:/*#__PURE__*/_jsx(CheckCircleFill,{size:24})}):/*#__PURE__*/_jsx("span",{className:"np-switch--thumb",children:/*#__PURE__*/_jsx(CrossCircleFill,{size:24})}))(),/*#__PURE__*/_jsx("input",{type:"checkbox",checked:c,readOnly:!0})]})};export default Switch;
1
+ import{CheckCircleFill,CrossCircleFill}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classnames from"classnames";import KeyCodes from"../common/keyCodes";import{logActionRequiredIf}from"../utilities";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Switch=function(a){var b=useTheme(),c=b.isModern,d=a.checked,e=a.className,f=a.id,g=a.onClick,h=a.disabled,i=a["aria-label"],j=i?void 0:a["aria-labelledby"];return logActionRequiredIf("Switch now expects either `aria-label` or `aria-labelledby`, and will soon make these props required. Please update your usage to provide one or the other.",!i&&!j),/*#__PURE__*/_jsxs("span",{className:classnames("np-switch",{"np-switch--unchecked":!d,"np-switch--checked":d,disabled:h},e),tabIndex:0,role:"switch","aria-checked":d,"aria-label":i,"aria-labelledby":j,id:f,"aria-disabled":h,onClick:h?void 0:g,onKeyDown:h?void 0:function handleKeyDown(a){("32"===a.code||a.keyCode===KeyCodes.SPACE)&&(a.preventDefault(),g())},children:[function returnIcon(){return c?/*#__PURE__*/_jsx("span",{className:"np-switch--thumb"}):d?/*#__PURE__*/_jsx("span",{className:"np-switch--thumb",children:/*#__PURE__*/_jsx(CheckCircleFill,{size:24})}):/*#__PURE__*/_jsx("span",{className:"np-switch--thumb",children:/*#__PURE__*/_jsx(CrossCircleFill,{size:24})})}(),/*#__PURE__*/_jsx("input",{type:"checkbox",checked:d,readOnly:!0})]})};export default Switch;
@@ -1 +1 @@
1
- import{useState}from"react";import Switch from"./Switch";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:Switch,title:"Actions/Switch"};export const Basic=()=>{const[a,b]=useState(!1),[c,d]=useState(!1);return/*#__PURE__*/_jsxs("div",{className:"d-flex flex-column",children:[/*#__PURE__*/_jsx("label",{id:"labelID",htmlFor:"switchId",children:"A switch with a label"}),/*#__PURE__*/_jsx(Switch,{checked:a,className:"a-class-name","aria-labelledby":"labelID",id:"switchId",onClick:()=>b(!a)}),/*#__PURE__*/_jsx(Switch,{checked:c,className:"a-class-name m-t-4","aria-label":"I'm a switch without label",onClick:()=>d(!c)})]})};export const Disabled=()=>{const[a,b]=useState(!1);return/*#__PURE__*/_jsxs("div",{className:"d-flex flex-column",children:[/*#__PURE__*/_jsx(Switch,{checked:a,disabled:!0,className:"a-class-name","aria-labelledby":"labelID",id:"switchId",onClick:()=>b(!a)}),/*#__PURE__*/_jsx(Switch,{checked:!a,disabled:!0,className:"a-class-name","aria-labelledby":"labelID",id:"switchId",onClick:()=>b(!a)})]})};
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import{useState}from"react";import Switch from"./Switch";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:Switch,title:"Actions/Switch"};export var Basic=function(){var a=useState(!1),b=_slicedToArray(a,2),c=b[0],d=b[1],e=useState(!1),f=_slicedToArray(e,2),g=f[0],h=f[1];return/*#__PURE__*/_jsxs("div",{className:"d-flex flex-column",children:[/*#__PURE__*/_jsx("label",{id:"labelID",htmlFor:"switchId",children:"A switch with a label"}),/*#__PURE__*/_jsx(Switch,{checked:c,className:"a-class-name","aria-labelledby":"labelID",id:"switchId",onClick:function onClick(){return d(!c)}}),/*#__PURE__*/_jsx(Switch,{checked:g,className:"a-class-name m-t-4","aria-label":"I'm a switch without label",onClick:function onClick(){return h(!g)}})]})};export var Disabled=function(){var a=useState(!1),b=_slicedToArray(a,2),c=b[0],d=b[1];return/*#__PURE__*/_jsxs("div",{className:"d-flex flex-column",children:[/*#__PURE__*/_jsx(Switch,{checked:c,disabled:!0,className:"a-class-name","aria-labelledby":"labelID",id:"switchId",onClick:function onClick(){return d(!c)}}),/*#__PURE__*/_jsx(Switch,{checked:!c,disabled:!0,className:"a-class-name","aria-labelledby":"labelID",id:"switchId",onClick:function onClick(){return d(!c)}})]})};
@@ -1 +1 @@
1
- import Option from"../common/Option";import Switch from"../switch";import{jsx as _jsx}from"react/jsx-runtime";const stopPropagation=a=>{a&&(a.stopPropagation(),a.preventDefault(),a.nativeEvent&&a.nativeEvent.stopImmediatePropagation&&a.nativeEvent.stopImmediatePropagation())},SwitchOption=a=>{let{checked:b,complex:c,content:d,disabled:e,id:f,media:g,onChange:h,title:i,showMediaCircle:j,showMediaAtAllSizes:k,isContainerAligned:l,"aria-label":m}=a;const n=a=>{stopPropagation(a);e||h(!b)};return/*#__PURE__*/_jsx(Option,{...{media:g,title:i,content:d,complex:c,disabled:e,showMediaCircle:j,showMediaAtAllSizes:k,isContainerAligned:l},button:/*#__PURE__*/_jsx(Switch,{id:f,checked:b,disabled:e,"aria-label":m,onClick:n}),onClick:n})};export default SwitchOption;
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 Option from"../common/Option";import Switch from"../switch";import{jsx as _jsx}from"react/jsx-runtime";var stopPropagation=function(a){a&&(a.stopPropagation(),a.preventDefault(),a.nativeEvent&&a.nativeEvent.stopImmediatePropagation&&a.nativeEvent.stopImmediatePropagation())},SwitchOption=function(a){var b=a.checked,c=a.complex,d=a.content,e=a.disabled,f=a.id,g=a.media,h=a.onChange,i=a.title,j=a.showMediaCircle,k=a.showMediaAtAllSizes,l=a.isContainerAligned,m=a["aria-label"],n=function(a){stopPropagation(a);e||h(!b)};return/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},{media:g,title:i,content:d,complex:c,disabled:e,showMediaCircle:j,showMediaAtAllSizes:k,isContainerAligned:l}),{},{button:/*#__PURE__*/_jsx(Switch,{id:f,checked:b,disabled:e,"aria-label":m,onClick:n}),onClick:n}))};export default SwitchOption;
@@ -1 +1 @@
1
- import{action}from"@storybook/addon-actions";import{text,boolean}from"@storybook/addon-knobs";import{FastFlag as FastFlagIcon}from"@transferwise/icons";import{useState}from"react";import{Nudge}from"..";import SwitchOption from"./SwitchOption";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 default{component:SwitchOption,title:"Option/SwitchOption"};const Template=()=>{const[a,b]=useState(!1),c=text("title","Switch option"),d=text("content","Normally, the button and icon are vertically centered."),e=boolean("disabled",!1),f=boolean("showMediaAtAllSizes",!1),g=boolean("isContainerAligned",!1);return/*#__PURE__*/_jsx(SwitchOption,{media:/*#__PURE__*/_jsx(FastFlagIcon,{}),title:c,content:d,id:"id",checked:a,complex:!1,disabled:e,showMediaAtAllSizes:f,isContainerAligned:g,"aria-label":c,onChange:b})};export const Basic=()=>/*#__PURE__*/_jsx(Template,{});export const Multiple=()=>/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx(Template,{})]});export const WithContainerContent=()=>/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("h2",{className:"m-b-2",children:"Choose how to pay"}),/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(Nudge,{className:"m-t-2",mediaName:"globe",title:"Text that is no longer than two lines.",link:"Link",href:"#",onClick:action("action clicked"),onDismiss:action("dismissed")})})]});
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import{action}from"@storybook/addon-actions";import{text,boolean}from"@storybook/addon-knobs";import{FastFlag as FastFlagIcon}from"@transferwise/icons";import{useState}from"react";import{Nudge}from"..";import SwitchOption from"./SwitchOption";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 default{component:SwitchOption,title:"Option/SwitchOption"};var Template=function(){var a=useState(!1),b=_slicedToArray(a,2),c=b[0],d=b[1],e=text("title","Switch option"),f=text("content","Normally, the button and icon are vertically centered."),g=boolean("disabled",!1),h=boolean("showMediaAtAllSizes",!1),i=boolean("isContainerAligned",!1);return/*#__PURE__*/_jsx(SwitchOption,{media:/*#__PURE__*/_jsx(FastFlagIcon,{}),title:e,content:f,id:"id",checked:c,complex:!1,disabled:g,showMediaAtAllSizes:h,isContainerAligned:i,"aria-label":e,onChange:d})};export var Basic=function(){return/*#__PURE__*/_jsx(Template,{})};export var Multiple=function(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx(Template,{})]})};export var WithContainerContent=function(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("h2",{className:"m-b-2",children:"Choose how to pay"}),/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(Nudge,{className:"m-t-2",mediaName:"globe",title:"Text that is no longer than two lines.",link:"Link",href:"#",onClick:action("action clicked"),onDismiss:action("dismissed")})})]})};
@@ -1 +1 @@
1
- import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef,useEffect,useRef}from"react";import{jsx as _jsx}from"react/jsx-runtime";const Tab=/*#__PURE__*/forwardRef((a,b)=>{let{children:c,id:d,disabled:e,panelId:f,selected:g,onKeyDown:h,onClick:i,style:j,focusTab:k}=a;const l=useRef(!0),m=()=>l.current?void(l.current=!1):void(g&&k&&k());return useEffect(()=>{m()},[g]),/*#__PURE__*/_jsx("li",{ref:b,className:classNames("tabs__tab",g?"np-text-body-large-bold":"np-text-body-large",{"tabs__tab--selected":g,clickable:!e,disabled:e}),role:"tab",id:d,"aria-selected":g?"true":"false","aria-disabled":e?"true":"false","aria-controls":e?null:f,tabIndex:"0",style:j,onKeyDown:e?null:h,onClick:i,children:/*#__PURE__*/_jsx("span",{className:"tabs__tab__content",children:c})})});Tab.defaultProps={disabled:!1,selected:!1,onClick:null,style:null,focusTab:null},Tab.propTypes={children:PropTypes.node.isRequired,disabled:PropTypes.bool,selected:PropTypes.bool,id:PropTypes.string.isRequired,panelId:PropTypes.string.isRequired,onKeyDown:PropTypes.func.isRequired,onClick:PropTypes.func,style:PropTypes.shape({width:PropTypes.string}),focusTab:PropTypes.func};export default Tab;
1
+ import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef,useEffect,useRef}from"react";import{jsx as _jsx}from"react/jsx-runtime";var Tab=/*#__PURE__*/forwardRef(function(a,b){var c=a.children,d=a.id,e=a.disabled,f=a.panelId,g=a.selected,h=a.onKeyDown,i=a.onClick,j=a.style,k=a.focusTab,l=useRef(!0),m=function(){return l.current?void(l.current=!1):void(g&&k&&k())};return useEffect(function(){m()},[g]),/*#__PURE__*/_jsx("li",{ref:b,className:classNames("tabs__tab",g?"np-text-body-large-bold":"np-text-body-large",{"tabs__tab--selected":g,clickable:!e,disabled:e}),role:"tab",id:d,"aria-selected":g?"true":"false","aria-disabled":e?"true":"false","aria-controls":e?null:f,tabIndex:"0",style:j,onKeyDown:e?null:h,onClick:i,children:/*#__PURE__*/_jsx("span",{className:"tabs__tab__content",children:c})})});Tab.defaultProps={disabled:!1,selected:!1,onClick:null,style:null,focusTab:null},Tab.propTypes={children:PropTypes.node.isRequired,disabled:PropTypes.bool,selected:PropTypes.bool,id:PropTypes.string.isRequired,panelId:PropTypes.string.isRequired,onKeyDown:PropTypes.func.isRequired,onClick:PropTypes.func,style:PropTypes.shape({width:PropTypes.string}),focusTab:PropTypes.func};export default Tab;
@@ -1 +1 @@
1
- import PropTypes from"prop-types";import{jsx as _jsx}from"react/jsx-runtime";const TabList=a=>{let{children:b}=a;return/*#__PURE__*/_jsx("ul",{className:"tabs__tab-list",role:"tablist",children:b})};TabList.propTypes={children:PropTypes.oneOfType([PropTypes.object,PropTypes.array]).isRequired};export default TabList;
1
+ import PropTypes from"prop-types";import{jsx as _jsx}from"react/jsx-runtime";var TabList=function(a){var b=a.children;return/*#__PURE__*/_jsx("ul",{className:"tabs__tab-list",role:"tablist",children:b})};TabList.propTypes={children:PropTypes.oneOfType([PropTypes.object,PropTypes.array]).isRequired};export default TabList;
@@ -1 +1 @@
1
- import PropTypes from"prop-types";import{jsx as _jsx}from"react/jsx-runtime";const TabPanel=a=>{let{children:b,id:c,tabId:d,style:e}=a;return/*#__PURE__*/_jsx("div",{className:"tabs__panel",role:"tabpanel",id:c,"aria-labelledby":d,style:e,children:b})};TabPanel.propTypes={children:PropTypes.node.isRequired,id:PropTypes.string.isRequired,tabId:PropTypes.string.isRequired,style:PropTypes.shape({width:PropTypes.string.isRequired}).isRequired};export default TabPanel;
1
+ import PropTypes from"prop-types";import{jsx as _jsx}from"react/jsx-runtime";var TabPanel=function(a){var b=a.children,c=a.id,d=a.tabId,e=a.style;return/*#__PURE__*/_jsx("div",{className:"tabs__panel",role:"tabpanel",id:c,"aria-labelledby":d,style:e,children:b})};TabPanel.propTypes={children:PropTypes.node.isRequired,id:PropTypes.string.isRequired,tabId:PropTypes.string.isRequired,style:PropTypes.shape({width:PropTypes.string.isRequired}).isRequired};export default TabPanel;