@transferwise/components 0.0.0-experimental-c7da7db → 0.0.0-experimental-24a0a12

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 (434) hide show
  1. package/build/accordion/AccordionItem/AccordionItem.js +0 -1
  2. package/build/accordion/AccordionItem/AccordionItem.js.map +1 -1
  3. package/build/accordion/AccordionItem/AccordionItem.mjs +0 -1
  4. package/build/accordion/AccordionItem/AccordionItem.mjs.map +1 -1
  5. package/build/actionButton/ActionButton.js +0 -1
  6. package/build/actionButton/ActionButton.js.map +1 -1
  7. package/build/actionButton/ActionButton.mjs +0 -1
  8. package/build/actionButton/ActionButton.mjs.map +1 -1
  9. package/build/actionOption/ActionOption.js +0 -1
  10. package/build/actionOption/ActionOption.js.map +1 -1
  11. package/build/actionOption/ActionOption.mjs +0 -1
  12. package/build/actionOption/ActionOption.mjs.map +1 -1
  13. package/build/alert/Alert.js +0 -1
  14. package/build/alert/Alert.js.map +1 -1
  15. package/build/alert/Alert.mjs +0 -1
  16. package/build/alert/Alert.mjs.map +1 -1
  17. package/build/alert/inlineMarkdown/InlineMarkdown.js +0 -1
  18. package/build/alert/inlineMarkdown/InlineMarkdown.js.map +1 -1
  19. package/build/alert/inlineMarkdown/InlineMarkdown.mjs +0 -1
  20. package/build/alert/inlineMarkdown/InlineMarkdown.mjs.map +1 -1
  21. package/build/avatar/Avatar.js +0 -1
  22. package/build/avatar/Avatar.js.map +1 -1
  23. package/build/avatar/Avatar.mjs +0 -1
  24. package/build/avatar/Avatar.mjs.map +1 -1
  25. package/build/avatarView/AvatarView.js +0 -1
  26. package/build/avatarView/AvatarView.js.map +1 -1
  27. package/build/avatarView/AvatarView.mjs +0 -1
  28. package/build/avatarView/AvatarView.mjs.map +1 -1
  29. package/build/avatarWrapper/AvatarWrapper.js +0 -1
  30. package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
  31. package/build/avatarWrapper/AvatarWrapper.mjs +0 -1
  32. package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -1
  33. package/build/badge/Badge.js +0 -1
  34. package/build/badge/Badge.js.map +1 -1
  35. package/build/badge/Badge.mjs +0 -1
  36. package/build/badge/Badge.mjs.map +1 -1
  37. package/build/button/Button.js +0 -1
  38. package/build/button/Button.js.map +1 -1
  39. package/build/button/Button.mjs +0 -1
  40. package/build/button/Button.mjs.map +1 -1
  41. package/build/button/LegacyButton.js +0 -1
  42. package/build/button/LegacyButton.js.map +1 -1
  43. package/build/button/LegacyButton.mjs +0 -1
  44. package/build/button/LegacyButton.mjs.map +1 -1
  45. package/build/button/classMap.js +0 -1
  46. package/build/button/classMap.js.map +1 -1
  47. package/build/button/classMap.mjs +0 -1
  48. package/build/button/classMap.mjs.map +1 -1
  49. package/build/button/legacyUtils/legacyUtils.js +0 -1
  50. package/build/button/legacyUtils/legacyUtils.js.map +1 -1
  51. package/build/button/legacyUtils/legacyUtils.mjs +0 -1
  52. package/build/button/legacyUtils/legacyUtils.mjs.map +1 -1
  53. package/build/card/Card.js +0 -1
  54. package/build/card/Card.js.map +1 -1
  55. package/build/card/Card.mjs +0 -1
  56. package/build/card/Card.mjs.map +1 -1
  57. package/build/checkbox/Checkbox.js +0 -1
  58. package/build/checkbox/Checkbox.js.map +1 -1
  59. package/build/checkbox/Checkbox.mjs +0 -1
  60. package/build/checkbox/Checkbox.mjs.map +1 -1
  61. package/build/chevron/Chevron.js +0 -1
  62. package/build/chevron/Chevron.js.map +1 -1
  63. package/build/chevron/Chevron.mjs +0 -1
  64. package/build/chevron/Chevron.mjs.map +1 -1
  65. package/build/chips/Chip.js +0 -1
  66. package/build/chips/Chip.js.map +1 -1
  67. package/build/chips/Chip.mjs +0 -1
  68. package/build/chips/Chip.mjs.map +1 -1
  69. package/build/circularButton/CircularButton.js +0 -1
  70. package/build/circularButton/CircularButton.js.map +1 -1
  71. package/build/circularButton/CircularButton.mjs +0 -1
  72. package/build/circularButton/CircularButton.mjs.map +1 -1
  73. package/build/common/locale/index.js +4 -9
  74. package/build/common/locale/index.js.map +1 -1
  75. package/build/common/locale/index.mjs +4 -9
  76. package/build/common/locale/index.mjs.map +1 -1
  77. package/build/common/panel/Panel.js +56 -41
  78. package/build/common/panel/Panel.js.map +1 -1
  79. package/build/common/panel/Panel.mjs +61 -46
  80. package/build/common/panel/Panel.mjs.map +1 -1
  81. package/build/common/responsivePanel/ResponsivePanel.js +0 -1
  82. package/build/common/responsivePanel/ResponsivePanel.js.map +1 -1
  83. package/build/common/responsivePanel/ResponsivePanel.mjs +0 -1
  84. package/build/common/responsivePanel/ResponsivePanel.mjs.map +1 -1
  85. package/build/criticalBanner/CriticalCommsBanner.js +0 -1
  86. package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
  87. package/build/criticalBanner/CriticalCommsBanner.mjs +0 -1
  88. package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
  89. package/build/dateInput/DateInput.js +1 -1
  90. package/build/dateInput/DateInput.mjs +1 -1
  91. package/build/dateLookup/DateLookup.js +1 -1
  92. package/build/dateLookup/DateLookup.mjs +1 -1
  93. package/build/dateLookup/dateHeader/DateHeader.js +0 -1
  94. package/build/dateLookup/dateHeader/DateHeader.js.map +1 -1
  95. package/build/dateLookup/dateHeader/DateHeader.mjs +0 -1
  96. package/build/dateLookup/dateHeader/DateHeader.mjs.map +1 -1
  97. package/build/decision/Decision.js +0 -1
  98. package/build/decision/Decision.js.map +1 -1
  99. package/build/decision/Decision.mjs +0 -1
  100. package/build/decision/Decision.mjs.map +1 -1
  101. package/build/definitionList/DefinitionList.js +0 -1
  102. package/build/definitionList/DefinitionList.js.map +1 -1
  103. package/build/definitionList/DefinitionList.mjs +0 -1
  104. package/build/definitionList/DefinitionList.mjs.map +1 -1
  105. package/build/dimmer/Dimmer.js +0 -1
  106. package/build/dimmer/Dimmer.js.map +1 -1
  107. package/build/dimmer/Dimmer.mjs +0 -1
  108. package/build/dimmer/Dimmer.mjs.map +1 -1
  109. package/build/display/Display.js +0 -1
  110. package/build/display/Display.js.map +1 -1
  111. package/build/display/Display.mjs +0 -1
  112. package/build/display/Display.mjs.map +1 -1
  113. package/build/drawer/Drawer.js +0 -1
  114. package/build/drawer/Drawer.js.map +1 -1
  115. package/build/drawer/Drawer.mjs +0 -1
  116. package/build/drawer/Drawer.mjs.map +1 -1
  117. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js +3 -4
  118. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js.map +1 -1
  119. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs +3 -4
  120. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs.map +1 -1
  121. package/build/field/Field.js +5 -5
  122. package/build/field/Field.mjs +5 -5
  123. package/build/flowNavigation/FlowNavigation.js +0 -1
  124. package/build/flowNavigation/FlowNavigation.js.map +1 -1
  125. package/build/flowNavigation/FlowNavigation.mjs +0 -1
  126. package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
  127. package/build/header/Header.js +0 -1
  128. package/build/header/Header.js.map +1 -1
  129. package/build/header/Header.mjs +0 -1
  130. package/build/header/Header.mjs.map +1 -1
  131. package/build/i18n/en.json +2 -0
  132. package/build/i18n/en.json.js +2 -0
  133. package/build/i18n/en.json.js.map +1 -1
  134. package/build/i18n/en.json.mjs +2 -0
  135. package/build/i18n/en.json.mjs.map +1 -1
  136. package/build/index.js +2 -0
  137. package/build/index.js.map +1 -1
  138. package/build/index.mjs +1 -0
  139. package/build/index.mjs.map +1 -1
  140. package/build/info/Info.js +0 -1
  141. package/build/info/Info.js.map +1 -1
  142. package/build/info/Info.mjs +0 -1
  143. package/build/info/Info.mjs.map +1 -1
  144. package/build/inlineAlert/InlineAlert.js +0 -1
  145. package/build/inlineAlert/InlineAlert.js.map +1 -1
  146. package/build/inlineAlert/InlineAlert.mjs +0 -1
  147. package/build/inlineAlert/InlineAlert.mjs.map +1 -1
  148. package/build/inputs/SearchInput.js +0 -1
  149. package/build/inputs/SearchInput.js.map +1 -1
  150. package/build/inputs/SearchInput.mjs +0 -1
  151. package/build/inputs/SearchInput.mjs.map +1 -1
  152. package/build/instructionsList/InstructionsList.js +0 -1
  153. package/build/instructionsList/InstructionsList.js.map +1 -1
  154. package/build/instructionsList/InstructionsList.mjs +0 -1
  155. package/build/instructionsList/InstructionsList.mjs.map +1 -1
  156. package/build/link/Link.js +0 -1
  157. package/build/link/Link.js.map +1 -1
  158. package/build/link/Link.mjs +0 -1
  159. package/build/link/Link.mjs.map +1 -1
  160. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js +0 -1
  161. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js.map +1 -1
  162. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs +0 -1
  163. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs.map +1 -1
  164. package/build/listItem/ListItem.js +0 -1
  165. package/build/listItem/ListItem.js.map +1 -1
  166. package/build/listItem/ListItem.mjs +0 -1
  167. package/build/listItem/ListItem.mjs.map +1 -1
  168. package/build/listItem/Prompt/ListItemPrompt.js +5 -5
  169. package/build/listItem/Prompt/ListItemPrompt.mjs +5 -5
  170. package/build/loader/Loader.js +0 -1
  171. package/build/loader/Loader.js.map +1 -1
  172. package/build/loader/Loader.mjs +0 -1
  173. package/build/loader/Loader.mjs.map +1 -1
  174. package/build/main.css +130 -51
  175. package/build/markdown/Markdown.js +0 -1
  176. package/build/markdown/Markdown.js.map +1 -1
  177. package/build/markdown/Markdown.mjs +0 -1
  178. package/build/markdown/Markdown.mjs.map +1 -1
  179. package/build/modal/Modal.js +0 -1
  180. package/build/modal/Modal.js.map +1 -1
  181. package/build/modal/Modal.mjs +0 -1
  182. package/build/modal/Modal.mjs.map +1 -1
  183. package/build/moneyInput/MoneyInput.js +12 -28
  184. package/build/moneyInput/MoneyInput.js.map +1 -1
  185. package/build/moneyInput/MoneyInput.mjs +14 -30
  186. package/build/moneyInput/MoneyInput.mjs.map +1 -1
  187. package/build/moneyInput/currencyFormatting.js +2 -8
  188. package/build/moneyInput/currencyFormatting.js.map +1 -1
  189. package/build/moneyInput/currencyFormatting.mjs +4 -5
  190. package/build/moneyInput/currencyFormatting.mjs.map +1 -1
  191. package/build/navigationOption/NavigationOption.js +0 -1
  192. package/build/navigationOption/NavigationOption.js.map +1 -1
  193. package/build/navigationOption/NavigationOption.mjs +0 -1
  194. package/build/navigationOption/NavigationOption.mjs.map +1 -1
  195. package/build/nudge/Nudge.js +0 -1
  196. package/build/nudge/Nudge.js.map +1 -1
  197. package/build/nudge/Nudge.mjs +0 -1
  198. package/build/nudge/Nudge.mjs.map +1 -1
  199. package/build/overlayHeader/OverlayHeader.js +0 -1
  200. package/build/overlayHeader/OverlayHeader.js.map +1 -1
  201. package/build/overlayHeader/OverlayHeader.mjs +0 -1
  202. package/build/overlayHeader/OverlayHeader.mjs.map +1 -1
  203. package/build/phoneNumberInput/PhoneNumberInput.js +0 -1
  204. package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
  205. package/build/phoneNumberInput/PhoneNumberInput.mjs +0 -1
  206. package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
  207. package/build/popover/Popover.js +0 -1
  208. package/build/popover/Popover.js.map +1 -1
  209. package/build/popover/Popover.mjs +0 -1
  210. package/build/popover/Popover.mjs.map +1 -1
  211. package/build/processIndicator/ProcessIndicator.js +0 -1
  212. package/build/processIndicator/ProcessIndicator.js.map +1 -1
  213. package/build/processIndicator/ProcessIndicator.mjs +0 -1
  214. package/build/processIndicator/ProcessIndicator.mjs.map +1 -1
  215. package/build/progressBar/ProgressBar.js +0 -1
  216. package/build/progressBar/ProgressBar.js.map +1 -1
  217. package/build/progressBar/ProgressBar.mjs +0 -1
  218. package/build/progressBar/ProgressBar.mjs.map +1 -1
  219. package/build/promoCard/PromoCard.js +0 -1
  220. package/build/promoCard/PromoCard.js.map +1 -1
  221. package/build/promoCard/PromoCard.mjs +0 -1
  222. package/build/promoCard/PromoCard.mjs.map +1 -1
  223. package/build/promoCard/PromoCardIndicator.js +0 -1
  224. package/build/promoCard/PromoCardIndicator.js.map +1 -1
  225. package/build/promoCard/PromoCardIndicator.mjs +0 -1
  226. package/build/promoCard/PromoCardIndicator.mjs.map +1 -1
  227. package/build/prompt/ActionPrompt/ActionPrompt.js +8 -41
  228. package/build/prompt/ActionPrompt/ActionPrompt.js.map +1 -1
  229. package/build/prompt/ActionPrompt/ActionPrompt.mjs +8 -41
  230. package/build/prompt/ActionPrompt/ActionPrompt.mjs.map +1 -1
  231. package/build/prompt/CriticalBanner/CriticalBanner.js +148 -0
  232. package/build/prompt/CriticalBanner/CriticalBanner.js.map +1 -0
  233. package/build/prompt/CriticalBanner/CriticalBanner.mjs +146 -0
  234. package/build/prompt/CriticalBanner/CriticalBanner.mjs.map +1 -0
  235. package/build/prompt/CriticalBanner/helpers.js +29 -0
  236. package/build/prompt/CriticalBanner/helpers.js.map +1 -0
  237. package/build/prompt/CriticalBanner/helpers.mjs +26 -0
  238. package/build/prompt/CriticalBanner/helpers.mjs.map +1 -0
  239. package/build/prompt/InfoPrompt/InfoPrompt.js +0 -1
  240. package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -1
  241. package/build/prompt/InfoPrompt/InfoPrompt.mjs +0 -1
  242. package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -1
  243. package/build/prompt/InlinePrompt/InlinePrompt.js +0 -1
  244. package/build/prompt/InlinePrompt/InlinePrompt.js.map +1 -1
  245. package/build/prompt/InlinePrompt/InlinePrompt.mjs +0 -1
  246. package/build/prompt/InlinePrompt/InlinePrompt.mjs.map +1 -1
  247. package/build/prompt/PrimitivePrompt/PrimitivePrompt.js +2 -0
  248. package/build/prompt/PrimitivePrompt/PrimitivePrompt.js.map +1 -1
  249. package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs +2 -0
  250. package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs.map +1 -1
  251. package/build/prompt/common/Expander/Expander.js +47 -0
  252. package/build/prompt/common/Expander/Expander.js.map +1 -0
  253. package/build/prompt/common/Expander/Expander.messages.js +17 -0
  254. package/build/prompt/common/Expander/Expander.messages.js.map +1 -0
  255. package/build/prompt/common/Expander/Expander.messages.mjs +13 -0
  256. package/build/prompt/common/Expander/Expander.messages.mjs.map +1 -0
  257. package/build/prompt/common/Expander/Expander.mjs +44 -0
  258. package/build/prompt/common/Expander/Expander.mjs.map +1 -0
  259. package/build/prompt/helpers/promptMedia.js +52 -0
  260. package/build/prompt/helpers/promptMedia.js.map +1 -0
  261. package/build/prompt/helpers/promptMedia.mjs +50 -0
  262. package/build/prompt/helpers/promptMedia.mjs.map +1 -0
  263. package/build/radio/Radio.js +0 -1
  264. package/build/radio/Radio.js.map +1 -1
  265. package/build/radio/Radio.mjs +0 -1
  266. package/build/radio/Radio.mjs.map +1 -1
  267. package/build/segmentedControl/SegmentedControl.js +0 -1
  268. package/build/segmentedControl/SegmentedControl.js.map +1 -1
  269. package/build/segmentedControl/SegmentedControl.mjs +0 -1
  270. package/build/segmentedControl/SegmentedControl.mjs.map +1 -1
  271. package/build/select/Select.js +0 -1
  272. package/build/select/Select.js.map +1 -1
  273. package/build/select/Select.mjs +0 -1
  274. package/build/select/Select.mjs.map +1 -1
  275. package/build/select/option/Option.js +0 -1
  276. package/build/select/option/Option.js.map +1 -1
  277. package/build/select/option/Option.mjs +0 -1
  278. package/build/select/option/Option.mjs.map +1 -1
  279. package/build/statusIcon/StatusIcon.js +0 -1
  280. package/build/statusIcon/StatusIcon.js.map +1 -1
  281. package/build/statusIcon/StatusIcon.mjs +0 -1
  282. package/build/statusIcon/StatusIcon.mjs.map +1 -1
  283. package/build/stepper/Stepper.js +0 -1
  284. package/build/stepper/Stepper.js.map +1 -1
  285. package/build/stepper/Stepper.mjs +0 -1
  286. package/build/stepper/Stepper.mjs.map +1 -1
  287. package/build/sticky/Sticky.js +0 -1
  288. package/build/sticky/Sticky.js.map +1 -1
  289. package/build/sticky/Sticky.mjs +0 -1
  290. package/build/sticky/Sticky.mjs.map +1 -1
  291. package/build/styles/css/neptune.css +22 -22
  292. package/build/styles/less/neptune-tokens.less +4 -4
  293. package/build/styles/main.css +130 -51
  294. package/build/styles/prompt/CriticalBanner/CriticalBanner.css +59 -0
  295. package/build/styles/prompt/common/Expander/Expander.css +8 -0
  296. package/build/styles/props/neptune-tokens.css +2 -2
  297. package/build/styles/styles/less/neptune.css +22 -22
  298. package/build/summary/Summary.js +0 -1
  299. package/build/summary/Summary.js.map +1 -1
  300. package/build/summary/Summary.mjs +0 -1
  301. package/build/summary/Summary.mjs.map +1 -1
  302. package/build/table/Table.js +0 -1
  303. package/build/table/Table.js.map +1 -1
  304. package/build/table/Table.mjs +0 -1
  305. package/build/table/Table.mjs.map +1 -1
  306. package/build/table/TableRow.js +0 -1
  307. package/build/table/TableRow.js.map +1 -1
  308. package/build/table/TableRow.mjs +0 -1
  309. package/build/table/TableRow.mjs.map +1 -1
  310. package/build/table/TableStatusText.js +0 -1
  311. package/build/table/TableStatusText.js.map +1 -1
  312. package/build/table/TableStatusText.mjs +0 -1
  313. package/build/table/TableStatusText.mjs.map +1 -1
  314. package/build/tabs/Tabs.js +0 -1
  315. package/build/tabs/Tabs.js.map +1 -1
  316. package/build/tabs/Tabs.mjs +0 -1
  317. package/build/tabs/Tabs.mjs.map +1 -1
  318. package/build/tile/Tile.js +0 -1
  319. package/build/tile/Tile.js.map +1 -1
  320. package/build/tile/Tile.mjs +0 -1
  321. package/build/tile/Tile.mjs.map +1 -1
  322. package/build/title/Title.js +0 -1
  323. package/build/title/Title.js.map +1 -1
  324. package/build/title/Title.mjs +0 -1
  325. package/build/title/Title.mjs.map +1 -1
  326. package/build/tooltip/Tooltip.js +50 -30
  327. package/build/tooltip/Tooltip.js.map +1 -1
  328. package/build/tooltip/Tooltip.mjs +51 -31
  329. package/build/tooltip/Tooltip.mjs.map +1 -1
  330. package/build/typeahead/Typeahead.js +5 -5
  331. package/build/typeahead/Typeahead.mjs +5 -5
  332. package/build/types/common/locale/index.d.ts +1 -1
  333. package/build/types/common/locale/index.d.ts.map +1 -1
  334. package/build/types/common/panel/Panel.d.ts.map +1 -1
  335. package/build/types/expressiveMoneyInput/currencySelector/CurrencySelector.d.ts.map +1 -1
  336. package/build/types/index.d.ts +2 -2
  337. package/build/types/index.d.ts.map +1 -1
  338. package/build/types/moneyInput/MoneyInput.d.ts +0 -6
  339. package/build/types/moneyInput/MoneyInput.d.ts.map +1 -1
  340. package/build/types/moneyInput/currencyFormatting.d.ts +3 -4
  341. package/build/types/moneyInput/currencyFormatting.d.ts.map +1 -1
  342. package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts +2 -11
  343. package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts.map +1 -1
  344. package/build/types/prompt/CriticalBanner/CriticalBanner.d.ts +40 -0
  345. package/build/types/prompt/CriticalBanner/CriticalBanner.d.ts.map +1 -0
  346. package/build/types/prompt/CriticalBanner/helpers.d.ts +18 -0
  347. package/build/types/prompt/CriticalBanner/helpers.d.ts.map +1 -0
  348. package/build/types/prompt/CriticalBanner/index.d.ts +3 -0
  349. package/build/types/prompt/CriticalBanner/index.d.ts.map +1 -0
  350. package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts +8 -3
  351. package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts.map +1 -1
  352. package/build/types/prompt/common/Expander/Expander.d.ts +20 -0
  353. package/build/types/prompt/common/Expander/Expander.d.ts.map +1 -0
  354. package/build/types/prompt/common/Expander/Expander.messages.d.ts +14 -0
  355. package/build/types/prompt/common/Expander/Expander.messages.d.ts.map +1 -0
  356. package/build/types/prompt/helpers/promptMedia.d.ts +22 -0
  357. package/build/types/prompt/helpers/promptMedia.d.ts.map +1 -0
  358. package/build/types/prompt/index.d.ts +2 -0
  359. package/build/types/prompt/index.d.ts.map +1 -1
  360. package/build/types/test-utils/index.d.ts +4 -0
  361. package/build/types/test-utils/index.d.ts.map +1 -1
  362. package/build/types/tooltip/Tooltip.d.ts.map +1 -1
  363. package/build/upload/Upload.js +0 -1
  364. package/build/upload/Upload.js.map +1 -1
  365. package/build/upload/Upload.mjs +0 -1
  366. package/build/upload/Upload.mjs.map +1 -1
  367. package/build/upload/steps/completeStep/completeStep.js +0 -1
  368. package/build/upload/steps/completeStep/completeStep.js.map +1 -1
  369. package/build/upload/steps/completeStep/completeStep.mjs +0 -1
  370. package/build/upload/steps/completeStep/completeStep.mjs.map +1 -1
  371. package/build/upload/steps/processingStep/processingStep.js +0 -1
  372. package/build/upload/steps/processingStep/processingStep.js.map +1 -1
  373. package/build/upload/steps/processingStep/processingStep.mjs +0 -1
  374. package/build/upload/steps/processingStep/processingStep.mjs.map +1 -1
  375. package/build/upload/steps/uploadImageStep/uploadImageStep.js +0 -1
  376. package/build/upload/steps/uploadImageStep/uploadImageStep.js.map +1 -1
  377. package/build/upload/steps/uploadImageStep/uploadImageStep.mjs +0 -1
  378. package/build/upload/steps/uploadImageStep/uploadImageStep.mjs.map +1 -1
  379. package/build/uploadInput/UploadInput.js +0 -1
  380. package/build/uploadInput/UploadInput.js.map +1 -1
  381. package/build/uploadInput/UploadInput.mjs +0 -1
  382. package/build/uploadInput/UploadInput.mjs.map +1 -1
  383. package/build/uploadInput/uploadButton/UploadButton.js +0 -1
  384. package/build/uploadInput/uploadButton/UploadButton.js.map +1 -1
  385. package/build/uploadInput/uploadButton/UploadButton.mjs +0 -1
  386. package/build/uploadInput/uploadButton/UploadButton.mjs.map +1 -1
  387. package/build/uploadInput/uploadButton/defaults.js +0 -1
  388. package/build/uploadInput/uploadButton/defaults.js.map +1 -1
  389. package/build/uploadInput/uploadButton/defaults.mjs +0 -1
  390. package/build/uploadInput/uploadButton/defaults.mjs.map +1 -1
  391. package/build/uploadInput/uploadItem/UploadItem.js +0 -1
  392. package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
  393. package/build/uploadInput/uploadItem/UploadItem.mjs +0 -1
  394. package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -1
  395. package/build/withDisplayFormat/WithDisplayFormat.js +0 -1
  396. package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
  397. package/build/withDisplayFormat/WithDisplayFormat.mjs +0 -1
  398. package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
  399. package/package.json +16 -14
  400. package/src/common/locale/index.test.ts +4 -13
  401. package/src/common/locale/index.ts +3 -9
  402. package/src/common/panel/Panel.tsx +50 -42
  403. package/src/expressiveMoneyInput/ExpressiveMoneyInput.story.tsx +0 -18
  404. package/src/expressiveMoneyInput/currencySelector/CurrencySelector.test.tsx +1 -119
  405. package/src/expressiveMoneyInput/currencySelector/CurrencySelector.tsx +3 -4
  406. package/src/i18n/en.json +2 -0
  407. package/src/index.ts +2 -2
  408. package/src/main.css +130 -51
  409. package/src/main.less +3 -1
  410. package/src/moneyInput/MoneyInput.story.tsx +1 -10
  411. package/src/moneyInput/MoneyInput.test.story.tsx +1 -141
  412. package/src/moneyInput/MoneyInput.test.tsx +0 -45
  413. package/src/moneyInput/MoneyInput.tsx +3 -27
  414. package/src/moneyInput/currencyFormatting.ts +5 -11
  415. package/src/prompt/ActionPrompt/ActionPrompt.tsx +9 -62
  416. package/src/prompt/CriticalBanner/CriticalBanner.accessibility.docs.mdx +131 -0
  417. package/src/prompt/CriticalBanner/CriticalBanner.css +59 -0
  418. package/src/prompt/CriticalBanner/CriticalBanner.less +64 -0
  419. package/src/prompt/CriticalBanner/CriticalBanner.story.tsx +645 -0
  420. package/src/prompt/CriticalBanner/CriticalBanner.test.story.tsx +285 -0
  421. package/src/prompt/CriticalBanner/CriticalBanner.tsx +194 -0
  422. package/src/prompt/CriticalBanner/helpers.ts +39 -0
  423. package/src/prompt/CriticalBanner/index.ts +2 -0
  424. package/src/prompt/PrimitivePrompt/PrimitivePrompt.tsx +9 -2
  425. package/src/prompt/common/Expander/Expander.css +8 -0
  426. package/src/prompt/common/Expander/Expander.less +9 -0
  427. package/src/prompt/common/Expander/Expander.messages.ts +14 -0
  428. package/src/prompt/common/Expander/Expander.test.tsx +167 -0
  429. package/src/prompt/common/Expander/Expander.tsx +83 -0
  430. package/src/prompt/helpers/promptMedia.tsx +79 -0
  431. package/src/prompt/index.ts +4 -0
  432. package/src/sentimentSurface/SentimentSurface.story.tsx +43 -17
  433. package/src/styles/less/neptune.css +22 -22
  434. package/src/tooltip/Tooltip.tsx +45 -26
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var react = require('@floating-ui/react');
6
5
  var clsx = require('clsx');
7
6
  var React = require('react');
7
+ var reactPopper = require('react-popper');
8
8
  require('../theme.js');
9
9
  require('../direction.js');
10
10
  require('../propsValues/control.js');
@@ -24,7 +24,6 @@ require('../propsValues/variant.js');
24
24
  require('../propsValues/scroll.js');
25
25
  require('../propsValues/markdownNodeType.js');
26
26
  require('../fileType.js');
27
- require('@transferwise/formatting');
28
27
  require('@transferwise/icons');
29
28
  require('react-intl');
30
29
  require('../closeButton/CloseButton.messages.js');
@@ -32,7 +31,7 @@ var jsxRuntime = require('react/jsx-runtime');
32
31
  var Dimmer = require('../../dimmer/Dimmer.js');
33
32
  var OverlayIdProvider = require('../../provider/overlay/OverlayIdProvider.js');
34
33
 
35
- const POPOVER_OFFSET = 16;
34
+ const POPOVER_OFFSET = [0, 16];
36
35
  // By default the flip positioning explores only the opposite alternative. So if left is passed and there's no enough space
37
36
  // the right one gets chosen. If there's no space on both sides popover goes back to the initially chosen one left.
38
37
  // This mapping forces popover to try the four available positions before going back to the initial chosen one.
@@ -55,46 +54,60 @@ const Panel = /*#__PURE__*/React.forwardRef(function Panel({
55
54
  considerHeight = false,
56
55
  ...rest
57
56
  }, reference) {
58
- const arrowRef = React.useRef(null);
59
- const middleware = [];
60
- if (arrow) {
61
- middleware.push(react.offset(POPOVER_OFFSET));
62
- }
63
- if (flip && fallbackPlacements[position$1]) {
64
- middleware.push(react.flip({
65
- fallbackPlacements: fallbackPlacements[position$1]
66
- }));
67
- }
57
+ const [arrowElement, setArrowElement] = React.useState(null);
58
+ const [popperElement, setPopperElement] = React.useState(null);
59
+ const modifiers = [];
68
60
  if (altAxis) {
69
- middleware.push(react.shift());
61
+ modifiers.push({
62
+ // https://popper.js.org/docs/v2/modifiers/prevent-overflow
63
+ name: 'preventOverflow',
64
+ options: {
65
+ altAxis: true,
66
+ tether: false
67
+ }
68
+ });
70
69
  }
71
70
  if (arrow) {
72
- middleware.push(react.arrow({
73
- element: arrowRef,
74
- padding: 8
75
- }));
71
+ modifiers.push({
72
+ name: 'arrow',
73
+ options: {
74
+ element: arrowElement,
75
+ options: {
76
+ padding: 8 // 8px from the edges of the popper
77
+ }
78
+ }
79
+ });
80
+ // This lets you displace a popper element from its reference element.
81
+ modifiers.push({
82
+ name: 'offset',
83
+ options: {
84
+ offset: POPOVER_OFFSET
85
+ }
86
+ });
87
+ }
88
+ if (flip && fallbackPlacements[position$1]) {
89
+ modifiers.push({
90
+ name: 'flip',
91
+ options: {
92
+ fallbackPlacements: fallbackPlacements[position$1]
93
+ }
94
+ });
76
95
  }
77
96
  const {
78
- refs,
79
- floatingStyles,
80
- placement,
81
- middlewareData
82
- } = react.useFloating({
97
+ styles,
98
+ attributes,
99
+ forceUpdate
100
+ } = reactPopper.usePopper(anchorRef.current, popperElement, {
83
101
  placement: position$1,
84
- middleware,
85
- elements: {
86
- reference: anchorRef.current
87
- },
88
- whileElementsMounted: open ? react.autoUpdate : undefined
102
+ modifiers
89
103
  });
90
- const arrowStyle = {
91
- ...(middlewareData.arrow?.x != null ? {
92
- left: middlewareData.arrow.x
93
- } : {}),
94
- ...(middlewareData.arrow?.y != null ? {
95
- top: middlewareData.arrow.y
96
- } : {})
97
- };
104
+ // If the trigger is not visible when the position is calculated, it will be incorrect. Because this can happen repeatedly (on resize for example),
105
+ // it is most simple just to always position before opening
106
+ React.useEffect(() => {
107
+ if (open && forceUpdate) {
108
+ forceUpdate();
109
+ }
110
+ }, [open]);
98
111
  const contentStyle = {
99
112
  ...(anchorWidth ? {
100
113
  width: anchorRef.current?.clientWidth
@@ -110,10 +123,12 @@ const Panel = /*#__PURE__*/React.forwardRef(function Panel({
110
123
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
111
124
  id: overlayId,
112
125
  ...rest,
113
- ref: refs.setFloating,
126
+ ref: setPopperElement,
114
127
  role: "dialog",
115
- style: floatingStyles,
116
- "data-popper-placement": placement,
128
+ style: {
129
+ ...styles.popper
130
+ },
131
+ ...attributes.popper,
117
132
  className: clsx.clsx('np-panel', {
118
133
  'np-panel--open': open
119
134
  }, rest.className),
@@ -122,9 +137,9 @@ const Panel = /*#__PURE__*/React.forwardRef(function Panel({
122
137
  style: contentStyle,
123
138
  className: clsx.clsx('np-panel__content'),
124
139
  children: [children, arrow && /*#__PURE__*/jsxRuntime.jsx("div", {
125
- ref: arrowRef,
140
+ ref: setArrowElement,
126
141
  className: clsx.clsx('np-panel__arrow'),
127
- style: arrowStyle
142
+ style: styles.arrow
128
143
  })]
129
144
  })
130
145
  })
@@ -1 +1 @@
1
- {"version":3,"file":"Panel.js","sources":["../../../src/common/panel/Panel.tsx"],"sourcesContent":["import {\n arrow as arrowMiddleware,\n autoUpdate,\n flip as flipMiddleware,\n offset,\n type Placement,\n shift,\n useFloating,\n} from '@floating-ui/react';\nimport { clsx } from 'clsx';\nimport {\n CSSProperties,\n HTMLAttributes,\n MutableRefObject,\n PropsWithChildren,\n SyntheticEvent,\n forwardRef,\n useContext,\n useRef,\n} from 'react';\n\nimport { Position, PositionBottom, PositionLeft, PositionRight, PositionTop } from '..';\nimport Dimmer from '../../dimmer';\nimport { OverlayIdContext } from '../../provider/overlay/OverlayIdProvider';\n\nconst POPOVER_OFFSET = 16;\n\n// By default the flip positioning explores only the opposite alternative. So if left is passed and there's no enough space\n// the right one gets chosen. If there's no space on both sides popover goes back to the initially chosen one left.\n// This mapping forces popover to try the four available positions before going back to the initial chosen one.\nconst fallbackPlacements: Record<string, Placement[]> = {\n [Position.TOP]: [Position.BOTTOM, Position.RIGHT, Position.LEFT],\n [Position.BOTTOM]: [Position.TOP, Position.RIGHT, Position.LEFT],\n [Position.LEFT]: [Position.RIGHT, Position.TOP, Position.BOTTOM],\n [Position.RIGHT]: [Position.LEFT, Position.TOP, Position.BOTTOM],\n};\n\nexport type PanelProps = PropsWithChildren<{\n arrow?: boolean;\n flip?: boolean;\n altAxis?: boolean;\n open?: boolean;\n onClose?: (event: Event | SyntheticEvent) => void;\n position?: PositionBottom | PositionLeft | PositionRight | PositionTop;\n anchorRef: MutableRefObject<Element | null>;\n anchorWidth?: boolean;\n considerHeight?: boolean;\n}> &\n HTMLAttributes<HTMLDivElement>;\n\nconst Panel = forwardRef<HTMLDivElement, PanelProps>(function Panel(\n {\n arrow = false,\n flip = true,\n altAxis = false,\n children,\n open = false,\n onClose,\n position = Position.BOTTOM,\n anchorRef,\n anchorWidth = false,\n considerHeight = false,\n ...rest\n }: PanelProps,\n reference,\n) {\n const arrowRef = useRef<HTMLDivElement | null>(null);\n\n const middleware = [];\n\n if (arrow) {\n middleware.push(offset(POPOVER_OFFSET));\n }\n\n if (flip && fallbackPlacements[position]) {\n middleware.push(\n flipMiddleware({\n fallbackPlacements: fallbackPlacements[position],\n }),\n );\n }\n\n if (altAxis) {\n middleware.push(shift());\n }\n\n if (arrow) {\n middleware.push(arrowMiddleware({ element: arrowRef, padding: 8 }));\n }\n\n const { refs, floatingStyles, placement, middlewareData } = useFloating({\n placement: position,\n middleware,\n elements: {\n reference: anchorRef.current,\n },\n whileElementsMounted: open ? autoUpdate : undefined,\n });\n\n const arrowStyle: CSSProperties = {\n ...(middlewareData.arrow?.x != null ? { left: middlewareData.arrow.x } : {}),\n ...(middlewareData.arrow?.y != null ? { top: middlewareData.arrow.y } : {}),\n };\n\n const contentStyle: CSSProperties = {\n ...(anchorWidth ? { width: anchorRef.current?.clientWidth } : undefined),\n };\n\n const overlayId = useContext(OverlayIdContext);\n\n return (\n <Dimmer open={open} transparent fadeContentOnEnter fadeContentOnExit onClose={onClose}>\n <div\n id={overlayId}\n {...rest}\n ref={refs.setFloating}\n role=\"dialog\"\n style={floatingStyles}\n data-popper-placement={placement}\n className={clsx('np-panel', { 'np-panel--open': open }, rest.className)}\n >\n <div ref={reference} style={contentStyle} className={clsx('np-panel__content')}>\n {children}\n {/* Arrow has to stay inside content to get the same animations as the \"dialog\" and to get hidden when panel is closed. */}\n {arrow && <div ref={arrowRef} className={clsx('np-panel__arrow')} style={arrowStyle} />}\n </div>\n </div>\n </Dimmer>\n );\n});\n\nexport default Panel;\n"],"names":["POPOVER_OFFSET","fallbackPlacements","Position","TOP","BOTTOM","RIGHT","LEFT","Panel","forwardRef","arrow","flip","altAxis","children","open","onClose","position","anchorRef","anchorWidth","considerHeight","rest","reference","arrowRef","useRef","middleware","push","offset","flipMiddleware","shift","arrowMiddleware","element","padding","refs","floatingStyles","placement","middlewareData","useFloating","elements","current","whileElementsMounted","autoUpdate","undefined","arrowStyle","x","left","y","top","contentStyle","width","clientWidth","overlayId","useContext","OverlayIdContext","_jsx","Dimmer","transparent","fadeContentOnEnter","fadeContentOnExit","id","ref","setFloating","role","style","className","clsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAMA,cAAc,GAAG,EAAE;AAEzB;AACA;AACA;AACA,MAAMC,kBAAkB,GAAgC;AACtD,EAAA,CAACC,iBAAQ,CAACC,GAAG,GAAG,CAACD,iBAAQ,CAACE,MAAM,EAAEF,iBAAQ,CAACG,KAAK,EAAEH,iBAAQ,CAACI,IAAI,CAAC;AAChE,EAAA,CAACJ,iBAAQ,CAACE,MAAM,GAAG,CAACF,iBAAQ,CAACC,GAAG,EAAED,iBAAQ,CAACG,KAAK,EAAEH,iBAAQ,CAACI,IAAI,CAAC;AAChE,EAAA,CAACJ,iBAAQ,CAACI,IAAI,GAAG,CAACJ,iBAAQ,CAACG,KAAK,EAAEH,iBAAQ,CAACC,GAAG,EAAED,iBAAQ,CAACE,MAAM,CAAC;AAChE,EAAA,CA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SAAI,CAAC,UAAU,EAAE;AAAE,QAAA,gBAAgB,EAAElD;AAAI,OAAE,EAAEM,IAAI,CAAC2C,SAAS,CAAE;AAAAlD,MAAAA,QAAA,eAExEoD,eAAA,CAAA,KAAA,EAAA;AAAKN,QAAAA,GAAG,EAAEtC,SAAU;AAACyC,QAAAA,KAAK,EAAEf,YAAa;AAACgB,QAAAA,SAAS,EAAEC,SAAI,CAAC,mBAAmB,CAAE;AAAAnD,QAAAA,QAAA,EAAA,CAC5EA,QAAQ,EAERH,KAAK,iBAAI2C,cAAA,CAAA,KAAA,EAAA;AAAKM,UAAAA,GAAG,EAAErC,QAAS;AAACyC,UAAAA,SAAS,EAAEC,SAAI,CAAC,iBAAiB,CAAE;AAACF,UAAAA,KAAK,EAAEpB;AAAW,SAAA,CAAG;OACpF;KACF;AACP,GAAQ,CAAC;AAEb,CAAC;;;;"}
1
+ {"version":3,"file":"Panel.js","sources":["../../../src/common/panel/Panel.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport {\n CSSProperties,\n HTMLAttributes,\n MutableRefObject,\n PropsWithChildren,\n SyntheticEvent,\n forwardRef,\n useContext,\n useEffect,\n useState,\n} from 'react';\nimport { usePopper } from 'react-popper';\n\nimport { Position, PositionBottom, PositionLeft, PositionRight, PositionTop } from '..';\nimport Dimmer from '../../dimmer';\nimport { OverlayIdContext } from '../../provider/overlay/OverlayIdProvider';\n\nconst POPOVER_OFFSET = [0, 16];\n\n// By default the flip positioning explores only the opposite alternative. So if left is passed and there's no enough space\n// the right one gets chosen. If there's no space on both sides popover goes back to the initially chosen one left.\n// This mapping forces popover to try the four available positions before going back to the initial chosen one.\nconst fallbackPlacements = {\n [Position.TOP]: [Position.BOTTOM, Position.RIGHT, Position.LEFT],\n [Position.BOTTOM]: [Position.TOP, Position.RIGHT, Position.LEFT],\n [Position.LEFT]: [Position.RIGHT, Position.TOP, Position.BOTTOM],\n [Position.RIGHT]: [Position.LEFT, Position.TOP, Position.BOTTOM],\n};\n\nexport type PanelProps = PropsWithChildren<{\n arrow?: boolean;\n flip?: boolean;\n altAxis?: boolean;\n open?: boolean;\n onClose?: (event: Event | SyntheticEvent) => void;\n position?: PositionBottom | PositionLeft | PositionRight | PositionTop;\n anchorRef: MutableRefObject<Element | null>;\n anchorWidth?: boolean;\n considerHeight?: boolean;\n}> &\n HTMLAttributes<HTMLDivElement>;\n\nconst Panel = forwardRef<HTMLDivElement, PanelProps>(function Panel(\n {\n arrow = false,\n flip = true,\n altAxis = false,\n children,\n open = false,\n onClose,\n position = Position.BOTTOM,\n anchorRef,\n anchorWidth = false,\n considerHeight = false,\n ...rest\n }: PanelProps,\n reference,\n) {\n const [arrowElement, setArrowElement] = useState<HTMLDivElement | null>(null);\n const [popperElement, setPopperElement] = useState<HTMLDivElement | null>(null);\n\n const modifiers = [];\n\n if (altAxis) {\n modifiers.push({\n // https://popper.js.org/docs/v2/modifiers/prevent-overflow\n name: 'preventOverflow',\n options: {\n altAxis: true,\n tether: false,\n },\n });\n }\n\n if (arrow) {\n modifiers.push({\n name: 'arrow',\n options: {\n element: arrowElement,\n options: {\n padding: 8, // 8px from the edges of the popper\n },\n },\n });\n // This lets you displace a popper element from its reference element.\n modifiers.push({ name: 'offset', options: { offset: POPOVER_OFFSET } });\n }\n if (flip && fallbackPlacements[position]) {\n modifiers.push({\n name: 'flip',\n options: {\n fallbackPlacements: fallbackPlacements[position],\n },\n });\n }\n\n const { styles, attributes, forceUpdate } = usePopper(anchorRef.current, popperElement, {\n placement: position,\n modifiers,\n });\n\n // If the trigger is not visible when the position is calculated, it will be incorrect. Because this can happen repeatedly (on resize for example),\n // it is most simple just to always position before opening\n useEffect(() => {\n if (open && forceUpdate) {\n forceUpdate();\n }\n }, [open]);\n\n const contentStyle: CSSProperties = {\n ...(anchorWidth ? { width: anchorRef.current?.clientWidth } : undefined),\n };\n\n const overlayId = useContext(OverlayIdContext);\n\n return (\n <Dimmer open={open} transparent fadeContentOnEnter fadeContentOnExit onClose={onClose}>\n <div\n id={overlayId}\n {...rest}\n ref={setPopperElement}\n role=\"dialog\"\n style={{ ...styles.popper }}\n {...attributes.popper}\n className={clsx('np-panel', { 'np-panel--open': open }, rest.className)}\n >\n <div ref={reference} style={contentStyle} className={clsx('np-panel__content')}>\n {children}\n {/* Arrow has to stay inside content to get the same animations as the \"dialog\" and to get hidden when panel is closed. */}\n {arrow && (\n <div ref={setArrowElement} className={clsx('np-panel__arrow')} style={styles.arrow} />\n )}\n </div>\n </div>\n </Dimmer>\n );\n});\n\nexport default Panel;\n"],"names":["POPOVER_OFFSET","fallbackPlacements","Position","TOP","BOTTOM","RIGHT","LEFT","Panel","forwardRef","arrow","flip","altAxis","children","open","onClose","position","anchorRef","anchorWidth","considerHeight","rest","reference","arrowElement","setArrowElement","useState","popperElement","setPopperElement","modifiers","push","name","options","tether","element","padding","offset","styles","attributes","forceUpdate","usePopper","current","placement","useEffect","contentStyle","width","clientWidth","undefined","overlayId","useContext","OverlayIdContext","_jsx","Dimmer","transparent","fadeContentOnEnter","fadeContentOnExit","id","ref","role","style","popper","className","clsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAMA,cAAc,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC;AAE9B;AACA;AACA;AACA,MAAMC,kBAAkB,GAAG;AACzB,EAAA,CAACC,iBAAQ,CAACC,GAAG,GAAG,CAACD,iBAAQ,CAACE,MAAM,EAAEF,iBAAQ,CAACG,KAAK,EAAEH,iBAAQ,CAACI,IAAI,CAAC;AAChE,EAAA,CAACJ,iBAAQ,CAACE,MAAM,GAAG,CAACF,iBAAQ,CAACC,GAAG,EAAED,iBAAQ,CAACG,KAAK,EAAEH,iBAAQ,CAACI,IAAI,CAAC;AAChE,EAAA,CAACJ,iBAAQ,CAACI,IAAI,GAAG,CAACJ,iBAAQ,CAACG,KAAK,EAAEH,iBAAQ,CAACC,GAAG,EAAED,iBAAQ,CAACE,MAAM,CAAC;AAChE,EAAA,CAAC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AAA,KAAK,EAAE;AAAE,QAAA,GAAGtB,MAAM,CAACuB;OAAS;MAAA,GACxBtB,UAAU,CAACsB,MAAM;AACrBC,MAAAA,SAAS,EAAEC,SAAI,CAAC,UAAU,EAAE;AAAE,QAAA,gBAAgB,EAAE9C;AAAI,OAAE,EAAEM,IAAI,CAACuC,SAAS,CAAE;AAAA9C,MAAAA,QAAA,eAExEgD,eAAA,CAAA,KAAA,EAAA;AAAKN,QAAAA,GAAG,EAAElC,SAAU;AAACoC,QAAAA,KAAK,EAAEf,YAAa;AAACiB,QAAAA,SAAS,EAAEC,SAAI,CAAC,mBAAmB,CAAE;AAAA/C,QAAAA,QAAA,EAAA,CAC5EA,QAAQ,EAERH,KAAK,iBACJuC,cAAA,CAAA,KAAA,EAAA;AAAKM,UAAAA,GAAG,EAAEhC,eAAgB;AAACoC,UAAAA,SAAS,EAAEC,SAAI,CAAC,iBAAiB,CAAE;UAACH,KAAK,EAAEtB,MAAM,CAACzB;AAAM,SAAA,CACpF;OACE;KACF;AACP,GAAQ,CAAC;AAEb,CAAC;;;;"}
@@ -1,6 +1,6 @@
1
- import { offset, flip, shift, arrow, useFloating, autoUpdate } from '@floating-ui/react';
2
1
  import { clsx } from 'clsx';
3
- import { forwardRef, useRef, useContext } from 'react';
2
+ import { forwardRef, useState, useEffect, useContext } from 'react';
3
+ import { usePopper } from 'react-popper';
4
4
  import '../theme.mjs';
5
5
  import '../direction.mjs';
6
6
  import '../propsValues/control.mjs';
@@ -20,7 +20,6 @@ import '../propsValues/variant.mjs';
20
20
  import '../propsValues/scroll.mjs';
21
21
  import '../propsValues/markdownNodeType.mjs';
22
22
  import '../fileType.mjs';
23
- import '@transferwise/formatting';
24
23
  import '@transferwise/icons';
25
24
  import 'react-intl';
26
25
  import '../closeButton/CloseButton.messages.mjs';
@@ -28,7 +27,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
28
27
  import Dimmer from '../../dimmer/Dimmer.mjs';
29
28
  import { OverlayIdContext } from '../../provider/overlay/OverlayIdProvider.mjs';
30
29
 
31
- const POPOVER_OFFSET = 16;
30
+ const POPOVER_OFFSET = [0, 16];
32
31
  // By default the flip positioning explores only the opposite alternative. So if left is passed and there's no enough space
33
32
  // the right one gets chosen. If there's no space on both sides popover goes back to the initially chosen one left.
34
33
  // This mapping forces popover to try the four available positions before going back to the initial chosen one.
@@ -39,8 +38,8 @@ const fallbackPlacements = {
39
38
  [Position.RIGHT]: [Position.LEFT, Position.TOP, Position.BOTTOM]
40
39
  };
41
40
  const Panel = /*#__PURE__*/forwardRef(function Panel({
42
- arrow: arrow$1 = false,
43
- flip: flip$1 = true,
41
+ arrow = false,
42
+ flip = true,
44
43
  altAxis = false,
45
44
  children,
46
45
  open = false,
@@ -51,46 +50,60 @@ const Panel = /*#__PURE__*/forwardRef(function Panel({
51
50
  considerHeight = false,
52
51
  ...rest
53
52
  }, reference) {
54
- const arrowRef = useRef(null);
55
- const middleware = [];
56
- if (arrow$1) {
57
- middleware.push(offset(POPOVER_OFFSET));
58
- }
59
- if (flip$1 && fallbackPlacements[position]) {
60
- middleware.push(flip({
61
- fallbackPlacements: fallbackPlacements[position]
62
- }));
63
- }
53
+ const [arrowElement, setArrowElement] = useState(null);
54
+ const [popperElement, setPopperElement] = useState(null);
55
+ const modifiers = [];
64
56
  if (altAxis) {
65
- middleware.push(shift());
57
+ modifiers.push({
58
+ // https://popper.js.org/docs/v2/modifiers/prevent-overflow
59
+ name: 'preventOverflow',
60
+ options: {
61
+ altAxis: true,
62
+ tether: false
63
+ }
64
+ });
66
65
  }
67
- if (arrow$1) {
68
- middleware.push(arrow({
69
- element: arrowRef,
70
- padding: 8
71
- }));
66
+ if (arrow) {
67
+ modifiers.push({
68
+ name: 'arrow',
69
+ options: {
70
+ element: arrowElement,
71
+ options: {
72
+ padding: 8 // 8px from the edges of the popper
73
+ }
74
+ }
75
+ });
76
+ // This lets you displace a popper element from its reference element.
77
+ modifiers.push({
78
+ name: 'offset',
79
+ options: {
80
+ offset: POPOVER_OFFSET
81
+ }
82
+ });
83
+ }
84
+ if (flip && fallbackPlacements[position]) {
85
+ modifiers.push({
86
+ name: 'flip',
87
+ options: {
88
+ fallbackPlacements: fallbackPlacements[position]
89
+ }
90
+ });
72
91
  }
73
92
  const {
74
- refs,
75
- floatingStyles,
76
- placement,
77
- middlewareData
78
- } = useFloating({
93
+ styles,
94
+ attributes,
95
+ forceUpdate
96
+ } = usePopper(anchorRef.current, popperElement, {
79
97
  placement: position,
80
- middleware,
81
- elements: {
82
- reference: anchorRef.current
83
- },
84
- whileElementsMounted: open ? autoUpdate : undefined
98
+ modifiers
85
99
  });
86
- const arrowStyle = {
87
- ...(middlewareData.arrow?.x != null ? {
88
- left: middlewareData.arrow.x
89
- } : {}),
90
- ...(middlewareData.arrow?.y != null ? {
91
- top: middlewareData.arrow.y
92
- } : {})
93
- };
100
+ // If the trigger is not visible when the position is calculated, it will be incorrect. Because this can happen repeatedly (on resize for example),
101
+ // it is most simple just to always position before opening
102
+ useEffect(() => {
103
+ if (open && forceUpdate) {
104
+ forceUpdate();
105
+ }
106
+ }, [open]);
94
107
  const contentStyle = {
95
108
  ...(anchorWidth ? {
96
109
  width: anchorRef.current?.clientWidth
@@ -106,10 +119,12 @@ const Panel = /*#__PURE__*/forwardRef(function Panel({
106
119
  children: /*#__PURE__*/jsx("div", {
107
120
  id: overlayId,
108
121
  ...rest,
109
- ref: refs.setFloating,
122
+ ref: setPopperElement,
110
123
  role: "dialog",
111
- style: floatingStyles,
112
- "data-popper-placement": placement,
124
+ style: {
125
+ ...styles.popper
126
+ },
127
+ ...attributes.popper,
113
128
  className: clsx('np-panel', {
114
129
  'np-panel--open': open
115
130
  }, rest.className),
@@ -117,10 +132,10 @@ const Panel = /*#__PURE__*/forwardRef(function Panel({
117
132
  ref: reference,
118
133
  style: contentStyle,
119
134
  className: clsx('np-panel__content'),
120
- children: [children, arrow$1 && /*#__PURE__*/jsx("div", {
121
- ref: arrowRef,
135
+ children: [children, arrow && /*#__PURE__*/jsx("div", {
136
+ ref: setArrowElement,
122
137
  className: clsx('np-panel__arrow'),
123
- style: arrowStyle
138
+ style: styles.arrow
124
139
  })]
125
140
  })
126
141
  })
@@ -1 +1 @@
1
- {"version":3,"file":"Panel.mjs","sources":["../../../src/common/panel/Panel.tsx"],"sourcesContent":["import {\n arrow as arrowMiddleware,\n autoUpdate,\n flip as flipMiddleware,\n offset,\n type Placement,\n shift,\n useFloating,\n} from '@floating-ui/react';\nimport { clsx } from 'clsx';\nimport {\n CSSProperties,\n HTMLAttributes,\n MutableRefObject,\n PropsWithChildren,\n SyntheticEvent,\n forwardRef,\n useContext,\n useRef,\n} from 'react';\n\nimport { Position, PositionBottom, PositionLeft, PositionRight, PositionTop } from '..';\nimport Dimmer from '../../dimmer';\nimport { OverlayIdContext } from '../../provider/overlay/OverlayIdProvider';\n\nconst POPOVER_OFFSET = 16;\n\n// By default the flip positioning explores only the opposite alternative. So if left is passed and there's no enough space\n// the right one gets chosen. If there's no space on both sides popover goes back to the initially chosen one left.\n// This mapping forces popover to try the four available positions before going back to the initial chosen one.\nconst fallbackPlacements: Record<string, Placement[]> = {\n [Position.TOP]: [Position.BOTTOM, Position.RIGHT, Position.LEFT],\n [Position.BOTTOM]: [Position.TOP, Position.RIGHT, Position.LEFT],\n [Position.LEFT]: [Position.RIGHT, Position.TOP, Position.BOTTOM],\n [Position.RIGHT]: [Position.LEFT, Position.TOP, Position.BOTTOM],\n};\n\nexport type PanelProps = PropsWithChildren<{\n arrow?: boolean;\n flip?: boolean;\n altAxis?: boolean;\n open?: boolean;\n onClose?: (event: Event | SyntheticEvent) => void;\n position?: PositionBottom | PositionLeft | PositionRight | PositionTop;\n anchorRef: MutableRefObject<Element | null>;\n anchorWidth?: boolean;\n considerHeight?: boolean;\n}> &\n HTMLAttributes<HTMLDivElement>;\n\nconst Panel = forwardRef<HTMLDivElement, PanelProps>(function Panel(\n {\n arrow = false,\n flip = true,\n altAxis = false,\n children,\n open = false,\n onClose,\n position = Position.BOTTOM,\n anchorRef,\n anchorWidth = false,\n considerHeight = false,\n ...rest\n }: PanelProps,\n reference,\n) {\n const arrowRef = useRef<HTMLDivElement | null>(null);\n\n const middleware = [];\n\n if (arrow) {\n middleware.push(offset(POPOVER_OFFSET));\n }\n\n if (flip && fallbackPlacements[position]) {\n middleware.push(\n flipMiddleware({\n fallbackPlacements: fallbackPlacements[position],\n }),\n );\n }\n\n if (altAxis) {\n middleware.push(shift());\n }\n\n if (arrow) {\n middleware.push(arrowMiddleware({ element: arrowRef, padding: 8 }));\n }\n\n const { refs, floatingStyles, placement, middlewareData } = useFloating({\n placement: position,\n middleware,\n elements: {\n reference: anchorRef.current,\n },\n whileElementsMounted: open ? autoUpdate : undefined,\n });\n\n const arrowStyle: CSSProperties = {\n ...(middlewareData.arrow?.x != null ? { left: middlewareData.arrow.x } : {}),\n ...(middlewareData.arrow?.y != null ? { top: middlewareData.arrow.y } : {}),\n };\n\n const contentStyle: CSSProperties = {\n ...(anchorWidth ? { width: anchorRef.current?.clientWidth } : undefined),\n };\n\n const overlayId = useContext(OverlayIdContext);\n\n return (\n <Dimmer open={open} transparent fadeContentOnEnter fadeContentOnExit onClose={onClose}>\n <div\n id={overlayId}\n {...rest}\n ref={refs.setFloating}\n role=\"dialog\"\n style={floatingStyles}\n data-popper-placement={placement}\n className={clsx('np-panel', { 'np-panel--open': open }, rest.className)}\n >\n <div ref={reference} style={contentStyle} className={clsx('np-panel__content')}>\n {children}\n {/* Arrow has to stay inside content to get the same animations as the \"dialog\" and to get hidden when panel is closed. */}\n {arrow && <div ref={arrowRef} className={clsx('np-panel__arrow')} style={arrowStyle} />}\n </div>\n </div>\n </Dimmer>\n );\n});\n\nexport default Panel;\n"],"names":["POPOVER_OFFSET","fallbackPlacements","Position","TOP","BOTTOM","RIGHT","LEFT","Panel","forwardRef","arrow","flip","altAxis","children","open","onClose","position","anchorRef","anchorWidth","considerHeight","rest","reference","arrowRef","useRef","middleware","push","offset","flipMiddleware","shift","arrowMiddleware","element","padding","refs","floatingStyles","placement","middlewareData","useFloating","elements","current","whileElementsMounted","autoUpdate","undefined","arrowStyle","x","left","y","top","contentStyle","width","clientWidth","overlayId","useContext","OverlayIdContext","_jsx","Dimmer","transparent","fadeContentOnEnter","fadeContentOnExit","id","ref","setFloating","role","style","className","clsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAMA,cAAc,GAAG,EAAE;AAEzB;AACA;AACA;AACA,MAAMC,kBAAkB,GAAgC;AACtD,EAAA,CAACC,QAAQ,CAACC,GAAG,GAAG,CAACD,QAAQ,CAACE,MAAM,EAAEF,QAAQ,CAACG,KAAK,EAAEH,QAAQ,CAACI,IAAI,CAAC;AAChE,EAAA,CAACJ,QAAQ,CAACE,MAAM,GAAG,CAACF,QAAQ,CAACC,GAAG,EAAED,QAAQ,CAACG,KAAK,EAAEH,QAAQ,CAACI,IAAI,CAAC;AAChE,EAAA,CAACJ,QAAQ,CAACI,IAAI,GAAG,CAACJ,QAAQ,CAACG,KAAK,EAAEH,QAAQ,CAACC,GAAG,EAAED,QAAQ,CAACE,MAAM,CAAC;AAChE,EAAA,CAACF,QAAQ,CAACG,KAAK,GAAG,CAACH,QAAQ,CAACI,IAAI,EAAEJ,QAAQ,CAACC,GAAG,EAAED,QAAQ,CAACE,MAAM;CAChE;AAeD,MAAMG,KAAK,gBAAGC,UAAU,CAA6B,SAASD,KAAKA,CACjE;AACEE,SAAAA,OAAK,GAAG,KAAK;AACbC,QAAAA,MAAI,GAAG,IAAI;AACXC,EAAAA,OAAO,GAAG,KAAK;EACfC,QAAQ;AACRC,EAAAA,IAAI,GAAG,KAAK;EACZC,OAAO;EACPC,QAAQ,GAAGb,QAAQ,CAACE,MAAM;EAC1BY,SAAS;AACTC,EAAAA,WAAW,GAAG,KAAK;AACnBC,EAAAA,cAAc,GAAG,KAAK;EACtB,GAAGC;AAAI,CACI,EACbC,SAAS,EAAA;AAET,EAAA,MAAMC,QAAQ,GAAGC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AAEb,CAAC;;;;"}
1
+ {"version":3,"file":"Panel.mjs","sources":["../../../src/common/panel/Panel.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport {\n CSSProperties,\n HTMLAttributes,\n MutableRefObject,\n PropsWithChildren,\n SyntheticEvent,\n forwardRef,\n useContext,\n useEffect,\n useState,\n} from 'react';\nimport { usePopper } from 'react-popper';\n\nimport { Position, PositionBottom, PositionLeft, PositionRight, PositionTop } from '..';\nimport Dimmer from '../../dimmer';\nimport { OverlayIdContext } from '../../provider/overlay/OverlayIdProvider';\n\nconst POPOVER_OFFSET = [0, 16];\n\n// By default the flip positioning explores only the opposite alternative. So if left is passed and there's no enough space\n// the right one gets chosen. If there's no space on both sides popover goes back to the initially chosen one left.\n// This mapping forces popover to try the four available positions before going back to the initial chosen one.\nconst fallbackPlacements = {\n [Position.TOP]: [Position.BOTTOM, Position.RIGHT, Position.LEFT],\n [Position.BOTTOM]: [Position.TOP, Position.RIGHT, Position.LEFT],\n [Position.LEFT]: [Position.RIGHT, Position.TOP, Position.BOTTOM],\n [Position.RIGHT]: [Position.LEFT, Position.TOP, Position.BOTTOM],\n};\n\nexport type PanelProps = PropsWithChildren<{\n arrow?: boolean;\n flip?: boolean;\n altAxis?: boolean;\n open?: boolean;\n onClose?: (event: Event | SyntheticEvent) => void;\n position?: PositionBottom | PositionLeft | PositionRight | PositionTop;\n anchorRef: MutableRefObject<Element | null>;\n anchorWidth?: boolean;\n considerHeight?: boolean;\n}> &\n HTMLAttributes<HTMLDivElement>;\n\nconst Panel = forwardRef<HTMLDivElement, PanelProps>(function Panel(\n {\n arrow = false,\n flip = true,\n altAxis = false,\n children,\n open = false,\n onClose,\n position = Position.BOTTOM,\n anchorRef,\n anchorWidth = false,\n considerHeight = false,\n ...rest\n }: PanelProps,\n reference,\n) {\n const [arrowElement, setArrowElement] = useState<HTMLDivElement | null>(null);\n const [popperElement, setPopperElement] = useState<HTMLDivElement | null>(null);\n\n const modifiers = [];\n\n if (altAxis) {\n modifiers.push({\n // https://popper.js.org/docs/v2/modifiers/prevent-overflow\n name: 'preventOverflow',\n options: {\n altAxis: true,\n tether: false,\n },\n });\n }\n\n if (arrow) {\n modifiers.push({\n name: 'arrow',\n options: {\n element: arrowElement,\n options: {\n padding: 8, // 8px from the edges of the popper\n },\n },\n });\n // This lets you displace a popper element from its reference element.\n modifiers.push({ name: 'offset', options: { offset: POPOVER_OFFSET } });\n }\n if (flip && fallbackPlacements[position]) {\n modifiers.push({\n name: 'flip',\n options: {\n fallbackPlacements: fallbackPlacements[position],\n },\n });\n }\n\n const { styles, attributes, forceUpdate } = usePopper(anchorRef.current, popperElement, {\n placement: position,\n modifiers,\n });\n\n // If the trigger is not visible when the position is calculated, it will be incorrect. Because this can happen repeatedly (on resize for example),\n // it is most simple just to always position before opening\n useEffect(() => {\n if (open && forceUpdate) {\n forceUpdate();\n }\n }, [open]);\n\n const contentStyle: CSSProperties = {\n ...(anchorWidth ? { width: anchorRef.current?.clientWidth } : undefined),\n };\n\n const overlayId = useContext(OverlayIdContext);\n\n return (\n <Dimmer open={open} transparent fadeContentOnEnter fadeContentOnExit onClose={onClose}>\n <div\n id={overlayId}\n {...rest}\n ref={setPopperElement}\n role=\"dialog\"\n style={{ ...styles.popper }}\n {...attributes.popper}\n className={clsx('np-panel', { 'np-panel--open': open }, rest.className)}\n >\n <div ref={reference} style={contentStyle} className={clsx('np-panel__content')}>\n {children}\n {/* Arrow has to stay inside content to get the same animations as the \"dialog\" and to get hidden when panel is closed. */}\n {arrow && (\n <div ref={setArrowElement} className={clsx('np-panel__arrow')} style={styles.arrow} />\n )}\n </div>\n </div>\n </Dimmer>\n );\n});\n\nexport default Panel;\n"],"names":["POPOVER_OFFSET","fallbackPlacements","Position","TOP","BOTTOM","RIGHT","LEFT","Panel","forwardRef","arrow","flip","altAxis","children","open","onClose","position","anchorRef","anchorWidth","considerHeight","rest","reference","arrowElement","setArrowElement","useState","popperElement","setPopperElement","modifiers","push","name","options","tether","element","padding","offset","styles","attributes","forceUpdate","usePopper","current","placement","useEffect","contentStyle","width","clientWidth","undefined","overlayId","useContext","OverlayIdContext","_jsx","Dimmer","transparent","fadeContentOnEnter","fadeContentOnExit","id","ref","role","style","popper","className","clsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAMA,cAAc,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC;AAE9B;AACA;AACA;AACA,MAAMC,kBAAkB,GAAG;AACzB,EAAA,CAACC,QAAQ,CAACC,GAAG,GAAG,CAACD,QAAQ,CAACE,MAAM,EAAEF,QAAQ,CAACG,KAAK,EAAEH,QAAQ,CAACI,IAAI,CAAC;AAChE,EAAA,CAACJ,QAAQ,CAACE,MAAM,GAAG,CAACF,QAAQ,CAACC,GAAG,EAAED,QAAQ,CAACG,KAAK,EAAEH,QAAQ,CAACI,IAAI,CAAC;AAChE,EAAA,CAACJ,QAAQ,CAACI,IAAI,GAAG,CAACJ,QAAQ,CAACG,KAAK,EAAEH,QAAQ,CAACC,GAAG,EAAED,QAAQ,CAACE,MAAM,CAAC;AAChE,EAAA,CAACF,QAAQ,CAACG,KAAK,GAAG,CAACH,QAAQ,CAACI,IAAI,EAAEJ,QAAQ,CAACC,GAAG,EAAED,QAAQ,CAACE,MAAM;CAChE;AAeD,MAAMG,KAAK,gBAAGC,UAAU,CAA6B,SAASD,KAAKA,CACjE;AACEE,EAAAA,KAAK,GAAG,KAAK;AACbC,EAAAA,IAAI,GAAG,IAAI;AACXC,EAAAA,OAAO,GAAG,KAAK;EACfC,QAAQ;AACRC,EAAAA,IAAI,GAAG,KAAK;EACZC,OAAO;EACPC,QAAQ,GAAGb,QAAQ,CAACE,MAAM;EAC1BY,SAAS;AACTC,EAAAA,WAAW,GAAG,KAAK;AACnBC,EAAAA,cAAc,GAAG,KAAK;EACtB,GAAGC;AAAI,CACI,EACbC,SAAS,EAAA;EAET,MAAM,CAACC,YAAY,EAAEC,eAAe,CAAC,GAAGC,QAAQ,CAA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C,iBAAiB,CAAE;UAACH,KAAK,EAAEtB,MAAM,CAACzB;AAAM,SAAA,CACpF;OACE;KACF;AACP,GAAQ,CAAC;AAEb,CAAC;;;;"}
@@ -23,7 +23,6 @@ require('../propsValues/variant.js');
23
23
  require('../propsValues/scroll.js');
24
24
  require('../propsValues/markdownNodeType.js');
25
25
  require('../fileType.js');
26
- require('@transferwise/formatting');
27
26
  require('@transferwise/icons');
28
27
  require('clsx');
29
28
  require('react-intl');
@@ -1 +1 @@
1
- {"version":3,"file":"ResponsivePanel.js","sources":["../../../src/common/responsivePanel/ResponsivePanel.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport { Position } from '..';\nimport BottomSheet from '../bottomSheet';\nimport { useLayout } from '../hooks';\nimport Panel, { type PanelProps } from '../panel';\nimport { isServerSide } from '../domHelpers';\n\nconst ResponsivePanel = forwardRef<HTMLDivElement, PanelProps>(function ResponsivePanel(\n {\n anchorRef,\n arrow = false,\n flip = true,\n children,\n className = undefined,\n onClose,\n open = false,\n position = Position.BOTTOM,\n anchorWidth = false,\n 'aria-label': ariaLabel,\n considerHeight = false,\n 'aria-labelledby': ariaLabelledBy,\n }: PanelProps,\n reference,\n) {\n const { isMobile } = useLayout();\n const SHORT_SCREEN = 500;\n const isShortViewport = considerHeight && !isServerSide() && window.innerHeight < SHORT_SCREEN;\n\n if (isMobile || isShortViewport) {\n return (\n <BottomSheet\n key=\"bottomSheet\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n open={open}\n className={className}\n onClose={onClose}\n >\n {children}\n </BottomSheet>\n );\n }\n return (\n <Panel\n key=\"panel\"\n ref={reference}\n flip={flip}\n arrow={arrow}\n open={open}\n position={position}\n anchorWidth={anchorWidth}\n anchorRef={anchorRef}\n aria-label={ariaLabel}\n considerHeight={considerHeight}\n aria-labelledby={ariaLabelledBy}\n className={className}\n onClose={onClose}\n >\n {children}\n </Panel>\n );\n});\n\nexport default ResponsivePanel;\n"],"names":["ResponsivePanel","forwardRef","anchorRef","arrow","flip","children","className","undefined","onClose","open","position","Position","BOTTOM","anchorWidth","ariaLabel","considerHeight","ariaLabelledBy","reference","isMobile","useLayout","SHORT_SCREEN","isShortViewport","isServerSide","window","innerHeight","_jsx","BottomSheet","Panel","ref"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAMA,eAAe,gBAAGC,gBAAU,CAA6B,SAASD,eAAeA,CACrF;EACEE,SAAS;AACTC,EAAAA,KAAK,GAAG,KAAK;AACbC,EAAAA,IAAI,GAAG,IAAI;EACXC,QAAQ;AACRC,EAAAA,SAAS,GAAGC,SAAS;EACrBC,OAAO;AACPC,EAAAA,IAAI,GAAG,KAAK;YACZC,UAAQ,GAAGC,iBAAQ,CAACC,MAAM;AAC1BC,EAAAA,WAAW,GAAG,KAAK;AACnB,EAAA,YAAY,EAAEC,SAAS;AACvBC,EAAAA,cAAc,GAAG,KAAK;AACtB,EAAA,iBAAiB,EAAEC;AAAc,CACtB,EACbC,SAAS,EAAA;EAET,MAAM;AAAEC,IAAAA;GAAU,GAAGC,mBAAS,EAAE;EAChC,MAAMC,YAAY,GAAG,GAAG;AACxB,EAAA,MAAMC,eAAe,GAAGN,cAAc,IAAI,CAACO,6BAAY,EAAE,IAAIC,MAAM,CAACC,WAAW,GAAGJ,YAAY;EAE9F,IAAIF,QAAQ,IAAIG,eAAe,EAAE;IAC/B,oBACEI,cAAA,CAACC,mBAAW,EAAA;AAEV,MAAA,YAAA,EAAYZ,SAAU;AACtB,MAAA,iBAAA,EAAiBE,cAAe;AAChCP,MAAAA,IAAI,EAAEA,IAAK;AACXH,MAAAA,SAAS,EAAEA,SAAU;AACrBE,MAAAA,OAAO,EAAEA,OAAQ;AAAAH,MAAAA,QAAA,EAEhBA;AAAQ,KAAA,EAPL,aAQO,CAAC;AAElB,EAAA;EACA,oBACEoB,cAAA,CAACE,aAAK,EAAA;AAEJC,IAAAA,GAAG,EAAEX,SAAU;AACfb,IAAAA,IAAI,EAAEA,IAAK;AACXD,IAAAA,KAAK,EAAEA,KAAM;AACbM,IAAAA,IAAI,EAAEA,IAAK;AACXC,IAAAA,QAAQ,EAAEA,UAAS;AACnBG,IAAAA,WAAW,EAAEA,WAAY;AACzBX,IAAAA,SAAS,EAAEA,SAAU;AACrB,IAAA,YAAA,EAAYY,SAAU;AACtBC,IAAAA,cAAc,EAAEA,cAAe;AAC/B,IAAA,iBAAA,EAAiBC,cAAe;AAChCV,IAAAA,SAAS,EAAEA,SAAU;AACrBE,IAAAA,OAAO,EAAEA,OAAQ;AAAAH,IAAAA,QAAA,EAEhBA;AAAQ,GAAA,EAdL,OAeC,CAAC;AAEZ,CAAC;;;;"}
1
+ {"version":3,"file":"ResponsivePanel.js","sources":["../../../src/common/responsivePanel/ResponsivePanel.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport { Position } from '..';\nimport BottomSheet from '../bottomSheet';\nimport { useLayout } from '../hooks';\nimport Panel, { type PanelProps } from '../panel';\nimport { isServerSide } from '../domHelpers';\n\nconst ResponsivePanel = forwardRef<HTMLDivElement, PanelProps>(function ResponsivePanel(\n {\n anchorRef,\n arrow = false,\n flip = true,\n children,\n className = undefined,\n onClose,\n open = false,\n position = Position.BOTTOM,\n anchorWidth = false,\n 'aria-label': ariaLabel,\n considerHeight = false,\n 'aria-labelledby': ariaLabelledBy,\n }: PanelProps,\n reference,\n) {\n const { isMobile } = useLayout();\n const SHORT_SCREEN = 500;\n const isShortViewport = considerHeight && !isServerSide() && window.innerHeight < SHORT_SCREEN;\n\n if (isMobile || isShortViewport) {\n return (\n <BottomSheet\n key=\"bottomSheet\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n open={open}\n className={className}\n onClose={onClose}\n >\n {children}\n </BottomSheet>\n );\n }\n return (\n <Panel\n key=\"panel\"\n ref={reference}\n flip={flip}\n arrow={arrow}\n open={open}\n position={position}\n anchorWidth={anchorWidth}\n anchorRef={anchorRef}\n aria-label={ariaLabel}\n considerHeight={considerHeight}\n aria-labelledby={ariaLabelledBy}\n className={className}\n onClose={onClose}\n >\n {children}\n </Panel>\n );\n});\n\nexport default ResponsivePanel;\n"],"names":["ResponsivePanel","forwardRef","anchorRef","arrow","flip","children","className","undefined","onClose","open","position","Position","BOTTOM","anchorWidth","ariaLabel","considerHeight","ariaLabelledBy","reference","isMobile","useLayout","SHORT_SCREEN","isShortViewport","isServerSide","window","innerHeight","_jsx","BottomSheet","Panel","ref"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAMA,eAAe,gBAAGC,gBAAU,CAA6B,SAASD,eAAeA,CACrF;EACEE,SAAS;AACTC,EAAAA,KAAK,GAAG,KAAK;AACbC,EAAAA,IAAI,GAAG,IAAI;EACXC,QAAQ;AACRC,EAAAA,SAAS,GAAGC,SAAS;EACrBC,OAAO;AACPC,EAAAA,IAAI,GAAG,KAAK;YACZC,UAAQ,GAAGC,iBAAQ,CAACC,MAAM;AAC1BC,EAAAA,WAAW,GAAG,KAAK;AACnB,EAAA,YAAY,EAAEC,SAAS;AACvBC,EAAAA,cAAc,GAAG,KAAK;AACtB,EAAA,iBAAiB,EAAEC;AAAc,CACtB,EACbC,SAAS,EAAA;EAET,MAAM;AAAEC,IAAAA;GAAU,GAAGC,mBAAS,EAAE;EAChC,MAAMC,YAAY,GAAG,GAAG;AACxB,EAAA,MAAMC,eAAe,GAAGN,cAAc,IAAI,CAACO,6BAAY,EAAE,IAAIC,MAAM,CAACC,WAAW,GAAGJ,YAAY;EAE9F,IAAIF,QAAQ,IAAIG,eAAe,EAAE;IAC/B,oBACEI,cAAA,CAACC,mBAAW,EAAA;AAEV,MAAA,YAAA,EAAYZ,SAAU;AACtB,MAAA,iBAAA,EAAiBE,cAAe;AAChCP,MAAAA,IAAI,EAAEA,IAAK;AACXH,MAAAA,SAAS,EAAEA,SAAU;AACrBE,MAAAA,OAAO,EAAEA,OAAQ;AAAAH,MAAAA,QAAA,EAEhBA;AAAQ,KAAA,EAPL,aAQO,CAAC;AAElB,EAAA;EACA,oBACEoB,cAAA,CAACE,aAAK,EAAA;AAEJC,IAAAA,GAAG,EAAEX,SAAU;AACfb,IAAAA,IAAI,EAAEA,IAAK;AACXD,IAAAA,KAAK,EAAEA,KAAM;AACbM,IAAAA,IAAI,EAAEA,IAAK;AACXC,IAAAA,QAAQ,EAAEA,UAAS;AACnBG,IAAAA,WAAW,EAAEA,WAAY;AACzBX,IAAAA,SAAS,EAAEA,SAAU;AACrB,IAAA,YAAA,EAAYY,SAAU;AACtBC,IAAAA,cAAc,EAAEA,cAAe;AAC/B,IAAA,iBAAA,EAAiBC,cAAe;AAChCV,IAAAA,SAAS,EAAEA,SAAU;AACrBE,IAAAA,OAAO,EAAEA,OAAQ;AAAAH,IAAAA,QAAA,EAEhBA;AAAQ,GAAA,EAdL,OAeC,CAAC;AAEZ,CAAC;;;;"}
@@ -19,7 +19,6 @@ import '../propsValues/variant.mjs';
19
19
  import '../propsValues/scroll.mjs';
20
20
  import '../propsValues/markdownNodeType.mjs';
21
21
  import '../fileType.mjs';
22
- import '@transferwise/formatting';
23
22
  import '@transferwise/icons';
24
23
  import 'clsx';
25
24
  import 'react-intl';
@@ -1 +1 @@
1
- {"version":3,"file":"ResponsivePanel.mjs","sources":["../../../src/common/responsivePanel/ResponsivePanel.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport { Position } from '..';\nimport BottomSheet from '../bottomSheet';\nimport { useLayout } from '../hooks';\nimport Panel, { type PanelProps } from '../panel';\nimport { isServerSide } from '../domHelpers';\n\nconst ResponsivePanel = forwardRef<HTMLDivElement, PanelProps>(function ResponsivePanel(\n {\n anchorRef,\n arrow = false,\n flip = true,\n children,\n className = undefined,\n onClose,\n open = false,\n position = Position.BOTTOM,\n anchorWidth = false,\n 'aria-label': ariaLabel,\n considerHeight = false,\n 'aria-labelledby': ariaLabelledBy,\n }: PanelProps,\n reference,\n) {\n const { isMobile } = useLayout();\n const SHORT_SCREEN = 500;\n const isShortViewport = considerHeight && !isServerSide() && window.innerHeight < SHORT_SCREEN;\n\n if (isMobile || isShortViewport) {\n return (\n <BottomSheet\n key=\"bottomSheet\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n open={open}\n className={className}\n onClose={onClose}\n >\n {children}\n </BottomSheet>\n );\n }\n return (\n <Panel\n key=\"panel\"\n ref={reference}\n flip={flip}\n arrow={arrow}\n open={open}\n position={position}\n anchorWidth={anchorWidth}\n anchorRef={anchorRef}\n aria-label={ariaLabel}\n considerHeight={considerHeight}\n aria-labelledby={ariaLabelledBy}\n className={className}\n onClose={onClose}\n >\n {children}\n </Panel>\n );\n});\n\nexport default ResponsivePanel;\n"],"names":["ResponsivePanel","forwardRef","anchorRef","arrow","flip","children","className","undefined","onClose","open","position","Position","BOTTOM","anchorWidth","ariaLabel","considerHeight","ariaLabelledBy","reference","isMobile","useLayout","SHORT_SCREEN","isShortViewport","isServerSide","window","innerHeight","_jsx","BottomSheet","Panel","ref"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAMA,eAAe,gBAAGC,UAAU,CAA6B,SAASD,eAAeA,CACrF;EACEE,SAAS;AACTC,EAAAA,KAAK,GAAG,KAAK;AACbC,EAAAA,IAAI,GAAG,IAAI;EACXC,QAAQ;AACRC,EAAAA,SAAS,GAAGC,SAAS;EACrBC,OAAO;AACPC,EAAAA,IAAI,GAAG,KAAK;EACZC,QAAQ,GAAGC,QAAQ,CAACC,MAAM;AAC1BC,EAAAA,WAAW,GAAG,KAAK;AACnB,EAAA,YAAY,EAAEC,SAAS;AACvBC,EAAAA,cAAc,GAAG,KAAK;AACtB,EAAA,iBAAiB,EAAEC;AAAc,CACtB,EACbC,SAAS,EAAA;EAET,MAAM;AAAEC,IAAAA;GAAU,GAAGC,SAAS,EAAE;EAChC,MAAMC,YAAY,GAAG,GAAG;AACxB,EAAA,MAAMC,eAAe,GAAGN,cAAc,IAAI,CAACO,YAAY,EAAE,IAAIC,MAAM,CAACC,WAAW,GAAGJ,YAAY;EAE9F,IAAIF,QAAQ,IAAIG,eAAe,EAAE;IAC/B,oBACEI,GAAA,CAACC,WAAW,EAAA;AAEV,MAAA,YAAA,EAAYZ,SAAU;AACtB,MAAA,iBAAA,EAAiBE,cAAe;AAChCP,MAAAA,IAAI,EAAEA,IAAK;AACXH,MAAAA,SAAS,EAAEA,SAAU;AACrBE,MAAAA,OAAO,EAAEA,OAAQ;AAAAH,MAAAA,QAAA,EAEhBA;AAAQ,KAAA,EAPL,aAQO,CAAC;AAElB,EAAA;EACA,oBACEoB,GAAA,CAACE,KAAK,EAAA;AAEJC,IAAAA,GAAG,EAAEX,SAAU;AACfb,IAAAA,IAAI,EAAEA,IAAK;AACXD,IAAAA,KAAK,EAAEA,KAAM;AACbM,IAAAA,IAAI,EAAEA,IAAK;AACXC,IAAAA,QAAQ,EAAEA,QAAS;AACnBG,IAAAA,WAAW,EAAEA,WAAY;AACzBX,IAAAA,SAAS,EAAEA,SAAU;AACrB,IAAA,YAAA,EAAYY,SAAU;AACtBC,IAAAA,cAAc,EAAEA,cAAe;AAC/B,IAAA,iBAAA,EAAiBC,cAAe;AAChCV,IAAAA,SAAS,EAAEA,SAAU;AACrBE,IAAAA,OAAO,EAAEA,OAAQ;AAAAH,IAAAA,QAAA,EAEhBA;AAAQ,GAAA,EAdL,OAeC,CAAC;AAEZ,CAAC;;;;"}
1
+ {"version":3,"file":"ResponsivePanel.mjs","sources":["../../../src/common/responsivePanel/ResponsivePanel.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport { Position } from '..';\nimport BottomSheet from '../bottomSheet';\nimport { useLayout } from '../hooks';\nimport Panel, { type PanelProps } from '../panel';\nimport { isServerSide } from '../domHelpers';\n\nconst ResponsivePanel = forwardRef<HTMLDivElement, PanelProps>(function ResponsivePanel(\n {\n anchorRef,\n arrow = false,\n flip = true,\n children,\n className = undefined,\n onClose,\n open = false,\n position = Position.BOTTOM,\n anchorWidth = false,\n 'aria-label': ariaLabel,\n considerHeight = false,\n 'aria-labelledby': ariaLabelledBy,\n }: PanelProps,\n reference,\n) {\n const { isMobile } = useLayout();\n const SHORT_SCREEN = 500;\n const isShortViewport = considerHeight && !isServerSide() && window.innerHeight < SHORT_SCREEN;\n\n if (isMobile || isShortViewport) {\n return (\n <BottomSheet\n key=\"bottomSheet\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n open={open}\n className={className}\n onClose={onClose}\n >\n {children}\n </BottomSheet>\n );\n }\n return (\n <Panel\n key=\"panel\"\n ref={reference}\n flip={flip}\n arrow={arrow}\n open={open}\n position={position}\n anchorWidth={anchorWidth}\n anchorRef={anchorRef}\n aria-label={ariaLabel}\n considerHeight={considerHeight}\n aria-labelledby={ariaLabelledBy}\n className={className}\n onClose={onClose}\n >\n {children}\n </Panel>\n );\n});\n\nexport default ResponsivePanel;\n"],"names":["ResponsivePanel","forwardRef","anchorRef","arrow","flip","children","className","undefined","onClose","open","position","Position","BOTTOM","anchorWidth","ariaLabel","considerHeight","ariaLabelledBy","reference","isMobile","useLayout","SHORT_SCREEN","isShortViewport","isServerSide","window","innerHeight","_jsx","BottomSheet","Panel","ref"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAMA,eAAe,gBAAGC,UAAU,CAA6B,SAASD,eAAeA,CACrF;EACEE,SAAS;AACTC,EAAAA,KAAK,GAAG,KAAK;AACbC,EAAAA,IAAI,GAAG,IAAI;EACXC,QAAQ;AACRC,EAAAA,SAAS,GAAGC,SAAS;EACrBC,OAAO;AACPC,EAAAA,IAAI,GAAG,KAAK;EACZC,QAAQ,GAAGC,QAAQ,CAACC,MAAM;AAC1BC,EAAAA,WAAW,GAAG,KAAK;AACnB,EAAA,YAAY,EAAEC,SAAS;AACvBC,EAAAA,cAAc,GAAG,KAAK;AACtB,EAAA,iBAAiB,EAAEC;AAAc,CACtB,EACbC,SAAS,EAAA;EAET,MAAM;AAAEC,IAAAA;GAAU,GAAGC,SAAS,EAAE;EAChC,MAAMC,YAAY,GAAG,GAAG;AACxB,EAAA,MAAMC,eAAe,GAAGN,cAAc,IAAI,CAACO,YAAY,EAAE,IAAIC,MAAM,CAACC,WAAW,GAAGJ,YAAY;EAE9F,IAAIF,QAAQ,IAAIG,eAAe,EAAE;IAC/B,oBACEI,GAAA,CAACC,WAAW,EAAA;AAEV,MAAA,YAAA,EAAYZ,SAAU;AACtB,MAAA,iBAAA,EAAiBE,cAAe;AAChCP,MAAAA,IAAI,EAAEA,IAAK;AACXH,MAAAA,SAAS,EAAEA,SAAU;AACrBE,MAAAA,OAAO,EAAEA,OAAQ;AAAAH,MAAAA,QAAA,EAEhBA;AAAQ,KAAA,EAPL,aAQO,CAAC;AAElB,EAAA;EACA,oBACEoB,GAAA,CAACE,KAAK,EAAA;AAEJC,IAAAA,GAAG,EAAEX,SAAU;AACfb,IAAAA,IAAI,EAAEA,IAAK;AACXD,IAAAA,KAAK,EAAEA,KAAM;AACbM,IAAAA,IAAI,EAAEA,IAAK;AACXC,IAAAA,QAAQ,EAAEA,QAAS;AACnBG,IAAAA,WAAW,EAAEA,WAAY;AACzBX,IAAAA,SAAS,EAAEA,SAAU;AACrB,IAAA,YAAA,EAAYY,SAAU;AACtBC,IAAAA,cAAc,EAAEA,cAAe;AAC/B,IAAA,iBAAA,EAAiBC,cAAe;AAChCV,IAAAA,SAAS,EAAEA,SAAU;AACrBE,IAAAA,OAAO,EAAEA,OAAQ;AAAAH,IAAAA,QAAA,EAEhBA;AAAQ,GAAA,EAdL,OAeC,CAAC;AAEZ,CAAC;;;;"}
@@ -24,7 +24,6 @@ require('../common/propsValues/variant.js');
24
24
  require('../common/propsValues/scroll.js');
25
25
  require('../common/propsValues/markdownNodeType.js');
26
26
  require('../common/fileType.js');
27
- require('@transferwise/formatting');
28
27
  require('react');
29
28
  require('react-intl');
30
29
  require('../common/closeButton/CloseButton.messages.js');
@@ -1 +1 @@
1
- {"version":3,"file":"CriticalCommsBanner.js","sources":["../../src/criticalBanner/CriticalCommsBanner.tsx"],"sourcesContent":["import { Alert as AlertIcon, ClockBorderless as ClockIcon } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { PropsWithChildren } from 'react';\n\nimport Alert from '../alert';\nimport { Sentiment } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport SentimentSurface from '../sentimentSurface';\n\nexport type CriticalCommsBannerSentiment =\n | `${Sentiment.WARNING}`\n | `${Sentiment.NEGATIVE}`\n | `${Sentiment.NEUTRAL}`;\n\nexport type CriticalCommsBannerProps = {\n title: string;\n subtitle?: string;\n action?: {\n label: string;\n href?: string;\n target?: HTMLAnchorElement['target'];\n onClick?: () => void;\n };\n sentiment?: CriticalCommsBannerSentiment;\n className?: string;\n};\n\nconst makeSurface = (sentiment: CriticalCommsBannerSentiment) => {\n const Surface = (props: PropsWithChildren<Pick<CircleProps, 'className'>>) => (\n <SentimentSurface as=\"span\" emphasis=\"elevated\" sentiment={sentiment} {...props} />\n );\n Surface.displayName = `CriticalCommsSurface(${sentiment})`;\n return Surface;\n};\n\nconst iconBySentiment: Record<CriticalCommsBannerSentiment, React.ReactNode> = {\n [Sentiment.NEGATIVE]: (\n <Circle as={makeSurface(Sentiment.NEGATIVE)} size={32} className=\"status-circle negative\">\n <AlertIcon className=\"status-icon light\" />\n </Circle>\n ),\n [Sentiment.WARNING]: (\n <Circle as={makeSurface(Sentiment.WARNING)} size={32} className=\"status-circle warning\">\n <AlertIcon className=\"status-icon dark\" />\n </Circle>\n ),\n [Sentiment.NEUTRAL]: (\n <Circle as={makeSurface(Sentiment.NEUTRAL)} size={32} className=\"status-circle neutral\">\n <ClockIcon className=\"status-icon dark\" />\n </Circle>\n ),\n};\n\nfunction CriticalCommsBanner({\n title,\n subtitle,\n action,\n sentiment = Sentiment.NEGATIVE,\n className,\n}: CriticalCommsBannerProps) {\n return (\n <SentimentSurface\n sentiment={sentiment}\n emphasis=\"elevated\"\n className={clsx('critical-comms', className)}\n >\n <Alert\n title={title}\n message={subtitle}\n action={\n action && {\n onClick: action.onClick,\n href: action.href,\n target: action.target,\n text: action.label,\n as: 'button',\n }\n }\n className={className}\n type={sentiment}\n icon={iconBySentiment[sentiment]}\n />\n </SentimentSurface>\n );\n}\n\nexport default CriticalCommsBanner;\n"],"names":["makeSurface","sentiment","Surface","props","_jsx","SentimentSurface","as","emphasis","displayName","iconBySentiment","Sentiment","NEGATIVE","Circle","size","className","children","AlertIcon","WARNING","NEUTRAL","ClockIcon","CriticalCommsBanner","title","subtitle","action","clsx","Alert","message","onClick","href","target","text","label","type","icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAMA,WAAW,GAAIC,SAAuC,IAAI;AAC9D,EAAA,MAAMC,OAAO,GAAIC,KAAwD,iBACvEC,cAAA,CAACC,wBAAgB,EAAA;AAACC,IAAAA,EAAE,EAAC,MAAM;AAACC,IAAAA,QAAQ,EAAC,UAAU;AAACN,IAAAA,SAAS,EAAEA,SAAU;IAAA,GAAKE;AAAK,GAAC,CACjF;AACDD,EAAAA,OAAO,CAACM,WAAW,GAAG,CAAA,qBAAA,EAAwBP,SAAS,CAAA,CAAA,CAAG;AAC1D,EAAA,OAAOC,OAAO;AAChB,CAAC;AAED,MAAMO,eAAe,GAA0D;AAC7E,EAAA,CAACC,mBAAS,CAACC,QAAQ,gBACjBP,cAAA,CAACQ,cAAM,EAAA;AAACN,IAAAA,EAAE,EAAEN,WAAW,CAACU,mBAAS,CAACC,QAAQ,CAAE;AAACE,IAAAA,IAAI,EAAE,EAAG;AAACC,IAAAA,SAAS,EAAC,wBAAwB;IAAAC,QAAA,eACvFX,cAAA,CAACY,WAAS,EAAA;AAACF,MAAAA,SAAS,EAAC;KAAmB;AAC1C,GAAQ,CACT;AACD,EAAA,CAACJ,mBAAS,CAACO,OAAO,gBAChBb,cAAA,CAACQ,cAAM,EAAA;AAACN,IAAAA,EAAE,EAAEN,WAAW,CAACU,mBAAS,CAACO,OAAO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GAAkB,CAAC;AAEvB;;;;"}
1
+ {"version":3,"file":"CriticalCommsBanner.js","sources":["../../src/criticalBanner/CriticalCommsBanner.tsx"],"sourcesContent":["import { Alert as AlertIcon, ClockBorderless as ClockIcon } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { PropsWithChildren } from 'react';\n\nimport Alert from '../alert';\nimport { Sentiment } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport SentimentSurface from '../sentimentSurface';\n\nexport type CriticalCommsBannerSentiment =\n | `${Sentiment.WARNING}`\n | `${Sentiment.NEGATIVE}`\n | `${Sentiment.NEUTRAL}`;\n\nexport type CriticalCommsBannerProps = {\n title: string;\n subtitle?: string;\n action?: {\n label: string;\n href?: string;\n target?: HTMLAnchorElement['target'];\n onClick?: () => void;\n };\n sentiment?: CriticalCommsBannerSentiment;\n className?: string;\n};\n\nconst makeSurface = (sentiment: CriticalCommsBannerSentiment) => {\n const Surface = (props: PropsWithChildren<Pick<CircleProps, 'className'>>) => (\n <SentimentSurface as=\"span\" emphasis=\"elevated\" sentiment={sentiment} {...props} />\n );\n Surface.displayName = `CriticalCommsSurface(${sentiment})`;\n return Surface;\n};\n\nconst iconBySentiment: Record<CriticalCommsBannerSentiment, React.ReactNode> = {\n [Sentiment.NEGATIVE]: (\n <Circle as={makeSurface(Sentiment.NEGATIVE)} size={32} className=\"status-circle negative\">\n <AlertIcon className=\"status-icon light\" />\n </Circle>\n ),\n [Sentiment.WARNING]: (\n <Circle as={makeSurface(Sentiment.WARNING)} size={32} className=\"status-circle warning\">\n <AlertIcon className=\"status-icon dark\" />\n </Circle>\n ),\n [Sentiment.NEUTRAL]: (\n <Circle as={makeSurface(Sentiment.NEUTRAL)} size={32} className=\"status-circle neutral\">\n <ClockIcon className=\"status-icon dark\" />\n </Circle>\n ),\n};\n\nfunction CriticalCommsBanner({\n title,\n subtitle,\n action,\n sentiment = Sentiment.NEGATIVE,\n className,\n}: CriticalCommsBannerProps) {\n return (\n <SentimentSurface\n sentiment={sentiment}\n emphasis=\"elevated\"\n className={clsx('critical-comms', className)}\n >\n <Alert\n title={title}\n message={subtitle}\n action={\n action && {\n onClick: action.onClick,\n href: action.href,\n target: action.target,\n text: action.label,\n as: 'button',\n }\n }\n className={className}\n type={sentiment}\n icon={iconBySentiment[sentiment]}\n />\n </SentimentSurface>\n );\n}\n\nexport default CriticalCommsBanner;\n"],"names":["makeSurface","sentiment","Surface","props","_jsx","SentimentSurface","as","emphasis","displayName","iconBySentiment","Sentiment","NEGATIVE","Circle","size","className","children","AlertIcon","WARNING","NEUTRAL","ClockIcon","CriticalCommsBanner","title","subtitle","action","clsx","Alert","message","onClick","href","target","text","label","type","icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAMA,WAAW,GAAIC,SAAuC,IAAI;AAC9D,EAAA,MAAMC,OAAO,GAAIC,KAAwD,iBACvEC,cAAA,CAACC,wBAAgB,EAAA;AAACC,IAAAA,EAAE,EAAC,MAAM;AAACC,IAAAA,QAAQ,EAAC,UAAU;AAACN,IAAAA,SAAS,EAAEA,SAAU;IAAA,GAAKE;AAAK,GAAC,CACjF;AACDD,EAAAA,OAAO,CAACM,WAAW,GAAG,CAAA,qBAAA,EAAwBP,SAAS,CAAA,CAAA,CAAG;AAC1D,EAAA,OAAOC,OAAO;AAChB,CAAC;AAED,MAAMO,eAAe,GAA0D;AAC7E,EAAA,CAACC,mBAAS,CAACC,QAAQ,gBACjBP,cAAA,CAACQ,cAAM,EAAA;AAACN,IAAAA,EAAE,EAAEN,WAAW,CAACU,mBAAS,CAACC,QAAQ,CAAE;AAACE,IAAAA,IAAI,EAAE,EAAG;AAACC,IAAAA,SAAS,EAAC,wBAAwB;IAAAC,QAAA,eACvFX,cAAA,CAACY,WAAS,EAAA;AAACF,MAAAA,SAAS,EAAC;KAAmB;AAC1C,GAAQ,CACT;AACD,EAAA,CAACJ,mBAAS,CAACO,OAAO,gBAChBb,cAAA,CAACQ,cAAM,EAAA;A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AU;MAChBgC,IAAI,EAAExB,eAAe,CAACR,WAAS;KAAE;AAErC,GAAkB,CAAC;AAEvB;;;;"}
@@ -20,7 +20,6 @@ import '../common/propsValues/variant.mjs';
20
20
  import '../common/propsValues/scroll.mjs';
21
21
  import '../common/propsValues/markdownNodeType.mjs';
22
22
  import '../common/fileType.mjs';
23
- import '@transferwise/formatting';
24
23
  import 'react';
25
24
  import 'react-intl';
26
25
  import '../common/closeButton/CloseButton.messages.mjs';
@@ -1 +1 @@
1
- {"version":3,"file":"CriticalCommsBanner.mjs","sources":["../../src/criticalBanner/CriticalCommsBanner.tsx"],"sourcesContent":["import { Alert as AlertIcon, ClockBorderless as ClockIcon } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { PropsWithChildren } from 'react';\n\nimport Alert from '../alert';\nimport { Sentiment } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport SentimentSurface from '../sentimentSurface';\n\nexport type CriticalCommsBannerSentiment =\n | `${Sentiment.WARNING}`\n | `${Sentiment.NEGATIVE}`\n | `${Sentiment.NEUTRAL}`;\n\nexport type CriticalCommsBannerProps = {\n title: string;\n subtitle?: string;\n action?: {\n label: string;\n href?: string;\n target?: HTMLAnchorElement['target'];\n onClick?: () => void;\n };\n sentiment?: CriticalCommsBannerSentiment;\n className?: string;\n};\n\nconst makeSurface = (sentiment: CriticalCommsBannerSentiment) => {\n const Surface = (props: PropsWithChildren<Pick<CircleProps, 'className'>>) => (\n <SentimentSurface as=\"span\" emphasis=\"elevated\" sentiment={sentiment} {...props} />\n );\n Surface.displayName = `CriticalCommsSurface(${sentiment})`;\n return Surface;\n};\n\nconst iconBySentiment: Record<CriticalCommsBannerSentiment, React.ReactNode> = {\n [Sentiment.NEGATIVE]: (\n <Circle as={makeSurface(Sentiment.NEGATIVE)} size={32} className=\"status-circle negative\">\n <AlertIcon className=\"status-icon light\" />\n </Circle>\n ),\n [Sentiment.WARNING]: (\n <Circle as={makeSurface(Sentiment.WARNING)} size={32} className=\"status-circle warning\">\n <AlertIcon className=\"status-icon dark\" />\n </Circle>\n ),\n [Sentiment.NEUTRAL]: (\n <Circle as={makeSurface(Sentiment.NEUTRAL)} size={32} className=\"status-circle neutral\">\n <ClockIcon className=\"status-icon dark\" />\n </Circle>\n ),\n};\n\nfunction CriticalCommsBanner({\n title,\n subtitle,\n action,\n sentiment = Sentiment.NEGATIVE,\n className,\n}: CriticalCommsBannerProps) {\n return (\n <SentimentSurface\n sentiment={sentiment}\n emphasis=\"elevated\"\n className={clsx('critical-comms', className)}\n >\n <Alert\n title={title}\n message={subtitle}\n action={\n action && {\n onClick: action.onClick,\n href: action.href,\n target: action.target,\n text: action.label,\n as: 'button',\n }\n }\n className={className}\n type={sentiment}\n icon={iconBySentiment[sentiment]}\n />\n </SentimentSurface>\n );\n}\n\nexport default CriticalCommsBanner;\n"],"names":["makeSurface","sentiment","Surface","props","_jsx","SentimentSurface","as","emphasis","displayName","iconBySentiment","Sentiment","NEGATIVE","Circle","size","className","children","AlertIcon","WARNING","NEUTRAL","ClockIcon","CriticalCommsBanner","title","subtitle","action","clsx","Alert","message","onClick","href","target","text","label","type","icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAMA,WAAW,GAAIC,SAAuC,IAAI;AAC9D,EAAA,MAAMC,OAAO,GAAIC,KAAwD,iBACvEC,GAAA,CAACC,gBAAgB,EAAA;AAACC,IAAAA,EAAE,EAAC,MAAM;AAACC,IAAAA,QAAQ,EAAC,UAAU;AAACN,IAAAA,SAAS,EAAEA,SAAU;IAAA,GAAKE;AAAK,GAAC,CACjF;AACDD,EAAAA,OAAO,CAACM,WAAW,GAAG,CAAA,qBAAA,EAAwBP,SAAS,CAAA,CAAA,CAAG;AAC1D,EAAA,OAAOC,OAAO;AAChB,CAAC;AAED,MAAMO,eAAe,GAA0D;AAC7E,EAAA,CAACC,SAAS,CAACC,QAAQ,gBACjBP,GAAA,CAACQ,MAAM,EAAA;AAACN,IAAAA,EAAE,EA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,MAAM,IAAI;QACRI,OAAO,EAAEJ,MAAM,CAACI,OAAO;QACvBC,IAAI,EAAEL,MAAM,CAACK,IAAI;QACjBC,MAAM,EAAEN,MAAM,CAACM,MAAM;QACrBC,IAAI,EAAEP,MAAM,CAACQ,KAAK;AAClBzB,QAAAA,EAAE,EAAE;OAEP;AACDQ,MAAAA,SAAS,EAAEA,SAAU;AACrBkB,MAAAA,IAAI,EAAE/B,SAAU;MAChBgC,IAAI,EAAExB,eAAe,CAACR,SAAS;KAAE;AAErC,GAAkB,CAAC;AAEvB;;;;"}
1
+ {"version":3,"file":"CriticalCommsBanner.mjs","sources":["../../src/criticalBanner/CriticalCommsBanner.tsx"],"sourcesContent":["import { Alert as AlertIcon, ClockBorderless as ClockIcon } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { PropsWithChildren } from 'react';\n\nimport Alert from '../alert';\nimport { Sentiment } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport SentimentSurface from '../sentimentSurface';\n\nexport type CriticalCommsBannerSentiment =\n | `${Sentiment.WARNING}`\n | `${Sentiment.NEGATIVE}`\n | `${Sentiment.NEUTRAL}`;\n\nexport type CriticalCommsBannerProps = {\n title: string;\n subtitle?: string;\n action?: {\n label: string;\n href?: string;\n target?: HTMLAnchorElement['target'];\n onClick?: () => void;\n };\n sentiment?: CriticalCommsBannerSentiment;\n className?: string;\n};\n\nconst makeSurface = (sentiment: CriticalCommsBannerSentiment) => {\n const Surface = (props: PropsWithChildren<Pick<CircleProps, 'className'>>) => (\n <SentimentSurface as=\"span\" emphasis=\"elevated\" sentiment={sentiment} {...props} />\n );\n Surface.displayName = `CriticalCommsSurface(${sentiment})`;\n return Surface;\n};\n\nconst iconBySentiment: Record<CriticalCommsBannerSentiment, React.ReactNode> = {\n [Sentiment.NEGATIVE]: (\n <Circle as={makeSurface(Sentiment.NEGATIVE)} size={32} className=\"status-circle negative\">\n <AlertIcon className=\"status-icon light\" />\n </Circle>\n ),\n [Sentiment.WARNING]: (\n <Circle as={makeSurface(Sentiment.WARNING)} size={32} className=\"status-circle warning\">\n <AlertIcon className=\"status-icon dark\" />\n </Circle>\n ),\n [Sentiment.NEUTRAL]: (\n <Circle as={makeSurface(Sentiment.NEUTRAL)} size={32} className=\"status-circle neutral\">\n <ClockIcon className=\"status-icon dark\" />\n </Circle>\n ),\n};\n\nfunction CriticalCommsBanner({\n title,\n subtitle,\n action,\n sentiment = Sentiment.NEGATIVE,\n className,\n}: CriticalCommsBannerProps) {\n return (\n <SentimentSurface\n sentiment={sentiment}\n emphasis=\"elevated\"\n className={clsx('critical-comms', className)}\n >\n <Alert\n title={title}\n message={subtitle}\n action={\n action && {\n onClick: action.onClick,\n href: action.href,\n target: action.target,\n text: action.label,\n as: 'button',\n }\n }\n className={className}\n type={sentiment}\n icon={iconBySentiment[sentiment]}\n />\n </SentimentSurface>\n );\n}\n\nexport default CriticalCommsBanner;\n"],"names":["makeSurface","sentiment","Surface","props","_jsx","SentimentSurface","as","emphasis","displayName","iconBySentiment","Sentiment","NEGATIVE","Circle","size","className","children","AlertIcon","WARNING","NEUTRAL","ClockIcon","CriticalCommsBanner","title","subtitle","action","clsx","Alert","message","onClick","href","target","text","label","type","icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAMA,WAAW,GAAIC,SAAuC,IAAI;AAC9D,EAAA,MAAMC,OAAO,GAAIC,KAAwD,iBACvEC,GAAA,CAACC,gBAAgB,EAAA;AAACC,IAAAA,EAAE,EAAC,MAAM;AAACC,IAAAA,QAAQ,EAAC,UAAU;AAACN,IAAAA,SAAS,EAAEA,SAAU;IAAA,GAAKE;AAAK,GAAC,CACjF;AACDD,EAAAA,OAAO,CAACM,WAAW,GAAG,CAAA,qBAAA,EAAwBP,SAAS,CAAA,CAAA,CAAG;AAC1D,EAAA,OAAOC,OAAO;AAChB,CAAC;AAED,MAAMO,eAAe,GAA0D;AAC7E,EAAA,CAACC,SAAS,CAACC,QAAQ,gBACjBP,GAA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AAA,OAAO,EAAEJ,QAAS;MAClBC,MAAM,EACJA,MAAM,IAAI;QACRI,OAAO,EAAEJ,MAAM,CAACI,OAAO;QACvBC,IAAI,EAAEL,MAAM,CAACK,IAAI;QACjBC,MAAM,EAAEN,MAAM,CAACM,MAAM;QACrBC,IAAI,EAAEP,MAAM,CAACQ,KAAK;AAClBzB,QAAAA,EAAE,EAAE;OAEP;AACDQ,MAAAA,SAAS,EAAEA,SAAU;AACrBkB,MAAAA,IAAI,EAAE/B,SAAU;MAChBgC,IAAI,EAAExB,eAAe,CAACR,SAAS;KAAE;AAErC,GAAkB,CAAC;AAEvB;;;;"}
@@ -36,9 +36,9 @@ require('../common/propsValues/variant.js');
36
36
  require('../common/propsValues/scroll.js');
37
37
  require('../common/propsValues/markdownNodeType.js');
38
38
  require('../common/fileType.js');
39
- require('@transferwise/formatting');
40
39
  require('../common/closeButton/CloseButton.messages.js');
41
40
  require('../inputs/SelectInput/SelectInput.messages.js');
41
+ require('@transferwise/formatting');
42
42
  var getMonthNames = require('../common/dateUtils/getMonthNames/getMonthNames.js');
43
43
  var isDateValid = require('../common/dateUtils/isDateValid/isDateValid.js');
44
44
  var isMonthAndYearFormat = require('../common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.js');
@@ -32,9 +32,9 @@ import '../common/propsValues/variant.mjs';
32
32
  import '../common/propsValues/scroll.mjs';
33
33
  import '../common/propsValues/markdownNodeType.mjs';
34
34
  import '../common/fileType.mjs';
35
- import '@transferwise/formatting';
36
35
  import '../common/closeButton/CloseButton.messages.mjs';
37
36
  import '../inputs/SelectInput/SelectInput.messages.mjs';
37
+ import '@transferwise/formatting';
38
38
  import { getMonthNames } from '../common/dateUtils/getMonthNames/getMonthNames.mjs';
39
39
  import { isDateValid } from '../common/dateUtils/isDateValid/isDateValid.mjs';
40
40
  import { isMonthAndYearFormat } from '../common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.mjs';
@@ -23,11 +23,11 @@ require('../common/propsValues/variant.js');
23
23
  require('../common/propsValues/scroll.js');
24
24
  require('../common/propsValues/markdownNodeType.js');
25
25
  require('../common/fileType.js');
26
- require('@transferwise/formatting');
27
26
  require('@transferwise/icons');
28
27
  require('react-intl');
29
28
  require('../common/closeButton/CloseButton.messages.js');
30
29
  var jsxRuntime = require('react/jsx-runtime');
30
+ require('@transferwise/formatting');
31
31
  var moveToWithinRange = require('../common/dateUtils/moveToWithinRange/moveToWithinRange.js');
32
32
  var isWithinRange = require('../common/dateUtils/isWithinRange/isWithinRange.js');
33
33
  var getDateView = require('../common/dateUtils/getDateView/getDateView.js');
@@ -19,11 +19,11 @@ import '../common/propsValues/variant.mjs';
19
19
  import '../common/propsValues/scroll.mjs';
20
20
  import '../common/propsValues/markdownNodeType.mjs';
21
21
  import '../common/fileType.mjs';
22
- import '@transferwise/formatting';
23
22
  import '@transferwise/icons';
24
23
  import 'react-intl';
25
24
  import '../common/closeButton/CloseButton.messages.mjs';
26
25
  import { jsxs, jsx } from 'react/jsx-runtime';
26
+ import '@transferwise/formatting';
27
27
  import { moveToWithinRange } from '../common/dateUtils/moveToWithinRange/moveToWithinRange.mjs';
28
28
  import { isWithinRange } from '../common/dateUtils/isWithinRange/isWithinRange.mjs';
29
29
  import { returnDateView } from '../common/dateUtils/getDateView/getDateView.mjs';
@@ -23,7 +23,6 @@ require('../../common/propsValues/variant.js');
23
23
  require('../../common/propsValues/scroll.js');
24
24
  require('../../common/propsValues/markdownNodeType.js');
25
25
  require('../../common/fileType.js');
26
- require('@transferwise/formatting');
27
26
  var icons = require('@transferwise/icons');
28
27
  require('react');
29
28
  require('../../common/closeButton/CloseButton.messages.js');