@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
@@ -2,9 +2,9 @@
2
2
  * The colors we support generating an Avatar background color from a "seed" for.
3
3
  * Changing this array will change the assignment between seeds.
4
4
  * Do not change this array.
5
- */const avatarColors=["--color-bright-blue","--color-bright-yellow","--color-bright-pink","--color-bright-orange"],hashSeed=a=>{const b=avatarColors.length;let c=0,d=1;for(let e=0;e<a.length;e++)c=(c+a.charCodeAt(e)*d)%b,d=d*31%b;return c};/*
5
+ */var avatarColors=["--color-bright-blue","--color-bright-yellow","--color-bright-pink","--color-bright-orange"],hashSeed=function(a){for(var b=avatarColors.length,c=0,d=1,e=0;e<a.length;e++)c=(c+a.charCodeAt(e)*d)%b,d=d*31%b;return c};/*
6
6
  * Takes in a "seed" string and spits out an index for the color we should use.
7
7
  * This implementation has been synced across all three clients so that we consistently
8
8
  * generate branded avatar colors when rendering a list of Avatars.
9
9
  * Do not change this implementation.
10
- */export const getAvatarColorFromSeed=a=>avatarColors[hashSeed(a)];
10
+ */export var getAvatarColorFromSeed=function(a){return avatarColors[hashSeed(a)]};
@@ -1 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["url","altText","statusIcon","children"];import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.regexp.to-string.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{Person as ProfileIcon,Briefcase as BriefcaseIcon}from"@transferwise/icons";import PropTypes from"prop-types";import{useState,useEffect}from"react";import Avatar,{AvatarType}from"../avatar";import Badge from"../badge";import{ProfileType,Size,Sentiment}from"../common";import StatusIcon from"../statusIcon/StatusIcon";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";const OptionalBadge=a=>{let{url:b,altText:c,statusIcon:d,children:e}=a,f=_objectWithoutProperties(a,_excluded);return b?/*#__PURE__*/_jsx(Badge,_objectSpread(_objectSpread({badge:/*#__PURE__*/_jsx("img",{src:b,alt:c})},f),{},{children:e})):d?/*#__PURE__*/_jsx(Badge,_objectSpread(_objectSpread({badge:/*#__PURE__*/_jsx(StatusIcon,{sentiment:d,size:Size.SMALL})},f),{},{children:e})):e};OptionalBadge.propTypes={url:PropTypes.string,altText:PropTypes.string,statusIcon:PropTypes.oneOf([Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING]),children:PropTypes.node.isRequired},OptionalBadge.defaultProps={url:void 0,altText:void 0,statusIcon:void 0};const AvatarWrapper=a=>{let{url:b,profileType:c,profileId:d,badgeUrl:e,badgeAltText:f,badgeStatusIcon:g,name:h,avatarProps:i,badgeProps:j}=a;const[k,l]=useState(!1),m=c===ProfileType.BUSINESS;useEffect(()=>l(!1),[b]);return/*#__PURE__*/_jsx(OptionalBadge,_objectSpread(_objectSpread({url:e,altText:f,statusIcon:g},j),{},{children:/*#__PURE__*/_jsx(Avatar,_objectSpread({size:Size.MEDIUM},(()=>b&&!k?_objectSpread({type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:b,alt:"avatar",onError:()=>l(!0)})},i):c?_objectSpread({type:AvatarType.ICON,children:m?/*#__PURE__*/_jsx(BriefcaseIcon,{size:"24"}):/*#__PURE__*/_jsx(ProfileIcon,{size:"24"})},i):h?_objectSpread({type:AvatarType.INITIALS,children:/*#__PURE__*/_jsx(_Fragment,{children:getInitials(h)}),backgroundColorSeed:null===d||void 0===d?void 0:d.toString()},i):_objectSpread({type:AvatarType.ICON,children:/*#__PURE__*/_jsx(ProfileIcon,{size:"24"})},i))()))}))};function getInitials(a){const b=a.split(" ").map(a=>a[0]).join("").toUpperCase();return 1===b.length?b[0]:b[0]+b.slice(-1)}AvatarWrapper.defaultProps={url:void 0,profileType:void 0,profileId:void 0,badgeUrl:void 0,badgeAltText:void 0,badgeStatusIcon:void 0,name:void 0,avatarProps:{},badgeProps:{}},AvatarWrapper.propTypes={url:PropTypes.string,profileType:PropTypes.oneOf([ProfileType.PERSONAL,ProfileType.BUSINESS]),profileId:PropTypes.number,badgeUrl:PropTypes.string,badgeAltText:PropTypes.string,badgeStatusIcon:PropTypes.oneOf([Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING]),name:PropTypes.string,avatarProps:PropTypes.shape({}),badgeProps:PropTypes.shape({})};export default AvatarWrapper;
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["url","altText","statusIcon","children"];import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";import"core-js/modules/es.function.name.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.regexp.to-string.js";import"core-js/modules/es.array.join.js";import"core-js/modules/es.array.map.js";import"core-js/modules/es.array.slice.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{Person as ProfileIcon,Briefcase as BriefcaseIcon}from"@transferwise/icons";import PropTypes from"prop-types";import{useState,useEffect}from"react";import Avatar,{AvatarType}from"../avatar";import Badge from"../badge";import{ProfileType,Size,Sentiment}from"../common";import StatusIcon from"../statusIcon/StatusIcon";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";var OptionalBadge=function(a){var b=a.url,c=a.altText,d=a.statusIcon,e=a.children,f=_objectWithoutProperties(a,_excluded);return b?/*#__PURE__*/_jsx(Badge,_objectSpread(_objectSpread({badge:/*#__PURE__*/_jsx("img",{src:b,alt:c})},f),{},{children:e})):d?/*#__PURE__*/_jsx(Badge,_objectSpread(_objectSpread({badge:/*#__PURE__*/_jsx(StatusIcon,{sentiment:d,size:Size.SMALL})},f),{},{children:e})):e};OptionalBadge.propTypes={url:PropTypes.string,altText:PropTypes.string,statusIcon:PropTypes.oneOf([Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING]),children:PropTypes.node.isRequired},OptionalBadge.defaultProps={url:void 0,altText:void 0,statusIcon:void 0};var AvatarWrapper=function(a){var b=a.url,c=a.profileType,d=a.profileId,e=a.badgeUrl,f=a.badgeAltText,g=a.badgeStatusIcon,h=a.name,i=a.avatarProps,j=a.badgeProps,k=useState(!1),l=_slicedToArray(k,2),m=l[0],n=l[1],o=c===ProfileType.BUSINESS;useEffect(function(){return n(!1)},[b]);return/*#__PURE__*/_jsx(OptionalBadge,_objectSpread(_objectSpread({url:e,altText:f,statusIcon:g},j),{},{children:/*#__PURE__*/_jsx(Avatar,_objectSpread({size:Size.MEDIUM},function getAvatarProps(){return b&&!m?_objectSpread({type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:b,alt:"avatar",onError:function onError(){return n(!0)}})},i):c?_objectSpread({type:AvatarType.ICON,children:o?/*#__PURE__*/_jsx(BriefcaseIcon,{size:"24"}):/*#__PURE__*/_jsx(ProfileIcon,{size:"24"})},i):h?_objectSpread({type:AvatarType.INITIALS,children:/*#__PURE__*/_jsx(_Fragment,{children:getInitials(h)}),backgroundColorSeed:null===d||void 0===d?void 0:d.toString()},i):_objectSpread({type:AvatarType.ICON,children:/*#__PURE__*/_jsx(ProfileIcon,{size:"24"})},i)}()))}))};function getInitials(a){var b=a.split(" ").map(function(a){return a[0]}).join("").toUpperCase();return 1===b.length?b[0]:b[0]+b.slice(-1)}AvatarWrapper.defaultProps={url:void 0,profileType:void 0,profileId:void 0,badgeUrl:void 0,badgeAltText:void 0,badgeStatusIcon:void 0,name:void 0,avatarProps:{},badgeProps:{}},AvatarWrapper.propTypes={url:PropTypes.string,profileType:PropTypes.oneOf([ProfileType.PERSONAL,ProfileType.BUSINESS]),profileId:PropTypes.number,badgeUrl:PropTypes.string,badgeAltText:PropTypes.string,badgeStatusIcon:PropTypes.oneOf([Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING]),name:PropTypes.string,avatarProps:PropTypes.shape({}),badgeProps:PropTypes.shape({})};export default AvatarWrapper;
@@ -1 +1 @@
1
- import{ProfileType,Sentiment}from"../common";import AvatarWrapper from"./AvatarWrapper";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:AvatarWrapper,title:"Content/AvatarWrapper",argTypes:{profileType:{type:{name:"enum",value:Object.keys(ProfileType)}},badgeStatusIcon:{type:{name:"enum",value:[Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING]}}},tags:["autodocs"]};export const WithBadgeUrl={args:{badgeUrl:"https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg",avatarProps:{outlined:!0}}};export const WithBadgeStatus={args:{profileType:ProfileType.BUSINESS,badgeStatusIcon:Sentiment.PENDING,avatarProps:{outlined:!1}}};export const All={args:{avatarProps:{outlined:!0}},render:a=>{const b=a.avatarProps;return/*#__PURE__*/_jsxs("div",{style:{maxWidth:"300px",display:"flex",justifyContent:"space-between"},children:[/*#__PURE__*/_jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx("b",{children:"No Badges"})})," ","Personal",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{profileType:ProfileType.PERSONAL,avatarProps:b})}),"Business",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{profileType:ProfileType.BUSINESS,avatarProps:b})}),"Avatar",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{url:"https://wise.com/web-art/assets/flags/jpy.svg",profileType:ProfileType.BUSINESS,avatarProps:b})}),"Initials",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{name:"A A",avatarProps:b})}),"Default",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{avatarProps:b})})]}),/*#__PURE__*/_jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx("b",{children:"Badges"})}),"Personal",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeUrl:"https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg",badgeAltText:"wise fast flag badge",profileType:ProfileType.PERSONAL,avatarProps:b})}),"Business",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.POSITIVE,profileType:ProfileType.BUSINESS,avatarProps:b})}),"Avatar",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.NEGATIVE,url:"https://wise.com/web-art/assets/flags/hrk.svg",profileType:ProfileType.BUSINESS,avatarProps:b})}),"Initials",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.NEUTRAL,name:"A A",avatarProps:b})}),"Default",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.PENDING,avatarProps:b})})]})]})}};
1
+ import"core-js/modules/es.object.keys.js";import{ProfileType,Sentiment}from"../common";import AvatarWrapper from"./AvatarWrapper";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:AvatarWrapper,title:"Content/AvatarWrapper",argTypes:{profileType:{type:{name:"enum",value:Object.keys(ProfileType)}},badgeStatusIcon:{type:{name:"enum",value:[Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING]}}},tags:["autodocs"]};export var WithBadgeUrl={args:{badgeUrl:"https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg",avatarProps:{outlined:!0}}};export var WithBadgeStatus={args:{profileType:ProfileType.BUSINESS,badgeStatusIcon:Sentiment.PENDING,avatarProps:{outlined:!1}}};export var All={args:{avatarProps:{outlined:!0}},render:function render(a){var b=a.avatarProps;return/*#__PURE__*/_jsxs("div",{style:{maxWidth:"300px",display:"flex",justifyContent:"space-between"},children:[/*#__PURE__*/_jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx("b",{children:"No Badges"})})," ","Personal",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{profileType:ProfileType.PERSONAL,avatarProps:b})}),"Business",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{profileType:ProfileType.BUSINESS,avatarProps:b})}),"Avatar",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{url:"https://wise.com/web-art/assets/flags/jpy.svg",profileType:ProfileType.BUSINESS,avatarProps:b})}),"Initials",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{name:"A A",avatarProps:b})}),"Default",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{avatarProps:b})})]}),/*#__PURE__*/_jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx("b",{children:"Badges"})}),"Personal",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeUrl:"https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg",badgeAltText:"wise fast flag badge",profileType:ProfileType.PERSONAL,avatarProps:b})}),"Business",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.POSITIVE,profileType:ProfileType.BUSINESS,avatarProps:b})}),"Avatar",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.NEGATIVE,url:"https://wise.com/web-art/assets/flags/hrk.svg",profileType:ProfileType.BUSINESS,avatarProps:b})}),"Initials",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.NEUTRAL,name:"A A",avatarProps:b})}),"Default",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.PENDING,avatarProps:b})})]})]})}};
@@ -1 +1 @@
1
- import classNames from"classnames";import{Size,Theme}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const Badge=a=>{let{badge:b,className:d=void 0,size:e=Size.SMALL,border:f=Theme.LIGHT,children:c}=a;const g=classNames("tw-badge",{["tw-badge-border-".concat(f)]:f,["tw-badge-".concat(e)]:e},d);return/*#__PURE__*/_jsxs("div",{className:g,children:[/*#__PURE__*/_jsx("div",{className:"tw-badge__children",children:c}),/*#__PURE__*/_jsx("div",{className:"tw-badge__content",children:b})]})};export default Badge;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import classNames from"classnames";import{Size,Theme}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Badge=function(a){var b,c=a.badge,d=a.className,e=void 0===d?void 0:d,f=a.size,g=void 0===f?Size.SMALL:f,h=a.border,i=void 0===h?Theme.LIGHT:h,j=a.children,k=classNames("tw-badge",(b={},_defineProperty(b,"tw-badge-border-".concat(i),i),_defineProperty(b,"tw-badge-".concat(g),g),b),e);return/*#__PURE__*/_jsxs("div",{className:k,children:[/*#__PURE__*/_jsx("div",{className:"tw-badge__children",children:j}),/*#__PURE__*/_jsx("div",{className:"tw-badge__content",children:c})]})};export default Badge;
@@ -1,3 +1,3 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["as","type","className"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"core-js/modules/web.dom-collections.iterator.js";import classNames from"classnames";import{forwardRef}from"react";import{Typography}from"../common/propsValues/typography";import{jsx as _jsx}from"react/jsx-runtime";const DEFAULT_TYPE=Typography.BODY_DEFAULT,bodyTypes=new Set([Typography.BODY_DEFAULT,Typography.BODY_DEFAULT_BOLD,Typography.BODY_LARGE,Typography.BODY_LARGE_BOLD]),Body=/*#__PURE__*/forwardRef(function(a,b){let{as:d="div",type:e=DEFAULT_TYPE,className:c}=a,f=_objectWithoutProperties(a,_excluded);const g=bodyTypes.has(e);return/*#__PURE__*/_jsx(d,_objectSpread(_objectSpread({},f),{},{// @ts-expect-error TODO: Remove when component could be rewritten with generics
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["as","type","className"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"core-js/modules/es.array.iterator.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.set.js";import"core-js/modules/es.string.iterator.js";import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";import classNames from"classnames";import{forwardRef}from"react";import{Typography}from"../common/propsValues/typography";import{jsx as _jsx}from"react/jsx-runtime";var DEFAULT_TYPE=Typography.BODY_DEFAULT,bodyTypes=new Set([Typography.BODY_DEFAULT,Typography.BODY_DEFAULT_BOLD,Typography.BODY_LARGE,Typography.BODY_LARGE_BOLD]),Body=/*#__PURE__*/forwardRef(function(a,b){var c=a.as,d=void 0===c?"div":c,e=a.type,f=void 0===e?DEFAULT_TYPE:e,g=a.className,h=_objectWithoutProperties(a,_excluded),i=bodyTypes.has(f);return/*#__PURE__*/_jsx(d,_objectSpread(_objectSpread({},h),{},{// @ts-expect-error TODO: Remove when component could be rewritten with generics
2
2
  // See: https://fettblog.eu/typescript-react-generic-forward-refs/
3
- ref:b,className:classNames("np-text-".concat(g?e:DEFAULT_TYPE),c)}))});export default Body;
3
+ ref:b,className:classNames("np-text-".concat(i?f:DEFAULT_TYPE),g)}))});export default Body;
@@ -1 +1 @@
1
- import{Typography}from"../common";import{render,screen}from"../test-utils";import Body from".";import{jsx as _jsx}from"react/jsx-runtime";describe("Body",()=>{it("testing default state",()=>{render(/*#__PURE__*/_jsx(Body,{children:"Test"}));const a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("DIV"),expect(a).toHaveClass("np-text-".concat(Typography.BODY_DEFAULT))}),it("enforces tag via `as` prop",()=>{render(/*#__PURE__*/_jsx(Body,{as:"p",children:"Test"}));const a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("P"),expect(a).toHaveClass("np-text-".concat(Typography.BODY_DEFAULT))}),it("supports native HTML attrs",()=>{render(/*#__PURE__*/_jsx(Body,{id:"test-id",role:"banner",children:"Test"}));const a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a).toHaveAttribute("id","test-id"),expect(a).toHaveAttribute("role","banner")}),it("handles unsupported typography type",()=>{render(/*#__PURE__*/_jsx(Body,{type:Typography.TITLE_SCREEN,children:"Test"}));const a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("DIV"),expect(a).toHaveClass("np-text-".concat(Typography.BODY_DEFAULT))})});
1
+ import{Typography}from"../common";import{render,screen}from"../test-utils";import Body from".";import{jsx as _jsx}from"react/jsx-runtime";describe("Body",function(){it("testing default state",function(){render(/*#__PURE__*/_jsx(Body,{children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("DIV"),expect(a).toHaveClass("np-text-".concat(Typography.BODY_DEFAULT))}),it("enforces tag via `as` prop",function(){render(/*#__PURE__*/_jsx(Body,{as:"p",children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("P"),expect(a).toHaveClass("np-text-".concat(Typography.BODY_DEFAULT))}),it("supports native HTML attrs",function(){render(/*#__PURE__*/_jsx(Body,{id:"test-id",role:"banner",children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a).toHaveAttribute("id","test-id"),expect(a).toHaveAttribute("role","banner")}),it("handles unsupported typography type",function(){render(/*#__PURE__*/_jsx(Body,{type:Typography.TITLE_SCREEN,children:"Test"}));var a=screen.getByText("Test");expect(a).toBeInTheDocument(),expect(a.tagName).toBe("DIV"),expect(a).toHaveClass("np-text-".concat(Typography.BODY_DEFAULT))})});
@@ -1 +1 @@
1
- import{Typography}from"../common/propsValues/typography";import Title from"../title";import Body from"./Body";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";export default{title:"Typography/Body",component:Body,tags:["autodocs"]};export const Basic=()=>/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,children:"Body Large Bold"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,children:"Body Default"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,children:"Body Default Bold"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,children:"Body Large"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs(Title,{type:Typography.TITLE_SUBSECTION,children:["Copy Example without ",/*#__PURE__*/_jsx("code",{children:"<Body />"})," component"]}),/*#__PURE__*/_jsx("p",{children:"Lorem ipsum dolor sit amet consectetur adipisicing elit. Explicabo saepe repellendus accusantium eveniet temporibus perspiciatis iure ut, pariatur nihil totam iusto, delectus, modi possimus soluta. Et iusto odio autem debitis!"}),/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,children:"Copy Example without any HTML tag"}),"Lorem ipsum dolor sit amet consectetur adipisicing elit. Explicabo saepe repellendus accusantium eveniet temporibus perspiciatis iure ut, pariatur nihil totam iusto, delectus, modi possimus soluta. Et iusto odio autem debitis!"]});
1
+ import{Typography}from"../common/propsValues/typography";import Title from"../title";import Body from"./Body";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";export default{title:"Typography/Body",component:Body,tags:["autodocs"]};export var Basic=function(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,children:"Body Large Bold"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE_BOLD,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,children:"Body Default"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,children:"Body Default Bold"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_DEFAULT_BOLD,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,children:"Body Large"}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["We\u2019re building the world's most ",/*#__PURE__*/_jsx("strong",{children:"international account"}),". We\u2019re building the world's most ",/*#__PURE__*/_jsx("b",{children:"international account"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 ",/*#__PURE__*/_jsx("strong",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),". \u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448"," ",/*#__PURE__*/_jsx("b",{children:"\u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456"}),"."]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("strong",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})," ","\u79C1\u305F\u3061\u306F\u4E16\u754C\u3067\u6700\u3082\u56FD\u969B\u7684\u306A\u30A2\u30AB\u30A6\u30F3",/*#__PURE__*/_jsx("b",{children:"\u30C8\u3092\u69CB\u7BC9\u3057\u3066\u3044\u307E\u3059"})]}),/*#__PURE__*/_jsxs(Body,{as:"p",type:Typography.BODY_LARGE,children:["Wir bauen den internationalen ",/*#__PURE__*/_jsx("strong",{children:"Bericht der Welt auf"}),". Wir bauen den internationalen ",/*#__PURE__*/_jsx("b",{children:"Bericht der Welt auf"}),"."]})]}),/*#__PURE__*/_jsxs(Title,{type:Typography.TITLE_SUBSECTION,children:["Copy Example without ",/*#__PURE__*/_jsx("code",{children:"<Body />"})," component"]}),/*#__PURE__*/_jsx("p",{children:"Lorem ipsum dolor sit amet consectetur adipisicing elit. Explicabo saepe repellendus accusantium eveniet temporibus perspiciatis iure ut, pariatur nihil totam iusto, delectus, modi possimus soluta. Et iusto odio autem debitis!"}),/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,children:"Copy Example without any HTML tag"}),"Lorem ipsum dolor sit amet consectetur adipisicing elit. Explicabo saepe repellendus accusantium eveniet temporibus perspiciatis iure ut, pariatur nihil totam iusto, delectus, modi possimus soluta. Et iusto odio autem debitis!"]})};
@@ -1,7 +1,7 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["as","block","children","className","disabled","loading","priority","size","type"],_excluded2=["htmlType"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import{forwardRef}from"react";import{Size,ControlType,Priority}from"../common";import{typeClassMap,priorityClassMap}from"./classMap";import{establishNewPriority,establishNewType,logDeprecationNotices}from"./legacyUtils";/** @deprecated */import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const Button=/*#__PURE__*/forwardRef((a,b)=>{var c;let{as:d,block:h=!1,children:e,className:f,disabled:g,loading:i=!1,priority:j=Priority.PRIMARY,size:k=Size.MEDIUM,type:l=ControlType.ACCENT}=a,m=_objectWithoutProperties(a,_excluded);logDeprecationNotices({size:k,type:l});// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
2
- const n=establishNewType(l),o=establishNewPriority(j,l),p=classNames("btn btn-".concat(k),"np-btn np-btn-".concat(k),{"btn-loading":i,"btn-block np-btn-block":h},{disabled:g||i},// @ts-expect-error fix when refactor `typeClassMap` to TypeScript
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["as","block","children","className","disabled","loading","priority","size","type"],_excluded2=["htmlType"];import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import{forwardRef}from"react";import{Size,ControlType,Priority}from"../common";import{typeClassMap,priorityClassMap}from"./classMap";import{establishNewPriority,establishNewType,logDeprecationNotices}from"./legacyUtils";/** @deprecated */import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Button=/*#__PURE__*/forwardRef(function(a,b){var c,d=a.as,e=a.block,f=void 0!==e&&e,g=a.children,h=a.className,i=a.disabled,j=a.loading,k=void 0!==j&&j,l=a.priority,m=void 0===l?Priority.PRIMARY:l,n=a.size,o=void 0===n?Size.MEDIUM:n,p=a.type,q=void 0===p?ControlType.ACCENT:p,r=_objectWithoutProperties(a,_excluded);logDeprecationNotices({size:o,type:q});// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
2
+ var s,t=establishNewType(q),u=establishNewPriority(m,q),v=classNames("btn btn-".concat(o),"np-btn np-btn-".concat(o),{"btn-loading":k,"btn-block np-btn-block":f},{disabled:i||k},// @ts-expect-error fix when refactor `typeClassMap` to TypeScript
3
3
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
4
- typeClassMap[n],// @ts-expect-error fix when refactor `typeClassMap` to TypeScript
4
+ typeClassMap[t],// @ts-expect-error fix when refactor `typeClassMap` to TypeScript
5
5
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
6
- priorityClassMap[o],f),q=null!==(c=d)&&void 0!==c?c:"button";// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
7
- let r;if("button"===q){const a=m,{htmlType:b="button"}=a,c=_objectWithoutProperties(a,_excluded2);r=_objectSpread(_objectSpread({},c),{},{disabled:g||i,type:b})}else r=_objectSpread({},m);return/*#__PURE__*/_jsxs(q,_objectSpread(_objectSpread({ref:b,className:p},r),{},{children:[e,i&&/*#__PURE__*/_jsx("span",{className:classNames("btn-loader",{"m-l-2":!h})})]}))});export default Button;
6
+ priorityClassMap[u],h),w=null!==(c=d)&&void 0!==c?c:"button";// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
7
+ if("button"===w){var x=r,y=x.htmlType,z=void 0===y?"button":y,A=_objectWithoutProperties(x,_excluded2);s=_objectSpread(_objectSpread({},A),{},{disabled:i||k,type:z})}else s=_objectSpread({},r);return/*#__PURE__*/_jsxs(w,_objectSpread(_objectSpread({ref:b,className:v},s),{},{children:[g,k&&/*#__PURE__*/_jsx("span",{className:classNames("btn-loader",{"m-l-2":!f})})]}))});export default Button;
@@ -1 +1 @@
1
- import _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{userEvent,within}from"@storybook/testing-library";import{ControlType,Priority}from"../common";import{storyConfig}from"../test-utils";import Button from"./Button";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";export default{component:Button,title:"Actions/Button",args:{children:"Button text"},argTypes:{as:{type:{name:"enum",value:["button","a"]}}},tags:["autodocs"]};export const Basic={};export const Focused=storyConfig({parameters:{chromatic:{delay:1e3}},play:a=>{let{canvasElement:b}=a;const c=within(b);userEvent.click(c.getByRole("button"))}},{variants:["dark"]});export const Variants=storyConfig({args:{className:"m-r-2"},render:a=>/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs("div",{className:"m-b-2",children:[/*#__PURE__*/_jsx("div",{className:"title-4 m-b-1",children:"Accent"}),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.PRIMARY,type:ControlType.ACCENT})),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.SECONDARY,type:ControlType.ACCENT})),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.TERTIARY,type:ControlType.ACCENT}))]}),/*#__PURE__*/_jsxs("div",{className:"m-b-2",children:[/*#__PURE__*/_jsx("div",{className:"title-4 m-b-1",children:"Positive"}),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.PRIMARY,type:ControlType.POSITIVE})),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.SECONDARY,type:ControlType.POSITIVE}))]}),/*#__PURE__*/_jsxs("div",{className:"m-b-2",children:[/*#__PURE__*/_jsx("div",{className:"title-4 m-b-1",children:"Negative"}),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.PRIMARY,type:ControlType.NEGATIVE})),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.SECONDARY,type:ControlType.NEGATIVE}))]}),/*#__PURE__*/_jsxs("div",{className:"m-b-2",children:[/*#__PURE__*/_jsx("div",{className:"title-4 m-b-1",children:"Disabled"}),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.PRIMARY,disabled:!0})),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.SECONDARY,disabled:!0})),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.TERTIARY,disabled:!0}))]})]})},{variants:["default","dark","rtl"]});export const SocialMedia=storyConfig({render:()=>/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("div",{className:"m-b-2",children:/*#__PURE__*/_jsx("button",{type:"button",className:"btn btn-google",children:"Login with Google"})}),/*#__PURE__*/_jsx("div",{className:"m-b-2",children:/*#__PURE__*/_jsx("button",{type:"button",className:"btn btn-facebook",children:"Login with Facebook"})})]})},{variants:["default","dark","rtl"]});export const SocialMediaMobile=storyConfig(SocialMedia,{variants:["default","dark","rtl","mobile"]});
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{userEvent,within}from"@storybook/testing-library";import{ControlType,Priority}from"../common";import{storyConfig}from"../test-utils";import Button from"./Button";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";export default{component:Button,title:"Actions/Button",args:{children:"Button text"},argTypes:{as:{type:{name:"enum",value:["button","a"]}}},tags:["autodocs"]};export var Basic={};export var Focused=storyConfig({parameters:{chromatic:{delay:1e3}},play:function play(a){var b=a.canvasElement,c=within(b);userEvent.click(c.getByRole("button"))}},{variants:["dark"]});export var Variants=storyConfig({args:{className:"m-r-2"},render:function render(a){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs("div",{className:"m-b-2",children:[/*#__PURE__*/_jsx("div",{className:"title-4 m-b-1",children:"Accent"}),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.PRIMARY,type:ControlType.ACCENT})),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.SECONDARY,type:ControlType.ACCENT})),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.TERTIARY,type:ControlType.ACCENT}))]}),/*#__PURE__*/_jsxs("div",{className:"m-b-2",children:[/*#__PURE__*/_jsx("div",{className:"title-4 m-b-1",children:"Positive"}),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.PRIMARY,type:ControlType.POSITIVE})),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.SECONDARY,type:ControlType.POSITIVE}))]}),/*#__PURE__*/_jsxs("div",{className:"m-b-2",children:[/*#__PURE__*/_jsx("div",{className:"title-4 m-b-1",children:"Negative"}),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.PRIMARY,type:ControlType.NEGATIVE})),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.SECONDARY,type:ControlType.NEGATIVE}))]}),/*#__PURE__*/_jsxs("div",{className:"m-b-2",children:[/*#__PURE__*/_jsx("div",{className:"title-4 m-b-1",children:"Disabled"}),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.PRIMARY,disabled:!0})),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.SECONDARY,disabled:!0})),/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({},a),{},{priority:Priority.TERTIARY,disabled:!0}))]})]})}},{variants:["default","dark","rtl"]});export var SocialMedia=storyConfig({render:function render(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("div",{className:"m-b-2",children:/*#__PURE__*/_jsx("button",{type:"button",className:"btn btn-google",children:"Login with Google"})}),/*#__PURE__*/_jsx("div",{className:"m-b-2",children:/*#__PURE__*/_jsx("button",{type:"button",className:"btn btn-facebook",children:"Login with Facebook"})})]})}},{variants:["default","dark","rtl"]});export var SocialMediaMobile=storyConfig(SocialMedia,{variants:["default","dark","rtl","mobile"]});
@@ -1 +1 @@
1
- import{ControlType,Priority}from"../common";export const typeClassMap={[ControlType.ACCENT]:"btn-accent",[ControlType.POSITIVE]:"btn-positive",[ControlType.NEGATIVE]:"btn-negative"};export const priorityClassMap={[Priority.PRIMARY]:"btn-priority-1",[Priority.SECONDARY]:"btn-priority-2",[Priority.TERTIARY]:"btn-priority-3"};
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";var _typeClassMap,_priorityClassMap;import{ControlType,Priority}from"../common";export var typeClassMap=(_typeClassMap={},_defineProperty(_typeClassMap,ControlType.ACCENT,"btn-accent"),_defineProperty(_typeClassMap,ControlType.POSITIVE,"btn-positive"),_defineProperty(_typeClassMap,ControlType.NEGATIVE,"btn-negative"),_typeClassMap);export var priorityClassMap=(_priorityClassMap={},_defineProperty(_priorityClassMap,Priority.PRIMARY,"btn-priority-1"),_defineProperty(_priorityClassMap,Priority.SECONDARY,"btn-priority-2"),_defineProperty(_priorityClassMap,Priority.TERTIARY,"btn-priority-3"),_priorityClassMap);
@@ -1,4 +1,4 @@
1
- import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import{ControlType,Priority,Size,Type}from"../../common";import{logActionRequiredIf}from"../../utilities";const deprecatedTypeMap={[Type.PRIMARY]:ControlType.ACCENT,[Type.SECONDARY]:ControlType.ACCENT,[Type.LINK]:ControlType.ACCENT,[Type.PAY]:ControlType.POSITIVE,[Type.DANGER]:ControlType.NEGATIVE},oldTypePriorityMap={[Type.DANGER]:Priority.SECONDARY,[Type.LINK]:Priority.TERTIARY,[Type.SECONDARY]:Priority.SECONDARY},deprecatedTypeMapMessage={[Type.DANGER]:"Type.NEGATIVE",[Type.LINK]:"ControlType.ACCENT with priority Priority.TERTIARY",[Type.PAY]:"ControlType.POSITIVE",[Type.PRIMARY]:"ControlType.ACCENT",[Type.SECONDARY]:"ControlType.ACCENT with priority Priority.SECONDARY"},deprecatedTypes=Object.keys(deprecatedTypeMap);export const establishNewType=a=>deprecatedTypeMap[a]||a;export const establishNewPriority=(a,b)=>{const c=establishNewType(b);// The old SECONDARY and LINK types now map to priorities. If they're still using one of
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";var _deprecatedTypeMap,_oldTypePriorityMap,_deprecatedTypeMapMes;import"core-js/modules/es.object.keys.js";import"core-js/modules/es.array.concat.js";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import{ControlType,Priority,Size,Type}from"../../common";import{logActionRequiredIf}from"../../utilities";var deprecatedTypeMap=(_deprecatedTypeMap={},_defineProperty(_deprecatedTypeMap,Type.PRIMARY,ControlType.ACCENT),_defineProperty(_deprecatedTypeMap,Type.SECONDARY,ControlType.ACCENT),_defineProperty(_deprecatedTypeMap,Type.LINK,ControlType.ACCENT),_defineProperty(_deprecatedTypeMap,Type.PAY,ControlType.POSITIVE),_defineProperty(_deprecatedTypeMap,Type.DANGER,ControlType.NEGATIVE),_deprecatedTypeMap),oldTypePriorityMap=(_oldTypePriorityMap={},_defineProperty(_oldTypePriorityMap,Type.DANGER,Priority.SECONDARY),_defineProperty(_oldTypePriorityMap,Type.LINK,Priority.TERTIARY),_defineProperty(_oldTypePriorityMap,Type.SECONDARY,Priority.SECONDARY),_oldTypePriorityMap),deprecatedTypeMapMessage=(_deprecatedTypeMapMes={},_defineProperty(_deprecatedTypeMapMes,Type.DANGER,"Type.NEGATIVE"),_defineProperty(_deprecatedTypeMapMes,Type.LINK,"ControlType.ACCENT with priority Priority.TERTIARY"),_defineProperty(_deprecatedTypeMapMes,Type.PAY,"ControlType.POSITIVE"),_defineProperty(_deprecatedTypeMapMes,Type.PRIMARY,"ControlType.ACCENT"),_defineProperty(_deprecatedTypeMapMes,Type.SECONDARY,"ControlType.ACCENT with priority Priority.SECONDARY"),_deprecatedTypeMapMes),deprecatedTypes=Object.keys(deprecatedTypeMap);export var establishNewType=function(a){return deprecatedTypeMap[a]||a};export var establishNewPriority=function(a,b){var c=establishNewType(b);// The old SECONDARY and LINK types now map to priorities. If they're still using one of
2
2
  // these old types, ignore whatever priority they've passed and use this instead.
3
3
  return oldTypePriorityMap[b]?oldTypePriorityMap[b]:a===Priority.TERTIARY&&c!==ControlType.ACCENT?Priority.SECONDARY:a;// Only ControlType.ACCENT supports tertiary styles
4
- };export const logDeprecationNotices=a=>{let{size:b,type:c}=a;logActionRequiredIf("Button has deprecated the `Size.EXTRA_SMALL` value for the `size` prop. Please use Size.SMALL instead.",b===Size.EXTRA_SMALL),logActionRequiredIf("Button has deprecated the ".concat(c," value for the `type` prop. Please update to ").concat(deprecatedTypeMapMessage[c],"."),deprecatedTypes.includes(c))};
4
+ };export var logDeprecationNotices=function(a){var b=a.size,c=a.type;logActionRequiredIf("Button has deprecated the `Size.EXTRA_SMALL` value for the `size` prop. Please use Size.SMALL instead.",b===Size.EXTRA_SMALL),logActionRequiredIf("Button has deprecated the ".concat(c," value for the `type` prop. Please update to ").concat(deprecatedTypeMapMessage[c],"."),deprecatedTypes.includes(c))};
@@ -1 +1 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["aria-label","as","isExpanded","title","details","children","onClick","icon","id","className"];import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef}from"react";import requiredIf from"react-required-if";import Body from"../body";import Chevron from"../chevron";import{Position,Typography}from"../common";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const Card=/*#__PURE__*/forwardRef((a,b)=>{const{"aria-label":c,as:d,isExpanded:e,title:f,details:g,children:h,onClick:i,icon:j,id:k,className:l}=a,m=_objectWithoutProperties(a,_excluded),n=!!(e&&h);return/*#__PURE__*/_jsxs(d,{ref:b,className:classNames("np-card",l,{"np-card--expanded":n,"np-card--inactive":!h,"np-card--has-icon":!!j}),id:k,"data-testid":m["data-testid"],children:[/*#__PURE__*/_jsx(Option,{"aria-label":c,as:h?"button":"div",className:classNames("np-card__button"),media:j,title:f,content:g,showMediaAtAllSizes:!0,button:h&&/*#__PURE__*/_jsx(Chevron,{orientation:n?Position.TOP:Position.BOTTOM}),onClick:()=>h&&i(!e)}),/*#__PURE__*/_jsx("div",{className:classNames("np-card__divider",{"np-card__divider--expanded":n})}),n&&/*#__PURE__*/_jsx(Body,{as:"span",type:Typography.BODY_LARGE,className:"np-card__content d-block",children:h})]})}),hasChildren=a=>{let{children:b}=a;return b};Card.propTypes={"aria-label":PropTypes.string,as:PropTypes.string,isExpanded:requiredIf(PropTypes.bool,hasChildren),title:PropTypes.node.isRequired,details:PropTypes.node.isRequired,onClick:requiredIf(PropTypes.func,hasChildren),icon:PropTypes.node,children:PropTypes.node,id:PropTypes.string,className:PropTypes.string,"data-testid":PropTypes.string},Card.defaultProps={"aria-label":void 0,as:"div",children:null,id:null,className:null,"data-testid":null};export default Card;
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["aria-label","as","isExpanded","title","details","children","onClick","icon","id","className"];import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef}from"react";import requiredIf from"react-required-if";import Body from"../body";import Chevron from"../chevron";import{Position,Typography}from"../common";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Card=/*#__PURE__*/forwardRef(function(a,b){var c=a["aria-label"],d=a.as,e=a.isExpanded,f=a.title,g=a.details,h=a.children,i=a.onClick,j=a.icon,k=a.id,l=a.className,m=_objectWithoutProperties(a,_excluded),n=!!(e&&h);return/*#__PURE__*/_jsxs(d,{ref:b,className:classNames("np-card",l,{"np-card--expanded":n,"np-card--inactive":!h,"np-card--has-icon":!!j}),id:k,"data-testid":m["data-testid"],children:[/*#__PURE__*/_jsx(Option,{"aria-label":c,as:h?"button":"div",className:classNames("np-card__button"),media:j,title:f,content:g,showMediaAtAllSizes:!0,button:h&&/*#__PURE__*/_jsx(Chevron,{orientation:n?Position.TOP:Position.BOTTOM}),onClick:function onClick(){return h&&i(!e)}}),/*#__PURE__*/_jsx("div",{className:classNames("np-card__divider",{"np-card__divider--expanded":n})}),n&&/*#__PURE__*/_jsx(Body,{as:"span",type:Typography.BODY_LARGE,className:"np-card__content d-block",children:h})]})}),hasChildren=function(a){var b=a.children;return b};Card.propTypes={"aria-label":PropTypes.string,as:PropTypes.string,isExpanded:requiredIf(PropTypes.bool,hasChildren),title:PropTypes.node.isRequired,details:PropTypes.node.isRequired,onClick:requiredIf(PropTypes.func,hasChildren),icon:PropTypes.node,children:PropTypes.node,id:PropTypes.string,className:PropTypes.string,"data-testid":PropTypes.string},Card.defaultProps={"aria-label":void 0,as:"div",children:null,id:null,className:null,"data-testid":null};export default Card;
@@ -1 +1 @@
1
- import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import Body from"../body/Body";import CheckboxButton from"../checkboxButton";import{Typography}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const Checkbox=a=>{let{id:b,checked:c,required:d,disabled:e,readOnly:f,label:g,className:h,secondary:i,onChange:j,onFocus:k,onBlur:l}=a;const{isModern:m}=useTheme(),n=classNames("np-checkbox",{checkbox:!0,"checkbox-lg":i,disabled:m&&e},h),o=e||f;return/*#__PURE__*/_jsx("div",{id:b,className:n,children:/*#__PURE__*/_jsxs("label",{className:classNames({disabled:e}),children:[/*#__PURE__*/_jsx(CheckboxButton,{className:"p-r-2",checked:c,disabled:o,required:!o&&d,onFocus:k,onChange:()=>j(!c),onBlur:l}),/*#__PURE__*/_jsxs(Body,{as:"span",className:"np-checkbox__text",type:i?Typography.BODY_LARGE_BOLD:Typography.BODY_LARGE,children:[/*#__PURE__*/_jsx("span",{className:d?"has-required":void 0,children:g}),i&&/*#__PURE__*/_jsx(Body,{as:"span",className:classNames({secondary:!m}),children:i})]})]})})};Checkbox.propTypes={id:PropTypes.string,checked:PropTypes.bool,required:PropTypes.bool,disabled:PropTypes.bool,readOnly:PropTypes.bool,label:PropTypes.node.isRequired,secondary:PropTypes.string,onFocus:PropTypes.func,onChange:PropTypes.func.isRequired,onBlur:PropTypes.func,className:PropTypes.string},Checkbox.defaultProps={id:null,checked:!1,required:!1,disabled:!1,readOnly:!1,secondary:null,onFocus:null,onBlur:null,className:void 0};export default Checkbox;
1
+ import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import Body from"../body/Body";import CheckboxButton from"../checkboxButton";import{Typography}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Checkbox=function(a){var b=a.id,c=a.checked,d=a.required,e=a.disabled,f=a.readOnly,g=a.label,h=a.className,i=a.secondary,j=a.onChange,k=a.onFocus,l=a.onBlur,m=useTheme(),n=m.isModern,o=classNames("np-checkbox",{checkbox:!0,"checkbox-lg":i,disabled:n&&e},h),p=e||f;return/*#__PURE__*/_jsx("div",{id:b,className:o,children:/*#__PURE__*/_jsxs("label",{className:classNames({disabled:e}),children:[/*#__PURE__*/_jsx(CheckboxButton,{className:"p-r-2",checked:c,disabled:p,required:!p&&d,onFocus:k,onChange:function onChange(){return j(!c)},onBlur:l}),/*#__PURE__*/_jsxs(Body,{as:"span",className:"np-checkbox__text",type:i?Typography.BODY_LARGE_BOLD:Typography.BODY_LARGE,children:[/*#__PURE__*/_jsx("span",{className:d?"has-required":void 0,children:g}),i&&/*#__PURE__*/_jsx(Body,{as:"span",className:classNames({secondary:!n}),children:i})]})]})})};Checkbox.propTypes={id:PropTypes.string,checked:PropTypes.bool,required:PropTypes.bool,disabled:PropTypes.bool,readOnly:PropTypes.bool,label:PropTypes.node.isRequired,secondary:PropTypes.string,onFocus:PropTypes.func,onChange:PropTypes.func.isRequired,onBlur:PropTypes.func,className:PropTypes.string},Checkbox.defaultProps={id:null,checked:!1,required:!1,disabled:!1,readOnly:!1,secondary:null,onFocus:null,onBlur:null,className:void 0};export default Checkbox;
@@ -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{lorem10,storyConfig}from"../test-utils";import Checkbox from"./Checkbox";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:Checkbox,title:"Forms/Checkbox",args:{label:"This is the label"},tags:["autodocs"]};export const Basic={};export const Multiple=storyConfig({render:a=>/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Checkbox,_objectSpread({},a)),/*#__PURE__*/_jsx(Checkbox,_objectSpread(_objectSpread({},a),{},{checked:!0})),/*#__PURE__*/_jsx(Checkbox,_objectSpread(_objectSpread({},a),{},{label:lorem10})),/*#__PURE__*/_jsx(Checkbox,_objectSpread(_objectSpread({},a),{},{label:lorem10,secondary:lorem10})),/*#__PURE__*/_jsx(Checkbox,_objectSpread(_objectSpread({},a),{},{disabled:!0}))]})},{variants:["default","dark","rtl"]});export const MultipleMobile=storyConfig(Multiple,{variants:["default","dark","rtl","mobile"]});
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{lorem10,storyConfig}from"../test-utils";import Checkbox from"./Checkbox";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:Checkbox,title:"Forms/Checkbox",args:{label:"This is the label"},tags:["autodocs"]};export var Basic={};export var Multiple=storyConfig({render:function render(a){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Checkbox,_objectSpread({},a)),/*#__PURE__*/_jsx(Checkbox,_objectSpread(_objectSpread({},a),{},{checked:!0})),/*#__PURE__*/_jsx(Checkbox,_objectSpread(_objectSpread({},a),{},{label:lorem10})),/*#__PURE__*/_jsx(Checkbox,_objectSpread(_objectSpread({},a),{},{label:lorem10,secondary:lorem10})),/*#__PURE__*/_jsx(Checkbox,_objectSpread(_objectSpread({},a),{},{disabled:!0}))]})}},{variants:["default","dark","rtl"]});export var MultipleMobile=storyConfig(Multiple,{variants:["default","dark","rtl","mobile"]});
@@ -1 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["checked","className","disabled","onChange"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import{forwardRef}from"react";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const CheckboxButton=/*#__PURE__*/forwardRef((a,b)=>{let{checked:c,className:d,disabled:e,onChange:f}=a,g=_objectWithoutProperties(a,_excluded);return/*#__PURE__*/_jsxs("span",{className:classNames("np-checkbox-button",d,e&&"disabled"),children:[/*#__PURE__*/_jsx("input",_objectSpread(_objectSpread({},g),{},{ref:b,type:"checkbox",disabled:e,checked:c,onChange:f})),/*#__PURE__*/_jsx("span",{className:"tw-checkbox-button",children:/*#__PURE__*/_jsx("span",{className:"tw-checkbox-check"})})]})});export default CheckboxButton;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["checked","className","disabled","onChange"];import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import{forwardRef}from"react";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var CheckboxButton=/*#__PURE__*/forwardRef(function(a,b){var c=a.checked,d=a.className,e=a.disabled,f=a.onChange,g=_objectWithoutProperties(a,_excluded);return/*#__PURE__*/_jsxs("span",{className:classNames("np-checkbox-button",d,e&&"disabled"),children:[/*#__PURE__*/_jsx("input",_objectSpread(_objectSpread({},g),{},{ref:b,type:"checkbox",disabled:e,checked:c,onChange:f})),/*#__PURE__*/_jsx("span",{className:"tw-checkbox-button",children:/*#__PURE__*/_jsx("span",{className:"tw-checkbox-check"})})]})});export default CheckboxButton;
@@ -1 +1 @@
1
- /* eslint-disable jest/expect-expect */ /* eslint-disable testing-library/no-render-in-setup */import"@testing-library/jest-dom";import{render,fireEvent,screen}from"../test-utils";import CheckboxButton from".";import{jsx as _jsx}from"react/jsx-runtime";describe("Checkbox button",()=>{describe("by default",()=>{render(/*#__PURE__*/_jsx(CheckboxButton,{onChange:jest.fn()}));const a=screen.getByRole("checkbox");it("is not checked",()=>expect(a).not.toBeChecked()),it("is not disabled",()=>expect(a).toBeEnabled())}),it("applies aria-label if provided",()=>{render(/*#__PURE__*/_jsx(CheckboxButton,{"aria-label":"An aria label",onChange:jest.fn()})),expect(screen.getByRole("checkbox",{name:"An aria label"})).toBeInTheDocument()}),it("is checked when checked prop is true",()=>{render(/*#__PURE__*/_jsx(CheckboxButton,{checked:!0,onChange:jest.fn()})),expect(screen.getByRole("checkbox")).toBeChecked()}),it("is disabled when disabled prop is true",()=>{render(/*#__PURE__*/_jsx(CheckboxButton,{disabled:!0,onChange:jest.fn()}));const a=screen.getByRole("checkbox");expect(a).toBeDisabled()}),it("calls onChange handler on change",()=>{const a=jest.fn();render(/*#__PURE__*/_jsx(CheckboxButton,{onChange:a}));const b=screen.getByRole("checkbox");expect(a).not.toHaveBeenCalled(),fireEvent.click(b),expect(a).toHaveBeenCalledTimes(1)})});
1
+ /* eslint-disable jest/expect-expect */ /* eslint-disable testing-library/no-render-in-setup */import"@testing-library/jest-dom";import{render,fireEvent,screen}from"../test-utils";import CheckboxButton from".";import{jsx as _jsx}from"react/jsx-runtime";describe("Checkbox button",function(){describe("by default",function(){render(/*#__PURE__*/_jsx(CheckboxButton,{onChange:jest.fn()}));var a=screen.getByRole("checkbox");it("is not checked",function(){return expect(a).not.toBeChecked()}),it("is not disabled",function(){return expect(a).toBeEnabled()})}),it("applies aria-label if provided",function(){render(/*#__PURE__*/_jsx(CheckboxButton,{"aria-label":"An aria label",onChange:jest.fn()})),expect(screen.getByRole("checkbox",{name:"An aria label"})).toBeInTheDocument()}),it("is checked when checked prop is true",function(){render(/*#__PURE__*/_jsx(CheckboxButton,{checked:!0,onChange:jest.fn()})),expect(screen.getByRole("checkbox")).toBeChecked()}),it("is disabled when disabled prop is true",function(){render(/*#__PURE__*/_jsx(CheckboxButton,{disabled:!0,onChange:jest.fn()}));var a=screen.getByRole("checkbox");expect(a).toBeDisabled()}),it("calls onChange handler on change",function(){var a=jest.fn();render(/*#__PURE__*/_jsx(CheckboxButton,{onChange:a}));var b=screen.getByRole("checkbox");expect(a).not.toHaveBeenCalled(),fireEvent.click(b),expect(a).toHaveBeenCalledTimes(1)})});
@@ -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 CheckboxButton from"./CheckboxButton";import{jsx as _jsx}from"react/jsx-runtime";export default{component:CheckboxButton,title:"Actions/CheckboxButton",tags:["autodocs"],args:{onBlur:action("blur"),onClick:action("click"),onFocus:action("focus")}};export const Basic={args:{"aria-label":"Toggle email updates",disabled:!1},render:a=>{// eslint-disable-next-line react-hooks/rules-of-hooks
2
- const[b,c]=useState(!0);return/*#__PURE__*/_jsx(CheckboxButton,_objectSpread(_objectSpread({},a),{},{checked:b,onChange:()=>c(!b)}))}};
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 CheckboxButton from"./CheckboxButton";import{jsx as _jsx}from"react/jsx-runtime";export default{component:CheckboxButton,title:"Actions/CheckboxButton",tags:["autodocs"],args:{onBlur:action("blur"),onClick:action("click"),onFocus:action("focus")}};export var Basic={args:{"aria-label":"Toggle email updates",disabled:!1},render:function render(a){// eslint-disable-next-line react-hooks/rules-of-hooks
2
+ var b=useState(!0),c=_slicedToArray(b,2),d=c[0],e=c[1];return/*#__PURE__*/_jsx(CheckboxButton,_objectSpread(_objectSpread({},a),{},{checked:d,onChange:function onChange(){return e(!d)}}))}};
@@ -1 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["checked","disabled","onChange"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{forwardRef}from"react";import CheckboxButton from"../checkboxButton";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";const CheckboxOption=/*#__PURE__*/forwardRef((a,b)=>{let{checked:c,disabled:d,onChange:e}=a,f=_objectWithoutProperties(a,_excluded);return/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},f),{},{ref:b,disabled:d,button:/*#__PURE__*/_jsx(CheckboxButton,{checked:c,disabled:d,onChange:()=>e(!c)})}))});export default CheckboxOption;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["checked","disabled","onChange"];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{forwardRef}from"react";import CheckboxButton from"../checkboxButton";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";var CheckboxOption=/*#__PURE__*/forwardRef(function(a,b){var c=a.checked,d=a.disabled,e=a.onChange,f=_objectWithoutProperties(a,_excluded);return/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},f),{},{ref:b,disabled:d,button:/*#__PURE__*/_jsx(CheckboxButton,{checked:c,disabled:d,onChange:function onChange(){return e(!c)}})}))});export default CheckboxOption;
@@ -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}/* eslint-disable jest/expect-expect */import"@testing-library/jest-dom";import{render,fireEvent,screen}from"../test-utils";import CheckboxOption from".";import{jsx as _jsx}from"react/jsx-runtime";describe("Checkbox option",()=>{const a={id:"id",name:"name",title:"Title",onChange:jest.fn(),"aria-label":"test-label"};describe("by default",()=>{render(/*#__PURE__*/_jsx(CheckboxOption,_objectSpread({},a)));const b=screen.getByRole("checkbox");it("is not checked",()=>{expect(b).not.toBeChecked()}),it("is not disabled",()=>{expect(b).toBeEnabled()})}),it("has `aria-label` attr",()=>{render(/*#__PURE__*/_jsx(CheckboxOption,_objectSpread({},a)));const b=screen.getByLabelText("test-label");expect(b).toBeInTheDocument()}),it("is checked when checked prop is true",()=>{render(/*#__PURE__*/_jsx(CheckboxOption,_objectSpread(_objectSpread({},a),{},{checked:!0}))),expect(screen.getByRole("checkbox")).toBeChecked()}),it("is disabled when disabled prop is true",()=>{render(/*#__PURE__*/_jsx(CheckboxOption,_objectSpread(_objectSpread({},a),{},{disabled:!0}))),expect(screen.getByRole("checkbox")).toBeDisabled()}),describe("onChange",()=>{it("is called with new checked value when the option is clicked",()=>{const b=jest.fn(),{rerender:c}=render(/*#__PURE__*/_jsx(CheckboxOption,_objectSpread(_objectSpread({},a),{},{onChange:b}))),d=screen.getByLabelText("test-label");expect(b).not.toHaveBeenCalled(),fireEvent.click(d),expect(b).toHaveBeenCalledWith(!0),c(/*#__PURE__*/_jsx(CheckboxOption,_objectSpread(_objectSpread({},a),{},{checked:!0,onChange:b}))),fireEvent.click(d),expect(b).toHaveBeenCalledWith(!1)}),it("is not called if the option is disabled",()=>{const b=jest.fn();render(/*#__PURE__*/_jsx(CheckboxOption,_objectSpread(_objectSpread({},a),{},{disabled:!0,onChange:b})));const c=screen.getByLabelText("test-label");expect(b).not.toHaveBeenCalled(),fireEvent.click(c),expect(b).not.toHaveBeenCalled()})}),it("renders aligned with container content",()=>{render(/*#__PURE__*/_jsx(CheckboxOption,_objectSpread(_objectSpread({},a),{},{isContainerAligned:!0}))),expect(document.querySelector(".np-option__container-aligned")).toBeInTheDocument()})});
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}/* eslint-disable jest/expect-expect */import"@testing-library/jest-dom";import{render,fireEvent,screen}from"../test-utils";import CheckboxOption from".";import{jsx as _jsx}from"react/jsx-runtime";describe("Checkbox option",function(){var a={id:"id",name:"name",title:"Title",onChange:jest.fn(),"aria-label":"test-label"};describe("by default",function(){render(/*#__PURE__*/_jsx(CheckboxOption,_objectSpread({},a)));var b=screen.getByRole("checkbox");it("is not checked",function(){expect(b).not.toBeChecked()}),it("is not disabled",function(){expect(b).toBeEnabled()})}),it("has `aria-label` attr",function(){render(/*#__PURE__*/_jsx(CheckboxOption,_objectSpread({},a)));var b=screen.getByLabelText("test-label");expect(b).toBeInTheDocument()}),it("is checked when checked prop is true",function(){render(/*#__PURE__*/_jsx(CheckboxOption,_objectSpread(_objectSpread({},a),{},{checked:!0}))),expect(screen.getByRole("checkbox")).toBeChecked()}),it("is disabled when disabled prop is true",function(){render(/*#__PURE__*/_jsx(CheckboxOption,_objectSpread(_objectSpread({},a),{},{disabled:!0}))),expect(screen.getByRole("checkbox")).toBeDisabled()}),describe("onChange",function(){it("is called with new checked value when the option is clicked",function(){var b=jest.fn(),c=render(/*#__PURE__*/_jsx(CheckboxOption,_objectSpread(_objectSpread({},a),{},{onChange:b}))),d=c.rerender,e=screen.getByLabelText("test-label");expect(b).not.toHaveBeenCalled(),fireEvent.click(e),expect(b).toHaveBeenCalledWith(!0),d(/*#__PURE__*/_jsx(CheckboxOption,_objectSpread(_objectSpread({},a),{},{checked:!0,onChange:b}))),fireEvent.click(e),expect(b).toHaveBeenCalledWith(!1)}),it("is not called if the option is disabled",function(){var b=jest.fn();render(/*#__PURE__*/_jsx(CheckboxOption,_objectSpread(_objectSpread({},a),{},{disabled:!0,onChange:b})));var c=screen.getByLabelText("test-label");expect(b).not.toHaveBeenCalled(),fireEvent.click(c),expect(b).not.toHaveBeenCalled()})}),it("renders aligned with container content",function(){render(/*#__PURE__*/_jsx(CheckboxOption,_objectSpread(_objectSpread({},a),{},{isContainerAligned:!0}))),expect(document.querySelector(".np-option__container-aligned")).toBeInTheDocument()})});
@@ -1 +1 @@
1
- import"core-js/modules/web.dom-collections.iterator.js";import{action}from"@storybook/addon-actions";import{boolean,text}from"@storybook/addon-knobs";import{FastFlag as FastFlagIcon}from"@transferwise/icons";import{useState}from"react";import{Nudge}from"..";import CheckboxOption from"./CheckboxOption";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 meta={component:CheckboxOption,title:"Option/CheckboxOption",tags:["autodocs"]};export default meta;const Template=()=>{const[a,b]=useState(!0),c=text("content","Normally, the button and icon are vertically centered."),d=text("title","Checkbox option"),e=boolean("disabled",!1),f=boolean("showMediaAtAllSizes",!1),g=boolean("isContainerAligned",!1);return/*#__PURE__*/_jsx(CheckboxOption,{id:"checkbox-option",name:"checkbox-option",checked:a,disabled:e,title:d,content:c,media:/*#__PURE__*/_jsx(FastFlagIcon,{}),showMediaAtAllSizes:f,isContainerAligned:g,onChange:a=>b(a)})};export const Basic=()=>/*#__PURE__*/_jsx(Template,{});export const Multiple=()=>/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx(Template,{})]});export const WithContainerContent=()=>/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("h2",{className:"m-b-2",children:"Choose how to pay"}),/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(Nudge,{className:"m-t-2",mediaName:"globe",title:"Text that is no longer than two lines.",link:"Link",href:"#",onClick:action("action clicked"),onDismiss:action("dismissed")})})]});
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import{action}from"@storybook/addon-actions";import{boolean,text}from"@storybook/addon-knobs";import{FastFlag as FastFlagIcon}from"@transferwise/icons";import{useState}from"react";import{Nudge}from"..";import CheckboxOption from"./CheckboxOption";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 meta={component:CheckboxOption,title:"Option/CheckboxOption",tags:["autodocs"]};export default meta;var Template=function(){var a=useState(!0),b=_slicedToArray(a,2),c=b[0],d=b[1],e=text("content","Normally, the button and icon are vertically centered."),f=text("title","Checkbox option"),g=boolean("disabled",!1),h=boolean("showMediaAtAllSizes",!1),i=boolean("isContainerAligned",!1);return/*#__PURE__*/_jsx(CheckboxOption,{id:"checkbox-option",name:"checkbox-option",checked:c,disabled:g,title:f,content:e,media:/*#__PURE__*/_jsx(FastFlagIcon,{}),showMediaAtAllSizes:h,isContainerAligned:i,onChange:function onChange(a){return d(a)}})};export var Basic=function(){return/*#__PURE__*/_jsx(Template,{})};export var Multiple=function(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx(Template,{})]})};export var WithContainerContent=function(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("h2",{className:"m-b-2",children:"Choose how to pay"}),/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(Nudge,{className:"m-t-2",mediaName:"globe",title:"Text that is no longer than two lines.",link:"Link",href:"#",onClick:action("action clicked"),onDismiss:action("dismissed")})})]})};
@@ -1 +1 @@
1
- import{ChevronUp}from"@transferwise/icons";import classNames from"classnames";import PropTypes from"prop-types";import{Size,Position}from"../common";import{jsx as _jsx}from"react/jsx-runtime";const CONTAINER_SIZE={[Size.EXTRA_SMALL]:10,[Size.SMALL]:16,[Size.MEDIUM]:24},ExtraSmallChevron=a=>{let{className:b}=a;return/*#__PURE__*/_jsx("span",{className:classNames("tw-icon","tw-icon-chevron",b),role:"presentation","aria-hidden":!0,children:/*#__PURE__*/_jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",focusable:"false",children:/*#__PURE__*/_jsx("path",{fillRule:"evenodd",d:"M4.9995 2.0865L0.0635004 6.7645L1.2745 7.9125L4.9995 4.3835L8.7245 7.9135L9.9355 6.7645L4.9995 2.0865Z"})})})};ExtraSmallChevron.propTypes={className:PropTypes.string},ExtraSmallChevron.defaultProps={className:null};const Chevron=a=>{let{orientation:b,size:c,disabled:d,className:e}=a;const f=classNames("tw-chevron",{"chevron-color":!d},"".concat([b]).toLowerCase(),e),g=CONTAINER_SIZE[c];return c===Size.EXTRA_SMALL?/*#__PURE__*/_jsx(ExtraSmallChevron,{className:f}):/*#__PURE__*/_jsx(ChevronUp,{className:f,size:g})};Chevron.propTypes={orientation:PropTypes.oneOf(["top","bottom","left","right"]),size:PropTypes.oneOf(["xs","sm","md"]),disabled:PropTypes.bool,className:PropTypes.string},Chevron.defaultProps={orientation:Position.BOTTOM,size:Size.SMALL,disabled:!1,className:null};export default Chevron;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";var _CONTAINER_SIZE;import{ChevronUp}from"@transferwise/icons";import classNames from"classnames";import PropTypes from"prop-types";import{Size,Position}from"../common";import{jsx as _jsx}from"react/jsx-runtime";var CONTAINER_SIZE=(_CONTAINER_SIZE={},_defineProperty(_CONTAINER_SIZE,Size.EXTRA_SMALL,10),_defineProperty(_CONTAINER_SIZE,Size.SMALL,16),_defineProperty(_CONTAINER_SIZE,Size.MEDIUM,24),_CONTAINER_SIZE),ExtraSmallChevron=function(a){var b=a.className;return/*#__PURE__*/_jsx("span",{className:classNames("tw-icon","tw-icon-chevron",b),role:"presentation","aria-hidden":!0,children:/*#__PURE__*/_jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",focusable:"false",children:/*#__PURE__*/_jsx("path",{fillRule:"evenodd",d:"M4.9995 2.0865L0.0635004 6.7645L1.2745 7.9125L4.9995 4.3835L8.7245 7.9135L9.9355 6.7645L4.9995 2.0865Z"})})})};ExtraSmallChevron.propTypes={className:PropTypes.string},ExtraSmallChevron.defaultProps={className:null};var Chevron=function(a){var b=a.orientation,c=a.size,d=a.disabled,e=a.className,f=classNames("tw-chevron",{"chevron-color":!d},"".concat([b]).toLowerCase(),e),g=CONTAINER_SIZE[c];return c===Size.EXTRA_SMALL?/*#__PURE__*/_jsx(ExtraSmallChevron,{className:f}):/*#__PURE__*/_jsx(ChevronUp,{className:f,size:g})};Chevron.propTypes={orientation:PropTypes.oneOf(["top","bottom","left","right"]),size:PropTypes.oneOf(["xs","sm","md"]),disabled:PropTypes.bool,className:PropTypes.string},Chevron.defaultProps={orientation:Position.BOTTOM,size:Size.SMALL,disabled:!1,className:null};export default Chevron;
@@ -1 +1 @@
1
- import Chevron from"./Chevron";export default{component:Chevron,title:"Other/Chevron",argTypes:{orientation:{type:{name:"enum",value:["top","bottom","left","right"]}},size:{type:{name:"enum",value:["xs","sm","md"]}}},tags:["autodocs"]};export const Basic={args:{orientation:"top",size:"md"}};
1
+ import Chevron from"./Chevron";export default{component:Chevron,title:"Other/Chevron",argTypes:{orientation:{type:{name:"enum",value:["top","bottom","left","right"]}},size:{type:{name:"enum",value:["xs","sm","md"]}}},tags:["autodocs"]};export var Basic={args:{orientation:"top",size:"md"}};
@@ -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{useTheme}from"@wise/components-theming";import classNames from"classnames";import{useEffect,useRef}from"react";import Body from"../body/Body";import{Typography}from"../common";import{CloseButton}from"../common/closeButton/CloseButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const Chip=a=>{let{label:b,value:c,onRemove:d,onClick:e,onKeyPress:f,className:k=void 0,"aria-label":g,"aria-checked":h,role:i,closeButton:j}=a;const l=e||f,m=l?"button":void 0,n=l?0:-1,{isModern:o}=useTheme(),p=useRef(null),q=useRef();return useEffect(()=>{if(null!=p.current&&!1===q.current){var a;null===(a=p.current)||void 0===a?void 0:a.focus()}q.current=null!=p.current},[d]),/*#__PURE__*/_jsxs("div",_objectSpread(_objectSpread({role:null!==i&&void 0!==i?i:m,tabIndex:n,"aria-label":g,"aria-checked":h,className:classNames("np-chip","d-flex","align-items-center","justify-content-between",d?"np-chip--removable":"",k)},l&&{onClick:e,onKeyPress:f}),{},{children:[o?/*#__PURE__*/_jsx(Body,{"aria-hidden":!!d,type:Typography.BODY_DEFAULT_BOLD,children:b}):/*#__PURE__*/_jsx("span",{"aria-hidden":"false",className:"np-chip-label",children:b}),d?/*#__PURE__*/_jsx(CloseButton,{ref:p,className:o?"btn-unstyled":"btn-unstyled m-l-1","aria-label":j&&j["aria-label"],size:"sm",filled:o,onClick:d}):null]}),c)};export default Chip;
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{useTheme}from"@wise/components-theming";import classNames from"classnames";import{useEffect,useRef}from"react";import Body from"../body/Body";import{Typography}from"../common";import{CloseButton}from"../common/closeButton/CloseButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Chip=function(a){var b=a.label,c=a.value,d=a.onRemove,e=a.onClick,f=a.onKeyPress,g=a.className,h=void 0===g?void 0:g,i=a["aria-label"],j=a["aria-checked"],k=a.role,l=a.closeButton,m=e||f,n=m?"button":void 0,o=m?0:-1,p=useTheme(),q=p.isModern,r=useRef(null),s=useRef();return useEffect(function(){if(null!=r.current&&!1===s.current){var a;null===(a=r.current)||void 0===a?void 0:a.focus()}s.current=null!=r.current},[d]),/*#__PURE__*/_jsxs("div",_objectSpread(_objectSpread({role:null!==k&&void 0!==k?k:n,tabIndex:o,"aria-label":i,"aria-checked":j,className:classNames("np-chip","d-flex","align-items-center","justify-content-between",d?"np-chip--removable":"",h)},m&&{onClick:e,onKeyPress:f}),{},{children:[q?/*#__PURE__*/_jsx(Body,{"aria-hidden":!!d,type:Typography.BODY_DEFAULT_BOLD,children:b}):/*#__PURE__*/_jsx("span",{"aria-hidden":"false",className:"np-chip-label",children:b}),d?/*#__PURE__*/_jsx(CloseButton,{ref:r,className:q?"btn-unstyled":"btn-unstyled m-l-1","aria-label":l&&l["aria-label"],size:"sm",filled:q,onClick:d}):null]}),c)};export default Chip;
@@ -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"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import classNames from"classnames";import{useIntl}from"react-intl";import Chip from"./Chip";import messages from"./Chips.messages";import{jsx as _jsx}from"react/jsx-runtime";const Chips=a=>{let{chips:b,onChange:c,selected:d,"aria-label":e,className:f,multiple:g}=a;const h=useIntl(),i=a=>Array.isArray(d)?d.includes(a):d===a,j=(a,b)=>{c({isEnabled:!b,selectedValue:a})};return/*#__PURE__*/_jsx("div",{className:classNames("np-chips d-flex",f),"aria-label":e,role:g?void 0:"radiogroup",children:b.map(a=>{const b=i(a.value);return/*#__PURE__*/_jsx(Chip,_objectSpread({value:a.value,label:a.label,closeButton:{"aria-label":h.formatMessage(messages.ariaLabel,{choice:a.label})},className:classNames("text-xs-nowrap",{"np-chip--selected":b,"p-r-1":g&&b})},g&&b?{onRemove:()=>j(a.value,b),"aria-label":a.label}:{onClick:()=>j(a.value,b),onKeyPress:()=>j(a.value,b),role:g?void 0:"radio","aria-checked":b}),a.value)})})};export default Chips;
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/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.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";import classNames from"classnames";import{useIntl}from"react-intl";import Chip from"./Chip";import messages from"./Chips.messages";import{jsx as _jsx}from"react/jsx-runtime";var Chips=function(a){var b=a.chips,c=a.onChange,d=a.selected,e=a["aria-label"],f=a.className,g=a.multiple,h=useIntl(),i=function(a){return Array.isArray(d)?d.includes(a):d===a},j=function(a,b){c({isEnabled:!b,selectedValue:a})};return/*#__PURE__*/_jsx("div",{className:classNames("np-chips d-flex",f),"aria-label":e,role:g?void 0:"radiogroup",children:b.map(function(a){var b=i(a.value);return/*#__PURE__*/_jsx(Chip,_objectSpread({value:a.value,label:a.label,closeButton:{"aria-label":h.formatMessage(messages.ariaLabel,{choice:a.label})},className:classNames("text-xs-nowrap",{"np-chip--selected":b,"p-r-1":g&&b})},g&&b?{onRemove:function onRemove(){return j(a.value,b)},"aria-label":a.label}:{onClick:function onClick(){return j(a.value,b)},onKeyPress:function onKeyPress(){return j(a.value,b)},role:g?void 0:"radio","aria-checked":b}),a.value)})})};export default Chips;
@@ -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"@testing-library/jest-dom";import{render,screen,fireEvent}from"../test-utils";import Chips from".";import{jsx as _jsx}from"react/jsx-runtime";const choiceProps={chips:[{value:"accounting",label:"Accounting"},{value:"payroll",label:"Payroll"},{value:"reporting",label:"Reporting"},{value:"payments",label:"Payments"}],selected:"payroll",onChange:jest.fn(),"aria-label":"Please select a category"},filterProps={chips:[{value:"accounting",label:"Accounting"},{value:"payroll",label:"Payroll"},{value:"reporting",label:"Reporting"},{value:"payments",label:"Payments"}],onChange:jest.fn(),"aria-label":"Filter by categories",selected:["payments"],multiple:!0};describe("Chips",()=>{describe("Choice Chips",()=>{it("renders as expected",()=>{expect(render(/*#__PURE__*/_jsx(Chips,_objectSpread({},choiceProps))).container).toMatchSnapshot()}),it("will pass previous state, updated state, and selected value on select",()=>{render(/*#__PURE__*/_jsx(Chips,_objectSpread({},choiceProps)));const a=screen.getByText("Accounting");fireEvent.click(a),expect(choiceProps.onChange).toHaveBeenCalledWith({selectedValue:"accounting",isEnabled:!0})})}),describe("Filter Chips",()=>{it("renders as expected",()=>{expect(render(/*#__PURE__*/_jsx(Chips,_objectSpread({},filterProps))).container).toMatchSnapshot()}),it("will pass previous state, updated state, and selected value on select",()=>{render(/*#__PURE__*/_jsx(Chips,_objectSpread({},filterProps)));const a=screen.getByText("Accounting");fireEvent.click(a),expect(filterProps.onChange).toHaveBeenCalledWith({selectedValue:"accounting",isEnabled:!0})}),it("will pass previous state, updated state, and cleared value on clear",()=>{render(/*#__PURE__*/_jsx(Chips,_objectSpread({},filterProps))),fireEvent.click(screen.getAllByRole("button")[3]),expect(filterProps.onChange).toHaveBeenCalledWith({selectedValue:"payments",isEnabled:!1})})})});
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"@testing-library/jest-dom";import{render,screen,fireEvent}from"../test-utils";import Chips from".";import{jsx as _jsx}from"react/jsx-runtime";var choiceProps={chips:[{value:"accounting",label:"Accounting"},{value:"payroll",label:"Payroll"},{value:"reporting",label:"Reporting"},{value:"payments",label:"Payments"}],selected:"payroll",onChange:jest.fn(),"aria-label":"Please select a category"},filterProps={chips:[{value:"accounting",label:"Accounting"},{value:"payroll",label:"Payroll"},{value:"reporting",label:"Reporting"},{value:"payments",label:"Payments"}],onChange:jest.fn(),"aria-label":"Filter by categories",selected:["payments"],multiple:!0};describe("Chips",function(){describe("Choice Chips",function(){it("renders as expected",function(){expect(render(/*#__PURE__*/_jsx(Chips,_objectSpread({},choiceProps))).container).toMatchSnapshot()}),it("will pass previous state, updated state, and selected value on select",function(){render(/*#__PURE__*/_jsx(Chips,_objectSpread({},choiceProps)));var a=screen.getByText("Accounting");fireEvent.click(a),expect(choiceProps.onChange).toHaveBeenCalledWith({selectedValue:"accounting",isEnabled:!0})})}),describe("Filter Chips",function(){it("renders as expected",function(){expect(render(/*#__PURE__*/_jsx(Chips,_objectSpread({},filterProps))).container).toMatchSnapshot()}),it("will pass previous state, updated state, and selected value on select",function(){render(/*#__PURE__*/_jsx(Chips,_objectSpread({},filterProps)));var a=screen.getByText("Accounting");fireEvent.click(a),expect(filterProps.onChange).toHaveBeenCalledWith({selectedValue:"accounting",isEnabled:!0})}),it("will pass previous state, updated state, and cleared value on clear",function(){render(/*#__PURE__*/_jsx(Chips,_objectSpread({},filterProps))),fireEvent.click(screen.getAllByRole("button")[3]),expect(filterProps.onChange).toHaveBeenCalledWith({selectedValue:"payments",isEnabled:!1})})})});
@@ -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"core-js/modules/web.dom-collections.iterator.js";import{useState}from"react";import Chips from"./Chips";import{jsx as _jsx}from"react/jsx-runtime";const meta={title:"Actions/Chips",component:Chips,tags:["autodocs"]};export default meta;const FilterTemplate=a=>{const[b,c]=useState(a.selected?a.selected:[]);return/*#__PURE__*/_jsx(Chips,_objectSpread(_objectSpread({},a),{},{selected:b,multiple:!0,onChange:a=>{let{selectedValue:d,isEnabled:e}=a;if(e)c([...b,d]);else{const a=b.filter(a=>d!==a);c(a)}}}))},ChoiceTemplate=a=>{const[b,c]=useState(a.selected);return/*#__PURE__*/_jsx(Chips,_objectSpread(_objectSpread({},a),{},{selected:b,onChange:a=>{let{selectedValue:b}=a;return c(b)}}))};export const FilterChips=FilterTemplate.bind({});FilterChips.args={chips:[{value:"accounting",label:"Accounting"},{value:"payroll",label:"Payroll"},{value:"reporting",label:"Reporting"},{value:"payments",label:"Payments"}]};export const PreSelectedFilterChips=FilterTemplate.bind({});PreSelectedFilterChips.args={chips:[{value:"accounting",label:"Accounting"},{value:"payroll",label:"Payroll"},{value:"reporting",label:"Reporting"},{value:"payments",label:"Payments"}],selected:["accounting","payments"]};export const ChoiceChips=ChoiceTemplate.bind({});ChoiceChips.args={chips:[{value:1,label:"100 GBP"},{value:2,label:"200 GBP"},{value:3,label:"300 GBP"},{value:4,label:"400 GBP+"}],selected:3};
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"core-js/modules/es.array.concat.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";import{useState}from"react";import Chips from"./Chips";import{jsx as _jsx}from"react/jsx-runtime";var meta={title:"Actions/Chips",component:Chips,tags:["autodocs"]};export default meta;var FilterTemplate=function(a){var b=useState(a.selected?a.selected:[]),c=_slicedToArray(b,2),d=c[0],e=c[1];return/*#__PURE__*/_jsx(Chips,_objectSpread(_objectSpread({},a),{},{selected:d,multiple:!0,onChange:function onChange(a){var b=a.selectedValue,c=a.isEnabled;if(c)e([].concat(_toConsumableArray(d),[b]));else{var f=d.filter(function(a){return b!==a});e(f)}}}))},ChoiceTemplate=function(a){var b=useState(a.selected),c=_slicedToArray(b,2),d=c[0],e=c[1];return/*#__PURE__*/_jsx(Chips,_objectSpread(_objectSpread({},a),{},{selected:d,onChange:function onChange(a){var b=a.selectedValue;return e(b)}}))};export var FilterChips=FilterTemplate.bind({});FilterChips.args={chips:[{value:"accounting",label:"Accounting"},{value:"payroll",label:"Payroll"},{value:"reporting",label:"Reporting"},{value:"payments",label:"Payments"}]};export var PreSelectedFilterChips=FilterTemplate.bind({});PreSelectedFilterChips.args={chips:[{value:"accounting",label:"Accounting"},{value:"payroll",label:"Payroll"},{value:"reporting",label:"Reporting"},{value:"payments",label:"Payments"}],selected:["accounting","payments"]};export var ChoiceChips=ChoiceTemplate.bind({});ChoiceChips.args={chips:[{value:1,label:"100 GBP"},{value:2,label:"200 GBP"},{value:3,label:"300 GBP"},{value:4,label:"400 GBP+"}],selected:3};
@@ -1 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["className","children","disabled","icon","priority","type"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement}from"react";import Body from"../body/Body";import{typeClassMap,priorityClassMap}from"../button/classMap";import{ControlType,Priority}from"../common";import{Typography}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const CircularButton=a=>{let{className:b,children:c,disabled:d,icon:e,priority:f,type:g}=a,h=_objectWithoutProperties(a,_excluded);const i=classNames("btn np-btn",typeClassMap[g],priorityClassMap[f]),j=24===e.props.size?e:/*#__PURE__*/cloneElement(e,{size:24});return/*#__PURE__*/_jsxs("label",{className:classNames("np-circular-btn",f,g,d?"disabled":"",b),children:[/*#__PURE__*/_jsx("input",_objectSpread({type:"button","aria-label":c,className:i,disabled:d},h)),j,/*#__PURE__*/_jsx(Body,{as:"span",className:"np-circular-btn__label",type:Typography.BODY_DEFAULT_BOLD,children:c})]})};CircularButton.propTypes={className:PropTypes.string,children:PropTypes.string.isRequired,disabled:PropTypes.bool,icon:PropTypes.element.isRequired,onClick:PropTypes.func,priority:PropTypes.oneOf(["primary","secondary"]),type:PropTypes.oneOf(["accent","positive","negative"])},CircularButton.defaultProps={className:void 0,disabled:!1,priority:Priority.PRIMARY,type:ControlType.ACCENT};export default CircularButton;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","children","disabled","icon","priority","type"];import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement}from"react";import Body from"../body/Body";import{typeClassMap,priorityClassMap}from"../button/classMap";import{ControlType,Priority}from"../common";import{Typography}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var CircularButton=function(a){var b=a.className,c=a.children,d=a.disabled,e=a.icon,f=a.priority,g=a.type,h=_objectWithoutProperties(a,_excluded),i=classNames("btn np-btn",typeClassMap[g],priorityClassMap[f]),j=24===e.props.size?e:/*#__PURE__*/cloneElement(e,{size:24});return/*#__PURE__*/_jsxs("label",{className:classNames("np-circular-btn",f,g,d?"disabled":"",b),children:[/*#__PURE__*/_jsx("input",_objectSpread({type:"button","aria-label":c,className:i,disabled:d},h)),j,/*#__PURE__*/_jsx(Body,{as:"span",className:"np-circular-btn__label",type:Typography.BODY_DEFAULT_BOLD,children:c})]})};CircularButton.propTypes={className:PropTypes.string,children:PropTypes.string.isRequired,disabled:PropTypes.bool,icon:PropTypes.element.isRequired,onClick:PropTypes.func,priority:PropTypes.oneOf(["primary","secondary"]),type:PropTypes.oneOf(["accent","positive","negative"])},CircularButton.defaultProps={className:void 0,disabled:!1,priority:Priority.PRIMARY,type:ControlType.ACCENT};export default CircularButton;
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * Defined in `Dimmer.less`
3
- */const NO_SCROLL_CLASS="no-scroll";/**
3
+ */var NO_SCROLL_CLASS="no-scroll";/**
4
4
  * Apply {@link NO_SCROLL_CLASS} that disables scroll on page (e.g use in Dimmer to disable scroll behind the component)
5
5
  *
6
6
  * CSS class needs to be applied for `html` and not `body`, as this doing both will break any position sticky in the document.
7
- */export const addNoScrollClass=()=>{document.documentElement.classList.add(NO_SCROLL_CLASS)};/**
7
+ */export var addNoScrollClass=function(){document.documentElement.classList.add(NO_SCROLL_CLASS)};/**
8
8
  * Clean up after {@link addNoScrollClass} function
9
- */export const removeNoScrollClass=()=>{document.documentElement.classList.remove(NO_SCROLL_CLASS)};
9
+ */export var removeNoScrollClass=function(){document.documentElement.classList.remove(NO_SCROLL_CLASS)};
@@ -1 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["media","title","content","as","button","decision","disabled","complex","inverseMediaCircle","className","showMediaAtAllSizes","showMediaCircle","isContainerAligned"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import{forwardRef}from"react";import Body from"../../body";import{Typography}from"../propsValues/typography";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const Option=/*#__PURE__*/forwardRef((a,b)=>{var c;let{media:k="",title:d,content:e,as:f,button:g,decision:l=!0,disabled:m=!1,complex:h,inverseMediaCircle:n=!0,className:i,showMediaAtAllSizes:j,showMediaCircle:o=!0,isContainerAligned:p=!1}=a,q=_objectWithoutProperties(a,_excluded);const r=null!==(c=f)&&void 0!==c?c:"label";return/*#__PURE__*/_jsx(r,_objectSpread(_objectSpread({},q),{},{ref:b,className:classNames("np-option",i,{"decision-complex":h,decision:l,disabled:m,"np-option__sm-media":j,"np-option__container-aligned":p}),disabled:m&&"button"===r,children:/*#__PURE__*/_jsxs("div",{className:"media",children:[k&&/*#__PURE__*/_jsx("div",{className:"media-left",children:o?/*#__PURE__*/_jsx("div",{className:classNames("circle circle-sm text-primary",{"circle-inverse":n}),children:k}):/*#__PURE__*/_jsx("div",{className:"np-option__no-media-circle",children:k})}),/*#__PURE__*/_jsxs("div",{className:"media-body",children:[/*#__PURE__*/_jsx(Body,{as:"span",type:Typography.BODY_LARGE_BOLD,className:"text-primary np-option__title d-block",children:d}),e&&/*#__PURE__*/_jsx(Body,{className:"d-block np-option__body",children:e})]}),/*#__PURE__*/_jsx("div",{className:"media-right",children:g})]})}))});export default Option;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["media","title","content","as","button","decision","disabled","complex","inverseMediaCircle","className","showMediaAtAllSizes","showMediaCircle","isContainerAligned"];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{circle,circleInverse,circleSm,textPrimary}from"@transferwise/neptune-css";import classNames from"classnames";import{forwardRef}from"react";import Body from"../../body";import{Typography}from"../propsValues/typography";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Option=/*#__PURE__*/forwardRef(function(a,b){var c,d=a.media,e=void 0===d?"":d,f=a.title,g=a.content,h=a.as,i=a.button,j=a.decision,k=a.disabled,l=void 0!==k&&k,m=a.complex,n=a.inverseMediaCircle,o=a.className,p=a.showMediaAtAllSizes,q=a.showMediaCircle,r=a.isContainerAligned,s=_objectWithoutProperties(a,_excluded),t=null!==(c=h)&&void 0!==c?c:"label";return/*#__PURE__*/_jsx(t,_objectSpread(_objectSpread({},s),{},{ref:b,className:classNames("np-option",o,{"decision-complex":m,decision:!(void 0!==j)||j,disabled:l,"np-option__sm-media":p,"np-option__container-aligned":void 0!==r&&r}),disabled:l&&"button"===t,children:/*#__PURE__*/_jsxs("div",{className:"media",children:[e&&/*#__PURE__*/_jsx("div",{className:"media-left",children:!(void 0!==q)||q?/*#__PURE__*/_jsx("div",{className:classNames(circle,circleSm,textPrimary,_defineProperty({},circleInverse,!(void 0!==n)||n)),children:e}):/*#__PURE__*/_jsx("div",{className:"np-option__no-media-circle",children:e})}),/*#__PURE__*/_jsxs("div",{className:"media-body",children:[/*#__PURE__*/_jsx(Body,{as:"span",type:Typography.BODY_LARGE_BOLD,className:"text-primary np-option__title d-block",children:f}),g&&/*#__PURE__*/_jsx(Body,{className:"d-block np-option__body",children:g})]}),/*#__PURE__*/_jsx("div",{className:"media-right",children:i})]})}))});export default Option;
@@ -1 +1 @@
1
- import classNames from"classnames";import PropTypes from"prop-types";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const RadioButton=a=>{let{id:b,value:c,name:d,checked:e,onChange:f,disabled:g,readOnly:h}=a;return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("input",{type:"radio",className:"sr-only",id:b,value:c,name:d,checked:e,disabled:g||h,onChange:()=>e?null:f(c)}),/*#__PURE__*/_jsx("span",{className:classNames("tw-radio-button",{checked:e,disabled:g||h}),children:/*#__PURE__*/_jsx("span",{className:"tw-radio-check"})})]})};RadioButton.propTypes={id:PropTypes.string,name:PropTypes.string.isRequired,checked:PropTypes.bool,onChange:PropTypes.func,disabled:PropTypes.bool,value:PropTypes.oneOfType([PropTypes.number,PropTypes.string]),readOnly:PropTypes.bool},RadioButton.defaultProps={checked:!1,onChange:()=>{},disabled:!1,id:null,value:"",readOnly:!1};export default RadioButton;
1
+ import"core-js/modules/es.function.name.js";import classNames from"classnames";import PropTypes from"prop-types";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var RadioButton=function(a){var b=a.id,c=a.value,d=a.name,e=a.checked,f=a.onChange,g=a.disabled,h=a.readOnly;return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("input",{type:"radio",className:"sr-only",id:b,value:c,name:d,checked:e,disabled:g||h,onChange:function onChange(){return e?null:f(c)}}),/*#__PURE__*/_jsx("span",{className:classNames("tw-radio-button",{checked:e,disabled:g||h}),children:/*#__PURE__*/_jsx("span",{className:"tw-radio-check"})})]})};RadioButton.propTypes={id:PropTypes.string,name:PropTypes.string.isRequired,checked:PropTypes.bool,onChange:PropTypes.func,disabled:PropTypes.bool,value:PropTypes.oneOfType([PropTypes.number,PropTypes.string]),readOnly:PropTypes.bool},RadioButton.defaultProps={checked:!1,onChange:function onChange(){},disabled:!1,id:null,value:"",readOnly:!1};export default RadioButton;
@@ -1,10 +1,10 @@
1
- import"core-js/modules/web.dom-collections.iterator.js";import classNames from"classnames";import{useRef,useState}from"react";import Dimmer from"../../dimmer";import SlidingPanel from"../../slidingPanel";import{CloseButton}from"../closeButton";import{isServerSide}from"../domHelpers";import{useConditionalListener}from"../hooks";import{Position}from"../propsValues/position";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const INITIAL_Y_POSITION=0,CONTENT_SCROLL_THRESHOLD=1,MOVE_OFFSET_THRESHOLD=50,BottomSheet=a=>{function b(a){null!==g.current&&(g.current.style.transform="translateY(".concat(a,"px)"))}function c(b){k(!1),m.current=INITIAL_Y_POSITION,null!==g.current&&g.current.style.removeProperty("transform"),a.onClose&&a.onClose(b)}function d(a){// stop moving component
2
- cancelAnimationFrame(l.current),k(!1),m.current>MOVE_OFFSET_THRESHOLD&&e()?c(a):b(INITIAL_Y_POSITION),m.current=INITIAL_Y_POSITION}function e(){var a;return(null===i||void 0===i||null===(a=i.current)||void 0===a?void 0:a.scrollTop)!==void 0&&i.current.scrollTop<=CONTENT_SCROLL_THRESHOLD}/**
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import"core-js/modules/es.array.concat.js";import classNames from"classnames";import{useRef,useState}from"react";import Dimmer from"../../dimmer";import SlidingPanel from"../../slidingPanel";import{CloseButton}from"../closeButton";import{isServerSide}from"../domHelpers";import{useConditionalListener}from"../hooks";import{Position}from"../propsValues/position";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var INITIAL_Y_POSITION=0,CONTENT_SCROLL_THRESHOLD=1,MOVE_OFFSET_THRESHOLD=50,BottomSheet=function(a){function b(a){null!==g.current&&(g.current.style.transform="translateY(".concat(a,"px)"))}function c(b){m(!1),o.current=INITIAL_Y_POSITION,null!==g.current&&g.current.style.removeProperty("transform"),a.onClose&&a.onClose(b)}function d(a){// stop moving component
2
+ cancelAnimationFrame(n.current),m(!1),o.current>MOVE_OFFSET_THRESHOLD&&e()?c(a):b(INITIAL_Y_POSITION),o.current=INITIAL_Y_POSITION}function e(){var a;return(null===i||void 0===i||null===(a=i.current)||void 0===a?void 0:a.scrollTop)!==void 0&&i.current.scrollTop<=CONTENT_SCROLL_THRESHOLD}/**
3
3
  * Calculates how hard user moves component,
4
4
  * result value used to determine whether to hide component or re-position to default state
5
5
  *
6
6
  * @param afterMoveYCoordinate
7
- */function f(a){return a-n.current}/**
7
+ */function f(a){return a-p.current}/**
8
8
  * Set `max-height` for content part (in order to keep it scrollable for content overflow cases) of the component
9
9
  * and ensures space for safe zone (32px) at the top.
10
- */const g=useRef(null),h=useRef(null),i=useRef(null),[j,k]=useState(!1),l=useRef(0),m=useRef(0),n=useRef(0);useConditionalListener({attachListener:a.open&&!isServerSide(),callback:()=>{if(null!==h.current){const{classList:a}=h.current;e()?a.remove("np-bottom-sheet--top-bar--shadow"):a.add("np-bottom-sheet--top-bar--shadow")}},eventType:"scroll",parent:isServerSide()?void 0:document});const o=a=>b=>{n.current=(a?b.touches[0]:b).clientY,k(!0)},p=a=>c=>{if(j){const{clientY:d}=a?c.touches[0]:c,h=f(d);h>INITIAL_Y_POSITION&&e()&&(m.current=h,l.current=requestAnimationFrame(()=>{l.current!==void 0&&null!==g.current&&b(h)}))}};return/*#__PURE__*/_jsx(Dimmer,{open:a.open,fadeContentOnEnter:!0,fadeContentOnExit:!0,onClose:c,children:/*#__PURE__*/_jsxs(SlidingPanel,{ref:g,open:a.open,position:Position.BOTTOM,className:classNames("np-bottom-sheet",a.className),role:"dialog",onTouchStart:o(!0),onTouchMove:p(!0),onTouchEnd:d,onMouseDown:o(!1),onMouseMove:p(!1),onMouseUp:d,children:[/*#__PURE__*/_jsxs("div",{ref:h,className:"np-bottom-sheet--top-bar",children:[/*#__PURE__*/_jsx("div",{className:"np-bottom-sheet--handler"}),/*#__PURE__*/_jsx(CloseButton,{size:"sm",className:"sr-only np-bottom-sheet--close-btn",onClick:c})]}),/*#__PURE__*/_jsx("div",{ref:i,style:function(){const a=isServerSide()?0:window.innerHeight,b="".concat(100*(.01*a),"px");return{maxHeight:"calc(".concat(b," - ").concat("64px"," - ").concat("32px",")")}}(),className:"np-bottom-sheet--content",children:a.children})]})})};export default BottomSheet;
10
+ */var g=useRef(null),h=useRef(null),i=useRef(null),j=useState(!1),k=_slicedToArray(j,2),l=k[0],m=k[1],n=useRef(0),o=useRef(0),p=useRef(0);useConditionalListener({attachListener:a.open&&!isServerSide(),callback:function callback(){if(null!==h.current){var a=h.current.classList;e()?a.remove("np-bottom-sheet--top-bar--shadow"):a.add("np-bottom-sheet--top-bar--shadow")}},eventType:"scroll",parent:isServerSide()?void 0:document});var q=function(a){return function(b){p.current=(a?b.touches[0]:b).clientY,m(!0)}},r=function(a){return function(c){if(l){var d=a?c.touches[0]:c,h=d.clientY,i=f(h);i>INITIAL_Y_POSITION&&e()&&(o.current=i,n.current=requestAnimationFrame(function(){n.current!==void 0&&null!==g.current&&b(i)}))}}};return/*#__PURE__*/_jsx(Dimmer,{open:a.open,fadeContentOnEnter:!0,fadeContentOnExit:!0,onClose:c,children:/*#__PURE__*/_jsxs(SlidingPanel,{ref:g,open:a.open,position:Position.BOTTOM,className:classNames("np-bottom-sheet",a.className),role:"dialog",onTouchStart:q(!0),onTouchMove:r(!0),onTouchEnd:d,onMouseDown:q(!1),onMouseMove:r(!1),onMouseUp:d,children:[/*#__PURE__*/_jsxs("div",{ref:h,className:"np-bottom-sheet--top-bar",children:[/*#__PURE__*/_jsx("div",{className:"np-bottom-sheet--handler"}),/*#__PURE__*/_jsx(CloseButton,{size:"sm",className:"sr-only np-bottom-sheet--close-btn",onClick:c})]}),/*#__PURE__*/_jsx("div",{ref:i,style:function(){var a=isServerSide()?0:window.innerHeight,b="".concat(100*(.01*a),"px");return{maxHeight:"calc(".concat(b," - ").concat("64px"," - ").concat("32px",")")}}(),className:"np-bottom-sheet--content",children:a.children})]})})};export default BottomSheet;
@@ -1 +1 @@
1
- import{render}from"../../test-utils";import BottomSheet from"./BottomSheet";import{jsx as _jsx}from"react/jsx-runtime";describe("BottomSheet",()=>{it("renders content when open",()=>{const{baseElement:a}=render(/*#__PURE__*/_jsx(BottomSheet,{open:!0,onClose:jest.fn(),children:/*#__PURE__*/_jsx("b",{children:"Test Content"})}));expect(a).toMatchSnapshot()}),it("does not renders when closed",()=>{const{container:a}=render(/*#__PURE__*/_jsx(BottomSheet,{open:!1,onClose:jest.fn(),children:"content"}));expect(a).toBeEmptyDOMElement()})});
1
+ import{render}from"../../test-utils";import BottomSheet from"./BottomSheet";import{jsx as _jsx}from"react/jsx-runtime";describe("BottomSheet",function(){it("renders content when open",function(){var a=render(/*#__PURE__*/_jsx(BottomSheet,{open:!0,onClose:jest.fn(),children:/*#__PURE__*/_jsx("b",{children:"Test Content"})})),b=a.baseElement;expect(b).toMatchSnapshot()}),it("does not renders when closed",function(){var a=render(/*#__PURE__*/_jsx(BottomSheet,{open:!1,onClose:jest.fn(),children:"content"})),b=a.container;expect(b).toBeEmptyDOMElement()})});