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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (612) hide show
  1. package/build/es/no-polyfill/accordion/Accordion.js +1 -1
  2. package/build/es/no-polyfill/accordion/Accordion.story.js +1 -1
  3. package/build/es/no-polyfill/accordion/AccordionItem/AccordionItem.js +1 -1
  4. package/build/es/no-polyfill/actionButton/ActionButton.js +1 -1
  5. package/build/es/no-polyfill/actionButton/ActionButton.spec.js +1 -1
  6. package/build/es/no-polyfill/actionButton/ActionButton.story.js +1 -1
  7. package/build/es/no-polyfill/actionOption/ActionOption.js +1 -1
  8. package/build/es/no-polyfill/actionOption/ActionOption.story.js +1 -1
  9. package/build/es/no-polyfill/alert/Alert.js +1 -1
  10. package/build/es/no-polyfill/alert/Alert.story.js +1 -1
  11. package/build/es/no-polyfill/alert/inlineMarkdown/InlineMarkdown.js +1 -1
  12. package/build/es/no-polyfill/alert/withArrow/alertArrowPositions.js +1 -1
  13. package/build/es/no-polyfill/alert/withArrow/withArrow.js +1 -1
  14. package/build/es/no-polyfill/avatar/Avatar.js +1 -1
  15. package/build/es/no-polyfill/avatar/Avatar.story.js +1 -1
  16. package/build/es/no-polyfill/avatar/avatarTypes.js +1 -1
  17. package/build/es/no-polyfill/avatar/colors/colors.js +2 -2
  18. package/build/es/no-polyfill/avatarWrapper/AvatarWrapper.js +1 -1
  19. package/build/es/no-polyfill/avatarWrapper/AvatarWrapper.story.js +1 -1
  20. package/build/es/no-polyfill/badge/Badge.js +1 -1
  21. package/build/es/no-polyfill/body/Body.js +2 -2
  22. package/build/es/no-polyfill/body/Body.spec.js +1 -1
  23. package/build/es/no-polyfill/body/Body.story.js +1 -1
  24. package/build/es/no-polyfill/button/Button.js +5 -5
  25. package/build/es/no-polyfill/button/Button.story.js +1 -1
  26. package/build/es/no-polyfill/button/classMap.js +1 -1
  27. package/build/es/no-polyfill/button/legacyUtils/legacyUtils.js +2 -2
  28. package/build/es/no-polyfill/card/Card.js +1 -1
  29. package/build/es/no-polyfill/checkbox/Checkbox.js +1 -1
  30. package/build/es/no-polyfill/checkbox/Checkbox.story.js +1 -1
  31. package/build/es/no-polyfill/checkboxButton/CheckboxButton.js +1 -1
  32. package/build/es/no-polyfill/checkboxButton/CheckboxButton.spec.js +1 -1
  33. package/build/es/no-polyfill/checkboxButton/CheckboxButton.story.js +2 -2
  34. package/build/es/no-polyfill/checkboxOption/CheckboxOption.js +1 -1
  35. package/build/es/no-polyfill/checkboxOption/CheckboxOption.spec.js +1 -1
  36. package/build/es/no-polyfill/checkboxOption/CheckboxOption.story.js +1 -1
  37. package/build/es/no-polyfill/chevron/Chevron.js +1 -1
  38. package/build/es/no-polyfill/chevron/Chevron.story.js +1 -1
  39. package/build/es/no-polyfill/chips/Chip.js +1 -1
  40. package/build/es/no-polyfill/chips/Chips.js +1 -1
  41. package/build/es/no-polyfill/chips/Chips.spec.js +1 -1
  42. package/build/es/no-polyfill/chips/Chips.story.js +1 -1
  43. package/build/es/no-polyfill/circularButton/CircularButton.js +1 -1
  44. package/build/es/no-polyfill/common/DOMOperations/DOMOperations.js +3 -3
  45. package/build/es/no-polyfill/common/Option/Option.js +1 -1
  46. package/build/es/no-polyfill/common/RadioButton/RadioButton.js +1 -1
  47. package/build/es/no-polyfill/common/bottomSheet/BottomSheet.js +4 -4
  48. package/build/es/no-polyfill/common/bottomSheet/BottomSheet.spec.js +1 -1
  49. package/build/es/no-polyfill/common/bottomSheet/BottomSheet.story.js +2 -2
  50. package/build/es/no-polyfill/common/closeButton/CloseButton.js +1 -1
  51. package/build/es/no-polyfill/common/dateUtils/getDayNames/getDayNames.js +2 -2
  52. package/build/es/no-polyfill/common/dateUtils/getMonthNames/getMonthNames.js +1 -1
  53. package/build/es/no-polyfill/common/dateUtils/isDateValid/isDateValid.js +1 -1
  54. package/build/es/no-polyfill/common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.js +1 -1
  55. package/build/es/no-polyfill/common/deviceDetection/deviceDetection.js +1 -1
  56. package/build/es/no-polyfill/common/direction.js +1 -1
  57. package/build/es/no-polyfill/common/domHelpers/index.js +1 -1
  58. package/build/es/no-polyfill/common/fakeEvents.js +1 -1
  59. package/build/es/no-polyfill/common/fileType.js +1 -1
  60. package/build/es/no-polyfill/common/flowHeader/FlowHeader.js +1 -1
  61. package/build/es/no-polyfill/common/focusBoundary/FocusBoundary.js +1 -1
  62. package/build/es/no-polyfill/common/focusBoundary/FocusBoundary.spec.js +1 -1
  63. package/build/es/no-polyfill/common/focusBoundary/utils/getFocusableElements.js +2 -2
  64. package/build/es/no-polyfill/common/focusBoundary/utils/resetFocus.js +1 -1
  65. package/build/es/no-polyfill/common/historyNavigator/historyNavigator.js +1 -1
  66. package/build/es/no-polyfill/common/hooks/useClientWidth/useClientWidth.js +3 -3
  67. package/build/es/no-polyfill/common/hooks/useConditionalListener/useConditionalListener.js +1 -1
  68. package/build/es/no-polyfill/common/hooks/useDirection/useDirection.js +1 -1
  69. package/build/es/no-polyfill/common/hooks/useHasIntersected/useHasIntersected.js +2 -2
  70. package/build/es/no-polyfill/common/hooks/useLayout/useLayout.js +1 -1
  71. package/build/es/no-polyfill/common/key.js +1 -1
  72. package/build/es/no-polyfill/common/locale/index.js +7 -7
  73. package/build/es/no-polyfill/common/panel/Panel.js +6 -6
  74. package/build/es/no-polyfill/common/propsValues/breakpoint.js +1 -1
  75. package/build/es/no-polyfill/common/propsValues/control.js +1 -1
  76. package/build/es/no-polyfill/common/propsValues/dateMode.js +1 -1
  77. package/build/es/no-polyfill/common/propsValues/layouts.js +1 -1
  78. package/build/es/no-polyfill/common/propsValues/markdownNodeType.js +1 -1
  79. package/build/es/no-polyfill/common/propsValues/monthFormat.js +1 -1
  80. package/build/es/no-polyfill/common/propsValues/position.js +1 -1
  81. package/build/es/no-polyfill/common/propsValues/profileType.js +1 -1
  82. package/build/es/no-polyfill/common/propsValues/scroll.js +1 -1
  83. package/build/es/no-polyfill/common/propsValues/sentiment.js +1 -1
  84. package/build/es/no-polyfill/common/propsValues/size.js +1 -1
  85. package/build/es/no-polyfill/common/propsValues/status.js +1 -1
  86. package/build/es/no-polyfill/common/propsValues/type.js +1 -1
  87. package/build/es/no-polyfill/common/propsValues/typography.js +1 -1
  88. package/build/es/no-polyfill/common/propsValues/variant.js +1 -1
  89. package/build/es/no-polyfill/common/propsValues/width.js +1 -1
  90. package/build/es/no-polyfill/common/requirements.js +2 -2
  91. package/build/es/no-polyfill/common/responsivePanel/ResponsivePanel.js +1 -1
  92. package/build/es/no-polyfill/common/textFormat/formatWithPattern/formatWithPattern.js +2 -2
  93. package/build/es/no-polyfill/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.js +1 -1
  94. package/build/es/no-polyfill/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js +1 -1
  95. package/build/es/no-polyfill/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js +1 -1
  96. package/build/es/no-polyfill/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js +1 -1
  97. package/build/es/no-polyfill/common/textFormat/unformatWithPattern/unformatWithPattern.js +1 -1
  98. package/build/es/no-polyfill/common/theme.js +1 -1
  99. package/build/es/no-polyfill/criticalBanner/CriticalCommsBanner.js +1 -1
  100. package/build/es/no-polyfill/criticalBanner/CriticalCommsBanner.story.js +1 -1
  101. package/build/es/no-polyfill/dateInput/DateInput.js +4 -10
  102. package/build/es/no-polyfill/dateInput/DateInput.story.js +1 -1
  103. package/build/es/no-polyfill/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.js +1 -1
  104. package/build/es/no-polyfill/dateInput/utils/explodeDate/explodeDate.js +1 -1
  105. package/build/es/no-polyfill/dateLookup/DateLookup.js +3 -4
  106. package/build/es/no-polyfill/dateLookup/dateHeader/DateHeader.js +1 -1
  107. package/build/es/no-polyfill/dateLookup/dateTrigger/DateTrigger.js +1 -1
  108. package/build/es/no-polyfill/dateLookup/dayCalendar/DayCalendar.js +1 -1
  109. package/build/es/no-polyfill/dateLookup/dayCalendar/table/DayCalendarTable.js +4 -5
  110. package/build/es/no-polyfill/dateLookup/monthCalendar/MonthCalendar.js +1 -1
  111. package/build/es/no-polyfill/dateLookup/monthCalendar/table/MonthCalendarTable.js +1 -1
  112. package/build/es/no-polyfill/dateLookup/tableLink/TableLink.js +1 -1
  113. package/build/es/no-polyfill/dateLookup/yearCalendar/YearCalendar.js +1 -1
  114. package/build/es/no-polyfill/dateLookup/yearCalendar/table/YearCalendarTable.js +1 -1
  115. package/build/es/no-polyfill/decision/Decision.js +5 -5
  116. package/build/es/no-polyfill/decision/decisionEnums.js +2 -2
  117. package/build/es/no-polyfill/definitionList/DefinitionList.js +1 -1
  118. package/build/es/no-polyfill/dimmer/Dimmer.js +3 -3
  119. package/build/es/no-polyfill/dimmer/Dimmer.story.js +2 -2
  120. package/build/es/no-polyfill/dimmer/dimmerManager/DimmerManager.js +3 -3
  121. package/build/es/no-polyfill/display/Display.js +1 -1
  122. package/build/es/no-polyfill/display/Display.story.js +2 -2
  123. package/build/es/no-polyfill/drawer/Drawer.js +1 -1
  124. package/build/es/no-polyfill/dropFade/DropFade.js +3 -3
  125. package/build/es/no-polyfill/dropFade/DropFade.story.js +1 -1
  126. package/build/es/no-polyfill/dynamicFieldDefinitionList/DynamicFieldDefinitionList.js +1 -1
  127. package/build/es/no-polyfill/dynamicFieldDefinitionList/FormattedValue/FormattedValue.js +1 -1
  128. package/build/es/no-polyfill/dynamicFieldDefinitionList/utils/createDefinitions.js +2 -2
  129. package/build/es/no-polyfill/dynamicFieldDefinitionList/utils/text-format.js +1 -1
  130. package/build/es/no-polyfill/emphasis/Emphasis.js +2 -2
  131. package/build/es/no-polyfill/emphasis/Emphasis.story.js +1 -1
  132. package/build/es/no-polyfill/emphasis/EmphasisHtmlTransformer.js +2 -2
  133. package/build/es/no-polyfill/flowNavigation/FlowNavigation.js +2 -2
  134. package/build/es/no-polyfill/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
  135. package/build/es/no-polyfill/flowNavigation/backButton/BackButton.js +1 -1
  136. package/build/es/no-polyfill/header/Header.js +2 -2
  137. package/build/es/no-polyfill/header/Header.spec.js +1 -1
  138. package/build/es/no-polyfill/header/Header.story.js +2 -1
  139. package/build/es/no-polyfill/i18n/index.js +1 -1
  140. package/build/es/no-polyfill/image/Image.js +2 -2
  141. package/build/es/no-polyfill/info/Info.js +1 -1
  142. package/build/es/no-polyfill/info/Info.story.js +1 -1
  143. package/build/es/no-polyfill/info/infoPresentations.js +1 -1
  144. package/build/es/no-polyfill/inlineAlert/InlineAlert.js +1 -1
  145. package/build/es/no-polyfill/inputWithDisplayFormat/InputWithDisplayFormat.js +1 -1
  146. package/build/es/no-polyfill/inputs/Input.js +1 -1
  147. package/build/es/no-polyfill/inputs/TextArea.js +1 -1
  148. package/build/es/no-polyfill/inputs/_common.js +2 -2
  149. package/build/es/no-polyfill/instructionsList/InstructionsList.js +3 -3
  150. package/build/es/no-polyfill/link/Link.js +2 -2
  151. package/build/es/no-polyfill/link/Link.spec.js +1 -1
  152. package/build/es/no-polyfill/link/Link.story.js +1 -1
  153. package/build/es/no-polyfill/listItem/ListItem.js +1 -1
  154. package/build/es/no-polyfill/listItem/ListItem.spec.js +1 -1
  155. package/build/es/no-polyfill/listItem/ListItem.story.js +1 -1
  156. package/build/es/no-polyfill/loader/Loader.js +2 -2
  157. package/build/es/no-polyfill/loader/Loader.story.js +1 -1
  158. package/build/es/no-polyfill/logo/Logo.js +1 -1
  159. package/build/es/no-polyfill/logo/Logo.story.js +1 -1
  160. package/build/es/no-polyfill/logo/logoTypes.js +1 -1
  161. package/build/es/no-polyfill/markdown/Markdown.js +1 -1
  162. package/build/es/no-polyfill/markdown/Markdown.story.js +1 -1
  163. package/build/es/no-polyfill/modal/Modal.js +1 -1
  164. package/build/es/no-polyfill/modal/Modal.story.js +2 -2
  165. package/build/es/no-polyfill/money/Money.js +1 -1
  166. package/build/es/no-polyfill/money/Money.story.js +1 -1
  167. package/build/es/no-polyfill/moneyInput/MoneyInput.js +1 -1
  168. package/build/es/no-polyfill/moneyInput/MoneyInput.story.js +1 -1
  169. package/build/es/no-polyfill/moneyInput/currencyFormatting.js +2 -2
  170. package/build/es/no-polyfill/navigationOption/NavigationOption.js +1 -1
  171. package/build/es/no-polyfill/navigationOptionsList/NavigationOptionsList.js +1 -1
  172. package/build/es/no-polyfill/nudge/Nudge.js +1 -1
  173. package/build/es/no-polyfill/overlayHeader/OverlayHeader.js +1 -1
  174. package/build/es/no-polyfill/phoneNumberInput/PhoneNumberInput.js +1 -1
  175. package/build/es/no-polyfill/phoneNumberInput/data/countries.js +1 -1
  176. package/build/es/no-polyfill/phoneNumberInput/utils/cleanNumber/cleanNumber.js +1 -1
  177. package/build/es/no-polyfill/phoneNumberInput/utils/excludeCountries/excludeCountries.js +2 -2
  178. package/build/es/no-polyfill/phoneNumberInput/utils/explodeNumberModel/index.js +1 -1
  179. package/build/es/no-polyfill/phoneNumberInput/utils/filterOptionsForQuery/index.js +1 -1
  180. package/build/es/no-polyfill/phoneNumberInput/utils/findCountryByCode/index.js +1 -1
  181. package/build/es/no-polyfill/phoneNumberInput/utils/findCountryByPrefix/index.js +1 -1
  182. package/build/es/no-polyfill/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.js +1 -1
  183. package/build/es/no-polyfill/phoneNumberInput/utils/isOptionAndFitsQuery/isOptionAndFitsQuery.js +1 -1
  184. package/build/es/no-polyfill/phoneNumberInput/utils/isStringNumeric/isStringNumeric.js +1 -1
  185. package/build/es/no-polyfill/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js +1 -1
  186. package/build/es/no-polyfill/phoneNumberInput/utils/longestMatchingPrefix/index.js +1 -1
  187. package/build/es/no-polyfill/phoneNumberInput/utils/setDefaultPrefix/index.js +2 -2
  188. package/build/es/no-polyfill/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.js +2 -2
  189. package/build/es/no-polyfill/popover/Popover.js +2 -2
  190. package/build/es/no-polyfill/processIndicator/ProcessIndicator.js +4 -4
  191. package/build/es/no-polyfill/processIndicator/ProcessIndicator.story.js +1 -1
  192. package/build/es/no-polyfill/progress/Progress.js +1 -1
  193. package/build/es/no-polyfill/progress/Progress.story.js +1 -1
  194. package/build/es/no-polyfill/progressBar/ProgressBar.js +1 -1
  195. package/build/es/no-polyfill/progressBar/ProgressBar.story.js +1 -1
  196. package/build/es/no-polyfill/provider/Provider.js +1 -1
  197. package/build/es/no-polyfill/provider/Provider.spec.js +1 -1
  198. package/build/es/no-polyfill/provider/Provider.story.js +1 -1
  199. package/build/es/no-polyfill/provider/direction/DirectionProvider.js +1 -1
  200. package/build/es/no-polyfill/provider/direction/DirectionProvider.spec.js +1 -1
  201. package/build/es/no-polyfill/provider/language/LanguageProvider.js +1 -1
  202. package/build/es/no-polyfill/provider/language/LanguageProvider.spec.js +1 -1
  203. package/build/es/no-polyfill/radio/Radio.js +1 -1
  204. package/build/es/no-polyfill/radioGroup/RadioGroup.js +2 -2
  205. package/build/es/no-polyfill/radioOption/RadioOption.js +1 -1
  206. package/build/es/no-polyfill/section/Section.js +1 -1
  207. package/build/es/no-polyfill/section/Section.spec.js +1 -1
  208. package/build/es/no-polyfill/section/Section.story.js +1 -1
  209. package/build/es/no-polyfill/select/Select.js +8 -9
  210. package/build/es/no-polyfill/select/option/Option.js +1 -1
  211. package/build/es/no-polyfill/select/searchBox/SearchBox.js +1 -1
  212. package/build/es/no-polyfill/sizeSwapper/SizeSwapper.js +3 -3
  213. package/build/es/no-polyfill/slidingPanel/SlidingPanel.js +1 -1
  214. package/build/es/no-polyfill/snackbar/Snackbar.js +1 -1
  215. package/build/es/no-polyfill/snackbar/SnackbarContext.js +1 -1
  216. package/build/es/no-polyfill/snackbar/SnackbarProvider.js +1 -1
  217. package/build/es/no-polyfill/snackbar/useSnackbar.js +1 -1
  218. package/build/es/no-polyfill/statusIcon/StatusIcon.js +1 -1
  219. package/build/es/no-polyfill/statusIcon/StatusIcon.story.js +1 -1
  220. package/build/es/no-polyfill/stepper/Stepper.js +1 -1
  221. package/build/es/no-polyfill/stepper/deviceDetection.js +2 -2
  222. package/build/es/no-polyfill/sticky/Sticky.js +1 -1
  223. package/build/es/no-polyfill/summary/Summary.js +1 -1
  224. package/build/es/no-polyfill/switch/Switch.js +1 -1
  225. package/build/es/no-polyfill/switch/Switch.story.js +1 -1
  226. package/build/es/no-polyfill/switchOption/SwitchOption.js +1 -1
  227. package/build/es/no-polyfill/switchOption/SwitchOption.story.js +1 -1
  228. package/build/es/no-polyfill/tabs/Tab.js +1 -1
  229. package/build/es/no-polyfill/tabs/TabList.js +1 -1
  230. package/build/es/no-polyfill/tabs/TabPanel.js +1 -1
  231. package/build/es/no-polyfill/tabs/Tabs.js +1 -5
  232. package/build/es/no-polyfill/tabs/utils.js +2 -2
  233. package/build/es/no-polyfill/textareaWithDisplayFormat/TextareaWithDisplayFormat.js +1 -1
  234. package/build/es/no-polyfill/tile/Tile.js +1 -1
  235. package/build/es/no-polyfill/title/Title.js +1 -1
  236. package/build/es/no-polyfill/title/Title.spec.js +1 -1
  237. package/build/es/no-polyfill/title/Title.story.js +1 -1
  238. package/build/es/no-polyfill/tooltip/Tooltip.js +7 -7
  239. package/build/es/no-polyfill/tooltip/Tooltip.spec.js +1 -1
  240. package/build/es/no-polyfill/tooltip/Tooltip.story.js +1 -1
  241. package/build/es/no-polyfill/typeahead/Typeahead.js +1 -1
  242. package/build/es/no-polyfill/typeahead/typeaheadInput/TypeaheadInput.js +1 -1
  243. package/build/es/no-polyfill/typeahead/typeaheadOption/TypeaheadOption.js +1 -1
  244. package/build/es/no-polyfill/typeahead/util/highlight.js +1 -1
  245. package/build/es/no-polyfill/upload/Upload.js +2 -6
  246. package/build/es/no-polyfill/upload/steps/completeStep/completeStep.js +1 -1
  247. package/build/es/no-polyfill/upload/steps/mediaUploadStep/mediaUploadStep.js +1 -1
  248. package/build/es/no-polyfill/upload/steps/processingStep/processingStep.js +1 -1
  249. package/build/es/no-polyfill/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
  250. package/build/es/no-polyfill/upload/uploadSteps.js +1 -1
  251. package/build/es/no-polyfill/upload/utils/asyncFileRead/asyncFileRead.js +1 -1
  252. package/build/es/no-polyfill/upload/utils/getFileType/getFileType.js +1 -1
  253. package/build/es/no-polyfill/upload/utils/getSupportedSpotMimeTypes/getSupportedSpotMimeTypes.js +1 -1
  254. package/build/es/no-polyfill/upload/utils/isSizeValid/isSizeValid.js +1 -1
  255. package/build/es/no-polyfill/upload/utils/isTypeValid/isTypeValid.js +1 -1
  256. package/build/es/no-polyfill/upload/utils/postData/postData.js +1 -1
  257. package/build/es/no-polyfill/upload/utils/requestMedia/requestMedia.js +1 -1
  258. package/build/es/no-polyfill/uploadInput/UploadInput.js +7 -7
  259. package/build/es/no-polyfill/uploadInput/UploadInput.spec.js +1 -1
  260. package/build/es/no-polyfill/uploadInput/UploadInput.story.js +1 -1
  261. package/build/es/no-polyfill/uploadInput/uploadButton/UploadButton.js +1 -1
  262. package/build/es/no-polyfill/uploadInput/uploadButton/UploadButton.spec.js +3 -3
  263. package/build/es/no-polyfill/uploadInput/uploadButton/defaults.js +1 -1
  264. package/build/es/no-polyfill/uploadInput/uploadButton/getAllowedFileTypes.js +3 -3
  265. package/build/es/no-polyfill/uploadInput/uploadButton/getAllowedFileTypes.spec.js +1 -1
  266. package/build/es/no-polyfill/uploadInput/uploadItem/UploadItem.js +2 -2
  267. package/build/es/no-polyfill/uploadInput/uploadItem/UploadItem.spec.js +1 -1
  268. package/build/es/no-polyfill/uploadInput/uploadItem/UploadItemBody.js +1 -1
  269. package/build/es/no-polyfill/utilities/deprecatedProperty/deprecatedProperty.js +1 -1
  270. package/build/es/no-polyfill/withDisplayFormat/WithDisplayFormat.js +3 -4
  271. package/build/es/no-polyfill/withNextPortal/withNextPortal.js +1 -1
  272. package/build/es/polyfill/accordion/Accordion.js +1 -1
  273. package/build/es/polyfill/accordion/Accordion.story.js +1 -1
  274. package/build/es/polyfill/accordion/AccordionItem/AccordionItem.js +1 -1
  275. package/build/es/polyfill/actionButton/ActionButton.js +1 -1
  276. package/build/es/polyfill/actionButton/ActionButton.spec.js +1 -1
  277. package/build/es/polyfill/actionButton/ActionButton.story.js +1 -1
  278. package/build/es/polyfill/actionOption/ActionOption.js +1 -1
  279. package/build/es/polyfill/actionOption/ActionOption.story.js +1 -1
  280. package/build/es/polyfill/alert/Alert.js +1 -1
  281. package/build/es/polyfill/alert/Alert.story.js +1 -1
  282. package/build/es/polyfill/alert/inlineMarkdown/InlineMarkdown.js +1 -1
  283. package/build/es/polyfill/alert/withArrow/alertArrowPositions.js +1 -1
  284. package/build/es/polyfill/alert/withArrow/withArrow.js +1 -1
  285. package/build/es/polyfill/avatar/Avatar.js +1 -1
  286. package/build/es/polyfill/avatar/Avatar.story.js +1 -1
  287. package/build/es/polyfill/avatar/avatarTypes.js +1 -1
  288. package/build/es/polyfill/avatar/colors/colors.js +2 -2
  289. package/build/es/polyfill/avatarWrapper/AvatarWrapper.js +1 -1
  290. package/build/es/polyfill/avatarWrapper/AvatarWrapper.story.js +1 -1
  291. package/build/es/polyfill/badge/Badge.js +1 -1
  292. package/build/es/polyfill/body/Body.js +2 -2
  293. package/build/es/polyfill/body/Body.spec.js +1 -1
  294. package/build/es/polyfill/body/Body.story.js +1 -1
  295. package/build/es/polyfill/button/Button.js +5 -5
  296. package/build/es/polyfill/button/Button.story.js +1 -1
  297. package/build/es/polyfill/button/classMap.js +1 -1
  298. package/build/es/polyfill/button/legacyUtils/legacyUtils.js +2 -2
  299. package/build/es/polyfill/card/Card.js +1 -1
  300. package/build/es/polyfill/checkbox/Checkbox.js +1 -1
  301. package/build/es/polyfill/checkbox/Checkbox.story.js +1 -1
  302. package/build/es/polyfill/checkboxButton/CheckboxButton.js +1 -1
  303. package/build/es/polyfill/checkboxButton/CheckboxButton.spec.js +1 -1
  304. package/build/es/polyfill/checkboxButton/CheckboxButton.story.js +2 -2
  305. package/build/es/polyfill/checkboxOption/CheckboxOption.js +1 -1
  306. package/build/es/polyfill/checkboxOption/CheckboxOption.spec.js +1 -1
  307. package/build/es/polyfill/checkboxOption/CheckboxOption.story.js +1 -1
  308. package/build/es/polyfill/chevron/Chevron.js +1 -1
  309. package/build/es/polyfill/chevron/Chevron.story.js +1 -1
  310. package/build/es/polyfill/chips/Chip.js +1 -1
  311. package/build/es/polyfill/chips/Chips.js +1 -1
  312. package/build/es/polyfill/chips/Chips.spec.js +1 -1
  313. package/build/es/polyfill/chips/Chips.story.js +1 -1
  314. package/build/es/polyfill/circularButton/CircularButton.js +1 -1
  315. package/build/es/polyfill/common/DOMOperations/DOMOperations.js +3 -3
  316. package/build/es/polyfill/common/Option/Option.js +1 -1
  317. package/build/es/polyfill/common/RadioButton/RadioButton.js +1 -1
  318. package/build/es/polyfill/common/bottomSheet/BottomSheet.js +4 -4
  319. package/build/es/polyfill/common/bottomSheet/BottomSheet.spec.js +1 -1
  320. package/build/es/polyfill/common/bottomSheet/BottomSheet.story.js +2 -2
  321. package/build/es/polyfill/common/closeButton/CloseButton.js +1 -1
  322. package/build/es/polyfill/common/dateUtils/getDayNames/getDayNames.js +2 -2
  323. package/build/es/polyfill/common/dateUtils/getMonthNames/getMonthNames.js +1 -1
  324. package/build/es/polyfill/common/dateUtils/isDateValid/isDateValid.js +1 -1
  325. package/build/es/polyfill/common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.js +1 -1
  326. package/build/es/polyfill/common/deviceDetection/deviceDetection.js +1 -1
  327. package/build/es/polyfill/common/direction.js +1 -1
  328. package/build/es/polyfill/common/domHelpers/index.js +1 -1
  329. package/build/es/polyfill/common/fakeEvents.js +1 -1
  330. package/build/es/polyfill/common/fileType.js +1 -1
  331. package/build/es/polyfill/common/flowHeader/FlowHeader.js +1 -1
  332. package/build/es/polyfill/common/focusBoundary/FocusBoundary.js +1 -1
  333. package/build/es/polyfill/common/focusBoundary/FocusBoundary.spec.js +1 -1
  334. package/build/es/polyfill/common/focusBoundary/utils/getFocusableElements.js +2 -2
  335. package/build/es/polyfill/common/focusBoundary/utils/resetFocus.js +1 -1
  336. package/build/es/polyfill/common/historyNavigator/historyNavigator.js +1 -1
  337. package/build/es/polyfill/common/hooks/useClientWidth/useClientWidth.js +3 -3
  338. package/build/es/polyfill/common/hooks/useConditionalListener/useConditionalListener.js +1 -1
  339. package/build/es/polyfill/common/hooks/useDirection/useDirection.js +1 -1
  340. package/build/es/polyfill/common/hooks/useHasIntersected/useHasIntersected.js +2 -2
  341. package/build/es/polyfill/common/hooks/useLayout/useLayout.js +1 -1
  342. package/build/es/polyfill/common/key.js +1 -1
  343. package/build/es/polyfill/common/locale/index.js +7 -7
  344. package/build/es/polyfill/common/panel/Panel.js +6 -6
  345. package/build/es/polyfill/common/propsValues/breakpoint.js +1 -1
  346. package/build/es/polyfill/common/propsValues/control.js +1 -1
  347. package/build/es/polyfill/common/propsValues/dateMode.js +1 -1
  348. package/build/es/polyfill/common/propsValues/layouts.js +1 -1
  349. package/build/es/polyfill/common/propsValues/markdownNodeType.js +1 -1
  350. package/build/es/polyfill/common/propsValues/monthFormat.js +1 -1
  351. package/build/es/polyfill/common/propsValues/position.js +1 -1
  352. package/build/es/polyfill/common/propsValues/profileType.js +1 -1
  353. package/build/es/polyfill/common/propsValues/scroll.js +1 -1
  354. package/build/es/polyfill/common/propsValues/sentiment.js +1 -1
  355. package/build/es/polyfill/common/propsValues/size.js +1 -1
  356. package/build/es/polyfill/common/propsValues/status.js +1 -1
  357. package/build/es/polyfill/common/propsValues/type.js +1 -1
  358. package/build/es/polyfill/common/propsValues/typography.js +1 -1
  359. package/build/es/polyfill/common/propsValues/variant.js +1 -1
  360. package/build/es/polyfill/common/propsValues/width.js +1 -1
  361. package/build/es/polyfill/common/requirements.js +2 -2
  362. package/build/es/polyfill/common/responsivePanel/ResponsivePanel.js +1 -1
  363. package/build/es/polyfill/common/textFormat/formatWithPattern/formatWithPattern.js +2 -2
  364. package/build/es/polyfill/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.js +1 -1
  365. package/build/es/polyfill/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js +1 -1
  366. package/build/es/polyfill/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js +1 -1
  367. package/build/es/polyfill/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js +1 -1
  368. package/build/es/polyfill/common/textFormat/unformatWithPattern/unformatWithPattern.js +1 -1
  369. package/build/es/polyfill/common/theme.js +1 -1
  370. package/build/es/polyfill/criticalBanner/CriticalCommsBanner.js +1 -1
  371. package/build/es/polyfill/criticalBanner/CriticalCommsBanner.story.js +1 -1
  372. package/build/es/polyfill/dateInput/DateInput.js +4 -10
  373. package/build/es/polyfill/dateInput/DateInput.story.js +1 -1
  374. package/build/es/polyfill/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.js +1 -1
  375. package/build/es/polyfill/dateInput/utils/explodeDate/explodeDate.js +1 -1
  376. package/build/es/polyfill/dateLookup/DateLookup.js +3 -4
  377. package/build/es/polyfill/dateLookup/dateHeader/DateHeader.js +1 -1
  378. package/build/es/polyfill/dateLookup/dateTrigger/DateTrigger.js +1 -1
  379. package/build/es/polyfill/dateLookup/dayCalendar/DayCalendar.js +1 -1
  380. package/build/es/polyfill/dateLookup/dayCalendar/table/DayCalendarTable.js +4 -5
  381. package/build/es/polyfill/dateLookup/monthCalendar/MonthCalendar.js +1 -1
  382. package/build/es/polyfill/dateLookup/monthCalendar/table/MonthCalendarTable.js +1 -1
  383. package/build/es/polyfill/dateLookup/tableLink/TableLink.js +1 -1
  384. package/build/es/polyfill/dateLookup/yearCalendar/YearCalendar.js +1 -1
  385. package/build/es/polyfill/dateLookup/yearCalendar/table/YearCalendarTable.js +1 -1
  386. package/build/es/polyfill/decision/Decision.js +5 -5
  387. package/build/es/polyfill/decision/decisionEnums.js +2 -2
  388. package/build/es/polyfill/definitionList/DefinitionList.js +1 -1
  389. package/build/es/polyfill/dimmer/Dimmer.js +3 -3
  390. package/build/es/polyfill/dimmer/Dimmer.story.js +2 -2
  391. package/build/es/polyfill/dimmer/dimmerManager/DimmerManager.js +3 -3
  392. package/build/es/polyfill/display/Display.js +1 -1
  393. package/build/es/polyfill/display/Display.story.js +2 -2
  394. package/build/es/polyfill/drawer/Drawer.js +1 -1
  395. package/build/es/polyfill/dropFade/DropFade.js +3 -3
  396. package/build/es/polyfill/dropFade/DropFade.story.js +1 -1
  397. package/build/es/polyfill/dynamicFieldDefinitionList/DynamicFieldDefinitionList.js +1 -1
  398. package/build/es/polyfill/dynamicFieldDefinitionList/FormattedValue/FormattedValue.js +2 -2
  399. package/build/es/polyfill/dynamicFieldDefinitionList/utils/createDefinitions.js +2 -2
  400. package/build/es/polyfill/dynamicFieldDefinitionList/utils/text-format.js +1 -1
  401. package/build/es/polyfill/emphasis/Emphasis.js +2 -2
  402. package/build/es/polyfill/emphasis/Emphasis.story.js +1 -1
  403. package/build/es/polyfill/emphasis/EmphasisHtmlTransformer.js +2 -2
  404. package/build/es/polyfill/flowNavigation/FlowNavigation.js +2 -2
  405. package/build/es/polyfill/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
  406. package/build/es/polyfill/flowNavigation/backButton/BackButton.js +1 -1
  407. package/build/es/polyfill/header/Header.js +2 -2
  408. package/build/es/polyfill/header/Header.spec.js +1 -1
  409. package/build/es/polyfill/header/Header.story.js +2 -1
  410. package/build/es/polyfill/i18n/index.js +1 -1
  411. package/build/es/polyfill/image/Image.js +2 -2
  412. package/build/es/polyfill/info/Info.js +1 -1
  413. package/build/es/polyfill/info/Info.story.js +1 -1
  414. package/build/es/polyfill/info/infoPresentations.js +1 -1
  415. package/build/es/polyfill/inlineAlert/InlineAlert.js +1 -1
  416. package/build/es/polyfill/inputWithDisplayFormat/InputWithDisplayFormat.js +1 -1
  417. package/build/es/polyfill/inputs/Input.js +1 -1
  418. package/build/es/polyfill/inputs/TextArea.js +1 -1
  419. package/build/es/polyfill/inputs/_common.js +2 -2
  420. package/build/es/polyfill/instructionsList/InstructionsList.js +3 -3
  421. package/build/es/polyfill/link/Link.js +2 -2
  422. package/build/es/polyfill/link/Link.spec.js +1 -1
  423. package/build/es/polyfill/link/Link.story.js +1 -1
  424. package/build/es/polyfill/listItem/ListItem.js +1 -1
  425. package/build/es/polyfill/listItem/ListItem.spec.js +1 -1
  426. package/build/es/polyfill/listItem/ListItem.story.js +1 -1
  427. package/build/es/polyfill/loader/Loader.js +2 -2
  428. package/build/es/polyfill/loader/Loader.story.js +1 -1
  429. package/build/es/polyfill/logo/Logo.js +1 -1
  430. package/build/es/polyfill/logo/Logo.story.js +1 -1
  431. package/build/es/polyfill/logo/logoTypes.js +1 -1
  432. package/build/es/polyfill/markdown/Markdown.js +1 -1
  433. package/build/es/polyfill/markdown/Markdown.story.js +1 -1
  434. package/build/es/polyfill/modal/Modal.js +1 -1
  435. package/build/es/polyfill/modal/Modal.story.js +2 -2
  436. package/build/es/polyfill/money/Money.js +1 -1
  437. package/build/es/polyfill/money/Money.story.js +1 -1
  438. package/build/es/polyfill/moneyInput/MoneyInput.js +1 -1
  439. package/build/es/polyfill/moneyInput/MoneyInput.story.js +1 -1
  440. package/build/es/polyfill/moneyInput/currencyFormatting.js +2 -2
  441. package/build/es/polyfill/navigationOption/NavigationOption.js +1 -1
  442. package/build/es/polyfill/navigationOptionsList/NavigationOptionsList.js +1 -1
  443. package/build/es/polyfill/nudge/Nudge.js +1 -1
  444. package/build/es/polyfill/overlayHeader/OverlayHeader.js +1 -1
  445. package/build/es/polyfill/phoneNumberInput/PhoneNumberInput.js +1 -1
  446. package/build/es/polyfill/phoneNumberInput/data/countries.js +1 -1
  447. package/build/es/polyfill/phoneNumberInput/utils/cleanNumber/cleanNumber.js +1 -1
  448. package/build/es/polyfill/phoneNumberInput/utils/excludeCountries/excludeCountries.js +3 -3
  449. package/build/es/polyfill/phoneNumberInput/utils/explodeNumberModel/index.js +2 -2
  450. package/build/es/polyfill/phoneNumberInput/utils/filterOptionsForQuery/index.js +2 -2
  451. package/build/es/polyfill/phoneNumberInput/utils/findCountryByCode/index.js +1 -1
  452. package/build/es/polyfill/phoneNumberInput/utils/findCountryByPrefix/index.js +1 -1
  453. package/build/es/polyfill/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.js +1 -1
  454. package/build/es/polyfill/phoneNumberInput/utils/isOptionAndFitsQuery/isOptionAndFitsQuery.js +2 -2
  455. package/build/es/polyfill/phoneNumberInput/utils/isStringNumeric/isStringNumeric.js +1 -1
  456. package/build/es/polyfill/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js +2 -2
  457. package/build/es/polyfill/phoneNumberInput/utils/longestMatchingPrefix/index.js +1 -1
  458. package/build/es/polyfill/phoneNumberInput/utils/setDefaultPrefix/index.js +2 -2
  459. package/build/es/polyfill/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.js +2 -2
  460. package/build/es/polyfill/popover/Popover.js +2 -2
  461. package/build/es/polyfill/processIndicator/ProcessIndicator.js +4 -4
  462. package/build/es/polyfill/processIndicator/ProcessIndicator.story.js +1 -1
  463. package/build/es/polyfill/progress/Progress.js +1 -1
  464. package/build/es/polyfill/progress/Progress.story.js +1 -1
  465. package/build/es/polyfill/progressBar/ProgressBar.js +1 -1
  466. package/build/es/polyfill/progressBar/ProgressBar.story.js +1 -1
  467. package/build/es/polyfill/provider/Provider.js +1 -1
  468. package/build/es/polyfill/provider/Provider.spec.js +1 -1
  469. package/build/es/polyfill/provider/Provider.story.js +1 -1
  470. package/build/es/polyfill/provider/direction/DirectionProvider.js +1 -1
  471. package/build/es/polyfill/provider/direction/DirectionProvider.spec.js +1 -1
  472. package/build/es/polyfill/provider/language/LanguageProvider.js +1 -1
  473. package/build/es/polyfill/provider/language/LanguageProvider.spec.js +1 -1
  474. package/build/es/polyfill/radio/Radio.js +1 -1
  475. package/build/es/polyfill/radioGroup/RadioGroup.js +2 -2
  476. package/build/es/polyfill/radioOption/RadioOption.js +1 -1
  477. package/build/es/polyfill/section/Section.js +1 -1
  478. package/build/es/polyfill/section/Section.spec.js +1 -1
  479. package/build/es/polyfill/section/Section.story.js +1 -1
  480. package/build/es/polyfill/select/Select.js +8 -9
  481. package/build/es/polyfill/select/option/Option.js +2 -2
  482. package/build/es/polyfill/select/searchBox/SearchBox.js +1 -1
  483. package/build/es/polyfill/sizeSwapper/SizeSwapper.js +3 -3
  484. package/build/es/polyfill/slidingPanel/SlidingPanel.js +1 -1
  485. package/build/es/polyfill/snackbar/Snackbar.js +1 -1
  486. package/build/es/polyfill/snackbar/SnackbarContext.js +1 -1
  487. package/build/es/polyfill/snackbar/SnackbarProvider.js +1 -1
  488. package/build/es/polyfill/snackbar/useSnackbar.js +1 -1
  489. package/build/es/polyfill/statusIcon/StatusIcon.js +1 -1
  490. package/build/es/polyfill/statusIcon/StatusIcon.story.js +1 -1
  491. package/build/es/polyfill/stepper/Stepper.js +1 -1
  492. package/build/es/polyfill/stepper/deviceDetection.js +2 -2
  493. package/build/es/polyfill/sticky/Sticky.js +1 -1
  494. package/build/es/polyfill/summary/Summary.js +1 -1
  495. package/build/es/polyfill/switch/Switch.js +1 -1
  496. package/build/es/polyfill/switch/Switch.story.js +1 -1
  497. package/build/es/polyfill/switchOption/SwitchOption.js +1 -1
  498. package/build/es/polyfill/switchOption/SwitchOption.story.js +1 -1
  499. package/build/es/polyfill/tabs/Tab.js +1 -1
  500. package/build/es/polyfill/tabs/TabList.js +1 -1
  501. package/build/es/polyfill/tabs/TabPanel.js +1 -1
  502. package/build/es/polyfill/tabs/Tabs.js +1 -5
  503. package/build/es/polyfill/tabs/utils.js +2 -2
  504. package/build/es/polyfill/textareaWithDisplayFormat/TextareaWithDisplayFormat.js +1 -1
  505. package/build/es/polyfill/tile/Tile.js +1 -1
  506. package/build/es/polyfill/title/Title.js +1 -1
  507. package/build/es/polyfill/title/Title.spec.js +1 -1
  508. package/build/es/polyfill/title/Title.story.js +1 -1
  509. package/build/es/polyfill/tooltip/Tooltip.js +7 -7
  510. package/build/es/polyfill/tooltip/Tooltip.spec.js +1 -1
  511. package/build/es/polyfill/tooltip/Tooltip.story.js +1 -1
  512. package/build/es/polyfill/typeahead/Typeahead.js +1 -1
  513. package/build/es/polyfill/typeahead/typeaheadInput/TypeaheadInput.js +1 -1
  514. package/build/es/polyfill/typeahead/typeaheadOption/TypeaheadOption.js +1 -1
  515. package/build/es/polyfill/typeahead/util/highlight.js +1 -1
  516. package/build/es/polyfill/upload/Upload.js +2 -6
  517. package/build/es/polyfill/upload/steps/completeStep/completeStep.js +1 -1
  518. package/build/es/polyfill/upload/steps/mediaUploadStep/mediaUploadStep.js +1 -1
  519. package/build/es/polyfill/upload/steps/processingStep/processingStep.js +1 -1
  520. package/build/es/polyfill/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
  521. package/build/es/polyfill/upload/uploadSteps.js +1 -1
  522. package/build/es/polyfill/upload/utils/asyncFileRead/asyncFileRead.js +1 -1
  523. package/build/es/polyfill/upload/utils/getFileType/getFileType.js +1 -1
  524. package/build/es/polyfill/upload/utils/getSupportedSpotMimeTypes/getSupportedSpotMimeTypes.js +2 -2
  525. package/build/es/polyfill/upload/utils/isSizeValid/isSizeValid.js +1 -1
  526. package/build/es/polyfill/upload/utils/isTypeValid/isTypeValid.js +1 -1
  527. package/build/es/polyfill/upload/utils/postData/postData.js +1 -1
  528. package/build/es/polyfill/upload/utils/requestMedia/requestMedia.js +1 -1
  529. package/build/es/polyfill/uploadInput/UploadInput.js +7 -7
  530. package/build/es/polyfill/uploadInput/UploadInput.spec.js +1 -1
  531. package/build/es/polyfill/uploadInput/UploadInput.story.js +1 -1
  532. package/build/es/polyfill/uploadInput/uploadButton/UploadButton.js +1 -1
  533. package/build/es/polyfill/uploadInput/uploadButton/UploadButton.spec.js +3 -3
  534. package/build/es/polyfill/uploadInput/uploadButton/defaults.js +1 -1
  535. package/build/es/polyfill/uploadInput/uploadButton/getAllowedFileTypes.js +3 -3
  536. package/build/es/polyfill/uploadInput/uploadButton/getAllowedFileTypes.spec.js +1 -1
  537. package/build/es/polyfill/uploadInput/uploadItem/UploadItem.js +2 -2
  538. package/build/es/polyfill/uploadInput/uploadItem/UploadItem.spec.js +1 -1
  539. package/build/es/polyfill/uploadInput/uploadItem/UploadItemBody.js +1 -1
  540. package/build/es/polyfill/utilities/deprecatedProperty/deprecatedProperty.js +1 -1
  541. package/build/es/polyfill/withDisplayFormat/WithDisplayFormat.js +3 -4
  542. package/build/es/polyfill/withNextPortal/withNextPortal.js +1 -1
  543. package/build/main.css +1 -4194
  544. package/build/styles/accordion/Accordion.css +1 -59
  545. package/build/styles/actionButton/ActionButton.css +1 -36
  546. package/build/styles/avatar/Avatar.css +1 -239
  547. package/build/styles/badge/Badge.css +1 -67
  548. package/build/styles/button/Button.css +1 -17
  549. package/build/styles/card/Card.css +1 -88
  550. package/build/styles/checkboxButton/CheckboxButton.css +1 -21
  551. package/build/styles/chips/Chip.css +1 -169
  552. package/build/styles/circularButton/CircularButton.css +1 -175
  553. package/build/styles/common/Option/Option.css +1 -74
  554. package/build/styles/common/RadioButton/RadioButton.css +1 -3
  555. package/build/styles/common/bottomSheet/BottomSheet.css +1 -44
  556. package/build/styles/common/closeButton/CloseButton.css +1 -44
  557. package/build/styles/common/panel/Panel.css +1 -67
  558. package/build/styles/criticalBanner/CriticalCommsBanner.css +1 -73
  559. package/build/styles/dateInput/DateInput.css +1 -3
  560. package/build/styles/dateLookup/DateLookup.css +1 -80
  561. package/build/styles/dateLookup/dateTrigger/DateTrigger.css +1 -53
  562. package/build/styles/decision/Decision.css +1 -69
  563. package/build/styles/definitionList/DefinitionList.css +1 -48
  564. package/build/styles/dimmer/Dimmer.css +1 -68
  565. package/build/styles/drawer/Drawer.css +1 -77
  566. package/build/styles/dropFade/DropFade.css +1 -19
  567. package/build/styles/dynamicFieldDefinitionList/FormattedValue/FormattedValue.css +1 -4
  568. package/build/styles/emphasis/Emphasis.css +1 -25
  569. package/build/styles/flowNavigation/FlowNavigation.css +1 -85
  570. package/build/styles/flowNavigation/animatedLabel/AnimatedLabel.css +1 -26
  571. package/build/styles/flowNavigation/backButton/BackButton.css +1 -28
  572. package/build/styles/header/Header.css +1 -19
  573. package/build/styles/image/Image.css +1 -13
  574. package/build/styles/info/Info.css +1 -37
  575. package/build/styles/inputs/Input.css +1 -53
  576. package/build/styles/inputs/TextArea.css +1 -59
  577. package/build/styles/instructionsList/InstructionsList.css +1 -30
  578. package/build/styles/link/Link.css +1 -12
  579. package/build/styles/listItem/ListItem.css +1 -6
  580. package/build/styles/loader/Loader.css +1 -295
  581. package/build/styles/logo/Logo.css +1 -10
  582. package/build/styles/main.css +1 -4194
  583. package/build/styles/modal/Modal.css +1 -133
  584. package/build/styles/moneyInput/MoneyInput.css +1 -128
  585. package/build/styles/navigationOption/NavigationOption.css +1 -61
  586. package/build/styles/navigationOptionsList/NavigationOptionsList.css +1 -12
  587. package/build/styles/nudge/Nudge.css +1 -138
  588. package/build/styles/overlayHeader/OverlayHeader.css +1 -31
  589. package/build/styles/phoneNumberInput/PhoneNumberInput.css +1 -17
  590. package/build/styles/popover/Popover.css +1 -36
  591. package/build/styles/progress/Progress.css +1 -35
  592. package/build/styles/progressBar/ProgressBar.css +1 -9
  593. package/build/styles/section/Section.css +1 -8
  594. package/build/styles/select/Select.css +1 -319
  595. package/build/styles/slidingPanel/SlidingPanel.css +1 -96
  596. package/build/styles/snackbar/Snackbar.css +1 -84
  597. package/build/styles/statusIcon/StatusIcon.css +1 -50
  598. package/build/styles/stepper/Stepper.css +1 -108
  599. package/build/styles/summary/Summary.css +1 -86
  600. package/build/styles/switch/Switch.css +1 -64
  601. package/build/styles/tabs/Tabs.css +1 -104
  602. package/build/styles/tile/Tile.css +1 -58
  603. package/build/styles/tooltip/Tooltip.css +1 -38
  604. package/build/styles/typeahead/Typeahead.css +1 -167
  605. package/build/styles/typeahead/typeaheadOption/TypeaheadOption.css +1 -6
  606. package/build/styles/upload/Upload.css +1 -15
  607. package/build/styles/uploadInput/UploadInput.css +1 -53
  608. package/build/styles/uploadInput/uploadButton/UploadButton.css +1 -44
  609. package/build/styles/uploadInput/uploadItem/UploadItem.css +1 -60
  610. package/build/umd/no-polyfill/main.js +1 -1
  611. package/build/umd/polyfill/main.js +1 -1
  612. package/package.json +1 -1
@@ -1,10 +1,4 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.regexp.to-string.js";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=>{var b,c,d;let{disabled:e,size:f,value:g,dayLabel:h,monthLabel:i,yearLabel:j,monthFormat:k,mode:l,onChange:m,onFocus:n,onBlur:o,placeholders:p,id:q,selectProps:r}=a;const{locale:s,formatMessage:t}=useIntl(),u=()=>g&&isDateValid(g)?"string"==typeof g?convertToLocalMidnight(g):g:null,v=a=>{let b=INITIAL_DEFAULT_STATE;if(g&&isDateValid(g)){const a=u();b=explodeDate(a),isMonthAndYearFormat(g)&&(b.day=null)}return b[a]},[w,x]=useState(()=>v("day")),[y,z]=useState(()=>v("month")),[A,B]=useState(()=>v("year")),[C,D]=useState(u);h=h||t(messages.dayLabel),i=i||t(messages.monthLabel),j=j||t(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)||t(messages.monthLabel),year:(null===(d=p)||void 0===d?void 0:d.year)||"YYYY"};const E=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("-");}},F=()=>{const a=getMonthNames(s,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:G(),size:f,selected:null===y?null:{value:y,label:a[y]},onChange:a=>J(a)},r))]})},G=()=>{const a=[],b=getMonthNames(s,k);return b.forEach((b,c)=>{a.push({value:c,label:b})}),a},H=function(){let a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:w,b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:y,c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:A;const d=null!=a&&null!=b&&null!=c?new Date(c,b,a):null,e=isDateValid(d)?d:null;e||L(INITIAL_DEFAULT_STATE),l===DateMode.MONTH_YEAR?0<=b&&c&&(b!==y||c!==A)&&L(e):a&&0<=b&&c&&(a!==w||b!==y||c!==A)&&L(e)},I=a=>{const{checkedDay:b}=M(a.target.value,y,A);x(b),H(b,y,A)},J=a=>{if(!a)return z(null),void H(w,null,A);const b=a?a.value:0,{checkedDay:c}=M(w,b,A);z(b),w&&c!==w&&x(c),H(c,b,A)},K=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}=M(w,y,b);w&&a!==w&&x(a),B(c),H(a,y,c)}else B(c),H(w,y,null)},L=a=>{a!==C&&(D(a),m(E(a)||null))},M=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}},N=l===DateMode.MONTH_YEAR,O=classNames({"col-sm-8":N,"col-sm-5":!N}),P=MonthBeforeDay.has(s);return/*#__PURE__*/_jsx("div",{className:"tw-date",id:q,onFocus:a=>shouldPropagateOnFocus(a)?n&&n():a.stopPropagation(),onBlur:a=>shouldPropagateOnBlur(a)?o&&o():a.stopPropagation(),children:/*#__PURE__*/_jsxs("div",{className:"row",children:[P&&/*#__PURE__*/_jsx("div",{className:O,children:F()}),!N&&/*#__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:w||"",placeholder:p.day,disabled:e,onChange:a=>I(a)})})]})}),!P&&/*#__PURE__*/_jsx("div",{className:O,children:F()}),/*#__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:A||"",disabled:e,onChange:a=>K(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";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"core-js/modules/es.array.iterator.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.set.js";import"core-js/modules/es.string.iterator.js";import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.array.join.js";import"core-js/modules/es.array.slice.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.regexp.to-string.js";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 _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 const Basic={};export const BasicMobile=storyConfig(Basic,{variants:["mobile"]});export const InputError=_objectSpread(_objectSpread({},Basic),{},{render:a=>/*#__PURE__*/_jsxs("div",{className:"form-group has-error",children:[/*#__PURE__*/_jsx(DateInput,_objectSpread({},a)),/*#__PURE__*/_jsx(InlineAlert,{type:"error",children:lorem10})]})});export const InputErrorMobile=storyConfig(InputError,{variants:["mobile"]});
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{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 _defineProperty from"@babel/runtime/helpers/defineProperty";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{constructor(a){super(a),_defineProperty(this,"element",/*#__PURE__*/createRef()),_defineProperty(this,"dropdown",/*#__PURE__*/createRef()),_defineProperty(this,"open",()=>{const{onFocus:a}=this.props;this.setState({open:!0,mode:MODE.DAY}),a&&a()}),_defineProperty(this,"close",()=>{const{onBlur:a}=this.props;this.setState({open:!1}),a&&a()}),_defineProperty(this,"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:}}),_defineProperty(this,"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)}),_defineProperty(this,"focusOn",(a,b)=>{const c=this.element.current.querySelector(a);c?c.focus():b&&this.focusOn(b)}),_defineProperty(this,"switchMode",a=>{this.setState({mode:a},()=>{this.focusOn(".active",".today")})}),_defineProperty(this,"switchToDays",()=>this.switchMode(MODE.DAY)),_defineProperty(this,"switchToMonths",()=>this.switchMode(MODE.MONTH)),_defineProperty(this,"switchToYears",()=>this.switchMode(MODE.YEAR)),_defineProperty(this,"handleSelectedDateUpdate",a=>{this.setState({selectedDate:a},()=>{this.props.onChange(a),this.close(),this.focusOn(".btn")})}),_defineProperty(this,"handleViewDateUpdate",a=>{let{month:b=this.state.viewMonth,year:c=this.state.viewYear}=a;this.setState({viewMonth:b,viewYear:c})}),_defineProperty(this,"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})]})}),_defineProperty(this,"handleClear",()=>{this.props.onChange(null),this.focusOn(".np-date-trigger")}),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=()=>{}}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";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.reflect.construct.js";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import PropTypes from"prop-types";import{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 ".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:()=>{}};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 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{locale:j,formatMessage:k}=useIntl();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,j,{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":k(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,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 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=useIntl(),k=j.locale,l=j.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,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--".concat(c),"aria-label":l(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,onClear:PropTypes.func},DateTrigger.defaultProps={selectedDate:null,size:Size.MEDIUM,onClear:void 0};export default DateTrigger;
@@ -1 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/web.dom-collections.iterator.js";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{constructor(){super(...arguments),_defineProperty(this,"selectPreviousMonth",()=>{const{viewMonth:a,viewYear:b}=this.props;this.props.onViewDateUpdate({month:0>=a?11:a-1,year:0>=a?b-1:b})}),_defineProperty(this,"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";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.reflect.construct.js";import"core-js/modules/es.array.concat.js";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import{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 _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/web.dom-collections.iterator.js";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{constructor(){super(...arguments),_defineProperty(this,"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}),_defineProperty(this,"days",getDayNames(this.props.intl.locale,"short")),_defineProperty(this,"daysShort",getDayNames(this.props.intl.locale,"narrow")),_defineProperty(this,"selectDay",a=>{const{viewMonth:b,viewYear:c,onSelect:d}=this.props;d(new Date(c,b,a))}),_defineProperty(this,"isDisabled",a=>{const{min:b,max:c,viewMonth:d,viewYear:e}=this.props,f=new Date(e,d,a);return!isWithinRange(f,b,c)}),_defineProperty(this,"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";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.reflect.construct.js";import"core-js/modules/es.array.concat.js";import"core-js/modules/es.array.map.js";import"core-js/modules/es.array.slice.js";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import{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 _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/web.dom-collections.iterator.js";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{constructor(){super(...arguments),_defineProperty(this,"onMonthSelect",a=>{this.props.onViewDateUpdate({month:a}),this.props.onSelect()}),_defineProperty(this,"selectPreviousYear",()=>{this.props.onViewDateUpdate({year:this.props.viewYear-1})}),_defineProperty(this,"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";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.reflect.construct.js";import"core-js/modules/es.array.concat.js";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import{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"core-js/modules/web.dom-collections.iterator.js";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"core-js/modules/es.array.map.js";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 _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/web.dom-collections.iterator.js";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{constructor(){super(...arguments),_defineProperty(this,"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-".concat(b,"-option ").concat(e?"active":""," ").concat(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";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.reflect.construct.js";import"core-js/modules/es.array.concat.js";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import PropTypes from"prop-types";import{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 _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/web.dom-collections.iterator.js";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{constructor(){super(...arguments),_defineProperty(this,"onYearSelect",a=>{this.props.onViewDateUpdate({year:a}),this.props.onSelect()}),_defineProperty(this,"selectPreviousYears",()=>{this.props.onViewDateUpdate({year:this.props.viewYear-20})}),_defineProperty(this,"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";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.reflect.construct.js";import"core-js/modules/es.array.concat.js";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import PropTypes from"prop-types";import{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"core-js/modules/web.dom-collections.iterator.js";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"core-js/modules/es.array.map.js";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"core-js/modules/es.symbol.description.js";import classNames from"classnames";import PropTypes from"prop-types";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-".concat(c))),i[1].items.push(/*#__PURE__*/_jsx(Tile// eslint-disable-next-line react/no-array-index-key
3
- ,{className:classNames("np-decision__tile".concat(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-".concat(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-".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:PropTypes.string,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"core-js/modules/es.object.to-string.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.symbol.description.js";import"core-js/modules/es.array.map.js";import classNames from"classnames";import PropTypes from"prop-types";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:PropTypes.string,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"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import"core-js/modules/web.dom-collections.iterator.js";import 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}),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"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import"core-js/modules/es.array.map.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";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}),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"core-js/modules/web.dom-collections.iterator.js";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{addNoScrollClass,removeNoScrollClass}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{addNoScrollClass,removeNoScrollClass}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&&(null===e||void 0===e?void 0: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),null===a||void 0===a?void 0:a.addEventListener("touchmove",handleTouchMove,{passive:!0})),()=>{document.removeEventListener("keydown",p),null===a||void 0===a?void 0: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&&addNoScrollClass(),()=>{c&&removeNoScrollClass()}),[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&&addNoScrollClass(),function(){c&&removeNoScrollClass()}},[c]),b};// Export without the Portal for tests only
6
6
  export{Dimmer};export default withNextPortal(Dimmer);
@@ -1,2 +1,2 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"core-js/modules/web.dom-collections.iterator.js";import{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,_objectSpread(_objectSpread({},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";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{action}from"@storybook/addon-actions";import{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
- import _defineProperty from"@babel/runtime/helpers/defineProperty";/**
1
+ import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.array.splice.js";/**
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(){_defineProperty(this,"dimmers",void 0),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-".concat(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("div",{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("div",{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("div",{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("div",{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("div",{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("div",{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("div",{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("div",{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-".concat(j),c),role:"dialog",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),role:"dialog",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,3 +1,3 @@
1
- import"core-js/modules/web.dom-collections.iterator.js";import React,{useRef,useState}from"react";import CSSTransition from"react-transition-group/CSSTransition";import{jsx as _jsx}from"react/jsx-runtime";const DropFade=a=>{let{children:b,show:c}=a;const d=useRef(null),[e,f]=useState(0),g=/*#__PURE__*/React.cloneElement(b);return/*#__PURE__*/_jsx(CSSTransition,{nodeRef:d,in:c,timeout:300,classNames:"np-dropfade",onEntering:()=>{var a;// Set height so we can animate to the correct height
2
- f((null===(a=d.current)||void 0===a?void 0:a.scrollHeight)||0)}// Un-set height, as we don't want to presume it should be that height forever
3
- ,onEntered:()=>f(void 0),onExit:()=>{var a;f((null===(a=d.current)||void 0===a?void 0:a.scrollHeight)||0)},onExiting:()=>{f(0)},children:/*#__PURE__*/_jsx("div",{ref:d,style:{height:e},className:"np-dropfade",children:g})})};export default DropFade;
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import React,{useRef,useState}from"react";import CSSTransition from"react-transition-group/CSSTransition";import{jsx as _jsx}from"react/jsx-runtime";var DropFade=function(a){var b=a.children,c=a.show,d=useRef(null),e=useState(0),f=_slicedToArray(e,2),g=f[0],h=f[1],i=/*#__PURE__*/React.cloneElement(b);return/*#__PURE__*/_jsx(CSSTransition,{nodeRef:d,in:c,timeout:300,classNames:"np-dropfade",onEntering:function onEntering(){var a;// Set height so we can animate to the correct height
2
+ h((null===(a=d.current)||void 0===a?void 0:a.scrollHeight)||0)}// Un-set height, as we don't want to presume it should be that height forever
3
+ ,onEntered:function onEntered(){return h(void 0)},onExit:function onExit(){var a;h((null===(a=d.current)||void 0===a?void 0:a.scrollHeight)||0)},onExiting:function onExiting(){h(0)},children:/*#__PURE__*/_jsx("div",{ref:d,style:{height:g},className:"np-dropfade",children:i})})};export default DropFade;
@@ -1 +1 @@
1
- import"core-js/modules/web.dom-collections.iterator.js";/* eslint-disable react/forbid-dom-props */import{action}from"@storybook/addon-actions";import{useState}from"react";import{Button,Nudge}from"..";import DropFade from"./DropFade";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{title:"Dialogs/DropFade",component:DropFade};export const Basic=()=>{const[a,b]=useState(!1);return/*#__PURE__*/_jsxs("div",{style:{margin:"0 auto",maxWidth:400},children:[/*#__PURE__*/_jsx(DropFade,{show:a,children:/*#__PURE__*/_jsx(Nudge,{media:/*#__PURE__*/_jsx("img",{alt:"",style:{width:44,height:44},src:"https://wise.com/public-resources/assets/public-navigation/saving.svg"}),mediaName:"globe",title:"Did you know it's cool to be Wise?",link:"Get Wise",href:"https://wise.com",onClick:action("action clicked"),onDismiss:()=>{action("dismissed"),b(!1)}})}),/*#__PURE__*/_jsx(Button,{className:"m-t-3",block:!0,onClick:()=>b(!0),children:"Some other content"})]})};
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";/* eslint-disable react/forbid-dom-props */import{action}from"@storybook/addon-actions";import{useState}from"react";import{Button,Nudge}from"..";import DropFade from"./DropFade";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{title:"Dialogs/DropFade",component:DropFade};export var Basic=function(){var a=useState(!1),b=_slicedToArray(a,2),c=b[0],d=b[1];return/*#__PURE__*/_jsxs("div",{style:{margin:"0 auto",maxWidth:400},children:[/*#__PURE__*/_jsx(DropFade,{show:c,children:/*#__PURE__*/_jsx(Nudge,{media:/*#__PURE__*/_jsx("img",{alt:"",style:{width:44,height:44},src:"https://wise.com/public-resources/assets/public-navigation/saving.svg"}),mediaName:"globe",title:"Did you know it's cool to be Wise?",link:"Get Wise",href:"https://wise.com",onClick:action("action clicked"),onDismiss:function onDismiss(){action("dismissed"),d(!1)}})}),/*#__PURE__*/_jsx(Button,{className:"m-t-3",block:!0,onClick:function onClick(){return d(!0)},children:"Some other content"})]})};
@@ -1 +1 @@
1
- import PropTypes from"prop-types";import{Typography,Layout}from"../common";import{prepFields}from"../common/requirements";import DefinitionList from"../definitionList";import Title from"../title";import createDefinitions from"./utils/createDefinitions";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const DynamicFieldDefinitionList=a=>{let{model:b,title:c,layout:d,fields:e}=a;return/*#__PURE__*/_jsxs(_Fragment,{children:[c&&/*#__PURE__*/_jsx("div",{className:"m-t-1 m-b-3",children:/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_BODY,className:"p-t-3",children:c})}),/*#__PURE__*/_jsx(DefinitionList,{layout:d,definitions:createDefinitions(prepFields(e),b)})]})};DynamicFieldDefinitionList.propTypes={model:PropTypes.shape({}).isRequired,fields:PropTypes.shape({}).isRequired,title:PropTypes.string,layout:PropTypes.oneOf(["VERTICAL_TWO_COLUMN","VERTICAL_ONE_COLUMN","HORIZONTAL_JUSTIFIED","HORIZONTAL_LEFT_ALIGNED"])},DynamicFieldDefinitionList.defaultProps={title:null,layout:Layout.VERTICAL_TWO_COLUMN};export default DynamicFieldDefinitionList;
1
+ import PropTypes from"prop-types";import{Typography,Layout}from"../common";import{prepFields}from"../common/requirements";import DefinitionList from"../definitionList";import Title from"../title";import createDefinitions from"./utils/createDefinitions";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 DynamicFieldDefinitionList=function(a){var b=a.model,c=a.title,d=a.layout,e=a.fields;return/*#__PURE__*/_jsxs(_Fragment,{children:[c&&/*#__PURE__*/_jsx("div",{className:"m-t-1 m-b-3",children:/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_BODY,className:"p-t-3",children:c})}),/*#__PURE__*/_jsx(DefinitionList,{layout:d,definitions:createDefinitions(prepFields(e),b)})]})};DynamicFieldDefinitionList.propTypes={model:PropTypes.shape({}).isRequired,fields:PropTypes.shape({}).isRequired,title:PropTypes.string,layout:PropTypes.oneOf(["VERTICAL_TWO_COLUMN","VERTICAL_ONE_COLUMN","HORIZONTAL_JUSTIFIED","HORIZONTAL_LEFT_ALIGNED"])},DynamicFieldDefinitionList.defaultProps={title:null,layout:Layout.VERTICAL_TWO_COLUMN};export default DynamicFieldDefinitionList;
@@ -1,8 +1,8 @@
1
- import"core-js/modules/web.dom-collections.iterator.js";import{formatDate,formatNumber}from"@transferwise/formatting";import classNames from"classnames";import PropTypes from"prop-types";import{useIntl}from"react-intl";import{formatUsingPattern}from"../utils/text-format";/**
1
+ import"core-js/modules/es.array.find.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.array.join.js";import"core-js/modules/es.array.iterator.js";import"core-js/modules/web.dom-collections.iterator.js";import{formatDate,formatNumber}from"@transferwise/formatting";import classNames from"classnames";import PropTypes from"prop-types";import{useIntl}from"react-intl";import{formatUsingPattern}from"../utils/text-format";/**
2
2
  *
3
3
  * @param {Array} options
4
4
  * @param {string|number} value
5
- */import{jsx as _jsx}from"react/jsx-runtime";const getValueLabel=(a,b)=>{const c=a.find(a=>a.value===b);return c&&c.label?c.label:b},mask=a=>Array(a.length+1).join("*"),FormattedValue=a=>{let{field:b,value:c}=a;const{locale:d}=useIntl(),e=[];switch(b.tagClassName&&b.tagClassName.h3&&(e.push("np-text-body-large-bold"),e.push("formatted-value__h3-custom-alignment")),b.control){case"select":case"radio":return/*#__PURE__*/_jsx("span",{children:getValueLabel(b.values,c)});case"date":return/*#__PURE__*/_jsx("span",{children:formatDate(c instanceof Date?c:new Date(c),d)});case"number":return/*#__PURE__*/_jsx("span",{children:formatNumber(c,d)});case"password":return/*#__PURE__*/_jsx("span",{children:mask(c)});case"file":return/*#__PURE__*/_jsx("div",{className:"thumbnail",children:/*#__PURE__*/_jsx("img",{alt:b.title,src:c})});case"checkbox":return/*#__PURE__*/_jsx("span",{children:JSON.stringify(c)});default:return/*#__PURE__*/_jsx("span",{className:classNames(e),children:formatUsingPattern(c,b.displayFormat)});}};/**
5
+ */import{jsx as _jsx}from"react/jsx-runtime";var getValueLabel=function(a,b){var c=a.find(function(a){return a.value===b});return c&&c.label?c.label:b},mask=function(a){return Array(a.length+1).join("*")},FormattedValue=function(a){var b=a.field,c=a.value,d=useIntl(),e=d.locale,f=[];switch(b.tagClassName&&b.tagClassName.h3&&(f.push("np-text-body-large-bold"),f.push("formatted-value__h3-custom-alignment")),b.control){case"select":case"radio":return/*#__PURE__*/_jsx("span",{children:getValueLabel(b.values,c)});case"date":return/*#__PURE__*/_jsx("span",{children:formatDate(c instanceof Date?c:new Date(c),e)});case"number":return/*#__PURE__*/_jsx("span",{children:formatNumber(c,e)});case"password":return/*#__PURE__*/_jsx("span",{children:mask(c)});case"file":return/*#__PURE__*/_jsx("div",{className:"thumbnail",children:/*#__PURE__*/_jsx("img",{alt:b.title,src:c})});case"checkbox":return/*#__PURE__*/_jsx("span",{children:JSON.stringify(c)});default:return/*#__PURE__*/_jsx("span",{className:classNames(f),children:formatUsingPattern(c,b.displayFormat)});}};/**
6
6
  *
7
7
  * @param {string} value
8
8
  */FormattedValue.propTypes={field:PropTypes.shape({control:PropTypes.string.isRequired,displayFormat:PropTypes.string,refreshRequirementsOnChange:PropTypes.bool,title:PropTypes.string.isRequired,type:PropTypes.string.isRequired,width:PropTypes.string,tagClassName:PropTypes.shape({h3:PropTypes.bool}),values:PropTypes.arrayOf(PropTypes.shape({value:PropTypes.any}))}).isRequired,value:PropTypes.any.isRequired};export default FormattedValue;
@@ -1,2 +1,2 @@
1
- import"core-js/modules/web.dom-collections.iterator.js";import toPairs from"lodash.topairs";import FormattedValue from"../FormattedValue";import{jsx as _jsx}from"react/jsx-runtime";export default function createDefinitions(a,b){return toPairs(a).map(a=>{let[c,d]=a;return createDefinition(c,d,b)}).filter(a=>!!a)}function createDefinition(a,b,c){const{title:d,group:e,hidden:f}=b;return!c[a]||f?null:{title:d,value:e?e.map((b,d)=>/*#__PURE__*/_jsx(FormattedValue,{// eslint-disable-line react/no-array-index-key
2
- field:b,value:c[a]},d)):/*#__PURE__*/_jsx(FormattedValue,{field:b,value:c[a]}),key:a}}
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.array.map.js";import toPairs from"lodash.topairs";import FormattedValue from"../FormattedValue";import{jsx as _jsx}from"react/jsx-runtime";export default function createDefinitions(a,b){return toPairs(a).map(function(a){var c=_slicedToArray(a,2),d=c[0],e=c[1];return createDefinition(d,e,b)}).filter(function(a){return!!a})}function createDefinition(a,b,c){var d=b.title,e=b.group,f=b.hidden;return!c[a]||f?null:{title:d,value:e?e.map(function(b,d){return/*#__PURE__*/_jsx(FormattedValue,{// eslint-disable-line react/no-array-index-key
2
+ field:b,value:c[a]},d)}):/*#__PURE__*/_jsx(FormattedValue,{field:b,value:c[a]}),key:a}}
@@ -1 +1 @@
1
- const formatUsingPattern=function(){let a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",b=1<arguments.length?arguments[1]:void 0;if("string"!=typeof b)return a;let c=b;0<c.indexOf("||")&&(c=c.slice(0,Math.max(0,b.indexOf("||"))));let d="",separators=0,e=a.length,f=0;for(;e;)positionIsSeparator(c,f)?(d+=c[f],separators+=1):(d+=a[f-separators],e-=1),f+=1;const g=countSeparatorsAfterCursor(c,f);return g&&(d+=c.slice(f,g)),d},countSeparatorsAfterCursor=(a,b)=>{let separators=0;for(;positionIsSeparator(a,b+separators);)separators+=1;return separators},positionIsSeparator=(a,b)=>a[b]&&"*"!==a[b];export{formatUsingPattern};
1
+ import"core-js/modules/es.array.slice.js";var formatUsingPattern=function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",b=1<arguments.length?arguments[1]:void 0;if("string"!=typeof b)return a;var c=b;0<c.indexOf("||")&&(c=c.slice(0,Math.max(0,b.indexOf("||"))));for(var d="",separators=0,e=a.length,f=0;e;)positionIsSeparator(c,f)?(d+=c[f],separators+=1):(d+=a[f-separators],e-=1),f+=1;var g=countSeparatorsAfterCursor(c,f);return g&&(d+=c.slice(f,g)),d},countSeparatorsAfterCursor=function(a,b){for(var separators=0;positionIsSeparator(a,b+separators);)separators+=1;return separators},positionIsSeparator=function(a,b){return a[b]&&"*"!==a[b]};export{formatUsingPattern};
@@ -1,2 +1,2 @@
1
- import EmphasisHtmlTransformer from"./EmphasisHtmlTransformer";import{jsx as _jsx}from"react/jsx-runtime";const SUPPORTED_TAGS=["important","positive","negative","warning"],emphasisHtmlTransformer=new EmphasisHtmlTransformer(SUPPORTED_TAGS),Emphasis=a=>{let{text:b=void 0}=a;if(!b)return null;const c=emphasisHtmlTransformer.transform(b);// eslint-disable-next-line react/no-danger
2
- return c?/*#__PURE__*/_jsx("span",{dangerouslySetInnerHTML:{__html:c}}):null};export default Emphasis;
1
+ import EmphasisHtmlTransformer from"./EmphasisHtmlTransformer";import{jsx as _jsx}from"react/jsx-runtime";var SUPPORTED_TAGS=["important","positive","negative","warning"],emphasisHtmlTransformer=new EmphasisHtmlTransformer(SUPPORTED_TAGS),Emphasis=function(a){var b=a.text,c=void 0===b?void 0:b;if(!c)return null;var d=emphasisHtmlTransformer.transform(c);// eslint-disable-next-line react/no-danger
2
+ return d?/*#__PURE__*/_jsx("span",{dangerouslySetInnerHTML:{__html:d}}):null};export default Emphasis;
@@ -1 +1 @@
1
- import Emphasis from"./Emphasis";export default{component:Emphasis,title:"Typography/Emphasis",tags:["autodocs"]};export const Basic={args:{text:"This is <important>important</important>.\\nThis is <positive>positive</positive>.\\nThis is <negative>negative</negative>.\\nThis is a <warning>warning</warning>.\\n<script>alert(\"nice try!\")</script>"}};
1
+ import Emphasis from"./Emphasis";export default{component:Emphasis,title:"Typography/Emphasis",tags:["autodocs"]};export var Basic={args:{text:"This is <important>important</important>.\\nThis is <positive>positive</positive>.\\nThis is <negative>negative</negative>.\\nThis is a <warning>warning</warning>.\\n<script>alert(\"nice try!\")</script>"}};