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

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 (616) hide show
  1. package/build/es/no-polyfill/accordion/Accordion.js +1 -1
  2. package/build/es/no-polyfill/accordion/Accordion.story.js +1 -1
  3. package/build/es/no-polyfill/accordion/AccordionItem/AccordionItem.js +1 -1
  4. package/build/es/no-polyfill/actionButton/ActionButton.js +1 -1
  5. package/build/es/no-polyfill/actionButton/ActionButton.spec.js +1 -1
  6. package/build/es/no-polyfill/actionButton/ActionButton.story.js +1 -1
  7. package/build/es/no-polyfill/actionOption/ActionOption.js +1 -1
  8. package/build/es/no-polyfill/actionOption/ActionOption.story.js +1 -1
  9. package/build/es/no-polyfill/alert/Alert.js +1 -1
  10. package/build/es/no-polyfill/alert/Alert.story.js +1 -1
  11. package/build/es/no-polyfill/alert/inlineMarkdown/InlineMarkdown.js +1 -1
  12. package/build/es/no-polyfill/alert/withArrow/alertArrowPositions.js +1 -1
  13. package/build/es/no-polyfill/alert/withArrow/withArrow.js +1 -1
  14. package/build/es/no-polyfill/avatar/Avatar.js +1 -1
  15. package/build/es/no-polyfill/avatar/Avatar.story.js +1 -1
  16. package/build/es/no-polyfill/avatar/avatarTypes.js +1 -1
  17. package/build/es/no-polyfill/avatar/colors/colors.js +2 -2
  18. package/build/es/no-polyfill/avatarWrapper/AvatarWrapper.js +1 -1
  19. package/build/es/no-polyfill/avatarWrapper/AvatarWrapper.story.js +1 -1
  20. package/build/es/no-polyfill/badge/Badge.js +1 -1
  21. package/build/es/no-polyfill/body/Body.js +2 -2
  22. package/build/es/no-polyfill/body/Body.spec.js +1 -1
  23. package/build/es/no-polyfill/body/Body.story.js +1 -1
  24. package/build/es/no-polyfill/button/Button.js +5 -5
  25. package/build/es/no-polyfill/button/Button.story.js +1 -1
  26. package/build/es/no-polyfill/button/classMap.js +1 -1
  27. package/build/es/no-polyfill/button/legacyUtils/legacyUtils.js +2 -2
  28. package/build/es/no-polyfill/card/Card.js +1 -1
  29. package/build/es/no-polyfill/checkbox/Checkbox.js +1 -1
  30. package/build/es/no-polyfill/checkbox/Checkbox.story.js +1 -1
  31. package/build/es/no-polyfill/checkboxButton/CheckboxButton.js +1 -1
  32. package/build/es/no-polyfill/checkboxButton/CheckboxButton.spec.js +1 -1
  33. package/build/es/no-polyfill/checkboxButton/CheckboxButton.story.js +2 -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/Emphasis.story.js +1 -0
  132. package/build/es/no-polyfill/emphasis/EmphasisHtmlTransformer.js +2 -2
  133. package/build/es/no-polyfill/flowNavigation/FlowNavigation.js +2 -2
  134. package/build/es/no-polyfill/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
  135. package/build/es/no-polyfill/flowNavigation/backButton/BackButton.js +1 -1
  136. package/build/es/no-polyfill/header/Header.js +2 -2
  137. package/build/es/no-polyfill/header/Header.spec.js +1 -1
  138. package/build/es/no-polyfill/header/Header.story.js +2 -1
  139. package/build/es/no-polyfill/i18n/index.js +1 -1
  140. package/build/es/no-polyfill/image/Image.js +2 -2
  141. package/build/es/no-polyfill/info/Info.js +1 -1
  142. package/build/es/no-polyfill/info/Info.story.js +1 -1
  143. package/build/es/no-polyfill/info/infoPresentations.js +1 -1
  144. package/build/es/no-polyfill/inlineAlert/InlineAlert.js +1 -1
  145. package/build/es/no-polyfill/inputWithDisplayFormat/InputWithDisplayFormat.js +1 -1
  146. package/build/es/no-polyfill/inputs/Input.js +1 -1
  147. package/build/es/no-polyfill/inputs/TextArea.js +1 -1
  148. package/build/es/no-polyfill/inputs/_common.js +2 -2
  149. package/build/es/no-polyfill/instructionsList/InstructionsList.js +3 -3
  150. package/build/es/no-polyfill/link/Link.js +2 -2
  151. package/build/es/no-polyfill/link/Link.spec.js +1 -1
  152. package/build/es/no-polyfill/link/Link.story.js +1 -1
  153. package/build/es/no-polyfill/listItem/ListItem.js +1 -1
  154. package/build/es/no-polyfill/listItem/ListItem.spec.js +1 -1
  155. package/build/es/no-polyfill/listItem/ListItem.story.js +1 -1
  156. package/build/es/no-polyfill/loader/Loader.js +2 -2
  157. package/build/es/no-polyfill/loader/Loader.story.js +1 -1
  158. package/build/es/no-polyfill/logo/Logo.js +1 -1
  159. package/build/es/no-polyfill/logo/Logo.story.js +1 -1
  160. package/build/es/no-polyfill/logo/logoTypes.js +1 -1
  161. package/build/es/no-polyfill/markdown/Markdown.js +1 -1
  162. package/build/es/no-polyfill/markdown/Markdown.story.js +1 -0
  163. package/build/es/no-polyfill/modal/Modal.js +1 -1
  164. package/build/es/no-polyfill/modal/Modal.story.js +2 -2
  165. package/build/es/no-polyfill/money/Money.js +1 -1
  166. package/build/es/no-polyfill/money/Money.story.js +1 -1
  167. package/build/es/no-polyfill/moneyInput/MoneyInput.js +1 -1
  168. package/build/es/no-polyfill/moneyInput/MoneyInput.story.js +1 -1
  169. package/build/es/no-polyfill/moneyInput/currencyFormatting.js +2 -2
  170. package/build/es/no-polyfill/navigationOption/NavigationOption.js +1 -1
  171. package/build/es/no-polyfill/navigationOptionsList/NavigationOptionsList.js +1 -1
  172. package/build/es/no-polyfill/nudge/Nudge.js +1 -1
  173. package/build/es/no-polyfill/overlayHeader/OverlayHeader.js +1 -1
  174. package/build/es/no-polyfill/phoneNumberInput/PhoneNumberInput.js +1 -1
  175. package/build/es/no-polyfill/phoneNumberInput/data/countries.js +1 -1
  176. package/build/es/no-polyfill/phoneNumberInput/utils/cleanNumber/cleanNumber.js +1 -1
  177. package/build/es/no-polyfill/phoneNumberInput/utils/excludeCountries/excludeCountries.js +2 -2
  178. package/build/es/no-polyfill/phoneNumberInput/utils/explodeNumberModel/index.js +1 -1
  179. package/build/es/no-polyfill/phoneNumberInput/utils/filterOptionsForQuery/index.js +1 -1
  180. package/build/es/no-polyfill/phoneNumberInput/utils/findCountryByCode/index.js +1 -1
  181. package/build/es/no-polyfill/phoneNumberInput/utils/findCountryByPrefix/index.js +1 -1
  182. package/build/es/no-polyfill/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.js +1 -1
  183. package/build/es/no-polyfill/phoneNumberInput/utils/isOptionAndFitsQuery/isOptionAndFitsQuery.js +1 -1
  184. package/build/es/no-polyfill/phoneNumberInput/utils/isStringNumeric/isStringNumeric.js +1 -1
  185. package/build/es/no-polyfill/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js +1 -1
  186. package/build/es/no-polyfill/phoneNumberInput/utils/longestMatchingPrefix/index.js +1 -1
  187. package/build/es/no-polyfill/phoneNumberInput/utils/setDefaultPrefix/index.js +3 -3
  188. package/build/es/no-polyfill/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.js +2 -2
  189. package/build/es/no-polyfill/popover/Popover.js +2 -2
  190. package/build/es/no-polyfill/processIndicator/ProcessIndicator.js +4 -4
  191. package/build/es/no-polyfill/progress/Progress.js +1 -1
  192. package/build/es/no-polyfill/progress/Progress.story.js +1 -1
  193. package/build/es/no-polyfill/progressBar/ProgressBar.js +1 -1
  194. package/build/es/no-polyfill/progressBar/ProgressBar.story.js +1 -1
  195. package/build/es/no-polyfill/provider/Provider.js +1 -1
  196. package/build/es/no-polyfill/provider/Provider.spec.js +1 -1
  197. package/build/es/no-polyfill/provider/Provider.story.js +1 -1
  198. package/build/es/no-polyfill/provider/direction/DirectionProvider.js +1 -1
  199. package/build/es/no-polyfill/provider/direction/DirectionProvider.spec.js +1 -1
  200. package/build/es/no-polyfill/provider/language/LanguageProvider.js +1 -1
  201. package/build/es/no-polyfill/provider/language/LanguageProvider.spec.js +1 -1
  202. package/build/es/no-polyfill/radio/Radio.js +1 -1
  203. package/build/es/no-polyfill/radioGroup/RadioGroup.js +2 -2
  204. package/build/es/no-polyfill/radioOption/RadioOption.js +1 -1
  205. package/build/es/no-polyfill/section/Section.js +1 -1
  206. package/build/es/no-polyfill/section/Section.spec.js +1 -1
  207. package/build/es/no-polyfill/section/Section.story.js +1 -1
  208. package/build/es/no-polyfill/select/Select.js +8 -9
  209. package/build/es/no-polyfill/select/option/Option.js +1 -1
  210. package/build/es/no-polyfill/select/searchBox/SearchBox.js +1 -1
  211. package/build/es/no-polyfill/sizeSwapper/SizeSwapper.js +3 -3
  212. package/build/es/no-polyfill/slidingPanel/SlidingPanel.js +2 -2
  213. package/build/es/no-polyfill/snackbar/Snackbar.js +1 -1
  214. package/build/es/no-polyfill/snackbar/SnackbarContext.js +1 -1
  215. package/build/es/no-polyfill/snackbar/SnackbarProvider.js +1 -1
  216. package/build/es/no-polyfill/snackbar/useSnackbar.js +1 -1
  217. package/build/es/no-polyfill/statusIcon/StatusIcon.js +1 -1
  218. package/build/es/no-polyfill/statusIcon/StatusIcon.story.js +1 -1
  219. package/build/es/no-polyfill/stepper/Stepper.js +1 -1
  220. package/build/es/no-polyfill/stepper/deviceDetection.js +2 -2
  221. package/build/es/no-polyfill/sticky/Sticky.js +1 -1
  222. package/build/es/no-polyfill/summary/Summary.js +1 -1
  223. package/build/es/no-polyfill/switch/Switch.js +1 -1
  224. package/build/es/no-polyfill/switch/Switch.story.js +1 -1
  225. package/build/es/no-polyfill/switchOption/SwitchOption.js +1 -1
  226. package/build/es/no-polyfill/switchOption/SwitchOption.story.js +1 -1
  227. package/build/es/no-polyfill/tabs/Tab.js +1 -1
  228. package/build/es/no-polyfill/tabs/TabList.js +1 -1
  229. package/build/es/no-polyfill/tabs/TabPanel.js +1 -1
  230. package/build/es/no-polyfill/tabs/Tabs.js +1 -5
  231. package/build/es/no-polyfill/tabs/utils.js +2 -2
  232. package/build/es/no-polyfill/textareaWithDisplayFormat/TextareaWithDisplayFormat.js +1 -1
  233. package/build/es/no-polyfill/tile/Tile.js +1 -1
  234. package/build/es/no-polyfill/title/Title.js +1 -1
  235. package/build/es/no-polyfill/title/Title.spec.js +1 -1
  236. package/build/es/no-polyfill/title/Title.story.js +1 -1
  237. package/build/es/no-polyfill/tooltip/Tooltip.js +7 -7
  238. package/build/es/no-polyfill/tooltip/Tooltip.spec.js +1 -1
  239. package/build/es/no-polyfill/tooltip/Tooltip.story.js +1 -1
  240. package/build/es/no-polyfill/typeahead/Typeahead.js +1 -1
  241. package/build/es/no-polyfill/typeahead/typeaheadInput/TypeaheadInput.js +1 -1
  242. package/build/es/no-polyfill/typeahead/typeaheadOption/TypeaheadOption.js +1 -1
  243. package/build/es/no-polyfill/typeahead/util/highlight.js +1 -1
  244. package/build/es/no-polyfill/upload/Upload.js +2 -6
  245. package/build/es/no-polyfill/upload/steps/completeStep/completeStep.js +1 -1
  246. package/build/es/no-polyfill/upload/steps/mediaUploadStep/mediaUploadStep.js +1 -1
  247. package/build/es/no-polyfill/upload/steps/processingStep/processingStep.js +1 -1
  248. package/build/es/no-polyfill/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
  249. package/build/es/no-polyfill/upload/uploadSteps.js +1 -1
  250. package/build/es/no-polyfill/upload/utils/asyncFileRead/asyncFileRead.js +1 -1
  251. package/build/es/no-polyfill/upload/utils/getFileType/getFileType.js +1 -1
  252. package/build/es/no-polyfill/upload/utils/getSupportedSpotMimeTypes/getSupportedSpotMimeTypes.js +1 -1
  253. package/build/es/no-polyfill/upload/utils/isSizeValid/isSizeValid.js +1 -1
  254. package/build/es/no-polyfill/upload/utils/isTypeValid/isTypeValid.js +1 -1
  255. package/build/es/no-polyfill/upload/utils/postData/postData.js +1 -1
  256. package/build/es/no-polyfill/upload/utils/requestMedia/requestMedia.js +1 -1
  257. package/build/es/no-polyfill/uploadInput/UploadInput.js +7 -7
  258. package/build/es/no-polyfill/uploadInput/UploadInput.spec.js +1 -1
  259. package/build/es/no-polyfill/uploadInput/UploadInput.story.js +1 -1
  260. package/build/es/no-polyfill/uploadInput/uploadButton/UploadButton.js +1 -1
  261. package/build/es/no-polyfill/uploadInput/uploadButton/UploadButton.spec.js +3 -3
  262. package/build/es/no-polyfill/uploadInput/uploadButton/defaults.js +1 -1
  263. package/build/es/no-polyfill/uploadInput/uploadButton/getAllowedFileTypes.js +3 -3
  264. package/build/es/no-polyfill/uploadInput/uploadButton/getAllowedFileTypes.spec.js +1 -1
  265. package/build/es/no-polyfill/uploadInput/uploadItem/UploadItem.js +2 -2
  266. package/build/es/no-polyfill/uploadInput/uploadItem/UploadItem.spec.js +1 -1
  267. package/build/es/no-polyfill/uploadInput/uploadItem/UploadItemBody.js +1 -1
  268. package/build/es/no-polyfill/utilities/deprecatedProperty/deprecatedProperty.js +1 -1
  269. package/build/es/no-polyfill/utilities/logActionRequired.js +1 -1
  270. package/build/es/no-polyfill/withDisplayFormat/WithDisplayFormat.js +3 -4
  271. package/build/es/no-polyfill/withNextPortal/withNextPortal.js +1 -1
  272. package/build/es/polyfill/accordion/Accordion.js +1 -1
  273. package/build/es/polyfill/accordion/Accordion.story.js +1 -1
  274. package/build/es/polyfill/accordion/AccordionItem/AccordionItem.js +1 -1
  275. package/build/es/polyfill/actionButton/ActionButton.js +1 -1
  276. package/build/es/polyfill/actionButton/ActionButton.spec.js +1 -1
  277. package/build/es/polyfill/actionButton/ActionButton.story.js +1 -1
  278. package/build/es/polyfill/actionOption/ActionOption.js +1 -1
  279. package/build/es/polyfill/actionOption/ActionOption.story.js +1 -1
  280. package/build/es/polyfill/alert/Alert.js +1 -1
  281. package/build/es/polyfill/alert/Alert.story.js +1 -1
  282. package/build/es/polyfill/alert/inlineMarkdown/InlineMarkdown.js +1 -1
  283. package/build/es/polyfill/alert/withArrow/alertArrowPositions.js +1 -1
  284. package/build/es/polyfill/alert/withArrow/withArrow.js +1 -1
  285. package/build/es/polyfill/avatar/Avatar.js +1 -1
  286. package/build/es/polyfill/avatar/Avatar.story.js +1 -1
  287. package/build/es/polyfill/avatar/avatarTypes.js +1 -1
  288. package/build/es/polyfill/avatar/colors/colors.js +2 -2
  289. package/build/es/polyfill/avatarWrapper/AvatarWrapper.js +1 -1
  290. package/build/es/polyfill/avatarWrapper/AvatarWrapper.story.js +1 -1
  291. package/build/es/polyfill/badge/Badge.js +1 -1
  292. package/build/es/polyfill/body/Body.js +2 -2
  293. package/build/es/polyfill/body/Body.spec.js +1 -1
  294. package/build/es/polyfill/body/Body.story.js +1 -1
  295. package/build/es/polyfill/button/Button.js +5 -5
  296. package/build/es/polyfill/button/Button.story.js +1 -1
  297. package/build/es/polyfill/button/classMap.js +1 -1
  298. package/build/es/polyfill/button/legacyUtils/legacyUtils.js +2 -2
  299. package/build/es/polyfill/card/Card.js +1 -1
  300. package/build/es/polyfill/checkbox/Checkbox.js +1 -1
  301. package/build/es/polyfill/checkbox/Checkbox.story.js +1 -1
  302. package/build/es/polyfill/checkboxButton/CheckboxButton.js +1 -1
  303. package/build/es/polyfill/checkboxButton/CheckboxButton.spec.js +1 -1
  304. package/build/es/polyfill/checkboxButton/CheckboxButton.story.js +2 -1
  305. package/build/es/polyfill/checkboxOption/CheckboxOption.js +1 -1
  306. package/build/es/polyfill/checkboxOption/CheckboxOption.spec.js +1 -1
  307. package/build/es/polyfill/checkboxOption/CheckboxOption.story.js +1 -1
  308. package/build/es/polyfill/chevron/Chevron.js +1 -1
  309. package/build/es/polyfill/chevron/Chevron.story.js +1 -1
  310. package/build/es/polyfill/chips/Chip.js +1 -1
  311. package/build/es/polyfill/chips/Chips.js +1 -1
  312. package/build/es/polyfill/chips/Chips.spec.js +1 -1
  313. package/build/es/polyfill/chips/Chips.story.js +1 -1
  314. package/build/es/polyfill/circularButton/CircularButton.js +1 -1
  315. package/build/es/polyfill/common/DOMOperations/DOMOperations.js +3 -3
  316. package/build/es/polyfill/common/Option/Option.js +1 -1
  317. package/build/es/polyfill/common/RadioButton/RadioButton.js +1 -1
  318. package/build/es/polyfill/common/bottomSheet/BottomSheet.js +4 -4
  319. package/build/es/polyfill/common/bottomSheet/BottomSheet.spec.js +1 -1
  320. package/build/es/polyfill/common/bottomSheet/BottomSheet.story.js +2 -2
  321. package/build/es/polyfill/common/closeButton/CloseButton.js +1 -1
  322. package/build/es/polyfill/common/dateUtils/getDayNames/getDayNames.js +2 -2
  323. package/build/es/polyfill/common/dateUtils/getMonthNames/getMonthNames.js +1 -1
  324. package/build/es/polyfill/common/dateUtils/isDateValid/isDateValid.js +1 -1
  325. package/build/es/polyfill/common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.js +1 -1
  326. package/build/es/polyfill/common/deviceDetection/deviceDetection.js +1 -1
  327. package/build/es/polyfill/common/direction.js +1 -1
  328. package/build/es/polyfill/common/domHelpers/index.js +1 -1
  329. package/build/es/polyfill/common/fakeEvents.js +1 -1
  330. package/build/es/polyfill/common/fileType.js +1 -1
  331. package/build/es/polyfill/common/flowHeader/FlowHeader.js +1 -1
  332. package/build/es/polyfill/common/focusBoundary/FocusBoundary.js +1 -1
  333. package/build/es/polyfill/common/focusBoundary/FocusBoundary.spec.js +1 -1
  334. package/build/es/polyfill/common/focusBoundary/utils/getFocusableElements.js +2 -2
  335. package/build/es/polyfill/common/focusBoundary/utils/resetFocus.js +1 -1
  336. package/build/es/polyfill/common/historyNavigator/historyNavigator.js +1 -1
  337. package/build/es/polyfill/common/hooks/useClientWidth/useClientWidth.js +3 -3
  338. package/build/es/polyfill/common/hooks/useConditionalListener/useConditionalListener.js +1 -1
  339. package/build/es/polyfill/common/hooks/useDirection/useDirection.js +1 -1
  340. package/build/es/polyfill/common/hooks/useHasIntersected/useHasIntersected.js +2 -2
  341. package/build/es/polyfill/common/hooks/useLayout/useLayout.js +1 -1
  342. package/build/es/polyfill/common/key.js +1 -1
  343. package/build/es/polyfill/common/locale/index.js +8 -8
  344. package/build/es/polyfill/common/panel/Panel.js +6 -6
  345. package/build/es/polyfill/common/propsValues/breakpoint.js +1 -1
  346. package/build/es/polyfill/common/propsValues/control.js +1 -1
  347. package/build/es/polyfill/common/propsValues/dateMode.js +1 -1
  348. package/build/es/polyfill/common/propsValues/layouts.js +1 -1
  349. package/build/es/polyfill/common/propsValues/markdownNodeType.js +1 -1
  350. package/build/es/polyfill/common/propsValues/monthFormat.js +1 -1
  351. package/build/es/polyfill/common/propsValues/position.js +1 -1
  352. package/build/es/polyfill/common/propsValues/profileType.js +1 -1
  353. package/build/es/polyfill/common/propsValues/scroll.js +1 -1
  354. package/build/es/polyfill/common/propsValues/sentiment.js +1 -1
  355. package/build/es/polyfill/common/propsValues/size.js +1 -1
  356. package/build/es/polyfill/common/propsValues/status.js +1 -1
  357. package/build/es/polyfill/common/propsValues/type.js +1 -1
  358. package/build/es/polyfill/common/propsValues/typography.js +1 -1
  359. package/build/es/polyfill/common/propsValues/variant.js +1 -1
  360. package/build/es/polyfill/common/propsValues/width.js +1 -1
  361. package/build/es/polyfill/common/requirements.js +2 -2
  362. package/build/es/polyfill/common/responsivePanel/ResponsivePanel.js +1 -1
  363. package/build/es/polyfill/common/textFormat/formatWithPattern/formatWithPattern.js +2 -2
  364. package/build/es/polyfill/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.js +1 -1
  365. package/build/es/polyfill/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js +1 -1
  366. package/build/es/polyfill/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js +1 -1
  367. package/build/es/polyfill/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js +1 -1
  368. package/build/es/polyfill/common/textFormat/unformatWithPattern/unformatWithPattern.js +1 -1
  369. package/build/es/polyfill/common/theme.js +1 -1
  370. package/build/es/polyfill/criticalBanner/CriticalCommsBanner.js +1 -1
  371. package/build/es/polyfill/criticalBanner/CriticalCommsBanner.story.js +1 -1
  372. package/build/es/polyfill/dateInput/DateInput.js +4 -10
  373. package/build/es/polyfill/dateInput/DateInput.story.js +1 -1
  374. package/build/es/polyfill/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.js +1 -1
  375. package/build/es/polyfill/dateInput/utils/explodeDate/explodeDate.js +1 -1
  376. package/build/es/polyfill/dateLookup/DateLookup.js +3 -4
  377. package/build/es/polyfill/dateLookup/dateHeader/DateHeader.js +1 -1
  378. package/build/es/polyfill/dateLookup/dateTrigger/DateTrigger.js +1 -1
  379. package/build/es/polyfill/dateLookup/dayCalendar/DayCalendar.js +1 -1
  380. package/build/es/polyfill/dateLookup/dayCalendar/table/DayCalendarTable.js +4 -5
  381. package/build/es/polyfill/dateLookup/monthCalendar/MonthCalendar.js +1 -1
  382. package/build/es/polyfill/dateLookup/monthCalendar/table/MonthCalendarTable.js +1 -1
  383. package/build/es/polyfill/dateLookup/tableLink/TableLink.js +1 -1
  384. package/build/es/polyfill/dateLookup/yearCalendar/YearCalendar.js +1 -1
  385. package/build/es/polyfill/dateLookup/yearCalendar/table/YearCalendarTable.js +1 -1
  386. package/build/es/polyfill/decision/Decision.js +5 -5
  387. package/build/es/polyfill/decision/decisionEnums.js +2 -2
  388. package/build/es/polyfill/definitionList/DefinitionList.js +1 -1
  389. package/build/es/polyfill/dimmer/Dimmer.js +3 -3
  390. package/build/es/polyfill/dimmer/Dimmer.story.js +2 -2
  391. package/build/es/polyfill/dimmer/dimmerManager/DimmerManager.js +3 -3
  392. package/build/es/polyfill/display/Display.js +1 -1
  393. package/build/es/polyfill/display/Display.story.js +2 -2
  394. package/build/es/polyfill/drawer/Drawer.js +1 -1
  395. package/build/es/polyfill/dropFade/DropFade.js +3 -3
  396. package/build/es/polyfill/dropFade/DropFade.story.js +1 -1
  397. package/build/es/polyfill/dynamicFieldDefinitionList/DynamicFieldDefinitionList.js +1 -1
  398. package/build/es/polyfill/dynamicFieldDefinitionList/FormattedValue/FormattedValue.js +2 -2
  399. package/build/es/polyfill/dynamicFieldDefinitionList/utils/createDefinitions.js +2 -2
  400. package/build/es/polyfill/dynamicFieldDefinitionList/utils/text-format.js +1 -1
  401. package/build/es/polyfill/emphasis/Emphasis.js +2 -2
  402. package/build/es/polyfill/emphasis/Emphasis.story.js +1 -0
  403. package/build/es/polyfill/emphasis/EmphasisHtmlTransformer.js +2 -2
  404. package/build/es/polyfill/flowNavigation/FlowNavigation.js +2 -2
  405. package/build/es/polyfill/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
  406. package/build/es/polyfill/flowNavigation/backButton/BackButton.js +1 -1
  407. package/build/es/polyfill/header/Header.js +2 -2
  408. package/build/es/polyfill/header/Header.spec.js +1 -1
  409. package/build/es/polyfill/header/Header.story.js +2 -1
  410. package/build/es/polyfill/i18n/index.js +1 -1
  411. package/build/es/polyfill/image/Image.js +2 -2
  412. package/build/es/polyfill/info/Info.js +1 -1
  413. package/build/es/polyfill/info/Info.story.js +1 -1
  414. package/build/es/polyfill/info/infoPresentations.js +1 -1
  415. package/build/es/polyfill/inlineAlert/InlineAlert.js +1 -1
  416. package/build/es/polyfill/inputWithDisplayFormat/InputWithDisplayFormat.js +1 -1
  417. package/build/es/polyfill/inputs/Input.js +1 -1
  418. package/build/es/polyfill/inputs/TextArea.js +1 -1
  419. package/build/es/polyfill/inputs/_common.js +2 -2
  420. package/build/es/polyfill/instructionsList/InstructionsList.js +3 -3
  421. package/build/es/polyfill/link/Link.js +2 -2
  422. package/build/es/polyfill/link/Link.spec.js +1 -1
  423. package/build/es/polyfill/link/Link.story.js +1 -1
  424. package/build/es/polyfill/listItem/ListItem.js +1 -1
  425. package/build/es/polyfill/listItem/ListItem.spec.js +1 -1
  426. package/build/es/polyfill/listItem/ListItem.story.js +1 -1
  427. package/build/es/polyfill/loader/Loader.js +2 -2
  428. package/build/es/polyfill/loader/Loader.story.js +1 -1
  429. package/build/es/polyfill/logo/Logo.js +1 -1
  430. package/build/es/polyfill/logo/Logo.story.js +1 -1
  431. package/build/es/polyfill/logo/logoTypes.js +1 -1
  432. package/build/es/polyfill/markdown/Markdown.js +1 -1
  433. package/build/es/polyfill/markdown/Markdown.story.js +1 -0
  434. package/build/es/polyfill/modal/Modal.js +1 -1
  435. package/build/es/polyfill/modal/Modal.story.js +2 -2
  436. package/build/es/polyfill/money/Money.js +1 -1
  437. package/build/es/polyfill/money/Money.story.js +1 -1
  438. package/build/es/polyfill/moneyInput/MoneyInput.js +1 -1
  439. package/build/es/polyfill/moneyInput/MoneyInput.story.js +1 -1
  440. package/build/es/polyfill/moneyInput/currencyFormatting.js +3 -3
  441. package/build/es/polyfill/navigationOption/NavigationOption.js +1 -1
  442. package/build/es/polyfill/navigationOptionsList/NavigationOptionsList.js +1 -1
  443. package/build/es/polyfill/nudge/Nudge.js +1 -1
  444. package/build/es/polyfill/overlayHeader/OverlayHeader.js +1 -1
  445. package/build/es/polyfill/phoneNumberInput/PhoneNumberInput.js +1 -1
  446. package/build/es/polyfill/phoneNumberInput/data/countries.js +1 -1
  447. package/build/es/polyfill/phoneNumberInput/utils/cleanNumber/cleanNumber.js +1 -1
  448. package/build/es/polyfill/phoneNumberInput/utils/excludeCountries/excludeCountries.js +3 -3
  449. package/build/es/polyfill/phoneNumberInput/utils/explodeNumberModel/index.js +2 -2
  450. package/build/es/polyfill/phoneNumberInput/utils/filterOptionsForQuery/index.js +2 -2
  451. package/build/es/polyfill/phoneNumberInput/utils/findCountryByCode/index.js +1 -1
  452. package/build/es/polyfill/phoneNumberInput/utils/findCountryByPrefix/index.js +1 -1
  453. package/build/es/polyfill/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.js +1 -1
  454. package/build/es/polyfill/phoneNumberInput/utils/isOptionAndFitsQuery/isOptionAndFitsQuery.js +2 -2
  455. package/build/es/polyfill/phoneNumberInput/utils/isStringNumeric/isStringNumeric.js +1 -1
  456. package/build/es/polyfill/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js +2 -2
  457. package/build/es/polyfill/phoneNumberInput/utils/longestMatchingPrefix/index.js +1 -1
  458. package/build/es/polyfill/phoneNumberInput/utils/setDefaultPrefix/index.js +3 -3
  459. package/build/es/polyfill/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.js +2 -2
  460. package/build/es/polyfill/popover/Popover.js +2 -2
  461. package/build/es/polyfill/processIndicator/ProcessIndicator.js +4 -4
  462. package/build/es/polyfill/progress/Progress.js +1 -1
  463. package/build/es/polyfill/progress/Progress.story.js +1 -1
  464. package/build/es/polyfill/progressBar/ProgressBar.js +1 -1
  465. package/build/es/polyfill/progressBar/ProgressBar.story.js +1 -1
  466. package/build/es/polyfill/provider/Provider.js +1 -1
  467. package/build/es/polyfill/provider/Provider.spec.js +1 -1
  468. package/build/es/polyfill/provider/Provider.story.js +1 -1
  469. package/build/es/polyfill/provider/direction/DirectionProvider.js +1 -1
  470. package/build/es/polyfill/provider/direction/DirectionProvider.spec.js +1 -1
  471. package/build/es/polyfill/provider/language/LanguageProvider.js +1 -1
  472. package/build/es/polyfill/provider/language/LanguageProvider.spec.js +1 -1
  473. package/build/es/polyfill/radio/Radio.js +1 -1
  474. package/build/es/polyfill/radioGroup/RadioGroup.js +2 -2
  475. package/build/es/polyfill/radioOption/RadioOption.js +1 -1
  476. package/build/es/polyfill/section/Section.js +1 -1
  477. package/build/es/polyfill/section/Section.spec.js +1 -1
  478. package/build/es/polyfill/section/Section.story.js +1 -1
  479. package/build/es/polyfill/select/Select.js +8 -9
  480. package/build/es/polyfill/select/option/Option.js +2 -2
  481. package/build/es/polyfill/select/searchBox/SearchBox.js +1 -1
  482. package/build/es/polyfill/sizeSwapper/SizeSwapper.js +3 -3
  483. package/build/es/polyfill/slidingPanel/SlidingPanel.js +2 -2
  484. package/build/es/polyfill/snackbar/Snackbar.js +1 -1
  485. package/build/es/polyfill/snackbar/SnackbarContext.js +1 -1
  486. package/build/es/polyfill/snackbar/SnackbarProvider.js +1 -1
  487. package/build/es/polyfill/snackbar/useSnackbar.js +1 -1
  488. package/build/es/polyfill/statusIcon/StatusIcon.js +1 -1
  489. package/build/es/polyfill/statusIcon/StatusIcon.story.js +1 -1
  490. package/build/es/polyfill/stepper/Stepper.js +1 -1
  491. package/build/es/polyfill/stepper/deviceDetection.js +2 -2
  492. package/build/es/polyfill/sticky/Sticky.js +1 -1
  493. package/build/es/polyfill/summary/Summary.js +1 -1
  494. package/build/es/polyfill/switch/Switch.js +1 -1
  495. package/build/es/polyfill/switch/Switch.story.js +1 -1
  496. package/build/es/polyfill/switchOption/SwitchOption.js +1 -1
  497. package/build/es/polyfill/switchOption/SwitchOption.story.js +1 -1
  498. package/build/es/polyfill/tabs/Tab.js +1 -1
  499. package/build/es/polyfill/tabs/TabList.js +1 -1
  500. package/build/es/polyfill/tabs/TabPanel.js +1 -1
  501. package/build/es/polyfill/tabs/Tabs.js +1 -5
  502. package/build/es/polyfill/tabs/utils.js +2 -2
  503. package/build/es/polyfill/textareaWithDisplayFormat/TextareaWithDisplayFormat.js +1 -1
  504. package/build/es/polyfill/tile/Tile.js +1 -1
  505. package/build/es/polyfill/title/Title.js +1 -1
  506. package/build/es/polyfill/title/Title.spec.js +1 -1
  507. package/build/es/polyfill/title/Title.story.js +1 -1
  508. package/build/es/polyfill/tooltip/Tooltip.js +7 -7
  509. package/build/es/polyfill/tooltip/Tooltip.spec.js +1 -1
  510. package/build/es/polyfill/tooltip/Tooltip.story.js +1 -1
  511. package/build/es/polyfill/typeahead/Typeahead.js +1 -1
  512. package/build/es/polyfill/typeahead/typeaheadInput/TypeaheadInput.js +1 -1
  513. package/build/es/polyfill/typeahead/typeaheadOption/TypeaheadOption.js +1 -1
  514. package/build/es/polyfill/typeahead/util/highlight.js +1 -1
  515. package/build/es/polyfill/upload/Upload.js +2 -6
  516. package/build/es/polyfill/upload/steps/completeStep/completeStep.js +1 -1
  517. package/build/es/polyfill/upload/steps/mediaUploadStep/mediaUploadStep.js +1 -1
  518. package/build/es/polyfill/upload/steps/processingStep/processingStep.js +1 -1
  519. package/build/es/polyfill/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
  520. package/build/es/polyfill/upload/uploadSteps.js +1 -1
  521. package/build/es/polyfill/upload/utils/asyncFileRead/asyncFileRead.js +1 -1
  522. package/build/es/polyfill/upload/utils/getFileType/getFileType.js +1 -1
  523. package/build/es/polyfill/upload/utils/getSupportedSpotMimeTypes/getSupportedSpotMimeTypes.js +2 -2
  524. package/build/es/polyfill/upload/utils/isSizeValid/isSizeValid.js +1 -1
  525. package/build/es/polyfill/upload/utils/isTypeValid/isTypeValid.js +1 -1
  526. package/build/es/polyfill/upload/utils/postData/postData.js +1 -1
  527. package/build/es/polyfill/upload/utils/requestMedia/requestMedia.js +1 -1
  528. package/build/es/polyfill/uploadInput/UploadInput.js +7 -7
  529. package/build/es/polyfill/uploadInput/UploadInput.spec.js +1 -1
  530. package/build/es/polyfill/uploadInput/UploadInput.story.js +1 -1
  531. package/build/es/polyfill/uploadInput/uploadButton/UploadButton.js +1 -1
  532. package/build/es/polyfill/uploadInput/uploadButton/UploadButton.spec.js +3 -3
  533. package/build/es/polyfill/uploadInput/uploadButton/defaults.js +1 -1
  534. package/build/es/polyfill/uploadInput/uploadButton/getAllowedFileTypes.js +3 -3
  535. package/build/es/polyfill/uploadInput/uploadButton/getAllowedFileTypes.spec.js +1 -1
  536. package/build/es/polyfill/uploadInput/uploadItem/UploadItem.js +2 -2
  537. package/build/es/polyfill/uploadInput/uploadItem/UploadItem.spec.js +1 -1
  538. package/build/es/polyfill/uploadInput/uploadItem/UploadItemBody.js +1 -1
  539. package/build/es/polyfill/utilities/deprecatedProperty/deprecatedProperty.js +1 -1
  540. package/build/es/polyfill/utilities/logActionRequired.js +1 -1
  541. package/build/es/polyfill/withDisplayFormat/WithDisplayFormat.js +3 -4
  542. package/build/es/polyfill/withNextPortal/withNextPortal.js +1 -1
  543. package/build/main.css +1 -4236
  544. package/build/styles/accordion/Accordion.css +1 -59
  545. package/build/styles/actionButton/ActionButton.css +1 -41
  546. package/build/styles/avatar/Avatar.css +1 -240
  547. package/build/styles/badge/Badge.css +1 -66
  548. package/build/styles/button/Button.css +1 -17
  549. package/build/styles/card/Card.css +1 -88
  550. package/build/styles/checkboxButton/CheckboxButton.css +1 -21
  551. package/build/styles/chips/Chip.css +1 -169
  552. package/build/styles/circularButton/CircularButton.css +1 -175
  553. package/build/styles/common/Option/Option.css +1 -74
  554. package/build/styles/common/RadioButton/RadioButton.css +1 -3
  555. package/build/styles/common/bottomSheet/BottomSheet.css +1 -44
  556. package/build/styles/common/closeButton/CloseButton.css +1 -44
  557. package/build/styles/common/panel/Panel.css +1 -67
  558. package/build/styles/criticalBanner/CriticalCommsBanner.css +1 -73
  559. package/build/styles/dateInput/DateInput.css +1 -3
  560. package/build/styles/dateLookup/DateLookup.css +1 -80
  561. package/build/styles/dateLookup/dateTrigger/DateTrigger.css +1 -53
  562. package/build/styles/decision/Decision.css +1 -69
  563. package/build/styles/definitionList/DefinitionList.css +1 -48
  564. package/build/styles/dimmer/Dimmer.css +1 -68
  565. package/build/styles/drawer/Drawer.css +1 -77
  566. package/build/styles/dropFade/DropFade.css +1 -19
  567. package/build/styles/dynamicFieldDefinitionList/FormattedValue/FormattedValue.css +1 -4
  568. package/build/styles/emphasis/Emphasis.css +1 -25
  569. package/build/styles/flowNavigation/FlowNavigation.css +1 -85
  570. package/build/styles/flowNavigation/animatedLabel/AnimatedLabel.css +1 -26
  571. package/build/styles/flowNavigation/backButton/BackButton.css +1 -28
  572. package/build/styles/header/Header.css +1 -20
  573. package/build/styles/image/Image.css +1 -12
  574. package/build/styles/info/Info.css +1 -37
  575. package/build/styles/inputs/Input.css +1 -53
  576. package/build/styles/inputs/TextArea.css +1 -59
  577. package/build/styles/instructionsList/InstructionsList.css +1 -30
  578. package/build/styles/link/Link.css +1 -12
  579. package/build/styles/listItem/ListItem.css +1 -6
  580. package/build/styles/loader/Loader.css +1 -294
  581. package/build/styles/logo/Logo.css +1 -10
  582. package/build/styles/main.css +1 -4236
  583. package/build/styles/modal/Modal.css +1 -133
  584. package/build/styles/moneyInput/MoneyInput.css +1 -128
  585. package/build/styles/navigationOption/NavigationOption.css +1 -61
  586. package/build/styles/navigationOptionsList/NavigationOptionsList.css +1 -12
  587. package/build/styles/nudge/Nudge.css +1 -138
  588. package/build/styles/overlayHeader/OverlayHeader.css +1 -31
  589. package/build/styles/phoneNumberInput/PhoneNumberInput.css +1 -17
  590. package/build/styles/popover/Popover.css +1 -40
  591. package/build/styles/progress/Progress.css +1 -35
  592. package/build/styles/progressBar/ProgressBar.css +1 -9
  593. package/build/styles/section/Section.css +1 -8
  594. package/build/styles/select/Select.css +1 -322
  595. package/build/styles/slidingPanel/SlidingPanel.css +1 -96
  596. package/build/styles/snackbar/Snackbar.css +1 -85
  597. package/build/styles/statusIcon/StatusIcon.css +1 -50
  598. package/build/styles/stepper/Stepper.css +1 -139
  599. package/build/styles/summary/Summary.css +1 -86
  600. package/build/styles/switch/Switch.css +1 -64
  601. package/build/styles/tabs/Tabs.css +1 -104
  602. package/build/styles/tile/Tile.css +1 -58
  603. package/build/styles/tooltip/Tooltip.css +1 -37
  604. package/build/styles/typeahead/Typeahead.css +1 -167
  605. package/build/styles/typeahead/typeaheadOption/TypeaheadOption.css +1 -6
  606. package/build/styles/upload/Upload.css +1 -15
  607. package/build/styles/uploadInput/UploadInput.css +1 -53
  608. package/build/styles/uploadInput/uploadButton/UploadButton.css +1 -44
  609. package/build/styles/uploadInput/uploadItem/UploadItem.css +1 -60
  610. package/build/types/checkboxButton/CheckboxButton.story.d.ts +14 -4
  611. package/build/types/emphasis/Emphasis.story.d.ts +13 -0
  612. package/build/types/markdown/Markdown.story.d.ts +39 -0
  613. package/build/umd/no-polyfill/main.js +1 -1
  614. package/build/umd/polyfill/main.js +1 -1
  615. package/package.json +1 -1
  616. package/build/types/test-utils/VariantDecorator.d.ts +0 -18
@@ -1,3 +1,3 @@
1
- /* eslint-disable no-unused-vars */ /* eslint-disable no-param-reassign */const prepRequirements=a=>{if(!a||0===a.length)return[];const b=copyOf(a);return b.forEach(a=>{a.prepared||(prepLegacyAlternatives(a),a.properties=prepFields(a.properties||a.fields),a.type&&"object"!==a.type&&!a.types&&(a.properties.type={type:"string",enum:[a.type],required:!0,hidden:!0},a.type="object"),a.prepared=!0)}),b},prepFields=(a,b,c)=>{if(!a)return{};let d=copyOf(a);return d=flattenFieldsWithGroups(d),d=transformFieldArrayToMap(d),d=transformNestedKeysToNestedSpecs(d),Object.keys(d).forEach(a=>{d[a]=prepField(d[a],b,c)}),d},prepField=(a,b,c)=>{const d=copyOf(a);return prepLegacyProps(d),prepType(d),prepPattern(d),prepValidationMessages(d,c),d},flattenFieldsWithGroups=a=>{if(Array.isArray(a)){let b=[];return a.forEach(a=>{a.fields?b=b.concat(flattenFieldWithGroup(a,a.fields)):a.group?b=b.concat(flattenFieldWithGroup(a,a.group)):b.push(a)}),b}return a},flattenFieldWithGroup=(a,b)=>(a.name&&0<b.length&&!b[0].name&&(b[0].name=a.name),a.width&&0<b.length&&!b[0].width&&(b[0].width=a.width),a.tooltip&&0<b.length&&!b[0].help&&(b[0].help={message:a.tooltip}),a.info&&0<b.length&&!b[0].help&&(b[0].help={message:a.info}),2===b.length&&b.forEach(a=>{a.width="md"}),3===b.length&&(b[0].width="md",b[1].width="md"),b),transformFieldArrayToMap=a=>{if(Array.isArray(a)){const b={};return a.forEach(a=>{const c=a.key||a.name;delete a.key,b[c]=copyOf(a)}),b}return a},transformNestedKeysToNestedSpecs=a=>{if(Array.isArray(a))throw new TypeError("Expecting a map of fields, not an array");const b={};return Object.keys(a).forEach(c=>{if(0<c.indexOf(".")){// If the key contains a period we need to nest the fields in another object
2
- const d=c.split("."),e=d[0];b[e]||(b[e]={type:"object",properties:{}}),b[e].properties[d[1]]=a[c]}else b[c]=a[c]}),b},prepType=a=>{const b=a.type&&a.type.toLowerCase&&a.type.toLowerCase();switch(b){case"text":a.type="string";break;case"date":a.type="string",a.format="date";break;case"password":a.type="string",a.control="password";break;case"checkbox":a.type="boolean";break;case"select":a.control||(a.control="select"),delete a.type;break;case"radio":a.control="radio",delete a.type;break;case"upload":a.type="string",a.format="base64url";break;case"tel":a.type="string",a.format="phone";break;case"textarea":a.type="string",a.control="textarea";break;default:}a.control||"object"===a.type||(a.control=getControlType(a))},prepLegacyAlternatives=a=>{!a.title&&a.label&&(a.title=a.label),a.title||(a.title=getNameFromType(a.type)),!a.type&&a.name&&(a.type=a.name),!a.description&&a.tooltip&&(a.description=a.tooltip),a.fieldGroups&&!a.fields&&(a.fields=flattenFieldsWithGroups(a.fieldGroups),delete a.fieldGroups)},prepLegacyProps=a=>{a.name&&!a.title&&(a.title=a.name,delete a.name),a.validationRegexp&&(a.pattern=a.validationRegexp,delete a.validationRegexp),a.min&&(a.minimum=a.min,delete a.min),a.max&&(a.maximum=a.max,delete a.max),a.example&&!a.placeholder&&(a.placeholder=a.example,delete a.example),a.tooltip&&!a.help&&(a.help={message:a.tooltip},delete a.tooltip),a.valuesAllowed&&!a.values&&(a.values=a.valuesAllowed,delete a.valuesAllowed),a.values&&a.values.map&&(a.values=prepLegacyValues(a.values)),a.value&&!a.default&&(a.default=a.value,delete a.value),a.values&&a.values&&0<a.values.length&&a.values[0]&&!a.values[0].value&&a.values[0].label&&!a.placeholder&&(a.placeholder=a.values[0].label,a.values=a.values.slice(1))},prepLegacyValues=a=>a.map(prepLegacyValue),prepLegacyValue=a=>(!a.label&&a.title&&(a.label=a.title,delete a.title),!a.label&&a.name&&(a.label=a.name,delete a.name),!a.value&&a.code&&(a.value=a.code,delete a.code),!a.value&&a.key&&(a.value=a.key,delete a.key),a),prepPattern=a=>{if(a.pattern)try{new RegExp(a.pattern)}catch{console.warn("API regexp is invalid"),delete a.pattern}else delete a.pattern},prepValidationMessages=(a,b)=>(a.validationMessages=a.validationMessages?a.validationMessages:b,a.validationMessages?void(a.validationMessages.minimum&&(a.validationMessages.min=a.validationMessages.minimum,delete a.validationMessages.minimum),a.validationMessages.maximum&&(a.validationMessages.max=a.validationMessages.maximum,delete a.validationMessages.maximum)):void delete a.validationMessages),getControlType=a=>{if(a.control)return a.control.toLowerCase();if(a.hidden)return"hidden";if(a.values&&0<a.values.length)return getSelectionType(a);switch(a.type){case"string":return getControlForStringFormat(a.format);case"number":case"integer":return"number";case"boolean":return"checkbox";default:return"text";}},getControlForStringFormat=a=>"date"===a?"date":"base64url"===a?"file":"password"===a?"password":"uri"===a?"text":"email"===a?"text":"phone"===a?"tel":"text",getSelectionType=a=>a.control?a.control:"select"===a.type?"select":"radio"===a.type?"radio":a.values?3<a.values.length?"select":"radio":"select",copyOf=a=>JSON.parse(JSON.stringify(a)),getNameFromType=a=>{if(a&&0<a.length){const b=a.toLowerCase().split("_").join(" ");// String.replace method only replaces first instance
1
+ /* eslint-disable no-unused-vars */ /* eslint-disable no-param-reassign */var prepRequirements=function(a){if(!a||0===a.length)return[];var b=copyOf(a);return b.forEach(function(a){a.prepared||(prepLegacyAlternatives(a),a.properties=prepFields(a.properties||a.fields),a.type&&"object"!==a.type&&!a.types&&(a.properties.type={type:"string",enum:[a.type],required:!0,hidden:!0},a.type="object"),a.prepared=!0)}),b},prepFields=function(a,b,c){if(!a)return{};var d=copyOf(a);return d=flattenFieldsWithGroups(d),d=transformFieldArrayToMap(d),d=transformNestedKeysToNestedSpecs(d),Object.keys(d).forEach(function(a){d[a]=prepField(d[a],b,c)}),d},prepField=function(a,b,c){var d=copyOf(a);return prepLegacyProps(d),prepType(d),prepPattern(d),prepValidationMessages(d,c),d},flattenFieldsWithGroups=function(a){if(Array.isArray(a)){var b=[];return a.forEach(function(a){a.fields?b=b.concat(flattenFieldWithGroup(a,a.fields)):a.group?b=b.concat(flattenFieldWithGroup(a,a.group)):b.push(a)}),b}return a},flattenFieldWithGroup=function(a,b){return a.name&&0<b.length&&!b[0].name&&(b[0].name=a.name),a.width&&0<b.length&&!b[0].width&&(b[0].width=a.width),a.tooltip&&0<b.length&&!b[0].help&&(b[0].help={message:a.tooltip}),a.info&&0<b.length&&!b[0].help&&(b[0].help={message:a.info}),2===b.length&&b.forEach(function(a){a.width="md"}),3===b.length&&(b[0].width="md",b[1].width="md"),b},transformFieldArrayToMap=function(a){if(Array.isArray(a)){var b={};return a.forEach(function(a){var c=a.key||a.name;delete a.key,b[c]=copyOf(a)}),b}return a},transformNestedKeysToNestedSpecs=function(a){if(Array.isArray(a))throw new TypeError("Expecting a map of fields, not an array");var b={};return Object.keys(a).forEach(function(c){if(0<c.indexOf(".")){// If the key contains a period we need to nest the fields in another object
2
+ var d=c.split("."),e=d[0];b[e]||(b[e]={type:"object",properties:{}}),b[e].properties[d[1]]=a[c]}else b[c]=a[c]}),b},prepType=function(a){var b=a.type&&a.type.toLowerCase&&a.type.toLowerCase();switch(b){case"text":a.type="string";break;case"date":a.type="string",a.format="date";break;case"password":a.type="string",a.control="password";break;case"checkbox":a.type="boolean";break;case"select":a.control||(a.control="select"),delete a.type;break;case"radio":a.control="radio",delete a.type;break;case"upload":a.type="string",a.format="base64url";break;case"tel":a.type="string",a.format="phone";break;case"textarea":a.type="string",a.control="textarea";break;default:}a.control||"object"===a.type||(a.control=getControlType(a))},prepLegacyAlternatives=function(a){!a.title&&a.label&&(a.title=a.label),a.title||(a.title=getNameFromType(a.type)),!a.type&&a.name&&(a.type=a.name),!a.description&&a.tooltip&&(a.description=a.tooltip),a.fieldGroups&&!a.fields&&(a.fields=flattenFieldsWithGroups(a.fieldGroups),delete a.fieldGroups)},prepLegacyProps=function(a){a.name&&!a.title&&(a.title=a.name,delete a.name),a.validationRegexp&&(a.pattern=a.validationRegexp,delete a.validationRegexp),a.min&&(a.minimum=a.min,delete a.min),a.max&&(a.maximum=a.max,delete a.max),a.example&&!a.placeholder&&(a.placeholder=a.example,delete a.example),a.tooltip&&!a.help&&(a.help={message:a.tooltip},delete a.tooltip),a.valuesAllowed&&!a.values&&(a.values=a.valuesAllowed,delete a.valuesAllowed),a.values&&a.values.map&&(a.values=prepLegacyValues(a.values)),a.value&&!a.default&&(a.default=a.value,delete a.value),a.values&&a.values&&0<a.values.length&&a.values[0]&&!a.values[0].value&&a.values[0].label&&!a.placeholder&&(a.placeholder=a.values[0].label,a.values=a.values.slice(1))},prepLegacyValues=function(a){return a.map(prepLegacyValue)},prepLegacyValue=function(a){return!a.label&&a.title&&(a.label=a.title,delete a.title),!a.label&&a.name&&(a.label=a.name,delete a.name),!a.value&&a.code&&(a.value=a.code,delete a.code),!a.value&&a.key&&(a.value=a.key,delete a.key),a},prepPattern=function(a){if(a.pattern)try{new RegExp(a.pattern)}catch(b){console.warn("API regexp is invalid"),delete a.pattern}else delete a.pattern},prepValidationMessages=function(a,b){return a.validationMessages=a.validationMessages?a.validationMessages:b,a.validationMessages?void(a.validationMessages.minimum&&(a.validationMessages.min=a.validationMessages.minimum,delete a.validationMessages.minimum),a.validationMessages.maximum&&(a.validationMessages.max=a.validationMessages.maximum,delete a.validationMessages.maximum)):void delete a.validationMessages},getControlType=function(a){if(a.control)return a.control.toLowerCase();if(a.hidden)return"hidden";if(a.values&&0<a.values.length)return getSelectionType(a);switch(a.type){case"string":return getControlForStringFormat(a.format);case"number":case"integer":return"number";case"boolean":return"checkbox";default:return"text";}},getControlForStringFormat=function(a){return"date"===a?"date":"base64url"===a?"file":"password"===a?"password":"uri"===a?"text":"email"===a?"text":"phone"===a?"tel":"text"},getSelectionType=function(a){return a.control?a.control:"select"===a.type?"select":"radio"===a.type?"radio":a.values?3<a.values.length?"select":"radio":"select"},copyOf=function(a){return JSON.parse(JSON.stringify(a))},getNameFromType=function(a){if(a&&0<a.length){var b=a.toLowerCase().split("_").join(" ");// String.replace method only replaces first instance
3
3
  return b.charAt(0).toUpperCase()+b.slice(1)}return""};export{prepFields,getControlType};
@@ -1 +1 @@
1
- import{useTheme}from"@wise/components-theming";import classNames from"classnames";import{forwardRef}from"react";import{Position}from"..";import BottomSheet from"../bottomSheet";import{useLayout}from"../hooks";import Panel from"../panel";import{jsx as _jsx}from"react/jsx-runtime";const ResponsivePanel=/*#__PURE__*/forwardRef((a,b)=>{let{anchorRef:c,arrow:f=!1,flip:g=!0,children:d,className:h=void 0,onClose:e,open:i=!1,position:j=Position.BOTTOM}=a;const{className:k}=useTheme(),{isMobile:l}=useLayout();return l?/*#__PURE__*/_jsx(BottomSheet,{open:i,className:h,onClose:e,children:d},"bottomSheet"):/*#__PURE__*/_jsx(Panel,{ref:b,flip:g,arrow:f,open:i,position:j,anchorRef:c,className:classNames(k,h),onClose:e,children:d},"panel")});export default ResponsivePanel;
1
+ import{useTheme}from"@wise/components-theming";import classNames from"classnames";import{forwardRef}from"react";import{Position}from"..";import BottomSheet from"../bottomSheet";import{useLayout}from"../hooks";import Panel from"../panel";import{jsx as _jsx}from"react/jsx-runtime";var ResponsivePanel=/*#__PURE__*/forwardRef(function(a,b){var c=a.anchorRef,d=a.arrow,e=a.flip,f=a.children,g=a.className,h=void 0===g?void 0:g,i=a.onClose,j=a.open,k=void 0!==j&&j,l=a.position,m=void 0===l?Position.BOTTOM:l,n=useTheme(),o=n.className,p=useLayout(),q=p.isMobile;return q?/*#__PURE__*/_jsx(BottomSheet,{open:k,className:h,onClose:i,children:f},"bottomSheet"):/*#__PURE__*/_jsx(Panel,{ref:b,flip:!(void 0!==e)||e,arrow:void 0!==d&&d,open:k,position:m,anchorRef:c,className:classNames(o,h),onClose:i,children:f},"panel")});export default ResponsivePanel;
@@ -1,2 +1,2 @@
1
- import getSymbolsInPatternWithPosition from"../getSymbolsInPatternWithPosition";const formatWithPattern=(a,b)=>{if(!a||""===a)return"";const c=a.toString().split(""),d=getSymbolsInPatternWithPosition(b);let e=[];// valueArray.length increments during the cycle cause we are adding new elements.
2
- for(let f=0;f<c.length;f+=1)e=d.filter(a=>a.index===f),1===e.length&&c.splice(f,0,e.pop().symbol);return c.join("")};export default formatWithPattern;
1
+ import getSymbolsInPatternWithPosition from"../getSymbolsInPatternWithPosition";var formatWithPattern=function(a,b){if(!a||""===a)return"";// valueArray.length increments during the cycle cause we are adding new elements.
2
+ for(var c=a.toString().split(""),d=getSymbolsInPatternWithPosition(b),e=[],f=function _loop(a){e=d.filter(function(b){return b.index===a}),1===e.length&&c.splice(a,0,e.pop().symbol)},g=0;g<c.length;g+=1)f(g);return c.join("")};export default formatWithPattern;
@@ -1 +1 @@
1
- import getSymbolsInPatternWithPosition from"../getSymbolsInPatternWithPosition";const getCountOfSymbolsInSelection=(a,b,c)=>getSymbolsInPatternWithPosition(c).filter(c=>c.index>=a&&c.index<b).length;export default getCountOfSymbolsInSelection;
1
+ import getSymbolsInPatternWithPosition from"../getSymbolsInPatternWithPosition";var getCountOfSymbolsInSelection=function(a,b,c){return getSymbolsInPatternWithPosition(c).filter(function(c){return c.index>=a&&c.index<b}).length};export default getCountOfSymbolsInSelection;
@@ -1 +1 @@
1
- import getCountOfSymbolsInSelection from"../getCountOfSymbolsInSelection";import{getDistanceToNextSymbol,getDistanceToPreviousSymbol}from"../getDistanceToSymbol";const getCursorPositionAfteractionstroke=(a,b,c,d,e)=>{let f=b;switch(a){case"Backspace":b===c&&(f-=getDistanceToPreviousSymbol(b,d),f=0<f?f-1:0);break;case"Paste":f+=e+getCountOfSymbolsInSelection(b,b+e,d)+getDistanceToNextSymbol(b+e,d);break;case"Cut":case"Delete":break;default:f+=1+getDistanceToNextSymbol(b,d);}return f};export default getCursorPositionAfteractionstroke;
1
+ import getCountOfSymbolsInSelection from"../getCountOfSymbolsInSelection";import{getDistanceToNextSymbol,getDistanceToPreviousSymbol}from"../getDistanceToSymbol";var getCursorPositionAfteractionstroke=function(a,b,c,d,e){var f=b;switch(a){case"Backspace":b===c&&(f-=getDistanceToPreviousSymbol(b,d),f=0<f?f-1:0);break;case"Paste":f+=e+getCountOfSymbolsInSelection(b,b+e,d)+getDistanceToNextSymbol(b+e,d);break;case"Cut":case"Delete":break;default:f+=1+getDistanceToNextSymbol(b,d);}return f};export default getCursorPositionAfteractionstroke;
@@ -1,2 +1,2 @@
1
- import getSymbolsInPatternWithPosition from"../getSymbolsInPatternWithPosition";export const getDistanceToNextSymbol=(a,b)=>{const c=getSymbolsInPatternWithPosition(b),d=c.filter(b=>b.index>=a);return countConsecutiveSymbols(a,d,"left")};export const getDistanceToPreviousSymbol=(a,b)=>{const c=getSymbolsInPatternWithPosition(b),d=c.filter(b=>b.index<a).reverse();return countConsecutiveSymbols(a,d,"right")};const countConsecutiveSymbols=(a,b,c)=>{let d,e=a;for(d=0;d<b.length;d+=1){const a="left"===c?e:e-1;if(b[d].index===a)e="left"===c?e+1:e-1;else// Exit if not consecutive.
1
+ import getSymbolsInPatternWithPosition from"../getSymbolsInPatternWithPosition";export var getDistanceToNextSymbol=function(a,b){var c=getSymbolsInPatternWithPosition(b),d=c.filter(function(b){return b.index>=a});return countConsecutiveSymbols(a,d,"left")};export var getDistanceToPreviousSymbol=function(a,b){var c=getSymbolsInPatternWithPosition(b),d=c.filter(function(b){return b.index<a}).reverse();return countConsecutiveSymbols(a,d,"right")};var countConsecutiveSymbols=function(a,b,c){var d,e=a;for(d=0;d<b.length;d+=1){var f="left"===c?e:e-1;if(b[d].index===f)e="left"===c?e+1:e-1;else// Exit if not consecutive.
2
2
  break}return d};
@@ -1 +1 @@
1
- const getSymbolsInPatternWithPosition=a=>{const b=[],c=a.split("");return c.forEach((a,c)=>{"*"!==a&&b.push({index:c,symbol:a})}),b};export default getSymbolsInPatternWithPosition;
1
+ var getSymbolsInPatternWithPosition=function(a){var b=[],c=a.split("");return c.forEach(function(a,c){"*"!==a&&b.push({index:c,symbol:a})}),b};export default getSymbolsInPatternWithPosition;
@@ -1 +1 @@
1
- const unformatWithPattern=(a,b)=>{let c=[""];return a&&0<a.length&&(c=a.toString().split(""),c=c.filter(a=>!getSymbolsInPattern(b).includes(a))),c.join("")},getSymbolsInPattern=a=>a.split("").filter(a=>"*"!==a);export default unformatWithPattern;
1
+ var unformatWithPattern=function(a,b){var c=[""];return a&&0<a.length&&(c=a.toString().split(""),c=c.filter(function(a){return!getSymbolsInPattern(b).includes(a)})),c.join("")},getSymbolsInPattern=function(a){return a.split("").filter(function(a){return"*"!==a})};export default unformatWithPattern;
@@ -1 +1 @@
1
- export let Theme=/*#__PURE__*/function(a){return a.LIGHT="light",a.DARK="dark",a.NAVY="navy",a.PERSONAL="personal",a.PERSONAL_FOREST_GREEN="personal--forest-green",a.PERSONAL_BRIGHT_GREEN="personal--bright-green",a.PERSONAL_DARK="personal--dark",a}({});export const modernThemes=new Set(["personal","personal--forest-green","personal--bright-green","personal--dark"]);export const getThemeClassName=a=>`np-theme-${a}`;
1
+ export var Theme=/*#__PURE__*/function(a){return a.LIGHT="light",a.DARK="dark",a.NAVY="navy",a.PERSONAL="personal",a.PERSONAL_FOREST_GREEN="personal--forest-green",a.PERSONAL_BRIGHT_GREEN="personal--bright-green",a.PERSONAL_DARK="personal--dark",a}({});export var modernThemes=new Set(["personal","personal--forest-green","personal--bright-green","personal--dark"]);export var getThemeClassName=function(a){return"np-theme-".concat(a)};
@@ -1 +1 @@
1
- import{Alert as DangerIcon,AlertCircleFill}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import Avatar,{AvatarType}from"../avatar";import Body from"../body";import Button from"../button";import{ControlType,Priority,Size,Typography}from"../common";import Title from"../title";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";function CriticalCommsBanner(a){let{title:b,subtitle:c,action:d,className:e}=a;const{isModern:f}=useTheme();return/*#__PURE__*/_jsx("div",{className:classNames("critical-comms",e),children:/*#__PURE__*/_jsxs("div",{className:"critical-comms-body",children:[/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.ICON,className:classNames(f?"m-r-2":"m-r-1"),backgroundColor:f?"var(--color-sentiment-negative)":"var(--color-background-negative)",children:f?/*#__PURE__*/_jsx(AlertCircleFill,{}):/*#__PURE__*/_jsx(DangerIcon,{size:24})}),/*#__PURE__*/_jsxs("div",{className:"critical-comms-content d-flex align-items-center flex-grow-1",children:[/*#__PURE__*/_jsxs("div",{className:classNames("flex-grow-1",{"p-x-2":!f}),children:[/*#__PURE__*/_jsx(Title,{type:f?Typography.TITLE_BODY:Typography.TITLE_GROUP,className:"critical-comms--title",children:b}),/*#__PURE__*/_jsx(Body,{className:"critical-comms--subtitle",children:c})]}),d?/*#__PURE__*/_jsx("div",{className:"critical-comms--cta",children:/*#__PURE__*/_jsx(Button,{block:f,size:Size.SMALL,type:ControlType.NEGATIVE,priority:f?Priority.SECONDARY:Priority.PRIMARY,className:"cta-btn",onClick:()=>{d&&(window.location.href=d.href)},children:d.label})}):null]})]})})}export default CriticalCommsBanner;
1
+ import{Alert as DangerIcon,AlertCircleFill}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import Avatar,{AvatarType}from"../avatar";import Body from"../body";import Button from"../button";import{ControlType,Priority,Size,Typography}from"../common";import Title from"../title";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";function CriticalCommsBanner(a){var b=a.title,c=a.subtitle,d=a.action,e=a.className,f=useTheme(),g=f.isModern;return/*#__PURE__*/_jsx("div",{className:classNames("critical-comms",e),children:/*#__PURE__*/_jsxs("div",{className:"critical-comms-body",children:[/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.ICON,className:classNames(g?"m-r-2":"m-r-1"),backgroundColor:g?"var(--color-sentiment-negative)":"var(--color-background-negative)",children:g?/*#__PURE__*/_jsx(AlertCircleFill,{}):/*#__PURE__*/_jsx(DangerIcon,{size:24})}),/*#__PURE__*/_jsxs("div",{className:"critical-comms-content d-flex align-items-center flex-grow-1",children:[/*#__PURE__*/_jsxs("div",{className:classNames("flex-grow-1",{"p-x-2":!g}),children:[/*#__PURE__*/_jsx(Title,{type:g?Typography.TITLE_BODY:Typography.TITLE_GROUP,className:"critical-comms--title",children:b}),/*#__PURE__*/_jsx(Body,{className:"critical-comms--subtitle",children:c})]}),d?/*#__PURE__*/_jsx("div",{className:"critical-comms--cta",children:/*#__PURE__*/_jsx(Button,{block:g,size:Size.SMALL,type:ControlType.NEGATIVE,priority:g?Priority.SECONDARY:Priority.PRIMARY,className:"cta-btn",onClick:function onClick(){d&&(window.location.href=d.href)},children:d.label})}):null]})]})})}export default CriticalCommsBanner;
@@ -1 +1 @@
1
- import{text}from"@storybook/addon-knobs";import CriticalCommsBanner from".";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";export default{component:CriticalCommsBanner,title:"Feedback/CriticalCommsBanner"};export const Basic=()=>{const a=text("title","Your account is overdrawn"),b=text("subtitle","Add money within the next 30 days");return/*#__PURE__*/_jsx(_Fragment,{children:/*#__PURE__*/_jsx(CriticalCommsBanner,{title:a,subtitle:b,action:{label:"Take action",href:"https://wise.com"}})})};
1
+ import{text}from"@storybook/addon-knobs";import CriticalCommsBanner from".";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";export default{component:CriticalCommsBanner,title:"Feedback/CriticalCommsBanner"};export var Basic=function(){var a=text("title","Your account is overdrawn"),b=text("subtitle","Add money within the next 30 days");return/*#__PURE__*/_jsx(_Fragment,{children:/*#__PURE__*/_jsx(CriticalCommsBanner,{title:a,subtitle:b,action:{label:"Take action",href:"https://wise.com"}})})};
@@ -1,10 +1,4 @@
1
- import classNames from"classnames";import PropTypes from"prop-types";import{useState}from"react";import{useIntl}from"react-intl";import{Select,Input}from"..";import{Size,DateMode,MonthFormat}from"../common";import{getMonthNames,isDateValid,isMonthAndYearFormat}from"../common/dateUtils";import messages from"./DateInput.messages";import{explodeDate,convertToLocalMidnight}from"./utils";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const MonthBeforeDay=new Set(["en-US","ja-JP"]),INITIAL_DEFAULT_STATE={year:null,month:null,day:null},DateInput=a=>{let{disabled:b,size:c,value:d,dayLabel:e,monthLabel:f,yearLabel:g,monthFormat:h,mode:i,onChange:j,onFocus:k,onBlur:l,placeholders:m,id:n,selectProps:o}=a;const{locale:p,formatMessage:q}=useIntl(),r=()=>d&&isDateValid(d)?"string"==typeof d?convertToLocalMidnight(d):d:null,s=a=>{let b=INITIAL_DEFAULT_STATE;if(d&&isDateValid(d)){const a=r();b=explodeDate(a),isMonthAndYearFormat(d)&&(b.day=null)}return b[a]},[t,u]=useState(()=>s("day")),[v,w]=useState(()=>s("month")),[x,y]=useState(()=>s("year")),[z,A]=useState(r);e=e||q(messages.dayLabel),f=f||q(messages.monthLabel),g=g||q(messages.yearLabel),m={day:m?.day||"DD",month:m?.month||q(messages.monthLabel),year:m?.year||"YYYY"};const B=a=>{if(!isDateValid(a))return"";switch(i){case DateMode.MONTH_YEAR:return[a.getFullYear(),`0${a.getMonth()+1}`.slice(-2)].join("-");case DateMode.DAY_MONTH_YEAR:default:return[a.getFullYear(),`0${a.getMonth()+1}`.slice(-2),`0${a.getDate()}`.slice(-2)].join("-");}},C=()=>{const a=getMonthNames(p,h);return/*#__PURE__*/_jsxs("label",{children:[/*#__PURE__*/_jsx("span",{className:"sr-only",children:f}),/*#__PURE__*/_jsx(Select,{id:n?`${n}-select`:void 0,name:"month",disabled:b,placeholder:m.month,options:D(),size:c,selected:null===v?null:{value:v,label:a[v]},onChange:a=>G(a),...o})]})},D=()=>{const a=[],b=getMonthNames(p,h);return b.forEach((b,c)=>{a.push({value:c,label:b})}),a},E=function(){let a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:t,b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:v,c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:x;const d=null!=a&&null!=b&&null!=c?new Date(c,b,a):null,e=isDateValid(d)?d:null;e||I(INITIAL_DEFAULT_STATE),i===DateMode.MONTH_YEAR?0<=b&&c&&(b!==v||c!==x)&&I(e):a&&0<=b&&c&&(a!==t||b!==v||c!==x)&&I(e)},F=a=>{const{checkedDay:b}=J(a.target.value,v,x);u(b),E(b,v,x)},G=a=>{if(!a)return w(null),void E(t,null,x);const b=a?a.value:0,{checkedDay:c}=J(t,b,x);w(b),t&&c!==t&&u(c),E(c,b,x)},H=a=>{const b=a.target.value,c=4<b.length?b.slice(0,4):b;if(4===c.toString().length){// Correct day based on year and month.
2
- const{checkedDay:a}=J(t,v,b);t&&a!==t&&u(a),y(c),E(a,v,c)}else y(c),E(t,v,null)},I=a=>{a!==z&&(A(a),j(B(a)||null))},J=function(){let a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,d=a;const e=new Date(c||2e3,b+1,0).getDate();return a||(d=null),(a&&0>a||"00"===a)&&(d=1),(a&&b||31<a)&&(d=a>e?e:a),{checkedDay:d,checkedMonth:b,checkedYear:c}},K=i===DateMode.MONTH_YEAR,L=classNames({"col-sm-8":K,"col-sm-5":!K}),M=MonthBeforeDay.has(p);return/*#__PURE__*/_jsx("div",{className:"tw-date",id:n,onFocus:a=>shouldPropagateOnFocus(a)?k&&k():a.stopPropagation(),onBlur:a=>shouldPropagateOnBlur(a)?l&&l():a.stopPropagation(),children:/*#__PURE__*/_jsxs("div",{className:"row",children:[M&&/*#__PURE__*/_jsx("div",{className:L,children:C()}),!K&&/*#__PURE__*/_jsx("div",{className:"col-sm-3",children:/*#__PURE__*/_jsxs("label",{children:[/*#__PURE__*/_jsx("span",{className:"sr-only",children:e}),/*#__PURE__*/_jsx("div",{className:`input-group input-group-${c}`,children:/*#__PURE__*/_jsx(Input,{type:"number",name:"day",value:t||"",placeholder:m.day,disabled:b,onChange:a=>F(a)})})]})}),!M&&/*#__PURE__*/_jsx("div",{className:L,children:C()}),/*#__PURE__*/_jsx("div",{className:"col-sm-4",children:/*#__PURE__*/_jsxs("label",{children:[/*#__PURE__*/_jsx("span",{className:"sr-only",children:g}),/*#__PURE__*/_jsx("div",{className:`input-group input-group-${c}`,children:/*#__PURE__*/_jsx(Input,{type:"number",name:"year",placeholder:m.year,value:x||"",disabled:b,onChange:a=>H(a)})})]})})]})})};// Should only propagate if the relatedTarget is not part of this DateInput component.
3
- function shouldPropagateOnFocus(a){let{target:b,relatedTarget:c}=a;const d=b.closest(".tw-date"),e=c&&c.closest(".tw-date");return d!==e}// Should only propagate if the relatedTarget or the activeElement is not part of this DateInput component.
4
- function shouldPropagateOnBlur(a){let{target:b,relatedTarget:c}=a;const d=b.closest(".tw-date"),e=c||(document.activeElement===b?null:document.activeElement),f=e&&e.closest(".tw-date");// Even though FocusEvent.relatedTarget is supported by IE
5
- // (https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent/relatedTarget)
6
- // "IE11 sets document.activeElement to the next focused element before the blur event is called."
7
- // (https://stackoverflow.com/a/49325196/986241)
8
- // Therefore if the relatedTarget is null, we try the document.activeElement,
9
- // which may contain the HTML element that is gaining focus
10
- return d!==f}DateInput.propTypes={disabled:PropTypes.bool,size:PropTypes.oneOf(["sm","md","lg"]),value:PropTypes.oneOfType([PropTypes.string,PropTypes.instanceOf(Date)]),onChange:PropTypes.func.isRequired,onFocus:PropTypes.func,onBlur:PropTypes.func,dayLabel:PropTypes.string,monthLabel:PropTypes.string,yearLabel:PropTypes.string,monthFormat:PropTypes.oneOf(["long","short"]),mode:PropTypes.oneOf(["day-month-year","month-year"]),placeholders:PropTypes.shape({day:PropTypes.node,month:PropTypes.node,year:PropTypes.node}),id:PropTypes.string,selectProps:PropTypes.object},DateInput.defaultProps={disabled:!1,size:Size.MEDIUM,value:null,onFocus:null,onBlur:null,monthFormat:MonthFormat.LONG,mode:DateMode.DAY_MONTH_YEAR,id:"",selectProps:{}};export default DateInput;
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 classNames from"classnames";import PropTypes from"prop-types";import{useState}from"react";import{useIntl}from"react-intl";import{Select,Input}from"..";import{Size,DateMode,MonthFormat}from"../common";import{getMonthNames,isDateValid,isMonthAndYearFormat}from"../common/dateUtils";import messages from"./DateInput.messages";import{explodeDate,convertToLocalMidnight}from"./utils";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var MonthBeforeDay=new Set(["en-US","ja-JP"]),INITIAL_DEFAULT_STATE={year:null,month:null,day:null},DateInput=function(a){var b,c,d,e=a.disabled,f=a.size,g=a.value,h=a.dayLabel,i=a.monthLabel,j=a.yearLabel,k=a.monthFormat,l=a.mode,m=a.onChange,n=a.onFocus,o=a.onBlur,p=a.placeholders,q=a.id,r=a.selectProps,s=useIntl(),t=s.locale,u=s.formatMessage,v=function(){return g&&isDateValid(g)?"string"==typeof g?convertToLocalMidnight(g):g:null},w=function(a){var b=INITIAL_DEFAULT_STATE;if(g&&isDateValid(g)){var c=v();b=explodeDate(c),isMonthAndYearFormat(g)&&(b.day=null)}return b[a]},x=useState(function(){return w("day")}),y=_slicedToArray(x,2),z=y[0],A=y[1],B=useState(function(){return w("month")}),C=_slicedToArray(B,2),D=C[0],E=C[1],F=useState(function(){return w("year")}),G=_slicedToArray(F,2),H=G[0],I=G[1],J=useState(v),K=_slicedToArray(J,2),L=K[0],M=K[1];h=h||u(messages.dayLabel),i=i||u(messages.monthLabel),j=j||u(messages.yearLabel),p={day:(null===(b=p)||void 0===b?void 0:b.day)||"DD",month:(null===(c=p)||void 0===c?void 0:c.month)||u(messages.monthLabel),year:(null===(d=p)||void 0===d?void 0:d.year)||"YYYY"};var N=function(a){if(!isDateValid(a))return"";switch(l){case DateMode.MONTH_YEAR:return[a.getFullYear(),"0".concat(a.getMonth()+1).slice(-2)].join("-");case DateMode.DAY_MONTH_YEAR:default:return[a.getFullYear(),"0".concat(a.getMonth()+1).slice(-2),"0".concat(a.getDate()).slice(-2)].join("-");}},O=function(){var a=getMonthNames(t,k);return/*#__PURE__*/_jsxs("label",{children:[/*#__PURE__*/_jsx("span",{className:"sr-only",children:i}),/*#__PURE__*/_jsx(Select,_objectSpread({id:q?"".concat(q,"-select"):void 0,name:"month",disabled:e,placeholder:p.month,options:P(),size:f,selected:null===D?null:{value:D,label:a[D]},onChange:function(a){return S(a)}},r))]})},P=function(){var a=[],b=getMonthNames(t,k);return b.forEach(function(b,c){a.push({value:c,label:b})}),a},Q=function(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:z,b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:D,c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:H,d=null!=a&&null!=b&&null!=c?new Date(c,b,a):null,e=isDateValid(d)?d:null;e||U(INITIAL_DEFAULT_STATE),l===DateMode.MONTH_YEAR?0<=b&&c&&(b!==D||c!==H)&&U(e):a&&0<=b&&c&&(a!==z||b!==D||c!==H)&&U(e)},R=function(a){var b=V(a.target.value,D,H),c=b.checkedDay;A(c),Q(c,D,H)},S=function(a){if(!a)return E(null),void Q(z,null,H);var b=a?a.value:0,c=V(z,b,H),d=c.checkedDay;E(b),z&&d!==z&&A(d),Q(d,b,H)},T=function(a){var b=a.target.value,c=4<b.length?b.slice(0,4):b;if(4===c.toString().length){// Correct day based on year and month.
2
+ var d=V(z,D,b),e=d.checkedDay;z&&e!==z&&A(e),I(c),Q(e,D,c)}else I(c),Q(z,D,null)},U=function(a){a!==L&&(M(a),m(N(a)||null))},V=function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,d=a,e=new Date(c||2e3,b+1,0).getDate();return a||(d=null),(a&&0>a||"00"===a)&&(d=1),(a&&b||31<a)&&(d=a>e?e:a),{checkedDay:d,checkedMonth:b,checkedYear:c}},W=l===DateMode.MONTH_YEAR,X=classNames({"col-sm-8":W,"col-sm-5":!W}),Y=MonthBeforeDay.has(t);return/*#__PURE__*/_jsx("div",{className:"tw-date",id:q,onFocus:function onFocus(a){return shouldPropagateOnFocus(a)?n&&n():a.stopPropagation()},onBlur:function onBlur(a){return shouldPropagateOnBlur(a)?o&&o():a.stopPropagation()},children:/*#__PURE__*/_jsxs("div",{className:"row",children:[Y&&/*#__PURE__*/_jsx("div",{className:X,children:O()}),!W&&/*#__PURE__*/_jsx("div",{className:"col-sm-3",children:/*#__PURE__*/_jsxs("label",{children:[/*#__PURE__*/_jsx("span",{className:"sr-only",children:h}),/*#__PURE__*/_jsx("div",{className:"input-group input-group-".concat(f),children:/*#__PURE__*/_jsx(Input,{type:"number",name:"day",value:z||"",placeholder:p.day,disabled:e,onChange:function(a){return R(a)}})})]})}),!Y&&/*#__PURE__*/_jsx("div",{className:X,children:O()}),/*#__PURE__*/_jsx("div",{className:"col-sm-4",children:/*#__PURE__*/_jsxs("label",{children:[/*#__PURE__*/_jsx("span",{className:"sr-only",children:j}),/*#__PURE__*/_jsx("div",{className:"input-group input-group-".concat(f),children:/*#__PURE__*/_jsx(Input,{type:"number",name:"year",placeholder:p.year,value:H||"",disabled:e,onChange:function(a){return T(a)}})})]})})]})})};// Should only propagate if the relatedTarget is not part of this DateInput component.
3
+ function shouldPropagateOnFocus(a){var b=a.target,c=a.relatedTarget,d=b.closest(".tw-date"),e=c&&c.closest(".tw-date");return d!==e}// Should only propagate if the relatedTarget or the activeElement is not part of this DateInput component.
4
+ function shouldPropagateOnBlur(a){var b=a.target,c=a.relatedTarget,d=b.closest(".tw-date"),e=c||(document.activeElement===b?null:document.activeElement),f=e&&e.closest(".tw-date");return d!==f}DateInput.propTypes={disabled:PropTypes.bool,size:PropTypes.oneOf(["sm","md","lg"]),value:PropTypes.oneOfType([PropTypes.string,PropTypes.instanceOf(Date)]),onChange:PropTypes.func.isRequired,onFocus:PropTypes.func,onBlur:PropTypes.func,dayLabel:PropTypes.string,monthLabel:PropTypes.string,yearLabel:PropTypes.string,monthFormat:PropTypes.oneOf(["long","short"]),mode:PropTypes.oneOf(["day-month-year","month-year"]),placeholders:PropTypes.shape({day:PropTypes.node,month:PropTypes.node,year:PropTypes.node}),id:PropTypes.string,selectProps:PropTypes.object},DateInput.defaultProps={disabled:!1,size:Size.MEDIUM,value:null,onFocus:null,onBlur:null,monthFormat:MonthFormat.LONG,mode:DateMode.DAY_MONTH_YEAR,id:"",selectProps:{}};export default DateInput;
@@ -1 +1 @@
1
- import{DateInput,InlineAlert}from"..";import{lorem10,storyConfig}from"../test-utils";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:DateInput,title:"Forms/DateInput",args:{dayLabel:"Day input",monthLabel:"Month select",yearLabel:"Year input",selectProps:{buttonProps:{"aria-label":"Select month"},dropdownProps:{"aria-label":"Month options"}}},tags:["autodocs"]};export const Basic={};export const BasicMobile=storyConfig(Basic,{variants:["mobile"]});export const InputError={...Basic,render:a=>/*#__PURE__*/_jsxs("div",{className:"form-group has-error",children:[/*#__PURE__*/_jsx(DateInput,{...a}),/*#__PURE__*/_jsx(InlineAlert,{type:"error",children:lorem10})]})};export const InputErrorMobile=storyConfig(InputError,{variants:["mobile"]});
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{DateInput,InlineAlert}from"..";import{lorem10,storyConfig}from"../test-utils";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:DateInput,title:"Forms/DateInput",args:{dayLabel:"Day input",monthLabel:"Month select",yearLabel:"Year input",selectProps:{buttonProps:{"aria-label":"Select month"},dropdownProps:{"aria-label":"Month options"}}},tags:["autodocs"]};export var Basic={};export var BasicMobile=storyConfig(Basic,{variants:["mobile"]});export var InputError=_objectSpread(_objectSpread({},Basic),{},{render:function render(a){return/*#__PURE__*/_jsxs("div",{className:"form-group has-error",children:[/*#__PURE__*/_jsx(DateInput,_objectSpread({},a)),/*#__PURE__*/_jsx(InlineAlert,{type:"error",children:lorem10})]})}});export var InputErrorMobile=storyConfig(InputError,{variants:["mobile"]});
@@ -1,2 +1,2 @@
1
- export const convertToLocalMidnight=a=>{const b=new Date(a.split("T")[0]);// using YYYY-MM-DD creates UTC date
1
+ export var convertToLocalMidnight=function(a){var b=new Date(a.split("T")[0]);// using YYYY-MM-DD creates UTC date
2
2
  return new Date(b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate())};
@@ -1 +1 @@
1
- export const explodeDate=a=>{const b=a.getFullYear(),c=a.getMonth(),d=a.getDate();return{year:b,month:c,day:d}};
1
+ export var explodeDate=function(a){var b=a.getFullYear(),c=a.getMonth(),d=a.getDate();return{year:b,month:c,day:d}};
@@ -1,4 +1,3 @@
1
- import PropTypes from"prop-types";import{createRef,PureComponent}from"react";import{Size,MonthFormat,Position}from"../common";import{isWithinRange,moveToWithinRange}from"../common/dateUtils";import KeyCodes from"../common/keyCodes";import ResponsivePanel from"../common/responsivePanel";import DateTrigger from"./dateTrigger";import DayCalendar from"./dayCalendar";import{getStartOfDay}from"./getStartOfDay";import MonthCalendar from"./monthCalendar";import YearCalendar from"./yearCalendar";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const MODE={DAY:"day",MONTH:"month",YEAR:"year"};class DateLookup extends PureComponent{element=/*#__PURE__*/createRef();dropdown=/*#__PURE__*/createRef();constructor(a){super(a),this.state={selectedDate:getStartOfDay(a.value),min:getStartOfDay(a.min),max:getStartOfDay(a.max),viewMonth:(a.value||new Date).getMonth(),viewYear:(a.value||new Date).getFullYear(),open:!1,mode:MODE.DAY}}static getDerivedStateFromProps(a,b){const c=getStartOfDay(a.value),d=getStartOfDay(a.min),e=getStartOfDay(a.max),f=+b.selectedDate!=+c,g=+b.min!=+d,h=+b.max!=+e;if(f||g||h){const i=f?c:b.selectedDate,j=g?d:b.min,k=h?e:b.max;// make sure that selected date is within allowed range
2
- if(!isWithinRange(i,j,k))return a.onChange(moveToWithinRange(i,j,k)),null;const l=(i||new Date).getMonth(),m=(i||new Date).getFullYear();return{selectedDate:i,min:j,max:k,viewMonth:l,viewYear:m}}return null}componentDidUpdate(a){+this.props.value!=+a.value&&this.state.open&&this.focusOn(".active")}componentWillUnmount(){// Prevents memory leak by cleaning state.
3
- this.setState=()=>{}}open=()=>{const{onFocus:a}=this.props;this.setState({open:!0,mode:MODE.DAY}),a&&a()};close=()=>{const{onBlur:a}=this.props;this.setState({open:!1}),a&&a()};handleKeyDown=a=>{const{open:b}=this.state;switch(a.keyCode){case KeyCodes.LEFT:b?this.adjustDate(-1,-1,-1):this.open(),a.preventDefault();break;case KeyCodes.UP:b?this.adjustDate(-7,-4,-4):this.open(),a.preventDefault();break;case KeyCodes.RIGHT:b?this.adjustDate(1,1,1):this.open(),a.preventDefault();break;case KeyCodes.DOWN:b?this.adjustDate(7,4,4):this.open(),a.preventDefault();break;case KeyCodes.ESCAPE:this.close(),a.preventDefault();break;default:}};adjustDate=(a,b,c)=>{const{selectedDate:d,min:e,max:f,mode:g}=this.state;let h;h=d?new Date(g===MODE.YEAR?d.getFullYear()+c:d.getFullYear(),g===MODE.MONTH?d.getMonth()+b:d.getMonth(),g===MODE.DAY?d.getDate()+a:d.getDate()):getStartOfDay(new Date),h=moveToWithinRange(h,e,f),+h!=+d&&this.props.onChange(h)};focusOn=(a,b)=>{const c=this.element.current.querySelector(a);c?c.focus():b&&this.focusOn(b)};switchMode=a=>{this.setState({mode:a},()=>{this.focusOn(".active",".today")})};switchToDays=()=>this.switchMode(MODE.DAY);switchToMonths=()=>this.switchMode(MODE.MONTH);switchToYears=()=>this.switchMode(MODE.YEAR);handleSelectedDateUpdate=a=>{this.setState({selectedDate:a},()=>{this.props.onChange(a),this.close(),this.focusOn(".btn")})};handleViewDateUpdate=a=>{let{month:b=this.state.viewMonth,year:c=this.state.viewYear}=a;this.setState({viewMonth:b,viewYear:c})};getCalendar=()=>{const{selectedDate:a,min:b,max:c,viewMonth:d,viewYear:e,mode:f}=this.state,{placeholder:g,monthFormat:h}=this.props;return/*#__PURE__*/_jsxs("div",{className:"p-a-1",children:[f===MODE.DAY&&/*#__PURE__*/_jsx(DayCalendar,{selectedDate:a,min:b,max:c,viewMonth:d,viewYear:e,monthFormat:h,onSelect:this.handleSelectedDateUpdate,onLabelClick:this.switchToYears,onViewDateUpdate:this.handleViewDateUpdate}),f===MODE.MONTH&&/*#__PURE__*/_jsx(MonthCalendar,{selectedDate:a,min:b,max:c,viewYear:e,placeholder:g,onSelect:this.switchToDays,onLabelClick:this.switchToYears,onViewDateUpdate:this.handleViewDateUpdate}),f===MODE.YEAR&&/*#__PURE__*/_jsx(YearCalendar,{selectedDate:a,min:b,max:c,viewYear:e,placeholder:g,onSelect:this.switchToMonths,onViewDateUpdate:this.handleViewDateUpdate})]})};handleClear=()=>{this.props.onChange(null),this.focusOn(".np-date-trigger")};render(){const{selectedDate:a,open:b}=this.state,{size:c,placeholder:d,label:e,monthFormat:f,disabled:g,clearable:h,value:i}=this.props;return/*#__PURE__*/_jsxs("div",{// eslint-disable-line jsx-a11y/no-static-element-interactions
4
- ref:this.element,className:"input-group",onKeyDown:this.handleKeyDown,children:[/*#__PURE__*/_jsx(DateTrigger,{selectedDate:a,size:c,placeholder:d,label:e,monthFormat:f,disabled:g,onClick:this.open,onClear:!g&&h&&i?this.handleClear:null}),/*#__PURE__*/_jsx(ResponsivePanel,{anchorRef:this.element,open:b,className:"tw-date-lookup-menu",position:Position.BOTTOM,onClose:this.close,children:this.getCalendar()})]})}}DateLookup.propTypes={value:PropTypes.instanceOf(Date).isRequired,min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),size:PropTypes.oneOf(["sm","md","lg"]),placeholder:PropTypes.string,label:PropTypes.string,monthFormat:PropTypes.oneOf(["long","short"]),disabled:PropTypes.bool,onChange:PropTypes.func.isRequired,onFocus:PropTypes.func,onBlur:PropTypes.func,clearable:PropTypes.bool},DateLookup.defaultProps={min:null,max:null,size:Size.MEDIUM,placeholder:"",label:"",monthFormat:MonthFormat.LONG,disabled:!1,onFocus:null,onBlur:null,clearable:!1};export default DateLookup;
1
+ import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";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{createRef,PureComponent}from"react";import{Size,MonthFormat,Position}from"../common";import{isWithinRange,moveToWithinRange}from"../common/dateUtils";import KeyCodes from"../common/keyCodes";import ResponsivePanel from"../common/responsivePanel";import DateTrigger from"./dateTrigger";import DayCalendar from"./dayCalendar";import{getStartOfDay}from"./getStartOfDay";import MonthCalendar from"./monthCalendar";import YearCalendar from"./yearCalendar";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var MODE={DAY:"day",MONTH:"month",YEAR:"year"},DateLookup=/*#__PURE__*/function(a){function b(a){var d;return _classCallCheck(this,b),d=c.call(this,a),_defineProperty(_assertThisInitialized(d),"element",/*#__PURE__*/createRef()),_defineProperty(_assertThisInitialized(d),"dropdown",/*#__PURE__*/createRef()),_defineProperty(_assertThisInitialized(d),"open",function(){var a=d.props.onFocus;d.setState({open:!0,mode:MODE.DAY}),a&&a()}),_defineProperty(_assertThisInitialized(d),"close",function(){var a=d.props.onBlur;d.setState({open:!1}),a&&a()}),_defineProperty(_assertThisInitialized(d),"handleKeyDown",function(a){var b=d.state.open;switch(a.keyCode){case KeyCodes.LEFT:b?d.adjustDate(-1,-1,-1):d.open(),a.preventDefault();break;case KeyCodes.UP:b?d.adjustDate(-7,-4,-4):d.open(),a.preventDefault();break;case KeyCodes.RIGHT:b?d.adjustDate(1,1,1):d.open(),a.preventDefault();break;case KeyCodes.DOWN:b?d.adjustDate(7,4,4):d.open(),a.preventDefault();break;case KeyCodes.ESCAPE:d.close(),a.preventDefault();break;default:}}),_defineProperty(_assertThisInitialized(d),"adjustDate",function(a,b,c){var e,f=d.state,g=f.selectedDate,h=f.min,i=f.max,j=f.mode;e=g?new Date(j===MODE.YEAR?g.getFullYear()+c:g.getFullYear(),j===MODE.MONTH?g.getMonth()+b:g.getMonth(),j===MODE.DAY?g.getDate()+a:g.getDate()):getStartOfDay(new Date),e=moveToWithinRange(e,h,i),+e!=+g&&d.props.onChange(e)}),_defineProperty(_assertThisInitialized(d),"focusOn",function(a,b){var c=d.element.current.querySelector(a);c?c.focus():b&&d.focusOn(b)}),_defineProperty(_assertThisInitialized(d),"switchMode",function(a){d.setState({mode:a},function(){d.focusOn(".active",".today")})}),_defineProperty(_assertThisInitialized(d),"switchToDays",function(){return d.switchMode(MODE.DAY)}),_defineProperty(_assertThisInitialized(d),"switchToMonths",function(){return d.switchMode(MODE.MONTH)}),_defineProperty(_assertThisInitialized(d),"switchToYears",function(){return d.switchMode(MODE.YEAR)}),_defineProperty(_assertThisInitialized(d),"handleSelectedDateUpdate",function(a){d.setState({selectedDate:a},function(){d.props.onChange(a),d.close(),d.focusOn(".btn")})}),_defineProperty(_assertThisInitialized(d),"handleViewDateUpdate",function(a){var b=a.month,c=void 0===b?d.state.viewMonth:b,e=a.year,f=void 0===e?d.state.viewYear:e;d.setState({viewMonth:c,viewYear:f})}),_defineProperty(_assertThisInitialized(d),"getCalendar",function(){var a=d.state,b=a.selectedDate,c=a.min,e=a.max,f=a.viewMonth,g=a.viewYear,h=a.mode,i=d.props,j=i.placeholder,k=i.monthFormat;return/*#__PURE__*/_jsxs("div",{className:"p-a-1",children:[h===MODE.DAY&&/*#__PURE__*/_jsx(DayCalendar,{selectedDate:b,min:c,max:e,viewMonth:f,viewYear:g,monthFormat:k,onSelect:d.handleSelectedDateUpdate,onLabelClick:d.switchToYears,onViewDateUpdate:d.handleViewDateUpdate}),h===MODE.MONTH&&/*#__PURE__*/_jsx(MonthCalendar,{selectedDate:b,min:c,max:e,viewYear:g,placeholder:j,onSelect:d.switchToDays,onLabelClick:d.switchToYears,onViewDateUpdate:d.handleViewDateUpdate}),h===MODE.YEAR&&/*#__PURE__*/_jsx(YearCalendar,{selectedDate:b,min:c,max:e,viewYear:g,placeholder:j,onSelect:d.switchToMonths,onViewDateUpdate:d.handleViewDateUpdate})]})}),_defineProperty(_assertThisInitialized(d),"handleClear",function(){d.props.onChange(null),d.focusOn(".np-date-trigger")}),d.state={selectedDate:getStartOfDay(a.value),min:getStartOfDay(a.min),max:getStartOfDay(a.max),viewMonth:(a.value||new Date).getMonth(),viewYear:(a.value||new Date).getFullYear(),open:!1,mode:MODE.DAY},d}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"componentDidUpdate",value:function componentDidUpdate(a){+this.props.value!=+a.value&&this.state.open&&this.focusOn(".active")}},{key:"componentWillUnmount",value:function componentWillUnmount(){this.setState=function(){}}},{key:"render",value:function render(){var a=this.state,b=a.selectedDate,c=a.open,d=this.props,e=d.size,f=d.placeholder,g=d.label,h=d.monthFormat,i=d.disabled,j=d.clearable,k=d.value;return/*#__PURE__*/_jsxs("div",{// eslint-disable-line jsx-a11y/no-static-element-interactions
2
+ ref:this.element,className:"input-group",onKeyDown:this.handleKeyDown,children:[/*#__PURE__*/_jsx(DateTrigger,{selectedDate:b,size:e,placeholder:f,label:g,monthFormat:h,disabled:i,onClick:this.open,onClear:!i&&j&&k?this.handleClear:null}),/*#__PURE__*/_jsx(ResponsivePanel,{anchorRef:this.element,open:c,className:"tw-date-lookup-menu",position:Position.BOTTOM,onClose:this.close,children:this.getCalendar()})]})}}],[{key:"getDerivedStateFromProps",value:function getDerivedStateFromProps(a,b){var c=getStartOfDay(a.value),d=getStartOfDay(a.min),e=getStartOfDay(a.max),f=+b.selectedDate!=+c,g=+b.min!=+d,h=+b.max!=+e;if(f||g||h){var i=f?c:b.selectedDate,j=g?d:b.min,k=h?e:b.max;// make sure that selected date is within allowed range
3
+ if(!isWithinRange(i,j,k))return a.onChange(moveToWithinRange(i,j,k)),null;var l=(i||new Date).getMonth(),m=(i||new Date).getFullYear();return{selectedDate:i,min:j,max:k,viewMonth:l,viewYear:m}}return null}}]),b}(PureComponent);DateLookup.propTypes={value:PropTypes.instanceOf(Date).isRequired,min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),size:PropTypes.oneOf(["sm","md","lg"]),placeholder:PropTypes.string,label:PropTypes.string,monthFormat:PropTypes.oneOf(["long","short"]),disabled:PropTypes.bool,onChange:PropTypes.func.isRequired,onFocus:PropTypes.func,onBlur:PropTypes.func,clearable:PropTypes.bool},DateLookup.defaultProps={min:null,max:null,size:Size.MEDIUM,placeholder:"",label:"",monthFormat:MonthFormat.LONG,disabled:!1,onFocus:null,onBlur:null,clearable:!1};export default DateLookup;
@@ -1 +1 @@
1
- import PropTypes from"prop-types";import Chevron from"../../chevron";import{Position,Size}from"../../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const buttonClasses="btn-link p-a-0 text-no-decoration np-text-body-large-bold rounded-sm",DateHeader=a=>{let{label:b,onLabelClick:c,onPreviousClick:d,onNextClick:e}=a;return/*#__PURE__*/_jsxs("div",{className:"text-xs-center p-t-1 p-b-2 clearfix",children:[/*#__PURE__*/_jsx("div",{className:"pull-left-single-direction",children:/*#__PURE__*/_jsx("button",{type:"button",className:`d-inline-flex ${buttonClasses}`,onClick:d,children:/*#__PURE__*/_jsx(Chevron,{orientation:Position.LEFT,className:"left-single-direction",size:Size.MEDIUM})})}),b&&/*#__PURE__*/_jsx("button",{type:"button",className:`tw-date-lookup-header-current ${buttonClasses}`,onClick:c,children:b}),/*#__PURE__*/_jsx("div",{className:"pull-right-single-direction",children:/*#__PURE__*/_jsx("button",{type:"button",className:`d-inline-flex ${buttonClasses}`,onClick:e,children:/*#__PURE__*/_jsx(Chevron,{orientation:Position.RIGHT,className:"right-single-direction",size:Size.MEDIUM})})})]})};DateHeader.propTypes={label:PropTypes.string,onLabelClick:PropTypes.func,onPreviousClick:PropTypes.func.isRequired,onNextClick:PropTypes.func.isRequired},DateHeader.defaultProps={label:null,onLabelClick:()=>{}};export default DateHeader;
1
+ import PropTypes from"prop-types";import Chevron from"../../chevron";import{Position,Size}from"../../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var buttonClasses="btn-link p-a-0 text-no-decoration np-text-body-large-bold rounded-sm",DateHeader=function(a){var b=a.label,c=a.onLabelClick,d=a.onPreviousClick,e=a.onNextClick;return/*#__PURE__*/_jsxs("div",{className:"text-xs-center p-t-1 p-b-2 clearfix",children:[/*#__PURE__*/_jsx("div",{className:"pull-left-single-direction",children:/*#__PURE__*/_jsx("button",{type:"button",className:"d-inline-flex ".concat(buttonClasses),onClick:d,children:/*#__PURE__*/_jsx(Chevron,{orientation:Position.LEFT,className:"left-single-direction",size:Size.MEDIUM})})}),b&&/*#__PURE__*/_jsx("button",{type:"button",className:"tw-date-lookup-header-current ".concat(buttonClasses),onClick:c,children:b}),/*#__PURE__*/_jsx("div",{className:"pull-right-single-direction",children:/*#__PURE__*/_jsx("button",{type:"button",className:"d-inline-flex ".concat(buttonClasses),onClick:e,children:/*#__PURE__*/_jsx(Chevron,{orientation:Position.RIGHT,className:"right-single-direction",size:Size.MEDIUM})})})]})};DateHeader.propTypes={label:PropTypes.string,onLabelClick:PropTypes.func,onPreviousClick:PropTypes.func.isRequired,onNextClick:PropTypes.func.isRequired},DateHeader.defaultProps={label:null,onLabelClick:function onLabelClick(){}};export default DateHeader;
@@ -1 +1 @@
1
- import{formatDate}from"@transferwise/formatting";import{isKey}from"@transferwise/neptune-validation";import{useTheme}from"@wise/components-theming";import PropTypes from"prop-types";import{useIntl}from"react-intl";import Chevron from"../../chevron";import{Size,Position}from"../../common";import{CloseButton}from"../../common/closeButton/CloseButton";import messages from"./DateTrigger.messages";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";const DateTrigger=a=>{let{selectedDate:b,size:c,placeholder:d,label:e,monthFormat:f,disabled:g,onClick:h,onClear:i}=a;const{isModern:j}=useTheme(),{locale:k,formatMessage:l}=useIntl();return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs("button",{className:`btn btn-${c} btn-input np-date-trigger`,disabled:g,type:"button",onClick:h,children:[e&&/*#__PURE__*/_jsx("span",{className:"control-label small m-r-1",children:e}),b?/*#__PURE__*/_jsx("span",{className:"font-weight-normal",children:formatDate(b,k,{day:"numeric",month:f,year:"numeric"})}):/*#__PURE__*/_jsx("span",{className:"form-control-placeholder visible-xs-inline visible-sm-inline visible-md-inline visible-lg-inline visible-xl-inline",children:d}),i?null:/*#__PURE__*/_jsx(Chevron,{orientation:Position.BOTTOM,disabled:g})]}),i?/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("div",{className:"clearfix"}),/*#__PURE__*/_jsx("span",{className:"input-group-addon",children:/*#__PURE__*/_jsx(CloseButton,{className:`clear-btn clear-btn--${c}`,"aria-label":l(messages.ariaLabel),size:Size.SMALL,onClick:a=>{a.stopPropagation(),a.preventDefault(),i()},onKeyPress:a=>{(isKey({keyType:"Space",event:a})||isKey({keyType:"Enter",event:a}))&&(a.stopPropagation(),a.preventDefault(),i())}})})]}):null]})};DateTrigger.propTypes={selectedDate:PropTypes.instanceOf(Date),size:PropTypes.oneOf(["sm","md","lg"]),placeholder:PropTypes.string.isRequired,label:PropTypes.string.isRequired,monthFormat:PropTypes.oneOf(["short","long"]).isRequired,disabled:PropTypes.bool.isRequired,onClick:PropTypes.func.isRequired,onClear:PropTypes.func},DateTrigger.defaultProps={selectedDate:null,size:Size.MEDIUM,onClear:void 0};export default DateTrigger;
1
+ import{formatDate}from"@transferwise/formatting";import{isKey}from"@transferwise/neptune-validation";import{useTheme}from"@wise/components-theming";import PropTypes from"prop-types";import{useIntl}from"react-intl";import Chevron from"../../chevron";import{Size,Position}from"../../common";import{CloseButton}from"../../common/closeButton/CloseButton";import messages from"./DateTrigger.messages";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";var DateTrigger=function(a){var b=a.selectedDate,c=a.size,d=a.placeholder,e=a.label,f=a.monthFormat,g=a.disabled,h=a.onClick,i=a.onClear,j=useTheme(),k=j.isModern,l=useIntl(),m=l.locale,n=l.formatMessage;return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs("button",{className:"btn btn-".concat(c," btn-input np-date-trigger"),disabled:g,type:"button",onClick:h,children:[e&&/*#__PURE__*/_jsx("span",{className:"control-label small m-r-1",children:e}),b?/*#__PURE__*/_jsx("span",{className:"font-weight-normal",children:formatDate(b,m,{day:"numeric",month:f,year:"numeric"})}):/*#__PURE__*/_jsx("span",{className:"form-control-placeholder visible-xs-inline visible-sm-inline visible-md-inline visible-lg-inline visible-xl-inline",children:d}),i?null:/*#__PURE__*/_jsx(Chevron,{orientation:Position.BOTTOM,disabled:g})]}),i?/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("div",{className:"clearfix"}),/*#__PURE__*/_jsx("span",{className:"input-group-addon",children:/*#__PURE__*/_jsx(CloseButton,{className:"clear-btn clear-btn--".concat(c),"aria-label":n(messages.ariaLabel),size:Size.SMALL,onClick:function(a){a.stopPropagation(),a.preventDefault(),i()},onKeyPress:function handleKeyDown(a){(isKey({keyType:"Space",event:a})||isKey({keyType:"Enter",event:a}))&&(a.stopPropagation(),a.preventDefault(),i())}})})]}):null]})};DateTrigger.propTypes={selectedDate:PropTypes.instanceOf(Date),size:PropTypes.oneOf(["sm","md","lg"]),placeholder:PropTypes.string.isRequired,label:PropTypes.string.isRequired,monthFormat:PropTypes.oneOf(["short","long"]).isRequired,disabled:PropTypes.bool.isRequired,onClick:PropTypes.func.isRequired,onClear:PropTypes.func},DateTrigger.defaultProps={selectedDate:null,size:Size.MEDIUM,onClear:void 0};export default DateTrigger;
@@ -1 +1 @@
1
- import{formatDate}from"@transferwise/formatting";import PropTypes from"prop-types";import{PureComponent}from"react";import{injectIntl}from"react-intl";import{MonthFormat}from"../../common";import DateHeader from"../dateHeader";import DayCalendarTable from"./table";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";class DayCalendar extends PureComponent{selectPreviousMonth=()=>{const{viewMonth:a,viewYear:b}=this.props;this.props.onViewDateUpdate({month:0>=a?11:a-1,year:0>=a?b-1:b})};selectNextMonth=()=>{const{viewMonth:a,viewYear:b}=this.props;this.props.onViewDateUpdate({month:11<=a?0:a+1,year:11<=a?b+1:b})};render(){const{selectedDate:a,min:b,max:c,viewMonth:d,viewYear:e,intl:{locale:i},monthFormat:f,onLabelClick:g,onSelect:h}=this.props;return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(DateHeader,{label:formatDate(new Date(e,d),i,{month:f,year:"numeric"}),onLabelClick:g,onPreviousClick:this.selectPreviousMonth,onNextClick:this.selectNextMonth}),/*#__PURE__*/_jsx(DayCalendarTable,{selectedDate:a,min:b,max:c,viewMonth:d,viewYear:e,onSelect:h})]})}}DayCalendar.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewMonth:PropTypes.number.isRequired,viewYear:PropTypes.number.isRequired,monthFormat:PropTypes.oneOf([MonthFormat.LONG,MonthFormat.SHORT]).isRequired,onSelect:PropTypes.func.isRequired,onLabelClick:PropTypes.func.isRequired,onViewDateUpdate:PropTypes.func.isRequired},DayCalendar.defaultProps={selectedDate:null,min:null,max:null};export default injectIntl(DayCalendar);
1
+ import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";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{formatDate}from"@transferwise/formatting";import PropTypes from"prop-types";import{PureComponent}from"react";import{injectIntl}from"react-intl";import{MonthFormat}from"../../common";import DateHeader from"../dateHeader";import DayCalendarTable from"./table";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var DayCalendar=/*#__PURE__*/function(a){function b(){var a;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return a=c.call.apply(c,[this].concat(e)),_defineProperty(_assertThisInitialized(a),"selectPreviousMonth",function(){var b=a.props,c=b.viewMonth,d=b.viewYear;a.props.onViewDateUpdate({month:0>=c?11:c-1,year:0>=c?d-1:d})}),_defineProperty(_assertThisInitialized(a),"selectNextMonth",function(){var b=a.props,c=b.viewMonth,d=b.viewYear;a.props.onViewDateUpdate({month:11<=c?0:c+1,year:11<=c?d+1:d})}),a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this.props,b=a.selectedDate,c=a.min,d=a.max,e=a.viewMonth,f=a.viewYear,g=a.intl.locale,h=a.monthFormat,i=a.onLabelClick,j=a.onSelect;return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(DateHeader,{label:formatDate(new Date(f,e),g,{month:h,year:"numeric"}),onLabelClick:i,onPreviousClick:this.selectPreviousMonth,onNextClick:this.selectNextMonth}),/*#__PURE__*/_jsx(DayCalendarTable,{selectedDate:b,min:c,max:d,viewMonth:e,viewYear:f,onSelect:j})]})}}]),b}(PureComponent);DayCalendar.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewMonth:PropTypes.number.isRequired,viewYear:PropTypes.number.isRequired,monthFormat:PropTypes.oneOf([MonthFormat.LONG,MonthFormat.SHORT]).isRequired,onSelect:PropTypes.func.isRequired,onLabelClick:PropTypes.func.isRequired,onViewDateUpdate:PropTypes.func.isRequired},DayCalendar.defaultProps={selectedDate:null,min:null,max:null};export default injectIntl(DayCalendar);
@@ -1,5 +1,4 @@
1
- import{formatDate}from"@transferwise/formatting";import PropTypes from"prop-types";import{PureComponent}from"react";import{injectIntl}from"react-intl";import{getDayNames,isWithinRange}from"../../../common/dateUtils";import{getStartOfDay}from"../../getStartOfDay";import TableLink from"../../tableLink";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const SHORT_DAY_FORMAT={day:"numeric"};class DayCalendarTable extends PureComponent{getTableStructure=()=>{const{viewMonth:a,viewYear:b}=this.props;let c=new Date(b,a,1).getDay();// JS Sunday is 0, we're setting it last
2
- 0===c&&(c=7);const d=new Date(b,a+1,0).getDate();let e=[];const f=[];let g;// Pad first week
3
- for(g=1;g<c;g+=1)e.push(!1);// Fill in days
4
- for(g=1;g<=d;g+=1)e.push(g),0==(c+g-1)%7&&(f.push(e),e=[]);if(0<e.length){// Pad last week
5
- for(g=e.length;7>g;g+=1)e.push(!1);f.push(e)}return f};days=getDayNames(this.props.intl.locale,"short");daysShort=getDayNames(this.props.intl.locale,"narrow");selectDay=a=>{const{viewMonth:b,viewYear:c,onSelect:d}=this.props;d(new Date(c,b,a))};isDisabled=a=>{const{min:b,max:c,viewMonth:d,viewYear:e}=this.props,f=new Date(e,d,a);return!isWithinRange(f,b,c)};isActive=a=>{const{selectedDate:b,viewMonth:c,viewYear:d}=this.props;return!!(b&&+new Date(d,c,a)==+b)};render(){const{viewMonth:a,viewYear:b,intl:{locale:c}}=this.props,d=this.getTableStructure();return/*#__PURE__*/_jsxs("table",{className:"table table-condensed table-bordered tw-date-lookup-calendar m-b-0",children:[/*#__PURE__*/_jsx("thead",{children:/*#__PURE__*/_jsx("tr",{children:this.days.map((a,b)=>/*#__PURE__*/_jsxs("th",{className:"text-xs-center np-text-body-default-bold",children:[/*#__PURE__*/_jsx("span",{className:"hidden-xs",children:a.slice(0,3)}),/*#__PURE__*/_jsx("span",{className:"visible-xs-inline-block",children:this.daysShort[b].slice(0,2)})]},a))})}),/*#__PURE__*/_jsx("tbody",{children:d.map((d,e)=>/*#__PURE__*/_jsx("tr",{children:d.map((d,e)=>/*#__PURE__*/_jsx("td",{className:4<e?"default":"",children:d&&/*#__PURE__*/_jsx(TableLink,{item:d,type:"day",title:formatDate(new Date(b,a,d),c,SHORT_DAY_FORMAT),longTitle:formatDate(new Date(b,a,d),c),active:this.isActive(d),disabled:this.isDisabled(d),today:+getStartOfDay(new Date)==+new Date(b,a,d),onClick:this.selectDay})},e))},e))})]})}}DayCalendarTable.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewMonth:PropTypes.number.isRequired,viewYear:PropTypes.number.isRequired,onSelect:PropTypes.func.isRequired},DayCalendarTable.defaultProps={selectedDate:null,min:null,max:null};export default injectIntl(DayCalendarTable);
1
+ import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";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{formatDate}from"@transferwise/formatting";import PropTypes from"prop-types";import{PureComponent}from"react";import{injectIntl}from"react-intl";import{getDayNames,isWithinRange}from"../../../common/dateUtils";import{getStartOfDay}from"../../getStartOfDay";import TableLink from"../../tableLink";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var SHORT_DAY_FORMAT={day:"numeric"},DayCalendarTable=/*#__PURE__*/function(a){function b(){var a;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return a=c.call.apply(c,[this].concat(e)),_defineProperty(_assertThisInitialized(a),"getTableStructure",function(){var b=a.props,c=b.viewMonth,d=b.viewYear,e=new Date(d,c,1).getDay();0===e&&(e=7);var f,g=new Date(d,c+1,0).getDate(),h=[],j=[];// Pad first week
2
+ for(f=1;f<e;f+=1)h.push(!1);// Fill in days
3
+ for(f=1;f<=g;f+=1)h.push(f),0==(e+f-1)%7&&(j.push(h),h=[]);if(0<h.length){// Pad last week
4
+ for(f=h.length;7>f;f+=1)h.push(!1);j.push(h)}return j}),_defineProperty(_assertThisInitialized(a),"days",getDayNames(a.props.intl.locale,"short")),_defineProperty(_assertThisInitialized(a),"daysShort",getDayNames(a.props.intl.locale,"narrow")),_defineProperty(_assertThisInitialized(a),"selectDay",function(b){var c=a.props,d=c.viewMonth,e=c.viewYear,f=c.onSelect;f(new Date(e,d,b))}),_defineProperty(_assertThisInitialized(a),"isDisabled",function(b){var c=a.props,d=c.min,e=c.max,f=c.viewMonth,g=c.viewYear,h=new Date(g,f,b);return!isWithinRange(h,d,e)}),_defineProperty(_assertThisInitialized(a),"isActive",function(b){var c=a.props,d=c.selectedDate,e=c.viewMonth,f=c.viewYear;return!!(d&&+new Date(f,e,b)==+d)}),a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this,b=this.props,c=b.viewMonth,d=b.viewYear,e=b.intl.locale,f=this.getTableStructure();return/*#__PURE__*/_jsxs("table",{className:"table table-condensed table-bordered tw-date-lookup-calendar m-b-0",children:[/*#__PURE__*/_jsx("thead",{children:/*#__PURE__*/_jsx("tr",{children:this.days.map(function(b,c){return/*#__PURE__*/_jsxs("th",{className:"text-xs-center np-text-body-default-bold",children:[/*#__PURE__*/_jsx("span",{className:"hidden-xs",children:b.slice(0,3)}),/*#__PURE__*/_jsx("span",{className:"visible-xs-inline-block",children:a.daysShort[c].slice(0,2)})]},b)})})}),/*#__PURE__*/_jsx("tbody",{children:f.map(function(b,f){return/*#__PURE__*/_jsx("tr",{children:b.map(function(b,f){return/*#__PURE__*/_jsx("td",{className:4<f?"default":"",children:b&&/*#__PURE__*/_jsx(TableLink,{item:b,type:"day",title:formatDate(new Date(d,c,b),e,SHORT_DAY_FORMAT),longTitle:formatDate(new Date(d,c,b),e),active:a.isActive(b),disabled:a.isDisabled(b),today:+getStartOfDay(new Date)==+new Date(d,c,b),onClick:a.selectDay})},f)})},f)})})]})}}]),b}(PureComponent);DayCalendarTable.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewMonth:PropTypes.number.isRequired,viewYear:PropTypes.number.isRequired,onSelect:PropTypes.func.isRequired},DayCalendarTable.defaultProps={selectedDate:null,min:null,max:null};export default injectIntl(DayCalendarTable);
@@ -1 +1 @@
1
- import{formatDate}from"@transferwise/formatting";import PropTypes from"prop-types";import{PureComponent}from"react";import{injectIntl}from"react-intl";import DateHeader from"../dateHeader";import MonthCalendarTable from"./table";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";class MonthCalendar extends PureComponent{onMonthSelect=a=>{this.props.onViewDateUpdate({month:a}),this.props.onSelect()};selectPreviousYear=()=>{this.props.onViewDateUpdate({year:this.props.viewYear-1})};selectNextYear=()=>{this.props.onViewDateUpdate({year:this.props.viewYear+1})};render(){const{selectedDate:a,min:b,max:c,viewYear:d,intl:{locale:g},placeholder:e,onLabelClick:f}=this.props;return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(DateHeader,{label:formatDate(new Date(d,0),g,{year:"numeric"}),onLabelClick:f,onPreviousClick:this.selectPreviousYear,onNextClick:this.selectNextYear}),/*#__PURE__*/_jsx(MonthCalendarTable,{selectedDate:a,min:b,max:c,viewYear:d,placeholder:e,onSelect:this.onMonthSelect})]})}}MonthCalendar.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewYear:PropTypes.number.isRequired,placeholder:PropTypes.string.isRequired,onSelect:PropTypes.func.isRequired,onLabelClick:PropTypes.func.isRequired,onViewDateUpdate:PropTypes.func.isRequired},MonthCalendar.defaultProps={selectedDate:null,min:null,max:null};export default injectIntl(MonthCalendar);
1
+ import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";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{formatDate}from"@transferwise/formatting";import PropTypes from"prop-types";import{PureComponent}from"react";import{injectIntl}from"react-intl";import DateHeader from"../dateHeader";import MonthCalendarTable from"./table";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var MonthCalendar=/*#__PURE__*/function(a){function b(){var a;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return a=c.call.apply(c,[this].concat(e)),_defineProperty(_assertThisInitialized(a),"onMonthSelect",function(b){a.props.onViewDateUpdate({month:b}),a.props.onSelect()}),_defineProperty(_assertThisInitialized(a),"selectPreviousYear",function(){a.props.onViewDateUpdate({year:a.props.viewYear-1})}),_defineProperty(_assertThisInitialized(a),"selectNextYear",function(){a.props.onViewDateUpdate({year:a.props.viewYear+1})}),a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this.props,b=a.selectedDate,c=a.min,d=a.max,e=a.viewYear,f=a.intl.locale,g=a.placeholder,h=a.onLabelClick;return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(DateHeader,{label:formatDate(new Date(e,0),f,{year:"numeric"}),onLabelClick:h,onPreviousClick:this.selectPreviousYear,onNextClick:this.selectNextYear}),/*#__PURE__*/_jsx(MonthCalendarTable,{selectedDate:b,min:c,max:d,viewYear:e,placeholder:g,onSelect:this.onMonthSelect})]})}}]),b}(PureComponent);MonthCalendar.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewYear:PropTypes.number.isRequired,placeholder:PropTypes.string.isRequired,onSelect:PropTypes.func.isRequired,onLabelClick:PropTypes.func.isRequired,onViewDateUpdate:PropTypes.func.isRequired},MonthCalendar.defaultProps={selectedDate:null,min:null,max:null};export default injectIntl(MonthCalendar);
@@ -1 +1 @@
1
- import{formatDate}from"@transferwise/formatting";import PropTypes from"prop-types";import{useIntl}from"react-intl";import TableLink from"../../tableLink";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const ROWS=3,COLS=4,MONTH_ONLY_FORMAY={month:"short"},MonthCalendarTable=a=>{let{selectedDate:b,min:c,max:d,viewYear:e,placeholder:f,onSelect:g}=a;const{locale:h}=useIntl(),i=a=>/*#__PURE__*/_jsx(TableLink,{item:a,type:"month",title:formatDate(new Date(e,a),h,MONTH_ONLY_FORMAY),active:!!(b&&a===b.getMonth()&&e===b.getFullYear()),disabled:j(a),today:e===new Date().getFullYear()&&a===new Date().getMonth(),onClick:g}),j=a=>{const b=new Date(e,a);return!!(c&&b<new Date(c.getFullYear(),c.getMonth())||d&&b>new Date(d.getFullYear(),d.getMonth()))};return/*#__PURE__*/_jsxs("table",{className:"table table-condensed table-bordered tw-date-lookup-calendar np-text-body-default-bold m-b-0",children:[/*#__PURE__*/_jsx("thead",{className:"sr-only",children:/*#__PURE__*/_jsx("tr",{children:/*#__PURE__*/_jsx("th",{colSpan:"3",children:f})})}),/*#__PURE__*/_jsx("tbody",{children:[...[,,,]].map((a,b)=>/*#__PURE__*/_jsx("tr",{children:[...Array(COLS)].map((a,c)=>/*#__PURE__*/_jsx("td",{children:i(b*COLS+c)},c))},b))})]})};MonthCalendarTable.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewYear:PropTypes.number.isRequired,placeholder:PropTypes.string.isRequired,onSelect:PropTypes.func.isRequired},MonthCalendarTable.defaultProps={selectedDate:null,min:null,max:null};export default MonthCalendarTable;
1
+ import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import{formatDate}from"@transferwise/formatting";import PropTypes from"prop-types";import{useIntl}from"react-intl";import TableLink from"../../tableLink";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var ROWS=3,COLS=4,MONTH_ONLY_FORMAY={month:"short"},MonthCalendarTable=function(a){var b=a.selectedDate,c=a.min,d=a.max,e=a.viewYear,f=a.placeholder,g=a.onSelect,h=useIntl(),i=h.locale,j=function(a){return/*#__PURE__*/_jsx(TableLink,{item:a,type:"month",title:formatDate(new Date(e,a),i,MONTH_ONLY_FORMAY),active:!!(b&&a===b.getMonth()&&e===b.getFullYear()),disabled:k(a),today:e===new Date().getFullYear()&&a===new Date().getMonth(),onClick:g})},k=function(a){var b=new Date(e,a);return!!(c&&b<new Date(c.getFullYear(),c.getMonth())||d&&b>new Date(d.getFullYear(),d.getMonth()))};return/*#__PURE__*/_jsxs("table",{className:"table table-condensed table-bordered tw-date-lookup-calendar np-text-body-default-bold m-b-0",children:[/*#__PURE__*/_jsx("thead",{className:"sr-only",children:/*#__PURE__*/_jsx("tr",{children:/*#__PURE__*/_jsx("th",{colSpan:"3",children:f})})}),/*#__PURE__*/_jsx("tbody",{children:_toConsumableArray([,,,]).map(function(a,b){return/*#__PURE__*/_jsx("tr",{children:_toConsumableArray(Array(COLS)).map(function(a,c){return/*#__PURE__*/_jsx("td",{children:j(b*COLS+c)},c)})},b)})})]})};MonthCalendarTable.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewYear:PropTypes.number.isRequired,placeholder:PropTypes.string.isRequired,onSelect:PropTypes.func.isRequired},MonthCalendarTable.defaultProps={selectedDate:null,min:null,max:null};export default MonthCalendarTable;
@@ -1,2 +1,2 @@
1
- import PropTypes from"prop-types";import{PureComponent}from"react";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";class TableLink extends PureComponent{onClick=a=>{a.preventDefault(),this.props.disabled||this.props.onClick(this.props.item)};render(){const{item:a,type:b,title:c,longTitle:d,active:e,disabled:f,today:g}=this.props;return/*#__PURE__*/_jsx(_Fragment,{children:/*#__PURE__*/_jsx("button",{type:"button",className:`tw-date-lookup-${b}-option ${e?"active":""} ${g?"today":""} np-text-body-default-bold`,disabled:f,"aria-label":d,onClick:this.onClick,children:c||a})})}}TableLink.propTypes={item:PropTypes.number.isRequired,// day (1-31), month (0-11) or year (2018 etc)
1
+ import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";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{PureComponent}from"react";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";var TableLink=/*#__PURE__*/function(a){function b(){var a;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return a=c.call.apply(c,[this].concat(e)),_defineProperty(_assertThisInitialized(a),"onClick",function(b){b.preventDefault(),a.props.disabled||a.props.onClick(a.props.item)}),a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this.props,b=a.item,c=a.type,d=a.title,e=a.longTitle,f=a.active,g=a.disabled,h=a.today;return/*#__PURE__*/_jsx(_Fragment,{children:/*#__PURE__*/_jsx("button",{type:"button",className:"tw-date-lookup-".concat(c,"-option ").concat(f?"active":""," ").concat(h?"today":""," np-text-body-default-bold"),disabled:g,"aria-label":e,onClick:this.onClick,children:d||b})})}}]),b}(PureComponent);TableLink.propTypes={item:PropTypes.number.isRequired,// day (1-31), month (0-11) or year (2018 etc)
2
2
  type:PropTypes.oneOf(["day","month","year"]).isRequired,title:PropTypes.string,longTitle:PropTypes.string,active:PropTypes.bool.isRequired,disabled:PropTypes.bool.isRequired,today:PropTypes.bool.isRequired,onClick:PropTypes.func.isRequired},TableLink.defaultProps={title:null,longTitle:null};export default TableLink;
@@ -1 +1 @@
1
- import PropTypes from"prop-types";import{PureComponent}from"react";import DateHeader from"../dateHeader";import YearCalendarTable from"./table";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";class YearCalendar extends PureComponent{onYearSelect=a=>{this.props.onViewDateUpdate({year:a}),this.props.onSelect()};selectPreviousYears=()=>{this.props.onViewDateUpdate({year:this.props.viewYear-20})};selectNextYears=()=>{this.props.onViewDateUpdate({year:this.props.viewYear+20})};render(){const{selectedDate:a,min:b,max:c,viewYear:d,placeholder:e}=this.props;return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(DateHeader,{onPreviousClick:this.selectPreviousYears,onNextClick:this.selectNextYears}),/*#__PURE__*/_jsx(YearCalendarTable,{selectedDate:a,min:b,max:c,viewYear:d,placeholder:e,onSelect:this.onYearSelect})]})}}YearCalendar.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewYear:PropTypes.number.isRequired,placeholder:PropTypes.string.isRequired,onSelect:PropTypes.func.isRequired,onViewDateUpdate:PropTypes.func.isRequired},YearCalendar.defaultProps={selectedDate:null,min:null,max:null};export default YearCalendar;
1
+ import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";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{PureComponent}from"react";import DateHeader from"../dateHeader";import YearCalendarTable from"./table";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var YearCalendar=/*#__PURE__*/function(a){function b(){var a;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return a=c.call.apply(c,[this].concat(e)),_defineProperty(_assertThisInitialized(a),"onYearSelect",function(b){a.props.onViewDateUpdate({year:b}),a.props.onSelect()}),_defineProperty(_assertThisInitialized(a),"selectPreviousYears",function(){a.props.onViewDateUpdate({year:a.props.viewYear-20})}),_defineProperty(_assertThisInitialized(a),"selectNextYears",function(){a.props.onViewDateUpdate({year:a.props.viewYear+20})}),a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this.props,b=a.selectedDate,c=a.min,d=a.max,e=a.viewYear,f=a.placeholder;return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(DateHeader,{onPreviousClick:this.selectPreviousYears,onNextClick:this.selectNextYears}),/*#__PURE__*/_jsx(YearCalendarTable,{selectedDate:b,min:c,max:d,viewYear:e,placeholder:f,onSelect:this.onYearSelect})]})}}]),b}(PureComponent);YearCalendar.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewYear:PropTypes.number.isRequired,placeholder:PropTypes.string.isRequired,onSelect:PropTypes.func.isRequired,onViewDateUpdate:PropTypes.func.isRequired},YearCalendar.defaultProps={selectedDate:null,min:null,max:null};export default YearCalendar;
@@ -1 +1 @@
1
- import{formatDate}from"@transferwise/formatting";import PropTypes from"prop-types";import{useIntl}from"react-intl";import TableLink from"../../tableLink";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const ROWS=5,COLS=4,YEAR_ONLY_FORMAT={year:"numeric"},YearCalendarTable=a=>{let{selectedDate:b,min:c,max:d,viewYear:e,placeholder:f,onSelect:g}=a;const{locale:h}=useIntl(),i=a=>/*#__PURE__*/_jsx(TableLink,{item:a,type:"year",title:formatDate(new Date(a,0),h,YEAR_ONLY_FORMAT),active:!!(b&&a===b.getFullYear()),disabled:!!(c&&a<c.getFullYear()||d&&a>d.getFullYear()),today:a===new Date().getFullYear(),onClick:g});return/*#__PURE__*/_jsxs("table",{className:"table table-condensed table-bordered tw-date-lookup-calendar m-b-0",children:[/*#__PURE__*/_jsx("thead",{className:"sr-only",children:/*#__PURE__*/_jsx("tr",{children:/*#__PURE__*/_jsx("th",{colSpan:"4",children:f})})}),/*#__PURE__*/_jsx("tbody",{children:[...[,,,,,]].map((a,b)=>/*#__PURE__*/_jsx("tr",{children:[...Array(COLS)].map((a,c)=>/*#__PURE__*/_jsx("td",{children:i(e-e%20+b*COLS+c)},c))},b))})]})};YearCalendarTable.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewYear:PropTypes.number.isRequired,placeholder:PropTypes.string.isRequired,onSelect:PropTypes.func.isRequired},YearCalendarTable.defaultProps={selectedDate:null,min:null,max:null};export default YearCalendarTable;
1
+ import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import{formatDate}from"@transferwise/formatting";import PropTypes from"prop-types";import{useIntl}from"react-intl";import TableLink from"../../tableLink";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var ROWS=5,COLS=4,YEAR_ONLY_FORMAT={year:"numeric"},YearCalendarTable=function(a){var b=a.selectedDate,c=a.min,d=a.max,e=a.viewYear,f=a.placeholder,g=a.onSelect,h=useIntl(),i=h.locale,j=function(a){return/*#__PURE__*/_jsx(TableLink,{item:a,type:"year",title:formatDate(new Date(a,0),i,YEAR_ONLY_FORMAT),active:!!(b&&a===b.getFullYear()),disabled:!!(c&&a<c.getFullYear()||d&&a>d.getFullYear()),today:a===new Date().getFullYear(),onClick:g})};return/*#__PURE__*/_jsxs("table",{className:"table table-condensed table-bordered tw-date-lookup-calendar m-b-0",children:[/*#__PURE__*/_jsx("thead",{className:"sr-only",children:/*#__PURE__*/_jsx("tr",{children:/*#__PURE__*/_jsx("th",{colSpan:"4",children:f})})}),/*#__PURE__*/_jsx("tbody",{children:_toConsumableArray([,,,,,]).map(function(a,b){return/*#__PURE__*/_jsx("tr",{children:_toConsumableArray(Array(COLS)).map(function(a,c){return/*#__PURE__*/_jsx("td",{children:j(e-e%20+b*COLS+c)},c)})},b)})})]})};YearCalendarTable.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewYear:PropTypes.number.isRequired,placeholder:PropTypes.string.isRequired,onSelect:PropTypes.func.isRequired},YearCalendarTable.defaultProps={selectedDate:null,min:null,max:null};export default YearCalendarTable;
@@ -1,5 +1,5 @@
1
- import classNames from"classnames";import PropTypes from"prop-types";import requiredIf from"react-required-if";import{Size,Breakpoint}from"../common";import NavigationOption from"../navigationOption";import SizeSwapper from"../sizeSwapper";import Tile from"../tile";import{Presentation,Type}from"./decisionEnums";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";const Decision=a=>{let{options:b,presentation:c,type:d,showMediaCircleInList:e,isContainerAligned:f,size:g}=a;if(d===Type.NAVIGATION){const{LIST_BLOCK:a,LIST_BLOCK_GRID:d}=Presentation;if(c===a||c===d){const a=g===Size.SMALL,h=c===d,i=[{items:[],layout:SizeSwapper.Layout.COLUMN},{items:[],breakpoint:a?Breakpoint.EXTRA_SMALL:Breakpoint.SMALL,wrap:h}];return b.forEach((b,c)=>{let{description:d,disabled:g,href:j,target:k,media:{block:n,list:o},onClick:l,title:m}=b;i[0].items.push(/*#__PURE__*/_jsx(NavigationOption// eslint-disable-next-line react/no-array-index-key
2
- ,{complex:!1,content:d,disabled:g,href:j,target:k,media:o,showMediaAtAllSizes:!0,showMediaCircle:e,isContainerAligned:f,title:m,onClick:l},`nav-${c}`)),i[1].items.push(/*#__PURE__*/_jsx(Tile// eslint-disable-next-line react/no-array-index-key
3
- ,{className:classNames(`np-decision__tile${a?"--small":""}`,{"np-decision__tile--fixed-width":h}),description:d,disabled:g,href:j,target:k,media:n,size:a?Size.SMALL:Size.MEDIUM,title:m,onClick:l},`tile-${c}`))}),/*#__PURE__*/_jsx("div",{className:classNames("np-decision",{"np-decision--small":a,"np-decision--grid":h}),children:/*#__PURE__*/_jsx(SizeSwapper,{items:i})})}// LIST
4
- return b.map((a,b)=>{let{title:c,description:d,disabled:g,href:h,target:i,media:{list:k},onClick:j}=a;return/*#__PURE__*/_jsx(NavigationOption// eslint-disable-next-line react/no-array-index-key
5
- ,{complex:!1,content:d,disabled:g,href:h,target:i,media:k,showMediaAtAllSizes:!0,showMediaCircle:e,isContainerAligned:f,title:c,onClick:j},`nav-${b}`)})}return/*#__PURE__*/_jsx(_Fragment,{})};Decision.propTypes={/** A list of elements to be rendered */options:PropTypes.arrayOf(PropTypes.shape({description:PropTypes.node,disabled:PropTypes.bool,href:requiredIf(PropTypes.string,a=>a.type===Type.NAVIGATION),target:PropTypes.oneOf(["_self","_blank","_parent","_top"]),media:PropTypes.shape({block:PropTypes.node.isRequired,list:PropTypes.node.isRequired}),onClick:PropTypes.func,title:PropTypes.node.isRequired})).isRequired,/** Handles the display mode of the component */presentation:PropTypes.oneOf(["LIST","LIST_BLOCK","LIST_BLOCK_GRID"]),/** Size currently affects only Tile dimension */size:PropTypes.oneOf(["sm","md"]),/** Decide which kind of element type needs to be rendered ex: Navigation Options or in the future Radio or Checkbox Options */type:PropTypes.oneOf(["NAVIGATION"]),/** Display media in a circle in list presentation */showMediaCircleInList:PropTypes.bool,/** Sets navigation options to be aligned with the parent container */isContainerAligned:PropTypes.bool},Decision.defaultProps={presentation:Presentation.LIST,size:Size.MEDIUM,type:Type.NAVIGATION,showMediaCircleInList:!0,isContainerAligned:!1};export default Decision;
1
+ import classNames from"classnames";import PropTypes from"prop-types";import requiredIf from"react-required-if";import{Size,Breakpoint}from"../common";import NavigationOption from"../navigationOption";import SizeSwapper from"../sizeSwapper";import Tile from"../tile";import{Presentation,Type}from"./decisionEnums";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";var Decision=function(a){var b=a.options,c=a.presentation,d=a.type,e=a.showMediaCircleInList,f=a.isContainerAligned,g=a.size;if(d===Type.NAVIGATION){var h=Presentation.LIST_BLOCK,i=Presentation.LIST_BLOCK_GRID;if(c===h||c===i){var j=g===Size.SMALL,k=c===i,l=[{items:[],layout:SizeSwapper.Layout.COLUMN},{items:[],breakpoint:j?Breakpoint.EXTRA_SMALL:Breakpoint.SMALL,wrap:k}];return b.forEach(function(a,b){var c=a.description,d=a.disabled,g=a.href,h=a.target,i=a.media,m=i.block,n=i.list,o=a.onClick,p=a.title;l[0].items.push(/*#__PURE__*/_jsx(NavigationOption// eslint-disable-next-line react/no-array-index-key
2
+ ,{complex:!1,content:c,disabled:d,href:g,target:h,media:n,showMediaAtAllSizes:!0,showMediaCircle:e,isContainerAligned:f,title:p,onClick:o},"nav-".concat(b))),l[1].items.push(/*#__PURE__*/_jsx(Tile// eslint-disable-next-line react/no-array-index-key
3
+ ,{className:classNames("np-decision__tile".concat(j?"--small":""),{"np-decision__tile--fixed-width":k}),description:c,disabled:d,href:g,target:h,media:m,size:j?Size.SMALL:Size.MEDIUM,title:p,onClick:o},"tile-".concat(b)))}),/*#__PURE__*/_jsx("div",{className:classNames("np-decision",{"np-decision--small":j,"np-decision--grid":k}),children:/*#__PURE__*/_jsx(SizeSwapper,{items:l})})}// LIST
4
+ return b.map(function(a,b){var c=a.title,d=a.description,g=a.disabled,h=a.href,i=a.target,j=a.media.list,k=a.onClick;return/*#__PURE__*/_jsx(NavigationOption// eslint-disable-next-line react/no-array-index-key
5
+ ,{complex:!1,content:d,disabled:g,href:h,target:i,media:j,showMediaAtAllSizes:!0,showMediaCircle:e,isContainerAligned:f,title:c,onClick:k},"nav-".concat(b))})}return/*#__PURE__*/_jsx(_Fragment,{})};Decision.propTypes={/** A list of elements to be rendered */options:PropTypes.arrayOf(PropTypes.shape({description:PropTypes.node,disabled:PropTypes.bool,href:requiredIf(PropTypes.string,function(a){return a.type===Type.NAVIGATION}),target:PropTypes.oneOf(["_self","_blank","_parent","_top"]),media:PropTypes.shape({block:PropTypes.node.isRequired,list:PropTypes.node.isRequired}),onClick:PropTypes.func,title:PropTypes.node.isRequired})).isRequired,/** Handles the display mode of the component */presentation:PropTypes.oneOf(["LIST","LIST_BLOCK","LIST_BLOCK_GRID"]),/** Size currently affects only Tile dimension */size:PropTypes.oneOf(["sm","md"]),/** Decide which kind of element type needs to be rendered ex: Navigation Options or in the future Radio or Checkbox Options */type:PropTypes.oneOf(["NAVIGATION"]),/** Display media in a circle in list presentation */showMediaCircleInList:PropTypes.bool,/** Sets navigation options to be aligned with the parent container */isContainerAligned:PropTypes.bool},Decision.defaultProps={presentation:Presentation.LIST,size:Size.MEDIUM,type:Type.NAVIGATION,showMediaCircleInList:!0,isContainerAligned:!1};export default Decision;
@@ -1,3 +1,3 @@
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 Presentation=/*#__PURE__*/function(a){return a.LIST="LIST",a.LIST_BLOCK="LIST_BLOCK",a.LIST_BLOCK_GRID="LIST_BLOCK_GRID",a}({});// TODO: consider to move this enum into component file once we migrate it on TypeScript or replace with some common enum
3
- export let Type=/*#__PURE__*/function(a){return a.NAVIGATION="NAVIGATION",a}({});
2
+ export var Presentation=/*#__PURE__*/function(a){return a.LIST="LIST",a.LIST_BLOCK="LIST_BLOCK",a.LIST_BLOCK_GRID="LIST_BLOCK_GRID",a}({});// TODO: consider to move this enum into component file once we migrate it on TypeScript or replace with some common enum
3
+ export var Type=/*#__PURE__*/function(a){return a.NAVIGATION="NAVIGATION",a}({});
@@ -1 +1 @@
1
- import classNames from"classnames";import PropTypes from"prop-types";import ActionButton from"../actionButton";import{Layout}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const isLayoutHorizontal=a=>[Layout.HORIZONTAL_LEFT_ALIGNED,Layout.HORIZONTAL_RIGHT_ALIGNED,Layout.HORIZONTAL_JUSTIFIED].includes(a),getAlignmentClasses=(a,b)=>{let c=["d-flex"];return b&&(isLayoutHorizontal(a)?c.push("align-items-center"):c.push("align-items-start")),a===Layout.HORIZONTAL_RIGHT_ALIGNED?c.push("text-sm-right tw-definition-list--right-aligned-desktop"):c.push("justify-content-between"),a===Layout.HORIZONTAL_JUSTIFIED&&c.push("text-sm-justify"),c},DefinitionList=a=>{let{definitions:b,layout:c,muted:d}=a;return/*#__PURE__*/_jsx("dl",{className:classNames("tw-definition-list d-flex ",{"text-muted":d,"flex-column":c===Layout.VERTICAL_ONE_COLUMN,"tw-definition-list--columns flex-column flex-row--sm":c===Layout.VERTICAL_TWO_COLUMN,"tw-definition-list--horizontal flex-column":isLayoutHorizontal(c)}),children:b.filter(a=>a).map(a=>{let{action:b,title:d,value:e,key:f}=a;return/*#__PURE__*/_jsxs("div",{className:"tw-definition-list__item",children:[/*#__PURE__*/_jsx("dt",{children:d}),/*#__PURE__*/_jsxs("dd",{className:classNames(...getAlignmentClasses(c,b)),children:[/*#__PURE__*/_jsx("div",{children:e}),b?/*#__PURE__*/_jsx("div",{className:classNames(isLayoutHorizontal(c)?"p-l-2":"p-x-2","tw-definition-list__action"),children:/*#__PURE__*/_jsx(ActionButton,{className:"tw-definition-list__button",onClick:b.onClick,children:b.label})}):null]})]},f)})})};DefinitionList.propTypes={definitions:PropTypes.arrayOf(PropTypes.shape({action:PropTypes.shape({label:PropTypes.string.isRequired,onClick:PropTypes.func.isRequired}),title:PropTypes.node.isRequired,value:PropTypes.node.isRequired,key:PropTypes.string.isRequired})),layout:PropTypes.oneOf(["VERTICAL_TWO_COLUMN","VERTICAL_ONE_COLUMN","HORIZONTAL_JUSTIFIED","HORIZONTAL_LEFT_ALIGNED","HORIZONTAL_RIGHT_ALIGNED"]),muted:PropTypes.bool},DefinitionList.defaultProps={definitions:[],layout:Layout.VERTICAL_TWO_COLUMN,muted:!1};export default DefinitionList;
1
+ import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import classNames from"classnames";import PropTypes from"prop-types";import ActionButton from"../actionButton";import{Layout}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var isLayoutHorizontal=function(a){return[Layout.HORIZONTAL_LEFT_ALIGNED,Layout.HORIZONTAL_RIGHT_ALIGNED,Layout.HORIZONTAL_JUSTIFIED].includes(a)},getAlignmentClasses=function(a,b){var c=["d-flex"];return b&&(isLayoutHorizontal(a)?c.push("align-items-center"):c.push("align-items-start")),a===Layout.HORIZONTAL_RIGHT_ALIGNED?c.push("text-sm-right tw-definition-list--right-aligned-desktop"):c.push("justify-content-between"),a===Layout.HORIZONTAL_JUSTIFIED&&c.push("text-sm-justify"),c},DefinitionList=function(a){var b=a.definitions,c=a.layout,d=a.muted;return/*#__PURE__*/_jsx("dl",{className:classNames("tw-definition-list d-flex ",{"text-muted":d,"flex-column":c===Layout.VERTICAL_ONE_COLUMN,"tw-definition-list--columns flex-column flex-row--sm":c===Layout.VERTICAL_TWO_COLUMN,"tw-definition-list--horizontal flex-column":isLayoutHorizontal(c)}),children:b.filter(function(a){return a}).map(function(a){var b=a.action,d=a.title,e=a.value,f=a.key;return/*#__PURE__*/_jsxs("div",{className:"tw-definition-list__item",children:[/*#__PURE__*/_jsx("dt",{children:d}),/*#__PURE__*/_jsxs("dd",{className:classNames.apply(void 0,_toConsumableArray(getAlignmentClasses(c,b))),children:[/*#__PURE__*/_jsx("div",{children:e}),b?/*#__PURE__*/_jsx("div",{className:classNames(isLayoutHorizontal(c)?"p-l-2":"p-x-2","tw-definition-list__action"),children:/*#__PURE__*/_jsx(ActionButton,{className:"tw-definition-list__button",onClick:b.onClick,children:b.label})}):null]})]},f)})})};DefinitionList.propTypes={definitions:PropTypes.arrayOf(PropTypes.shape({action:PropTypes.shape({label:PropTypes.string.isRequired,onClick:PropTypes.func.isRequired}),title:PropTypes.node.isRequired,value:PropTypes.node.isRequired,key:PropTypes.string.isRequired})),layout:PropTypes.oneOf(["VERTICAL_TWO_COLUMN","VERTICAL_ONE_COLUMN","HORIZONTAL_JUSTIFIED","HORIZONTAL_LEFT_ALIGNED","HORIZONTAL_RIGHT_ALIGNED"]),muted:PropTypes.bool},DefinitionList.defaultProps={definitions:[],layout:Layout.VERTICAL_TWO_COLUMN,muted:!1};export default DefinitionList;
@@ -1,6 +1,6 @@
1
- import{ThemeProvider,useTheme}from"@wise/components-theming";import classNames from"classnames";import{useCallback,useEffect,useRef,useState}from"react";import CSSTransition from"react-transition-group/CSSTransition";import{addNoScrollBodyClass,removeNoScrollBodyClass}from"../common";import{isIosDevice}from"../common/deviceDetection";import FocusBoundary from"../common/focusBoundary";import withNextPortal from"../withNextPortal/withNextPortal";import DimmerManager from"./dimmerManager";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";export const EXIT_ANIMATION=350;const dimmerManager=new DimmerManager;export const handleTouchMove=a=>{const b=a.target.classList.contains("dimmer");// disable scroll on iOS devices for Dimmer area
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import{ThemeProvider,useTheme}from"@wise/components-theming";import classNames from"classnames";import{useCallback,useEffect,useRef,useState}from"react";import CSSTransition from"react-transition-group/CSSTransition";import{addNoScrollBodyClass,removeNoScrollBodyClass}from"../common";import{isIosDevice}from"../common/deviceDetection";import FocusBoundary from"../common/focusBoundary";import withNextPortal from"../withNextPortal/withNextPortal";import DimmerManager from"./dimmerManager";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";export var EXIT_ANIMATION=350;var dimmerManager=new DimmerManager;export var handleTouchMove=function(a){var b=a.target.classList.contains("dimmer");// disable scroll on iOS devices for Dimmer area
2
2
  // this is because of bug in WebKit https://bugs.webkit.org/show_bug.cgi?id=220908
3
3
  // note: scrolling still works for children(s) as expected
4
- isIosDevice()&&b&&(a.stopPropagation(),a.preventDefault())};const Dimmer=a=>{let{children:b,className:c,disableClickToClose:f=!1,contentPosition:d,fadeContentOnEnter:g=!1,fadeContentOnExit:h=!1,open:i=!1,scrollable:j=!1,transparent:k=!1,onClose:e}=a;const[l,m]=useState(!1),n=useRef(null),o=a=>{a.target===n.current&&e?.(a)},p=useCallback(a=>{"Escape"!==a.key||(a.stopPropagation(),e&&n.current&&dimmerManager.isTop(n.current)&&e(a))},[e]);return useEffect(()=>{const a=n.current;return i&&(document.addEventListener("keydown",p),a?.addEventListener("touchmove",handleTouchMove,{passive:!0})),()=>{document.removeEventListener("keydown",p),a?.removeEventListener("touchmove",handleTouchMove)}},[p,i]),/*#__PURE__*/_jsx(DimmerWrapper,{open:i,hasNotExited:l,children:/*#__PURE__*/_jsx(CSSTransition,{nodeRef:n,in:i,appear:!0// Wait for animation to finish before unmount.
5
- ,timeout:{enter:0,exit:EXIT_ANIMATION},classNames:{enter:classNames({"dimmer--enter-fade":g}),enterDone:classNames("dimmer--enter-done",{"dimmer--enter-fade":g}),exit:classNames("dimmer--exit",{"dimmer--exit-fade":h})},unmountOnExit:!0,onEnter:()=>{m(!0),n.current&&dimmerManager.add(n.current)},onExited:()=>{m(!1),n.current&&dimmerManager.remove(n.current)},children:/*#__PURE__*/_jsx(DimmerContentWrapper,{scrollBody:!k,children:/*#__PURE__*/_jsx(FocusBoundary,{children:/*#__PURE__*/_jsx("div",{ref:n,className:classNames("dimmer",{"dimmer--scrollable":j,"dimmer--transparent":k},c),role:"presentation",onClick:a=>{f||!e||o(a)},children:/*#__PURE__*/_jsx("div",{className:classNames("dimmer-content-positioner",null!=d&&["d-flex justify-content-center",{"align-items-start":"top"===d,"align-items-center":"center"===d,"align-items-end":"bottom"===d}]),children:b})})})})})})},DimmerWrapper=a=>{let{open:b,hasNotExited:c,children:d}=a;const{screenMode:e,theme:f}=useTheme();return b||c?/*#__PURE__*/_jsx(ThemeProvider,{theme:f,screenMode:e,isNotRootProvider:!0,children:d}):/*#__PURE__*/_jsx(_Fragment,{children:d})};export const DimmerContentWrapper=a=>{let{children:b,scrollBody:c}=a;return useEffect(()=>(c&&addNoScrollBodyClass(),()=>{c&&removeNoScrollBodyClass()}),[c]),b};// Export without the Portal for tests only
4
+ isIosDevice()&&b&&(a.stopPropagation(),a.preventDefault())};var Dimmer=function(a){var b=a.children,c=a.className,d=a.disableClickToClose,e=a.contentPosition,f=a.fadeContentOnEnter,g=void 0!==f&&f,h=a.fadeContentOnExit,i=a.open,j=void 0!==i&&i,k=a.scrollable,l=a.transparent,m=void 0!==l&&l,n=a.onClose,o=useState(!1),p=_slicedToArray(o,2),q=p[0],r=p[1],s=useRef(null),t=function(a){a.target===s.current&&(null===n||void 0===n?void 0:n(a))},u=useCallback(function(a){"Escape"!==a.key||(a.stopPropagation(),n&&s.current&&dimmerManager.isTop(s.current)&&n(a))},[n]);return useEffect(function(){var a=s.current;return j&&(document.addEventListener("keydown",u),null===a||void 0===a?void 0:a.addEventListener("touchmove",handleTouchMove,{passive:!0})),function(){document.removeEventListener("keydown",u),null===a||void 0===a?void 0:a.removeEventListener("touchmove",handleTouchMove)}},[u,j]),/*#__PURE__*/_jsx(DimmerWrapper,{open:j,hasNotExited:q,children:/*#__PURE__*/_jsx(CSSTransition,{nodeRef:s,in:j,appear:!0// Wait for animation to finish before unmount.
5
+ ,timeout:{enter:0,exit:EXIT_ANIMATION},classNames:{enter:classNames({"dimmer--enter-fade":g}),enterDone:classNames("dimmer--enter-done",{"dimmer--enter-fade":g}),exit:classNames("dimmer--exit",{"dimmer--exit-fade":void 0!==h&&h})},unmountOnExit:!0,onEnter:function onEnter(){r(!0),s.current&&dimmerManager.add(s.current)},onExited:function onExited(){r(!1),s.current&&dimmerManager.remove(s.current)},children:/*#__PURE__*/_jsx(DimmerContentWrapper,{scrollBody:!m,children:/*#__PURE__*/_jsx(FocusBoundary,{children:/*#__PURE__*/_jsx("div",{ref:s,className:classNames("dimmer",{"dimmer--scrollable":void 0!==k&&k,"dimmer--transparent":m},c),role:"presentation",onClick:function handleClick(a){void 0!==d&&d||!n||t(a)},children:/*#__PURE__*/_jsx("div",{className:classNames("dimmer-content-positioner",null!=e&&["d-flex justify-content-center",{"align-items-start":"top"===e,"align-items-center":"center"===e,"align-items-end":"bottom"===e}]),children:b})})})})})})},DimmerWrapper=function(a){var b=a.open,c=a.hasNotExited,d=a.children,e=useTheme(),f=e.screenMode,g=e.theme;return b||c?/*#__PURE__*/_jsx(ThemeProvider,{theme:g,screenMode:f,isNotRootProvider:!0,children:d}):/*#__PURE__*/_jsx(_Fragment,{children:d})};export var DimmerContentWrapper=function(a){var b=a.children,c=a.scrollBody;return useEffect(function(){return c&&addNoScrollBodyClass(),function(){c&&removeNoScrollBodyClass()}},[c]),b};// Export without the Portal for tests only
6
6
  export{Dimmer};export default withNextPortal(Dimmer);
@@ -1,2 +1,2 @@
1
- import{action}from"@storybook/addon-actions";import{useState}from"react";import{Button,Dimmer}from"..";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:Dimmer,title:"Layouts/Dimmer",args:{fadeContentOnEnter:!1,fadeContentOnExit:!1,disableClickToClose:!1}};export const Basic={render:a=>{// eslint-disable-next-line react-hooks/rules-of-hooks
2
- const[b,c]=useState(!1);return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Button,{onClick:()=>c(a=>!a),children:"Toggle dimmer"}),/*#__PURE__*/_jsx(Dimmer,{...a,open:b,onClose:a=>{c(!1),action("closed")(a)}})]})}};
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{action}from"@storybook/addon-actions";import{useState}from"react";import{Button,Dimmer}from"..";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:Dimmer,title:"Layouts/Dimmer",args:{fadeContentOnEnter:!1,fadeContentOnExit:!1,disableClickToClose:!1}};export var Basic={render:function render(a){// eslint-disable-next-line react-hooks/rules-of-hooks
2
+ var b=useState(!1),c=_slicedToArray(b,2),d=c[0],e=c[1];return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Button,{onClick:function onClick(){return e(function(a){return!a})},children:"Toggle dimmer"}),/*#__PURE__*/_jsx(Dimmer,_objectSpread(_objectSpread({},a),{},{open:d,onClose:function onClose(a){e(!1),action("closed")(a)}}))]})}};
@@ -1,5 +1,5 @@
1
- /**
1
+ import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _defineProperty from"@babel/runtime/helpers/defineProperty";/**
2
2
  * Dimmer state management inspired by Material UI's ModalManager (https://github.com/mui-org/material-ui)
3
- */export default class DimmerManager{/**
3
+ */var DimmerManager=/*#__PURE__*/function(){/**
4
4
  * Dimmer refs
5
- */constructor(){this.dimmers=[]}add(a){let b=this.dimmers.indexOf(a);return-1===b?(b=this.dimmers.length,this.dimmers.push(a),b):b}remove(a){const b=this.dimmers.indexOf(a);return-1!==b&&this.dimmers.splice(b,1),b}isTop(a){return 0<this.dimmers.length&&this.dimmers[this.dimmers.length-1]===a}}
5
+ */function a(){_classCallCheck(this,a),_defineProperty(this,"dimmers",void 0),this.dimmers=[]}return _createClass(a,[{key:"add",value:function add(a){var b=this.dimmers.indexOf(a);return-1===b?(b=this.dimmers.length,this.dimmers.push(a),b):b}},{key:"remove",value:function remove(a){var b=this.dimmers.indexOf(a);return-1!==b&&this.dimmers.splice(b,1),b}},{key:"isTop",value:function isTop(a){return 0<this.dimmers.length&&this.dimmers[this.dimmers.length-1]===a}}]),a}();export{DimmerManager as default};
@@ -1 +1 @@
1
- import classNames from"classnames";import{Typography}from"../common";import{jsx as _jsx}from"react/jsx-runtime";function Display(a){let{as:d="h1",type:e=Typography.DISPLAY_LARGE,children:b,className:c}=a;return/*#__PURE__*/_jsx(d,{className:classNames(`np-text-${e}`,"text-primary",c),children:b})}export default Display;
1
+ import classNames from"classnames";import{Typography}from"../common";import{jsx as _jsx}from"react/jsx-runtime";function Display(a){var b=a.as,c=void 0===b?"h1":b,d=a.type,e=void 0===d?Typography.DISPLAY_LARGE:d,f=a.children,g=a.className;return/*#__PURE__*/_jsx(c,{className:classNames("np-text-".concat(e),"text-primary",g),children:f})}export default Display;
@@ -1,2 +1,2 @@
1
- /* eslint-disable jsx-a11y/accessible-emoji */import{Typography}from"../common";import Money from"../money/Money";import Title from"../title/Title";import Display from"./Display";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/Display"};export const Basic=()=>{const a="\xC4\xD6\xDC\u1E9EABCDEFGHIJKLMNOPQRSTUVWXYZ",b="\u0410\u0411\u0412\u0413\u0490\u0414\u0415\u0404\u0416\u0417\u0418\u0406\u0407\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042C\u042E\u042F",c="\u3041\u3042\u3043\u3044\u3045\u3046\u3047\u3048\u3049\u304A\u304B\u304C\u304D\u304E\u304F\u3050\u3051\u3052\u3053\u3054\u3055\u3056\u3057\u3058\u3059\u305A\u305B\u305C\u305D\u305E\u305F\u3060\u3061\u3062\u3063\u3064\u3065\u3066\u3067";// Made for hyphenation testing
2
- return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs("html",{lang:"ja",children:[/*#__PURE__*/_jsx("h1",{children:"Default case, example being \uD83C\uDDEF\uD83C\uDDF5"}),/*#__PURE__*/_jsx("h4",{children:"This is close to the right formatting but to get it perfect, change locale on the right to ja-JP"}),"Extra Large",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_EXTRA_LARGE,children:c}),/*#__PURE__*/_jsx("hr",{}),"Large",/*#__PURE__*/_jsx(Display,{as:"h2",type:Typography.DISPLAY_LARGE,children:c}),/*#__PURE__*/_jsx("hr",{}),"Medium",/*#__PURE__*/_jsx(Display,{as:"h3",type:Typography.DISPLAY_MEDIUM,children:c}),/*#__PURE__*/_jsx("hr",{}),"Small",/*#__PURE__*/_jsx(Display,{as:"h4",type:Typography.DISPLAY_SMALL,children:c})]}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsxs("html",{lang:"en",children:[/*#__PURE__*/_jsx("h1",{children:"First fallback is \uD83C\uDDEC\uD83C\uDDE7"}),"Extra Large",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_EXTRA_LARGE,children:"compounding without subscription"}),/*#__PURE__*/_jsx("hr",{}),"Large",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_LARGE,children:"compounding without subscription"}),/*#__PURE__*/_jsx("hr",{}),"Medium",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_MEDIUM,children:"compounding without subscription"}),/*#__PURE__*/_jsx("hr",{}),"Small",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_SMALL,children:"compounding without subscription"})]}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsxs("html",{lang:"de",children:[/*#__PURE__*/_jsx("h1",{children:"Next fallback is many languages including \uD83C\uDDE9\uD83C\uDDEA (only change is line-height being increased)"}),"Extra Large",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_EXTRA_LARGE,children:[a,/*#__PURE__*/_jsx("br",{}),a]}),/*#__PURE__*/_jsx("hr",{}),"Large",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_LARGE,children:[a,/*#__PURE__*/_jsx("br",{}),a]}),/*#__PURE__*/_jsx("hr",{}),"Medium",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_MEDIUM,children:[a,/*#__PURE__*/_jsx("br",{}),a]}),/*#__PURE__*/_jsx("hr",{}),"Small",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_SMALL,children:[a,/*#__PURE__*/_jsx("br",{}),a]})]}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsxs("html",{lang:"uk",children:[/*#__PURE__*/_jsx("h1",{children:"Final fallback are Greek and Cyrillic lanugages like \uD83C\uDDFA\uD83C\uDDE6"}),"Extra Large",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_EXTRA_LARGE,children:[b,/*#__PURE__*/_jsx("br",{}),b]}),/*#__PURE__*/_jsx("hr",{}),"Large",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_LARGE,children:[b,/*#__PURE__*/_jsx("br",{}),b]}),/*#__PURE__*/_jsx("hr",{}),"Medium",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_MEDIUM,children:[b,/*#__PURE__*/_jsx("br",{}),b]}),/*#__PURE__*/_jsx("hr",{}),"Small",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_SMALL,children:[b,/*#__PURE__*/_jsx("br",{}),b]})]})]})};export const Numbers=()=>/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SCREEN,children:"Display Number"}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx("div",{className:"np-text-display-number",children:/*#__PURE__*/_jsx(Money,{amount:1050.6,currency:"UAH"})}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx("div",{className:"np-text-display-number",children:/*#__PURE__*/_jsx(Money,{amount:10.17,currency:"JPY"})}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx("div",{className:"np-text-display-number",children:/*#__PURE__*/_jsx(Money,{amount:.01,currency:"EUR"})}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx("div",{className:"np-text-display-number",children:/*#__PURE__*/_jsx(Money,{amount:1e6,currency:"EUR"})}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx("div",{className:"np-text-display-number",children:/*#__PURE__*/_jsx(Money,{amount:1e6,currency:"GBP"})})]});
1
+ /* eslint-disable jsx-a11y/accessible-emoji */import{Typography}from"../common";import Money from"../money/Money";import Title from"../title/Title";import Display from"./Display";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/Display"};export var Basic=function(){var a="\xC4\xD6\xDC\u1E9EABCDEFGHIJKLMNOPQRSTUVWXYZ",b="\u0410\u0411\u0412\u0413\u0490\u0414\u0415\u0404\u0416\u0417\u0418\u0406\u0407\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042C\u042E\u042F",c="\u3041\u3042\u3043\u3044\u3045\u3046\u3047\u3048\u3049\u304A\u304B\u304C\u304D\u304E\u304F\u3050\u3051\u3052\u3053\u3054\u3055\u3056\u3057\u3058\u3059\u305A\u305B\u305C\u305D\u305E\u305F\u3060\u3061\u3062\u3063\u3064\u3065\u3066\u3067";// Made for hyphenation testing
2
+ return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs("html",{lang:"ja",children:[/*#__PURE__*/_jsx("h1",{children:"Default case, example being \uD83C\uDDEF\uD83C\uDDF5"}),/*#__PURE__*/_jsx("h4",{children:"This is close to the right formatting but to get it perfect, change locale on the right to ja-JP"}),"Extra Large",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_EXTRA_LARGE,children:c}),/*#__PURE__*/_jsx("hr",{}),"Large",/*#__PURE__*/_jsx(Display,{as:"h2",type:Typography.DISPLAY_LARGE,children:c}),/*#__PURE__*/_jsx("hr",{}),"Medium",/*#__PURE__*/_jsx(Display,{as:"h3",type:Typography.DISPLAY_MEDIUM,children:c}),/*#__PURE__*/_jsx("hr",{}),"Small",/*#__PURE__*/_jsx(Display,{as:"h4",type:Typography.DISPLAY_SMALL,children:c})]}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsxs("html",{lang:"en",children:[/*#__PURE__*/_jsx("h1",{children:"First fallback is \uD83C\uDDEC\uD83C\uDDE7"}),"Extra Large",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_EXTRA_LARGE,children:"compounding without subscription"}),/*#__PURE__*/_jsx("hr",{}),"Large",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_LARGE,children:"compounding without subscription"}),/*#__PURE__*/_jsx("hr",{}),"Medium",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_MEDIUM,children:"compounding without subscription"}),/*#__PURE__*/_jsx("hr",{}),"Small",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_SMALL,children:"compounding without subscription"})]}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsxs("html",{lang:"de",children:[/*#__PURE__*/_jsx("h1",{children:"Next fallback is many languages including \uD83C\uDDE9\uD83C\uDDEA (only change is line-height being increased)"}),"Extra Large",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_EXTRA_LARGE,children:[a,/*#__PURE__*/_jsx("br",{}),a]}),/*#__PURE__*/_jsx("hr",{}),"Large",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_LARGE,children:[a,/*#__PURE__*/_jsx("br",{}),a]}),/*#__PURE__*/_jsx("hr",{}),"Medium",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_MEDIUM,children:[a,/*#__PURE__*/_jsx("br",{}),a]}),/*#__PURE__*/_jsx("hr",{}),"Small",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_SMALL,children:[a,/*#__PURE__*/_jsx("br",{}),a]})]}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsxs("html",{lang:"uk",children:[/*#__PURE__*/_jsx("h1",{children:"Final fallback are Greek and Cyrillic lanugages like \uD83C\uDDFA\uD83C\uDDE6"}),"Extra Large",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_EXTRA_LARGE,children:[b,/*#__PURE__*/_jsx("br",{}),b]}),/*#__PURE__*/_jsx("hr",{}),"Large",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_LARGE,children:[b,/*#__PURE__*/_jsx("br",{}),b]}),/*#__PURE__*/_jsx("hr",{}),"Medium",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_MEDIUM,children:[b,/*#__PURE__*/_jsx("br",{}),b]}),/*#__PURE__*/_jsx("hr",{}),"Small",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_SMALL,children:[b,/*#__PURE__*/_jsx("br",{}),b]})]})]})};export var Numbers=function(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SCREEN,children:"Display Number"}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx("div",{className:"np-text-display-number",children:/*#__PURE__*/_jsx(Money,{amount:1050.6,currency:"UAH"})}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx("div",{className:"np-text-display-number",children:/*#__PURE__*/_jsx(Money,{amount:10.17,currency:"JPY"})}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx("div",{className:"np-text-display-number",children:/*#__PURE__*/_jsx(Money,{amount:.01,currency:"EUR"})}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx("div",{className:"np-text-display-number",children:/*#__PURE__*/_jsx(Money,{amount:1e6,currency:"EUR"})}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx("div",{className:"np-text-display-number",children:/*#__PURE__*/_jsx(Money,{amount:1e6,currency:"GBP"})})]})};
@@ -1 +1 @@
1
- import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import{Position,Typography}from"../common";import{CloseButton}from"../common/closeButton";import{useLayout}from"../common/hooks";import Dimmer from"../dimmer";import SlidingPanel from"../slidingPanel";import Title from"../title";import{logActionRequiredIf}from"../utilities";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const Drawer=a=>{let{children:b,className:c,footerContent:d,headerTitle:e,onClose:f,open:g,position:h}=a;logActionRequiredIf("Drawer now expects `onClose`, and will soon make this prop required. Please update your usage to provide it.",!f);const{isMobile:i}=useLayout(),{theme:j}=useTheme();return/*#__PURE__*/_jsx(Dimmer,{open:g,onClose:f,children:/*#__PURE__*/_jsx(SlidingPanel,{open:g,position:i?Position.BOTTOM:h,children:/*#__PURE__*/_jsxs("div",{className:classNames("np-drawer",`np-theme-${j}`,c),children:[/*#__PURE__*/_jsxs("div",{className:classNames("np-drawer-header",{"np-drawer-header--withborder":e}),children:[e&&/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_BODY,children:e}),/*#__PURE__*/_jsx(CloseButton,{onClick:f})]}),b&&/*#__PURE__*/_jsx("div",{className:classNames("np-drawer-content"),children:b}),d&&/*#__PURE__*/_jsx("div",{className:classNames("np-drawer-footer"),children:d})]})})})};Drawer.propTypes={/** The content to appear in the drawer body. */children:PropTypes.node,className:PropTypes.string,/** The content to appear in the drawer footer. */footerContent:PropTypes.node,/** The content to appear in the drawer header. */headerTitle:PropTypes.node,/** The action to perform on close click. */onClose:PropTypes.func,/** The status of Drawer either open or not. */open:PropTypes.bool,/** The placement of Drawer on the screen either left or right. On mobile it will default to bottom. */position:PropTypes.oneOf(["left","right","bottom"])},Drawer.defaultProps={children:null,className:void 0,footerContent:null,headerTitle:null,onClose:null,open:!1,position:Position.RIGHT};export default Drawer;
1
+ import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import{Position,Typography}from"../common";import{CloseButton}from"../common/closeButton";import{useLayout}from"../common/hooks";import Dimmer from"../dimmer";import SlidingPanel from"../slidingPanel";import Title from"../title";import{logActionRequiredIf}from"../utilities";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Drawer=function(a){var b=a.children,c=a.className,d=a.footerContent,e=a.headerTitle,f=a.onClose,g=a.open,h=a.position;logActionRequiredIf("Drawer now expects `onClose`, and will soon make this prop required. Please update your usage to provide it.",!f);var i=useLayout(),j=i.isMobile,k=useTheme(),l=k.theme;return/*#__PURE__*/_jsx(Dimmer,{open:g,onClose:f,children:/*#__PURE__*/_jsx(SlidingPanel,{open:g,position:j?Position.BOTTOM:h,children:/*#__PURE__*/_jsxs("div",{className:classNames("np-drawer","np-theme-".concat(l),c),children:[/*#__PURE__*/_jsxs("div",{className:classNames("np-drawer-header",{"np-drawer-header--withborder":e}),children:[e&&/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_BODY,children:e}),/*#__PURE__*/_jsx(CloseButton,{onClick:f})]}),b&&/*#__PURE__*/_jsx("div",{className:classNames("np-drawer-content"),children:b}),d&&/*#__PURE__*/_jsx("div",{className:classNames("np-drawer-footer"),children:d})]})})})};Drawer.propTypes={/** The content to appear in the drawer body. */children:PropTypes.node,className:PropTypes.string,/** The content to appear in the drawer footer. */footerContent:PropTypes.node,/** The content to appear in the drawer header. */headerTitle:PropTypes.node,/** The action to perform on close click. */onClose:PropTypes.func,/** The status of Drawer either open or not. */open:PropTypes.bool,/** The placement of Drawer on the screen either left or right. On mobile it will default to bottom. */position:PropTypes.oneOf(["left","right","bottom"])},Drawer.defaultProps={children:null,className:void 0,footerContent:null,headerTitle:null,onClose:null,open:!1,position:Position.RIGHT};export default Drawer;