@transferwise/components 37.0.0 → 37.0.1-beta.23

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 (371) hide show
  1. package/CHANGELOG.md +264 -0
  2. package/build/es/no-polyfill/accordion/Accordion.js +1 -1
  3. package/build/es/no-polyfill/accordion/AccordionItem/AccordionItem.js +1 -1
  4. package/build/es/no-polyfill/actionOption/ActionOption.js +1 -1
  5. package/build/es/no-polyfill/actionOption/ActionOption.story.js +1 -1
  6. package/build/es/no-polyfill/alert/Alert.js +1 -1
  7. package/build/es/no-polyfill/alert/inlineMarkdown/InlineMarkdown.js +1 -1
  8. package/build/es/no-polyfill/alert/withArrow/withArrow.js +1 -1
  9. package/build/es/no-polyfill/avatar/Avatar.js +1 -1
  10. package/build/es/no-polyfill/avatarWrapper/AvatarWrapper.js +1 -1
  11. package/build/es/no-polyfill/badge/Badge.js +1 -1
  12. package/build/es/no-polyfill/button/Button.js +1 -2
  13. package/build/es/no-polyfill/card/Card.js +2 -5
  14. package/build/es/no-polyfill/checkbox/Checkbox.js +1 -1
  15. package/build/es/no-polyfill/checkboxButton/CheckboxButton.js +1 -1
  16. package/build/es/no-polyfill/checkboxOption/CheckboxOption.js +1 -1
  17. package/build/es/no-polyfill/chevron/Chevron.js +1 -1
  18. package/build/es/no-polyfill/chip/Chip.js +8 -2
  19. package/build/es/no-polyfill/circularButton/CircularButton.js +1 -1
  20. package/build/es/no-polyfill/common/Option/Option.js +1 -1
  21. package/build/es/no-polyfill/common/Option/OptionDocumentation.js +1 -0
  22. package/build/es/no-polyfill/common/RadioButton/RadioButton.js +1 -1
  23. package/build/es/no-polyfill/common/bottomSheet/BottomSheet.js +4 -6
  24. package/build/es/no-polyfill/common/closeButton/CloseButton.js +1 -1
  25. package/build/es/no-polyfill/common/focusBoundary/FocusBoundary.js +1 -1
  26. package/build/es/no-polyfill/common/focusBoundary/utils/getFocusableElements.js +2 -2
  27. package/build/es/no-polyfill/common/focusBoundary/utils/resetFocus.js +2 -2
  28. package/build/es/no-polyfill/common/historyNavigator/historyNavigator.js +1 -1
  29. package/build/es/no-polyfill/common/hooks/useClientWidth/useClientWidth.js +2 -1
  30. package/build/es/no-polyfill/common/hooks/useConditionalListener/useConditionalListener.js +3 -5
  31. package/build/es/no-polyfill/common/hooks/useHasIntersected/useHasIntersected.js +3 -2
  32. package/build/es/no-polyfill/common/keyCodes.js +1 -0
  33. package/build/es/no-polyfill/common/panel/Panel.js +2 -3
  34. package/build/es/no-polyfill/common/requirements.js +2 -2
  35. package/build/es/no-polyfill/common/responsivePanel/ResponsivePanel.js +1 -1
  36. package/build/es/no-polyfill/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js +1 -1
  37. package/build/es/no-polyfill/common/textFormat/unformatWithPattern/unformatWithPattern.js +1 -1
  38. package/build/es/no-polyfill/dateInput/DateInput.js +3 -4
  39. package/build/es/no-polyfill/dateInput/DateInput.messages.js +1 -0
  40. package/build/es/no-polyfill/dateLookup/DateLookup.js +1 -1
  41. package/build/es/no-polyfill/dateLookup/dateTrigger/DateTrigger.js +1 -1
  42. package/build/es/no-polyfill/dateLookup/dayCalendar/DayCalendar.js +1 -1
  43. package/build/es/no-polyfill/dateLookup/dayCalendar/table/DayCalendarTable.js +3 -3
  44. package/build/es/no-polyfill/dateLookup/header/Header.js +1 -1
  45. package/build/es/no-polyfill/dateLookup/monthCalendar/MonthCalendar.js +1 -1
  46. package/build/es/no-polyfill/dateLookup/monthCalendar/table/MonthCalendarTable.js +1 -1
  47. package/build/es/no-polyfill/dateLookup/tableLink/TableLink.js +1 -1
  48. package/build/es/no-polyfill/dateLookup/yearCalendar/YearCalendar.js +1 -1
  49. package/build/es/no-polyfill/dateLookup/yearCalendar/table/YearCalendarTable.js +1 -1
  50. package/build/es/no-polyfill/decision/Decision.js +5 -5
  51. package/build/es/no-polyfill/definitionList/DefinitionList.js +1 -1
  52. package/build/es/no-polyfill/dimmer/Dimmer.js +3 -3
  53. package/build/es/no-polyfill/drawer/Drawer.js +1 -1
  54. package/build/es/no-polyfill/dynamicFieldDefinitionList/DynamicFieldDefinitionList.js +1 -1
  55. package/build/es/no-polyfill/dynamicFieldDefinitionList/FormattedValue/FormattedValue.js +2 -4
  56. package/build/es/no-polyfill/dynamicFieldDefinitionList/utils/text-format.js +1 -1
  57. package/build/es/no-polyfill/emphasis/Emphasis.js +1 -1
  58. package/build/es/no-polyfill/flowNavigation/FlowNavigation.js +1 -1
  59. package/build/es/no-polyfill/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
  60. package/build/es/no-polyfill/flowNavigation/backButton/BackButton.js +1 -1
  61. package/build/es/no-polyfill/header/Header.js +1 -1
  62. package/build/es/no-polyfill/i18n/en.json +3 -2
  63. package/build/es/no-polyfill/i18n/index.js +1 -1
  64. package/build/es/no-polyfill/image/Image.js +4 -5
  65. package/build/es/no-polyfill/info/Info.js +1 -1
  66. package/build/es/no-polyfill/inlineAlert/InlineAlert.js +1 -1
  67. package/build/es/no-polyfill/instructionsList/InstructionsList.js +1 -1
  68. package/build/es/no-polyfill/lab/mobileNav/MobileNav.js +2 -2
  69. package/build/es/no-polyfill/lab/pagination/Pagination.js +1 -1
  70. package/build/es/no-polyfill/lab/pagination/paginationLink/PaginationLink.js +1 -1
  71. package/build/es/no-polyfill/link/Link.js +4 -3
  72. package/build/es/no-polyfill/link/Link.spec.js +1 -0
  73. package/build/es/no-polyfill/link/Link.story.js +1 -0
  74. package/build/es/no-polyfill/loader/Loader.js +7 -3
  75. package/build/es/no-polyfill/logo/Logo.js +1 -1
  76. package/build/es/no-polyfill/markdown/Markdown.js +1 -1
  77. package/build/es/no-polyfill/modal/Modal.js +1 -1
  78. package/build/es/no-polyfill/money/Money.js +1 -1
  79. package/build/es/no-polyfill/moneyInput/MoneyInput.js +1 -2
  80. package/build/es/no-polyfill/navigationOption/NavigationOption.js +1 -1
  81. package/build/es/no-polyfill/navigationOptionsList/NavigationOptionsList.js +1 -1
  82. package/build/es/no-polyfill/nudge/Nudge.js +1 -1
  83. package/build/es/no-polyfill/overlayHeader/OverlayHeader.js +1 -1
  84. package/build/es/no-polyfill/phoneNumberInput/PhoneNumberInput.js +1 -1
  85. package/build/es/no-polyfill/phoneNumberInput/utils/explodeNumberModel/index.js +2 -1
  86. package/build/es/no-polyfill/phoneNumberInput/utils/filterOptionsForQuery/index.js +1 -0
  87. package/build/es/no-polyfill/phoneNumberInput/utils/findCountryByCode/index.js +1 -1
  88. package/build/es/no-polyfill/phoneNumberInput/utils/findCountryByPrefix/index.js +1 -1
  89. package/build/es/no-polyfill/phoneNumberInput/utils/isOptionAndFitsQuery/isOptionAndFitsQuery.js +1 -0
  90. package/build/es/no-polyfill/phoneNumberInput/utils/setDefaultPrefix/index.js +2 -0
  91. package/build/es/no-polyfill/popover/Popover.js +1 -1
  92. package/build/es/no-polyfill/processIndicator/ProcessIndicator.js +4 -1
  93. package/build/es/no-polyfill/provider/Provider.js +1 -1
  94. package/build/es/no-polyfill/provider/direction/DirectionProvider.js +1 -1
  95. package/build/es/no-polyfill/radio/Radio.js +1 -1
  96. package/build/es/no-polyfill/radioGroup/RadioGroup.js +2 -2
  97. package/build/es/no-polyfill/radioOption/RadioOption.js +1 -1
  98. package/build/es/no-polyfill/select/Select.js +3 -5
  99. package/build/es/no-polyfill/select/option/Option.js +1 -1
  100. package/build/es/no-polyfill/select/searchBox/SearchBox.js +1 -1
  101. package/build/es/no-polyfill/sizeSwapper/SizeSwapper.js +4 -2
  102. package/build/es/no-polyfill/slidingPanel/SlidingPanel.js +2 -2
  103. package/build/es/no-polyfill/snackbar/Snackbar.js +1 -1
  104. package/build/es/no-polyfill/snackbar/SnackbarProvider.js +1 -1
  105. package/build/es/no-polyfill/stepper/Stepper.js +1 -1
  106. package/build/es/no-polyfill/stepper/deviceDetection.js +2 -1
  107. package/build/es/no-polyfill/summary/Summary.js +1 -4
  108. package/build/es/no-polyfill/switch/Switch.js +1 -1
  109. package/build/es/no-polyfill/switch/Switch.story.js +1 -1
  110. package/build/es/no-polyfill/switchOption/SwitchOption.js +1 -1
  111. package/build/es/no-polyfill/switchOption/SwitchOption.story.js +1 -1
  112. package/build/es/no-polyfill/tabs/Tab.js +1 -1
  113. package/build/es/no-polyfill/tabs/Tabs.js +1 -1
  114. package/build/es/no-polyfill/tile/Tile.js +1 -1
  115. package/build/es/no-polyfill/tooltip/Tooltip.js +1 -1
  116. package/build/es/no-polyfill/typeahead/Typeahead.js +1 -2
  117. package/build/es/no-polyfill/typeahead/typeaheadInput/TypeaheadInput.js +1 -1
  118. package/build/es/no-polyfill/typeahead/typeaheadOption/TypeaheadOption.js +1 -1
  119. package/build/es/no-polyfill/typeahead/util/highlight.js +1 -1
  120. package/build/es/no-polyfill/upload/Upload.js +3 -5
  121. package/build/es/no-polyfill/upload/steps/completeStep/completeStep.js +1 -1
  122. package/build/es/no-polyfill/upload/steps/mediaUploadStep/mediaUploadStep.js +1 -1
  123. package/build/es/no-polyfill/upload/steps/processingStep/processingStep.js +1 -1
  124. package/build/es/no-polyfill/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
  125. package/build/es/no-polyfill/upload/utils/asyncFileRead/asyncFileRead.js +1 -1
  126. package/build/es/no-polyfill/upload/utils/getSupportedSpotMimeTypes/getSupportedSpotMimeTypes.js +1 -1
  127. package/build/es/no-polyfill/upload/utils/index.js +1 -1
  128. package/build/es/no-polyfill/uploadInput/UploadInput.js +4 -6
  129. package/build/es/no-polyfill/uploadInput/UploadInput.spec.js +1 -1
  130. package/build/es/no-polyfill/uploadInput/UploadInput.story.js +1 -1
  131. package/build/es/no-polyfill/uploadInput/types.js +1 -0
  132. package/build/es/no-polyfill/uploadInput/uploadButton/UploadButton.js +1 -1
  133. package/build/es/no-polyfill/uploadInput/uploadButton/UploadButton.spec.js +3 -1
  134. package/build/es/no-polyfill/uploadInput/uploadButton/getAllowedFileTypes.spec.js +1 -1
  135. package/build/es/no-polyfill/uploadInput/uploadItem/UploadItem.js +2 -2
  136. package/build/es/no-polyfill/uploadInput/uploadItem/UploadItem.spec.js +1 -1
  137. package/build/es/no-polyfill/uploadInput/uploadItem/UploadItemBody.js +1 -1
  138. package/build/es/no-polyfill/utilities/{deprecatedProp/deprecatedProp.js → deprecatedProperty/deprecatedProperty.js} +0 -0
  139. package/build/es/no-polyfill/utilities/deprecatedProperty/index.js +1 -0
  140. package/build/es/no-polyfill/utilities/index.js +1 -1
  141. package/build/es/no-polyfill/utilities/logActionRequired.js +1 -1
  142. package/build/es/no-polyfill/withDisplayFormat/WithDisplayFormat.js +2 -2
  143. package/build/es/no-polyfill/withNextPortal/withNextPortal.js +1 -1
  144. package/build/es/no-polyfill/withNormaliser/WithNormalizer.js +3 -0
  145. package/build/es/polyfill/accordion/Accordion.js +1 -1
  146. package/build/es/polyfill/accordion/AccordionItem/AccordionItem.js +1 -1
  147. package/build/es/polyfill/actionOption/ActionOption.js +1 -1
  148. package/build/es/polyfill/actionOption/ActionOption.story.js +1 -1
  149. package/build/es/polyfill/alert/Alert.js +1 -1
  150. package/build/es/polyfill/alert/inlineMarkdown/InlineMarkdown.js +1 -1
  151. package/build/es/polyfill/alert/withArrow/withArrow.js +1 -1
  152. package/build/es/polyfill/avatar/Avatar.js +1 -1
  153. package/build/es/polyfill/avatarWrapper/AvatarWrapper.js +1 -1
  154. package/build/es/polyfill/badge/Badge.js +1 -1
  155. package/build/es/polyfill/button/Button.js +1 -2
  156. package/build/es/polyfill/card/Card.js +2 -5
  157. package/build/es/polyfill/checkbox/Checkbox.js +1 -1
  158. package/build/es/polyfill/checkboxButton/CheckboxButton.js +1 -1
  159. package/build/es/polyfill/checkboxOption/CheckboxOption.js +1 -1
  160. package/build/es/polyfill/chevron/Chevron.js +1 -1
  161. package/build/es/polyfill/chip/Chip.js +8 -2
  162. package/build/es/polyfill/circularButton/CircularButton.js +1 -1
  163. package/build/es/polyfill/common/Option/Option.js +1 -1
  164. package/build/es/polyfill/common/Option/OptionDocumentation.js +1 -0
  165. package/build/es/polyfill/common/RadioButton/RadioButton.js +1 -1
  166. package/build/es/polyfill/common/bottomSheet/BottomSheet.js +4 -6
  167. package/build/es/polyfill/common/closeButton/CloseButton.js +1 -1
  168. package/build/es/polyfill/common/focusBoundary/FocusBoundary.js +1 -1
  169. package/build/es/polyfill/common/focusBoundary/utils/getFocusableElements.js +2 -2
  170. package/build/es/polyfill/common/focusBoundary/utils/resetFocus.js +2 -2
  171. package/build/es/polyfill/common/historyNavigator/historyNavigator.js +1 -1
  172. package/build/es/polyfill/common/hooks/useClientWidth/useClientWidth.js +2 -1
  173. package/build/es/polyfill/common/hooks/useConditionalListener/useConditionalListener.js +3 -5
  174. package/build/es/polyfill/common/hooks/useHasIntersected/useHasIntersected.js +3 -2
  175. package/build/es/polyfill/common/keyCodes.js +1 -0
  176. package/build/es/polyfill/common/panel/Panel.js +2 -3
  177. package/build/es/polyfill/common/requirements.js +2 -2
  178. package/build/es/polyfill/common/responsivePanel/ResponsivePanel.js +1 -1
  179. package/build/es/polyfill/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js +1 -1
  180. package/build/es/polyfill/common/textFormat/unformatWithPattern/unformatWithPattern.js +1 -1
  181. package/build/es/polyfill/dateInput/DateInput.js +3 -4
  182. package/build/es/polyfill/dateInput/DateInput.messages.js +1 -0
  183. package/build/es/polyfill/dateLookup/DateLookup.js +1 -1
  184. package/build/es/polyfill/dateLookup/dateTrigger/DateTrigger.js +1 -1
  185. package/build/es/polyfill/dateLookup/dayCalendar/DayCalendar.js +1 -1
  186. package/build/es/polyfill/dateLookup/dayCalendar/table/DayCalendarTable.js +3 -3
  187. package/build/es/polyfill/dateLookup/header/Header.js +1 -1
  188. package/build/es/polyfill/dateLookup/monthCalendar/MonthCalendar.js +1 -1
  189. package/build/es/polyfill/dateLookup/monthCalendar/table/MonthCalendarTable.js +1 -1
  190. package/build/es/polyfill/dateLookup/tableLink/TableLink.js +1 -1
  191. package/build/es/polyfill/dateLookup/yearCalendar/YearCalendar.js +1 -1
  192. package/build/es/polyfill/dateLookup/yearCalendar/table/YearCalendarTable.js +1 -1
  193. package/build/es/polyfill/decision/Decision.js +5 -5
  194. package/build/es/polyfill/definitionList/DefinitionList.js +1 -1
  195. package/build/es/polyfill/dimmer/Dimmer.js +3 -3
  196. package/build/es/polyfill/drawer/Drawer.js +1 -1
  197. package/build/es/polyfill/dynamicFieldDefinitionList/DynamicFieldDefinitionList.js +1 -1
  198. package/build/es/polyfill/dynamicFieldDefinitionList/FormattedValue/FormattedValue.js +2 -4
  199. package/build/es/polyfill/dynamicFieldDefinitionList/utils/text-format.js +1 -1
  200. package/build/es/polyfill/emphasis/Emphasis.js +1 -1
  201. package/build/es/polyfill/flowNavigation/FlowNavigation.js +1 -1
  202. package/build/es/polyfill/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
  203. package/build/es/polyfill/flowNavigation/backButton/BackButton.js +1 -1
  204. package/build/es/polyfill/header/Header.js +1 -1
  205. package/build/es/polyfill/i18n/en.json +3 -2
  206. package/build/es/polyfill/i18n/index.js +1 -1
  207. package/build/es/polyfill/image/Image.js +4 -5
  208. package/build/es/polyfill/info/Info.js +1 -1
  209. package/build/es/polyfill/inlineAlert/InlineAlert.js +1 -1
  210. package/build/es/polyfill/instructionsList/InstructionsList.js +1 -1
  211. package/build/es/polyfill/lab/mobileNav/MobileNav.js +2 -2
  212. package/build/es/polyfill/lab/pagination/Pagination.js +1 -1
  213. package/build/es/polyfill/lab/pagination/paginationLink/PaginationLink.js +1 -1
  214. package/build/es/polyfill/link/Link.js +4 -3
  215. package/build/es/polyfill/link/Link.spec.js +1 -0
  216. package/build/es/polyfill/link/Link.story.js +1 -0
  217. package/build/es/polyfill/loader/Loader.js +7 -3
  218. package/build/es/polyfill/logo/Logo.js +1 -1
  219. package/build/es/polyfill/markdown/Markdown.js +1 -1
  220. package/build/es/polyfill/modal/Modal.js +1 -1
  221. package/build/es/polyfill/money/Money.js +1 -1
  222. package/build/es/polyfill/moneyInput/MoneyInput.js +1 -2
  223. package/build/es/polyfill/navigationOption/NavigationOption.js +1 -1
  224. package/build/es/polyfill/navigationOptionsList/NavigationOptionsList.js +1 -1
  225. package/build/es/polyfill/nudge/Nudge.js +1 -1
  226. package/build/es/polyfill/overlayHeader/OverlayHeader.js +1 -1
  227. package/build/es/polyfill/phoneNumberInput/PhoneNumberInput.js +1 -1
  228. package/build/es/polyfill/phoneNumberInput/utils/explodeNumberModel/index.js +3 -2
  229. package/build/es/polyfill/phoneNumberInput/utils/filterOptionsForQuery/index.js +1 -0
  230. package/build/es/polyfill/phoneNumberInput/utils/findCountryByCode/index.js +1 -1
  231. package/build/es/polyfill/phoneNumberInput/utils/findCountryByPrefix/index.js +1 -1
  232. package/build/es/polyfill/phoneNumberInput/utils/isOptionAndFitsQuery/isOptionAndFitsQuery.js +1 -0
  233. package/build/es/polyfill/phoneNumberInput/utils/setDefaultPrefix/index.js +2 -0
  234. package/build/es/polyfill/popover/Popover.js +1 -1
  235. package/build/es/polyfill/processIndicator/ProcessIndicator.js +4 -1
  236. package/build/es/polyfill/provider/Provider.js +1 -1
  237. package/build/es/polyfill/provider/direction/DirectionProvider.js +1 -1
  238. package/build/es/polyfill/radio/Radio.js +1 -1
  239. package/build/es/polyfill/radioGroup/RadioGroup.js +2 -2
  240. package/build/es/polyfill/radioOption/RadioOption.js +1 -1
  241. package/build/es/polyfill/select/Select.js +3 -5
  242. package/build/es/polyfill/select/option/Option.js +1 -1
  243. package/build/es/polyfill/select/searchBox/SearchBox.js +1 -1
  244. package/build/es/polyfill/sizeSwapper/SizeSwapper.js +4 -2
  245. package/build/es/polyfill/slidingPanel/SlidingPanel.js +2 -2
  246. package/build/es/polyfill/snackbar/Snackbar.js +1 -1
  247. package/build/es/polyfill/snackbar/SnackbarProvider.js +1 -1
  248. package/build/es/polyfill/stepper/Stepper.js +1 -1
  249. package/build/es/polyfill/stepper/deviceDetection.js +2 -1
  250. package/build/es/polyfill/summary/Summary.js +1 -4
  251. package/build/es/polyfill/switch/Switch.js +1 -1
  252. package/build/es/polyfill/switch/Switch.story.js +1 -1
  253. package/build/es/polyfill/switchOption/SwitchOption.js +1 -1
  254. package/build/es/polyfill/switchOption/SwitchOption.story.js +1 -1
  255. package/build/es/polyfill/tabs/Tab.js +1 -1
  256. package/build/es/polyfill/tabs/Tabs.js +1 -1
  257. package/build/es/polyfill/tile/Tile.js +1 -1
  258. package/build/es/polyfill/tooltip/Tooltip.js +1 -1
  259. package/build/es/polyfill/typeahead/Typeahead.js +1 -2
  260. package/build/es/polyfill/typeahead/typeaheadInput/TypeaheadInput.js +1 -1
  261. package/build/es/polyfill/typeahead/typeaheadOption/TypeaheadOption.js +1 -1
  262. package/build/es/polyfill/typeahead/util/highlight.js +1 -1
  263. package/build/es/polyfill/upload/Upload.js +3 -5
  264. package/build/es/polyfill/upload/steps/completeStep/completeStep.js +1 -1
  265. package/build/es/polyfill/upload/steps/mediaUploadStep/mediaUploadStep.js +1 -1
  266. package/build/es/polyfill/upload/steps/processingStep/processingStep.js +1 -1
  267. package/build/es/polyfill/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
  268. package/build/es/polyfill/upload/utils/asyncFileRead/asyncFileRead.js +1 -1
  269. package/build/es/polyfill/upload/utils/getSupportedSpotMimeTypes/getSupportedSpotMimeTypes.js +2 -2
  270. package/build/es/polyfill/upload/utils/index.js +1 -1
  271. package/build/es/polyfill/uploadInput/UploadInput.js +4 -6
  272. package/build/es/polyfill/uploadInput/UploadInput.spec.js +1 -1
  273. package/build/es/polyfill/uploadInput/UploadInput.story.js +1 -1
  274. package/build/es/polyfill/uploadInput/types.js +1 -0
  275. package/build/es/polyfill/uploadInput/uploadButton/UploadButton.js +1 -1
  276. package/build/es/polyfill/uploadInput/uploadButton/UploadButton.spec.js +3 -1
  277. package/build/es/polyfill/uploadInput/uploadButton/getAllowedFileTypes.spec.js +1 -1
  278. package/build/es/polyfill/uploadInput/uploadItem/UploadItem.js +2 -2
  279. package/build/es/polyfill/uploadInput/uploadItem/UploadItem.spec.js +1 -1
  280. package/build/es/polyfill/uploadInput/uploadItem/UploadItemBody.js +1 -1
  281. package/build/es/polyfill/utilities/{deprecatedProp/deprecatedProp.js → deprecatedProperty/deprecatedProperty.js} +0 -0
  282. package/build/es/polyfill/utilities/deprecatedProperty/index.js +1 -0
  283. package/build/es/polyfill/utilities/index.js +1 -1
  284. package/build/es/polyfill/utilities/logActionRequired.js +1 -1
  285. package/build/es/polyfill/withDisplayFormat/WithDisplayFormat.js +2 -2
  286. package/build/es/polyfill/withNextPortal/withNextPortal.js +1 -1
  287. package/build/es/polyfill/withNormaliser/WithNormalizer.js +3 -0
  288. package/build/i18n/en.json +3 -2
  289. package/build/main.css +1 -1
  290. package/build/styles/accordion/Accordion.css +1 -1
  291. package/build/styles/avatar/Avatar.css +1 -1
  292. package/build/styles/card/Card.css +1 -1
  293. package/build/styles/chip/Chip.css +1 -1
  294. package/build/styles/circularButton/CircularButton.css +1 -1
  295. package/build/styles/common/RadioButton/RadioButton.css +1 -1
  296. package/build/styles/common/bottomSheet/BottomSheet.css +1 -1
  297. package/build/styles/common/closeButton/CloseButton.css +1 -1
  298. package/build/styles/dateLookup/DateLookup.css +1 -1
  299. package/build/styles/dateLookup/dateTrigger/DateTrigger.css +1 -1
  300. package/build/styles/drawer/Drawer.css +1 -1
  301. package/build/styles/emphasis/Emphasis.css +1 -1
  302. package/build/styles/flowNavigation/FlowNavigation.css +1 -1
  303. package/build/styles/flowNavigation/backButton/BackButton.css +1 -1
  304. package/build/styles/info/Info.css +1 -1
  305. package/build/styles/instructionsList/InstructionsList.css +1 -1
  306. package/build/styles/lab/mobileNav/MobileNav.css +1 -1
  307. package/build/styles/lab/pagination/Pagination.css +1 -1
  308. package/build/styles/loader/Loader.css +1 -1
  309. package/build/styles/main.css +1 -1
  310. package/build/styles/moneyInput/MoneyInput.css +1 -1
  311. package/build/styles/navigationOption/NavigationOption.css +1 -1
  312. package/build/styles/nudge/Nudge.css +1 -1
  313. package/build/styles/overlayHeader/OverlayHeader.css +1 -1
  314. package/build/styles/popover/Popover.css +1 -1
  315. package/build/styles/snackbar/Snackbar.css +1 -1
  316. package/build/styles/stepper/Stepper.css +1 -1
  317. package/build/styles/summary/Summary.css +1 -1
  318. package/build/styles/switch/Switch.css +1 -1
  319. package/build/styles/tabs/Tabs.css +1 -1
  320. package/build/styles/tile/Tile.css +1 -1
  321. package/build/styles/typeahead/typeaheadOption/TypeaheadOption.css +1 -1
  322. package/build/styles/uploadInput/UploadInput.css +1 -1
  323. package/build/styles/uploadInput/uploadButton/UploadButton.css +1 -1
  324. package/build/styles/uploadInput/uploadItem/UploadItem.css +1 -1
  325. package/build/types/actionOption/ActionOption.story.d.ts +1 -1
  326. package/build/types/alert/Alert.d.ts +1 -1
  327. package/build/types/badge/Badge.d.ts +1 -1
  328. package/build/types/chip/Chip.d.ts +8 -2
  329. package/build/types/common/bottomSheet/BottomSheet.d.ts +3 -1
  330. package/build/types/common/commonProps.d.ts +1 -1
  331. package/build/types/common/focusBoundary/utils/getFocusableElements.d.ts +1 -1
  332. package/build/types/common/focusBoundary/utils/resetFocus.d.ts +1 -1
  333. package/build/types/common/hooks/useHasIntersected/useHasIntersected.d.ts +4 -1
  334. package/build/types/{link/Link.messages.d.ts → dateInput/DateInput.messages.d.ts} +8 -5
  335. package/build/types/link/Link.d.ts +5 -4
  336. package/build/types/link/Link.spec.d.ts +1 -0
  337. package/build/types/link/Link.story.d.ts +9 -0
  338. package/build/types/loader/Loader.d.ts +6 -1
  339. package/build/types/modal/Modal.d.ts +0 -1
  340. package/build/types/nudge/Nudge.d.ts +1 -0
  341. package/build/types/switch/Switch.story.d.ts +2 -1
  342. package/build/types/switchOption/SwitchOption.story.d.ts +1 -1
  343. package/build/types/test-utils/index.d.ts +17 -5
  344. package/build/types/upload/Upload.d.ts +1 -1
  345. package/build/types/upload/utils/index.d.ts +0 -1
  346. package/build/types/uploadInput/UploadInput.d.ts +8 -4
  347. package/build/types/uploadInput/UploadInput.story.d.ts +11 -10
  348. package/build/types/uploadInput/uploadButton/UploadButton.d.ts +1 -0
  349. package/build/types/uploadInput/uploadItem/UploadItem.d.ts +8 -1
  350. package/build/types/uploadInput/uploadItem/UploadItemBody.d.ts +3 -2
  351. package/build/types/utilities/{deprecatedProp/deprecatedProp.d.ts → deprecatedProperty/deprecatedProperty.d.ts} +2 -2
  352. package/build/types/utilities/deprecatedProperty/index.d.ts +1 -0
  353. package/build/types/utilities/index.d.ts +1 -1
  354. package/build/types/withDisplayFormat/WithDisplayFormat.d.ts +1 -1
  355. package/build/types/withNextPortal/withNextPortal.d.ts +1 -2
  356. package/build/umd/no-polyfill/main.js +1 -1
  357. package/build/umd/polyfill/main.js +1 -1
  358. package/package.json +18 -18
  359. package/build/es/no-polyfill/common/Option/OptionDocs.js +0 -1
  360. package/build/es/no-polyfill/link/Link.messages.js +0 -1
  361. package/build/es/no-polyfill/upload/utils/generateErrorMessage/generateErrorMessage.js +0 -1
  362. package/build/es/no-polyfill/upload/utils/generateErrorMessage/index.js +0 -1
  363. package/build/es/no-polyfill/utilities/deprecatedProp/index.js +0 -1
  364. package/build/es/polyfill/common/Option/OptionDocs.js +0 -1
  365. package/build/es/polyfill/link/Link.messages.js +0 -1
  366. package/build/es/polyfill/upload/utils/generateErrorMessage/generateErrorMessage.js +0 -1
  367. package/build/es/polyfill/upload/utils/generateErrorMessage/index.js +0 -1
  368. package/build/es/polyfill/utilities/deprecatedProp/index.js +0 -1
  369. package/build/types/upload/utils/generateErrorMessage/generateErrorMessage.d.ts +0 -1
  370. package/build/types/upload/utils/generateErrorMessage/index.d.ts +0 -1
  371. package/build/types/utilities/deprecatedProp/index.d.ts +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,270 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [37.4.2](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.4.1...@transferwise/components@37.4.2) (2021-09-15)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * fix wrong peerdependency version, again ([#1144](https://github.com/transferwise/neptune-web/issues/1144)) ([77a11cc](https://github.com/transferwise/neptune-web/commit/77a11cce599f2a8ebb17995f35033f5a2ac40044))
12
+
13
+
14
+
15
+
16
+
17
+ ## [37.4.1](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.4.0...@transferwise/components@37.4.1) (2021-09-14)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * update peerdependencies to support latest neptune-css and components ([#1143](https://github.com/transferwise/neptune-web/issues/1143)) ([3b59c71](https://github.com/transferwise/neptune-web/commit/3b59c71c4da291acb1d95b8dc5e07d01b415b96b))
23
+
24
+
25
+
26
+
27
+
28
+ # [37.4.0](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.3.13...@transferwise/components@37.4.0) (2021-09-14)
29
+
30
+
31
+ ### Features
32
+
33
+ * [VUX-950] Update persist async to work with `blob` type ([6f958f6](https://github.com/transferwise/neptune-web/commit/6f958f69ea88bfcecf1cedf85600b2bd5eb71151))
34
+
35
+
36
+
37
+
38
+
39
+ ## [37.3.13](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.3.12...@transferwise/components@37.3.13) (2021-09-14)
40
+
41
+
42
+ ### Bug Fixes
43
+
44
+ * **Upload:** re-render translated messages on language change ([#1135](https://github.com/transferwise/neptune-web/issues/1135)) ([e375eaa](https://github.com/transferwise/neptune-web/commit/e375eaa3279dbb88cd8d8411c9477caa89aa45db))
45
+
46
+
47
+
48
+
49
+
50
+ ## [37.3.12](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.3.11...@transferwise/components@37.3.12) (2021-09-14)
51
+
52
+
53
+ ### Bug Fixes
54
+
55
+ * update drawer padding ([#1130](https://github.com/transferwise/neptune-web/issues/1130)) ([fc50a09](https://github.com/transferwise/neptune-web/commit/fc50a09a03c11258f3c73639230a325d3d165f01))
56
+
57
+
58
+
59
+
60
+
61
+ ## [37.3.11](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.3.10...@transferwise/components@37.3.11) (2021-09-13)
62
+
63
+
64
+ ### Bug Fixes
65
+
66
+ * adjusting padding for tabs with auto width ([#1139](https://github.com/transferwise/neptune-web/issues/1139)) ([168a9e0](https://github.com/transferwise/neptune-web/commit/168a9e0cd23687b5e1cd2a26d4c70bf795cb7189))
67
+
68
+
69
+
70
+
71
+
72
+ ## [37.3.10](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.3.9...@transferwise/components@37.3.10) (2021-09-13)
73
+
74
+ **Note:** Version bump only for package @transferwise/components
75
+
76
+
77
+
78
+
79
+
80
+ ## [37.3.9](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.3.8...@transferwise/components@37.3.9) (2021-09-09)
81
+
82
+
83
+ ### Bug Fixes
84
+
85
+ * dimmer color for Angular comp and fix .on-scroll on unmount and update BT ([#1140](https://github.com/transferwise/neptune-web/issues/1140)) ([b146e9d](https://github.com/transferwise/neptune-web/commit/b146e9d9169660666c3f4bd564834965069427ed))
86
+
87
+
88
+
89
+
90
+
91
+ ## [37.3.8](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.3.7...@transferwise/components@37.3.8) (2021-09-06)
92
+
93
+ **Note:** Version bump only for package @transferwise/components
94
+
95
+
96
+
97
+
98
+
99
+ ## [37.3.7](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.3.6...@transferwise/components@37.3.7) (2021-09-06)
100
+
101
+
102
+ ### Bug Fixes
103
+
104
+ * add background color to keyline ([#1133](https://github.com/transferwise/neptune-web/issues/1133)) ([f170263](https://github.com/transferwise/neptune-web/commit/f170263e6f62d715077787b694977c4b0ab63e36))
105
+
106
+
107
+
108
+
109
+
110
+ ## [37.3.6](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.3.5...@transferwise/components@37.3.6) (2021-09-03)
111
+
112
+
113
+ ### Bug Fixes
114
+
115
+ * Switch disabled state ([#1124](https://github.com/transferwise/neptune-web/issues/1124)) ([556f1dd](https://github.com/transferwise/neptune-web/commit/556f1dda5667f2d6bc8ff95f4c39c6de5185f4bb))
116
+
117
+
118
+
119
+
120
+
121
+ ## [37.3.5](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.3.4...@transferwise/components@37.3.5) (2021-09-02)
122
+
123
+
124
+ ### Bug Fixes
125
+
126
+ * fixing incorrect title text wrapping in drawer ([#1126](https://github.com/transferwise/neptune-web/issues/1126)) ([c91ecd7](https://github.com/transferwise/neptune-web/commit/c91ecd79a0dfe0986f725a3d7ec3e6812b2807c6))
127
+
128
+
129
+
130
+
131
+
132
+ ## [37.3.4](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.3.3...@transferwise/components@37.3.4) (2021-09-02)
133
+
134
+ **Note:** Version bump only for package @transferwise/components
135
+
136
+
137
+
138
+
139
+
140
+ ## [37.3.3](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.3.2...@transferwise/components@37.3.3) (2021-09-02)
141
+
142
+ **Note:** Version bump only for package @transferwise/components
143
+
144
+
145
+
146
+
147
+
148
+ ## [37.3.2](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.3.1...@transferwise/components@37.3.2) (2021-09-02)
149
+
150
+
151
+ ### Bug Fixes
152
+
153
+ * remove unused closeOnClick prop from Modal ([#1117](https://github.com/transferwise/neptune-web/issues/1117)) ([3b6cc4b](https://github.com/transferwise/neptune-web/commit/3b6cc4b6d7c1eb8cd536c02254e051d4beb0fa2e))
154
+
155
+
156
+
157
+
158
+
159
+ ## [37.3.1](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.3.0...@transferwise/components@37.3.1) (2021-08-26)
160
+
161
+
162
+ ### Bug Fixes
163
+
164
+ * localize placeholders and labels in DateInput ([#1110](https://github.com/transferwise/neptune-web/issues/1110)) ([0338ad6](https://github.com/transferwise/neptune-web/commit/0338ad64bba0dffd653196d8804fff34d432601b))
165
+
166
+
167
+
168
+
169
+
170
+ # [37.3.0](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.2.1...@transferwise/components@37.3.0) (2021-08-25)
171
+
172
+
173
+ ### Features
174
+
175
+ * add onClick to the Nudge ([#1108](https://github.com/transferwise/neptune-web/issues/1108)) ([265021c](https://github.com/transferwise/neptune-web/commit/265021cb9a060ccfd40458f4c065e87e3c5b0276))
176
+
177
+
178
+
179
+
180
+
181
+ ## [37.2.1](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.2.0...@transferwise/components@37.2.1) (2021-08-18)
182
+
183
+ **Note:** Version bump only for package @transferwise/components
184
+
185
+
186
+
187
+
188
+
189
+ # [37.2.0](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.1.1...@transferwise/components@37.2.0) (2021-08-17)
190
+
191
+
192
+ ### Features
193
+
194
+ * **select:** incremental results when searching large Select lists for better performance ([#1084](https://github.com/transferwise/neptune-web/issues/1084)) ([238cb0a](https://github.com/transferwise/neptune-web/commit/238cb0a336e3b0bfd2c1ace8fac50b5188f1e663))
195
+
196
+
197
+
198
+
199
+
200
+ ## [37.1.1](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.1.0...@transferwise/components@37.1.1) (2021-08-16)
201
+
202
+ **Note:** Version bump only for package @transferwise/components
203
+
204
+
205
+
206
+
207
+
208
+ # [37.1.0](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.0.6...@transferwise/components@37.1.0) (2021-08-16)
209
+
210
+
211
+ ### Features
212
+
213
+ * add manual file download handler to UploadInput ([#1098](https://github.com/transferwise/neptune-web/issues/1098)) ([a944372](https://github.com/transferwise/neptune-web/commit/a944372b1368a1e2c41a7d37cea7c29ccf05ac93))
214
+
215
+
216
+
217
+
218
+
219
+ ## [37.0.6](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.0.5...@transferwise/components@37.0.6) (2021-08-16)
220
+
221
+ **Note:** Version bump only for package @transferwise/components
222
+
223
+
224
+
225
+
226
+
227
+ ## [37.0.5](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.0.4...@transferwise/components@37.0.5) (2021-08-16)
228
+
229
+ **Note:** Version bump only for package @transferwise/components
230
+
231
+
232
+
233
+
234
+
235
+ ## [37.0.4](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.0.3...@transferwise/components@37.0.4) (2021-08-13)
236
+
237
+ **Note:** Version bump only for package @transferwise/components
238
+
239
+
240
+
241
+
242
+
243
+ ## [37.0.3](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.0.2...@transferwise/components@37.0.3) (2021-08-13)
244
+
245
+ **Note:** Version bump only for package @transferwise/components
246
+
247
+
248
+
249
+
250
+
251
+ ## [37.0.2](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.0.1...@transferwise/components@37.0.2) (2021-08-12)
252
+
253
+ **Note:** Version bump only for package @transferwise/components
254
+
255
+
256
+
257
+
258
+
259
+ ## [37.0.1](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.0.0...@transferwise/components@37.0.1) (2021-08-11)
260
+
261
+
262
+ ### Bug Fixes
263
+
264
+ * fix select chevron colour disabled state ([#1088](https://github.com/transferwise/neptune-web/issues/1088)) ([1d83a79](https://github.com/transferwise/neptune-web/commit/1d83a792d1e2a385289037342b55c30c5fce1894))
265
+
266
+
267
+
268
+
269
+
6
270
  # [37.0.0](https://github.com/transferwise/neptune-web/compare/@transferwise/components@36.13.0...@transferwise/components@37.0.0) (2021-08-06)
7
271
 
8
272
 
@@ -1 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";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{useState}from"react";import PropTypes from"prop-types";import AccordionItem from"./AccordionItem";import{Theme}from"../common";import{jsx as _jsx}from"react/jsx-runtime";var Accordion=function(a){var b=a.items,c=a.onClick,d=a.indexOpen,e=a.theme,f=useState(function(){return b.map(function(a,b){return b===d})}),g=_slicedToArray(f,2),h=g[0],i=g[1],j=function(a){c&&c(a);var b=_toConsumableArray(h);b[a]=!h[a],i(b)};return b.map(function(a,b){return/*#__PURE__*/_jsx(AccordionItem,_objectSpread(_objectSpread({onClick:function(){return j(b)},open:h[b]},a),{},{theme:e}),a.id||b)})};Accordion.propTypes={indexOpen:PropTypes.number,items:PropTypes.arrayOf(PropTypes.shape({id:PropTypes.string,title:PropTypes.node.isRequired,content:PropTypes.node.isRequired,icon:PropTypes.node})).isRequired,onClick:PropTypes.func,theme:PropTypes.oneOf(["light","dark"])},Accordion.defaultProps={indexOpen:-1,onClick:null,theme:Theme.LIGHT};export default Accordion;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";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 PropTypes from"prop-types";import{useState}from"react";import{Theme}from"../common";import AccordionItem from"./AccordionItem";import{jsx as _jsx}from"react/jsx-runtime";var Accordion=function(a){var b=a.items,c=a.onClick,d=a.indexOpen,e=a.theme,f=useState(function(){return b.map(function(a,b){return b===d})}),g=_slicedToArray(f,2),h=g[0],i=g[1],j=function(a){c&&c(a);var b=_toConsumableArray(h);b[a]=!h[a],i(b)};return b.map(function(a,b){return/*#__PURE__*/_jsx(AccordionItem,_objectSpread(_objectSpread({open:h[b],onClick:function(){return j(b)}},a),{},{theme:e}),a.id||b)})};Accordion.propTypes={indexOpen:PropTypes.number,items:PropTypes.arrayOf(PropTypes.shape({id:PropTypes.string,title:PropTypes.node.isRequired,content:PropTypes.node.isRequired,icon:PropTypes.node})).isRequired,onClick:PropTypes.func,theme:PropTypes.oneOf(["light","dark"])},Accordion.defaultProps={indexOpen:-1,onClick:null,theme:Theme.LIGHT};export default Accordion;
@@ -1 +1 @@
1
- import{cloneElement}from"react";import PropTypes from"prop-types";import classNames from"classnames";import{isString}from"@transferwise/neptune-validation";import Chevron from"../../chevron";import{Position,Theme}from"../../common";import{useDirection}from"../../common/hooks";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var AccordionItem=function(a){var b=a.id,c=a.title,d=a.content,e=a.onClick,f=a.open,g=a.icon,h=a.theme,i=g?/*#__PURE__*/cloneElement(g,{size:24}):null,j=useDirection(),k=j.isRTL;return/*#__PURE__*/_jsxs("div",{id:b,className:classNames("tw-accordion-item decision p-a-0","tw-accordion-item--".concat(h),{closed:!f}),children:[/*#__PURE__*/_jsx("button",{type:"button","aria-expanded":f,onClick:e,className:classNames("tw-accordion-item btn btn-link p-x-0 text-no-decoration p-t-3",{"p-b-3":!f,"p-b-2":f}),children:/*#__PURE__*/_jsxs("div",{className:"media",children:[g&&/*#__PURE__*/_jsx("div",{className:classNames("hidden-xs hidden-sm",{"media-left":!k,"media-right":k,"p-r-2":!k,"p-l-2":k}),children:i}),/*#__PURE__*/_jsx("div",{className:classNames("media-body title",{"text-xs-left":!k,"text-xs-right":k}),children:isString(c)?/*#__PURE__*/_jsx("span",{className:"h5 tw-accordion-item__title",children:c}):c}),/*#__PURE__*/_jsx("div",{className:classNames("d-flex align-items-center",{"media-right":!k,"media-left":k}),children:/*#__PURE__*/_jsx(Chevron,{orientation:f?Position.TOP:Position.BOTTOM})})]})}),/*#__PURE__*/_jsx("div",{className:"accordion-content media",children:/*#__PURE__*/_jsx("div",{className:classNames("media-body p-b-3",{"m-l-5":g||k,"m-r-5":g}),"aria-hidden":!f,children:d})})]})};AccordionItem.propTypes={content:PropTypes.node.isRequired,icon:PropTypes.node,id:PropTypes.string,open:PropTypes.bool.isRequired,onClick:PropTypes.func.isRequired,title:PropTypes.node.isRequired,theme:PropTypes.oneOf(["light","dark"])},AccordionItem.defaultProps={icon:null,id:null,theme:Theme.LIGHT};export default AccordionItem;
1
+ import{isString}from"@transferwise/neptune-validation";import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement}from"react";import Chevron from"../../chevron";import{Position,Theme}from"../../common";import{useDirection}from"../../common/hooks";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var AccordionItem=function(a){var b=a.id,c=a.title,d=a.content,e=a.onClick,f=a.open,g=a.icon,h=a.theme,i=g?/*#__PURE__*/cloneElement(g,{size:24}):null,j=useDirection(),k=j.isRTL;return/*#__PURE__*/_jsxs("div",{id:b,className:classNames("tw-accordion-item decision p-a-0","tw-accordion-item--".concat(h),{closed:!f}),children:[/*#__PURE__*/_jsx("button",{type:"button","aria-expanded":f,className:classNames("tw-accordion-item btn btn-link p-x-0 text-no-decoration p-t-3",{"p-b-3":!f,"p-b-2":f}),onClick:e,children:/*#__PURE__*/_jsxs("div",{className:"media",children:[g&&/*#__PURE__*/_jsx("div",{className:classNames("hidden-xs hidden-sm",{"media-left":!k,"media-right":k,"p-r-2":!k,"p-l-2":k}),children:i}),/*#__PURE__*/_jsx("div",{className:classNames("media-body title",{"text-xs-left":!k,"text-xs-right":k}),children:isString(c)?/*#__PURE__*/_jsx("span",{className:"h5 tw-accordion-item__title",children:c}):c}),/*#__PURE__*/_jsx("div",{className:classNames("d-flex align-items-center",{"media-right":!k,"media-left":k}),children:/*#__PURE__*/_jsx(Chevron,{orientation:f?Position.TOP:Position.BOTTOM})})]})}),/*#__PURE__*/_jsx("div",{className:"accordion-content media",children:/*#__PURE__*/_jsx("div",{className:classNames("media-body p-b-3",{"m-l-5":g||k,"m-r-5":g}),"aria-hidden":!f,children:d})})]})};AccordionItem.propTypes={content:PropTypes.node.isRequired,icon:PropTypes.node,id:PropTypes.string,open:PropTypes.bool.isRequired,onClick:PropTypes.func.isRequired,title:PropTypes.node.isRequired,theme:PropTypes.oneOf(["light","dark"])},AccordionItem.defaultProps={icon:null,id:null,theme:Theme.LIGHT};export default AccordionItem;
@@ -1 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import Option from"../common/Option";import Button from"../button";import{ControlType,Priority,Size}from"../common";import{jsx as _jsx}from"react/jsx-runtime";var ActionOption=function(a){var b=a.action,c=a.disabled,d=a.onClick,e=a.media,f=a.title,g=a.content,h=a.complex,i=a.className,j=a.showMediaAtAllSizes,k={media:e,title:f,content:g,complex:h,disabled:c,showMediaAtAllSizes:j,className:classNames("tw-action-option",i)};return/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},k),{},{button:/*#__PURE__*/_jsx(Button,{className:"p-x-0","aria-label":"".concat(f,", ").concat(b),type:ControlType.ACCENT,priority:Priority.TERTIARY,size:Size.SMALL,disabled:c,onClick:d,children:b})}))};export default ActionOption;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import Button from"../button";import{ControlType,Priority,Size}from"../common";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";var ActionOption=function(a){var b=a.action,c=a.disabled,d=a.onClick,e=a.media,f=a.title,g=a.content,h=a.complex,i=a.className,j=a.showMediaAtAllSizes,k={media:e,title:f,content:g,complex:h,disabled:c,showMediaAtAllSizes:j,className:classNames("tw-action-option",i)};return/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},k),{},{button:/*#__PURE__*/_jsx(Button,{className:"p-x-0","aria-label":function getAriaLabel(){var a=[];return"string"==typeof f&&a.push(f),"string"==typeof b&&a.push(b),a.join(", ")||void 0}(),type:ControlType.ACCENT,priority:Priority.TERTIARY,size:Size.SMALL,disabled:c,onClick:d,children:b})}))};export default ActionOption;
@@ -1 +1 @@
1
- import{FastFlag as FastFlagIcon}from"@transferwise/icons";import{action}from"@storybook/addon-actions";import{text,boolean}from"@storybook/addon-knobs";import ActionOption from"./ActionOption";import{jsx as _jsx}from"react/jsx-runtime";export default{component:ActionOption,title:"ActionOption"};export var basic=function(){var a=text("title","Action option"),b=text("content","Normally, the button and icon are vertically centered."),c=text("action","Action"),d=boolean("disabled",!1),e=boolean("showMediaAtAllSizes",!1);return/*#__PURE__*/_jsx(ActionOption,{action:c,media:/*#__PURE__*/_jsx(FastFlagIcon,{}),title:a,content:b,onClick:action("Button Clicked"),complex:!1,disabled:d,showMediaAtAllSizes:e})};
1
+ import{action}from"@storybook/addon-actions";import{text,boolean}from"@storybook/addon-knobs";import{FastFlag as FastFlagIcon}from"@transferwise/icons";import ActionOption from"./ActionOption";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:ActionOption,title:"ActionOption"};export var Basic=function(){var a=text("title","Action option"),b=text("content","Normally, the button and icon are vertically centered."),c=text("action","Action"),d=boolean("disabled",!1),e=boolean("showMediaAtAllSizes",!1);return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(ActionOption,{action:c,media:/*#__PURE__*/_jsx(FastFlagIcon,{}),title:a,content:b,complex:!1,disabled:d,showMediaAtAllSizes:e,onClick:action("Button Clicked")}),/*#__PURE__*/_jsx(ActionOption,{action:c,media:/*#__PURE__*/_jsx(FastFlagIcon,{}),title:a,content:b,complex:!1,disabled:!0,showMediaAtAllSizes:e,onClick:action("Button Clicked")})]})};
@@ -1 +1 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";var _deprecatedTypeMap,_iconTypeMap,_deprecatedTypeMapMes;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{cloneElement,useState,useRef}from"react";import PropTypes from"prop-types";import classNames from"classnames";import requiredIf from"react-required-if";import{InfoCircle,CheckCircle,Alert as AlertIcon,AlertCircle}from"@transferwise/icons";import{Sentiment}from"../common";import CloseButton from"../common/closeButton";import withArrow from"./withArrow";import InlineMarkdown from"./inlineMarkdown";import{logActionRequiredIf,deprecated}from"../utilities";import{useDirection}from"../common/hooks";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var deprecatedTypeMap=(_deprecatedTypeMap={},_defineProperty(_deprecatedTypeMap,Sentiment.SUCCESS,Sentiment.POSITIVE),_defineProperty(_deprecatedTypeMap,Sentiment.INFO,Sentiment.NEUTRAL),_defineProperty(_deprecatedTypeMap,Sentiment.ERROR,Sentiment.NEGATIVE),_deprecatedTypeMap),iconTypeMap=(_iconTypeMap={},_defineProperty(_iconTypeMap,Sentiment.POSITIVE,CheckCircle),_defineProperty(_iconTypeMap,Sentiment.NEUTRAL,InfoCircle),_defineProperty(_iconTypeMap,Sentiment.WARNING,AlertIcon),_defineProperty(_iconTypeMap,Sentiment.NEGATIVE,AlertCircle),_iconTypeMap),Alert=function(a){var b=useState(!1),c=_slicedToArray(b,2),d=c[0],e=c[1],f=a.arrow,g=a.action,h=a.children,i=a.className,j=a.icon,k=a.onDismiss,l=a.message,m=a.type,n=useRef(null),o=useDirection(),p=o.isRTL;if(f){var u=withArrow(Alert,f);return/*#__PURE__*/_jsx(u,_objectSpread({},a))}logActionRequired(a);var q=deprecatedTypeMap[m]||m,r=iconTypeMap[q],s=j?/*#__PURE__*/cloneElement(j,{size:24}):/*#__PURE__*/_jsx(r,{size:24}),t=/*#__PURE__*/_jsxs("div",{role:"alert",className:classNames("alert d-flex","alert-".concat(q),i),onTouchStart:function handleTouchStart(){return e(!0)},onTouchEnd:function handleTouchEnd(a){d&&g&&null!==n&&void 0!==n&&n.current&&!n.current.contains(a.target)&&("_blank"===(null===g||void 0===g?void 0:g.target)?window.top.open(g.href):window.top.location.assign(g.href)),e(!1)},onTouchMove:function handleTouchMove(){return e(!1)},children:[s,/*#__PURE__*/_jsxs("div",{className:classNames("alert__message flex-grow-1",{"p-l-2":!p,"p-r-2":p}),children:[/*#__PURE__*/_jsx("div",{children:h||/*#__PURE__*/_jsx(InlineMarkdown,{children:l})}),g&&/*#__PURE__*/_jsx("a",{href:g.href,className:"m-t-1 d-inline-block","aria-label":g["aria-label"],target:g.target,children:g.text})]}),k&&/*#__PURE__*/_jsx(CloseButton,{onClick:k,size:16,className:classNames({"m-l-2":!p,"m-r-2":p}),ref:n})]});return t},deprecatedTypeMapMessage=(_deprecatedTypeMapMes={},_defineProperty(_deprecatedTypeMapMes,Sentiment.SUCCESS,"Sentiment.POSITIVE"),_defineProperty(_deprecatedTypeMapMes,Sentiment.INFO,"Sentiment.NEUTRAL"),_defineProperty(_deprecatedTypeMapMes,Sentiment.ERROR,"Sentiment.NEGATIVE"),_deprecatedTypeMapMes),deprecatedTypes=Object.keys(deprecatedTypeMap);function logActionRequired(a){var b=a.size,c=a.type;logActionRequiredIf("Alert no longer supports any possible variations in size. Please remove the `size` prop.",!!b),logActionRequiredIf("Alert has deprecated the ".concat(c," value for the `type` prop. Please update to ").concat(deprecatedTypeMapMessage[c],"."),deprecatedTypes.includes(c))}Alert.propTypes={/** An optional call to action to sit under the main body of the alert. If your label is short, use aria-label to provide more context */action:PropTypes.shape({"aria-label":PropTypes.string,href:PropTypes.string.isRequired,target:PropTypes.string,text:PropTypes.node.isRequired}),className:PropTypes.string,/** An optional icon. If not provided, we will default the icon to something appropriate for the type */icon:PropTypes.element,/** The main body of the alert. Accepts plain text and bold words specified with **double stars** */message:requiredIf(PropTypes.node,function(a){var b=a.children;return!b}),/** The presence of the onDismiss handler will trigger the visibility of the close button */onDismiss:PropTypes.func,/** The type dictates which icon and colour will be used */type:PropTypes.oneOf(["negative","neutral","positive","warning","info","error","success"]),/** @deprecated no arrow for `Alert` component anymore, consider to use [`InlineAlert`](https://transferwise.github.io/neptune-web/components/alerts/InlineAlert) component */arrow:deprecated(PropTypes.oneOf(["up-left","up-center","up-right","down-left","down-center","down-right"]),{component:"Alert",expiryDate:new Date("03-01-2021")}),/** @deprecated use `message` property instead */children:deprecated(requiredIf(PropTypes.node,function(a){var b=a.message;return!b}),{component:"Alert",message:"You should now use the `message` prop. Be aware `message` only accepts plain text or text with **bold** markdown.",expiryDate:new Date("03-01-2021")}),/** @deprecated use `onDismiss` instead */dismissible:deprecated(PropTypes.bool,{component:"Alert",message:"The Alert will now be considered dismissible if an `onDismiss` hander is present.",expiryDate:new Date("03-01-2021")})},Alert.defaultProps={action:void 0,arrow:void 0,className:void 0,dismissible:void 0,icon:void 0,type:Sentiment.NEUTRAL};export default Alert;
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";var _deprecatedTypeMap,_iconTypeMap,_deprecatedTypeMapMes;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{InfoCircle,CheckCircle,Alert as AlertIcon,AlertCircle}from"@transferwise/icons";import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement,useState,useRef}from"react";import requiredIf from"react-required-if";import{Sentiment}from"../common";import CloseButton from"../common/closeButton";import{useDirection}from"../common/hooks";import{logActionRequiredIf,deprecated}from"../utilities";import InlineMarkdown from"./inlineMarkdown";import withArrow from"./withArrow";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var deprecatedTypeMap=(_deprecatedTypeMap={},_defineProperty(_deprecatedTypeMap,Sentiment.SUCCESS,Sentiment.POSITIVE),_defineProperty(_deprecatedTypeMap,Sentiment.INFO,Sentiment.NEUTRAL),_defineProperty(_deprecatedTypeMap,Sentiment.ERROR,Sentiment.NEGATIVE),_deprecatedTypeMap),iconTypeMap=(_iconTypeMap={},_defineProperty(_iconTypeMap,Sentiment.POSITIVE,CheckCircle),_defineProperty(_iconTypeMap,Sentiment.NEUTRAL,InfoCircle),_defineProperty(_iconTypeMap,Sentiment.WARNING,AlertIcon),_defineProperty(_iconTypeMap,Sentiment.NEGATIVE,AlertCircle),_iconTypeMap),Alert=function(a){var b=useState(!1),c=_slicedToArray(b,2),d=c[0],e=c[1],f=a.arrow,g=a.action,h=a.children,i=a.className,j=a.icon,k=a.onDismiss,l=a.message,m=a.type,n=useRef(null),o=useDirection(),p=o.isRTL;if(f){var t=withArrow(Alert,f);return/*#__PURE__*/_jsx(t,_objectSpread({},a))}logActionRequired(a);var q=deprecatedTypeMap[m]||m,r=iconTypeMap[q],s=j?/*#__PURE__*/cloneElement(j,{size:24}):/*#__PURE__*/_jsx(r,{size:24});return/*#__PURE__*/_jsxs("div",{role:"alert",className:classNames("alert d-flex","alert-".concat(q),i),onTouchStart:function handleTouchStart(){return e(!0)},onTouchEnd:function handleTouchEnd(a){d&&g&&null!==n&&void 0!==n&&n.current&&!n.current.contains(a.target)&&("_blank"===(null===g||void 0===g?void 0:g.target)?window.top.open(g.href):window.top.location.assign(g.href)),e(!1)},onTouchMove:function handleTouchMove(){return e(!1)},children:[s,/*#__PURE__*/_jsxs("div",{className:classNames("alert__message flex-grow-1",{"p-l-2":!p,"p-r-2":p}),children:[/*#__PURE__*/_jsx("div",{children:h||/*#__PURE__*/_jsx(InlineMarkdown,{children:l})}),g&&/*#__PURE__*/_jsx("a",{href:g.href,className:"m-t-1 d-inline-block","aria-label":g["aria-label"],target:g.target,children:g.text})]}),k&&/*#__PURE__*/_jsx(CloseButton,{ref:n,size:16,className:classNames({"m-l-2":!p,"m-r-2":p}),onClick:k})]})},deprecatedTypeMapMessage=(_deprecatedTypeMapMes={},_defineProperty(_deprecatedTypeMapMes,Sentiment.SUCCESS,"Sentiment.POSITIVE"),_defineProperty(_deprecatedTypeMapMes,Sentiment.INFO,"Sentiment.NEUTRAL"),_defineProperty(_deprecatedTypeMapMes,Sentiment.ERROR,"Sentiment.NEGATIVE"),_deprecatedTypeMapMes),deprecatedTypes=Object.keys(deprecatedTypeMap);function logActionRequired(a){var b=a.size,c=a.type;logActionRequiredIf("Alert no longer supports any possible variations in size. Please remove the `size` prop.",!!b),logActionRequiredIf("Alert has deprecated the ".concat(c," value for the `type` prop. Please update to ").concat(deprecatedTypeMapMessage[c],"."),deprecatedTypes.includes(c))}Alert.propTypes={/** An optional call to action to sit under the main body of the alert. If your label is short, use aria-label to provide more context */action:PropTypes.shape({"aria-label":PropTypes.string,href:PropTypes.string.isRequired,target:PropTypes.string,text:PropTypes.node.isRequired}),className:PropTypes.string,/** An optional icon. If not provided, we will default the icon to something appropriate for the type */icon:PropTypes.element,/** The main body of the alert. Accepts plain text and bold words specified with **double stars*/message:requiredIf(PropTypes.node,function(a){var b=a.children;return!b}),/** The presence of the onDismiss handler will trigger the visibility of the close button */onDismiss:PropTypes.func,/** The type dictates which icon and colour will be used */type:PropTypes.oneOf(["negative","neutral","positive","warning","info","error","success"]),/** @deprecated no arrow for `Alert` component anymore, consider to use [`InlineAlert`](https://transferwise.github.io/neptune-web/components/alerts/InlineAlert) component */arrow:deprecated(PropTypes.oneOf(["up-left","up-center","up-right","down-left","down-center","down-right"]),{component:"Alert",expiryDate:new Date("03-01-2021")}),/** @deprecated use `message` property instead */children:deprecated(requiredIf(PropTypes.node,function(a){var b=a.message;return!b}),{component:"Alert",message:"You should now use the `message` prop. Be aware `message` only accepts plain text or text with **bold** markdown.",expiryDate:new Date("03-01-2021")}),/** @deprecated use `onDismiss` instead */dismissible:deprecated(PropTypes.bool,{component:"Alert",message:"The Alert will now be considered dismissible if an `onDismiss` hander is present.",expiryDate:new Date("03-01-2021")})},Alert.defaultProps={action:void 0,arrow:void 0,className:void 0,dismissible:void 0,icon:void 0,type:Sentiment.NEUTRAL};export default Alert;
@@ -1 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import PropTypes from"prop-types";import Markdown from"../../markdown";import{MarkdownNodeType}from"../../common";import{jsx as _jsx}from"react/jsx-runtime";var allowList=[MarkdownNodeType.STRONG],InlineMarkdown=function(a){return/*#__PURE__*/_jsx(Markdown,_objectSpread(_objectSpread({},a),{},{as:"span",allowList:allowList,blockList:void 0}))};InlineMarkdown.propTypes={children:PropTypes.string.isRequired,className:PropTypes.string},InlineMarkdown.defaultProps={className:void 0};export default InlineMarkdown;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import PropTypes from"prop-types";import{MarkdownNodeType}from"../../common";import Markdown from"../../markdown";import{jsx as _jsx}from"react/jsx-runtime";var allowList=[MarkdownNodeType.STRONG],InlineMarkdown=function(a){return/*#__PURE__*/_jsx(Markdown,_objectSpread(_objectSpread({},a),{},{as:"span",allowList:allowList,blockList:void 0}))};InlineMarkdown.propTypes={children:PropTypes.string.isRequired,className:PropTypes.string},InlineMarkdown.defaultProps={className:void 0};export default InlineMarkdown;
@@ -1 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import PropTypes from"prop-types";import classNames from"classnames";import{ArrowPosition}from"./alertArrowPositions";import{jsx as _jsx}from"react/jsx-runtime";function withArrow(a,b){var c=function(c){return/*#__PURE__*/_jsx(a,_objectSpread(_objectSpread({},c),{},{className:classNames(c.className,arrowClasses(b)),arrow:void 0}))};return c.propTypes={className:PropTypes.string},c.defaultProps={className:void 0},c}function arrowClasses(a){if(a){var b=["arrow"],c=ArrowPosition.BOTTOM,d=ArrowPosition.BOTTOM_LEFT,e=ArrowPosition.BOTTOM_RIGHT,f=ArrowPosition.TOP,g=ArrowPosition.TOP_RIGHT,h=ArrowPosition.TOP_LEFT;switch(a){case c:return b.concat("arrow-bottom","arrow-center");case d:return b.concat("arrow-bottom","arrow-left");case e:return b.concat("arrow-bottom","arrow-right");case f:return b.concat("arrow-center");case g:return b.concat("arrow-right");case h:default:return b;}}return""}export default withArrow;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import PropTypes from"prop-types";import{ArrowPosition}from"./alertArrowPositions";import{jsx as _jsx}from"react/jsx-runtime";function withArrow(a,b){var c=function(c){return/*#__PURE__*/_jsx(a,_objectSpread(_objectSpread({},c),{},{className:classNames(c.className,arrowClasses(b)),arrow:void 0}))};return c.propTypes={className:PropTypes.string},c.defaultProps={className:void 0},c}function arrowClasses(a){if(a){var b=["arrow"],c=ArrowPosition.BOTTOM,d=ArrowPosition.BOTTOM_LEFT,e=ArrowPosition.BOTTOM_RIGHT,f=ArrowPosition.TOP,g=ArrowPosition.TOP_RIGHT,h=ArrowPosition.TOP_LEFT;switch(a){case c:return b.concat("arrow-bottom","arrow-center");case d:return b.concat("arrow-bottom","arrow-left");case e:return b.concat("arrow-bottom","arrow-right");case f:return b.concat("arrow-center");case g:return b.concat("arrow-right");case h:default:return b;}}return""}export default withArrow;
@@ -1 +1 @@
1
- import PropTypes from"prop-types";import classnames from"classnames";import{AvatarType}from"./avatarTypes";import{Size,Theme}from"../common";import{jsx as _jsx}from"react/jsx-runtime";var Avatar=function(a){var b=a.backgroundColor,c=a.children,d=a.className,e=a.outlined,f=a.size,g=a.theme,h=a.type;return/*#__PURE__*/_jsx("div",{className:classnames("tw-avatar",d,"tw-avatar--".concat(f),"tw-avatar--".concat(h),"tw-avatar--".concat(g),{"tw-avatar--outlined":e}),children:/*#__PURE__*/_jsx("div",{className:"tw-avatar__content",style:{backgroundColor:b||void 0},children:c})})};Avatar.propTypes={backgroundColor:PropTypes.string,children:PropTypes.node,className:PropTypes.string,outlined:PropTypes.bool,size:PropTypes.oneOf(["sm","md","lg"]),theme:PropTypes.oneOf(["light","dark"]),type:PropTypes.oneOf(["thumbnail","icon","emoji","initials"])},Avatar.defaultProps={backgroundColor:null,children:null,className:null,outlined:!1,size:Size.MEDIUM,theme:Theme.LIGHT,type:AvatarType.THUMBNAIL};export default Avatar;
1
+ import classnames from"classnames";import PropTypes from"prop-types";import{Size,Theme}from"../common";import{AvatarType}from"./avatarTypes";import{jsx as _jsx}from"react/jsx-runtime";var Avatar=function(a){var b=a.backgroundColor,c=a.children,d=a.className,e=a.outlined,f=a.size,g=a.theme,h=a.type;return/*#__PURE__*/_jsx("div",{className:classnames("tw-avatar",d,"tw-avatar--".concat(f),"tw-avatar--".concat(h),"tw-avatar--".concat(g),{"tw-avatar--outlined":e}),children:/*#__PURE__*/_jsx("div",{className:"tw-avatar__content",style:{backgroundColor:b||void 0},children:c})})};Avatar.propTypes={backgroundColor:PropTypes.string,children:PropTypes.node,className:PropTypes.string,outlined:PropTypes.bool,size:PropTypes.oneOf(["sm","md","lg"]),theme:PropTypes.oneOf(["light","dark"]),type:PropTypes.oneOf(["thumbnail","icon","emoji","initials"])},Avatar.defaultProps={backgroundColor:null,children:null,className:null,outlined:!1,size:Size.MEDIUM,theme:Theme.LIGHT,type:AvatarType.THUMBNAIL};export default Avatar;
@@ -1 +1 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["url","children"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{useState,useEffect}from"react";import PropTypes from"prop-types";import{Profile as ProfileIcon,Briefcase as BriefcaseIcon}from"@transferwise/icons";import Avatar,{AvatarType}from"../avatar";import Badge from"../badge";import{ProfileType,Size}from"../common";import{jsx as _jsx}from"react/jsx-runtime";var OptionalBadge=function(a){var b=a.url,c=a.children,d=_objectWithoutProperties(a,_excluded);return b?/*#__PURE__*/_jsx(Badge,_objectSpread(_objectSpread({badge:/*#__PURE__*/_jsx("img",{src:b,alt:""})},d),{},{children:c})):c};OptionalBadge.propTypes={url:PropTypes.string,children:PropTypes.node.isRequired},OptionalBadge.defaultProps={url:void 0};var AvatarWrapper=function(a){var b=a.url,c=a.profileType,d=a.badgeUrl,e=a.name,f=a.avatarProps,g=a.badgeProps,h=useState(!1),i=_slicedToArray(h,2),j=i[0],k=i[1],l=c===ProfileType.BUSINESS;useEffect(function(){return k(!1)},[b]);return/*#__PURE__*/_jsx(OptionalBadge,_objectSpread(_objectSpread({url:d},g),{},{children:/*#__PURE__*/_jsx(Avatar,_objectSpread({size:Size.MEDIUM},function getAvatarProps(){return b&&!j?_objectSpread({type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:b,alt:"avatar",onError:function onError(){return k(!0)}})},f):c?_objectSpread({type:AvatarType.ICON,children:l?/*#__PURE__*/_jsx(BriefcaseIcon,{}):/*#__PURE__*/_jsx(ProfileIcon,{})},f):e?_objectSpread({type:AvatarType.INITIALS,children:/*#__PURE__*/_jsx("small",{children:getInitials(e)})},f):_objectSpread({type:AvatarType.ICON,children:/*#__PURE__*/_jsx(ProfileIcon,{})},f)}()))}))};function getInitials(a){var b=a.split(" ").map(function(a){return a[0]}).join("").toUpperCase();return 1===b.length?b[0]:b[0]+b.slice(-1)}AvatarWrapper.defaultProps={url:void 0,profileType:void 0,badgeUrl:void 0,name:void 0,avatarProps:{},badgeProps:{}},AvatarWrapper.propTypes={url:PropTypes.string,profileType:PropTypes.oneOf(["PERSONAL","BUSINESS"]),badgeUrl:PropTypes.string,name:PropTypes.string,avatarProps:PropTypes.shape({}),badgeProps:PropTypes.shape({})};export default AvatarWrapper;
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["url","children"];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{Profile as ProfileIcon,Briefcase as BriefcaseIcon}from"@transferwise/icons";import PropTypes from"prop-types";import{useState,useEffect}from"react";import Avatar,{AvatarType}from"../avatar";import Badge from"../badge";import{ProfileType,Size}from"../common";import{jsx as _jsx}from"react/jsx-runtime";var OptionalBadge=function(a){var b=a.url,c=a.children,d=_objectWithoutProperties(a,_excluded);return b?/*#__PURE__*/_jsx(Badge,_objectSpread(_objectSpread({badge:/*#__PURE__*/_jsx("img",{src:b,alt:""})},d),{},{children:c})):c};OptionalBadge.propTypes={url:PropTypes.string,children:PropTypes.node.isRequired},OptionalBadge.defaultProps={url:void 0};var AvatarWrapper=function(a){var b=a.url,c=a.profileType,d=a.badgeUrl,e=a.name,f=a.avatarProps,g=a.badgeProps,h=useState(!1),i=_slicedToArray(h,2),j=i[0],k=i[1],l=c===ProfileType.BUSINESS;useEffect(function(){return k(!1)},[b]);return/*#__PURE__*/_jsx(OptionalBadge,_objectSpread(_objectSpread({url:d},g),{},{children:/*#__PURE__*/_jsx(Avatar,_objectSpread({size:Size.MEDIUM},function getAvatarProps(){return b&&!j?_objectSpread({type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:b,alt:"avatar",onError:function onError(){return k(!0)}})},f):c?_objectSpread({type:AvatarType.ICON,children:l?/*#__PURE__*/_jsx(BriefcaseIcon,{}):/*#__PURE__*/_jsx(ProfileIcon,{})},f):e?_objectSpread({type:AvatarType.INITIALS,children:/*#__PURE__*/_jsx("small",{children:getInitials(e)})},f):_objectSpread({type:AvatarType.ICON,children:/*#__PURE__*/_jsx(ProfileIcon,{})},f)}()))}))};function getInitials(a){var b=a.split(" ").map(function(a){return a[0]}).join("").toUpperCase();return 1===b.length?b[0]:b[0]+b.slice(-1)}AvatarWrapper.defaultProps={url:void 0,profileType:void 0,badgeUrl:void 0,name:void 0,avatarProps:{},badgeProps:{}},AvatarWrapper.propTypes={url:PropTypes.string,profileType:PropTypes.oneOf(["PERSONAL","BUSINESS"]),badgeUrl:PropTypes.string,name:PropTypes.string,avatarProps:PropTypes.shape({}),badgeProps:PropTypes.shape({})};export default AvatarWrapper;
@@ -1 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import classNames from"classnames";import{Size,Theme}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";function Badge(a){var b,c=a.badge,d=a.className,e=void 0===d?void 0:d,f=a.size,g=void 0===f?Size.SMALL:f,h=a.border,i=void 0===h?Theme.LIGHT:h,j=a.children,k=classNames("tw-badge",(b={},_defineProperty(b,"tw-badge-border-".concat(i),i),_defineProperty(b,"tw-badge-".concat(g),g),b),e);return/*#__PURE__*/_jsxs("div",{className:k,children:[/*#__PURE__*/_jsx("div",{className:"tw-badge__children",children:j}),/*#__PURE__*/_jsx("div",{className:"tw-badge__content",children:c})]})}export default Badge;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import classNames from"classnames";import{Size,Theme}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Badge=function(a){var b,c=a.badge,d=a.className,e=void 0===d?void 0:d,f=a.size,g=void 0===f?Size.SMALL:f,h=a.border,i=void 0===h?Theme.LIGHT:h,j=a.children,k=classNames("tw-badge",(b={},_defineProperty(b,"tw-badge-border-".concat(i),i),_defineProperty(b,"tw-badge-".concat(g),g),b),e);return/*#__PURE__*/_jsxs("div",{className:k,children:[/*#__PURE__*/_jsx("div",{className:"tw-badge__children",children:j}),/*#__PURE__*/_jsx("div",{className:"tw-badge__content",children:c})]})};export default Badge;
@@ -1,2 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["block","children","className","disabled","htmlType","loading","priority","size","type"];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 PropTypes from"prop-types";import classNames from"classnames";import requiredIf from"react-required-if";import{Size,ControlType,Priority}from"../common";import{establishNewPriority,establishNewType,logDeprecationNotices}from"./legacyUtils";import{typeClassMap,priorityClassMap}from"./classMap";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Button=function(a){var b=a.block,c=a.children,d=a.className,e=a.disabled,f=a.htmlType,g=a.loading,h=a.priority,i=a.size,j=a.type,k=_objectWithoutProperties(a,_excluded);logDeprecationNotices(a);var l=establishNewType(j),m=establishNewPriority(h,j),n=classNames("btn btn-".concat(i),"np-btn np-btn-".concat(i),{"btn-loading":g,"btn-block np-btn-block":b},typeClassMap[l],priorityClassMap[m],d);return/*#__PURE__*/ (/* eslint-disable react/button-has-type */_jsxs("button",_objectSpread(_objectSpread({type:f,className:n,disabled:e||g},k),{},{children:[c,g&&/*#__PURE__*/_jsx("span",{className:classNames("btn-loader",{"m-l-2":!b})})]})))};Button.propTypes={block:PropTypes.bool,children:PropTypes.node.isRequired,className:PropTypes.string,disabled:PropTypes.bool,htmlType:PropTypes.oneOf(["submit","reset","button"]),loading:PropTypes.bool,// eslint-disable-next-line
2
- onClick:requiredIf(PropTypes.func,function(a){return"submit"!==a.htmlType}),priority:PropTypes.oneOf(["primary","secondary","tertiary"]),/** @deprecated `primary`, `pay`, `secondary`, `danger`, `link` */type:PropTypes.oneOf(["accent","positive","negative","primary","pay","secondary","danger","link"]),/** @deprecated `xs` */size:PropTypes.oneOf(["xs","sm","md","lg"])},Button.defaultProps={block:!1,className:null,disabled:!1,htmlType:"button",loading:!1,priority:Priority.PRIMARY,size:Size.MEDIUM,type:ControlType.ACCENT};export default Button;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["block","children","className","disabled","htmlType","loading","priority","size","type"];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 requiredIf from"react-required-if";import{Size,ControlType,Priority}from"../common";import{typeClassMap,priorityClassMap}from"./classMap";import{establishNewPriority,establishNewType,logDeprecationNotices}from"./legacyUtils";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Button=function(a){var b=a.block,c=a.children,d=a.className,e=a.disabled,f=a.htmlType,g=a.loading,h=a.priority,i=a.size,j=a.type,k=_objectWithoutProperties(a,_excluded);logDeprecationNotices(a);var l=establishNewType(j),m=establishNewPriority(h,j),n=classNames("btn btn-".concat(i),"np-btn np-btn-".concat(i),{"btn-loading":g,"btn-block np-btn-block":b},typeClassMap[l],priorityClassMap[m],d);return/*#__PURE__*/ (/* eslint-disable react/button-has-type */_jsxs("button",_objectSpread(_objectSpread({type:f,className:n,disabled:e||g},k),{},{children:[c,g&&/*#__PURE__*/_jsx("span",{className:classNames("btn-loader",{"m-l-2":!b})})]})))};Button.propTypes={block:PropTypes.bool,children:PropTypes.node.isRequired,className:PropTypes.string,disabled:PropTypes.bool,htmlType:PropTypes.oneOf(["submit","reset","button"]),loading:PropTypes.bool,onClick:requiredIf(PropTypes.func,function(a){return"submit"!==a.htmlType}),priority:PropTypes.oneOf(["primary","secondary","tertiary"]),/** @deprecated `primary`, `pay`, `secondary`, `danger`, `link` */type:PropTypes.oneOf(["accent","positive","negative","primary","pay","secondary","danger","link"]),/** @deprecated `xs` */size:PropTypes.oneOf(["xs","sm","md","lg"])},Button.defaultProps={block:!1,className:null,disabled:!1,htmlType:"button",loading:!1,priority:Priority.PRIMARY,size:Size.MEDIUM,type:ControlType.ACCENT};export default Button;
@@ -1,5 +1,2 @@
1
- import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["as","isExpanded","title","details","children","onClick","icon","id","className"];import{forwardRef}from"react";import PropTypes from"prop-types";import requiredIf from"react-required-if";import classNames from"classnames";import{Position,Key}from"../common";import Chevron from"../chevron";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Card=/*#__PURE__*/forwardRef(function(a,b){var c=a.as,d=a.isExpanded,e=a.title,f=a.details,g=a.children,h=a.onClick,i=a.icon,j=a.id,k=a.className,l=_objectWithoutProperties(a,_excluded),m=!!(d&&g),n=[Key.ENTER].concat(_toConsumableArray(Key.SPACE));return/*#__PURE__*/_jsxs(c,{className:classNames("tw-card list-group-item p-a-0",k,{active:m}),id:j,"data-testid":l["data-testid"],ref:b,children:[/*#__PURE__*/_jsx("div",{"aria-expanded":d,className:classNames("p-a-panel tw-card__panel",{"tw-card__panel--inactive":!g}),role:g?"button":null,onClick:function onClick(){return g&&h(!d)}// TODO: Consider renaming to onExpand as Card can be expanded with keyboard
2
- // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
3
- ,tabIndex:g?0:void 0,onKeyDown:function onKeyDown(a){n.includes(a.key)&&g&&(a.preventDefault(),h(!d))},children:/*#__PURE__*/_jsx(Option,{as:"div",media:i,title:e,content:f,decision:!1,button:g&&/*#__PURE__*/_jsx(Chevron,{orientation:m?Position.TOP:Position.DOWN}),inverseMediaCircle:m})}),m&&/*#__PURE__*/_jsx("div",{className:"p-l-panel p-r-panel p-b-panel tw-card__content",children:/*#__PURE__*/_jsxs("div",{className:"media",children:[/*#__PURE__*/_jsx("div",{className:"media-left",children:/*#__PURE__*/_jsx("div",{className:"circle circle-sm circle-inverse circle-responsive invisible"})}),/*#__PURE__*/_jsxs("div",{className:"media-body",children:[/*#__PURE__*/_jsx("hr",{className:"m-t-0 hidden-xs hidden-sm"}),/*#__PURE__*/_jsx("div",{children:g})]})]})})]})}),hasChildren=function(a){var b=a.children;return b};Card.propTypes={as:PropTypes.string,// eslint-disable-next-line
4
- isExpanded:requiredIf(PropTypes.bool,hasChildren),title:PropTypes.node.isRequired,details:PropTypes.node.isRequired,// eslint-disable-next-line
5
- onClick:requiredIf(PropTypes.func,hasChildren),icon:PropTypes.node.isRequired,children:PropTypes.node,id:PropTypes.string,className:PropTypes.string,"data-testid":PropTypes.string},Card.defaultProps={as:"div",children:null,id:null,className:null,"data-testid":null};export default Card;
1
+ import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["as","isExpanded","title","details","children","onClick","icon","id","className"];import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef}from"react";import requiredIf from"react-required-if";import Chevron from"../chevron";import{Position,Key}from"../common";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Card=/*#__PURE__*/forwardRef(function(a,b){var c=a.as,d=a.isExpanded,e=a.title,f=a.details,g=a.children,h=a.onClick,i=a.icon,j=a.id,k=a.className,l=_objectWithoutProperties(a,_excluded),m=!!(d&&g),n=new Set([Key.ENTER].concat(_toConsumableArray(Key.SPACE)));return/*#__PURE__*/_jsxs(c,{ref:b,className:classNames("tw-card list-group-item p-a-0",k,{active:m}),id:j,"data-testid":l["data-testid"],children:[/*#__PURE__*/_jsx("div",{"aria-expanded":d,className:classNames("p-a-panel tw-card__panel",{"tw-card__panel--inactive":!g}),role:g?"button":null,tabIndex:g?0:void 0,onClick:function onClick(){return g&&h(!d)}// TODO: Consider renaming to onExpand as Card can be expanded with keyboard
2
+ ,onKeyDown:function onKeyDown(a){n.has(a.key)&&g&&(a.preventDefault(),h(!d))},children:/*#__PURE__*/_jsx(Option,{as:"div",media:i,title:e,content:f,decision:!1,button:g&&/*#__PURE__*/_jsx(Chevron,{orientation:m?Position.TOP:Position.DOWN}),inverseMediaCircle:m})}),m&&/*#__PURE__*/_jsx("div",{className:"p-l-panel p-r-panel p-b-panel tw-card__content",children:/*#__PURE__*/_jsxs("div",{className:"media",children:[/*#__PURE__*/_jsx("div",{className:"media-left",children:/*#__PURE__*/_jsx("div",{className:"circle circle-sm circle-inverse circle-responsive invisible"})}),/*#__PURE__*/_jsxs("div",{className:"media-body",children:[/*#__PURE__*/_jsx("hr",{className:"m-t-0 hidden-xs hidden-sm"}),/*#__PURE__*/_jsx("div",{children:g})]})]})})]})}),hasChildren=function(a){var b=a.children;return b};Card.propTypes={as:PropTypes.string,isExpanded:requiredIf(PropTypes.bool,hasChildren),title:PropTypes.node.isRequired,details:PropTypes.node.isRequired,onClick:requiredIf(PropTypes.func,hasChildren),icon:PropTypes.node.isRequired,children:PropTypes.node,id:PropTypes.string,className:PropTypes.string,"data-testid":PropTypes.string},Card.defaultProps={as:"div",children:null,id:null,className:null,"data-testid":null};export default Card;
@@ -1 +1 @@
1
- import PropTypes from"prop-types";import classNames from"classnames";import CheckboxButton from"../checkboxButton";import{useDirection}from"../common/hooks";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Checkbox=function(a){var b=a.id,c=a.checked,d=a.required,e=a.disabled,f=a.readOnly,g=a.label,h=a.secondary,i=a.onChange,j=a.onFocus,k=a.onBlur,l=useDirection(),m=l.isRTL,n=d&&!e&&!f&&!c,o=classNames("np-checkbox",{checkbox:!0,"checkbox-lg":h,"has-error":n,disabled:e});return/*#__PURE__*/_jsx("div",{id:b,className:o,children:/*#__PURE__*/_jsxs("label",{children:[/*#__PURE__*/_jsx(CheckboxButton,{className:classNames({"has-error":n,"p-r-2":!m,"p-l-2":m}),checked:c,onFocus:j,onChange:function onChange(){return i(!c)},onBlur:k,disabled:e||f}),/*#__PURE__*/_jsxs("span",{className:"np-checkbox__text",children:[g,d&&"*",h&&/*#__PURE__*/_jsx("small",{children:h})]})]})})};Checkbox.propTypes={id:PropTypes.string,checked:PropTypes.bool,required:PropTypes.bool,disabled:PropTypes.bool,readOnly:PropTypes.bool,label:PropTypes.node.isRequired,secondary:PropTypes.string,onFocus:PropTypes.func,onChange:PropTypes.func.isRequired,onBlur:PropTypes.func},Checkbox.defaultProps={id:null,checked:!1,required:!1,disabled:!1,readOnly:!1,secondary:null,onFocus:null,onBlur:null};export default Checkbox;
1
+ import classNames from"classnames";import PropTypes from"prop-types";import CheckboxButton from"../checkboxButton";import{useDirection}from"../common/hooks";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Checkbox=function(a){var b=a.id,c=a.checked,d=a.required,e=a.disabled,f=a.readOnly,g=a.label,h=a.secondary,i=a.onChange,j=a.onFocus,k=a.onBlur,l=useDirection(),m=l.isRTL,n=d&&!e&&!f&&!c,o=classNames("np-checkbox",{checkbox:!0,"checkbox-lg":h,"has-error":n,disabled:e});return/*#__PURE__*/_jsx("div",{id:b,className:o,children:/*#__PURE__*/_jsxs("label",{children:[/*#__PURE__*/_jsx(CheckboxButton,{className:classNames({"has-error":n,"p-r-2":!m,"p-l-2":m}),checked:c,disabled:e||f,onFocus:j,onChange:function onChange(){return i(!c)},onBlur:k}),/*#__PURE__*/_jsxs("span",{className:"np-checkbox__text",children:[g,d&&"*",h&&/*#__PURE__*/_jsx("small",{children:h})]})]})})};Checkbox.propTypes={id:PropTypes.string,checked:PropTypes.bool,required:PropTypes.bool,disabled:PropTypes.bool,readOnly:PropTypes.bool,label:PropTypes.node.isRequired,secondary:PropTypes.string,onFocus:PropTypes.func,onChange:PropTypes.func.isRequired,onBlur:PropTypes.func},Checkbox.defaultProps={id:null,checked:!1,required:!1,disabled:!1,readOnly:!1,secondary:null,onFocus:null,onBlur:null};export default Checkbox;
@@ -1 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["checked","className","disabled","onChange"];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 PropTypes from"prop-types";import classNames from"classnames";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var CheckboxButton=function(a){var b=a.checked,c=a.className,d=a.disabled,e=a.onChange,f=_objectWithoutProperties(a,_excluded);return/*#__PURE__*/_jsxs("span",{className:classNames("np-checkbox-button",c),children:[/*#__PURE__*/_jsx("input",_objectSpread(_objectSpread({},f),{},{type:"checkbox",disabled:d,checked:b,onChange:e})),/*#__PURE__*/_jsx("span",{className:"tw-checkbox-button",children:/*#__PURE__*/_jsx("span",{className:"tw-checkbox-check"})})]})};CheckboxButton.propTypes={/* Provide this if the CheckboxButton is being used without a label */"aria-label":PropTypes.string,checked:PropTypes.bool,className:PropTypes.string,disabled:PropTypes.bool,onChange:PropTypes.func.isRequired},CheckboxButton.defaultProps={"aria-label":void 0,checked:!1,className:void 0,disabled:!1};export default CheckboxButton;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["checked","className","disabled","onChange"];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{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var CheckboxButton=function(a){var b=a.checked,c=a.className,d=a.disabled,e=a.onChange,f=_objectWithoutProperties(a,_excluded);return/*#__PURE__*/_jsxs("span",{className:classNames("np-checkbox-button",c),children:[/*#__PURE__*/_jsx("input",_objectSpread(_objectSpread({},f),{},{type:"checkbox",disabled:d,checked:b,onChange:e})),/*#__PURE__*/_jsx("span",{className:"tw-checkbox-button",children:/*#__PURE__*/_jsx("span",{className:"tw-checkbox-check"})})]})};CheckboxButton.propTypes={/* Provide this if the CheckboxButton is being used without a label */"aria-label":PropTypes.string,checked:PropTypes.bool,className:PropTypes.string,disabled:PropTypes.bool,onChange:PropTypes.func.isRequired},CheckboxButton.defaultProps={"aria-label":void 0,checked:!1,className:void 0,disabled:!1};export default CheckboxButton;
@@ -1 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import PropTypes from"prop-types";import Option from"../common/Option";import CheckboxButton from"../checkboxButton";import{jsx as _jsx}from"react/jsx-runtime";var CheckboxOption=function(a){var b=a.media,c=a.title,d=a.content,e=a.name,f=a.checked,g=a.onChange,h=a.complex,i=a.disabled,j=a.showMediaAtAllSizes;return/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},{media:b,title:c,content:d,name:e,complex:h,disabled:i,showMediaAtAllSizes:j}),{},{button:/*#__PURE__*/_jsx(CheckboxButton,{checked:f,disabled:i,onChange:function onChange(){return g(!f)}})}))};CheckboxOption.propTypes={checked:PropTypes.bool,complex:PropTypes.bool,content:PropTypes.node,disabled:PropTypes.bool,id:PropTypes.string,media:PropTypes.node,name:PropTypes.string.isRequired,onChange:PropTypes.func.isRequired,title:PropTypes.node.isRequired,showMediaAtAllSizes:PropTypes.bool},CheckboxOption.defaultProps={checked:!1,complex:!1,content:null,disabled:!1,id:void 0,media:null,showMediaAtAllSizes:!1};export default CheckboxOption;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import PropTypes from"prop-types";import CheckboxButton from"../checkboxButton";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";var CheckboxOption=function(a){var b=a.media,c=a.title,d=a.content,e=a.name,f=a.checked,g=a.onChange,h=a.complex,i=a.disabled,j=a.showMediaAtAllSizes;return/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},{media:b,title:c,content:d,name:e,complex:h,disabled:i,showMediaAtAllSizes:j}),{},{button:/*#__PURE__*/_jsx(CheckboxButton,{checked:f,disabled:i,onChange:function onChange(){return g(!f)}})}))};CheckboxOption.propTypes={checked:PropTypes.bool,complex:PropTypes.bool,content:PropTypes.node,disabled:PropTypes.bool,id:PropTypes.string,media:PropTypes.node,name:PropTypes.string.isRequired,onChange:PropTypes.func.isRequired,title:PropTypes.node.isRequired,showMediaAtAllSizes:PropTypes.bool},CheckboxOption.defaultProps={checked:!1,complex:!1,content:null,disabled:!1,id:void 0,media:null,showMediaAtAllSizes:!1};export default CheckboxOption;
@@ -1 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";var _CONTAINER_SIZE;import PropTypes from"prop-types";import classNames from"classnames";import{ChevronUp}from"@transferwise/icons";import{Size,Position}from"../common";import{jsx as _jsx}from"react/jsx-runtime";var CONTAINER_SIZE=(_CONTAINER_SIZE={},_defineProperty(_CONTAINER_SIZE,Size.EXTRA_SMALL,10),_defineProperty(_CONTAINER_SIZE,Size.SMALL,16),_defineProperty(_CONTAINER_SIZE,Size.MEDIUM,24),_CONTAINER_SIZE),ExtraSmallChevron=function(a){var b=a.className;return/*#__PURE__*/_jsx("span",{className:classNames("tw-icon","tw-icon-chevron",b),role:"presentation","aria-hidden":!0,children:/*#__PURE__*/_jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",focusable:"false",children:/*#__PURE__*/_jsx("path",{fillRule:"evenodd",d:"M4.9995 2.0865L0.0635004 6.7645L1.2745 7.9125L4.9995 4.3835L8.7245 7.9135L9.9355 6.7645L4.9995 2.0865Z"})})})};ExtraSmallChevron.propTypes={className:PropTypes.string},ExtraSmallChevron.defaultProps={className:null};var Chevron=function(a){var b=a.orientation,c=a.size,d=a.disabled,e=a.className,f=classNames("tw-chevron",{"chevron-color":!d},"".concat([b]).toLowerCase(),e),g=CONTAINER_SIZE[c];return c===Size.EXTRA_SMALL?/*#__PURE__*/_jsx(ExtraSmallChevron,{className:f}):/*#__PURE__*/_jsx(ChevronUp,{className:f,size:g})};Chevron.propTypes={orientation:PropTypes.oneOf(["top","bottom","left","right"]),size:PropTypes.oneOf(["xs","sm","md"]),disabled:PropTypes.bool,className:PropTypes.string},Chevron.defaultProps={orientation:Position.BOTTOM,size:Size.SMALL,disabled:!1,className:null};export default Chevron;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";var _CONTAINER_SIZE;import{ChevronUp}from"@transferwise/icons";import classNames from"classnames";import PropTypes from"prop-types";import{Size,Position}from"../common";import{jsx as _jsx}from"react/jsx-runtime";var CONTAINER_SIZE=(_CONTAINER_SIZE={},_defineProperty(_CONTAINER_SIZE,Size.EXTRA_SMALL,10),_defineProperty(_CONTAINER_SIZE,Size.SMALL,16),_defineProperty(_CONTAINER_SIZE,Size.MEDIUM,24),_CONTAINER_SIZE),ExtraSmallChevron=function(a){var b=a.className;return/*#__PURE__*/_jsx("span",{className:classNames("tw-icon","tw-icon-chevron",b),role:"presentation","aria-hidden":!0,children:/*#__PURE__*/_jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",focusable:"false",children:/*#__PURE__*/_jsx("path",{fillRule:"evenodd",d:"M4.9995 2.0865L0.0635004 6.7645L1.2745 7.9125L4.9995 4.3835L8.7245 7.9135L9.9355 6.7645L4.9995 2.0865Z"})})})};ExtraSmallChevron.propTypes={className:PropTypes.string},ExtraSmallChevron.defaultProps={className:null};var Chevron=function(a){var b=a.orientation,c=a.size,d=a.disabled,e=a.className,f=classNames("tw-chevron",{"chevron-color":!d},"".concat([b]).toLowerCase(),e),g=CONTAINER_SIZE[c];return c===Size.EXTRA_SMALL?/*#__PURE__*/_jsx(ExtraSmallChevron,{className:f}):/*#__PURE__*/_jsx(ChevronUp,{className:f,size:g})};Chevron.propTypes={orientation:PropTypes.oneOf(["top","bottom","left","right"]),size:PropTypes.oneOf(["xs","sm","md"]),disabled:PropTypes.bool,className:PropTypes.string},Chevron.defaultProps={orientation:Position.BOTTOM,size:Size.SMALL,disabled:!1,className:null};export default Chevron;
@@ -1,5 +1,11 @@
1
- import classNames from"classnames";import{Cross as CrossIcon}from"@transferwise/icons";import{useDirection}from"../common/hooks";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";/**
1
+ import{Cross as CrossIcon}from"@transferwise/icons";import classNames from"classnames";import{useDirection}from"../common/hooks";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";/**
2
2
  * `Chip` component
3
3
  *
4
4
  * Docs link: https://transferwise.github.io/neptune-web/components/internal/Chip
5
- */export default function Chip(a){var b=a.label,c=a.onRemove,d=a.hasError,e=a.className,f=void 0===e?void 0:e,g=useDirection(),h=g.isRTL;return/*#__PURE__*/_jsxs("div",{className:classNames("chip","d-inline-flex","align-items-center","m-t-1",{"has-error":void 0!==d&&d,"p-r-1 p-l-2":!h,"p-l-1 p-r-2":h},f),children:[b,/*#__PURE__*/_jsx("button",{type:"button",className:classNames("btn-unstyled chip-remove",{"m-l-2":!h,"m-r-2":h}),onClick:c,children:/*#__PURE__*/_jsx(CrossIcon,{})})]})}
5
+ *
6
+ * @param root0
7
+ * @param root0.label
8
+ * @param root0.onRemove
9
+ * @param root0.hasError
10
+ * @param root0.className
11
+ */var Chip=function(a){var b=a.label,c=a.onRemove,d=a.hasError,e=a.className,f=void 0===e?void 0:e,g=useDirection(),h=g.isRTL;return/*#__PURE__*/_jsxs("div",{className:classNames("chip","d-inline-flex","align-items-center","m-t-1",{"has-error":void 0!==d&&d,"p-r-1 p-l-2":!h,"p-l-1 p-r-2":h},f),children:[b,/*#__PURE__*/_jsx("button",{type:"button",className:classNames("btn-unstyled chip-remove",{"m-l-2":!h,"m-r-2":h}),onClick:c,children:/*#__PURE__*/_jsx(CrossIcon,{})})]})};export default Chip;
@@ -1 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","children","disabled","icon","priority","type"];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{cloneElement}from"react";import PropTypes from"prop-types";import classNames from"classnames";import{ControlType,Priority}from"../common";import{typeClassMap,priorityClassMap}from"../button/classMap";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var CircularButton=function(a){var b=a.className,c=a.children,d=a.disabled,e=a.icon,f=a.priority,g=a.type,h=_objectWithoutProperties(a,_excluded),i=classNames("btn np-btn",typeClassMap[g],priorityClassMap[f]),j=24===e.props.size?e:/*#__PURE__*/cloneElement(e,{size:24});return/*#__PURE__*/_jsxs("label",{className:classNames("np-circular-btn",f,g,d?"disabled":"",b),children:[/*#__PURE__*/_jsx("input",_objectSpread({type:"button","aria-label":c,className:i,disabled:d},h)),j,/*#__PURE__*/_jsx("span",{className:"np-circular-btn__label",children:c})]})};CircularButton.propTypes={className:PropTypes.string,children:PropTypes.string.isRequired,disabled:PropTypes.bool,icon:PropTypes.element.isRequired,onClick:PropTypes.func.isRequired,priority:PropTypes.oneOf(["primary","secondary"]),type:PropTypes.oneOf(["accent","positive","negative"])},CircularButton.defaultProps={className:void 0,disabled:!1,priority:Priority.PRIMARY,type:ControlType.ACCENT};export default CircularButton;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","children","disabled","icon","priority","type"];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{cloneElement}from"react";import{typeClassMap,priorityClassMap}from"../button/classMap";import{ControlType,Priority}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var CircularButton=function(a){var b=a.className,c=a.children,d=a.disabled,e=a.icon,f=a.priority,g=a.type,h=_objectWithoutProperties(a,_excluded),i=classNames("btn np-btn",typeClassMap[g],priorityClassMap[f]),j=24===e.props.size?e:/*#__PURE__*/cloneElement(e,{size:24});return/*#__PURE__*/_jsxs("label",{className:classNames("np-circular-btn",f,g,d?"disabled":"",b),children:[/*#__PURE__*/_jsx("input",_objectSpread({type:"button","aria-label":c,className:i,disabled:d},h)),j,/*#__PURE__*/_jsx("span",{className:"np-circular-btn__label",children:c})]})};CircularButton.propTypes={className:PropTypes.string,children:PropTypes.string.isRequired,disabled:PropTypes.bool,icon:PropTypes.element.isRequired,onClick:PropTypes.func.isRequired,priority:PropTypes.oneOf(["primary","secondary"]),type:PropTypes.oneOf(["accent","positive","negative"])},CircularButton.defaultProps={className:void 0,disabled:!1,priority:Priority.PRIMARY,type:ControlType.ACCENT};export default CircularButton;
@@ -1 +1 @@
1
- import PropTypes from"prop-types";import classNames from"classnames";import requiredIf from"react-required-if";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Option=function(a){var b=a.as,c=a.href,d=a.target,e=a.media,f=a.title,g=a.content,h=a.onClick,i=a.htmlFor,j=a.disabled,k=a.button,l=a.decision,m=a.complex,n=a.className,o=a.inverseMediaCircle,p=a.showMediaAtAllSizes,q=a.showMediaCircle;return/*#__PURE__*/_jsxs(b,{className:classNames(n,"media",{"decision-complex":m,decision:l,disabled:j,"tw-option__sm-media":p}),href:c,onClick:h,htmlFor:i,target:d,disabled:j&&"button"===b,children:[e&&/*#__PURE__*/_jsx("div",{className:"media-left",children:q?/*#__PURE__*/_jsx("div",{className:classNames("circle circle-sm text-primary",{"circle-inverse":o}),children:e}):/*#__PURE__*/_jsx("div",{className:"tw-option__no-media-circle",children:e})}),/*#__PURE__*/_jsxs("div",{className:"media-body",children:[/*#__PURE__*/_jsx("div",{className:"h5",children:f}),g&&/*#__PURE__*/_jsx("div",{className:"decision__content",children:g})]}),/*#__PURE__*/_jsx("div",{className:"media-right",children:k})]})};Option.propTypes={media:PropTypes.node,htmlFor:PropTypes.string,title:PropTypes.node.isRequired,content:PropTypes.node,onClick:PropTypes.func,href:requiredIf(PropTypes.string,function(a){return"a"===a.as}),target:PropTypes.oneOf(["_self","_blank","_parent","_top"]),as:PropTypes.string,disabled:PropTypes.bool,button:PropTypes.node,decision:PropTypes.bool,complex:PropTypes.bool,inverseMediaCircle:PropTypes.bool,className:PropTypes.string,showMediaAtAllSizes:PropTypes.bool,showMediaCircle:PropTypes.bool},Option.defaultProps={as:"label",media:"",content:null,htmlFor:null,disabled:!1,button:null,onClick:null,href:null,target:void 0,decision:!0,complex:!1,inverseMediaCircle:!0,className:null,showMediaAtAllSizes:!1,showMediaCircle:!0};export default Option;
1
+ import classNames from"classnames";import PropTypes from"prop-types";import requiredIf from"react-required-if";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Option=function(a){var b=a.as,c=a.href,d=a.target,e=a.media,f=a.title,g=a.content,h=a.onClick,i=a.htmlFor,j=a.disabled,k=a.button,l=a.decision,m=a.complex,n=a.className,o=a.inverseMediaCircle,p=a.showMediaAtAllSizes,q=a.showMediaCircle;return/*#__PURE__*/_jsxs(b,{className:classNames(n,"media",{"decision-complex":m,decision:l,disabled:j,"tw-option__sm-media":p}),href:c,htmlFor:i,target:d,disabled:j&&"button"===b,onClick:h,children:[e&&/*#__PURE__*/_jsx("div",{className:"media-left",children:q?/*#__PURE__*/_jsx("div",{className:classNames("circle circle-sm text-primary",{"circle-inverse":o}),children:e}):/*#__PURE__*/_jsx("div",{className:"tw-option__no-media-circle",children:e})}),/*#__PURE__*/_jsxs("div",{className:"media-body",children:[/*#__PURE__*/_jsx("div",{className:"h5",children:f}),g&&/*#__PURE__*/_jsx("div",{className:"decision__content",children:g})]}),/*#__PURE__*/_jsx("div",{className:"media-right",children:k})]})};Option.propTypes={media:PropTypes.node,htmlFor:PropTypes.string,title:PropTypes.node.isRequired,content:PropTypes.node,onClick:PropTypes.func,href:requiredIf(PropTypes.string,function(a){return"a"===a.as}),target:PropTypes.oneOf(["_self","_blank","_parent","_top"]),as:PropTypes.string,disabled:PropTypes.bool,button:PropTypes.node,decision:PropTypes.bool,complex:PropTypes.bool,inverseMediaCircle:PropTypes.bool,className:PropTypes.string,showMediaAtAllSizes:PropTypes.bool,showMediaCircle:PropTypes.bool},Option.defaultProps={as:"label",media:"",content:null,htmlFor:null,disabled:!1,button:null,onClick:null,href:null,target:void 0,decision:!0,complex:!1,inverseMediaCircle:!0,className:null,showMediaAtAllSizes:!1,showMediaCircle:!0};export default Option;
@@ -0,0 +1 @@
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";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}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{FastFlag as FastFlagIcon}from"@transferwise/icons";import PropTypes from"prop-types";import{Component}from"react";import{Checkbox}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";var OptionDocumentation=/*#__PURE__*/function(a){function b(){var a;return _classCallCheck(this,b),a=c.call(this),a.state={complex:!1,disabled:!1,hasMedia:!0},a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"createStateLink",value:function createStateLink(a){var b=this;return function(c){return b.setState(_defineProperty({},a,c))}}},{key:"render",value:function render(){var a,b=this.props,c=b.type,d=b.Option,e=b.name,f=b.callbackName,g=b.callback,h=b.callbackString,i=b.propName,j=b.propValue,k=b.title,l=b.content,m=b.extra,n=this.state,o=n.complex,p=n.disabled,q=n.hasMedia;return/*#__PURE__*/_jsx("div",{className:"container",id:"".concat(c,"-option-docs"),children:/*#__PURE__*/_jsxs("div",{className:"section",children:[/*#__PURE__*/_jsxs("div",{className:"row",children:[/*#__PURE__*/_jsxs("div",{className:"col-md-6",children:[/*#__PURE__*/_jsx("h2",{children:k}),/*#__PURE__*/_jsx("p",{children:l})]}),/*#__PURE__*/_jsx("div",{className:"col-md-6",children:/*#__PURE__*/_jsx(d,_objectSpread({id:"".concat(c,"-option"),name:"".concat(c,"-option"),title:k,content:getContentForComplexState(o),complex:o,disabled:p,media:q?/*#__PURE__*/_jsx(FastFlagIcon,{}):void 0},(a={},_defineProperty(a,i,j),_defineProperty(a,f,g),a)))})]}),/*#__PURE__*/_jsxs("div",{className:"row m-t-5",children:[/*#__PURE__*/_jsxs("div",{className:"col-md-6",children:[/*#__PURE__*/_jsx(function Code(){return/*#__PURE__*/_jsx(_Fragment,{children:/*#__PURE__*/_jsx("pre",{className:"tw-docs-code",children:"<".concat(e,"\n id=\"").concat(c,"-option\"\n name=\"").concat(c,"-option\"\n title=\"").concat(k,"\"\n content=\"").concat(getContentForComplexState(o),"\"").concat(boolProperty(i,j)).concat(boolProperty("complex",o)).concat(boolProperty("disabled",p),"\n ").concat(f,"={").concat(h,"}").concat(q?"\n media={<FastFlagIcon />}":"","\n/>")})})},{}),m]}),/*#__PURE__*/_jsxs("div",{className:"col-md-6",children:[/*#__PURE__*/_jsxs("div",{className:"row",children:[/*#__PURE__*/_jsx("div",{className:"col-md-6",children:/*#__PURE__*/_jsx(Checkbox,{id:"".concat(c,"-option-complex"),label:"Complex",checked:o,onChange:this.createStateLink("complex")})}),/*#__PURE__*/_jsx("div",{className:"col-md-6 m-b-0",children:/*#__PURE__*/_jsx(Checkbox,{id:"".concat(c,"-option-disabled"),label:"Disabled",checked:p,onChange:this.createStateLink("disabled")})})]}),/*#__PURE__*/_jsx("div",{className:"row m-t-2",children:/*#__PURE__*/_jsx("div",{className:"col-md-6",children:/*#__PURE__*/_jsx(Checkbox,{id:"".concat(c,"-option-media"),label:"Has media",checked:q,onChange:this.createStateLink("hasMedia")})})})]})]})]})})}}]),b}(Component);function getContentForComplexState(a){return a?"Complex items should be used for items with long descriptions. Their button and media will be aligned to the top.":"Normally, the button and icon are vertically centered."}function boolProperty(a,b){return b?"\n ".concat(a):""}OptionDocumentation.propTypes={type:PropTypes.string.isRequired,Option:PropTypes.func.isRequired,name:PropTypes.string.isRequired,callbackName:PropTypes.string.isRequired,callback:PropTypes.func.isRequired,callbackString:PropTypes.string.isRequired,propName:PropTypes.string,propValue:PropTypes.bool,title:PropTypes.string.isRequired,content:PropTypes.string.isRequired,extra:PropTypes.string},OptionDocumentation.defaultProps={propName:null,propValue:!1,extra:""};export default OptionDocumentation;
@@ -1 +1 @@
1
- import PropTypes from"prop-types";import classNames from"classnames";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var RadioButton=function(a){var b=a.id,c=a.value,d=a.name,e=a.checked,f=a.onChange,g=a.disabled,h=a.readOnly;return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("input",{type:"radio",className:"sr-only",id:b,value:c,name:d,checked:e,onChange:function onChange(){return e?null:f(c)},disabled:g||h}),/*#__PURE__*/_jsx("span",{className:classNames("tw-radio-button",{checked:e,disabled:g||h}),children:/*#__PURE__*/_jsx("span",{className:"tw-radio-check"})})]})};RadioButton.propTypes={id:PropTypes.string,name:PropTypes.string.isRequired,checked:PropTypes.bool,onChange:PropTypes.func,disabled:PropTypes.bool,value:PropTypes.oneOfType([PropTypes.number,PropTypes.string]),readOnly:PropTypes.bool},RadioButton.defaultProps={checked:!1,onChange:function onChange(){},disabled:!1,id:null,value:"",readOnly:!1};export default RadioButton;
1
+ import classNames from"classnames";import PropTypes from"prop-types";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var RadioButton=function(a){var b=a.id,c=a.value,d=a.name,e=a.checked,f=a.onChange,g=a.disabled,h=a.readOnly;return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("input",{type:"radio",className:"sr-only",id:b,value:c,name:d,checked:e,disabled:g||h,onChange:function onChange(){return e?null:f(c)}}),/*#__PURE__*/_jsx("span",{className:classNames("tw-radio-button",{checked:e,disabled:g||h}),children:/*#__PURE__*/_jsx("span",{className:"tw-radio-check"})})]})};RadioButton.propTypes={id:PropTypes.string,name:PropTypes.string.isRequired,checked:PropTypes.bool,onChange:PropTypes.func,disabled:PropTypes.bool,value:PropTypes.oneOfType([PropTypes.number,PropTypes.string]),readOnly:PropTypes.bool},RadioButton.defaultProps={checked:!1,onChange:function onChange(){},disabled:!1,id:null,value:"",readOnly:!1};export default RadioButton;
@@ -1,12 +1,10 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import{useRef,useState}from"react";import classNames from"classnames";import Dimmer from"../../dimmer";import SlidingPanel from"../../slidingPanel";import CloseButton from"../closeButton";import{isServerSideRendering}from"../domHelpers";import{useConditionalListener}from"../hooks";import{Position}from"../propsValues/position";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var INITIAL_Y_POSITION=0,CONTENT_SCROLL_THRESHOLD=1,MOVE_OFFSET_THRESHOLD=50;/**
2
- * Neptune: https://transferwise.github.io/neptune/components/bottom-sheet/
3
- *
4
- * Neptune Web: https://transferwise.github.io/neptune-web/components/overlays/BottomSheet
5
- */function BottomSheet(a){function b(a){null!==g.current&&(g.current.style.transform="translateY(".concat(a,"px)"))}function c(){m(!1),o.current=INITIAL_Y_POSITION,null!==g.current&&g.current.style.removeProperty("transform"),a.onClose&&a.onClose()}function d(){// stop moving component
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import classNames from"classnames";import{useRef,useState}from"react";import Dimmer from"../../dimmer";import SlidingPanel from"../../slidingPanel";import CloseButton from"../closeButton";import{isServerSideRendering}from"../domHelpers";import{useConditionalListener}from"../hooks";import{Position}from"../propsValues/position";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var INITIAL_Y_POSITION=0,CONTENT_SCROLL_THRESHOLD=1,MOVE_OFFSET_THRESHOLD=50,BottomSheet=function(a){function b(a){null!==g.current&&(g.current.style.transform="translateY(".concat(a,"px)"))}function c(){m(!1),o.current=INITIAL_Y_POSITION,null!==g.current&&g.current.style.removeProperty("transform"),a.onClose&&a.onClose()}function d(){// stop moving component
6
2
  cancelAnimationFrame(n.current),m(!1),o.current>MOVE_OFFSET_THRESHOLD&&e()?c():b(INITIAL_Y_POSITION),o.current=INITIAL_Y_POSITION}function e(){var a;return(null===i||void 0===i||null===(a=i.current)||void 0===a?void 0:a.scrollTop)!==void 0&&i.current.scrollTop<=CONTENT_SCROLL_THRESHOLD}/**
7
3
  * Calculates how hard user moves component,
8
4
  * result value used to determine whether to hide component or re-position to default state
5
+ *
6
+ * @param afterMoveYCoordinate
9
7
  */function f(a){return a-p.current}/**
10
8
  * Set `max-height` for content part (in order to keep it scrollable for content overflow cases) of the component
11
9
  * and ensures space for safe zone (32px) at the top.
12
- */var g=useRef(null),h=useRef(null),i=useRef(null),j=useState(!1),k=_slicedToArray(j,2),l=k[0],m=k[1],n=useRef(0),o=useRef(0),p=useRef(0);useConditionalListener({attachListener:a.open&&!isServerSideRendering(),callback:function callback(){if(null!==h.current){var a=h.current.classList;e()?a.remove("np-bottom-sheet--top-bar--shadow"):a.add("np-bottom-sheet--top-bar--shadow")}},eventType:"scroll",parent:isServerSideRendering()?void 0:document});var q=function(a){return function(b){p.current=(a?b.touches[0]:b).clientY,m(!0)}},r=function(a){return function(c){if(l){var d=a?c.touches[0]:c,h=d.clientY,i=f(h);i>INITIAL_Y_POSITION&&e()&&(o.current=i,n.current=requestAnimationFrame(function(){n.current!==void 0&&null!==g.current&&b(i)}))}}};return/*#__PURE__*/_jsx(Dimmer,{open:a.open,onClose:c,fadeContentOnEnter:!0,fadeContentOnExit:!0,children:/*#__PURE__*/_jsxs(SlidingPanel,{open:a.open,position:Position.BOTTOM,ref:g,className:classNames("np-bottom-sheet",a.className),onTouchStart:q(!0),onTouchMove:r(!0),onTouchEnd:d,onMouseDown:q(!1),onMouseMove:r(!1),onMouseUp:d,role:"dialog",children:[/*#__PURE__*/_jsxs("div",{className:"np-bottom-sheet--top-bar",ref:h,children:[/*#__PURE__*/_jsx("div",{className:"np-bottom-sheet--handler"}),/*#__PURE__*/_jsx(CloseButton,{onClick:c,size:16,className:"sr-only np-bottom-sheet--close-btn"})]}),/*#__PURE__*/_jsx("div",{style:function(){var a=isServerSideRendering()?0:window.innerHeight,b="".concat(100*(.01*a),"px");return{maxHeight:"calc(".concat(b," - ").concat("64px"," - ").concat("32px",")")}}(),className:"np-bottom-sheet--content",ref:i,children:a.children})]})})}export default BottomSheet;
10
+ */var g=useRef(null),h=useRef(null),i=useRef(null),j=useState(!1),k=_slicedToArray(j,2),l=k[0],m=k[1],n=useRef(0),o=useRef(0),p=useRef(0);useConditionalListener({attachListener:a.open&&!isServerSideRendering(),callback:function callback(){if(null!==h.current){var a=h.current.classList;e()?a.remove("np-bottom-sheet--top-bar--shadow"):a.add("np-bottom-sheet--top-bar--shadow")}},eventType:"scroll",parent:isServerSideRendering()?void 0:document});var q=function(a){return function(b){p.current=(a?b.touches[0]:b).clientY,m(!0)}},r=function(a){return function(c){if(l){var d=a?c.touches[0]:c,h=d.clientY,i=f(h);i>INITIAL_Y_POSITION&&e()&&(o.current=i,n.current=requestAnimationFrame(function(){n.current!==void 0&&null!==g.current&&b(i)}))}}};return/*#__PURE__*/_jsx(Dimmer,{open:a.open,fadeContentOnEnter:!0,fadeContentOnExit:!0,onClose:c,children:/*#__PURE__*/_jsxs(SlidingPanel,{ref:g,open:a.open,position:Position.BOTTOM,className:classNames("np-bottom-sheet",a.className),role:"dialog",onTouchStart:q(!0),onTouchMove:r(!0),onTouchEnd:d,onMouseDown:q(!1),onMouseMove:r(!1),onMouseUp:d,children:[/*#__PURE__*/_jsxs("div",{ref:h,className:"np-bottom-sheet--top-bar",children:[/*#__PURE__*/_jsx("div",{className:"np-bottom-sheet--handler"}),/*#__PURE__*/_jsx(CloseButton,{size:16,className:"sr-only np-bottom-sheet--close-btn",onClick:c})]}),/*#__PURE__*/_jsx("div",{ref:i,style:function(){var a=isServerSideRendering()?0:window.innerHeight,b="".concat(100*(.01*a),"px");return{maxHeight:"calc(".concat(b," - ").concat("64px"," - ").concat("32px",")")}}(),className:"np-bottom-sheet--content",children:a.children})]})})};export default BottomSheet;
@@ -1 +1 @@
1
- import{forwardRef}from"react";import PropTypes from"prop-types";import classNames from"classnames";import{useIntl}from"react-intl";import{Cross as CrossIcon}from"@transferwise/icons";import messages from"./CloseButton.messages";import{jsx as _jsx}from"react/jsx-runtime";export var CloseButton=/*#__PURE__*/forwardRef(function(a,b){var c=useIntl(),d=a.onClick,e=a.className,f=a.size;return/*#__PURE__*/_jsx("button",{ref:b,type:"button",className:classNames("np-close-button close btn-link text-no-decoration",{"np-close-button--large":f===CloseButton.Size.LARGE},e),"aria-label":c.formatMessage(messages.ariaLabel),onClick:d,children:/*#__PURE__*/_jsx(CrossIcon,{size:f})})});CloseButton.Size={SMALL:16,LARGE:24},CloseButton.propTypes={onClick:PropTypes.func.isRequired,className:PropTypes.string,size:PropTypes.oneOf(Object.values(CloseButton.Size))},CloseButton.defaultProps={className:null,size:CloseButton.Size.LARGE};export default CloseButton;
1
+ import{Cross as CrossIcon}from"@transferwise/icons";import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef}from"react";import{useIntl}from"react-intl";import messages from"./CloseButton.messages";import{jsx as _jsx}from"react/jsx-runtime";export var CloseButton=/*#__PURE__*/forwardRef(function(a,b){var c=useIntl(),d=a.onClick,e=a.className,f=a.size;return/*#__PURE__*/_jsx("button",{ref:b,type:"button",className:classNames("np-close-button close btn-link text-no-decoration",{"np-close-button--large":f===CloseButton.Size.LARGE},e),"aria-label":c.formatMessage(messages.ariaLabel),onClick:d,children:/*#__PURE__*/_jsx(CrossIcon,{size:f})})});CloseButton.Size={SMALL:16,LARGE:24},CloseButton.propTypes={onClick:PropTypes.func.isRequired,className:PropTypes.string,size:PropTypes.oneOf(Object.values(CloseButton.Size))},CloseButton.defaultProps={className:null,size:CloseButton.Size.LARGE};export default CloseButton;