@transferwise/components 0.0.0-experimental-fa9fbe9 → 0.0.0-experimental-00012dd

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 (500) hide show
  1. package/build/accordion/AccordionItem/AccordionItem.js +1 -1
  2. package/build/accordion/AccordionItem/AccordionItem.mjs +1 -1
  3. package/build/actionButton/ActionButton.js +1 -1
  4. package/build/actionButton/ActionButton.mjs +1 -1
  5. package/build/actionOption/ActionOption.js +1 -1
  6. package/build/actionOption/ActionOption.mjs +1 -1
  7. package/build/alert/Alert.js +1 -1
  8. package/build/alert/Alert.mjs +1 -1
  9. package/build/alert/inlineMarkdown/InlineMarkdown.js +1 -1
  10. package/build/alert/inlineMarkdown/InlineMarkdown.mjs +1 -1
  11. package/build/avatar/Avatar.js +1 -1
  12. package/build/avatar/Avatar.mjs +1 -1
  13. package/build/avatarLayout/AvatarLayout.js +1 -1
  14. package/build/avatarLayout/AvatarLayout.mjs +1 -1
  15. package/build/avatarView/AvatarView.js +1 -1
  16. package/build/avatarView/AvatarView.mjs +1 -1
  17. package/build/avatarWrapper/AvatarWrapper.js +1 -1
  18. package/build/avatarWrapper/AvatarWrapper.mjs +1 -1
  19. package/build/badge/Badge.js +1 -1
  20. package/build/badge/Badge.mjs +1 -1
  21. package/build/button/Button.js +1 -1
  22. package/build/button/Button.mjs +1 -1
  23. package/build/button/LegacyButton.js +1 -1
  24. package/build/button/LegacyButton.mjs +1 -1
  25. package/build/button/classMap.js +1 -1
  26. package/build/button/classMap.mjs +1 -1
  27. package/build/button/legacyUtils/legacyUtils.js +1 -1
  28. package/build/button/legacyUtils/legacyUtils.mjs +1 -1
  29. package/build/card/Card.js +1 -1
  30. package/build/card/Card.mjs +1 -1
  31. package/build/checkbox/Checkbox.js +1 -1
  32. package/build/checkbox/Checkbox.mjs +1 -1
  33. package/build/chevron/Chevron.js +1 -1
  34. package/build/chevron/Chevron.mjs +1 -1
  35. package/build/chips/Chip.js +1 -1
  36. package/build/chips/Chip.mjs +1 -1
  37. package/build/circularButton/CircularButton.js +2 -2
  38. package/build/circularButton/CircularButton.js.map +1 -1
  39. package/build/circularButton/CircularButton.mjs +2 -2
  40. package/build/circularButton/CircularButton.mjs.map +1 -1
  41. package/build/common/bottomSheet/BottomSheet.js +2 -2
  42. package/build/common/bottomSheet/BottomSheet.js.map +1 -1
  43. package/build/common/bottomSheet/BottomSheet.mjs +2 -2
  44. package/build/common/bottomSheet/BottomSheet.mjs.map +1 -1
  45. package/build/common/circle/Circle.js +2 -2
  46. package/build/common/circle/Circle.js.map +1 -1
  47. package/build/common/circle/Circle.mjs +2 -2
  48. package/build/common/circle/Circle.mjs.map +1 -1
  49. package/build/common/hooks/useLayout/useLayout.js +6 -6
  50. package/build/common/hooks/useLayout/useLayout.js.map +1 -1
  51. package/build/common/hooks/useLayout/useLayout.mjs +1 -1
  52. package/build/common/hooks/useLayout/useLayout.mjs.map +1 -1
  53. package/build/common/hooks/useResizeObserver.js +3 -3
  54. package/build/common/hooks/useResizeObserver.js.map +1 -1
  55. package/build/common/hooks/useResizeObserver.mjs +3 -3
  56. package/build/common/hooks/useResizeObserver.mjs.map +1 -1
  57. package/build/common/hooks/useScreenSize.js.map +1 -1
  58. package/build/common/hooks/useScreenSize.mjs.map +1 -1
  59. package/build/common/panel/Panel.js +1 -1
  60. package/build/common/panel/Panel.mjs +1 -1
  61. package/build/common/responsivePanel/ResponsivePanel.js +1 -1
  62. package/build/common/responsivePanel/ResponsivePanel.mjs +1 -1
  63. package/build/criticalBanner/CriticalCommsBanner.js +1 -4
  64. package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
  65. package/build/criticalBanner/CriticalCommsBanner.mjs +1 -4
  66. package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
  67. package/build/dateInput/DateInput.js +1 -1
  68. package/build/dateInput/DateInput.mjs +1 -1
  69. package/build/dateLookup/DateLookup.js +2 -2
  70. package/build/dateLookup/DateLookup.js.map +1 -1
  71. package/build/dateLookup/DateLookup.mjs +1 -1
  72. package/build/dateLookup/DateLookup.mjs.map +1 -1
  73. package/build/dateLookup/dateHeader/DateHeader.js +1 -1
  74. package/build/dateLookup/dateHeader/DateHeader.mjs +1 -1
  75. package/build/dateLookup/dateTrigger/DateTrigger.js +1 -1
  76. package/build/dateLookup/dateTrigger/DateTrigger.mjs +1 -1
  77. package/build/decision/Decision.js +3 -3
  78. package/build/decision/Decision.js.map +1 -1
  79. package/build/decision/Decision.mjs +1 -1
  80. package/build/decision/Decision.mjs.map +1 -1
  81. package/build/definitionList/DefinitionList.js +1 -1
  82. package/build/definitionList/DefinitionList.mjs +1 -1
  83. package/build/dimmer/Dimmer.js +1 -1
  84. package/build/dimmer/Dimmer.mjs +1 -1
  85. package/build/display/Display.js +1 -1
  86. package/build/display/Display.mjs +1 -1
  87. package/build/drawer/Drawer.js +1 -1
  88. package/build/drawer/Drawer.mjs +1 -1
  89. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js +1 -1
  90. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs +1 -1
  91. package/build/field/Field.js +3 -4
  92. package/build/field/Field.js.map +1 -1
  93. package/build/field/Field.mjs +3 -4
  94. package/build/field/Field.mjs.map +1 -1
  95. package/build/flowNavigation/FlowNavigation.js +3 -3
  96. package/build/flowNavigation/FlowNavigation.js.map +1 -1
  97. package/build/flowNavigation/FlowNavigation.mjs +1 -1
  98. package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
  99. package/build/header/Header.js +1 -1
  100. package/build/header/Header.mjs +1 -1
  101. package/build/i18n/en.json +0 -2
  102. package/build/i18n/en.json.js +0 -2
  103. package/build/i18n/en.json.js.map +1 -1
  104. package/build/i18n/en.json.mjs +0 -2
  105. package/build/i18n/en.json.mjs.map +1 -1
  106. package/build/image/Image.js +1 -1
  107. package/build/image/Image.mjs +1 -1
  108. package/build/index.js +2 -4
  109. package/build/index.js.map +1 -1
  110. package/build/index.mjs +1 -2
  111. package/build/index.mjs.map +1 -1
  112. package/build/info/Info.js +1 -1
  113. package/build/info/Info.mjs +1 -1
  114. package/build/inlineAlert/InlineAlert.js +1 -1
  115. package/build/inlineAlert/InlineAlert.mjs +1 -1
  116. package/build/inputs/SearchInput.js +1 -1
  117. package/build/inputs/SearchInput.mjs +1 -1
  118. package/build/inputs/SelectInput/SelectInput.js +2 -2
  119. package/build/inputs/SelectInput/SelectInput.js.map +1 -1
  120. package/build/inputs/SelectInput/SelectInput.mjs +1 -1
  121. package/build/inputs/SelectInput/SelectInput.mjs.map +1 -1
  122. package/build/instructionsList/InstructionsList.js +1 -1
  123. package/build/instructionsList/InstructionsList.mjs +1 -1
  124. package/build/link/Link.js +1 -1
  125. package/build/link/Link.mjs +1 -1
  126. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js +1 -1
  127. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs +1 -1
  128. package/build/listItem/ListItem.js +1 -1
  129. package/build/listItem/ListItem.mjs +1 -1
  130. package/build/listItem/Prompt/ListItemPrompt.js +3 -4
  131. package/build/listItem/Prompt/ListItemPrompt.js.map +1 -1
  132. package/build/listItem/Prompt/ListItemPrompt.mjs +3 -4
  133. package/build/listItem/Prompt/ListItemPrompt.mjs.map +1 -1
  134. package/build/loader/Loader.js +1 -1
  135. package/build/loader/Loader.mjs +1 -1
  136. package/build/logo/Logo.js +1 -1
  137. package/build/logo/Logo.js.map +1 -1
  138. package/build/logo/Logo.mjs +1 -1
  139. package/build/logo/Logo.mjs.map +1 -1
  140. package/build/main.css +330 -495
  141. package/build/markdown/Markdown.js +1 -1
  142. package/build/markdown/Markdown.mjs +1 -1
  143. package/build/modal/Modal.js +1 -1
  144. package/build/modal/Modal.mjs +1 -1
  145. package/build/moneyInput/MoneyInput.js +1 -1
  146. package/build/moneyInput/MoneyInput.mjs +1 -1
  147. package/build/navigationOption/NavigationOption.js +1 -1
  148. package/build/navigationOption/NavigationOption.mjs +1 -1
  149. package/build/nudge/Nudge.js +1 -1
  150. package/build/nudge/Nudge.mjs +1 -1
  151. package/build/overlayHeader/OverlayHeader.js +1 -1
  152. package/build/overlayHeader/OverlayHeader.mjs +1 -1
  153. package/build/phoneNumberInput/PhoneNumberInput.js +1 -1
  154. package/build/phoneNumberInput/PhoneNumberInput.mjs +1 -1
  155. package/build/popover/Popover.js +1 -1
  156. package/build/popover/Popover.mjs +1 -1
  157. package/build/processIndicator/ProcessIndicator.js +1 -1
  158. package/build/processIndicator/ProcessIndicator.mjs +1 -1
  159. package/build/progressBar/ProgressBar.js +1 -1
  160. package/build/progressBar/ProgressBar.mjs +1 -1
  161. package/build/promoCard/PromoCard.js +1 -1
  162. package/build/promoCard/PromoCard.mjs +1 -1
  163. package/build/promoCard/PromoCardIndicator.js +1 -1
  164. package/build/promoCard/PromoCardIndicator.mjs +1 -1
  165. package/build/prompt/ActionPrompt/ActionPrompt.js +42 -10
  166. package/build/prompt/ActionPrompt/ActionPrompt.js.map +1 -1
  167. package/build/prompt/ActionPrompt/ActionPrompt.mjs +41 -9
  168. package/build/prompt/ActionPrompt/ActionPrompt.mjs.map +1 -1
  169. package/build/prompt/InfoPrompt/InfoPrompt.js +1 -1
  170. package/build/prompt/InfoPrompt/InfoPrompt.mjs +1 -1
  171. package/build/prompt/InlinePrompt/InlinePrompt.js +1 -1
  172. package/build/prompt/InlinePrompt/InlinePrompt.mjs +1 -1
  173. package/build/prompt/PrimitivePrompt/PrimitivePrompt.js +4 -11
  174. package/build/prompt/PrimitivePrompt/PrimitivePrompt.js.map +1 -1
  175. package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs +4 -11
  176. package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs.map +1 -1
  177. package/build/provider/Provider.js +1 -1
  178. package/build/provider/Provider.mjs +1 -1
  179. package/build/radio/Radio.js +1 -1
  180. package/build/radio/Radio.mjs +1 -1
  181. package/build/segmentedControl/SegmentedControl.js +1 -1
  182. package/build/segmentedControl/SegmentedControl.mjs +1 -1
  183. package/build/select/Select.js +1 -1
  184. package/build/select/Select.mjs +1 -1
  185. package/build/select/option/Option.js +1 -1
  186. package/build/select/option/Option.mjs +1 -1
  187. package/build/statusIcon/StatusIcon.js +2 -2
  188. package/build/statusIcon/StatusIcon.js.map +1 -1
  189. package/build/statusIcon/StatusIcon.mjs +2 -2
  190. package/build/statusIcon/StatusIcon.mjs.map +1 -1
  191. package/build/stepper/Stepper.js +1 -1
  192. package/build/stepper/Stepper.mjs +1 -1
  193. package/build/sticky/Sticky.js +1 -1
  194. package/build/sticky/Sticky.mjs +1 -1
  195. package/build/styles/accordion/Accordion.css +1 -1
  196. package/build/styles/card/Card.css +2 -2
  197. package/build/styles/carousel/Carousel.css +5 -5
  198. package/build/styles/common/Option/Option.css +1 -1
  199. package/build/styles/common/baseCard/BaseCard.css +1 -1
  200. package/build/styles/container/Container.css +3 -3
  201. package/build/styles/criticalBanner/CriticalCommsBanner.css +1 -1
  202. package/build/styles/css/accordion.css +4 -4
  203. package/build/styles/css/button-groups.css +6 -6
  204. package/build/styles/css/buttons.css +1 -1
  205. package/build/styles/css/circles.css +1 -1
  206. package/build/styles/css/column-layout.css +4 -4
  207. package/build/styles/css/decision.css +4 -4
  208. package/build/styles/css/dropdowns.css +10 -10
  209. package/build/styles/css/droppable.css +8 -8
  210. package/build/styles/css/flex.css +14 -14
  211. package/build/styles/css/footer.css +3 -3
  212. package/build/styles/css/grid.css +19 -19
  213. package/build/styles/css/input-groups.css +12 -12
  214. package/build/styles/css/list-group.css +8 -8
  215. package/build/styles/css/modals.css +3 -3
  216. package/build/styles/css/navbar.css +62 -62
  217. package/build/styles/css/navs.css +2 -2
  218. package/build/styles/css/neptune.css +258 -258
  219. package/build/styles/css/panels.css +9 -9
  220. package/build/styles/css/popovers.css +13 -13
  221. package/build/styles/css/select.css +1 -1
  222. package/build/styles/css/sequences.css +6 -6
  223. package/build/styles/css/table.css +6 -6
  224. package/build/styles/css/utilities.css +4 -4
  225. package/build/styles/css/wells.css +4 -4
  226. package/build/styles/dateInput/DateInput.css +1 -1
  227. package/build/styles/definitionList/DefinitionList.css +2 -2
  228. package/build/styles/drawer/Drawer.css +1 -1
  229. package/build/styles/inputs/Input.css +3 -3
  230. package/build/styles/inputs/SelectInput/Options/SelectInputOptions.css +2 -2
  231. package/build/styles/inputs/SelectInput/SelectInput.css +2 -2
  232. package/build/styles/inputs/TextArea.css +3 -3
  233. package/build/styles/less/legacy-variables.less +34 -47
  234. package/build/styles/less/neptune-tokens.less +2 -2
  235. package/build/styles/logo/Logo.css +2 -2
  236. package/build/styles/main.css +330 -495
  237. package/build/styles/modal/Modal.css +5 -5
  238. package/build/styles/popover/Popover.css +3 -3
  239. package/build/styles/promoCard/PromoCard.css +1 -1
  240. package/build/styles/prompt/ActionPrompt/ActionPrompt.css +1 -1
  241. package/build/styles/prompt/PrimitivePrompt/PrimitivePrompt.css +1 -1
  242. package/build/styles/props/custom-media.css +23 -11
  243. package/build/styles/props/neptune-tokens.css +1 -1
  244. package/build/styles/snackbar/Snackbar.css +2 -2
  245. package/build/styles/stepper/Stepper.css +2 -2
  246. package/build/styles/styles/less/accordion.css +4 -4
  247. package/build/styles/styles/less/button-groups.css +6 -6
  248. package/build/styles/styles/less/buttons.css +1 -1
  249. package/build/styles/styles/less/circles.css +1 -1
  250. package/build/styles/styles/less/column-layout.css +4 -4
  251. package/build/styles/styles/less/decision.css +4 -4
  252. package/build/styles/styles/less/dropdowns.css +10 -10
  253. package/build/styles/styles/less/droppable.css +8 -8
  254. package/build/styles/styles/less/flex.css +14 -14
  255. package/build/styles/styles/less/footer.css +3 -3
  256. package/build/styles/styles/less/forms/bootstrap-forms.css +9 -9
  257. package/build/styles/styles/less/grid.css +19 -19
  258. package/build/styles/styles/less/input-groups.css +12 -12
  259. package/build/styles/styles/less/list-group.css +8 -8
  260. package/build/styles/styles/less/modals.css +3 -3
  261. package/build/styles/styles/less/navbar.css +62 -62
  262. package/build/styles/styles/less/navs.css +2 -2
  263. package/build/styles/styles/less/neptune.css +258 -258
  264. package/build/styles/styles/less/panels.css +9 -9
  265. package/build/styles/styles/less/popovers.css +13 -13
  266. package/build/styles/styles/less/select.css +1 -1
  267. package/build/styles/styles/less/sequences.css +6 -6
  268. package/build/styles/styles/less/table.css +6 -6
  269. package/build/styles/styles/less/utilities.css +4 -4
  270. package/build/styles/styles/less/wells.css +4 -4
  271. package/build/styles/styles/props/custom-media.css +1 -11
  272. package/build/styles/table/Table.css +1 -1
  273. package/build/styles/tabs/Tabs.css +2 -2
  274. package/build/styles/typeahead/Typeahead.css +1 -1
  275. package/build/summary/Summary.js +1 -1
  276. package/build/summary/Summary.mjs +1 -1
  277. package/build/table/Table.js +7 -6
  278. package/build/table/Table.js.map +1 -1
  279. package/build/table/Table.mjs +7 -6
  280. package/build/table/Table.mjs.map +1 -1
  281. package/build/table/TableRow.js +1 -1
  282. package/build/table/TableRow.mjs +1 -1
  283. package/build/table/TableStatusText.js +1 -1
  284. package/build/table/TableStatusText.mjs +1 -1
  285. package/build/tabs/Tabs.js +1 -1
  286. package/build/tabs/Tabs.mjs +1 -1
  287. package/build/tile/Tile.js +1 -1
  288. package/build/tile/Tile.mjs +1 -1
  289. package/build/title/Title.js +1 -1
  290. package/build/title/Title.mjs +1 -1
  291. package/build/tooltip/Tooltip.js +1 -1
  292. package/build/tooltip/Tooltip.mjs +1 -1
  293. package/build/typeahead/Typeahead.js +3 -4
  294. package/build/typeahead/Typeahead.js.map +1 -1
  295. package/build/typeahead/Typeahead.mjs +3 -4
  296. package/build/typeahead/Typeahead.mjs.map +1 -1
  297. package/build/types/circularButton/CircularButton.d.ts.map +1 -1
  298. package/build/types/common/bottomSheet/BottomSheet.d.ts.map +1 -1
  299. package/build/types/common/hooks/useResizeObserver.d.ts +1 -1
  300. package/build/types/common/hooks/useResizeObserver.d.ts.map +1 -1
  301. package/build/types/common/hooks/useScreenSize.d.ts +1 -1
  302. package/build/types/common/hooks/useScreenSize.d.ts.map +1 -1
  303. package/build/types/common/index.d.ts +1 -1
  304. package/build/types/common/index.d.ts.map +1 -1
  305. package/build/types/criticalBanner/CriticalCommsBanner.d.ts +0 -3
  306. package/build/types/criticalBanner/CriticalCommsBanner.d.ts.map +1 -1
  307. package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
  308. package/build/types/decision/Decision.d.ts.map +1 -1
  309. package/build/types/flowNavigation/FlowNavigation.d.ts.map +1 -1
  310. package/build/types/index.d.ts +4 -3
  311. package/build/types/index.d.ts.map +1 -1
  312. package/build/types/logo/Logo.d.ts +1 -1
  313. package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts +11 -2
  314. package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts.map +1 -1
  315. package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts +3 -35
  316. package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts.map +1 -1
  317. package/build/types/prompt/index.d.ts +0 -2
  318. package/build/types/prompt/index.d.ts.map +1 -1
  319. package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
  320. package/build/types/table/Table.d.ts.map +1 -1
  321. package/build/types/test-utils/index.d.ts +0 -4
  322. package/build/types/test-utils/index.d.ts.map +1 -1
  323. package/build/upload/Upload.js +1 -1
  324. package/build/upload/Upload.mjs +1 -1
  325. package/build/upload/steps/completeStep/completeStep.js +1 -1
  326. package/build/upload/steps/completeStep/completeStep.mjs +1 -1
  327. package/build/upload/steps/processingStep/processingStep.js +1 -1
  328. package/build/upload/steps/processingStep/processingStep.mjs +1 -1
  329. package/build/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
  330. package/build/upload/steps/uploadImageStep/uploadImageStep.mjs +1 -1
  331. package/build/uploadInput/UploadInput.js +1 -1
  332. package/build/uploadInput/UploadInput.mjs +1 -1
  333. package/build/uploadInput/uploadButton/UploadButton.js +1 -1
  334. package/build/uploadInput/uploadButton/UploadButton.mjs +1 -1
  335. package/build/uploadInput/uploadButton/defaults.js +1 -1
  336. package/build/uploadInput/uploadButton/defaults.mjs +1 -1
  337. package/build/uploadInput/uploadItem/UploadItem.js +1 -1
  338. package/build/uploadInput/uploadItem/UploadItem.mjs +1 -1
  339. package/build/withDisplayFormat/WithDisplayFormat.js +1 -1
  340. package/build/withDisplayFormat/WithDisplayFormat.mjs +1 -1
  341. package/package.json +3 -3
  342. package/src/accordion/Accordion.css +1 -1
  343. package/src/card/Card.css +2 -2
  344. package/src/carousel/Carousel.css +5 -5
  345. package/src/circularButton/CircularButton.tsx +3 -2
  346. package/src/common/Option/Option.css +1 -1
  347. package/src/common/baseCard/BaseCard.css +1 -1
  348. package/src/common/bottomSheet/BottomSheet.test.story.tsx +6 -5
  349. package/src/common/bottomSheet/BottomSheet.tsx +2 -2
  350. package/src/common/circle/Circle.tsx +2 -2
  351. package/src/common/hooks/useLayout/useLayout.ts +1 -1
  352. package/src/common/hooks/useResizeObserver.ts +2 -3
  353. package/src/common/hooks/useScreenSize.ts +1 -1
  354. package/src/common/index.ts +1 -1
  355. package/src/common/responsivePanel/ResponsivePanel.test.js +3 -2
  356. package/src/container/Container.css +3 -3
  357. package/src/criticalBanner/CriticalCommsBanner.css +1 -1
  358. package/src/criticalBanner/CriticalCommsBanner.story.tsx +0 -4
  359. package/src/criticalBanner/CriticalCommsBanner.test.story.tsx +1 -1
  360. package/src/criticalBanner/CriticalCommsBanner.tsx +0 -3
  361. package/src/dateInput/DateInput.css +1 -1
  362. package/src/dateLookup/DateLookup.tsx +1 -1
  363. package/src/decision/Decision.test.tsx +2 -1
  364. package/src/decision/Decision.tsx +2 -1
  365. package/src/definitionList/DefinitionList.css +2 -2
  366. package/src/definitionList/DefinitionList.less +2 -2
  367. package/src/drawer/Drawer.css +1 -1
  368. package/src/flowNavigation/FlowNavigation.test.js +1 -1
  369. package/src/flowNavigation/FlowNavigation.tsx +2 -1
  370. package/src/i18n/en.json +0 -2
  371. package/src/index.ts +3 -3
  372. package/src/inputs/Input.css +3 -3
  373. package/src/inputs/SelectInput/Options/SelectInputOptions.css +2 -2
  374. package/src/inputs/SelectInput/SelectInput.css +2 -2
  375. package/src/inputs/SelectInput/SelectInput.tsx +1 -1
  376. package/src/inputs/TextArea.css +3 -3
  377. package/src/logo/Logo.css +2 -2
  378. package/src/logo/Logo.story.tsx +3 -3
  379. package/src/logo/Logo.tsx +1 -1
  380. package/src/main.css +330 -495
  381. package/src/main.less +1 -3
  382. package/src/modal/Modal.css +5 -5
  383. package/src/popover/Popover.css +3 -3
  384. package/src/popover/Popover.test.tsx +2 -1
  385. package/src/promoCard/PromoCard.css +1 -1
  386. package/src/prompt/ActionPrompt/ActionPrompt.css +1 -1
  387. package/src/prompt/ActionPrompt/ActionPrompt.test.tsx +3 -3
  388. package/src/prompt/ActionPrompt/ActionPrompt.tsx +64 -10
  389. package/src/prompt/PrimitivePrompt/PrimitivePrompt.css +1 -1
  390. package/src/prompt/PrimitivePrompt/PrimitivePrompt.tsx +40 -56
  391. package/src/prompt/index.ts +0 -4
  392. package/src/section/Section.story.tsx +2 -8
  393. package/src/select/Select.test.tsx +1 -1
  394. package/src/sentimentSurface/SentimentSurface.story.tsx +17 -43
  395. package/src/snackbar/Snackbar.css +2 -2
  396. package/src/statusIcon/StatusIcon.test.tsx +0 -2
  397. package/src/statusIcon/StatusIcon.tsx +3 -2
  398. package/src/stepper/Stepper.css +2 -2
  399. package/src/styles/less/accordion.css +4 -4
  400. package/src/styles/less/button-groups.css +6 -6
  401. package/src/styles/less/buttons.css +1 -1
  402. package/src/styles/less/circles.css +1 -1
  403. package/src/styles/less/column-layout.css +4 -4
  404. package/src/styles/less/decision.css +4 -4
  405. package/src/styles/less/dropdowns.css +10 -10
  406. package/src/styles/less/droppable.css +8 -8
  407. package/src/styles/less/flex.css +14 -14
  408. package/src/styles/less/footer.css +3 -3
  409. package/src/styles/less/forms/bootstrap-forms.css +9 -9
  410. package/src/styles/less/forms/bootstrap-forms.less +1 -1
  411. package/src/styles/less/grid.css +19 -19
  412. package/src/styles/less/input-groups.css +12 -12
  413. package/src/styles/less/list-group.css +8 -8
  414. package/src/styles/less/modals.css +3 -3
  415. package/src/styles/less/navbar.css +62 -62
  416. package/src/styles/less/navbar.less +2 -2
  417. package/src/styles/less/navs.css +2 -2
  418. package/src/styles/less/neptune.bundle.less +1 -0
  419. package/src/styles/less/neptune.css +258 -258
  420. package/src/styles/less/panels.css +9 -9
  421. package/src/styles/less/popovers.css +13 -13
  422. package/src/styles/less/select.css +1 -1
  423. package/src/styles/less/sequences.css +6 -6
  424. package/src/styles/less/table.css +6 -6
  425. package/src/styles/less/table.less +1 -1
  426. package/src/styles/less/utilities.css +4 -4
  427. package/src/styles/less/wells.css +4 -4
  428. package/src/styles/props/custom-media.css +1 -11
  429. package/src/styles/variables/legacy-variables.less +4 -47
  430. package/src/table/Table.css +1 -1
  431. package/src/table/Table.story.tsx +1 -1
  432. package/src/table/Table.tsx +6 -5
  433. package/src/tabs/Tabs.css +2 -2
  434. package/src/typeahead/Typeahead.css +1 -1
  435. package/build/common/hooks/useContainerSize.js +0 -30
  436. package/build/common/hooks/useContainerSize.js.map +0 -1
  437. package/build/common/hooks/useContainerSize.mjs +0 -28
  438. package/build/common/hooks/useContainerSize.mjs.map +0 -1
  439. package/build/common/propsValues/breakpoint.js +0 -12
  440. package/build/common/propsValues/breakpoint.js.map +0 -1
  441. package/build/common/propsValues/breakpoint.mjs +0 -12
  442. package/build/common/propsValues/breakpoint.mjs.map +0 -1
  443. package/build/prompt/CriticalBanner/CriticalBanner.js +0 -142
  444. package/build/prompt/CriticalBanner/CriticalBanner.js.map +0 -1
  445. package/build/prompt/CriticalBanner/CriticalBanner.mjs +0 -140
  446. package/build/prompt/CriticalBanner/CriticalBanner.mjs.map +0 -1
  447. package/build/prompt/CriticalBanner/helpers.js +0 -29
  448. package/build/prompt/CriticalBanner/helpers.js.map +0 -1
  449. package/build/prompt/CriticalBanner/helpers.mjs +0 -26
  450. package/build/prompt/CriticalBanner/helpers.mjs.map +0 -1
  451. package/build/prompt/common/Expander/Expander.js +0 -35
  452. package/build/prompt/common/Expander/Expander.js.map +0 -1
  453. package/build/prompt/common/Expander/Expander.messages.js +0 -17
  454. package/build/prompt/common/Expander/Expander.messages.js.map +0 -1
  455. package/build/prompt/common/Expander/Expander.messages.mjs +0 -13
  456. package/build/prompt/common/Expander/Expander.messages.mjs.map +0 -1
  457. package/build/prompt/common/Expander/Expander.mjs +0 -33
  458. package/build/prompt/common/Expander/Expander.mjs.map +0 -1
  459. package/build/prompt/helpers/promptMedia.js +0 -52
  460. package/build/prompt/helpers/promptMedia.js.map +0 -1
  461. package/build/prompt/helpers/promptMedia.mjs +0 -50
  462. package/build/prompt/helpers/promptMedia.mjs.map +0 -1
  463. package/build/styles/prompt/CriticalBanner/CriticalBanner.css +0 -134
  464. package/build/styles/prompt/CriticalBanner/CriticalBanner.vars.css +0 -0
  465. package/build/styles/prompt/common/Expander/Expander.css +0 -8
  466. package/build/types/common/hooks/useContainerSize.d.ts +0 -14
  467. package/build/types/common/hooks/useContainerSize.d.ts.map +0 -1
  468. package/build/types/common/propsValues/breakpoint.d.ts +0 -9
  469. package/build/types/common/propsValues/breakpoint.d.ts.map +0 -1
  470. package/build/types/prompt/CriticalBanner/CriticalBanner.d.ts +0 -39
  471. package/build/types/prompt/CriticalBanner/CriticalBanner.d.ts.map +0 -1
  472. package/build/types/prompt/CriticalBanner/helpers.d.ts +0 -18
  473. package/build/types/prompt/CriticalBanner/helpers.d.ts.map +0 -1
  474. package/build/types/prompt/CriticalBanner/index.d.ts +0 -3
  475. package/build/types/prompt/CriticalBanner/index.d.ts.map +0 -1
  476. package/build/types/prompt/common/Expander/Expander.d.ts +0 -20
  477. package/build/types/prompt/common/Expander/Expander.d.ts.map +0 -1
  478. package/build/types/prompt/common/Expander/Expander.messages.d.ts +0 -14
  479. package/build/types/prompt/common/Expander/Expander.messages.d.ts.map +0 -1
  480. package/build/types/prompt/helpers/promptMedia.d.ts +0 -22
  481. package/build/types/prompt/helpers/promptMedia.d.ts.map +0 -1
  482. package/src/common/hooks/useContainerSize.test.tsx +0 -121
  483. package/src/common/hooks/useContainerSize.ts +0 -32
  484. package/src/common/propsValues/breakpoint.ts +0 -8
  485. package/src/prompt/CriticalBanner/CriticalBanner.accessibility.docs.mdx +0 -113
  486. package/src/prompt/CriticalBanner/CriticalBanner.css +0 -134
  487. package/src/prompt/CriticalBanner/CriticalBanner.less +0 -155
  488. package/src/prompt/CriticalBanner/CriticalBanner.story.tsx +0 -635
  489. package/src/prompt/CriticalBanner/CriticalBanner.test.story.tsx +0 -422
  490. package/src/prompt/CriticalBanner/CriticalBanner.tsx +0 -178
  491. package/src/prompt/CriticalBanner/CriticalBanner.vars.css +0 -0
  492. package/src/prompt/CriticalBanner/CriticalBanner.vars.less +0 -6
  493. package/src/prompt/CriticalBanner/helpers.ts +0 -39
  494. package/src/prompt/CriticalBanner/index.ts +0 -2
  495. package/src/prompt/common/Expander/Expander.css +0 -8
  496. package/src/prompt/common/Expander/Expander.less +0 -9
  497. package/src/prompt/common/Expander/Expander.messages.ts +0 -14
  498. package/src/prompt/common/Expander/Expander.test.tsx +0 -167
  499. package/src/prompt/common/Expander/Expander.tsx +0 -83
  500. package/src/prompt/helpers/promptMedia.tsx +0 -79
@@ -1,5 +1,6 @@
1
1
  import { clsx } from 'clsx';
2
2
  import { useRef, useState, useContext } from 'react';
3
+ import { Breakpoint } from '@transferwise/neptune-tokens';
3
4
  import Dimmer from '../../dimmer/Dimmer.mjs';
4
5
  import Drawer from '../../drawer/Drawer.mjs';
5
6
  import { OverlayIdContext } from '../../provider/overlay/OverlayIdProvider.mjs';
@@ -8,7 +9,6 @@ import { CloseButton } from '../closeButton/CloseButton.mjs';
8
9
  import { isServerSide } from '../domHelpers/documentIosClick.mjs';
9
10
  import { useConditionalListener } from '../hooks/useConditionalListener/useConditionalListener.mjs';
10
11
  import '../../provider/direction/DirectionProvider.mjs';
11
- import { Breakpoint } from '../propsValues/breakpoint.mjs';
12
12
  import { useMedia } from '../hooks/useMedia.mjs';
13
13
  import { Position } from '../propsValues/position.mjs';
14
14
  import { jsx, jsxs } from 'react/jsx-runtime';
@@ -143,7 +143,7 @@ const BottomSheet = ({
143
143
  maxHeight: `calc(${screenHeight} - ${safeZoneHeight} - ${topbarHeight})`
144
144
  };
145
145
  }
146
- const is400Zoom = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);
146
+ const is400Zoom = useMedia(`(max-width: ${Breakpoint.EXTRA_SMALL}px)`);
147
147
  const overlayId = useContext(OverlayIdContext);
148
148
  return is400Zoom ? /*#__PURE__*/jsx(Drawer, {
149
149
  "aria-labelledby": props['aria-labelledby'],
@@ -1 +1 @@
1
- {"version":3,"file":"BottomSheet.mjs","sources":["../../../src/common/bottomSheet/BottomSheet.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport {\n CSSProperties,\n HTMLAttributes,\n PropsWithChildren,\n SyntheticEvent,\n useContext,\n useRef,\n useState,\n} from 'react';\n\nimport Dimmer from '../../dimmer';\nimport Drawer from '../../drawer';\nimport { OverlayIdContext } from '../../provider/overlay/OverlayIdProvider';\nimport SlidingPanel from '../../slidingPanel';\nimport { CloseButton } from '../closeButton';\nimport { CommonProps } from '../commonProps';\nimport { isServerSide } from '../domHelpers';\nimport { useConditionalListener } from '../hooks';\nimport { useMedia } from '../hooks/useMedia';\nimport { Breakpoint } from '../propsValues/breakpoint';\nimport { Position } from '../propsValues/position';\n\nconst INITIAL_Y_POSITION = 0;\n\nconst CONTENT_SCROLL_THRESHOLD = 1;\n\nconst MOVE_OFFSET_THRESHOLD = 50;\n\nexport type BottomSheetProps = PropsWithChildren<\n {\n onClose?: (event: Event | SyntheticEvent) => void;\n open: boolean;\n } & CommonProps &\n Pick<HTMLAttributes<HTMLDivElement>, 'role' | 'aria-labelledby' | 'aria-label'>\n>;\n\n/**\n * Neptune: https://transferwise.github.io/neptune/components/bottom-sheet/\n *\n * Neptune Web: https://transferwise.github.io/neptune-web/components/overlays/BottomSheet\n *\n */\nconst BottomSheet = ({ role = 'dialog', ...props }: BottomSheetProps) => {\n const bottomSheetReference = useRef<HTMLDivElement>(null);\n const topBarReference = useRef<HTMLDivElement>(null);\n const contentReference = useRef<HTMLDivElement>(null);\n\n const [pressed, setPressed] = useState<boolean>(false);\n\n /**\n * Used to track `requestAnimationFrame` requests\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame#return_value\n */\n const animationId = useRef<number>(0);\n\n /**\n * Difference between initial coordinate ({@link initialYCoordinate})\n * and new position (when user moves component), it's get calculated on `onTouchMove` and `onMouseMove` events\n *\n * @see {@link calculateOffsetAfterMove}\n */\n const moveOffset = useRef<number>(0);\n const initialYCoordinate = useRef<number>(0);\n\n // apply shadow to the bottom of top-bar when scroll over content\n useConditionalListener({\n attachListener: props.open && !isServerSide(),\n callback: () => {\n if (topBarReference.current !== null) {\n const { classList } = topBarReference.current;\n if (!isContentScrollPositionAtTop()) {\n classList.add('np-bottom-sheet--top-bar--shadow');\n } else {\n classList.remove('np-bottom-sheet--top-bar--shadow');\n }\n }\n },\n eventType: 'scroll',\n parent: isServerSide() ? undefined : document,\n });\n\n function move(newHeight: number): void {\n if (bottomSheetReference.current !== null) {\n bottomSheetReference.current.style.transform = `translateY(${newHeight}px)`;\n }\n }\n\n function close(event: Event | SyntheticEvent): void {\n setPressed(false);\n moveOffset.current = INITIAL_Y_POSITION;\n if (bottomSheetReference.current !== null) {\n bottomSheetReference.current.style.removeProperty('transform');\n }\n if (props.onClose) {\n props.onClose(event);\n }\n }\n\n const onSwipeStart = (\n event: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>,\n ): void => {\n initialYCoordinate.current = ('touches' in event ? event.touches[0] : event).clientY;\n setPressed(true);\n };\n\n const onSwipeMove = (\n event: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>,\n ): void => {\n if (pressed) {\n const { clientY } = 'touches' in event ? event.touches[0] : event;\n\n const offset = calculateOffsetAfterMove(clientY);\n // check whether move is to the bottom only and content scroll position is at the top\n if (offset > INITIAL_Y_POSITION && isContentScrollPositionAtTop()) {\n moveOffset.current = offset;\n animationId.current = requestAnimationFrame(() => {\n if (animationId.current !== undefined && bottomSheetReference.current !== null) {\n move(offset);\n }\n });\n }\n }\n };\n\n function onSwipeEnd(\n event: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>,\n ): void {\n // stop moving component\n cancelAnimationFrame(animationId.current);\n setPressed(false);\n // check whether move down is strong enough\n // and content scroll position is at the top to close the component\n if (moveOffset.current > MOVE_OFFSET_THRESHOLD && isContentScrollPositionAtTop()) {\n close(event);\n }\n // otherwise move component back to default (initial) position\n else {\n move(INITIAL_Y_POSITION);\n }\n moveOffset.current = INITIAL_Y_POSITION;\n }\n\n function isContentScrollPositionAtTop(): boolean {\n return (\n contentReference?.current?.scrollTop !== undefined &&\n contentReference.current.scrollTop <= CONTENT_SCROLL_THRESHOLD\n );\n }\n\n /**\n * Calculates how hard user moves component,\n * result value used to determine whether to hide component or re-position to default state\n *\n * @param afterMoveYCoordinate\n */\n function calculateOffsetAfterMove(afterMoveYCoordinate: number): number {\n return afterMoveYCoordinate - initialYCoordinate.current;\n }\n\n /**\n * Set `max-height` for content part (in order to keep it scrollable for content overflow cases) of the component\n * and ensures space for safe zone (32px) at the top.\n */\n function setContentMaxHeight(): CSSProperties {\n const safeZoneHeight = '64px';\n const topbarHeight = '32px';\n const windowHight: number = isServerSide() ? 0 : window.innerHeight;\n /**\n * Calculate _real_ height of the screen (taking into account parts of browser interface).\n *\n * See https://css-tricks.com/the-trick-to-viewport-units-on-mobile for more details.\n */\n const screenHeight = `${windowHight * 0.01 * 100}px`;\n return {\n maxHeight: `calc(${screenHeight} - ${safeZoneHeight} - ${topbarHeight})`,\n };\n }\n\n const is400Zoom = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n\n const overlayId = useContext(OverlayIdContext);\n\n return is400Zoom ? (\n <Drawer\n aria-labelledby={props['aria-labelledby']}\n aria-label={props['aria-label']}\n role={role}\n open={props.open}\n className={props.className}\n onClose={close}\n >\n {props.children}\n </Drawer>\n ) : (\n <Dimmer open={props.open} fadeContentOnEnter fadeContentOnExit onClose={close}>\n <SlidingPanel\n ref={bottomSheetReference}\n open={props.open}\n position={Position.BOTTOM}\n className={clsx('np-bottom-sheet', props.className)}\n >\n <div\n id={overlayId}\n aria-labelledby={props['aria-labelledby'] || undefined}\n aria-label={props['aria-label'] || undefined}\n role={role}\n aria-modal\n onTouchStart={onSwipeStart}\n onTouchMove={onSwipeMove}\n onTouchEnd={onSwipeEnd}\n onMouseDown={onSwipeStart}\n onMouseMove={onSwipeMove}\n onMouseUp={onSwipeEnd}\n >\n <div ref={topBarReference} className=\"np-bottom-sheet--top-bar\">\n <div className=\"np-bottom-sheet--handler\" />\n <CloseButton size=\"sm\" className=\"sr-only np-bottom-sheet--close-btn\" onClick={close} />\n </div>\n <div\n ref={contentReference}\n style={setContentMaxHeight()}\n className=\"np-bottom-sheet--content\"\n >\n {props.children}\n </div>\n </div>\n </SlidingPanel>\n </Dimmer>\n );\n};\n\nexport default BottomSheet;\n"],"names":["INITIAL_Y_POSITION","CONTENT_SCROLL_THRESHOLD","MOVE_OFFSET_THRESHOLD","BottomSheet","role","props","bottomSheetReference","useRef","topBarReference","contentReference","pressed","setPressed","useState","animationId","moveOffset","initialYCoordinate","useConditionalListener","attachListener","open","isServerSide","callback","current","classList","isContentScrollPositionAtTop","add","remove","eventType","parent","undefined","document","move","newHeight","style","transform","close","event","removeProperty","onClose","onSwipeStart","touches","clientY","onSwipeMove","offset","calculateOffsetAfterMove","requestAnimationFrame","onSwipeEnd","cancelAnimationFrame","scrollTop","afterMoveYCoordinate","setContentMaxHeight","safeZoneHeight","topbarHeight","windowHight","window","innerHeight","screenHeight","maxHeight","is400Zoom","useMedia","Breakpoint","ZOOM_400","overlayId","useContext","OverlayIdContext","_jsx","Drawer","className","children","Dimmer","fadeContentOnEnter","fadeContentOnExit","SlidingPanel","ref","position","Position","BOTTOM","clsx","_jsxs","id","onTou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AYvB,KAAK,CAAC,YAAY,CAAC,IAAIuB,SAAU;AAC7CxB,QAAAA,IAAI,EAAEA,IAAK;QACX,YAAA,EAAA,IAAU;AACV2E,QAAAA,YAAY,EAAEzC,YAAa;AAC3B0C,QAAAA,WAAW,EAAEvC,WAAY;AACzBwC,QAAAA,UAAU,EAAEpC,UAAW;AACvBqC,QAAAA,WAAW,EAAE5C,YAAa;AAC1B6C,QAAAA,WAAW,EAAE1C,WAAY;AACzB2C,QAAAA,SAAS,EAAEvC,UAAW;AAAAsB,QAAAA,QAAA,gBAEtBU,IAAA,CAAA,KAAA,EAAA;AAAKL,UAAAA,GAAG,EAAEhE,eAAgB;AAAC0D,UAAAA,SAAS,EAAC,0BAA0B;AAAAC,UAAAA,QAAA,gBAC7DH,GAAA,CAAA,KAAA,EAAA;AAAKE,YAAAA,SAAS,EAAC;AAA0B,WAAA,CACzC,eAAAF,GAAA,CAACqB,WAAW,EAAA;AAACC,YAAAA,IAAI,EAAC,IAAI;AAACpB,YAAAA,SAAS,EAAC,oCAAoC;AAACqB,YAAAA,OAAO,EAAErD;AAAM,WAAA,CACvF;SAAK,CACL,eAAA8B,GAAA,CAAA,KAAA,EAAA;AACEQ,UAAAA,GAAG,EAAE/D,gBAAiB;UACtBuB,KAAK,EAAEiB,mBAAmB,EAAG;AAC7BiB,UAAAA,SAAS,EAAC,0BAA0B;UAAAC,QAAA,EAEnC9D,KAAK,CAAC8D;AAAQ,SACZ,CACP;OAAK;KACO;AAChB,GAAQ,CACT;AACH;;;;"}
1
+ {"version":3,"file":"BottomSheet.mjs","sources":["../../../src/common/bottomSheet/BottomSheet.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport {\n CSSProperties,\n HTMLAttributes,\n PropsWithChildren,\n SyntheticEvent,\n useContext,\n useRef,\n useState,\n} from 'react';\nimport { Breakpoint } from '@transferwise/neptune-tokens';\n\nimport Dimmer from '../../dimmer';\nimport Drawer from '../../drawer';\nimport { OverlayIdContext } from '../../provider/overlay/OverlayIdProvider';\nimport SlidingPanel from '../../slidingPanel';\nimport { CloseButton } from '../closeButton';\nimport { CommonProps } from '../commonProps';\nimport { isServerSide } from '../domHelpers';\nimport { useConditionalListener } from '../hooks';\nimport { useMedia } from '../hooks/useMedia';\nimport { Position } from '../propsValues/position';\n\nconst INITIAL_Y_POSITION = 0;\n\nconst CONTENT_SCROLL_THRESHOLD = 1;\n\nconst MOVE_OFFSET_THRESHOLD = 50;\n\nexport type BottomSheetProps = PropsWithChildren<\n {\n onClose?: (event: Event | SyntheticEvent) => void;\n open: boolean;\n } & CommonProps &\n Pick<HTMLAttributes<HTMLDivElement>, 'role' | 'aria-labelledby' | 'aria-label'>\n>;\n\n/**\n * Neptune: https://transferwise.github.io/neptune/components/bottom-sheet/\n *\n * Neptune Web: https://transferwise.github.io/neptune-web/components/overlays/BottomSheet\n *\n */\nconst BottomSheet = ({ role = 'dialog', ...props }: BottomSheetProps) => {\n const bottomSheetReference = useRef<HTMLDivElement>(null);\n const topBarReference = useRef<HTMLDivElement>(null);\n const contentReference = useRef<HTMLDivElement>(null);\n\n const [pressed, setPressed] = useState<boolean>(false);\n\n /**\n * Used to track `requestAnimationFrame` requests\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame#return_value\n */\n const animationId = useRef<number>(0);\n\n /**\n * Difference between initial coordinate ({@link initialYCoordinate})\n * and new position (when user moves component), it's get calculated on `onTouchMove` and `onMouseMove` events\n *\n * @see {@link calculateOffsetAfterMove}\n */\n const moveOffset = useRef<number>(0);\n const initialYCoordinate = useRef<number>(0);\n\n // apply shadow to the bottom of top-bar when scroll over content\n useConditionalListener({\n attachListener: props.open && !isServerSide(),\n callback: () => {\n if (topBarReference.current !== null) {\n const { classList } = topBarReference.current;\n if (!isContentScrollPositionAtTop()) {\n classList.add('np-bottom-sheet--top-bar--shadow');\n } else {\n classList.remove('np-bottom-sheet--top-bar--shadow');\n }\n }\n },\n eventType: 'scroll',\n parent: isServerSide() ? undefined : document,\n });\n\n function move(newHeight: number): void {\n if (bottomSheetReference.current !== null) {\n bottomSheetReference.current.style.transform = `translateY(${newHeight}px)`;\n }\n }\n\n function close(event: Event | SyntheticEvent): void {\n setPressed(false);\n moveOffset.current = INITIAL_Y_POSITION;\n if (bottomSheetReference.current !== null) {\n bottomSheetReference.current.style.removeProperty('transform');\n }\n if (props.onClose) {\n props.onClose(event);\n }\n }\n\n const onSwipeStart = (\n event: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>,\n ): void => {\n initialYCoordinate.current = ('touches' in event ? event.touches[0] : event).clientY;\n setPressed(true);\n };\n\n const onSwipeMove = (\n event: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>,\n ): void => {\n if (pressed) {\n const { clientY } = 'touches' in event ? event.touches[0] : event;\n\n const offset = calculateOffsetAfterMove(clientY);\n // check whether move is to the bottom only and content scroll position is at the top\n if (offset > INITIAL_Y_POSITION && isContentScrollPositionAtTop()) {\n moveOffset.current = offset;\n animationId.current = requestAnimationFrame(() => {\n if (animationId.current !== undefined && bottomSheetReference.current !== null) {\n move(offset);\n }\n });\n }\n }\n };\n\n function onSwipeEnd(\n event: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>,\n ): void {\n // stop moving component\n cancelAnimationFrame(animationId.current);\n setPressed(false);\n // check whether move down is strong enough\n // and content scroll position is at the top to close the component\n if (moveOffset.current > MOVE_OFFSET_THRESHOLD && isContentScrollPositionAtTop()) {\n close(event);\n }\n // otherwise move component back to default (initial) position\n else {\n move(INITIAL_Y_POSITION);\n }\n moveOffset.current = INITIAL_Y_POSITION;\n }\n\n function isContentScrollPositionAtTop(): boolean {\n return (\n contentReference?.current?.scrollTop !== undefined &&\n contentReference.current.scrollTop <= CONTENT_SCROLL_THRESHOLD\n );\n }\n\n /**\n * Calculates how hard user moves component,\n * result value used to determine whether to hide component or re-position to default state\n *\n * @param afterMoveYCoordinate\n */\n function calculateOffsetAfterMove(afterMoveYCoordinate: number): number {\n return afterMoveYCoordinate - initialYCoordinate.current;\n }\n\n /**\n * Set `max-height` for content part (in order to keep it scrollable for content overflow cases) of the component\n * and ensures space for safe zone (32px) at the top.\n */\n function setContentMaxHeight(): CSSProperties {\n const safeZoneHeight = '64px';\n const topbarHeight = '32px';\n const windowHight: number = isServerSide() ? 0 : window.innerHeight;\n /**\n * Calculate _real_ height of the screen (taking into account parts of browser interface).\n *\n * See https://css-tricks.com/the-trick-to-viewport-units-on-mobile for more details.\n */\n const screenHeight = `${windowHight * 0.01 * 100}px`;\n return {\n maxHeight: `calc(${screenHeight} - ${safeZoneHeight} - ${topbarHeight})`,\n };\n }\n\n const is400Zoom = useMedia(`(max-width: ${Breakpoint.EXTRA_SMALL}px)`);\n\n const overlayId = useContext(OverlayIdContext);\n\n return is400Zoom ? (\n <Drawer\n aria-labelledby={props['aria-labelledby']}\n aria-label={props['aria-label']}\n role={role}\n open={props.open}\n className={props.className}\n onClose={close}\n >\n {props.children}\n </Drawer>\n ) : (\n <Dimmer open={props.open} fadeContentOnEnter fadeContentOnExit onClose={close}>\n <SlidingPanel\n ref={bottomSheetReference}\n open={props.open}\n position={Position.BOTTOM}\n className={clsx('np-bottom-sheet', props.className)}\n >\n <div\n id={overlayId}\n aria-labelledby={props['aria-labelledby'] || undefined}\n aria-label={props['aria-label'] || undefined}\n role={role}\n aria-modal\n onTouchStart={onSwipeStart}\n onTouchMove={onSwipeMove}\n onTouchEnd={onSwipeEnd}\n onMouseDown={onSwipeStart}\n onMouseMove={onSwipeMove}\n onMouseUp={onSwipeEnd}\n >\n <div ref={topBarReference} className=\"np-bottom-sheet--top-bar\">\n <div className=\"np-bottom-sheet--handler\" />\n <CloseButton size=\"sm\" className=\"sr-only np-bottom-sheet--close-btn\" onClick={close} />\n </div>\n <div\n ref={contentReference}\n style={setContentMaxHeight()}\n className=\"np-bottom-sheet--content\"\n >\n {props.children}\n </div>\n </div>\n </SlidingPanel>\n </Dimmer>\n );\n};\n\nexport default BottomSheet;\n"],"names":["INITIAL_Y_POSITION","CONTENT_SCROLL_THRESHOLD","MOVE_OFFSET_THRESHOLD","BottomSheet","role","props","bottomSheetReference","useRef","topBarReference","contentReference","pressed","setPressed","useState","animationId","moveOffset","initialYCoordinate","useConditionalListener","attachListener","open","isServerSide","callback","current","classList","isContentScrollPositionAtTop","add","remove","eventType","parent","undefined","document","move","newHeight","style","transform","close","event","removeProperty","onClose","onSwipeStart","touches","clientY","onSwipeMove","offset","calculateOffsetAfterMove","requestAnimationFrame","onSwipeEnd","cancelAnimationFrame","scrollTop","afterMoveYCoordinate","setContentMaxHeight","safeZoneHeight","topbarHeight","windowHight","window","innerHeight","screenHeight","maxHeight","is400Zoom","useMedia","Breakpoint","EXTRA_SMALL","overlayId","useContext","OverlayIdContext","_jsx","Drawer","className","children","Dimmer","fadeContentOnEnter","fadeContentOnExit","SlidingPanel","ref","position","Position","BOTTOM","clsx","_jsxs","id","onTouchStart","onTouchMove","onTouchEnd","onMouseDown","onMouseMove","onMouseUp","CloseButton","size","onClick"],"mappings":";;;;;;;;;;;;;;;AAuBA,MAAMA,kBAAkB,GAAG,CAAC;AAE5B,MAAMC,wBAAwB,GAAG,CAAC;AAElC,MAAMC,qBAAqB,GAAG,EAAE;AAUhC;;;;;AAKG;AACH,MAAMC,WAAW,GAAGA,CAAC;AAAEC,EAAAA,IAAI,GAAG,QAAQ;EAAE,GAAGC;AAAK,CAAoB,KAAI;AACtE,EAAA,MAAMC,oBAAoB,GAAGC,MAAM,CAAiB,IAAI,CAAC;AACzD,EAAA,MAAMC,eAAe,GAAGD,MAAM,CAAiB,IAAI,CAAC;AACpD,EAAA,MAAME,gBAAgB,GAAGF,MAAM,CAAiB,IAAI,CAAC;EAErD,MAAM,CAACG,OAAO,EAAEC,UAAU,CAAC,GAAGC,QAAQ,CAAU,KAAK,CAAC;AAEtD;;;;AAIG;AACH,EAAA,MAAMC,WAAW,GAAGN,MAAM,CAAS,CAAC,CAAC;AAErC;;;;;AAKG;AACH,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YAAAA,OAAO,EAAErD;AAAM,WAAA,CACvF;SAAK,CACL,eAAA8B,GAAA,CAAA,KAAA,EAAA;AACEQ,UAAAA,GAAG,EAAE/D,gBAAiB;UACtBuB,KAAK,EAAEiB,mBAAmB,EAAG;AAC7BiB,UAAAA,SAAS,EAAC,0BAA0B;UAAAC,QAAA,EAEnC9D,KAAK,CAAC8D;AAAQ,SACZ,CACP;OAAK;KACO;AAChB,GAAQ,CACT;AACH;;;;"}
@@ -4,8 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var clsx = require('clsx');
7
+ var neptuneTokens = require('@transferwise/neptune-tokens');
7
8
  var useMedia = require('../hooks/useMedia.js');
8
- var breakpoint = require('../propsValues/breakpoint.js');
9
9
  var jsxRuntime = require('react/jsx-runtime');
10
10
 
11
11
  const MAP_ICON_SIZE = {
@@ -41,7 +41,7 @@ const Circle = /*#__PURE__*/React.forwardRef(function Circle({
41
41
  style,
42
42
  ...props
43
43
  }, ref) {
44
- const isTinyViewport = useMedia.useMedia(`(max-width: ${breakpoint.Breakpoint.ZOOM_400}px)`);
44
+ const isTinyViewport = useMedia.useMedia(`(max-width: ${neptuneTokens.Breakpoint.EXTRA_SMALL}px)`);
45
45
  return /*#__PURE__*/jsxRuntime.jsx(Element, {
46
46
  ...props,
47
47
  ref: ref,
@@ -1 +1 @@
1
- {"version":3,"file":"Circle.js","sources":["../../../src/common/circle/Circle.tsx"],"sourcesContent":["import { HTMLAttributes, forwardRef } from 'react';\nimport { clsx } from 'clsx';\nimport { useMedia } from '../hooks/useMedia';\nimport { Breakpoint } from '../propsValues/breakpoint';\n\nexport type ShapeSize = 16 | 24 | 32 | 40 | 48 | 56 | 72;\n\nexport type Props = {\n /**\n * Modify underlying element, `div` by default\n */\n as?: React.ElementType;\n /**\n * Set size of the circle in px, `48` by default\n */\n size?: ShapeSize;\n /**\n * When `true` will use the fixed size (`48px`) instead of the CSS spacing variable (`--size-*`)\n * as those can be dynamic a at certain viewport sizes\n */\n fixedSize?: boolean;\n enableBorder?: boolean;\n} & HTMLAttributes<HTMLDivElement>;\n\n/**\n * circle like components has custom sizes for icons\n */\nconst MAP_ICON_SIZE = {\n 16: 12,\n 24: 16,\n 32: 18,\n 40: 20,\n 48: 24,\n 56: 28,\n 72: 36,\n};\n\n/**\n * circle like components have custom typography styles for for default (Inter) font\n *\n * circle size : font size (px)\n */\nconst MAP_FONT_SIZE = {\n 16: 8,\n 24: 12,\n 32: 14,\n 40: 18,\n 48: 22,\n 56: 26,\n 72: 30,\n};\n\nconst Circle = forwardRef(function Circle(\n {\n as: Element = 'div',\n children,\n size = 48,\n fixedSize = false,\n enableBorder = false,\n className,\n style,\n ...props\n }: Props,\n ref,\n) {\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n return (\n <Element\n {...props}\n ref={ref}\n style={{\n '--circle-size': fixedSize ? `${size}px` : `var(--size-${size})`,\n '--circle-icon-size':\n isTinyViewport && !fixedSize\n ? `${MAP_ICON_SIZE[size] / 2}px`\n : `${MAP_ICON_SIZE[size]}px`,\n '--circle-font-size': `${MAP_FONT_SIZE[size]}px`,\n ...style,\n }}\n className={clsx(\n 'np-circle',\n { 'np-circle-border': enableBorder },\n 'd-flex align-items-center justify-content-center',\n className,\n )}\n >\n {children}\n </Element>\n );\n});\n\nexport default Circle;\n"],"names":["MAP_ICON_SIZE","MAP_FONT_SIZE","Circle","forwardRef","as","Element","children","size","fixedSize","enableBorder","className","style","props","ref","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","clsx"],"mappings":";;;;;;;;;;AA2BA,MAAMA,aAAa,GAAG;AACpB,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE;CACL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,IAAAA,QAAA,EAEDA;AAAQ,GACF,CAAC;AAEd,CAAC;;;;"}
1
+ {"version":3,"file":"Circle.js","sources":["../../../src/common/circle/Circle.tsx"],"sourcesContent":["import { HTMLAttributes, forwardRef } from 'react';\nimport { clsx } from 'clsx';\nimport { Breakpoint } from '@transferwise/neptune-tokens';\nimport { useMedia } from '../hooks/useMedia';\n\nexport type ShapeSize = 16 | 24 | 32 | 40 | 48 | 56 | 72;\n\nexport type Props = {\n /**\n * Modify underlying element, `div` by default\n */\n as?: React.ElementType;\n /**\n * Set size of the circle in px, `48` by default\n */\n size?: ShapeSize;\n /**\n * When `true` will use the fixed size (`48px`) instead of the CSS spacing variable (`--size-*`)\n * as those can be dynamic a at certain viewport sizes\n */\n fixedSize?: boolean;\n enableBorder?: boolean;\n} & HTMLAttributes<HTMLDivElement>;\n\n/**\n * circle like components has custom sizes for icons\n */\nconst MAP_ICON_SIZE = {\n 16: 12,\n 24: 16,\n 32: 18,\n 40: 20,\n 48: 24,\n 56: 28,\n 72: 36,\n};\n\n/**\n * circle like components have custom typography styles for for default (Inter) font\n *\n * circle size : font size (px)\n */\nconst MAP_FONT_SIZE = {\n 16: 8,\n 24: 12,\n 32: 14,\n 40: 18,\n 48: 22,\n 56: 26,\n 72: 30,\n};\n\nconst Circle = forwardRef(function Circle(\n {\n as: Element = 'div',\n children,\n size = 48,\n fixedSize = false,\n enableBorder = false,\n className,\n style,\n ...props\n }: Props,\n ref,\n) {\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.EXTRA_SMALL}px)`);\n return (\n <Element\n {...props}\n ref={ref}\n style={{\n '--circle-size': fixedSize ? `${size}px` : `var(--size-${size})`,\n '--circle-icon-size':\n isTinyViewport && !fixedSize\n ? `${MAP_ICON_SIZE[size] / 2}px`\n : `${MAP_ICON_SIZE[size]}px`,\n '--circle-font-size': `${MAP_FONT_SIZE[size]}px`,\n ...style,\n }}\n className={clsx(\n 'np-circle',\n { 'np-circle-border': enableBorder },\n 'd-flex align-items-center justify-content-center',\n className,\n )}\n >\n {children}\n </Element>\n );\n});\n\nexport default Circle;\n"],"names":["MAP_ICON_SIZE","MAP_FONT_SIZE","Circle","forwardRef","as","Element","children","size","fixedSize","enableBorder","className","style","props","ref","isTinyViewport","useMedia","Breakpoint","EXTRA_SMALL","_jsx","clsx"],"mappings":";;;;;;;;;;AA2BA,MAAMA,aAAa,GAAG;AACpB,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE;CACL;AAED;;;;AAIG;AACH,MAAMC,aAAa,GAAG;AACpB,EAAA,EAAE,EAAE,CAAC;AACL,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE;CACL;AAED,MAAMC,MAAM,gBAAGC,gBAAU,CAAC,SAASD,MAAMA,CACvC;EACEE,EAAE,EAAEC,OAAO,GAAG,KAAK;EACnBC,QAAQ;AACRC,EAAAA,IAAI,GAAG,EAAE;AACTC,EAAAA,SAAS,GAAG,KAAK;AACjBC,EAAAA,YAAY,GAAG,KAAK;EACpBC,SAAS;EACTC,KAAK;EACL,GAAGC;AAAK,CACF,EACRC,GAAG,EAAA;EAEH,MAAMC,cAAc,GAAGC,iBAAQ,CAAC,eAAeC,wBAAU,CAACC,WAAW,CAAA,GAAA,CAAK,CAAC;EAC3E,oBACEC,cAAA,CAACb,OAAO,EAAA;AAAA,IAAA,GACFO,KAAK;AACTC,IAAAA,GAAG,EAAEA,GAAI;AACTF,IAAAA,KAAK,EAAE;MACL,eAAe,EAAEH,SAAS,GAAG,CAAA,EAAGD,IAAI,CAAA,EAAA,CAAI,GAAG,CAAA,WAAA,EAAcA,IAAI,CAAA,CAAA,CAAG;MAChE,oBAAoB,EAClBO,cAAc,IAAI,CAACN,SAAS,GACxB,CAAA,EAAGR,aAAa,CAACO,IAAI,CAAC,GAAG,CAAC,IAAI,GAC9B,CAAA,EAAGP,aAAa,CAACO,IAAI,CAAC,CAAA,EAAA,CAAI;AAChC,MAAA,oBAAoB,EAAE,CAAA,EAAGN,aAAa,CAACM,IAAI,CAAC,CAAA,EAAA,CAAI;MAChD,GAAGI;KACH;AACFD,IAAAA,SAAS,EAAES,SAAI,CACb,WAAW,EACX;AAAE,MAAA,kBAAkB,EAAEV;KAAc,EACpC,kDAAkD,EAClDC,SAAS,CACT;AAAAJ,IAAAA,QAAA,EAEDA;AAAQ,GACF,CAAC;AAEd,CAAC;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { forwardRef } from 'react';
2
2
  import { clsx } from 'clsx';
3
+ import { Breakpoint } from '@transferwise/neptune-tokens';
3
4
  import { useMedia } from '../hooks/useMedia.mjs';
4
- import { Breakpoint } from '../propsValues/breakpoint.mjs';
5
5
  import { jsx } from 'react/jsx-runtime';
6
6
 
7
7
  const MAP_ICON_SIZE = {
@@ -37,7 +37,7 @@ const Circle = /*#__PURE__*/forwardRef(function Circle({
37
37
  style,
38
38
  ...props
39
39
  }, ref) {
40
- const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);
40
+ const isTinyViewport = useMedia(`(max-width: ${Breakpoint.EXTRA_SMALL}px)`);
41
41
  return /*#__PURE__*/jsx(Element, {
42
42
  ...props,
43
43
  ref: ref,
@@ -1 +1 @@
1
- {"version":3,"file":"Circle.mjs","sources":["../../../src/common/circle/Circle.tsx"],"sourcesContent":["import { HTMLAttributes, forwardRef } from 'react';\nimport { clsx } from 'clsx';\nimport { useMedia } from '../hooks/useMedia';\nimport { Breakpoint } from '../propsValues/breakpoint';\n\nexport type ShapeSize = 16 | 24 | 32 | 40 | 48 | 56 | 72;\n\nexport type Props = {\n /**\n * Modify underlying element, `div` by default\n */\n as?: React.ElementType;\n /**\n * Set size of the circle in px, `48` by default\n */\n size?: ShapeSize;\n /**\n * When `true` will use the fixed size (`48px`) instead of the CSS spacing variable (`--size-*`)\n * as those can be dynamic a at certain viewport sizes\n */\n fixedSize?: boolean;\n enableBorder?: boolean;\n} & HTMLAttributes<HTMLDivElement>;\n\n/**\n * circle like components has custom sizes for icons\n */\nconst MAP_ICON_SIZE = {\n 16: 12,\n 24: 16,\n 32: 18,\n 40: 20,\n 48: 24,\n 56: 28,\n 72: 36,\n};\n\n/**\n * circle like components have custom typography styles for for default (Inter) font\n *\n * circle size : font size (px)\n */\nconst MAP_FONT_SIZE = {\n 16: 8,\n 24: 12,\n 32: 14,\n 40: 18,\n 48: 22,\n 56: 26,\n 72: 30,\n};\n\nconst Circle = forwardRef(function Circle(\n {\n as: Element = 'div',\n children,\n size = 48,\n fixedSize = false,\n enableBorder = false,\n className,\n style,\n ...props\n }: Props,\n ref,\n) {\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n return (\n <Element\n {...props}\n ref={ref}\n style={{\n '--circle-size': fixedSize ? `${size}px` : `var(--size-${size})`,\n '--circle-icon-size':\n isTinyViewport && !fixedSize\n ? `${MAP_ICON_SIZE[size] / 2}px`\n : `${MAP_ICON_SIZE[size]}px`,\n '--circle-font-size': `${MAP_FONT_SIZE[size]}px`,\n ...style,\n }}\n className={clsx(\n 'np-circle',\n { 'np-circle-border': enableBorder },\n 'd-flex align-items-center justify-content-center',\n className,\n )}\n >\n {children}\n </Element>\n );\n});\n\nexport default Circle;\n"],"names":["MAP_ICON_SIZE","MAP_FONT_SIZE","Circle","forwardRef","as","Element","children","size","fixedSize","enableBorder","className","style","props","ref","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","clsx"],"mappings":";;;;;;AA2BA,MAAMA,aAAa,GAAG;AACpB,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE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,CAAI;MAChD,GAAGI;KACH;AACFD,IAAAA,SAAS,EAAES,IAAI,CACb,WAAW,EACX;AAAE,MAAA,kBAAkB,EAAEV;KAAc,EACpC,kDAAkD,EAClDC,SAAS,CACT;AAAAJ,IAAAA,QAAA,EAEDA;AAAQ,GACF,CAAC;AAEd,CAAC;;;;"}
1
+ {"version":3,"file":"Circle.mjs","sources":["../../../src/common/circle/Circle.tsx"],"sourcesContent":["import { HTMLAttributes, forwardRef } from 'react';\nimport { clsx } from 'clsx';\nimport { Breakpoint } from '@transferwise/neptune-tokens';\nimport { useMedia } from '../hooks/useMedia';\n\nexport type ShapeSize = 16 | 24 | 32 | 40 | 48 | 56 | 72;\n\nexport type Props = {\n /**\n * Modify underlying element, `div` by default\n */\n as?: React.ElementType;\n /**\n * Set size of the circle in px, `48` by default\n */\n size?: ShapeSize;\n /**\n * When `true` will use the fixed size (`48px`) instead of the CSS spacing variable (`--size-*`)\n * as those can be dynamic a at certain viewport sizes\n */\n fixedSize?: boolean;\n enableBorder?: boolean;\n} & HTMLAttributes<HTMLDivElement>;\n\n/**\n * circle like components has custom sizes for icons\n */\nconst MAP_ICON_SIZE = {\n 16: 12,\n 24: 16,\n 32: 18,\n 40: 20,\n 48: 24,\n 56: 28,\n 72: 36,\n};\n\n/**\n * circle like components have custom typography styles for for default (Inter) font\n *\n * circle size : font size (px)\n */\nconst MAP_FONT_SIZE = {\n 16: 8,\n 24: 12,\n 32: 14,\n 40: 18,\n 48: 22,\n 56: 26,\n 72: 30,\n};\n\nconst Circle = forwardRef(function Circle(\n {\n as: Element = 'div',\n children,\n size = 48,\n fixedSize = false,\n enableBorder = false,\n className,\n style,\n ...props\n }: Props,\n ref,\n) {\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.EXTRA_SMALL}px)`);\n return (\n <Element\n {...props}\n ref={ref}\n style={{\n '--circle-size': fixedSize ? `${size}px` : `var(--size-${size})`,\n '--circle-icon-size':\n isTinyViewport && !fixedSize\n ? `${MAP_ICON_SIZE[size] / 2}px`\n : `${MAP_ICON_SIZE[size]}px`,\n '--circle-font-size': `${MAP_FONT_SIZE[size]}px`,\n ...style,\n }}\n className={clsx(\n 'np-circle',\n { 'np-circle-border': enableBorder },\n 'd-flex align-items-center justify-content-center',\n className,\n )}\n >\n {children}\n </Element>\n );\n});\n\nexport default Circle;\n"],"names":["MAP_ICON_SIZE","MAP_FONT_SIZE","Circle","forwardRef","as","Element","children","size","fixedSize","enableBorder","className","style","props","ref","isTinyViewport","useMedia","Breakpoint","EXTRA_SMALL","_jsx","clsx"],"mappings":";;;;;;AA2BA,MAAMA,aAAa,GAAG;AACpB,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE;CACL;AAED;;;;AAIG;AACH,MAAMC,aAAa,GAAG;AACpB,EAAA,EAAE,EAAE,CAAC;AACL,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE;CACL;AAED,MAAMC,MAAM,gBAAGC,UAAU,CAAC,SAASD,MAAMA,CACvC;EACEE,EAAE,EAAEC,OAAO,GAAG,KAAK;EACnBC,QAAQ;AACRC,EAAAA,IAAI,GAAG,EAAE;AACTC,EAAAA,SAAS,GAAG,KAAK;AACjBC,EAAAA,YAAY,GAAG,KAAK;EACpBC,SAAS;EACTC,KAAK;EACL,GAAGC;AAAK,CACF,EACRC,GAAG,EAAA;EAEH,MAAMC,cAAc,GAAGC,QAAQ,CAAC,eAAeC,UAAU,CAACC,WAAW,CAAA,GAAA,CAAK,CAAC;EAC3E,oBACEC,GAAA,CAACb,OAAO,EAAA;AAAA,IAAA,GACFO,KAAK;AACTC,IAAAA,GAAG,EAAEA,GAAI;AACTF,IAAAA,KAAK,EAAE;MACL,eAAe,EAAEH,SAAS,GAAG,CAAA,EAAGD,IAAI,CAAA,EAAA,CAAI,GAAG,CAAA,WAAA,EAAcA,IAAI,CAAA,CAAA,CAAG;MAChE,oBAAoB,EAClBO,cAAc,IAAI,CAACN,SAAS,GACxB,CAAA,EAAGR,aAAa,CAACO,IAAI,CAAC,GAAG,CAAC,IAAI,GAC9B,CAAA,EAAGP,aAAa,CAACO,IAAI,CAAC,CAAA,EAAA,CAAI;AAChC,MAAA,oBAAoB,EAAE,CAAA,EAAGN,aAAa,CAACM,IAAI,CAAC,CAAA,EAAA,CAAI;MAChD,GAAGI;KACH;AACFD,IAAAA,SAAS,EAAES,IAAI,CACb,WAAW,EACX;AAAE,MAAA,kBAAkB,EAAEV;KAAc,EACpC,kDAAkD,EAClDC,SAAS,CACT;AAAAJ,IAAAA,QAAA,EAEDA;AAAQ,GACF,CAAC;AAEd,CAAC;;;;"}
@@ -1,17 +1,17 @@
1
1
  'use strict';
2
2
 
3
- var breakpoint = require('../../propsValues/breakpoint.js');
3
+ var neptuneTokens = require('@transferwise/neptune-tokens');
4
4
  var useScreenSize = require('../useScreenSize.js');
5
5
 
6
6
  /**
7
7
  * @deprecated Prefer `useScreenSize` instead.
8
8
  */
9
9
  const useLayout = () => {
10
- const screenXs = useScreenSize.useScreenSize(breakpoint.Breakpoint.EXTRA_SMALL);
11
- const screenSm = useScreenSize.useScreenSize(breakpoint.Breakpoint.SMALL);
12
- const screenMd = useScreenSize.useScreenSize(breakpoint.Breakpoint.MEDIUM);
13
- const screenLg = useScreenSize.useScreenSize(breakpoint.Breakpoint.LARGE);
14
- const screenXl = useScreenSize.useScreenSize(breakpoint.Breakpoint.EXTRA_LARGE);
10
+ const screenXs = useScreenSize.useScreenSize(neptuneTokens.Breakpoint.EXTRA_SMALL);
11
+ const screenSm = useScreenSize.useScreenSize(neptuneTokens.Breakpoint.SMALL);
12
+ const screenMd = useScreenSize.useScreenSize(neptuneTokens.Breakpoint.MEDIUM);
13
+ const screenLg = useScreenSize.useScreenSize(neptuneTokens.Breakpoint.LARGE);
14
+ const screenXl = useScreenSize.useScreenSize(neptuneTokens.Breakpoint.EXTRA_LARGE);
15
15
  return {
16
16
  isMobile: screenSm != null ? !screenSm : undefined,
17
17
  isExtraSmall: screenXs,
@@ -1 +1 @@
1
- {"version":3,"file":"useLayout.js","sources":["../../../../src/common/hooks/useLayout/useLayout.ts"],"sourcesContent":["import { Breakpoint } from '../../propsValues/breakpoint';\nimport { useScreenSize } from '../useScreenSize';\n\n/**\n * @deprecated Prefer `useScreenSize` instead.\n */\nexport const useLayout = (): {\n isMobile: boolean | undefined;\n isExtraSmall: boolean | undefined;\n isSmall: boolean | undefined;\n isMedium: boolean | undefined;\n isLarge: boolean | undefined;\n isExtraLarge: boolean | undefined;\n} => {\n const screenXs = useScreenSize(Breakpoint.EXTRA_SMALL);\n const screenSm = useScreenSize(Breakpoint.SMALL);\n const screenMd = useScreenSize(Breakpoint.MEDIUM);\n const screenLg = useScreenSize(Breakpoint.LARGE);\n const screenXl = useScreenSize(Breakpoint.EXTRA_LARGE);\n\n return {\n isMobile: screenSm != null ? !screenSm : undefined,\n isExtraSmall: screenXs,\n isSmall: screenSm,\n isMedium: screenMd,\n isLarge: screenLg,\n isExtraLarge: screenXl,\n };\n};\n"],"names":["useLayout","screenXs","useScreenSize","Breakpoint","EXTRA_SMALL","screenSm","SMALL","screenMd","MEDIUM","screenLg","LARGE","screenXl","EXTRA_LARGE","isMobile","undefined","isExtraSmall","isSmall","isMedium","isLarge","isExtraLarge"],"mappings":";;;;;AAGA;;AAEG;AACI,MAAMA,SAAS,GAAGA,MAOrB;AACF,EAAA,MAAMC,QAAQ,GAAGC,2BAAa,CAACC,qBAAU,CAACC,WAAW,CAAC;AACtD,EAAA,MAAMC,QAAQ,GAAGH,2BAAa,CAACC,qBAAU,CAACG,KAAK,CAAC;AAChD,EAAA,MAAMC,QAAQ,GAAGL,2BAAa,CAACC,qBAAU,CAACK,MAAM,CAAC;AACjD,EAAA,MAAMC,QAAQ,GAAGP,2BAAa,CAACC,qBAAU,CAACO,KAAK,CAAC;AAChD,EAAA,MAAMC,QAAQ,GAAGT,2BAAa,CAACC,qBAAU,CAACS,WAAW,CAAC;EAEtD,OAAO;IACLC,QAAQ,EAAER,QAAQ,IAAI,IAAI,GAAG,CAACA,QAAQ,GAAGS,SAAS;AAClDC,IAAAA,YAAY,EAAEd,QAAQ;AACtBe,IAAAA,OAAO,EAAEX,QAAQ;AACjBY,IAAAA,QAAQ,EAAEV,QAAQ;AAClBW,IAAAA,OAAO,EAAET,QAAQ;AACjBU,IAAAA,YAAY,EAAER;GACf;AACH;;;;"}
1
+ {"version":3,"file":"useLayout.js","sources":["../../../../src/common/hooks/useLayout/useLayout.ts"],"sourcesContent":["import { Breakpoint } from '@transferwise/neptune-tokens';\nimport { useScreenSize } from '../useScreenSize';\n\n/**\n * @deprecated Prefer `useScreenSize` instead.\n */\nexport const useLayout = (): {\n isMobile: boolean | undefined;\n isExtraSmall: boolean | undefined;\n isSmall: boolean | undefined;\n isMedium: boolean | undefined;\n isLarge: boolean | undefined;\n isExtraLarge: boolean | undefined;\n} => {\n const screenXs = useScreenSize(Breakpoint.EXTRA_SMALL);\n const screenSm = useScreenSize(Breakpoint.SMALL);\n const screenMd = useScreenSize(Breakpoint.MEDIUM);\n const screenLg = useScreenSize(Breakpoint.LARGE);\n const screenXl = useScreenSize(Breakpoint.EXTRA_LARGE);\n\n return {\n isMobile: screenSm != null ? !screenSm : undefined,\n isExtraSmall: screenXs,\n isSmall: screenSm,\n isMedium: screenMd,\n isLarge: screenLg,\n isExtraLarge: screenXl,\n };\n};\n"],"names":["useLayout","screenXs","useScreenSize","Breakpoint","EXTRA_SMALL","screenSm","SMALL","screenMd","MEDIUM","screenLg","LARGE","screenXl","EXTRA_LARGE","isMobile","undefined","isExtraSmall","isSmall","isMedium","isLarge","isExtraLarge"],"mappings":";;;;;AAGA;;AAEG;AACI,MAAMA,SAAS,GAAGA,MAOrB;AACF,EAAA,MAAMC,QAAQ,GAAGC,2BAAa,CAACC,wBAAU,CAACC,WAAW,CAAC;AACtD,EAAA,MAAMC,QAAQ,GAAGH,2BAAa,CAACC,wBAAU,CAACG,KAAK,CAAC;AAChD,EAAA,MAAMC,QAAQ,GAAGL,2BAAa,CAACC,wBAAU,CAACK,MAAM,CAAC;AACjD,EAAA,MAAMC,QAAQ,GAAGP,2BAAa,CAACC,wBAAU,CAACO,KAAK,CAAC;AAChD,EAAA,MAAMC,QAAQ,GAAGT,2BAAa,CAACC,wBAAU,CAACS,WAAW,CAAC;EAEtD,OAAO;IACLC,QAAQ,EAAER,QAAQ,IAAI,IAAI,GAAG,CAACA,QAAQ,GAAGS,SAAS;AAClDC,IAAAA,YAAY,EAAEd,QAAQ;AACtBe,IAAAA,OAAO,EAAEX,QAAQ;AACjBY,IAAAA,QAAQ,EAAEV,QAAQ;AAClBW,IAAAA,OAAO,EAAET,QAAQ;AACjBU,IAAAA,YAAY,EAAER;GACf;AACH;;;;"}
@@ -1,4 +1,4 @@
1
- import { Breakpoint } from '../../propsValues/breakpoint.mjs';
1
+ import { Breakpoint } from '@transferwise/neptune-tokens';
2
2
  import { useScreenSize } from '../useScreenSize.mjs';
3
3
 
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"useLayout.mjs","sources":["../../../../src/common/hooks/useLayout/useLayout.ts"],"sourcesContent":["import { Breakpoint } from '../../propsValues/breakpoint';\nimport { useScreenSize } from '../useScreenSize';\n\n/**\n * @deprecated Prefer `useScreenSize` instead.\n */\nexport const useLayout = (): {\n isMobile: boolean | undefined;\n isExtraSmall: boolean | undefined;\n isSmall: boolean | undefined;\n isMedium: boolean | undefined;\n isLarge: boolean | undefined;\n isExtraLarge: boolean | undefined;\n} => {\n const screenXs = useScreenSize(Breakpoint.EXTRA_SMALL);\n const screenSm = useScreenSize(Breakpoint.SMALL);\n const screenMd = useScreenSize(Breakpoint.MEDIUM);\n const screenLg = useScreenSize(Breakpoint.LARGE);\n const screenXl = useScreenSize(Breakpoint.EXTRA_LARGE);\n\n return {\n isMobile: screenSm != null ? !screenSm : undefined,\n isExtraSmall: screenXs,\n isSmall: screenSm,\n isMedium: screenMd,\n isLarge: screenLg,\n isExtraLarge: screenXl,\n };\n};\n"],"names":["useLayout","screenXs","useScreenSize","Breakpoint","EXTRA_SMALL","screenSm","SMALL","screenMd","MEDIUM","screenLg","LARGE","screenXl","EXTRA_LARGE","isMobile","undefined","isExtraSmall","isSmall","isMedium","isLarge","isExtraLarge"],"mappings":";;;AAGA;;AAEG;AACI,MAAMA,SAAS,GAAGA,MAOrB;AACF,EAAA,MAAMC,QAAQ,GAAGC,aAAa,CAACC,UAAU,CAACC,WAAW,CAAC;AACtD,EAAA,MAAMC,QAAQ,GAAGH,aAAa,CAACC,UAAU,CAACG,KAAK,CAAC;AAChD,EAAA,MAAMC,QAAQ,GAAGL,aAAa,CAACC,UAAU,CAACK,MAAM,CAAC;AACjD,EAAA,MAAMC,QAAQ,GAAGP,aAAa,CAACC,UAAU,CAACO,KAAK,CAAC;AAChD,EAAA,MAAMC,QAAQ,GAAGT,aAAa,CAACC,UAAU,CAACS,WAAW,CAAC;EAEtD,OAAO;IACLC,QAAQ,EAAER,QAAQ,IAAI,IAAI,GAAG,CAACA,QAAQ,GAAGS,SAAS;AAClDC,IAAAA,YAAY,EAAEd,QAAQ;AACtBe,IAAAA,OAAO,EAAEX,QAAQ;AACjBY,IAAAA,QAAQ,EAAEV,QAAQ;AAClBW,IAAAA,OAAO,EAAET,QAAQ;AACjBU,IAAAA,YAAY,EAAER;GACf;AACH;;;;"}
1
+ {"version":3,"file":"useLayout.mjs","sources":["../../../../src/common/hooks/useLayout/useLayout.ts"],"sourcesContent":["import { Breakpoint } from '@transferwise/neptune-tokens';\nimport { useScreenSize } from '../useScreenSize';\n\n/**\n * @deprecated Prefer `useScreenSize` instead.\n */\nexport const useLayout = (): {\n isMobile: boolean | undefined;\n isExtraSmall: boolean | undefined;\n isSmall: boolean | undefined;\n isMedium: boolean | undefined;\n isLarge: boolean | undefined;\n isExtraLarge: boolean | undefined;\n} => {\n const screenXs = useScreenSize(Breakpoint.EXTRA_SMALL);\n const screenSm = useScreenSize(Breakpoint.SMALL);\n const screenMd = useScreenSize(Breakpoint.MEDIUM);\n const screenLg = useScreenSize(Breakpoint.LARGE);\n const screenXl = useScreenSize(Breakpoint.EXTRA_LARGE);\n\n return {\n isMobile: screenSm != null ? !screenSm : undefined,\n isExtraSmall: screenXs,\n isSmall: screenSm,\n isMedium: screenMd,\n isLarge: screenLg,\n isExtraLarge: screenXl,\n };\n};\n"],"names":["useLayout","screenXs","useScreenSize","Breakpoint","EXTRA_SMALL","screenSm","SMALL","screenMd","MEDIUM","screenLg","LARGE","screenXl","EXTRA_LARGE","isMobile","undefined","isExtraSmall","isSmall","isMedium","isLarge","isExtraLarge"],"mappings":";;;AAGA;;AAEG;AACI,MAAMA,SAAS,GAAGA,MAOrB;AACF,EAAA,MAAMC,QAAQ,GAAGC,aAAa,CAACC,UAAU,CAACC,WAAW,CAAC;AACtD,EAAA,MAAMC,QAAQ,GAAGH,aAAa,CAACC,UAAU,CAACG,KAAK,CAAC;AAChD,EAAA,MAAMC,QAAQ,GAAGL,aAAa,CAACC,UAAU,CAACK,MAAM,CAAC;AACjD,EAAA,MAAMC,QAAQ,GAAGP,aAAa,CAACC,UAAU,CAACO,KAAK,CAAC;AAChD,EAAA,MAAMC,QAAQ,GAAGT,aAAa,CAACC,UAAU,CAACS,WAAW,CAAC;EAEtD,OAAO;IACLC,QAAQ,EAAER,QAAQ,IAAI,IAAI,GAAG,CAACA,QAAQ,GAAGS,SAAS;AAClDC,IAAAA,YAAY,EAAEd,QAAQ;AACtBe,IAAAA,OAAO,EAAEX,QAAQ;AACjBY,IAAAA,QAAQ,EAAEV,QAAQ;AAClBW,IAAAA,OAAO,EAAET,QAAQ;AACjBU,IAAAA,YAAY,EAAER;GACf;AACH;;;;"}
@@ -3,7 +3,7 @@
3
3
  var React = require('react');
4
4
  var useEffectEvent = require('./useEffectEvent.js');
5
5
 
6
- function useResizeObserver(ref, callback, box = 'border-box') {
6
+ function useResizeObserver(ref, callback) {
7
7
  const handleCallback = useEffectEvent.useEffectEvent(callback);
8
8
  React.useEffect(() => {
9
9
  if (ref.current != null) {
@@ -11,14 +11,14 @@ function useResizeObserver(ref, callback, box = 'border-box') {
11
11
  handleCallback(entry);
12
12
  });
13
13
  resizeObserver.observe(ref.current, {
14
- box
14
+ box: 'border-box'
15
15
  });
16
16
  return () => {
17
17
  resizeObserver.disconnect();
18
18
  };
19
19
  }
20
20
  return () => {};
21
- }, [handleCallback, ref, box]);
21
+ }, [handleCallback, ref]);
22
22
  }
23
23
 
24
24
  exports.useResizeObserver = useResizeObserver;
@@ -1 +1 @@
1
- {"version":3,"file":"useResizeObserver.js","sources":["../../../src/common/hooks/useResizeObserver.ts"],"sourcesContent":["import { useEffect } from 'react';\n\nimport { useEffectEvent } from './useEffectEvent';\n\nexport function useResizeObserver(\n ref: React.MutableRefObject<Element | null>,\n callback: (entry: ResizeObserverEntry) => void,\n box: ResizeObserverBoxOptions = 'border-box',\n) {\n const handleCallback = useEffectEvent(callback);\n useEffect(() => {\n if (ref.current != null) {\n const resizeObserver = new ResizeObserver(([entry]) => {\n handleCallback(entry);\n });\n resizeObserver.observe(ref.current, { box });\n return () => {\n resizeObserver.disconnect();\n };\n }\n return () => {};\n }, [handleCallback, ref, box]);\n}\n"],"names":["useResizeObserver","ref","callback","box","handleCallback","useEffectEvent","useEffect","current","resizeObserver","ResizeObserver","entry","observe","disconnect"],"mappings":";;;;;AAIM,SAAUA,iBAAiBA,CAC/BC,GAA2C,EAC3CC,QAA8C,EAC9CC,MAAgC,YAAY,EAAA;AAE5C,EAAA,MAAMC,cAAc,GAAGC,6BAAc,CAACH,QAAQ,CAAC;AAC/CI,EAAAA,eAAS,CAAC,MAAK;AACb,IAAA,IAAIL,GAAG,CAACM,OAAO,IAAI,IAAI,EAAE;MACvB,MAAMC,cAAc,GAAG,IAAIC,cAAc,CAAC,CAAC,CAACC,KAAK,CAAC,KAAI;QACpDN,cAAc,CAACM,KAAK,CAAC;AACvB,MAAA,CAAC,CAAC;AACFF,MAAAA,cAAc,CAACG,OAAO,CAACV,GAAG,CAACM,OAAO,EAAE;AAAEJ,QAAAA;AAAG,OAAE,CAAC;AAC5C,MAAA,OAAO,MAAK;QACVK,cAAc,CAACI,UAAU,EAAE;MAC7B,CAAC;AACH,IAAA;IACA,OAAO,MAAK,CAAE,CAAC;EACjB,CAAC,EAAE,CAACR,cAAc,EAAEH,GAAG,EAAEE,GAAG,CAAC,CAAC;AAChC;;;;"}
1
+ {"version":3,"file":"useResizeObserver.js","sources":["../../../src/common/hooks/useResizeObserver.ts"],"sourcesContent":["import { useEffect } from 'react';\n\nimport { useEffectEvent } from './useEffectEvent';\n\nexport function useResizeObserver(\n ref: React.MutableRefObject<Element | null>,\n callback: (entry: ResizeObserverEntry) => void,\n) {\n const handleCallback = useEffectEvent(callback);\n useEffect(() => {\n if (ref.current != null) {\n const resizeObserver = new ResizeObserver(([entry]) => {\n handleCallback(entry);\n });\n resizeObserver.observe(ref.current, { box: 'border-box' });\n return () => {\n resizeObserver.disconnect();\n };\n }\n return () => {};\n }, [handleCallback, ref]);\n}\n"],"names":["useResizeObserver","ref","callback","handleCallback","useEffectEvent","useEffect","current","resizeObserver","ResizeObserver","entry","observe","box","disconnect"],"mappings":";;;;;AAIM,SAAUA,iBAAiBA,CAC/BC,GAA2C,EAC3CC,QAA8C,EAAA;AAE9C,EAAA,MAAMC,cAAc,GAAGC,6BAAc,CAACF,QAAQ,CAAC;AAC/CG,EAAAA,eAAS,CAAC,MAAK;AACb,IAAA,IAAIJ,GAAG,CAACK,OAAO,IAAI,IAAI,EAAE;MACvB,MAAMC,cAAc,GAAG,IAAIC,cAAc,CAAC,CAAC,CAACC,KAAK,CAAC,KAAI;QACpDN,cAAc,CAACM,KAAK,CAAC;AACvB,MAAA,CAAC,CAAC;AACFF,MAAAA,cAAc,CAACG,OAAO,CAACT,GAAG,CAACK,OAAO,EAAE;AAAEK,QAAAA,GAAG,EAAE;AAAY,OAAE,CAAC;AAC1D,MAAA,OAAO,MAAK;QACVJ,cAAc,CAACK,UAAU,EAAE;MAC7B,CAAC;AACH,IAAA;IACA,OAAO,MAAK,CAAE,CAAC;AACjB,EAAA,CAAC,EAAE,CAACT,cAAc,EAAEF,GAAG,CAAC,CAAC;AAC3B;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { useEffect } from 'react';
2
2
  import { useEffectEvent } from './useEffectEvent.mjs';
3
3
 
4
- function useResizeObserver(ref, callback, box = 'border-box') {
4
+ function useResizeObserver(ref, callback) {
5
5
  const handleCallback = useEffectEvent(callback);
6
6
  useEffect(() => {
7
7
  if (ref.current != null) {
@@ -9,14 +9,14 @@ function useResizeObserver(ref, callback, box = 'border-box') {
9
9
  handleCallback(entry);
10
10
  });
11
11
  resizeObserver.observe(ref.current, {
12
- box
12
+ box: 'border-box'
13
13
  });
14
14
  return () => {
15
15
  resizeObserver.disconnect();
16
16
  };
17
17
  }
18
18
  return () => {};
19
- }, [handleCallback, ref, box]);
19
+ }, [handleCallback, ref]);
20
20
  }
21
21
 
22
22
  export { useResizeObserver };
@@ -1 +1 @@
1
- {"version":3,"file":"useResizeObserver.mjs","sources":["../../../src/common/hooks/useResizeObserver.ts"],"sourcesContent":["import { useEffect } from 'react';\n\nimport { useEffectEvent } from './useEffectEvent';\n\nexport function useResizeObserver(\n ref: React.MutableRefObject<Element | null>,\n callback: (entry: ResizeObserverEntry) => void,\n box: ResizeObserverBoxOptions = 'border-box',\n) {\n const handleCallback = useEffectEvent(callback);\n useEffect(() => {\n if (ref.current != null) {\n const resizeObserver = new ResizeObserver(([entry]) => {\n handleCallback(entry);\n });\n resizeObserver.observe(ref.current, { box });\n return () => {\n resizeObserver.disconnect();\n };\n }\n return () => {};\n }, [handleCallback, ref, box]);\n}\n"],"names":["useResizeObserver","ref","callback","box","handleCallback","useEffectEvent","useEffect","current","resizeObserver","ResizeObserver","entry","observe","disconnect"],"mappings":";;;AAIM,SAAUA,iBAAiBA,CAC/BC,GAA2C,EAC3CC,QAA8C,EAC9CC,MAAgC,YAAY,EAAA;AAE5C,EAAA,MAAMC,cAAc,GAAGC,cAAc,CAACH,QAAQ,CAAC;AAC/CI,EAAAA,SAAS,CAAC,MAAK;AACb,IAAA,IAAIL,GAAG,CAACM,OAAO,IAAI,IAAI,EAAE;MACvB,MAAMC,cAAc,GAAG,IAAIC,cAAc,CAAC,CAAC,CAACC,KAAK,CAAC,KAAI;QACpDN,cAAc,CAACM,KAAK,CAAC;AACvB,MAAA,CAAC,CAAC;AACFF,MAAAA,cAAc,CAACG,OAAO,CAACV,GAAG,CAACM,OAAO,EAAE;AAAEJ,QAAAA;AAAG,OAAE,CAAC;AAC5C,MAAA,OAAO,MAAK;QACVK,cAAc,CAACI,UAAU,EAAE;MAC7B,CAAC;AACH,IAAA;IACA,OAAO,MAAK,CAAE,CAAC;EACjB,CAAC,EAAE,CAACR,cAAc,EAAEH,GAAG,EAAEE,GAAG,CAAC,CAAC;AAChC;;;;"}
1
+ {"version":3,"file":"useResizeObserver.mjs","sources":["../../../src/common/hooks/useResizeObserver.ts"],"sourcesContent":["import { useEffect } from 'react';\n\nimport { useEffectEvent } from './useEffectEvent';\n\nexport function useResizeObserver(\n ref: React.MutableRefObject<Element | null>,\n callback: (entry: ResizeObserverEntry) => void,\n) {\n const handleCallback = useEffectEvent(callback);\n useEffect(() => {\n if (ref.current != null) {\n const resizeObserver = new ResizeObserver(([entry]) => {\n handleCallback(entry);\n });\n resizeObserver.observe(ref.current, { box: 'border-box' });\n return () => {\n resizeObserver.disconnect();\n };\n }\n return () => {};\n }, [handleCallback, ref]);\n}\n"],"names":["useResizeObserver","ref","callback","handleCallback","useEffectEvent","useEffect","current","resizeObserver","ResizeObserver","entry","observe","box","disconnect"],"mappings":";;;AAIM,SAAUA,iBAAiBA,CAC/BC,GAA2C,EAC3CC,QAA8C,EAAA;AAE9C,EAAA,MAAMC,cAAc,GAAGC,cAAc,CAACF,QAAQ,CAAC;AAC/CG,EAAAA,SAAS,CAAC,MAAK;AACb,IAAA,IAAIJ,GAAG,CAACK,OAAO,IAAI,IAAI,EAAE;MACvB,MAAMC,cAAc,GAAG,IAAIC,cAAc,CAAC,CAAC,CAACC,KAAK,CAAC,KAAI;QACpDN,cAAc,CAACM,KAAK,CAAC;AACvB,MAAA,CAAC,CAAC;AACFF,MAAAA,cAAc,CAACG,OAAO,CAACT,GAAG,CAACK,OAAO,EAAE;AAAEK,QAAAA,GAAG,EAAE;AAAY,OAAE,CAAC;AAC1D,MAAA,OAAO,MAAK;QACVJ,cAAc,CAACK,UAAU,EAAE;MAC7B,CAAC;AACH,IAAA;IACA,OAAO,MAAK,CAAE,CAAC;AACjB,EAAA,CAAC,EAAE,CAACT,cAAc,EAAEF,GAAG,CAAC,CAAC;AAC3B;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useScreenSize.js","sources":["../../../src/common/hooks/useScreenSize.ts"],"sourcesContent":["import { Breakpoint } from '../propsValues/breakpoint';\n\nimport { useMedia } from './useMedia';\n\nexport function useScreenSize(size: Breakpoint) {\n return useMedia(`(min-width: ${size}px)`);\n}\n"],"names":["useScreenSize","size","useMedia"],"mappings":";;;;AAIM,SAAUA,aAAaA,CAACC,IAAgB,EAAA;AAC5C,EAAA,OAAOC,iBAAQ,CAAC,CAAA,YAAA,EAAeD,IAAI,KAAK,CAAC;AAC3C;;;;"}
1
+ {"version":3,"file":"useScreenSize.js","sources":["../../../src/common/hooks/useScreenSize.ts"],"sourcesContent":["import { Breakpoint } from '@transferwise/neptune-tokens';\n\nimport { useMedia } from './useMedia';\n\nexport function useScreenSize(size: Breakpoint) {\n return useMedia(`(min-width: ${size}px)`);\n}\n"],"names":["useScreenSize","size","useMedia"],"mappings":";;;;AAIM,SAAUA,aAAaA,CAACC,IAAgB,EAAA;AAC5C,EAAA,OAAOC,iBAAQ,CAAC,CAAA,YAAA,EAAeD,IAAI,KAAK,CAAC;AAC3C;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useScreenSize.mjs","sources":["../../../src/common/hooks/useScreenSize.ts"],"sourcesContent":["import { Breakpoint } from '../propsValues/breakpoint';\n\nimport { useMedia } from './useMedia';\n\nexport function useScreenSize(size: Breakpoint) {\n return useMedia(`(min-width: ${size}px)`);\n}\n"],"names":["useScreenSize","size","useMedia"],"mappings":";;AAIM,SAAUA,aAAaA,CAACC,IAAgB,EAAA;AAC5C,EAAA,OAAOC,QAAQ,CAAC,CAAA,YAAA,EAAeD,IAAI,KAAK,CAAC;AAC3C;;;;"}
1
+ {"version":3,"file":"useScreenSize.mjs","sources":["../../../src/common/hooks/useScreenSize.ts"],"sourcesContent":["import { Breakpoint } from '@transferwise/neptune-tokens';\n\nimport { useMedia } from './useMedia';\n\nexport function useScreenSize(size: Breakpoint) {\n return useMedia(`(min-width: ${size}px)`);\n}\n"],"names":["useScreenSize","size","useMedia"],"mappings":";;AAIM,SAAUA,aAAaA,CAACC,IAAgB,EAAA;AAC5C,EAAA,OAAOC,QAAQ,CAAC,CAAA,YAAA,EAAeD,IAAI,KAAK,CAAC;AAC3C;;;;"}
@@ -7,8 +7,8 @@ var clsx = require('clsx');
7
7
  var React = require('react');
8
8
  require('../theme.js');
9
9
  require('../direction.js');
10
+ require('@transferwise/neptune-tokens');
10
11
  require('../propsValues/control.js');
11
- require('../propsValues/breakpoint.js');
12
12
  require('../propsValues/size.js');
13
13
  require('../propsValues/typography.js');
14
14
  require('../propsValues/width.js');
@@ -3,8 +3,8 @@ import { clsx } from 'clsx';
3
3
  import { forwardRef, useRef, useContext } from 'react';
4
4
  import '../theme.mjs';
5
5
  import '../direction.mjs';
6
+ import '@transferwise/neptune-tokens';
6
7
  import '../propsValues/control.mjs';
7
- import '../propsValues/breakpoint.mjs';
8
8
  import '../propsValues/size.mjs';
9
9
  import '../propsValues/typography.mjs';
10
10
  import '../propsValues/width.mjs';
@@ -6,8 +6,8 @@ var React = require('react');
6
6
  var documentIosClick = require('../domHelpers/documentIosClick.js');
7
7
  require('../theme.js');
8
8
  require('../direction.js');
9
+ require('@transferwise/neptune-tokens');
9
10
  require('../propsValues/control.js');
10
- require('../propsValues/breakpoint.js');
11
11
  require('../propsValues/size.js');
12
12
  require('../propsValues/typography.js');
13
13
  require('../propsValues/width.js');
@@ -2,8 +2,8 @@ import { forwardRef } from 'react';
2
2
  import { isServerSide } from '../domHelpers/documentIosClick.mjs';
3
3
  import '../theme.mjs';
4
4
  import '../direction.mjs';
5
+ import '@transferwise/neptune-tokens';
5
6
  import '../propsValues/control.mjs';
6
- import '../propsValues/breakpoint.mjs';
7
7
  import '../propsValues/size.mjs';
8
8
  import '../propsValues/typography.mjs';
9
9
  import '../propsValues/width.mjs';
@@ -7,8 +7,8 @@ var clsx = require('clsx');
7
7
  var Alert = require('../alert/Alert.js');
8
8
  require('../common/theme.js');
9
9
  require('../common/direction.js');
10
+ require('@transferwise/neptune-tokens');
10
11
  require('../common/propsValues/control.js');
11
- require('../common/propsValues/breakpoint.js');
12
12
  require('../common/propsValues/size.js');
13
13
  require('../common/propsValues/typography.js');
14
14
  require('../common/propsValues/width.js');
@@ -68,9 +68,6 @@ const iconBySentiment = {
68
68
  })
69
69
  })
70
70
  };
71
- /**
72
- * @deprecated `CriticalCommsBanner` component is deprecated and now replaced by the `CriticalBanner` component.
73
- */
74
71
  function CriticalCommsBanner({
75
72
  title,
76
73
  subtitle,
@@ -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\n/**\n * @deprecated `CriticalCommsBanner` component is deprecated and now replaced by the `CriticalBanner` component.\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,CAAE;AAACJ,IAAAA,IAAI,EAAE,EAAG;AAACC,IAAAA,SAAS,EAAC,uBAAuB;IAAAC,QAAA,eACrFX,cAAA,CAACY,WAAS,EAAA;AAACF,MAAAA,SAAS,EAAC;KAAkB;AACzC,GAAQ,CACT;AACD,EAAA,CAACJ,mBAAS,CAACQ,OAAO,gBAChBd,cAAA,CAACQ,cAAM,EAAA;AAACN,IAAAA,EAAE,EAAEN,WAAW,CAACU,mBAAS,CAACQ,OAAO,CAAE;AAACL,IAAAA,IAAI,EAAE,EAAG;AAACC,IAAAA,SAAS,EAAC,uBAAuB;IAAAC,QAAA,eACrFX,cAAA,CAACe,qBAAS,EAAA;AAACL,MAAAA,SAAS,EAAC;KAAkB;GACjC;CAEX;AAED;;AAEG;AACH,SAASM,mBAAmBA,CAAC;EAC3BC,KAAK;EACLC,QAAQ;EACRC,MAAM;aACNtB,WAAS,GAAGS,mBAAS,CAACC,QAAQ;AAC9BG,EAAAA;AAAS,CACgB,EAAA;EACzB,oBACEV,cAAA,CAACC,wBAAgB,EAAA;AACfJ,IAAAA,SAAS,EAAEA,WAAU;AACrBM,IAAAA,QAAQ,EAAC,UAAU;AACnBO,IAAAA,SAAS,EAAEU,SAAI,CAAC,gBAAgB,EAAEV,SAAS,CAAE;IAAAC,QAAA,eAE7CX,cAAA,CAACqB,aAAK,EAAA;AACJJ,MAAAA,KAAK,EAAEA,KAAM;AACbK,MAAAA,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,WAAU;MAChBgC,IAAI,EAAExB,eAAe,CAACR,WAAS;KAAE;AAErC,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;AAACN,IAAAA,EAAE,EAAEN,WAAW,CAACU,mBAAS,CAACO,OAAO,CAAE;AAACJ,IAAAA,IAAI,EAAE,EAAG;AAACC,IAAAA,SAAS,EAAC,uBAA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import Alert$1 from '../alert/Alert.mjs';
4
4
  import '../common/theme.mjs';
5
5
  import '../common/direction.mjs';
6
+ import '@transferwise/neptune-tokens';
6
7
  import '../common/propsValues/control.mjs';
7
- import '../common/propsValues/breakpoint.mjs';
8
8
  import '../common/propsValues/size.mjs';
9
9
  import '../common/propsValues/typography.mjs';
10
10
  import '../common/propsValues/width.mjs';
@@ -64,9 +64,6 @@ const iconBySentiment = {
64
64
  })
65
65
  })
66
66
  };
67
- /**
68
- * @deprecated `CriticalCommsBanner` component is deprecated and now replaced by the `CriticalBanner` component.
69
- */
70
67
  function CriticalCommsBanner({
71
68
  title,
72
69
  subtitle,
@@ -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\n/**\n * @deprecated `CriticalCommsBanner` component is deprecated and now replaced by the `CriticalBanner` component.\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,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S,EAAEU,IAAI,CAAC,gBAAgB,EAAEV,SAAS,CAAE;IAAAC,QAAA,eAE7CX,GAAA,CAACqB,OAAK,EAAA;AACJJ,MAAAA,KAAK,EAAEA,KAAM;AACbK,MAAAA,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;;;;"}
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,O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IAAAA,QAAQ,EAAC,UAAU;AACnBO,IAAAA,SAAS,EAAEU,IAAI,CAAC,gBAAgB,EAAEV,SAAS,CAAE;IAAAC,QAAA,eAE7CX,GAAA,CAACqB,OAAK,EAAA;AACJJ,MAAAA,KAAK,EAAEA,KAAM;AACbK,MAAAA,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;;;;"}
@@ -19,8 +19,8 @@ require('../header/Header.js');
19
19
  require('virtua');
20
20
  require('../common/theme.js');
21
21
  require('../common/direction.js');
22
+ require('@transferwise/neptune-tokens');
22
23
  require('../common/propsValues/control.js');
23
- require('../common/propsValues/breakpoint.js');
24
24
  var size = require('../common/propsValues/size.js');
25
25
  var typography = require('../common/propsValues/typography.js');
26
26
  require('../common/propsValues/width.js');
@@ -15,8 +15,8 @@ import '../header/Header.mjs';
15
15
  import 'virtua';
16
16
  import '../common/theme.mjs';
17
17
  import '../common/direction.mjs';
18
+ import '@transferwise/neptune-tokens';
18
19
  import '../common/propsValues/control.mjs';
19
- import '../common/propsValues/breakpoint.mjs';
20
20
  import { Size } from '../common/propsValues/size.mjs';
21
21
  import { Typography } from '../common/propsValues/typography.mjs';
22
22
  import '../common/propsValues/width.mjs';
@@ -4,10 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var clsx = require('clsx');
6
6
  var React = require('react');
7
+ var neptuneTokens = require('@transferwise/neptune-tokens');
7
8
  require('../common/theme.js');
8
9
  require('../common/direction.js');
9
10
  require('../common/propsValues/control.js');
10
- var breakpoint = require('../common/propsValues/breakpoint.js');
11
11
  var size = require('../common/propsValues/size.js');
12
12
  require('../common/propsValues/typography.js');
13
13
  require('../common/propsValues/width.js');
@@ -101,7 +101,7 @@ class DateLookup extends React.PureComponent {
101
101
  if (this.props.value?.getTime() !== previousProps.value?.getTime() && this.state.open) {
102
102
  this.focusOn('.active');
103
103
  }
104
- const mediaQuery = window.matchMedia(`(max-width: ${breakpoint.Breakpoint.SMALL}px)`);
104
+ const mediaQuery = window.matchMedia(`(max-width: ${neptuneTokens.Breakpoint.SMALL}px)`);
105
105
  this.setState({
106
106
  isMobile: mediaQuery.matches
107
107
  });