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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (611) hide show
  1. package/build/es/no-polyfill/accordion/Accordion.js +1 -1
  2. package/build/es/no-polyfill/accordion/Accordion.story.js +1 -1
  3. package/build/es/no-polyfill/accordion/AccordionItem/AccordionItem.js +1 -1
  4. package/build/es/no-polyfill/actionButton/ActionButton.js +1 -1
  5. package/build/es/no-polyfill/actionButton/ActionButton.spec.js +1 -1
  6. package/build/es/no-polyfill/actionButton/ActionButton.story.js +1 -1
  7. package/build/es/no-polyfill/actionOption/ActionOption.js +1 -1
  8. package/build/es/no-polyfill/actionOption/ActionOption.story.js +1 -1
  9. package/build/es/no-polyfill/alert/Alert.js +1 -1
  10. package/build/es/no-polyfill/alert/Alert.story.js +1 -1
  11. package/build/es/no-polyfill/alert/inlineMarkdown/InlineMarkdown.js +1 -1
  12. package/build/es/no-polyfill/alert/withArrow/alertArrowPositions.js +1 -1
  13. package/build/es/no-polyfill/alert/withArrow/withArrow.js +1 -1
  14. package/build/es/no-polyfill/avatar/Avatar.js +1 -1
  15. package/build/es/no-polyfill/avatar/Avatar.story.js +1 -1
  16. package/build/es/no-polyfill/avatar/avatarTypes.js +1 -1
  17. package/build/es/no-polyfill/avatar/colors/colors.js +2 -2
  18. package/build/es/no-polyfill/avatarWrapper/AvatarWrapper.js +1 -1
  19. package/build/es/no-polyfill/avatarWrapper/AvatarWrapper.story.js +1 -1
  20. package/build/es/no-polyfill/badge/Badge.js +1 -1
  21. package/build/es/no-polyfill/body/Body.js +2 -2
  22. package/build/es/no-polyfill/body/Body.spec.js +1 -1
  23. package/build/es/no-polyfill/body/Body.story.js +1 -1
  24. package/build/es/no-polyfill/button/Button.js +5 -5
  25. package/build/es/no-polyfill/button/Button.story.js +1 -1
  26. package/build/es/no-polyfill/button/classMap.js +1 -1
  27. package/build/es/no-polyfill/button/legacyUtils/legacyUtils.js +2 -2
  28. package/build/es/no-polyfill/card/Card.js +1 -1
  29. package/build/es/no-polyfill/checkbox/Checkbox.js +1 -1
  30. package/build/es/no-polyfill/checkbox/Checkbox.story.js +1 -1
  31. package/build/es/no-polyfill/checkboxButton/CheckboxButton.js +1 -1
  32. package/build/es/no-polyfill/checkboxButton/CheckboxButton.spec.js +1 -1
  33. package/build/es/no-polyfill/checkboxButton/CheckboxButton.story.js +1 -1
  34. package/build/es/no-polyfill/checkboxOption/CheckboxOption.js +1 -1
  35. package/build/es/no-polyfill/checkboxOption/CheckboxOption.spec.js +1 -1
  36. package/build/es/no-polyfill/checkboxOption/CheckboxOption.story.js +1 -1
  37. package/build/es/no-polyfill/chevron/Chevron.js +1 -1
  38. package/build/es/no-polyfill/chevron/Chevron.story.js +1 -1
  39. package/build/es/no-polyfill/chips/Chip.js +1 -1
  40. package/build/es/no-polyfill/chips/Chips.js +1 -1
  41. package/build/es/no-polyfill/chips/Chips.spec.js +1 -1
  42. package/build/es/no-polyfill/chips/Chips.story.js +1 -1
  43. package/build/es/no-polyfill/circularButton/CircularButton.js +1 -1
  44. package/build/es/no-polyfill/common/DOMOperations/DOMOperations.js +3 -3
  45. package/build/es/no-polyfill/common/Option/Option.js +1 -1
  46. package/build/es/no-polyfill/common/RadioButton/RadioButton.js +1 -1
  47. package/build/es/no-polyfill/common/bottomSheet/BottomSheet.js +4 -4
  48. package/build/es/no-polyfill/common/bottomSheet/BottomSheet.spec.js +1 -1
  49. package/build/es/no-polyfill/common/bottomSheet/BottomSheet.story.js +2 -2
  50. package/build/es/no-polyfill/common/closeButton/CloseButton.js +1 -1
  51. package/build/es/no-polyfill/common/dateUtils/getDayNames/getDayNames.js +2 -2
  52. package/build/es/no-polyfill/common/dateUtils/getMonthNames/getMonthNames.js +1 -1
  53. package/build/es/no-polyfill/common/dateUtils/isDateValid/isDateValid.js +1 -1
  54. package/build/es/no-polyfill/common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.js +1 -1
  55. package/build/es/no-polyfill/common/deviceDetection/deviceDetection.js +1 -1
  56. package/build/es/no-polyfill/common/direction.js +1 -1
  57. package/build/es/no-polyfill/common/domHelpers/index.js +1 -1
  58. package/build/es/no-polyfill/common/fakeEvents.js +1 -1
  59. package/build/es/no-polyfill/common/fileType.js +1 -1
  60. package/build/es/no-polyfill/common/flowHeader/FlowHeader.js +1 -1
  61. package/build/es/no-polyfill/common/focusBoundary/FocusBoundary.js +1 -1
  62. package/build/es/no-polyfill/common/focusBoundary/FocusBoundary.spec.js +1 -1
  63. package/build/es/no-polyfill/common/focusBoundary/utils/getFocusableElements.js +2 -2
  64. package/build/es/no-polyfill/common/focusBoundary/utils/resetFocus.js +1 -1
  65. package/build/es/no-polyfill/common/historyNavigator/historyNavigator.js +1 -1
  66. package/build/es/no-polyfill/common/hooks/useClientWidth/useClientWidth.js +3 -3
  67. package/build/es/no-polyfill/common/hooks/useConditionalListener/useConditionalListener.js +1 -1
  68. package/build/es/no-polyfill/common/hooks/useDirection/useDirection.js +1 -1
  69. package/build/es/no-polyfill/common/hooks/useHasIntersected/useHasIntersected.js +2 -2
  70. package/build/es/no-polyfill/common/hooks/useLayout/useLayout.js +1 -1
  71. package/build/es/no-polyfill/common/key.js +1 -1
  72. package/build/es/no-polyfill/common/locale/index.js +7 -7
  73. package/build/es/no-polyfill/common/panel/Panel.js +6 -6
  74. package/build/es/no-polyfill/common/propsValues/breakpoint.js +1 -1
  75. package/build/es/no-polyfill/common/propsValues/control.js +1 -1
  76. package/build/es/no-polyfill/common/propsValues/dateMode.js +1 -1
  77. package/build/es/no-polyfill/common/propsValues/layouts.js +1 -1
  78. package/build/es/no-polyfill/common/propsValues/markdownNodeType.js +1 -1
  79. package/build/es/no-polyfill/common/propsValues/monthFormat.js +1 -1
  80. package/build/es/no-polyfill/common/propsValues/position.js +1 -1
  81. package/build/es/no-polyfill/common/propsValues/profileType.js +1 -1
  82. package/build/es/no-polyfill/common/propsValues/scroll.js +1 -1
  83. package/build/es/no-polyfill/common/propsValues/sentiment.js +1 -1
  84. package/build/es/no-polyfill/common/propsValues/size.js +1 -1
  85. package/build/es/no-polyfill/common/propsValues/status.js +1 -1
  86. package/build/es/no-polyfill/common/propsValues/type.js +1 -1
  87. package/build/es/no-polyfill/common/propsValues/typography.js +1 -1
  88. package/build/es/no-polyfill/common/propsValues/variant.js +1 -1
  89. package/build/es/no-polyfill/common/propsValues/width.js +1 -1
  90. package/build/es/no-polyfill/common/requirements.js +2 -2
  91. package/build/es/no-polyfill/common/responsivePanel/ResponsivePanel.js +1 -1
  92. package/build/es/no-polyfill/common/textFormat/formatWithPattern/formatWithPattern.js +2 -2
  93. package/build/es/no-polyfill/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.js +1 -1
  94. package/build/es/no-polyfill/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js +1 -1
  95. package/build/es/no-polyfill/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js +1 -1
  96. package/build/es/no-polyfill/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js +1 -1
  97. package/build/es/no-polyfill/common/textFormat/unformatWithPattern/unformatWithPattern.js +1 -1
  98. package/build/es/no-polyfill/common/theme.js +1 -1
  99. package/build/es/no-polyfill/criticalBanner/CriticalCommsBanner.js +1 -1
  100. package/build/es/no-polyfill/criticalBanner/CriticalCommsBanner.story.js +1 -1
  101. package/build/es/no-polyfill/dateInput/DateInput.js +4 -10
  102. package/build/es/no-polyfill/dateInput/DateInput.story.js +1 -1
  103. package/build/es/no-polyfill/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.js +1 -1
  104. package/build/es/no-polyfill/dateInput/utils/explodeDate/explodeDate.js +1 -1
  105. package/build/es/no-polyfill/dateLookup/DateLookup.js +3 -4
  106. package/build/es/no-polyfill/dateLookup/dateHeader/DateHeader.js +1 -1
  107. package/build/es/no-polyfill/dateLookup/dateTrigger/DateTrigger.js +1 -1
  108. package/build/es/no-polyfill/dateLookup/dayCalendar/DayCalendar.js +1 -1
  109. package/build/es/no-polyfill/dateLookup/dayCalendar/table/DayCalendarTable.js +4 -5
  110. package/build/es/no-polyfill/dateLookup/monthCalendar/MonthCalendar.js +1 -1
  111. package/build/es/no-polyfill/dateLookup/monthCalendar/table/MonthCalendarTable.js +1 -1
  112. package/build/es/no-polyfill/dateLookup/tableLink/TableLink.js +1 -1
  113. package/build/es/no-polyfill/dateLookup/yearCalendar/YearCalendar.js +1 -1
  114. package/build/es/no-polyfill/dateLookup/yearCalendar/table/YearCalendarTable.js +1 -1
  115. package/build/es/no-polyfill/decision/Decision.js +5 -5
  116. package/build/es/no-polyfill/decision/decisionEnums.js +2 -2
  117. package/build/es/no-polyfill/definitionList/DefinitionList.js +1 -1
  118. package/build/es/no-polyfill/dimmer/Dimmer.js +3 -3
  119. package/build/es/no-polyfill/dimmer/Dimmer.story.js +2 -2
  120. package/build/es/no-polyfill/dimmer/dimmerManager/DimmerManager.js +3 -3
  121. package/build/es/no-polyfill/display/Display.js +1 -1
  122. package/build/es/no-polyfill/display/Display.story.js +2 -2
  123. package/build/es/no-polyfill/drawer/Drawer.js +1 -1
  124. package/build/es/no-polyfill/dropFade/DropFade.js +3 -3
  125. package/build/es/no-polyfill/dropFade/DropFade.story.js +1 -1
  126. package/build/es/no-polyfill/dynamicFieldDefinitionList/DynamicFieldDefinitionList.js +1 -1
  127. package/build/es/no-polyfill/dynamicFieldDefinitionList/FormattedValue/FormattedValue.js +1 -1
  128. package/build/es/no-polyfill/dynamicFieldDefinitionList/utils/createDefinitions.js +2 -2
  129. package/build/es/no-polyfill/dynamicFieldDefinitionList/utils/text-format.js +1 -1
  130. package/build/es/no-polyfill/emphasis/Emphasis.js +2 -2
  131. package/build/es/no-polyfill/emphasis/EmphasisHtmlTransformer.js +2 -2
  132. package/build/es/no-polyfill/flowNavigation/FlowNavigation.js +2 -2
  133. package/build/es/no-polyfill/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
  134. package/build/es/no-polyfill/flowNavigation/backButton/BackButton.js +1 -1
  135. package/build/es/no-polyfill/header/Header.js +2 -2
  136. package/build/es/no-polyfill/header/Header.spec.js +1 -1
  137. package/build/es/no-polyfill/header/Header.story.js +2 -1
  138. package/build/es/no-polyfill/i18n/index.js +1 -1
  139. package/build/es/no-polyfill/image/Image.js +2 -2
  140. package/build/es/no-polyfill/info/Info.js +1 -1
  141. package/build/es/no-polyfill/info/Info.story.js +1 -1
  142. package/build/es/no-polyfill/info/infoPresentations.js +1 -1
  143. package/build/es/no-polyfill/inlineAlert/InlineAlert.js +1 -1
  144. package/build/es/no-polyfill/inputWithDisplayFormat/InputWithDisplayFormat.js +1 -1
  145. package/build/es/no-polyfill/inputs/Input.js +1 -1
  146. package/build/es/no-polyfill/inputs/TextArea.js +1 -1
  147. package/build/es/no-polyfill/inputs/_common.js +2 -2
  148. package/build/es/no-polyfill/instructionsList/InstructionsList.js +3 -3
  149. package/build/es/no-polyfill/link/Link.js +2 -2
  150. package/build/es/no-polyfill/link/Link.spec.js +1 -1
  151. package/build/es/no-polyfill/link/Link.story.js +1 -1
  152. package/build/es/no-polyfill/listItem/ListItem.js +1 -1
  153. package/build/es/no-polyfill/listItem/ListItem.spec.js +1 -1
  154. package/build/es/no-polyfill/listItem/ListItem.story.js +1 -1
  155. package/build/es/no-polyfill/loader/Loader.js +2 -2
  156. package/build/es/no-polyfill/loader/Loader.story.js +1 -1
  157. package/build/es/no-polyfill/logo/Logo.js +1 -1
  158. package/build/es/no-polyfill/logo/Logo.story.js +1 -1
  159. package/build/es/no-polyfill/logo/logoTypes.js +1 -1
  160. package/build/es/no-polyfill/markdown/Markdown.js +1 -1
  161. package/build/es/no-polyfill/modal/Modal.js +1 -1
  162. package/build/es/no-polyfill/modal/Modal.story.js +2 -2
  163. package/build/es/no-polyfill/money/Money.js +1 -1
  164. package/build/es/no-polyfill/money/Money.story.js +1 -1
  165. package/build/es/no-polyfill/moneyInput/MoneyInput.js +1 -1
  166. package/build/es/no-polyfill/moneyInput/MoneyInput.story.js +1 -1
  167. package/build/es/no-polyfill/moneyInput/currencyFormatting.js +2 -2
  168. package/build/es/no-polyfill/navigationOption/NavigationOption.js +1 -1
  169. package/build/es/no-polyfill/navigationOptionsList/NavigationOptionsList.js +1 -1
  170. package/build/es/no-polyfill/nudge/Nudge.js +1 -1
  171. package/build/es/no-polyfill/overlayHeader/OverlayHeader.js +1 -1
  172. package/build/es/no-polyfill/phoneNumberInput/PhoneNumberInput.js +1 -1
  173. package/build/es/no-polyfill/phoneNumberInput/data/countries.js +1 -1
  174. package/build/es/no-polyfill/phoneNumberInput/utils/cleanNumber/cleanNumber.js +1 -1
  175. package/build/es/no-polyfill/phoneNumberInput/utils/excludeCountries/excludeCountries.js +2 -2
  176. package/build/es/no-polyfill/phoneNumberInput/utils/explodeNumberModel/index.js +1 -1
  177. package/build/es/no-polyfill/phoneNumberInput/utils/filterOptionsForQuery/index.js +1 -1
  178. package/build/es/no-polyfill/phoneNumberInput/utils/findCountryByCode/index.js +1 -1
  179. package/build/es/no-polyfill/phoneNumberInput/utils/findCountryByPrefix/index.js +1 -1
  180. package/build/es/no-polyfill/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.js +1 -1
  181. package/build/es/no-polyfill/phoneNumberInput/utils/isOptionAndFitsQuery/isOptionAndFitsQuery.js +1 -1
  182. package/build/es/no-polyfill/phoneNumberInput/utils/isStringNumeric/isStringNumeric.js +1 -1
  183. package/build/es/no-polyfill/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js +1 -1
  184. package/build/es/no-polyfill/phoneNumberInput/utils/longestMatchingPrefix/index.js +1 -1
  185. package/build/es/no-polyfill/phoneNumberInput/utils/setDefaultPrefix/index.js +3 -3
  186. package/build/es/no-polyfill/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.js +2 -2
  187. package/build/es/no-polyfill/popover/Popover.js +2 -2
  188. package/build/es/no-polyfill/processIndicator/ProcessIndicator.js +4 -4
  189. package/build/es/no-polyfill/progress/Progress.js +1 -1
  190. package/build/es/no-polyfill/progress/Progress.story.js +1 -1
  191. package/build/es/no-polyfill/progressBar/ProgressBar.js +1 -1
  192. package/build/es/no-polyfill/progressBar/ProgressBar.story.js +1 -1
  193. package/build/es/no-polyfill/provider/Provider.js +1 -1
  194. package/build/es/no-polyfill/provider/Provider.spec.js +1 -1
  195. package/build/es/no-polyfill/provider/Provider.story.js +1 -1
  196. package/build/es/no-polyfill/provider/direction/DirectionProvider.js +1 -1
  197. package/build/es/no-polyfill/provider/direction/DirectionProvider.spec.js +1 -1
  198. package/build/es/no-polyfill/provider/language/LanguageProvider.js +1 -1
  199. package/build/es/no-polyfill/provider/language/LanguageProvider.spec.js +1 -1
  200. package/build/es/no-polyfill/radio/Radio.js +1 -1
  201. package/build/es/no-polyfill/radioGroup/RadioGroup.js +2 -2
  202. package/build/es/no-polyfill/radioOption/RadioOption.js +1 -1
  203. package/build/es/no-polyfill/section/Section.js +1 -1
  204. package/build/es/no-polyfill/section/Section.spec.js +1 -1
  205. package/build/es/no-polyfill/section/Section.story.js +1 -1
  206. package/build/es/no-polyfill/select/Select.js +8 -9
  207. package/build/es/no-polyfill/select/option/Option.js +1 -1
  208. package/build/es/no-polyfill/select/searchBox/SearchBox.js +1 -1
  209. package/build/es/no-polyfill/sizeSwapper/SizeSwapper.js +3 -3
  210. package/build/es/no-polyfill/slidingPanel/SlidingPanel.js +2 -2
  211. package/build/es/no-polyfill/snackbar/Snackbar.js +1 -1
  212. package/build/es/no-polyfill/snackbar/SnackbarContext.js +1 -1
  213. package/build/es/no-polyfill/snackbar/SnackbarProvider.js +1 -1
  214. package/build/es/no-polyfill/snackbar/useSnackbar.js +1 -1
  215. package/build/es/no-polyfill/statusIcon/StatusIcon.js +1 -1
  216. package/build/es/no-polyfill/statusIcon/StatusIcon.story.js +1 -1
  217. package/build/es/no-polyfill/stepper/Stepper.js +1 -1
  218. package/build/es/no-polyfill/stepper/deviceDetection.js +2 -2
  219. package/build/es/no-polyfill/sticky/Sticky.js +1 -1
  220. package/build/es/no-polyfill/summary/Summary.js +1 -1
  221. package/build/es/no-polyfill/switch/Switch.js +1 -1
  222. package/build/es/no-polyfill/switch/Switch.story.js +1 -1
  223. package/build/es/no-polyfill/switchOption/SwitchOption.js +1 -1
  224. package/build/es/no-polyfill/switchOption/SwitchOption.story.js +1 -1
  225. package/build/es/no-polyfill/tabs/Tab.js +1 -1
  226. package/build/es/no-polyfill/tabs/TabList.js +1 -1
  227. package/build/es/no-polyfill/tabs/TabPanel.js +1 -1
  228. package/build/es/no-polyfill/tabs/Tabs.js +1 -5
  229. package/build/es/no-polyfill/tabs/utils.js +2 -2
  230. package/build/es/no-polyfill/textareaWithDisplayFormat/TextareaWithDisplayFormat.js +1 -1
  231. package/build/es/no-polyfill/tile/Tile.js +1 -1
  232. package/build/es/no-polyfill/title/Title.js +1 -1
  233. package/build/es/no-polyfill/title/Title.spec.js +1 -1
  234. package/build/es/no-polyfill/title/Title.story.js +1 -1
  235. package/build/es/no-polyfill/tooltip/Tooltip.js +7 -7
  236. package/build/es/no-polyfill/tooltip/Tooltip.spec.js +1 -1
  237. package/build/es/no-polyfill/tooltip/Tooltip.story.js +1 -1
  238. package/build/es/no-polyfill/typeahead/Typeahead.js +1 -1
  239. package/build/es/no-polyfill/typeahead/typeaheadInput/TypeaheadInput.js +1 -1
  240. package/build/es/no-polyfill/typeahead/typeaheadOption/TypeaheadOption.js +1 -1
  241. package/build/es/no-polyfill/typeahead/util/highlight.js +1 -1
  242. package/build/es/no-polyfill/upload/Upload.js +2 -6
  243. package/build/es/no-polyfill/upload/steps/completeStep/completeStep.js +1 -1
  244. package/build/es/no-polyfill/upload/steps/mediaUploadStep/mediaUploadStep.js +1 -1
  245. package/build/es/no-polyfill/upload/steps/processingStep/processingStep.js +1 -1
  246. package/build/es/no-polyfill/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
  247. package/build/es/no-polyfill/upload/uploadSteps.js +1 -1
  248. package/build/es/no-polyfill/upload/utils/asyncFileRead/asyncFileRead.js +1 -1
  249. package/build/es/no-polyfill/upload/utils/getFileType/getFileType.js +1 -1
  250. package/build/es/no-polyfill/upload/utils/getSupportedSpotMimeTypes/getSupportedSpotMimeTypes.js +1 -1
  251. package/build/es/no-polyfill/upload/utils/isSizeValid/isSizeValid.js +1 -1
  252. package/build/es/no-polyfill/upload/utils/isTypeValid/isTypeValid.js +1 -1
  253. package/build/es/no-polyfill/upload/utils/postData/postData.js +1 -1
  254. package/build/es/no-polyfill/upload/utils/requestMedia/requestMedia.js +1 -1
  255. package/build/es/no-polyfill/uploadInput/UploadInput.js +7 -7
  256. package/build/es/no-polyfill/uploadInput/UploadInput.spec.js +1 -1
  257. package/build/es/no-polyfill/uploadInput/UploadInput.story.js +1 -1
  258. package/build/es/no-polyfill/uploadInput/uploadButton/UploadButton.js +1 -1
  259. package/build/es/no-polyfill/uploadInput/uploadButton/UploadButton.spec.js +3 -3
  260. package/build/es/no-polyfill/uploadInput/uploadButton/defaults.js +1 -1
  261. package/build/es/no-polyfill/uploadInput/uploadButton/getAllowedFileTypes.js +3 -3
  262. package/build/es/no-polyfill/uploadInput/uploadButton/getAllowedFileTypes.spec.js +1 -1
  263. package/build/es/no-polyfill/uploadInput/uploadItem/UploadItem.js +2 -2
  264. package/build/es/no-polyfill/uploadInput/uploadItem/UploadItem.spec.js +1 -1
  265. package/build/es/no-polyfill/uploadInput/uploadItem/UploadItemBody.js +1 -1
  266. package/build/es/no-polyfill/utilities/deprecatedProperty/deprecatedProperty.js +1 -1
  267. package/build/es/no-polyfill/utilities/logActionRequired.js +1 -1
  268. package/build/es/no-polyfill/withDisplayFormat/WithDisplayFormat.js +3 -4
  269. package/build/es/no-polyfill/withNextPortal/withNextPortal.js +1 -1
  270. package/build/es/polyfill/accordion/Accordion.js +1 -1
  271. package/build/es/polyfill/accordion/Accordion.story.js +1 -1
  272. package/build/es/polyfill/accordion/AccordionItem/AccordionItem.js +1 -1
  273. package/build/es/polyfill/actionButton/ActionButton.js +1 -1
  274. package/build/es/polyfill/actionButton/ActionButton.spec.js +1 -1
  275. package/build/es/polyfill/actionButton/ActionButton.story.js +1 -1
  276. package/build/es/polyfill/actionOption/ActionOption.js +1 -1
  277. package/build/es/polyfill/actionOption/ActionOption.story.js +1 -1
  278. package/build/es/polyfill/alert/Alert.js +1 -1
  279. package/build/es/polyfill/alert/Alert.story.js +1 -1
  280. package/build/es/polyfill/alert/inlineMarkdown/InlineMarkdown.js +1 -1
  281. package/build/es/polyfill/alert/withArrow/alertArrowPositions.js +1 -1
  282. package/build/es/polyfill/alert/withArrow/withArrow.js +1 -1
  283. package/build/es/polyfill/avatar/Avatar.js +1 -1
  284. package/build/es/polyfill/avatar/Avatar.story.js +1 -1
  285. package/build/es/polyfill/avatar/avatarTypes.js +1 -1
  286. package/build/es/polyfill/avatar/colors/colors.js +2 -2
  287. package/build/es/polyfill/avatarWrapper/AvatarWrapper.js +1 -1
  288. package/build/es/polyfill/avatarWrapper/AvatarWrapper.story.js +1 -1
  289. package/build/es/polyfill/badge/Badge.js +1 -1
  290. package/build/es/polyfill/body/Body.js +2 -2
  291. package/build/es/polyfill/body/Body.spec.js +1 -1
  292. package/build/es/polyfill/body/Body.story.js +1 -1
  293. package/build/es/polyfill/button/Button.js +5 -5
  294. package/build/es/polyfill/button/Button.story.js +1 -1
  295. package/build/es/polyfill/button/classMap.js +1 -1
  296. package/build/es/polyfill/button/legacyUtils/legacyUtils.js +2 -2
  297. package/build/es/polyfill/card/Card.js +1 -1
  298. package/build/es/polyfill/checkbox/Checkbox.js +1 -1
  299. package/build/es/polyfill/checkbox/Checkbox.story.js +1 -1
  300. package/build/es/polyfill/checkboxButton/CheckboxButton.js +1 -1
  301. package/build/es/polyfill/checkboxButton/CheckboxButton.spec.js +1 -1
  302. package/build/es/polyfill/checkboxButton/CheckboxButton.story.js +1 -1
  303. package/build/es/polyfill/checkboxOption/CheckboxOption.js +1 -1
  304. package/build/es/polyfill/checkboxOption/CheckboxOption.spec.js +1 -1
  305. package/build/es/polyfill/checkboxOption/CheckboxOption.story.js +1 -1
  306. package/build/es/polyfill/chevron/Chevron.js +1 -1
  307. package/build/es/polyfill/chevron/Chevron.story.js +1 -1
  308. package/build/es/polyfill/chips/Chip.js +1 -1
  309. package/build/es/polyfill/chips/Chips.js +1 -1
  310. package/build/es/polyfill/chips/Chips.spec.js +1 -1
  311. package/build/es/polyfill/chips/Chips.story.js +1 -1
  312. package/build/es/polyfill/circularButton/CircularButton.js +1 -1
  313. package/build/es/polyfill/common/DOMOperations/DOMOperations.js +3 -3
  314. package/build/es/polyfill/common/Option/Option.js +1 -1
  315. package/build/es/polyfill/common/RadioButton/RadioButton.js +1 -1
  316. package/build/es/polyfill/common/bottomSheet/BottomSheet.js +4 -4
  317. package/build/es/polyfill/common/bottomSheet/BottomSheet.spec.js +1 -1
  318. package/build/es/polyfill/common/bottomSheet/BottomSheet.story.js +2 -2
  319. package/build/es/polyfill/common/closeButton/CloseButton.js +1 -1
  320. package/build/es/polyfill/common/dateUtils/getDayNames/getDayNames.js +2 -2
  321. package/build/es/polyfill/common/dateUtils/getMonthNames/getMonthNames.js +1 -1
  322. package/build/es/polyfill/common/dateUtils/isDateValid/isDateValid.js +1 -1
  323. package/build/es/polyfill/common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.js +1 -1
  324. package/build/es/polyfill/common/deviceDetection/deviceDetection.js +1 -1
  325. package/build/es/polyfill/common/direction.js +1 -1
  326. package/build/es/polyfill/common/domHelpers/index.js +1 -1
  327. package/build/es/polyfill/common/fakeEvents.js +1 -1
  328. package/build/es/polyfill/common/fileType.js +1 -1
  329. package/build/es/polyfill/common/flowHeader/FlowHeader.js +1 -1
  330. package/build/es/polyfill/common/focusBoundary/FocusBoundary.js +1 -1
  331. package/build/es/polyfill/common/focusBoundary/FocusBoundary.spec.js +1 -1
  332. package/build/es/polyfill/common/focusBoundary/utils/getFocusableElements.js +2 -2
  333. package/build/es/polyfill/common/focusBoundary/utils/resetFocus.js +1 -1
  334. package/build/es/polyfill/common/historyNavigator/historyNavigator.js +1 -1
  335. package/build/es/polyfill/common/hooks/useClientWidth/useClientWidth.js +3 -3
  336. package/build/es/polyfill/common/hooks/useConditionalListener/useConditionalListener.js +1 -1
  337. package/build/es/polyfill/common/hooks/useDirection/useDirection.js +1 -1
  338. package/build/es/polyfill/common/hooks/useHasIntersected/useHasIntersected.js +2 -2
  339. package/build/es/polyfill/common/hooks/useLayout/useLayout.js +1 -1
  340. package/build/es/polyfill/common/key.js +1 -1
  341. package/build/es/polyfill/common/locale/index.js +8 -8
  342. package/build/es/polyfill/common/panel/Panel.js +6 -6
  343. package/build/es/polyfill/common/propsValues/breakpoint.js +1 -1
  344. package/build/es/polyfill/common/propsValues/control.js +1 -1
  345. package/build/es/polyfill/common/propsValues/dateMode.js +1 -1
  346. package/build/es/polyfill/common/propsValues/layouts.js +1 -1
  347. package/build/es/polyfill/common/propsValues/markdownNodeType.js +1 -1
  348. package/build/es/polyfill/common/propsValues/monthFormat.js +1 -1
  349. package/build/es/polyfill/common/propsValues/position.js +1 -1
  350. package/build/es/polyfill/common/propsValues/profileType.js +1 -1
  351. package/build/es/polyfill/common/propsValues/scroll.js +1 -1
  352. package/build/es/polyfill/common/propsValues/sentiment.js +1 -1
  353. package/build/es/polyfill/common/propsValues/size.js +1 -1
  354. package/build/es/polyfill/common/propsValues/status.js +1 -1
  355. package/build/es/polyfill/common/propsValues/type.js +1 -1
  356. package/build/es/polyfill/common/propsValues/typography.js +1 -1
  357. package/build/es/polyfill/common/propsValues/variant.js +1 -1
  358. package/build/es/polyfill/common/propsValues/width.js +1 -1
  359. package/build/es/polyfill/common/requirements.js +2 -2
  360. package/build/es/polyfill/common/responsivePanel/ResponsivePanel.js +1 -1
  361. package/build/es/polyfill/common/textFormat/formatWithPattern/formatWithPattern.js +2 -2
  362. package/build/es/polyfill/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.js +1 -1
  363. package/build/es/polyfill/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js +1 -1
  364. package/build/es/polyfill/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js +1 -1
  365. package/build/es/polyfill/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js +1 -1
  366. package/build/es/polyfill/common/textFormat/unformatWithPattern/unformatWithPattern.js +1 -1
  367. package/build/es/polyfill/common/theme.js +1 -1
  368. package/build/es/polyfill/criticalBanner/CriticalCommsBanner.js +1 -1
  369. package/build/es/polyfill/criticalBanner/CriticalCommsBanner.story.js +1 -1
  370. package/build/es/polyfill/dateInput/DateInput.js +4 -10
  371. package/build/es/polyfill/dateInput/DateInput.story.js +1 -1
  372. package/build/es/polyfill/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.js +1 -1
  373. package/build/es/polyfill/dateInput/utils/explodeDate/explodeDate.js +1 -1
  374. package/build/es/polyfill/dateLookup/DateLookup.js +3 -4
  375. package/build/es/polyfill/dateLookup/dateHeader/DateHeader.js +1 -1
  376. package/build/es/polyfill/dateLookup/dateTrigger/DateTrigger.js +1 -1
  377. package/build/es/polyfill/dateLookup/dayCalendar/DayCalendar.js +1 -1
  378. package/build/es/polyfill/dateLookup/dayCalendar/table/DayCalendarTable.js +4 -5
  379. package/build/es/polyfill/dateLookup/monthCalendar/MonthCalendar.js +1 -1
  380. package/build/es/polyfill/dateLookup/monthCalendar/table/MonthCalendarTable.js +1 -1
  381. package/build/es/polyfill/dateLookup/tableLink/TableLink.js +1 -1
  382. package/build/es/polyfill/dateLookup/yearCalendar/YearCalendar.js +1 -1
  383. package/build/es/polyfill/dateLookup/yearCalendar/table/YearCalendarTable.js +1 -1
  384. package/build/es/polyfill/decision/Decision.js +5 -5
  385. package/build/es/polyfill/decision/decisionEnums.js +2 -2
  386. package/build/es/polyfill/definitionList/DefinitionList.js +1 -1
  387. package/build/es/polyfill/dimmer/Dimmer.js +3 -3
  388. package/build/es/polyfill/dimmer/Dimmer.story.js +2 -2
  389. package/build/es/polyfill/dimmer/dimmerManager/DimmerManager.js +3 -3
  390. package/build/es/polyfill/display/Display.js +1 -1
  391. package/build/es/polyfill/display/Display.story.js +2 -2
  392. package/build/es/polyfill/drawer/Drawer.js +1 -1
  393. package/build/es/polyfill/dropFade/DropFade.js +3 -3
  394. package/build/es/polyfill/dropFade/DropFade.story.js +1 -1
  395. package/build/es/polyfill/dynamicFieldDefinitionList/DynamicFieldDefinitionList.js +1 -1
  396. package/build/es/polyfill/dynamicFieldDefinitionList/FormattedValue/FormattedValue.js +2 -2
  397. package/build/es/polyfill/dynamicFieldDefinitionList/utils/createDefinitions.js +2 -2
  398. package/build/es/polyfill/dynamicFieldDefinitionList/utils/text-format.js +1 -1
  399. package/build/es/polyfill/emphasis/Emphasis.js +2 -2
  400. package/build/es/polyfill/emphasis/EmphasisHtmlTransformer.js +2 -2
  401. package/build/es/polyfill/flowNavigation/FlowNavigation.js +2 -2
  402. package/build/es/polyfill/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
  403. package/build/es/polyfill/flowNavigation/backButton/BackButton.js +1 -1
  404. package/build/es/polyfill/header/Header.js +2 -2
  405. package/build/es/polyfill/header/Header.spec.js +1 -1
  406. package/build/es/polyfill/header/Header.story.js +2 -1
  407. package/build/es/polyfill/i18n/index.js +1 -1
  408. package/build/es/polyfill/image/Image.js +2 -2
  409. package/build/es/polyfill/info/Info.js +1 -1
  410. package/build/es/polyfill/info/Info.story.js +1 -1
  411. package/build/es/polyfill/info/infoPresentations.js +1 -1
  412. package/build/es/polyfill/inlineAlert/InlineAlert.js +1 -1
  413. package/build/es/polyfill/inputWithDisplayFormat/InputWithDisplayFormat.js +1 -1
  414. package/build/es/polyfill/inputs/Input.js +1 -1
  415. package/build/es/polyfill/inputs/TextArea.js +1 -1
  416. package/build/es/polyfill/inputs/_common.js +2 -2
  417. package/build/es/polyfill/instructionsList/InstructionsList.js +3 -3
  418. package/build/es/polyfill/link/Link.js +2 -2
  419. package/build/es/polyfill/link/Link.spec.js +1 -1
  420. package/build/es/polyfill/link/Link.story.js +1 -1
  421. package/build/es/polyfill/listItem/ListItem.js +1 -1
  422. package/build/es/polyfill/listItem/ListItem.spec.js +1 -1
  423. package/build/es/polyfill/listItem/ListItem.story.js +1 -1
  424. package/build/es/polyfill/loader/Loader.js +2 -2
  425. package/build/es/polyfill/loader/Loader.story.js +1 -1
  426. package/build/es/polyfill/logo/Logo.js +1 -1
  427. package/build/es/polyfill/logo/Logo.story.js +1 -1
  428. package/build/es/polyfill/logo/logoTypes.js +1 -1
  429. package/build/es/polyfill/markdown/Markdown.js +1 -1
  430. package/build/es/polyfill/modal/Modal.js +1 -1
  431. package/build/es/polyfill/modal/Modal.story.js +2 -2
  432. package/build/es/polyfill/money/Money.js +1 -1
  433. package/build/es/polyfill/money/Money.story.js +1 -1
  434. package/build/es/polyfill/moneyInput/MoneyInput.js +1 -1
  435. package/build/es/polyfill/moneyInput/MoneyInput.story.js +1 -1
  436. package/build/es/polyfill/moneyInput/currencyFormatting.js +3 -3
  437. package/build/es/polyfill/navigationOption/NavigationOption.js +1 -1
  438. package/build/es/polyfill/navigationOptionsList/NavigationOptionsList.js +1 -1
  439. package/build/es/polyfill/nudge/Nudge.js +1 -1
  440. package/build/es/polyfill/overlayHeader/OverlayHeader.js +1 -1
  441. package/build/es/polyfill/phoneNumberInput/PhoneNumberInput.js +1 -1
  442. package/build/es/polyfill/phoneNumberInput/data/countries.js +1 -1
  443. package/build/es/polyfill/phoneNumberInput/utils/cleanNumber/cleanNumber.js +1 -1
  444. package/build/es/polyfill/phoneNumberInput/utils/excludeCountries/excludeCountries.js +3 -3
  445. package/build/es/polyfill/phoneNumberInput/utils/explodeNumberModel/index.js +2 -2
  446. package/build/es/polyfill/phoneNumberInput/utils/filterOptionsForQuery/index.js +2 -2
  447. package/build/es/polyfill/phoneNumberInput/utils/findCountryByCode/index.js +1 -1
  448. package/build/es/polyfill/phoneNumberInput/utils/findCountryByPrefix/index.js +1 -1
  449. package/build/es/polyfill/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.js +1 -1
  450. package/build/es/polyfill/phoneNumberInput/utils/isOptionAndFitsQuery/isOptionAndFitsQuery.js +2 -2
  451. package/build/es/polyfill/phoneNumberInput/utils/isStringNumeric/isStringNumeric.js +1 -1
  452. package/build/es/polyfill/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js +2 -2
  453. package/build/es/polyfill/phoneNumberInput/utils/longestMatchingPrefix/index.js +1 -1
  454. package/build/es/polyfill/phoneNumberInput/utils/setDefaultPrefix/index.js +3 -3
  455. package/build/es/polyfill/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.js +2 -2
  456. package/build/es/polyfill/popover/Popover.js +2 -2
  457. package/build/es/polyfill/processIndicator/ProcessIndicator.js +4 -4
  458. package/build/es/polyfill/progress/Progress.js +1 -1
  459. package/build/es/polyfill/progress/Progress.story.js +1 -1
  460. package/build/es/polyfill/progressBar/ProgressBar.js +1 -1
  461. package/build/es/polyfill/progressBar/ProgressBar.story.js +1 -1
  462. package/build/es/polyfill/provider/Provider.js +1 -1
  463. package/build/es/polyfill/provider/Provider.spec.js +1 -1
  464. package/build/es/polyfill/provider/Provider.story.js +1 -1
  465. package/build/es/polyfill/provider/direction/DirectionProvider.js +1 -1
  466. package/build/es/polyfill/provider/direction/DirectionProvider.spec.js +1 -1
  467. package/build/es/polyfill/provider/language/LanguageProvider.js +1 -1
  468. package/build/es/polyfill/provider/language/LanguageProvider.spec.js +1 -1
  469. package/build/es/polyfill/radio/Radio.js +1 -1
  470. package/build/es/polyfill/radioGroup/RadioGroup.js +2 -2
  471. package/build/es/polyfill/radioOption/RadioOption.js +1 -1
  472. package/build/es/polyfill/section/Section.js +1 -1
  473. package/build/es/polyfill/section/Section.spec.js +1 -1
  474. package/build/es/polyfill/section/Section.story.js +1 -1
  475. package/build/es/polyfill/select/Select.js +8 -9
  476. package/build/es/polyfill/select/option/Option.js +2 -2
  477. package/build/es/polyfill/select/searchBox/SearchBox.js +1 -1
  478. package/build/es/polyfill/sizeSwapper/SizeSwapper.js +3 -3
  479. package/build/es/polyfill/slidingPanel/SlidingPanel.js +2 -2
  480. package/build/es/polyfill/snackbar/Snackbar.js +1 -1
  481. package/build/es/polyfill/snackbar/SnackbarContext.js +1 -1
  482. package/build/es/polyfill/snackbar/SnackbarProvider.js +1 -1
  483. package/build/es/polyfill/snackbar/useSnackbar.js +1 -1
  484. package/build/es/polyfill/statusIcon/StatusIcon.js +1 -1
  485. package/build/es/polyfill/statusIcon/StatusIcon.story.js +1 -1
  486. package/build/es/polyfill/stepper/Stepper.js +1 -1
  487. package/build/es/polyfill/stepper/deviceDetection.js +2 -2
  488. package/build/es/polyfill/sticky/Sticky.js +1 -1
  489. package/build/es/polyfill/summary/Summary.js +1 -1
  490. package/build/es/polyfill/switch/Switch.js +1 -1
  491. package/build/es/polyfill/switch/Switch.story.js +1 -1
  492. package/build/es/polyfill/switchOption/SwitchOption.js +1 -1
  493. package/build/es/polyfill/switchOption/SwitchOption.story.js +1 -1
  494. package/build/es/polyfill/tabs/Tab.js +1 -1
  495. package/build/es/polyfill/tabs/TabList.js +1 -1
  496. package/build/es/polyfill/tabs/TabPanel.js +1 -1
  497. package/build/es/polyfill/tabs/Tabs.js +1 -5
  498. package/build/es/polyfill/tabs/utils.js +2 -2
  499. package/build/es/polyfill/textareaWithDisplayFormat/TextareaWithDisplayFormat.js +1 -1
  500. package/build/es/polyfill/tile/Tile.js +1 -1
  501. package/build/es/polyfill/title/Title.js +1 -1
  502. package/build/es/polyfill/title/Title.spec.js +1 -1
  503. package/build/es/polyfill/title/Title.story.js +1 -1
  504. package/build/es/polyfill/tooltip/Tooltip.js +7 -7
  505. package/build/es/polyfill/tooltip/Tooltip.spec.js +1 -1
  506. package/build/es/polyfill/tooltip/Tooltip.story.js +1 -1
  507. package/build/es/polyfill/typeahead/Typeahead.js +1 -1
  508. package/build/es/polyfill/typeahead/typeaheadInput/TypeaheadInput.js +1 -1
  509. package/build/es/polyfill/typeahead/typeaheadOption/TypeaheadOption.js +1 -1
  510. package/build/es/polyfill/typeahead/util/highlight.js +1 -1
  511. package/build/es/polyfill/upload/Upload.js +2 -6
  512. package/build/es/polyfill/upload/steps/completeStep/completeStep.js +1 -1
  513. package/build/es/polyfill/upload/steps/mediaUploadStep/mediaUploadStep.js +1 -1
  514. package/build/es/polyfill/upload/steps/processingStep/processingStep.js +1 -1
  515. package/build/es/polyfill/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
  516. package/build/es/polyfill/upload/uploadSteps.js +1 -1
  517. package/build/es/polyfill/upload/utils/asyncFileRead/asyncFileRead.js +1 -1
  518. package/build/es/polyfill/upload/utils/getFileType/getFileType.js +1 -1
  519. package/build/es/polyfill/upload/utils/getSupportedSpotMimeTypes/getSupportedSpotMimeTypes.js +2 -2
  520. package/build/es/polyfill/upload/utils/isSizeValid/isSizeValid.js +1 -1
  521. package/build/es/polyfill/upload/utils/isTypeValid/isTypeValid.js +1 -1
  522. package/build/es/polyfill/upload/utils/postData/postData.js +1 -1
  523. package/build/es/polyfill/upload/utils/requestMedia/requestMedia.js +1 -1
  524. package/build/es/polyfill/uploadInput/UploadInput.js +7 -7
  525. package/build/es/polyfill/uploadInput/UploadInput.spec.js +1 -1
  526. package/build/es/polyfill/uploadInput/UploadInput.story.js +1 -1
  527. package/build/es/polyfill/uploadInput/uploadButton/UploadButton.js +1 -1
  528. package/build/es/polyfill/uploadInput/uploadButton/UploadButton.spec.js +3 -3
  529. package/build/es/polyfill/uploadInput/uploadButton/defaults.js +1 -1
  530. package/build/es/polyfill/uploadInput/uploadButton/getAllowedFileTypes.js +3 -3
  531. package/build/es/polyfill/uploadInput/uploadButton/getAllowedFileTypes.spec.js +1 -1
  532. package/build/es/polyfill/uploadInput/uploadItem/UploadItem.js +2 -2
  533. package/build/es/polyfill/uploadInput/uploadItem/UploadItem.spec.js +1 -1
  534. package/build/es/polyfill/uploadInput/uploadItem/UploadItemBody.js +1 -1
  535. package/build/es/polyfill/utilities/deprecatedProperty/deprecatedProperty.js +1 -1
  536. package/build/es/polyfill/utilities/logActionRequired.js +1 -1
  537. package/build/es/polyfill/withDisplayFormat/WithDisplayFormat.js +3 -4
  538. package/build/es/polyfill/withNextPortal/withNextPortal.js +1 -1
  539. package/build/main.css +1 -4236
  540. package/build/styles/accordion/Accordion.css +1 -59
  541. package/build/styles/actionButton/ActionButton.css +1 -41
  542. package/build/styles/avatar/Avatar.css +1 -240
  543. package/build/styles/badge/Badge.css +1 -66
  544. package/build/styles/button/Button.css +1 -17
  545. package/build/styles/card/Card.css +1 -88
  546. package/build/styles/checkboxButton/CheckboxButton.css +1 -21
  547. package/build/styles/chips/Chip.css +1 -169
  548. package/build/styles/circularButton/CircularButton.css +1 -175
  549. package/build/styles/common/Option/Option.css +1 -74
  550. package/build/styles/common/RadioButton/RadioButton.css +1 -3
  551. package/build/styles/common/bottomSheet/BottomSheet.css +1 -44
  552. package/build/styles/common/closeButton/CloseButton.css +1 -44
  553. package/build/styles/common/panel/Panel.css +1 -67
  554. package/build/styles/criticalBanner/CriticalCommsBanner.css +1 -73
  555. package/build/styles/dateInput/DateInput.css +1 -3
  556. package/build/styles/dateLookup/DateLookup.css +1 -80
  557. package/build/styles/dateLookup/dateTrigger/DateTrigger.css +1 -53
  558. package/build/styles/decision/Decision.css +1 -69
  559. package/build/styles/definitionList/DefinitionList.css +1 -48
  560. package/build/styles/dimmer/Dimmer.css +1 -68
  561. package/build/styles/drawer/Drawer.css +1 -77
  562. package/build/styles/dropFade/DropFade.css +1 -19
  563. package/build/styles/dynamicFieldDefinitionList/FormattedValue/FormattedValue.css +1 -4
  564. package/build/styles/emphasis/Emphasis.css +1 -25
  565. package/build/styles/flowNavigation/FlowNavigation.css +1 -85
  566. package/build/styles/flowNavigation/animatedLabel/AnimatedLabel.css +1 -26
  567. package/build/styles/flowNavigation/backButton/BackButton.css +1 -28
  568. package/build/styles/header/Header.css +1 -20
  569. package/build/styles/image/Image.css +1 -12
  570. package/build/styles/info/Info.css +1 -37
  571. package/build/styles/inputs/Input.css +1 -53
  572. package/build/styles/inputs/TextArea.css +1 -59
  573. package/build/styles/instructionsList/InstructionsList.css +1 -30
  574. package/build/styles/link/Link.css +1 -12
  575. package/build/styles/listItem/ListItem.css +1 -6
  576. package/build/styles/loader/Loader.css +1 -294
  577. package/build/styles/logo/Logo.css +1 -10
  578. package/build/styles/main.css +1 -4236
  579. package/build/styles/modal/Modal.css +1 -133
  580. package/build/styles/moneyInput/MoneyInput.css +1 -128
  581. package/build/styles/navigationOption/NavigationOption.css +1 -61
  582. package/build/styles/navigationOptionsList/NavigationOptionsList.css +1 -12
  583. package/build/styles/nudge/Nudge.css +1 -138
  584. package/build/styles/overlayHeader/OverlayHeader.css +1 -31
  585. package/build/styles/phoneNumberInput/PhoneNumberInput.css +1 -17
  586. package/build/styles/popover/Popover.css +1 -40
  587. package/build/styles/progress/Progress.css +1 -35
  588. package/build/styles/progressBar/ProgressBar.css +1 -9
  589. package/build/styles/section/Section.css +1 -8
  590. package/build/styles/select/Select.css +1 -322
  591. package/build/styles/slidingPanel/SlidingPanel.css +1 -96
  592. package/build/styles/snackbar/Snackbar.css +1 -85
  593. package/build/styles/statusIcon/StatusIcon.css +1 -50
  594. package/build/styles/stepper/Stepper.css +1 -139
  595. package/build/styles/summary/Summary.css +1 -86
  596. package/build/styles/switch/Switch.css +1 -64
  597. package/build/styles/tabs/Tabs.css +1 -104
  598. package/build/styles/tile/Tile.css +1 -58
  599. package/build/styles/tooltip/Tooltip.css +1 -37
  600. package/build/styles/typeahead/Typeahead.css +1 -167
  601. package/build/styles/typeahead/typeaheadOption/TypeaheadOption.css +1 -6
  602. package/build/styles/upload/Upload.css +1 -15
  603. package/build/styles/uploadInput/UploadInput.css +1 -53
  604. package/build/styles/uploadInput/uploadButton/UploadButton.css +1 -44
  605. package/build/styles/uploadInput/uploadItem/UploadItem.css +1 -60
  606. package/build/types/actionButton/ActionButton.d.ts +3 -0
  607. package/build/types/actionButton/ActionButton.story.d.ts +1 -0
  608. package/build/types/button/Button.story.d.ts +24 -24
  609. package/build/umd/no-polyfill/main.js +1 -1
  610. package/build/umd/polyfill/main.js +1 -1
  611. package/package.json +1 -1
@@ -1 +1 @@
1
- import{logActionRequired}from"../logActionRequired";const deprecatedMessage=a=>{let{component:b,propName:c,message:d,expiryDate:e}=a;const f=[`${b} has deprecated the use of ${c}.`];return d&&f.push(d),e&&f.push(`${c} will be removed on or after ${e.toLocaleString("en-GB",{year:"numeric",month:"numeric",day:"numeric"})}`),f.join(" ")},deprecated=(a,b)=>{let{component:c,message:d="",newProp:e=null,expiryDate:f=null}=b;return function(b,g){const h=e?`Please use ${e} instead.`:d;null!=b[g]&&"undefined"!=typeof b[g]&&logActionRequired(deprecatedMessage({component:c,propName:g,message:h,expiryDate:f}));for(var i=arguments.length,j=Array(2<i?i-2:0),k=2;k<i;k++)j[k-2]=arguments[k];return a(b,g,...j)}};export default deprecated;
1
+ import{logActionRequired}from"../logActionRequired";var deprecatedMessage=function(a){var b=a.component,c=a.propName,d=a.message,e=a.expiryDate,f=["".concat(b," has deprecated the use of ").concat(c,".")];return d&&f.push(d),e&&f.push("".concat(c," will be removed on or after ").concat(e.toLocaleString("en-GB",{year:"numeric",month:"numeric",day:"numeric"}))),f.join(" ")},deprecated=function(a,b){var c=b.component,d=b.message,e=void 0===d?"":d,f=b.newProp,g=void 0===f?null:f,h=b.expiryDate,i=void 0===h?null:h;return function(b,d){var f=g?"Please use ".concat(g," instead."):e;null!=b[d]&&"undefined"!=typeof b[d]&&logActionRequired(deprecatedMessage({component:c,propName:d,message:f,expiryDate:i}));for(var h=arguments.length,j=Array(2<h?h-2:0),k=2;k<h;k++)j[k-2]=arguments[k];return a.apply(void 0,[b,d].concat(j))}};export default deprecated;
@@ -1 +1 @@
1
- export function logActionRequired(a){["development","test"].includes(process?.env?.NODE_ENV)&&console.warn(a)}export function logActionRequiredIf(a,b){b&&logActionRequired(a)}
1
+ export function logActionRequired(a){var b,c;["development","test"].includes(null===(b=process)||void 0===b||null===(c=b.env)||void 0===c?void 0:c.NODE_ENV)&&console.warn(a)}export function logActionRequiredIf(a,b){b&&logActionRequired(a)}
@@ -1,8 +1,7 @@
1
- import PropTypes from"prop-types";import{Component}from"react";import{HistoryNavigator}from"../common";import{formatWithPattern,getCountOfSymbolsInSelection,getCursorPositionAfterKeystroke,unformatWithPattern,getDistanceToPreviousSymbol,getDistanceToNextSymbol}from"../common/textFormat";class WithDisplayFormat extends Component{constructor(a){super(a);const{value:b,displayPattern:c}=a,d=unformatWithPattern(b,c);this.state={value:formatWithPattern(d,c),historyNavigator:new HistoryNavigator,prevDisplayPattern:a.displayPattern,triggerType:null,triggerEvent:null}}static getDerivedStateFromProps(a,b){const{displayPattern:c}=a,{prevDisplayPattern:d}=b;if(b.prevDisplayPattern!==c){const{value:a,historyNavigator:e}=b,f=unformatWithPattern(a,d);return e.reset(),{prevDisplayPattern:c,value:formatWithPattern(f,c),triggerType:null,triggerEvent:null,pastedLength:0}}return null}getUserAction=a=>{const{triggerEvent:b,triggerType:c,value:d}=this.state,{displayPattern:e}=this.props,f=String.fromCharCode(b.which).toLowerCase();return"Paste"===c||"Cut"===c?c:(b.ctrlKey||b.metaKey)&&"z"===f?b.shiftKey?"Redo":"Undo":b.ctrlKey&&"d"===f?"Delete":"undefined"==typeof b.key&&a.length<=unformatWithPattern(d,e).length?"Backspace":b.key;// Detect mouse event redo
1
+ import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import PropTypes from"prop-types";import{Component}from"react";import{HistoryNavigator}from"../common";import{formatWithPattern,getCountOfSymbolsInSelection,getCursorPositionAfterKeystroke,unformatWithPattern,getDistanceToPreviousSymbol,getDistanceToNextSymbol}from"../common/textFormat";var WithDisplayFormat=/*#__PURE__*/function(a){function b(a){var d;_classCallCheck(this,b),d=c.call(this,a),_defineProperty(_assertThisInitialized(d),"getUserAction",function(a){var b=d.state,c=b.triggerEvent,e=b.triggerType,f=b.value,g=d.props.displayPattern,h=String.fromCharCode(c.which).toLowerCase();return"Paste"===e||"Cut"===e?e:(c.ctrlKey||c.metaKey)&&"z"===h?c.shiftKey?"Redo":"Undo":c.ctrlKey&&"d"===h?"Delete":"undefined"==typeof c.key&&a.length<=unformatWithPattern(f,g).length?"Backspace":c.key;// Detect mouse event redo
2
2
  // Android Fix.
3
- };resetEvent=()=>{this.setState({triggerType:null,triggerEvent:null,pastedLength:0})};detectUndoRedo=a=>{const b=String.fromCharCode(a.which).toLowerCase();return(a.ctrlKey||a.metaKey)&&"z"===b?a.shiftKey?"Redo":"Undo":null};handleOnKeyDown=a=>{a.persist();const{selectionStart:b,selectionEnd:c}=a.target,{historyNavigator:d}=this.state,{displayPattern:e}=this.props;// Unfortunately Undo and Redo don't trigger OnChange event so we need to handle some value logic here.
4
- let f="";"Undo"===this.detectUndoRedo(a)?(f=formatWithPattern(d.undo(),e),this.setState({value:f,triggerType:"Undo"})):"Redo"===this.detectUndoRedo(a)?(f=formatWithPattern(d.redo(),e),this.setState({value:f,triggerType:"Redo"})):this.setState({triggerEvent:a,triggerType:"KeyDown",selectionStart:b,selectionEnd:c})};handleOnPaste=a=>{const{displayPattern:b}=this.props,c=unformatWithPattern(a.clipboardData.getData("Text"),b).length;this.setState({triggerType:"Paste",pastedLength:c})};handleOnCut=()=>{this.setState({triggerType:"Cut"})};isKeyAllowed=a=>{const{displayPattern:b}=this.props,c=b.split("").filter(a=>"*"!==a);return!c.includes(a)};handleOnChange=a=>{const{historyNavigator:b,triggerEvent:c,triggerType:d}=this.state,{displayPattern:e,onChange:f}=this.props,{value:g}=a.target;let h=unformatWithPattern(g,e);const i=null===c?// triggerEvent can be null only in case of "autofilling" (via password manager extension or browser build-in one) events
5
- "Paste":this.getUserAction(h);if(this.isKeyAllowed(i)&&"Undo"!==d&&"Redo"!==d){("Backspace"===i||"Delete"===i)&&(h=this.handleDelete(h,i));const a=formatWithPattern(h,e);b.add(h),this.handleCursorPositioning(i);const c=unformatWithPattern(a,e);this.setState({value:a},this.resetEvent(),f(c))}};handleOnBlur=a=>{const{displayPattern:b,onBlur:c}=this.props;c&&c(unformatWithPattern(a.target.value,b))};handleOnFocus=a=>{const{displayPattern:b,onFocus:c}=this.props;c&&(this.handleOnChange(a),c(unformatWithPattern(a.target.value,b)))};handleDelete=(a,b)=>{const{displayPattern:c}=this.props,{selectionStart:d,selectionEnd:e}=this.state,f=[...a];if(d===e){let a=d-getCountOfSymbolsInSelection(0,d,c),e=0,g=getDistanceToNextSymbol(d,c);"Backspace"===b&&(a-=1,g=getDistanceToPreviousSymbol(d,c)),0<=a&&g&&(e=1),f.splice(a,e)}return f.join("")};handleCursorPositioning=a=>{const{displayPattern:b}=this.props,{triggerEvent:c,selectionStart:d,selectionEnd:e,pastedLength:f}=this.state,g=getCursorPositionAfterKeystroke(a,d,e,b,f);setTimeout(()=>{c&&c.target.setSelectionRange(g,g),this.setState({selectionStart:g,selectionEnd:g})},0)};render(){const{type:a,inputMode:b,className:c,id:d,name:e,placeholder:f,readOnly:g,required:h,minLength:i,maxLength:j,disabled:k,autoComplete:l}=this.props,{value:m}=this.state,n={type:a,inputMode:b,className:c,id:d,name:e,placeholder:f,readOnly:g,required:h,minLength:i,maxLength:j,disabled:k,autoComplete:l,value:m,onFocus:this.handleOnFocus,onBlur:this.handleOnBlur,onPaste:this.handleOnPaste,onKeyDown:this.handleOnKeyDown,onChange:this.handleOnChange,onCut:this.handleOnCut};return this.props.render(n)}}WithDisplayFormat.propTypes={/**
3
+ }),_defineProperty(_assertThisInitialized(d),"resetEvent",function(){d.setState({triggerType:null,triggerEvent:null,pastedLength:0})}),_defineProperty(_assertThisInitialized(d),"detectUndoRedo",function(a){var b=String.fromCharCode(a.which).toLowerCase();return(a.ctrlKey||a.metaKey)&&"z"===b?a.shiftKey?"Redo":"Undo":null}),_defineProperty(_assertThisInitialized(d),"handleOnKeyDown",function(a){a.persist();var b=a.target,c=b.selectionStart,e=b.selectionEnd,f=d.state.historyNavigator,g=d.props.displayPattern,h="";"Undo"===d.detectUndoRedo(a)?(h=formatWithPattern(f.undo(),g),d.setState({value:h,triggerType:"Undo"})):"Redo"===d.detectUndoRedo(a)?(h=formatWithPattern(f.redo(),g),d.setState({value:h,triggerType:"Redo"})):d.setState({triggerEvent:a,triggerType:"KeyDown",selectionStart:c,selectionEnd:e})}),_defineProperty(_assertThisInitialized(d),"handleOnPaste",function(a){var b=d.props.displayPattern,c=unformatWithPattern(a.clipboardData.getData("Text"),b).length;d.setState({triggerType:"Paste",pastedLength:c})}),_defineProperty(_assertThisInitialized(d),"handleOnCut",function(){d.setState({triggerType:"Cut"})}),_defineProperty(_assertThisInitialized(d),"isKeyAllowed",function(a){var b=d.props.displayPattern,c=b.split("").filter(function(a){return"*"!==a});return!c.includes(a)}),_defineProperty(_assertThisInitialized(d),"handleOnChange",function(a){var b=d.state,c=b.historyNavigator,e=b.triggerEvent,f=b.triggerType,g=d.props,h=g.displayPattern,i=g.onChange,j=a.target.value,k=unformatWithPattern(j,h),l=null===e?// triggerEvent can be null only in case of "autofilling" (via password manager extension or browser build-in one) events
4
+ "Paste":d.getUserAction(k);if(d.isKeyAllowed(l)&&"Undo"!==f&&"Redo"!==f){("Backspace"===l||"Delete"===l)&&(k=d.handleDelete(k,l));var m=formatWithPattern(k,h);c.add(k),d.handleCursorPositioning(l);var n=unformatWithPattern(m,h);d.setState({value:m},d.resetEvent(),i(n))}}),_defineProperty(_assertThisInitialized(d),"handleOnBlur",function(a){var b=d.props,c=b.displayPattern,e=b.onBlur;e&&e(unformatWithPattern(a.target.value,c))}),_defineProperty(_assertThisInitialized(d),"handleOnFocus",function(a){var b=d.props,c=b.displayPattern,e=b.onFocus;e&&(d.handleOnChange(a),e(unformatWithPattern(a.target.value,c)))}),_defineProperty(_assertThisInitialized(d),"handleDelete",function(a,b){var c=d.props.displayPattern,e=d.state,f=e.selectionStart,g=e.selectionEnd,h=_toConsumableArray(a);if(f===g){var i=f-getCountOfSymbolsInSelection(0,f,c),j=0,k=getDistanceToNextSymbol(f,c);"Backspace"===b&&(i-=1,k=getDistanceToPreviousSymbol(f,c)),0<=i&&k&&(j=1),h.splice(i,j)}return h.join("")}),_defineProperty(_assertThisInitialized(d),"handleCursorPositioning",function(a){var b=d.props.displayPattern,c=d.state,e=c.triggerEvent,f=c.selectionStart,g=c.selectionEnd,h=c.pastedLength,i=getCursorPositionAfterKeystroke(a,f,g,b,h);setTimeout(function(){e&&e.target.setSelectionRange(i,i),d.setState({selectionStart:i,selectionEnd:i})},0)});var e=a.value,f=a.displayPattern,g=unformatWithPattern(e,f);return d.state={value:formatWithPattern(g,f),historyNavigator:new HistoryNavigator,prevDisplayPattern:a.displayPattern,triggerType:null,triggerEvent:null},d}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this.props,b=a.type,c=a.inputMode,d=a.className,e=a.id,f=a.name,g=a.placeholder,h=a.readOnly,i=a.required,j=a.minLength,k=a.maxLength,l=a.disabled,m=a.autoComplete,n=this.state.value,o={type:b,inputMode:c,className:d,id:e,name:f,placeholder:g,readOnly:h,required:i,minLength:j,maxLength:k,disabled:l,autoComplete:m,value:n,onFocus:this.handleOnFocus,onBlur:this.handleOnBlur,onPaste:this.handleOnPaste,onKeyDown:this.handleOnKeyDown,onChange:this.handleOnChange,onCut:this.handleOnCut};return this.props.render(o)}}],[{key:"getDerivedStateFromProps",value:function getDerivedStateFromProps(a,b){var c=a.displayPattern,d=b.prevDisplayPattern;if(b.prevDisplayPattern!==c){var e=b.value,f=b.historyNavigator,g=unformatWithPattern(e,d);return f.reset(),{prevDisplayPattern:c,value:formatWithPattern(g,c),triggerType:null,triggerEvent:null,pastedLength:0}}return null}}]),b}(Component);WithDisplayFormat.propTypes={/**
6
5
  * autocomplete hides our form help so we need to disable it when help text
7
6
  * is present. Chrome ignores autocomplete=off, the only way to disable it is
8
7
  * to provide an 'invalid' value, for which 'disabled' serves.
@@ -1 +1 @@
1
- import{useState,useEffect}from"react";import{createPortal}from"react-dom";import{jsx as _jsx}from"react/jsx-runtime";export default function withNextPortalWrapper(a){return function(b){const[c,d]=useState(!1);return useEffect(()=>{d(!0)},[d]),c?/*#__PURE__*/createPortal(/*#__PURE__*/_jsx(a,{...b}),document.body):null}}
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{useState,useEffect}from"react";import{createPortal}from"react-dom";import{jsx as _jsx}from"react/jsx-runtime";export default function withNextPortalWrapper(a){return function(b){var c=useState(!1),d=_slicedToArray(c,2),e=d[0],f=d[1];return useEffect(function(){f(!0)},[f]),e?/*#__PURE__*/createPortal(/*#__PURE__*/_jsx(a,_objectSpread({},b)),document.body):null}}
@@ -1 +1 @@
1
- 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";const Accordion=a=>{let{items:b,onClick:c,indexOpen:d,theme:e}=a;const[f,g]=useState(()=>b.map((a,b)=>b===d)),h=a=>{c&&c(a);const b=[...f];b[a]=!f[a],g(b)};return b.map((a,b)=>/*#__PURE__*/_jsx(AccordionItem,{open:f[b],onClick:()=>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"core-js/modules/es.array.map.js";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";import 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{FastFlag as FastFlagIcon}from"@transferwise/icons";import{Scroll,Size}from"../common";import Modal from"../modal";import{lorem10,lorem40,storyConfig}from"../test-utils";import Accordion from"./Accordion";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:Accordion,title:"Content/Accordion",args:{items:[{title:"Item 1",content:lorem10,id:"Item 1"},{title:"Item 2",content:lorem40,id:"Item 2"},{title:"Item 3",content:lorem10,id:"Item 3"},{title:"Item 4",content:lorem10,id:"Item 4",icon:/*#__PURE__*/_jsx(FastFlagIcon,{size:24})}]}};export const Basic={args:{indexOpen:0}};export const BasicMobile=storyConfig(Basic,{variants:["mobile"]});export const Variants=storyConfig({args:{indexOpen:0}},{variants:["default","dark","rtl"]});export const Multiple={render:a=>{const b=a.items;return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Accordion,{...a,items:[b[0]]}),/*#__PURE__*/_jsx(Accordion,{...a,items:[b[0]],indexOpen:0}),/*#__PURE__*/_jsx(Accordion,{...a,items:b})]})}};export const InModal={parameters:{chromatic:{delay:1e3}},render:a=>{const b=a.items;return/*#__PURE__*/_jsx(Modal,{body:/*#__PURE__*/_jsxs("div",{className:"p-a-1",children:[/*#__PURE__*/_jsx("h3",{className:"m-t-2 m-b-4 text-xs-center",children:"Large transfer tips"}),/*#__PURE__*/_jsx(Accordion,{...a,items:[b[0]]}),/*#__PURE__*/_jsx(Accordion,{...a,items:[b[0]],indexOpen:0}),/*#__PURE__*/_jsx(Accordion,{...a,items:b})]}),scroll:Scroll.CONTENT,size:Size.LARGE,open:!0,footer:/*#__PURE__*/_jsx("div",{className:"p-a-3 text-xs-center",children:/*#__PURE__*/_jsx("a",{href:"/large-amounts",children:"Learn more"})}),onClose:()=>void 0})}};export const InModalMobile=storyConfig(InModal,{variants:["mobile"]});
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{FastFlag as FastFlagIcon}from"@transferwise/icons";import{Scroll,Size}from"../common";import Modal from"../modal";import{lorem10,lorem40,storyConfig}from"../test-utils";import Accordion from"./Accordion";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:Accordion,title:"Content/Accordion",args:{items:[{title:"Item 1",content:lorem10,id:"Item 1"},{title:"Item 2",content:lorem40,id:"Item 2"},{title:"Item 3",content:lorem10,id:"Item 3"},{title:"Item 4",content:lorem10,id:"Item 4",icon:/*#__PURE__*/_jsx(FastFlagIcon,{size:24})}]}};export var Basic={args:{indexOpen:0}};export var BasicMobile=storyConfig(Basic,{variants:["mobile"]});export var Variants=storyConfig({args:{indexOpen:0}},{variants:["default","dark","rtl"]});export var Multiple={render:function render(a){var b=a.items;return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Accordion,_objectSpread(_objectSpread({},a),{},{items:[b[0]]})),/*#__PURE__*/_jsx(Accordion,_objectSpread(_objectSpread({},a),{},{items:[b[0]],indexOpen:0})),/*#__PURE__*/_jsx(Accordion,_objectSpread(_objectSpread({},a),{},{items:b}))]})}};export var InModal={parameters:{chromatic:{delay:1e3}},render:function render(a){var b=a.items;return/*#__PURE__*/_jsx(Modal,{body:/*#__PURE__*/_jsxs("div",{className:"p-a-1",children:[/*#__PURE__*/_jsx("h3",{className:"m-t-2 m-b-4 text-xs-center",children:"Large transfer tips"}),/*#__PURE__*/_jsx(Accordion,_objectSpread(_objectSpread({},a),{},{items:[b[0]]})),/*#__PURE__*/_jsx(Accordion,_objectSpread(_objectSpread({},a),{},{items:[b[0]],indexOpen:0})),/*#__PURE__*/_jsx(Accordion,_objectSpread(_objectSpread({},a),{},{items:b}))]}),scroll:Scroll.CONTENT,size:Size.LARGE,open:!0,footer:/*#__PURE__*/_jsx("div",{className:"p-a-3 text-xs-center",children:/*#__PURE__*/_jsx("a",{href:"/large-amounts",children:"Learn more"})}),onClose:function onClose(){}})}};export var InModalMobile=storyConfig(InModal,{variants:["mobile"]});
@@ -1 +1 @@
1
- import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement}from"react";import Body from"../../body";import Chevron from"../../chevron";import{Position,Size,Typography,Theme}from"../../common";import Option from"../../common/Option";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const AccordionItem=a=>{let{"aria-label":b,id:c,title:d,content:e,onClick:f,open:g,icon:h,theme:i}=a;const{isModern:j}=useTheme(),k=h?/*#__PURE__*/cloneElement(h,{size:24}):null;return/*#__PURE__*/_jsxs("div",{id:c,className:classNames("np-accordion-item",`np-accordion-item--${i}`,k?"np-accordion-item--with-icon":null,{"np-accordion-item--open":g}),children:[/*#__PURE__*/_jsx(Option,{"aria-label":b,as:"button",type:"button",media:k,title:d,button:/*#__PURE__*/_jsx(Chevron,{orientation:g?Position.TOP:Position.DOWN,size:j?Size.MEDIUM:Size.SMALL}),inverseMediaCircle:!1,onClick:f}),g&&/*#__PURE__*/_jsx(Body,{as:"span",type:Typography.BODY_LARGE,className:classNames("np-accordion-item__content","d-block",{"has-icon":h}),children:e})]})};AccordionItem.propTypes={"aria-label":PropTypes.string,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={"aria-label":void 0,icon:null,id:null,theme:Theme.LIGHT};export default AccordionItem;
1
+ import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement}from"react";import Body from"../../body";import Chevron from"../../chevron";import{Position,Size,Typography,Theme}from"../../common";import Option from"../../common/Option";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var AccordionItem=function(a){var b=a["aria-label"],c=a.id,d=a.title,e=a.content,f=a.onClick,g=a.open,h=a.icon,i=a.theme,j=useTheme(),k=j.isModern,l=h?/*#__PURE__*/cloneElement(h,{size:24}):null;return/*#__PURE__*/_jsxs("div",{id:c,className:classNames("np-accordion-item","np-accordion-item--".concat(i),l?"np-accordion-item--with-icon":null,{"np-accordion-item--open":g}),children:[/*#__PURE__*/_jsx(Option,{"aria-label":b,as:"button",type:"button",media:l,title:d,button:/*#__PURE__*/_jsx(Chevron,{orientation:g?Position.TOP:Position.DOWN,size:k?Size.MEDIUM:Size.SMALL}),inverseMediaCircle:!1,onClick:f}),g&&/*#__PURE__*/_jsx(Body,{as:"span",type:Typography.BODY_LARGE,className:classNames("np-accordion-item__content","d-block",{"has-icon":h}),children:e})]})};AccordionItem.propTypes={"aria-label":PropTypes.string,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={"aria-label":void 0,icon:null,id:null,theme:Theme.LIGHT};export default AccordionItem;
@@ -1 +1 @@
1
- import classNames from"classnames";import{forwardRef}from"react";import{jsx as _jsx}from"react/jsx-runtime";const ActionButton=/*#__PURE__*/forwardRef((a,b)=>{let{disabled:g=!1,className:h=void 0,onClick:c,text:d,children:e,...f}=a;return/*#__PURE__*/_jsx("button",{ref:b,type:"button",className:classNames(`np-action-btn`,"np-text-body-default-bold",h),disabled:g,onClick:c,...f,children:e||d})});export default ActionButton;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["disabled","className","onClick","priority","text","children"];import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import{forwardRef}from"react";import{Priority}from"../common";import{jsx as _jsx}from"react/jsx-runtime";var ActionButton=/*#__PURE__*/forwardRef(function(a,b){var c=a.disabled,d=a.className,e=void 0===d?void 0:d,f=a.onClick,g=a.priority,h=void 0===g?Priority.PRIMARY:g,i=a.text,j=a.children,k=_objectWithoutProperties(a,_excluded);return/*#__PURE__*/_jsx("button",_objectSpread(_objectSpread({ref:b,type:"button",className:classNames("np-action-btn","np-text-body-default-bold",h===Priority.PRIMARY?"btn-priority-1":"btn-priority-2",e),disabled:void 0!==c&&c,onClick:f},k),{},{children:j||i}))});export default ActionButton;
@@ -1 +1 @@
1
- import"@testing-library/jest-dom";import{render,screen,userEvent}from"../test-utils";import ActionButton from".";import{jsx as _jsx}from"react/jsx-runtime";describe("ActionButton",()=>{const a={children:"Personal profile",onClick:jest.fn()};describe("by default",()=>{beforeEach(()=>{render(/*#__PURE__*/_jsx(ActionButton,{...a}))}),it("renders the text",()=>{expect(screen.getByText("Personal profile")).toBeInTheDocument()}),it("is not disabled",()=>{expect(screen.getByRole("button")).toBeEnabled()}),it("renders the button",()=>{expect(render(/*#__PURE__*/_jsx(ActionButton,{...a})).container).toMatchSnapshot()})}),describe("button attributes",()=>{it("disables the button if disabled",()=>{render(/*#__PURE__*/_jsx(ActionButton,{...a,disabled:!0})),expect(screen.getByRole("button")).toBeDisabled()}),it("passes through custom classes if set",()=>{render(/*#__PURE__*/_jsx(ActionButton,{...a,className:"catsarethebest"})),expect(screen.getByRole("button")).toHaveClass("catsarethebest")})}),describe("onClick",()=>{it("calls onClick when clicked",()=>{const b=jest.fn();render(/*#__PURE__*/_jsx(ActionButton,{...a,onClick:b})),userEvent.click(screen.getByRole("button")),expect(b).toHaveBeenCalledTimes(1)}),it("does not call onClick when clicked if disabled",()=>{const b=jest.fn();render(/*#__PURE__*/_jsx(ActionButton,{...a,disabled:!0,onClick:b})),userEvent.click(screen.getByRole("button")),expect(b).toHaveBeenCalledTimes(0)})}),describe("deprecated",()=>{it("text prop",()=>{const a=jest.fn();render(/*#__PURE__*/_jsx(ActionButton,{disabled:!0,text:"Text prop",onClick:a})),expect(screen.getByText("Text prop")).toBeInTheDocument()})})});
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";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"@testing-library/jest-dom";import{render,screen,userEvent}from"../test-utils";import ActionButton from".";import{jsx as _jsx}from"react/jsx-runtime";describe("ActionButton",function(){var a={children:"Personal profile",onClick:jest.fn()};describe("by default",function(){beforeEach(function(){render(/*#__PURE__*/_jsx(ActionButton,_objectSpread({},a)))}),it("renders the text",function(){expect(screen.getByText("Personal profile")).toBeInTheDocument()}),it("is not disabled",function(){expect(screen.getByRole("button")).toBeEnabled()}),it("renders the button",function(){expect(render(/*#__PURE__*/_jsx(ActionButton,_objectSpread({},a))).container).toMatchSnapshot()})}),describe("button attributes",function(){it("disables the button if disabled",function(){render(/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{disabled:!0}))),expect(screen.getByRole("button")).toBeDisabled()}),it("passes through custom classes if set",function(){render(/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{className:"catsarethebest"}))),expect(screen.getByRole("button")).toHaveClass("catsarethebest")})}),describe("onClick",function(){it("calls onClick when clicked",function(){var b=jest.fn();render(/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{onClick:b}))),userEvent.click(screen.getByRole("button")),expect(b).toHaveBeenCalledTimes(1)}),it("does not call onClick when clicked if disabled",function(){var b=jest.fn();render(/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{disabled:!0,onClick:b}))),userEvent.click(screen.getByRole("button")),expect(b).toHaveBeenCalledTimes(0)})}),describe("deprecated",function(){it("text prop",function(){var a=jest.fn();render(/*#__PURE__*/_jsx(ActionButton,{disabled:!0,text:"Text prop",onClick:a})),expect(screen.getByText("Text prop")).toBeInTheDocument()})}),describe("priority",function(){it("is rendered for primary",function(){render(/*#__PURE__*/_jsx(ActionButton,{priority:"primary"})),expect(screen.getByRole("button")).toHaveClass("btn-priority-1")}),it("is rendered for secondary",function(){render(/*#__PURE__*/_jsx(ActionButton,{priority:"secondary"})),expect(screen.getByRole("button")).toHaveClass("btn-priority-2")}),it("is backwards compatible if nothing is passed in",function(){render(/*#__PURE__*/_jsx(ActionButton,{})),expect(screen.getByRole("button")).toHaveClass("btn-priority-1")})})});
@@ -1 +1 @@
1
- import{Settings}from"@transferwise/icons";import{storyConfig}from"../test-utils/story-config";import ActionButton from"./ActionButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:ActionButton,title:"Actions/ActionButton",tags:["autodocs"]};export const Basic={render:a=>/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(ActionButton,{...a,children:"Button label"})})};export const WithIcon={render:a=>/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsxs(ActionButton,{...a,children:[/*#__PURE__*/_jsx(Settings,{className:"m-r-1"}),"Button label"]})})};export const Disabled=storyConfig({render:WithIcon.render,args:{disabled:!0}},{variants:["default","dark","rtl","mobile"]});
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{Settings}from"@transferwise/icons";import{storyConfig}from"../test-utils/story-config";import ActionButton from"./ActionButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:ActionButton,title:"Actions/ActionButton",tags:["autodocs"]};export var Basic=storyConfig({render:function render(a){return/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({priority:"primary"},a),{},{className:"m-r-1",children:"Primary label"})),/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({priority:"secondary"},a),{},{children:"Secondary label"}))]})}},{variants:["default","dark","rtl","mobile"]});export var WithIcon={render:function render(a){return/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsxs(ActionButton,_objectSpread(_objectSpread({priority:"primary"},a),{},{className:"m-r-1",children:[/*#__PURE__*/_jsx(Settings,{className:"m-r-1"}),"Primary label"]})),/*#__PURE__*/_jsxs(ActionButton,_objectSpread(_objectSpread({priority:"secondary"},a),{},{children:[/*#__PURE__*/_jsx(Settings,{className:"m-r-1"}),"Secondary label"]}))]})}};export var Disabled=storyConfig({render:WithIcon.render,args:{disabled:!0}},{variants:["default","dark","rtl","mobile"]});
@@ -1 +1 @@
1
- import classNames from"classnames";import ActionButton from"../actionButton";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";const ActionOption=a=>{let{action:b,disabled:c,onClick:d,media:e,title:f,content:g,complex:h,className:i,showMediaAtAllSizes:j,showMediaCircle:k,isContainerAligned:l}=a;const m={media:e,title:f,content:g,complex:h,disabled:c,showMediaAtAllSizes:j,showMediaCircle:k,className:classNames("tw-action-option",i),isContainerAligned:l};return/*#__PURE__*/_jsx(Option,{...m,button:/*#__PURE__*/_jsx(ActionButton,{disabled:c,"aria-label":(()=>{const a=[];return"string"==typeof f&&a.push(f),"string"==typeof b&&a.push(b),a.join(", ")||void 0})(),onClick:d,children:b})})};export default ActionOption;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"core-js/modules/es.array.join.js";import classNames from"classnames";import ActionButton from"../actionButton";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=a.showMediaCircle,l=a.isContainerAligned,m={media:e,title:f,content:g,complex:h,disabled:c,showMediaAtAllSizes:j,showMediaCircle:k,className:classNames("tw-action-option",i),isContainerAligned:l};return/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},m),{},{button:/*#__PURE__*/_jsx(ActionButton,{disabled:c,"aria-label":function getAriaLabel(){var a=[];return"string"==typeof f&&a.push(f),"string"==typeof b&&a.push(b),a.join(", ")||void 0}(),onClick:d,children:b})}))};export default ActionOption;
@@ -1 +1 @@
1
- import{action}from"@storybook/addon-actions";import{FastFlag as FastFlagIcon}from"@transferwise/icons";import{Nudge}from"..";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:"Option/ActionOption",args:{title:"Action option",content:"Normally, the button and icon are vertically centered.",action:"Action",media:/*#__PURE__*/_jsx(FastFlagIcon,{}),showMediaCircle:!1},tags:["autodocs"]};export const Basic={render:a=>/*#__PURE__*/_jsx(ActionOption,{...a})};export const WithContainerContent={render:a=>/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("h2",{className:"m-b-2",children:"Choose how to pay"}),/*#__PURE__*/_jsx(ActionOption,{...a}),/*#__PURE__*/_jsx(ActionOption,{...a}),/*#__PURE__*/_jsx(ActionOption,{...a}),/*#__PURE__*/_jsx(Nudge,{className:"m-t-2",mediaName:"globe",title:"Text that is no longer than two lines.",link:"Link",href:"#",onClick:action("action clicked"),onDismiss:action("dismissed")})]})};
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{action}from"@storybook/addon-actions";import{FastFlag as FastFlagIcon}from"@transferwise/icons";import{Nudge}from"..";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:"Option/ActionOption",args:{title:"Action option",content:"Normally, the button and icon are vertically centered.",action:"Action",media:/*#__PURE__*/_jsx(FastFlagIcon,{}),showMediaCircle:!1},tags:["autodocs"]};export var Basic={render:function render(a){return/*#__PURE__*/_jsx(ActionOption,_objectSpread({},a))}};export var WithContainerContent={render:function render(a){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("h2",{className:"m-b-2",children:"Choose how to pay"}),/*#__PURE__*/_jsx(ActionOption,_objectSpread({},a)),/*#__PURE__*/_jsx(ActionOption,_objectSpread({},a)),/*#__PURE__*/_jsx(ActionOption,_objectSpread({},a)),/*#__PURE__*/_jsx(Nudge,{className:"m-t-2",mediaName:"globe",title:"Text that is no longer than two lines.",link:"Link",href:"#",onClick:action("action clicked"),onDismiss:action("dismissed")})]})}};
@@ -1 +1 @@
1
- import{InfoCircle,Warning as AlertTriangle,CrossCircle,CheckCircle,Clock}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement,useState,useRef}from"react";import requiredIf from"react-required-if";import Body from"../body/Body";import{Sentiment,Size,Typography,Variant}from"../common";import{CloseButton}from"../common/closeButton";import Link from"../link";import StatusIcon from"../statusIcon";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";const deprecatedTypeMap={[Sentiment.SUCCESS]:Sentiment.POSITIVE,[Sentiment.INFO]:Sentiment.NEUTRAL,[Sentiment.ERROR]:Sentiment.NEGATIVE},Alert=a=>{const{isModern:b}=useTheme(),c={[Sentiment.POSITIVE]:CheckCircle,[Sentiment.NEUTRAL]:InfoCircle,[Sentiment.WARNING]:AlertTriangle,[Sentiment.NEGATIVE]:CrossCircle,[Sentiment.PENDING]:Clock},[d,e]=useState(!1),{arrow:f,action:g,children:h,className:i,icon:j,onDismiss:k,message:l,type:m,variant:n}=a,o=useRef(null);if(f){const b=withArrow(Alert,f);return/*#__PURE__*/_jsx(b,{...a})}logActionRequired(a);const p=deprecatedTypeMap[m]||m,q=c[p];return/*#__PURE__*/_jsxs("div",{role:"alert",className:classNames("alert d-flex",`alert-${p}`,i),onTouchStart:()=>e(!0),onTouchEnd:a=>{d&&g&&o?.current&&!o.current.contains(a.target)&&("_blank"===g?.target?window.top.open(g.href):window.top.location.assign(g.href)),e(!1)},onTouchMove:()=>e(!1),children:[/*#__PURE__*/_jsxs("div",{className:classNames("alert__content","d-flex","flex-grow-1",n),"data-testid":n,children:[function(){return j?/*#__PURE__*/cloneElement(j,{size:24}):b?/*#__PURE__*/_jsx(StatusIcon,{size:Size.LARGE,sentiment:p}):/*#__PURE__*/_jsx(q,{size:24})}(),/*#__PURE__*/_jsxs("div",{className:"alert__message",children:[/*#__PURE__*/_jsx(Body,{as:"span",className:"d-block",type:Typography.BODY_LARGE,children:h||/*#__PURE__*/_jsx(InlineMarkdown,{children:l})}),g&&/*#__PURE__*/_jsx(Link,{href:g.href,className:"m-t-1","aria-label":g["aria-label"],target:g.target,type:Typography.LINK_LARGE,children:g.text})]})]}),k&&/*#__PURE__*/_jsx(CloseButton,{ref:o,className:"m-l-2",onClick:k})]})},deprecatedTypeMapMessage={[Sentiment.SUCCESS]:"Sentiment.POSITIVE",[Sentiment.INFO]:"Sentiment.NEUTRAL",[Sentiment.ERROR]:"Sentiment.NEGATIVE"},deprecatedTypes=Object.keys(deprecatedTypeMap);function logActionRequired(a){let{size:b,type:c}=a;logActionRequiredIf("Alert no longer supports any possible variations in size. Please remove the `size` prop.",!!b),logActionRequiredIf(`Alert has deprecated the ${c} value for the \`type\` prop. Please update to ${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,a=>{let{children:b}=a;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"]),variant:PropTypes.oneOf(["desktop","mobile"]),/** @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,a=>{let{message:b}=a;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,variant:Variant.DESKTOP};export default Alert;
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";var _deprecatedTypeMap,_deprecatedTypeMapMes;import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.array.concat.js";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{InfoCircle,Warning as AlertTriangle,CrossCircle,CheckCircle,Clock}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement,useState,useRef}from"react";import requiredIf from"react-required-if";import Body from"../body/Body";import{Sentiment,Size,Typography,Variant}from"../common";import{CloseButton}from"../common/closeButton";import Link from"../link";import StatusIcon from"../statusIcon";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),Alert=function(a){var b,c=useTheme(),d=c.isModern,e=(b={},_defineProperty(b,Sentiment.POSITIVE,CheckCircle),_defineProperty(b,Sentiment.NEUTRAL,InfoCircle),_defineProperty(b,Sentiment.WARNING,AlertTriangle),_defineProperty(b,Sentiment.NEGATIVE,CrossCircle),_defineProperty(b,Sentiment.PENDING,Clock),b),f=useState(!1),g=_slicedToArray(f,2),h=g[0],i=g[1],j=a.arrow,k=a.action,l=a.children,m=a.className,n=a.icon,o=a.onDismiss,p=a.message,q=a.type,r=a.variant,s=useRef(null);if(j){var t=withArrow(Alert,j);return/*#__PURE__*/_jsx(t,_objectSpread({},a))}logActionRequired(a);var u=deprecatedTypeMap[q]||q,v=e[u];return/*#__PURE__*/_jsxs("div",{role:"alert",className:classNames("alert d-flex","alert-".concat(u),m),onTouchStart:function handleTouchStart(){return i(!0)},onTouchEnd:function handleTouchEnd(a){h&&k&&null!==s&&void 0!==s&&s.current&&!s.current.contains(a.target)&&("_blank"===(null===k||void 0===k?void 0:k.target)?window.top.open(k.href):window.top.location.assign(k.href)),i(!1)},onTouchMove:function handleTouchMove(){return i(!1)},children:[/*#__PURE__*/_jsxs("div",{className:classNames("alert__content","d-flex","flex-grow-1",r),"data-testid":r,children:[function(){return n?/*#__PURE__*/cloneElement(n,{size:24}):d?/*#__PURE__*/_jsx(StatusIcon,{size:Size.LARGE,sentiment:u}):/*#__PURE__*/_jsx(v,{size:24})}(),/*#__PURE__*/_jsxs("div",{className:"alert__message",children:[/*#__PURE__*/_jsx(Body,{as:"span",className:"d-block",type:Typography.BODY_LARGE,children:l||/*#__PURE__*/_jsx(InlineMarkdown,{children:p})}),k&&/*#__PURE__*/_jsx(Link,{href:k.href,className:"m-t-1","aria-label":k["aria-label"],target:k.target,type:Typography.LINK_LARGE,children:k.text})]})]}),o&&/*#__PURE__*/_jsx(CloseButton,{ref:s,className:"m-l-2",onClick:o})]})},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"]),variant:PropTypes.oneOf(["desktop","mobile"]),/** @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,variant:Variant.DESKTOP};export default Alert;
@@ -1 +1 @@
1
- /* eslint-disable no-alert */import{Sentiment}from"../common";import Alert from"./Alert";import{AlertArrowPosition}from"./withArrow";export default{component:Alert,title:"Feedback/Alert",args:{type:Sentiment.POSITIVE,message:"Payments sent to your bank details **today** might not arrive in time for the holidays."},argTypes:{arrow:{name:"arrow (deprecated)",type:{name:"enum",value:Object.keys(AlertArrowPosition)}},type:{type:{name:"enum",value:[Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING]}}},tags:["autodocs"]};export const Basic={args:{onDismiss:void 0}};export const WithAction={args:{action:{href:"/",text:"Read more"}}};export const WithArrow={args:{arrow:AlertArrowPosition.TOP_LEFT}};
1
+ import"core-js/modules/es.object.keys.js";/* eslint-disable no-alert */import{Sentiment}from"../common";import Alert from"./Alert";import{AlertArrowPosition}from"./withArrow";export default{component:Alert,title:"Feedback/Alert",args:{type:Sentiment.POSITIVE,message:"Payments sent to your bank details **today** might not arrive in time for the holidays."},argTypes:{arrow:{name:"arrow (deprecated)",type:{name:"enum",value:Object.keys(AlertArrowPosition)}},type:{type:{name:"enum",value:[Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING]}}},tags:["autodocs"]};export var Basic={args:{onDismiss:void 0}};export var WithAction={args:{action:{href:"/",text:"Read more"}}};export var WithArrow={args:{arrow:AlertArrowPosition.TOP_LEFT}};
@@ -1 +1 @@
1
- import PropTypes from"prop-types";import{MarkdownNodeType}from"../../common";import Markdown from"../../markdown";import{jsx as _jsx}from"react/jsx-runtime";const allowList=[MarkdownNodeType.STRONG],InlineMarkdown=a=>/*#__PURE__*/_jsx(Markdown,{...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";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import 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,2 +1,2 @@
1
1
  // TODO: consider to move this enum into component file once we migrate it on TypeScript or replace with some common enum
2
- export let ArrowPosition=/*#__PURE__*/function(a){return a.TOP_LEFT="up-left",a.TOP="up-center",a.TOP_RIGHT="up-right",a.BOTTOM_LEFT="down-left",a.BOTTOM="down-center",a.BOTTOM_RIGHT="down-right",a}({});
2
+ export var ArrowPosition=/*#__PURE__*/function(a){return a.TOP_LEFT="up-left",a.TOP="up-center",a.TOP_RIGHT="up-right",a.BOTTOM_LEFT="down-left",a.BOTTOM="down-center",a.BOTTOM_RIGHT="down-right",a}({});
@@ -1 +1 @@
1
- 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){const c=c=>/*#__PURE__*/_jsx(a,{...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){const b=["arrow"],{BOTTOM:c,BOTTOM_LEFT:d,BOTTOM_RIGHT:e,TOP:f,TOP_RIGHT:g,TOP_LEFT:h}=ArrowPosition;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";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";import"core-js/modules/es.array.concat.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import PropTypes from"prop-types";import{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 classnames from"classnames";import{useMemo}from"react";import{Theme}from"../common";import{getAvatarColorFromSeed}from"./colors";import{jsx as _jsx}from"react/jsx-runtime";const backwardsCompatibleSize=a=>"sm"===a?24:"md"===a?48:"lg"===a?72:a,Avatar=a=>{let{backgroundColor:b=null,backgroundColorSeed:c=null,children:d=null,className:e=null,outlined:f=!1,size:g=48,theme:h=Theme.LIGHT,type:i="thumbnail"}=a;const j=useMemo(()=>!b&&c?`var(${getAvatarColorFromSeed(c)})`:void 0,[b,c]),k=backwardsCompatibleSize(g);return/*#__PURE__*/_jsx("div",{className:classnames("tw-avatar",e,`tw-avatar--${k}`,`tw-avatar--${i}`,{"tw-avatar--outlined":f,"tw-avatar--branded":!!j,"np-text-title-body":"initials"===i}),children:/*#__PURE__*/_jsx("div",{className:"tw-avatar__content",style:{backgroundColor:b||j},children:d})})};export default Avatar;
1
+ import classnames from"classnames";import{useMemo}from"react";import{Theme}from"../common";import{getAvatarColorFromSeed}from"./colors";import{jsx as _jsx}from"react/jsx-runtime";var backwardsCompatibleSize=function(a){return"sm"===a?24:"md"===a?48:"lg"===a?72:a},Avatar=function(a){var b=a.backgroundColor,c=void 0===b?null:b,d=a.backgroundColorSeed,e=void 0===d?null:d,f=a.children,g=void 0===f?null:f,h=a.className,i=void 0===h?null:h,j=a.outlined,k=a.size,l=void 0===k?48:k,m=a.theme,n=void 0===m?Theme.LIGHT:m,o=a.type,p=void 0===o?"thumbnail":o,q=useMemo(function(){return!c&&e?"var(".concat(getAvatarColorFromSeed(e),")"):void 0},[c,e]),r=backwardsCompatibleSize(l);return/*#__PURE__*/_jsx("div",{className:classnames("tw-avatar",i,"tw-avatar--".concat(r),"tw-avatar--".concat(p),{"tw-avatar--outlined":void 0!==j&&j,"tw-avatar--branded":!!q,"np-text-title-body":"initials"===p}),children:/*#__PURE__*/_jsx("div",{className:"tw-avatar__content",style:{backgroundColor:c||q},children:g})})};export default Avatar;
@@ -1 +1 @@
1
- import*as wiseIcons from"@transferwise/icons";import{Size}from"../common";import{storyConfig}from"../test-utils";import Avatar,{AvatarType}from".";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:Avatar,title:"Content/Avatar",tags:["autodocs"]};export const Emoji={render:a=>/*#__PURE__*/_jsx(Avatar,{...a,children:"\u2708\uFE0F"}),args:{type:AvatarType.EMOJI,size:Size.MEDIUM}};export const Flag={render:a=>/*#__PURE__*/_jsx(Avatar,{...a,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/public-resources/assets/flags/square/gbp.svg",alt:""})}),args:{type:AvatarType.THUMBNAIL,size:Size.MEDIUM,outlined:!0}};export const Table=storyConfig({render:()=>{const a="https://wise.com/web-art/assets/flags/gbp.svg",b="#d6f5e3",c="\u2708\uFE0F",d="GN",e=wiseIcons.Check;return/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsxs("table",{children:["Outlined",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})})]}),"Image URL",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})})]}),"Emoji",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.EMOJI,children:c})})]}),/*#__PURE__*/_jsx("div",{style:{paddingBottom:"20px"},children:/*#__PURE__*/_jsx("span",{style:{position:"absolute"},children:"Custom background and icon"})}),/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:16})})})]}),"Initials",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:72,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:48,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:24,type:AvatarType.INITIALS,children:d})})]}),"Branded",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:72,type:AvatarType.INITIALS,backgroundColorSeed:"1",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.INITIALS,backgroundColorSeed:"2",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:48,type:AvatarType.INITIALS,backgroundColorSeed:"3",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.INITIALS,backgroundColorSeed:"4",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:24,type:AvatarType.INITIALS,backgroundColorSeed:"5",children:d})})]})]})})}},{variants:["default","dark","rtl"]});
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import*as wiseIcons from"@transferwise/icons";import{Size}from"../common";import{storyConfig}from"../test-utils";import Avatar,{AvatarType}from".";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:Avatar,title:"Content/Avatar",tags:["autodocs"]};export var Emoji={render:function render(a){return/*#__PURE__*/_jsx(Avatar,_objectSpread(_objectSpread({},a),{},{children:"\u2708\uFE0F"}))},args:{type:AvatarType.EMOJI,size:Size.MEDIUM}};export var Flag={render:function render(a){return/*#__PURE__*/_jsx(Avatar,_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/public-resources/assets/flags/square/gbp.svg",alt:""})}))},args:{type:AvatarType.THUMBNAIL,size:Size.MEDIUM,outlined:!0}};export var Table=storyConfig({render:function render(){var a="https://wise.com/web-art/assets/flags/gbp.svg",b="#d6f5e3",c="\u2708\uFE0F",d="GN",e=wiseIcons.Check;return/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsxs("table",{children:["Outlined",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})})]}),"Image URL",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})})]}),"Emoji",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.EMOJI,children:c})})]}),/*#__PURE__*/_jsx("div",{style:{paddingBottom:"20px"},children:/*#__PURE__*/_jsx("span",{style:{position:"absolute"},children:"Custom background and icon"})}),/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:16})})})]}),"Initials",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:72,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:48,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:24,type:AvatarType.INITIALS,children:d})})]}),"Branded",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:72,type:AvatarType.INITIALS,backgroundColorSeed:"1",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.INITIALS,backgroundColorSeed:"2",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:48,type:AvatarType.INITIALS,backgroundColorSeed:"3",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.INITIALS,backgroundColorSeed:"4",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:24,type:AvatarType.INITIALS,backgroundColorSeed:"5",children:d})})]})]})})}},{variants:["default","dark","rtl"]});
@@ -1,2 +1,2 @@
1
1
  // TODO: consider to move this enum into component file once we migrate it on TypeScript or replace with some common enum
2
- export let AvatarType=/*#__PURE__*/function(a){return a.THUMBNAIL="thumbnail",a.ICON="icon",a.EMOJI="emoji",a.INITIALS="initials",a}({});
2
+ export var AvatarType=/*#__PURE__*/function(a){return a.THUMBNAIL="thumbnail",a.ICON="icon",a.EMOJI="emoji",a.INITIALS="initials",a}({});
@@ -2,9 +2,9 @@
2
2
  * The colors we support generating an Avatar background color from a "seed" for.
3
3
  * Changing this array will change the assignment between seeds.
4
4
  * Do not change this array.
5
- */const avatarColors=["--color-bright-blue","--color-bright-yellow","--color-bright-pink","--color-bright-orange"],hashSeed=a=>{const b=avatarColors.length;let c=0,d=1;for(let e=0;e<a.length;e++)c=(c+a.charCodeAt(e)*d)%b,d=d*31%b;return c};/*
5
+ */var avatarColors=["--color-bright-blue","--color-bright-yellow","--color-bright-pink","--color-bright-orange"],hashSeed=function(a){for(var b=avatarColors.length,c=0,d=1,e=0;e<a.length;e++)c=(c+a.charCodeAt(e)*d)%b,d=d*31%b;return c};/*
6
6
  * Takes in a "seed" string and spits out an index for the color we should use.
7
7
  * This implementation has been synced across all three clients so that we consistently
8
8
  * generate branded avatar colors when rendering a list of Avatars.
9
9
  * Do not change this implementation.
10
- */export const getAvatarColorFromSeed=a=>avatarColors[hashSeed(a)];
10
+ */export var getAvatarColorFromSeed=function(a){return avatarColors[hashSeed(a)]};
@@ -1 +1 @@
1
- import{Person 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,Sentiment}from"../common";import StatusIcon from"../statusIcon/StatusIcon";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";const OptionalBadge=a=>{let{url:b,altText:c,statusIcon:d,children:e,...f}=a;return b?/*#__PURE__*/_jsx(Badge,{badge:/*#__PURE__*/_jsx("img",{src:b,alt:c}),...f,children:e}):d?/*#__PURE__*/_jsx(Badge,{badge:/*#__PURE__*/_jsx(StatusIcon,{sentiment:d,size:Size.SMALL}),...f,children:e}):e};OptionalBadge.propTypes={url:PropTypes.string,altText:PropTypes.string,statusIcon:PropTypes.oneOf([Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING]),children:PropTypes.node.isRequired},OptionalBadge.defaultProps={url:void 0,altText:void 0,statusIcon:void 0};const AvatarWrapper=a=>{let{url:b,profileType:c,profileId:d,badgeUrl:e,badgeAltText:f,badgeStatusIcon:g,name:h,avatarProps:i,badgeProps:j}=a;const[k,l]=useState(!1),m=c===ProfileType.BUSINESS;useEffect(()=>l(!1),[b]);return/*#__PURE__*/_jsx(OptionalBadge,{url:e,altText:f,statusIcon:g,...j,children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,...(()=>b&&!k?{type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:b,alt:"avatar",onError:()=>l(!0)}),...i}:c?{type:AvatarType.ICON,children:m?/*#__PURE__*/_jsx(BriefcaseIcon,{size:"24"}):/*#__PURE__*/_jsx(ProfileIcon,{size:"24"}),...i}:h?{type:AvatarType.INITIALS,children:/*#__PURE__*/_jsx(_Fragment,{children:getInitials(h)}),backgroundColorSeed:d?.toString(),...i}:{type:AvatarType.ICON,children:/*#__PURE__*/_jsx(ProfileIcon,{size:"24"}),...i})()})})};function getInitials(a){const b=a.split(" ").map(a=>a[0]).join("").toUpperCase();return 1===b.length?b[0]:b[0]+b.slice(-1)}AvatarWrapper.defaultProps={url:void 0,profileType:void 0,profileId:void 0,badgeUrl:void 0,badgeAltText:void 0,badgeStatusIcon:void 0,name:void 0,avatarProps:{},badgeProps:{}},AvatarWrapper.propTypes={url:PropTypes.string,profileType:PropTypes.oneOf([ProfileType.PERSONAL,ProfileType.BUSINESS]),profileId:PropTypes.number,badgeUrl:PropTypes.string,badgeAltText:PropTypes.string,badgeStatusIcon:PropTypes.oneOf([Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING]),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","altText","statusIcon","children"];import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";import"core-js/modules/es.function.name.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.regexp.to-string.js";import"core-js/modules/es.array.join.js";import"core-js/modules/es.array.map.js";import"core-js/modules/es.array.slice.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{Person 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,Sentiment}from"../common";import StatusIcon from"../statusIcon/StatusIcon";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";var OptionalBadge=function(a){var b=a.url,c=a.altText,d=a.statusIcon,e=a.children,f=_objectWithoutProperties(a,_excluded);return b?/*#__PURE__*/_jsx(Badge,_objectSpread(_objectSpread({badge:/*#__PURE__*/_jsx("img",{src:b,alt:c})},f),{},{children:e})):d?/*#__PURE__*/_jsx(Badge,_objectSpread(_objectSpread({badge:/*#__PURE__*/_jsx(StatusIcon,{sentiment:d,size:Size.SMALL})},f),{},{children:e})):e};OptionalBadge.propTypes={url:PropTypes.string,altText:PropTypes.string,statusIcon:PropTypes.oneOf([Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING]),children:PropTypes.node.isRequired},OptionalBadge.defaultProps={url:void 0,altText:void 0,statusIcon:void 0};var AvatarWrapper=function(a){var b=a.url,c=a.profileType,d=a.profileId,e=a.badgeUrl,f=a.badgeAltText,g=a.badgeStatusIcon,h=a.name,i=a.avatarProps,j=a.badgeProps,k=useState(!1),l=_slicedToArray(k,2),m=l[0],n=l[1],o=c===ProfileType.BUSINESS;useEffect(function(){return n(!1)},[b]);return/*#__PURE__*/_jsx(OptionalBadge,_objectSpread(_objectSpread({url:e,altText:f,statusIcon:g},j),{},{children:/*#__PURE__*/_jsx(Avatar,_objectSpread({size:Size.MEDIUM},function getAvatarProps(){return b&&!m?_objectSpread({type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:b,alt:"avatar",onError:function onError(){return n(!0)}})},i):c?_objectSpread({type:AvatarType.ICON,children:o?/*#__PURE__*/_jsx(BriefcaseIcon,{size:"24"}):/*#__PURE__*/_jsx(ProfileIcon,{size:"24"})},i):h?_objectSpread({type:AvatarType.INITIALS,children:/*#__PURE__*/_jsx(_Fragment,{children:getInitials(h)}),backgroundColorSeed:null===d||void 0===d?void 0:d.toString()},i):_objectSpread({type:AvatarType.ICON,children:/*#__PURE__*/_jsx(ProfileIcon,{size:"24"})},i)}()))}))};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,profileId:void 0,badgeUrl:void 0,badgeAltText:void 0,badgeStatusIcon:void 0,name:void 0,avatarProps:{},badgeProps:{}},AvatarWrapper.propTypes={url:PropTypes.string,profileType:PropTypes.oneOf([ProfileType.PERSONAL,ProfileType.BUSINESS]),profileId:PropTypes.number,badgeUrl:PropTypes.string,badgeAltText:PropTypes.string,badgeStatusIcon:PropTypes.oneOf([Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING]),name:PropTypes.string,avatarProps:PropTypes.shape({}),badgeProps:PropTypes.shape({})};export default AvatarWrapper;
@@ -1 +1 @@
1
- import{ProfileType,Sentiment}from"../common";import AvatarWrapper from"./AvatarWrapper";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:AvatarWrapper,title:"Content/AvatarWrapper",argTypes:{profileType:{type:{name:"enum",value:Object.keys(ProfileType)}},badgeStatusIcon:{type:{name:"enum",value:[Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING]}}},tags:["autodocs"]};export const WithBadgeUrl={args:{badgeUrl:"https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg",avatarProps:{outlined:!0}}};export const WithBadgeStatus={args:{profileType:ProfileType.BUSINESS,badgeStatusIcon:Sentiment.PENDING,avatarProps:{outlined:!1}}};export const All={args:{avatarProps:{outlined:!0}},render:a=>{const b=a.avatarProps;return/*#__PURE__*/_jsxs("div",{style:{maxWidth:"300px",display:"flex",justifyContent:"space-between"},children:[/*#__PURE__*/_jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx("b",{children:"No Badges"})})," ","Personal",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{profileType:ProfileType.PERSONAL,avatarProps:b})}),"Business",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{profileType:ProfileType.BUSINESS,avatarProps:b})}),"Avatar",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{url:"https://wise.com/public-resources/assets/flags/square/gbp.svg",profileType:ProfileType.BUSINESS,avatarProps:b})}),"Initials",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{name:"A A",avatarProps:b})}),"Default",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{avatarProps:b})})]}),/*#__PURE__*/_jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx("b",{children:"Badges"})}),"Personal",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeUrl:"https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg",badgeAltText:"wise fast flag badge",profileType:ProfileType.PERSONAL,avatarProps:b})}),"Business",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.POSITIVE,profileType:ProfileType.BUSINESS,avatarProps:b})}),"Avatar",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.NEGATIVE,url:"https://wise.com/public-resources/assets/flags/square/gbp.svg",profileType:ProfileType.BUSINESS,avatarProps:b})}),"Initials",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.NEUTRAL,name:"A A",avatarProps:b})}),"Default",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.PENDING,avatarProps:b})})]})]})}};
1
+ import"core-js/modules/es.object.keys.js";import{ProfileType,Sentiment}from"../common";import AvatarWrapper from"./AvatarWrapper";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:AvatarWrapper,title:"Content/AvatarWrapper",argTypes:{profileType:{type:{name:"enum",value:Object.keys(ProfileType)}},badgeStatusIcon:{type:{name:"enum",value:[Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING]}}},tags:["autodocs"]};export var WithBadgeUrl={args:{badgeUrl:"https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg",avatarProps:{outlined:!0}}};export var WithBadgeStatus={args:{profileType:ProfileType.BUSINESS,badgeStatusIcon:Sentiment.PENDING,avatarProps:{outlined:!1}}};export var All={args:{avatarProps:{outlined:!0}},render:function render(a){var b=a.avatarProps;return/*#__PURE__*/_jsxs("div",{style:{maxWidth:"300px",display:"flex",justifyContent:"space-between"},children:[/*#__PURE__*/_jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx("b",{children:"No Badges"})})," ","Personal",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{profileType:ProfileType.PERSONAL,avatarProps:b})}),"Business",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{profileType:ProfileType.BUSINESS,avatarProps:b})}),"Avatar",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{url:"https://wise.com/public-resources/assets/flags/square/gbp.svg",profileType:ProfileType.BUSINESS,avatarProps:b})}),"Initials",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{name:"A A",avatarProps:b})}),"Default",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{avatarProps:b})})]}),/*#__PURE__*/_jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx("b",{children:"Badges"})}),"Personal",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeUrl:"https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg",badgeAltText:"wise fast flag badge",profileType:ProfileType.PERSONAL,avatarProps:b})}),"Business",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.POSITIVE,profileType:ProfileType.BUSINESS,avatarProps:b})}),"Avatar",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.NEGATIVE,url:"https://wise.com/public-resources/assets/flags/square/gbp.svg",profileType:ProfileType.BUSINESS,avatarProps:b})}),"Initials",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.NEUTRAL,name:"A A",avatarProps:b})}),"Default",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.PENDING,avatarProps:b})})]})]})}};
@@ -1 +1 @@
1
- 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";const Badge=a=>{let{badge:b,className:d=void 0,size:e=Size.SMALL,border:f=Theme.LIGHT,children:c}=a;const g=classNames("tw-badge",{[`tw-badge-border-${f}`]:f,[`tw-badge-${e}`]:e},d);return/*#__PURE__*/_jsxs("div",{className:g,children:[/*#__PURE__*/_jsx("div",{className:"tw-badge__children",children:c}),/*#__PURE__*/_jsx("div",{className:"tw-badge__content",children:b})]})};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,3 +1,3 @@
1
- import classNames from"classnames";import{forwardRef}from"react";import{Typography}from"../common/propsValues/typography";import{jsx as _jsx}from"react/jsx-runtime";const DEFAULT_TYPE=Typography.BODY_DEFAULT,bodyTypes=new Set([Typography.BODY_DEFAULT,Typography.BODY_DEFAULT_BOLD,Typography.BODY_LARGE,Typography.BODY_LARGE_BOLD]),Body=/*#__PURE__*/forwardRef(function(a,b){let{as:e="div",type:f=DEFAULT_TYPE,className:c,...d}=a;const g=bodyTypes.has(f);return/*#__PURE__*/_jsx(e,{...d,// @ts-expect-error TODO: Remove when component could be rewritten with generics
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["as","type","className"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"core-js/modules/es.array.iterator.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.set.js";import"core-js/modules/es.string.iterator.js";import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";import classNames from"classnames";import{forwardRef}from"react";import{Typography}from"../common/propsValues/typography";import{jsx as _jsx}from"react/jsx-runtime";var DEFAULT_TYPE=Typography.BODY_DEFAULT,bodyTypes=new Set([Typography.BODY_DEFAULT,Typography.BODY_DEFAULT_BOLD,Typography.BODY_LARGE,Typography.BODY_LARGE_BOLD]),Body=/*#__PURE__*/forwardRef(function(a,b){var c=a.as,d=void 0===c?"div":c,e=a.type,f=void 0===e?DEFAULT_TYPE:e,g=a.className,h=_objectWithoutProperties(a,_excluded),i=bodyTypes.has(f);return/*#__PURE__*/_jsx(d,_objectSpread(_objectSpread({},h),{},{// @ts-expect-error TODO: Remove when component could be rewritten with generics
2
2
  // See: https://fettblog.eu/typescript-react-generic-forward-refs/
3
- ref:b,className:classNames(`np-text-${g?f:DEFAULT_TYPE}`,c)})});export default Body;
3
+ ref:b,className:classNames("np-text-".concat(i?f:DEFAULT_TYPE),g)}))});export default Body;
@@ -1 +1 @@
1
- import{Typography}from"../common";import{render,screen}from"../test-utils";import Body from".";import{jsx as _jsx}from"react/jsx-runtime";describe("Body",()=>{it("testing default state",()=>{render(/*#__PURE__*/_jsx(Body,{children:"Test"}));const a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("DIV"),expect(a).toHaveClass(`np-text-${Typography.BODY_DEFAULT}`)}),it("enforces tag via `as` prop",()=>{render(/*#__PURE__*/_jsx(Body,{as:"p",children:"Test"}));const a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("P"),expect(a).toHaveClass(`np-text-${Typography.BODY_DEFAULT}`)}),it("supports native HTML attrs",()=>{render(/*#__PURE__*/_jsx(Body,{id:"test-id",role:"banner",children:"Test"}));const a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a).toHaveAttribute("id","test-id"),expect(a).toHaveAttribute("role","banner")}),it("handles unsupported typography type",()=>{render(/*#__PURE__*/_jsx(Body,{type:Typography.TITLE_SCREEN,children:"Test"}));const a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("DIV"),expect(a).toHaveClass(`np-text-${Typography.BODY_DEFAULT}`)})});
1
+ import{Typography}from"../common";import{render,screen}from"../test-utils";import Body from".";import{jsx as _jsx}from"react/jsx-runtime";describe("Body",function(){it("testing default state",function(){render(/*#__PURE__*/_jsx(Body,{children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("DIV"),expect(a).toHaveClass("np-text-".concat(Typography.BODY_DEFAULT))}),it("enforces tag via `as` prop",function(){render(/*#__PURE__*/_jsx(Body,{as:"p",children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("P"),expect(a).toHaveClass("np-text-".concat(Typography.BODY_DEFAULT))}),it("supports native HTML attrs",function(){render(/*#__PURE__*/_jsx(Body,{id:"test-id",role:"banner",children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a).toHaveAttribute("id","test-id"),expect(a).toHaveAttribute("role","banner")}),it("handles unsupported typography type",function(){render(/*#__PURE__*/_jsx(Body,{type:Typography.TITLE_SCREEN,children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("DIV"),expect(a).toHaveClass("np-text-".concat(Typography.BODY_DEFAULT))})});
@@ -1 +1 @@
1
- import{Typography}from"../common/propsValues/typography";import Title from"../title";import Body from"./Body";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";export default{title:"Typography/Body",component:Body,tags:["autodocs"]};export const Basic=()=>/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,children:"Body Large Bold"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,children:"Body Default"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,children:"Body Default Bold"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,children:"Body Large"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs(Title,{type:Typography.TITLE_SUBSECTION,children:["Copy Example without ",/*#__PURE__*/_jsx("code",{children:"<Body />"})," component"]}),/*#__PURE__*/_jsx("p",{children:"Lorem ipsum dolor sit amet consectetur adipisicing elit. Explicabo saepe repellendus accusantium eveniet temporibus perspiciatis iure ut, pariatur nihil totam iusto, delectus, modi possimus soluta. Et iusto odio autem debitis!"}),/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,children:"Copy Example without any HTML tag"}),"Lorem ipsum dolor sit amet consectetur adipisicing elit. Explicabo saepe repellendus accusantium eveniet temporibus perspiciatis iure ut, pariatur nihil totam iusto, delectus, modi possimus soluta. Et iusto odio autem debitis!"]});
1
+ import{Typography}from"../common/propsValues/typography";import Title from"../title";import Body from"./Body";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";export default{title:"Typography/Body",component:Body,tags:["autodocs"]};export var Basic=function(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,children:"Body Large Bold"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,children:"Body Default"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,children:"Body Default Bold"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,children:"Body Large"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs(Title,{type:Typography.TITLE_SUBSECTION,children:["Copy Example without ",/*#__PURE__*/_jsx("code",{children:"<Body />"})," component"]}),/*#__PURE__*/_jsx("p",{children:"Lorem ipsum dolor sit amet consectetur adipisicing elit. Explicabo saepe repellendus accusantium eveniet temporibus perspiciatis iure ut, pariatur nihil totam iusto, delectus, modi possimus soluta. Et iusto odio autem debitis!"}),/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,children:"Copy Example without any HTML tag"}),"Lorem ipsum dolor sit amet consectetur adipisicing elit. Explicabo saepe repellendus accusantium eveniet temporibus perspiciatis iure ut, pariatur nihil totam iusto, delectus, modi possimus soluta. Et iusto odio autem debitis!"]})};
@@ -1,7 +1,7 @@
1
- import classNames from"classnames";import{forwardRef}from"react";import{Size,ControlType,Priority}from"../common";import{typeClassMap,priorityClassMap}from"./classMap";import{establishNewPriority,establishNewType,logDeprecationNotices}from"./legacyUtils";/** @deprecated */import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const Button=/*#__PURE__*/forwardRef((a,b)=>{let{as:c,block:h=!1,children:d,className:e,disabled:f,loading:i=!1,priority:j=Priority.PRIMARY,size:k=Size.MEDIUM,type:l=ControlType.ACCENT,...g}=a;logDeprecationNotices({size:k,type:l});// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
2
- const m=establishNewType(l),n=establishNewPriority(j,l),o=classNames(`btn btn-${k}`,`np-btn np-btn-${k}`,{"btn-loading":i,"btn-block np-btn-block":h},{disabled:f||i},// @ts-expect-error fix when refactor `typeClassMap` to TypeScript
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["as","block","children","className","disabled","loading","priority","size","type"],_excluded2=["htmlType"];import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import{forwardRef}from"react";import{Size,ControlType,Priority}from"../common";import{typeClassMap,priorityClassMap}from"./classMap";import{establishNewPriority,establishNewType,logDeprecationNotices}from"./legacyUtils";/** @deprecated */import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Button=/*#__PURE__*/forwardRef(function(a,b){var c,d=a.as,e=a.block,f=void 0!==e&&e,g=a.children,h=a.className,i=a.disabled,j=a.loading,k=void 0!==j&&j,l=a.priority,m=void 0===l?Priority.PRIMARY:l,n=a.size,o=void 0===n?Size.MEDIUM:n,p=a.type,q=void 0===p?ControlType.ACCENT:p,r=_objectWithoutProperties(a,_excluded);logDeprecationNotices({size:o,type:q});// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
2
+ var s,t=establishNewType(q),u=establishNewPriority(m,q),v=classNames("btn btn-".concat(o),"np-btn np-btn-".concat(o),{"btn-loading":k,"btn-block np-btn-block":f},{disabled:i||k},// @ts-expect-error fix when refactor `typeClassMap` to TypeScript
3
3
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
4
- typeClassMap[m],// @ts-expect-error fix when refactor `typeClassMap` to TypeScript
4
+ typeClassMap[t],// @ts-expect-error fix when refactor `typeClassMap` to TypeScript
5
5
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
6
- priorityClassMap[n],e),p=c??"button";// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
7
- let q;if("button"===p){const{htmlType:b="button",...a}=g;q={...a,disabled:f||i,type:b}}else q={...g};return/*#__PURE__*/_jsxs(p,{ref:b,className:o,...q,children:[d,i&&/*#__PURE__*/_jsx("span",{className:classNames("btn-loader",{"m-l-2":!h})})]})});export default Button;
6
+ priorityClassMap[u],h),w=null!==(c=d)&&void 0!==c?c:"button";// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
7
+ if("button"===w){var x=r,y=x.htmlType,z=void 0===y?"button":y,A=_objectWithoutProperties(x,_excluded2);s=_objectSpread(_objectSpread({},A),{},{disabled:i||k,type:z})}else s=_objectSpread({},r);return/*#__PURE__*/_jsxs(w,_objectSpread(_objectSpread({ref:b,className:v},s),{},{children:[g,k&&/*#__PURE__*/_jsx("span",{className:classNames("btn-loader",{"m-l-2":!f})})]}))});export default Button;
@@ -1 +1 @@
1
- import{userEvent,within}from"@storybook/testing-library";import{ControlType,Priority}from"../common";import{storyConfig}from"../test-utils";import Button from"./Button";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";export default{component:Button,title:"Actions/Button",args:{children:"Button text"},argTypes:{as:{type:{name:"enum",value:["button","a"]}}},tags:["autodocs"]};export const Basic={};export const Focused=storyConfig({parameters:{chromatic:{delay:1e3}},play:a=>{let{canvasElement:b}=a;const c=within(b);userEvent.click(c.getByRole("button"))}},{variants:["dark"]});export const Variants=storyConfig({args:{className:"m-r-2"},render:a=>/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs("div",{className:"m-b-2",children:[/*#__PURE__*/_jsx("div",{className:"title-4 m-b-1",children:"Accent"}),/*#__PURE__*/_jsx(Button,{...a,priority:Priority.PRIMARY,type:ControlType.ACCENT}),/*#__PURE__*/_jsx(Button,{...a,priority:Priority.SECONDARY,type:ControlType.ACCENT}),/*#__PURE__*/_jsx(Button,{...a,priority:Priority.TERTIARY,type:ControlType.ACCENT})]}),/*#__PURE__*/_jsxs("div",{className:"m-b-2",children:[/*#__PURE__*/_jsx("div",{className:"title-4 m-b-1",children:"Positive"}),/*#__PURE__*/_jsx(Button,{...a,priority:Priority.PRIMARY,type:ControlType.POSITIVE}),/*#__PURE__*/_jsx(Button,{...a,priority:Priority.SECONDARY,type:ControlType.POSITIVE})]}),/*#__PURE__*/_jsxs("div",{className:"m-b-2",children:[/*#__PURE__*/_jsx("div",{className:"title-4 m-b-1",children:"Negative"}),/*#__PURE__*/_jsx(Button,{...a,priority:Priority.PRIMARY,type:ControlType.NEGATIVE}),/*#__PURE__*/_jsx(Button,{...a,priority:Priority.SECONDARY,type:ControlType.NEGATIVE})]}),/*#__PURE__*/_jsxs("div",{className:"m-b-2",children:[/*#__PURE__*/_jsx("div",{className:"title-4 m-b-1",children:"Disabled"}),/*#__PURE__*/_jsx(Button,{...a,priority:Priority.PRIMARY,disabled:!0}),/*#__PURE__*/_jsx(Button,{...a,priority:Priority.SECONDARY,disabled:!0}),/*#__PURE__*/_jsx(Button,{...a,priority:Priority.TERTIARY,disabled:!0})]})]})},{variants:["default","dark","rtl"]});export const SocialMedia=storyConfig({render:()=>/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("div",{className:"m-b-2",children:/*#__PURE__*/_jsx("button",{type:"button",className:"btn btn-google",children:"Login with Google"})}),/*#__PURE__*/_jsx("div",{className:"m-b-2",children:/*#__PURE__*/_jsx("button",{type:"button",className:"btn btn-facebook",children:"Login with Facebook"})})]})},{variants:["default","dark","rtl"]});export const SocialMediaMobile=storyConfig(SocialMedia,{variants:["default","dark","rtl","mobile"]});
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{userEvent,within}from"@storybook/testing-library";import{ControlType,Priority}from"../common";import{storyConfig}from"../test-utils";import Button from"./Button";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";export default{component:Button,title:"Actions/Button",args:{children:"Button text"},argTypes:{as:{type:{name:"enum",value:["button","a"]}}},tags:["autodocs"]};export var Basic={};export var Focused=storyConfig({parameters:{chromatic:{delay:1e3}},play:function play(a){var b=a.canvasElement,c=within(b);userEvent.click(c.getByRole("button"))}},{variants:["dark"]});export var Variants=storyConfig({args:{className:"m-r-2"},render:function render(a){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs("div",{className:"m-b-2",children:[/*#__PURE__*/_jsx("div",{className:"title-4 m-b-1",children:"Accent"}),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.PRIMARY,type:ControlType.ACCENT})),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.SECONDARY,type:ControlType.ACCENT})),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.TERTIARY,type:ControlType.ACCENT}))]}),/*#__PURE__*/_jsxs("div",{className:"m-b-2",children:[/*#__PURE__*/_jsx("div",{className:"title-4 m-b-1",children:"Positive"}),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.PRIMARY,type:ControlType.POSITIVE})),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.SECONDARY,type:ControlType.POSITIVE}))]}),/*#__PURE__*/_jsxs("div",{className:"m-b-2",children:[/*#__PURE__*/_jsx("div",{className:"title-4 m-b-1",children:"Negative"}),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.PRIMARY,type:ControlType.NEGATIVE})),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.SECONDARY,type:ControlType.NEGATIVE}))]}),/*#__PURE__*/_jsxs("div",{className:"m-b-2",children:[/*#__PURE__*/_jsx("div",{className:"title-4 m-b-1",children:"Disabled"}),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.PRIMARY,disabled:!0})),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.SECONDARY,disabled:!0})),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.TERTIARY,disabled:!0}))]})]})}},{variants:["default","dark","rtl"]});export var SocialMedia=storyConfig({render:function render(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("div",{className:"m-b-2",children:/*#__PURE__*/_jsx("button",{type:"button",className:"btn btn-google",children:"Login with Google"})}),/*#__PURE__*/_jsx("div",{className:"m-b-2",children:/*#__PURE__*/_jsx("button",{type:"button",className:"btn btn-facebook",children:"Login with Facebook"})})]})}},{variants:["default","dark","rtl"]});export var SocialMediaMobile=storyConfig(SocialMedia,{variants:["default","dark","rtl","mobile"]});
@@ -1 +1 @@
1
- import{ControlType,Priority}from"../common";export const typeClassMap={[ControlType.ACCENT]:"btn-accent",[ControlType.POSITIVE]:"btn-positive",[ControlType.NEGATIVE]:"btn-negative"};export const priorityClassMap={[Priority.PRIMARY]:"btn-priority-1",[Priority.SECONDARY]:"btn-priority-2",[Priority.TERTIARY]:"btn-priority-3"};
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";var _typeClassMap,_priorityClassMap;import{ControlType,Priority}from"../common";export var typeClassMap=(_typeClassMap={},_defineProperty(_typeClassMap,ControlType.ACCENT,"btn-accent"),_defineProperty(_typeClassMap,ControlType.POSITIVE,"btn-positive"),_defineProperty(_typeClassMap,ControlType.NEGATIVE,"btn-negative"),_typeClassMap);export var priorityClassMap=(_priorityClassMap={},_defineProperty(_priorityClassMap,Priority.PRIMARY,"btn-priority-1"),_defineProperty(_priorityClassMap,Priority.SECONDARY,"btn-priority-2"),_defineProperty(_priorityClassMap,Priority.TERTIARY,"btn-priority-3"),_priorityClassMap);
@@ -1,4 +1,4 @@
1
- import{ControlType,Priority,Size,Type}from"../../common";import{logActionRequiredIf}from"../../utilities";const deprecatedTypeMap={[Type.PRIMARY]:ControlType.ACCENT,[Type.SECONDARY]:ControlType.ACCENT,[Type.LINK]:ControlType.ACCENT,[Type.PAY]:ControlType.POSITIVE,[Type.DANGER]:ControlType.NEGATIVE},oldTypePriorityMap={[Type.DANGER]:Priority.SECONDARY,[Type.LINK]:Priority.TERTIARY,[Type.SECONDARY]:Priority.SECONDARY},deprecatedTypeMapMessage={[Type.DANGER]:"Type.NEGATIVE",[Type.LINK]:"ControlType.ACCENT with priority Priority.TERTIARY",[Type.PAY]:"ControlType.POSITIVE",[Type.PRIMARY]:"ControlType.ACCENT",[Type.SECONDARY]:"ControlType.ACCENT with priority Priority.SECONDARY"},deprecatedTypes=Object.keys(deprecatedTypeMap);export const establishNewType=a=>deprecatedTypeMap[a]||a;export const establishNewPriority=(a,b)=>{const c=establishNewType(b);// The old SECONDARY and LINK types now map to priorities. If they're still using one of
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";var _deprecatedTypeMap,_oldTypePriorityMap,_deprecatedTypeMapMes;import"core-js/modules/es.object.keys.js";import"core-js/modules/es.array.concat.js";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import{ControlType,Priority,Size,Type}from"../../common";import{logActionRequiredIf}from"../../utilities";var deprecatedTypeMap=(_deprecatedTypeMap={},_defineProperty(_deprecatedTypeMap,Type.PRIMARY,ControlType.ACCENT),_defineProperty(_deprecatedTypeMap,Type.SECONDARY,ControlType.ACCENT),_defineProperty(_deprecatedTypeMap,Type.LINK,ControlType.ACCENT),_defineProperty(_deprecatedTypeMap,Type.PAY,ControlType.POSITIVE),_defineProperty(_deprecatedTypeMap,Type.DANGER,ControlType.NEGATIVE),_deprecatedTypeMap),oldTypePriorityMap=(_oldTypePriorityMap={},_defineProperty(_oldTypePriorityMap,Type.DANGER,Priority.SECONDARY),_defineProperty(_oldTypePriorityMap,Type.LINK,Priority.TERTIARY),_defineProperty(_oldTypePriorityMap,Type.SECONDARY,Priority.SECONDARY),_oldTypePriorityMap),deprecatedTypeMapMessage=(_deprecatedTypeMapMes={},_defineProperty(_deprecatedTypeMapMes,Type.DANGER,"Type.NEGATIVE"),_defineProperty(_deprecatedTypeMapMes,Type.LINK,"ControlType.ACCENT with priority Priority.TERTIARY"),_defineProperty(_deprecatedTypeMapMes,Type.PAY,"ControlType.POSITIVE"),_defineProperty(_deprecatedTypeMapMes,Type.PRIMARY,"ControlType.ACCENT"),_defineProperty(_deprecatedTypeMapMes,Type.SECONDARY,"ControlType.ACCENT with priority Priority.SECONDARY"),_deprecatedTypeMapMes),deprecatedTypes=Object.keys(deprecatedTypeMap);export var establishNewType=function(a){return deprecatedTypeMap[a]||a};export var establishNewPriority=function(a,b){var c=establishNewType(b);// The old SECONDARY and LINK types now map to priorities. If they're still using one of
2
2
  // these old types, ignore whatever priority they've passed and use this instead.
3
3
  return oldTypePriorityMap[b]?oldTypePriorityMap[b]:a===Priority.TERTIARY&&c!==ControlType.ACCENT?Priority.SECONDARY:a;// Only ControlType.ACCENT supports tertiary styles
4
- };export const logDeprecationNotices=a=>{let{size:b,type:c}=a;logActionRequiredIf("Button has deprecated the `Size.EXTRA_SMALL` value for the `size` prop. Please use Size.SMALL instead.",b===Size.EXTRA_SMALL),logActionRequiredIf(`Button has deprecated the ${c} value for the \`type\` prop. Please update to ${deprecatedTypeMapMessage[c]}.`,deprecatedTypes.includes(c))};
4
+ };export var logDeprecationNotices=function(a){var b=a.size,c=a.type;logActionRequiredIf("Button has deprecated the `Size.EXTRA_SMALL` value for the `size` prop. Please use Size.SMALL instead.",b===Size.EXTRA_SMALL),logActionRequiredIf("Button has deprecated the ".concat(c," value for the `type` prop. Please update to ").concat(deprecatedTypeMapMessage[c],"."),deprecatedTypes.includes(c))};
@@ -1 +1 @@
1
- import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef}from"react";import requiredIf from"react-required-if";import Body from"../body";import Chevron from"../chevron";import{Position,Typography}from"../common";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const Card=/*#__PURE__*/forwardRef((a,b)=>{const{"aria-label":c,as:d,isExpanded:e,title:f,details:g,children:h,onClick:i,icon:j,id:k,className:l,...m}=a,n=!!(e&&h);return/*#__PURE__*/_jsxs(d,{ref:b,className:classNames("np-card",l,{"np-card--expanded":n,"np-card--inactive":!h,"np-card--has-icon":!!j}),id:k,"data-testid":m["data-testid"],children:[/*#__PURE__*/_jsx(Option,{"aria-label":c,as:h?"button":"div",className:classNames("np-card__button"),media:j,title:f,content:g,showMediaAtAllSizes:!0,button:h&&/*#__PURE__*/_jsx(Chevron,{orientation:n?Position.TOP:Position.BOTTOM}),onClick:()=>h&&i(!e)}),/*#__PURE__*/_jsx("div",{className:classNames("np-card__divider",{"np-card__divider--expanded":n})}),n&&/*#__PURE__*/_jsx(Body,{as:"span",type:Typography.BODY_LARGE,className:"np-card__content d-block",children:h})]})}),hasChildren=a=>{let{children:b}=a;return b};Card.propTypes={"aria-label":PropTypes.string,as:PropTypes.string,isExpanded:requiredIf(PropTypes.bool,hasChildren),title:PropTypes.node.isRequired,details:PropTypes.node.isRequired,onClick:requiredIf(PropTypes.func,hasChildren),icon:PropTypes.node,children:PropTypes.node,id:PropTypes.string,className:PropTypes.string,"data-testid":PropTypes.string},Card.defaultProps={"aria-label":void 0,as:"div",children:null,id:null,className:null,"data-testid":null};export default Card;
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["aria-label","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 Body from"../body";import Chevron from"../chevron";import{Position,Typography}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["aria-label"],d=a.as,e=a.isExpanded,f=a.title,g=a.details,h=a.children,i=a.onClick,j=a.icon,k=a.id,l=a.className,m=_objectWithoutProperties(a,_excluded),n=!!(e&&h);return/*#__PURE__*/_jsxs(d,{ref:b,className:classNames("np-card",l,{"np-card--expanded":n,"np-card--inactive":!h,"np-card--has-icon":!!j}),id:k,"data-testid":m["data-testid"],children:[/*#__PURE__*/_jsx(Option,{"aria-label":c,as:h?"button":"div",className:classNames("np-card__button"),media:j,title:f,content:g,showMediaAtAllSizes:!0,button:h&&/*#__PURE__*/_jsx(Chevron,{orientation:n?Position.TOP:Position.BOTTOM}),onClick:function onClick(){return h&&i(!e)}}),/*#__PURE__*/_jsx("div",{className:classNames("np-card__divider",{"np-card__divider--expanded":n})}),n&&/*#__PURE__*/_jsx(Body,{as:"span",type:Typography.BODY_LARGE,className:"np-card__content d-block",children:h})]})}),hasChildren=function(a){var b=a.children;return b};Card.propTypes={"aria-label":PropTypes.string,as:PropTypes.string,isExpanded:requiredIf(PropTypes.bool,hasChildren),title:PropTypes.node.isRequired,details:PropTypes.node.isRequired,onClick:requiredIf(PropTypes.func,hasChildren),icon:PropTypes.node,children:PropTypes.node,id:PropTypes.string,className:PropTypes.string,"data-testid":PropTypes.string},Card.defaultProps={"aria-label":void 0,as:"div",children:null,id:null,className:null,"data-testid":null};export default Card;
@@ -1 +1 @@
1
- import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import Body from"../body/Body";import CheckboxButton from"../checkboxButton";import{Typography}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const Checkbox=a=>{let{id:b,checked:c,required:d,disabled:e,readOnly:f,label:g,className:h,secondary:i,onChange:j,onFocus:k,onBlur:l}=a;const{isModern:m}=useTheme(),n=classNames("np-checkbox",{checkbox:!0,"checkbox-lg":i,disabled:m&&e},h),o=e||f;return/*#__PURE__*/_jsx("div",{id:b,className:n,children:/*#__PURE__*/_jsxs("label",{className:classNames({disabled:e}),children:[/*#__PURE__*/_jsx(CheckboxButton,{className:"p-r-2",checked:c,disabled:o,required:!o&&d,onFocus:k,onChange:()=>j(!c),onBlur:l}),/*#__PURE__*/_jsxs(Body,{as:"span",className:"np-checkbox__text",type:i?Typography.BODY_LARGE_BOLD:Typography.BODY_LARGE,children:[/*#__PURE__*/_jsx("span",{className:d?"has-required":void 0,children:g}),i&&/*#__PURE__*/_jsx(Body,{as:"span",className:classNames({secondary:!m}),children:i})]})]})})};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,className:PropTypes.string},Checkbox.defaultProps={id:null,checked:!1,required:!1,disabled:!1,readOnly:!1,secondary:null,onFocus:null,onBlur:null,className:void 0};export default Checkbox;
1
+ import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import Body from"../body/Body";import CheckboxButton from"../checkboxButton";import{Typography}from"../common";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.className,i=a.secondary,j=a.onChange,k=a.onFocus,l=a.onBlur,m=useTheme(),n=m.isModern,o=classNames("np-checkbox",{checkbox:!0,"checkbox-lg":i,disabled:n&&e},h),p=e||f;return/*#__PURE__*/_jsx("div",{id:b,className:o,children:/*#__PURE__*/_jsxs("label",{className:classNames({disabled:e}),children:[/*#__PURE__*/_jsx(CheckboxButton,{className:"p-r-2",checked:c,disabled:p,required:!p&&d,onFocus:k,onChange:function onChange(){return j(!c)},onBlur:l}),/*#__PURE__*/_jsxs(Body,{as:"span",className:"np-checkbox__text",type:i?Typography.BODY_LARGE_BOLD:Typography.BODY_LARGE,children:[/*#__PURE__*/_jsx("span",{className:d?"has-required":void 0,children:g}),i&&/*#__PURE__*/_jsx(Body,{as:"span",className:classNames({secondary:!n}),children:i})]})]})})};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,className:PropTypes.string},Checkbox.defaultProps={id:null,checked:!1,required:!1,disabled:!1,readOnly:!1,secondary:null,onFocus:null,onBlur:null,className:void 0};export default Checkbox;