@transferwise/components 46.78.0 → 46.79.1

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 (409) hide show
  1. package/build/accordion/AccordionItem/AccordionItem.js +22 -3
  2. package/build/accordion/AccordionItem/AccordionItem.js.map +1 -1
  3. package/build/accordion/AccordionItem/AccordionItem.mjs +22 -3
  4. package/build/accordion/AccordionItem/AccordionItem.mjs.map +1 -1
  5. package/build/actionButton/ActionButton.js +22 -1
  6. package/build/actionButton/ActionButton.js.map +1 -1
  7. package/build/actionButton/ActionButton.mjs +22 -1
  8. package/build/actionButton/ActionButton.mjs.map +1 -1
  9. package/build/actionOption/ActionOption.js +24 -2
  10. package/build/actionOption/ActionOption.js.map +1 -1
  11. package/build/actionOption/ActionOption.mjs +24 -2
  12. package/build/actionOption/ActionOption.mjs.map +1 -1
  13. package/build/alert/Alert.js +22 -6
  14. package/build/alert/Alert.js.map +1 -1
  15. package/build/alert/Alert.mjs +22 -6
  16. package/build/alert/Alert.mjs.map +1 -1
  17. package/build/alert/inlineMarkdown/InlineMarkdown.js +25 -2
  18. package/build/alert/inlineMarkdown/InlineMarkdown.js.map +1 -1
  19. package/build/alert/inlineMarkdown/InlineMarkdown.mjs +25 -2
  20. package/build/alert/inlineMarkdown/InlineMarkdown.mjs.map +1 -1
  21. package/build/avatar/Avatar.js +23 -2
  22. package/build/avatar/Avatar.js.map +1 -1
  23. package/build/avatar/Avatar.mjs +23 -2
  24. package/build/avatar/Avatar.mjs.map +1 -1
  25. package/build/avatarWrapper/AvatarWrapper.js +23 -3
  26. package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
  27. package/build/avatarWrapper/AvatarWrapper.mjs +23 -3
  28. package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -1
  29. package/build/badge/Badge.js +23 -2
  30. package/build/badge/Badge.js.map +1 -1
  31. package/build/badge/Badge.mjs +23 -2
  32. package/build/badge/Badge.mjs.map +1 -1
  33. package/build/button/Button.js +22 -6
  34. package/build/button/Button.js.map +1 -1
  35. package/build/button/Button.messages.js.map +1 -1
  36. package/build/button/Button.messages.mjs.map +1 -1
  37. package/build/button/Button.mjs +22 -6
  38. package/build/button/Button.mjs.map +1 -1
  39. package/build/button/classMap.js +24 -0
  40. package/build/button/classMap.js.map +1 -1
  41. package/build/button/classMap.mjs +24 -0
  42. package/build/button/classMap.mjs.map +1 -1
  43. package/build/button/legacyUtils/legacyUtils.js +30 -7
  44. package/build/button/legacyUtils/legacyUtils.js.map +1 -1
  45. package/build/button/legacyUtils/legacyUtils.mjs +30 -7
  46. package/build/button/legacyUtils/legacyUtils.mjs.map +1 -1
  47. package/build/card/Card.js +23 -3
  48. package/build/card/Card.js.map +1 -1
  49. package/build/card/Card.mjs +23 -3
  50. package/build/card/Card.mjs.map +1 -1
  51. package/build/checkbox/Checkbox.js +23 -1
  52. package/build/checkbox/Checkbox.js.map +1 -1
  53. package/build/checkbox/Checkbox.mjs +23 -1
  54. package/build/checkbox/Checkbox.mjs.map +1 -1
  55. package/build/checkboxOption/CheckboxOption.js +1 -1
  56. package/build/checkboxOption/CheckboxOption.mjs +1 -1
  57. package/build/chevron/Chevron.js +21 -1
  58. package/build/chevron/Chevron.js.map +1 -1
  59. package/build/chevron/Chevron.mjs +21 -1
  60. package/build/chevron/Chevron.mjs.map +1 -1
  61. package/build/chips/Chip.js +19 -1
  62. package/build/chips/Chip.js.map +1 -1
  63. package/build/chips/Chip.mjs +19 -1
  64. package/build/chips/Chip.mjs.map +1 -1
  65. package/build/circularButton/CircularButton.js +23 -4
  66. package/build/circularButton/CircularButton.js.map +1 -1
  67. package/build/circularButton/CircularButton.mjs +23 -4
  68. package/build/circularButton/CircularButton.mjs.map +1 -1
  69. package/build/common/bottomSheet/BottomSheet.js +3 -2
  70. package/build/common/bottomSheet/BottomSheet.js.map +1 -1
  71. package/build/common/bottomSheet/BottomSheet.mjs +3 -2
  72. package/build/common/bottomSheet/BottomSheet.mjs.map +1 -1
  73. package/build/common/dateUtils/getDateView/getDateView.js +10 -0
  74. package/build/common/dateUtils/getDateView/getDateView.js.map +1 -0
  75. package/build/common/dateUtils/getDateView/getDateView.mjs +8 -0
  76. package/build/common/dateUtils/getDateView/getDateView.mjs.map +1 -0
  77. package/build/common/hooks/useHasIntersected/useHasIntersected.js +10 -10
  78. package/build/common/hooks/useHasIntersected/useHasIntersected.js.map +1 -1
  79. package/build/common/hooks/useHasIntersected/useHasIntersected.mjs +10 -10
  80. package/build/common/hooks/useHasIntersected/useHasIntersected.mjs.map +1 -1
  81. package/build/common/locale/index.js +24 -0
  82. package/build/common/locale/index.js.map +1 -1
  83. package/build/common/locale/index.mjs +24 -0
  84. package/build/common/locale/index.mjs.map +1 -1
  85. package/build/common/panel/Panel.js +23 -2
  86. package/build/common/panel/Panel.js.map +1 -1
  87. package/build/common/panel/Panel.mjs +23 -2
  88. package/build/common/panel/Panel.mjs.map +1 -1
  89. package/build/common/responsivePanel/ResponsivePanel.js +27 -3
  90. package/build/common/responsivePanel/ResponsivePanel.js.map +1 -1
  91. package/build/common/responsivePanel/ResponsivePanel.mjs +27 -3
  92. package/build/common/responsivePanel/ResponsivePanel.mjs.map +1 -1
  93. package/build/criticalBanner/CriticalCommsBanner.js +22 -3
  94. package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
  95. package/build/criticalBanner/CriticalCommsBanner.mjs +22 -3
  96. package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
  97. package/build/dateInput/DateInput.js +22 -5
  98. package/build/dateInput/DateInput.js.map +1 -1
  99. package/build/dateInput/DateInput.mjs +22 -5
  100. package/build/dateInput/DateInput.mjs.map +1 -1
  101. package/build/dateLookup/DateLookup.js +30 -12
  102. package/build/dateLookup/DateLookup.js.map +1 -1
  103. package/build/dateLookup/DateLookup.mjs +30 -12
  104. package/build/dateLookup/DateLookup.mjs.map +1 -1
  105. package/build/dateLookup/dateHeader/DateHeader.js +26 -5
  106. package/build/dateLookup/dateHeader/DateHeader.js.map +1 -1
  107. package/build/dateLookup/dateHeader/DateHeader.mjs +26 -5
  108. package/build/dateLookup/dateHeader/DateHeader.mjs.map +1 -1
  109. package/build/dateLookup/dateTrigger/DateTrigger.js +19 -3
  110. package/build/dateLookup/dateTrigger/DateTrigger.js.map +1 -1
  111. package/build/dateLookup/dateTrigger/DateTrigger.mjs +19 -3
  112. package/build/dateLookup/dateTrigger/DateTrigger.mjs.map +1 -1
  113. package/build/dateLookup/dayCalendar/table/DayCalendarTable.js +4 -1
  114. package/build/dateLookup/dayCalendar/table/DayCalendarTable.js.map +1 -1
  115. package/build/dateLookup/dayCalendar/table/DayCalendarTable.mjs +4 -1
  116. package/build/dateLookup/dayCalendar/table/DayCalendarTable.mjs.map +1 -1
  117. package/build/decision/Decision.js +24 -3
  118. package/build/decision/Decision.js.map +1 -1
  119. package/build/decision/Decision.mjs +24 -3
  120. package/build/decision/Decision.mjs.map +1 -1
  121. package/build/definitionList/DefinitionList.js +23 -1
  122. package/build/definitionList/DefinitionList.js.map +1 -1
  123. package/build/definitionList/DefinitionList.mjs +23 -1
  124. package/build/definitionList/DefinitionList.mjs.map +1 -1
  125. package/build/dimmer/Dimmer.js +24 -2
  126. package/build/dimmer/Dimmer.js.map +1 -1
  127. package/build/dimmer/Dimmer.mjs +24 -2
  128. package/build/dimmer/Dimmer.mjs.map +1 -1
  129. package/build/display/Display.js +23 -1
  130. package/build/display/Display.js.map +1 -1
  131. package/build/display/Display.mjs +23 -1
  132. package/build/display/Display.mjs.map +1 -1
  133. package/build/drawer/Drawer.js +23 -4
  134. package/build/drawer/Drawer.js.map +1 -1
  135. package/build/drawer/Drawer.mjs +23 -4
  136. package/build/drawer/Drawer.mjs.map +1 -1
  137. package/build/field/Field.js +23 -2
  138. package/build/field/Field.js.map +1 -1
  139. package/build/field/Field.mjs +23 -2
  140. package/build/field/Field.mjs.map +1 -1
  141. package/build/flowNavigation/FlowNavigation.js +19 -2
  142. package/build/flowNavigation/FlowNavigation.js.map +1 -1
  143. package/build/flowNavigation/FlowNavigation.mjs +19 -2
  144. package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
  145. package/build/header/Header.js +24 -2
  146. package/build/header/Header.js.map +1 -1
  147. package/build/header/Header.mjs +24 -2
  148. package/build/header/Header.mjs.map +1 -1
  149. package/build/image/Image.js +4 -1
  150. package/build/image/Image.js.map +1 -1
  151. package/build/image/Image.mjs +4 -1
  152. package/build/image/Image.mjs.map +1 -1
  153. package/build/index.js +69 -62
  154. package/build/index.js.map +1 -1
  155. package/build/index.mjs +27 -20
  156. package/build/index.mjs.map +1 -1
  157. package/build/info/Info.js +21 -3
  158. package/build/info/Info.js.map +1 -1
  159. package/build/info/Info.mjs +21 -3
  160. package/build/info/Info.mjs.map +1 -1
  161. package/build/inlineAlert/InlineAlert.js +24 -3
  162. package/build/inlineAlert/InlineAlert.js.map +1 -1
  163. package/build/inlineAlert/InlineAlert.mjs +24 -3
  164. package/build/inlineAlert/InlineAlert.mjs.map +1 -1
  165. package/build/inputs/SearchInput.js +23 -2
  166. package/build/inputs/SearchInput.js.map +1 -1
  167. package/build/inputs/SearchInput.mjs +23 -2
  168. package/build/inputs/SearchInput.mjs.map +1 -1
  169. package/build/instructionsList/InstructionsList.js +22 -1
  170. package/build/instructionsList/InstructionsList.js.map +1 -1
  171. package/build/instructionsList/InstructionsList.mjs +22 -1
  172. package/build/instructionsList/InstructionsList.mjs.map +1 -1
  173. package/build/loader/Loader.js +22 -1
  174. package/build/loader/Loader.js.map +1 -1
  175. package/build/loader/Loader.mjs +22 -1
  176. package/build/loader/Loader.mjs.map +1 -1
  177. package/build/markdown/Markdown.js +24 -1
  178. package/build/markdown/Markdown.js.map +1 -1
  179. package/build/markdown/Markdown.mjs +24 -1
  180. package/build/markdown/Markdown.mjs.map +1 -1
  181. package/build/modal/Modal.js +22 -5
  182. package/build/modal/Modal.js.map +1 -1
  183. package/build/modal/Modal.mjs +22 -5
  184. package/build/modal/Modal.mjs.map +1 -1
  185. package/build/moneyInput/MoneyInput.js +22 -3
  186. package/build/moneyInput/MoneyInput.js.map +1 -1
  187. package/build/moneyInput/MoneyInput.mjs +22 -3
  188. package/build/moneyInput/MoneyInput.mjs.map +1 -1
  189. package/build/navigationOption/NavigationOption.js +23 -2
  190. package/build/navigationOption/NavigationOption.js.map +1 -1
  191. package/build/navigationOption/NavigationOption.mjs +23 -2
  192. package/build/navigationOption/NavigationOption.mjs.map +1 -1
  193. package/build/nudge/Nudge.js +19 -1
  194. package/build/nudge/Nudge.js.map +1 -1
  195. package/build/nudge/Nudge.mjs +19 -1
  196. package/build/nudge/Nudge.mjs.map +1 -1
  197. package/build/overlayHeader/OverlayHeader.js +19 -1
  198. package/build/overlayHeader/OverlayHeader.js.map +1 -1
  199. package/build/overlayHeader/OverlayHeader.mjs +19 -1
  200. package/build/overlayHeader/OverlayHeader.mjs.map +1 -1
  201. package/build/phoneNumberInput/PhoneNumberInput.js +23 -2
  202. package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
  203. package/build/phoneNumberInput/PhoneNumberInput.mjs +23 -2
  204. package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
  205. package/build/popover/Popover.js +24 -4
  206. package/build/popover/Popover.js.map +1 -1
  207. package/build/popover/Popover.mjs +24 -4
  208. package/build/popover/Popover.mjs.map +1 -1
  209. package/build/processIndicator/ProcessIndicator.js +22 -1
  210. package/build/processIndicator/ProcessIndicator.js.map +1 -1
  211. package/build/processIndicator/ProcessIndicator.mjs +22 -1
  212. package/build/processIndicator/ProcessIndicator.mjs.map +1 -1
  213. package/build/progressBar/ProgressBar.js +24 -2
  214. package/build/progressBar/ProgressBar.js.map +1 -1
  215. package/build/progressBar/ProgressBar.mjs +24 -2
  216. package/build/progressBar/ProgressBar.mjs.map +1 -1
  217. package/build/promoCard/PromoCard.js +22 -2
  218. package/build/promoCard/PromoCard.js.map +1 -1
  219. package/build/promoCard/PromoCard.mjs +22 -2
  220. package/build/promoCard/PromoCard.mjs.map +1 -1
  221. package/build/promoCard/PromoCardIndicator.js +22 -1
  222. package/build/promoCard/PromoCardIndicator.js.map +1 -1
  223. package/build/promoCard/PromoCardIndicator.mjs +22 -1
  224. package/build/promoCard/PromoCardIndicator.mjs.map +1 -1
  225. package/build/provider/Provider.js +25 -2
  226. package/build/provider/Provider.js.map +1 -1
  227. package/build/provider/Provider.mjs +25 -2
  228. package/build/provider/Provider.mjs.map +1 -1
  229. package/build/radio/Radio.js +24 -2
  230. package/build/radio/Radio.js.map +1 -1
  231. package/build/radio/Radio.mjs +24 -2
  232. package/build/radio/Radio.mjs.map +1 -1
  233. package/build/segmentedControl/SegmentedControl.js +22 -1
  234. package/build/segmentedControl/SegmentedControl.js.map +1 -1
  235. package/build/segmentedControl/SegmentedControl.mjs +22 -1
  236. package/build/segmentedControl/SegmentedControl.mjs.map +1 -1
  237. package/build/select/Select.js +26 -4
  238. package/build/select/Select.js.map +1 -1
  239. package/build/select/Select.mjs +26 -4
  240. package/build/select/Select.mjs.map +1 -1
  241. package/build/select/option/Option.js +22 -1
  242. package/build/select/option/Option.js.map +1 -1
  243. package/build/select/option/Option.mjs +22 -1
  244. package/build/select/option/Option.mjs.map +1 -1
  245. package/build/selectOption/SelectOption.js +24 -6
  246. package/build/selectOption/SelectOption.js.map +1 -1
  247. package/build/selectOption/SelectOption.mjs +24 -6
  248. package/build/selectOption/SelectOption.mjs.map +1 -1
  249. package/build/statusIcon/StatusIcon.js +22 -4
  250. package/build/statusIcon/StatusIcon.js.map +1 -1
  251. package/build/statusIcon/StatusIcon.mjs +22 -4
  252. package/build/statusIcon/StatusIcon.mjs.map +1 -1
  253. package/build/stepper/Stepper.js +25 -3
  254. package/build/stepper/Stepper.js.map +1 -1
  255. package/build/stepper/Stepper.mjs +25 -3
  256. package/build/stepper/Stepper.mjs.map +1 -1
  257. package/build/stepper/deviceDetection.js +2 -3
  258. package/build/stepper/deviceDetection.js.map +1 -1
  259. package/build/stepper/deviceDetection.mjs +2 -3
  260. package/build/stepper/deviceDetection.mjs.map +1 -1
  261. package/build/sticky/Sticky.js +25 -2
  262. package/build/sticky/Sticky.js.map +1 -1
  263. package/build/sticky/Sticky.mjs +25 -2
  264. package/build/sticky/Sticky.mjs.map +1 -1
  265. package/build/summary/Summary.js +21 -5
  266. package/build/summary/Summary.js.map +1 -1
  267. package/build/summary/Summary.mjs +21 -5
  268. package/build/summary/Summary.mjs.map +1 -1
  269. package/build/tabs/Tabs.js +23 -3
  270. package/build/tabs/Tabs.js.map +1 -1
  271. package/build/tabs/Tabs.mjs +23 -3
  272. package/build/tabs/Tabs.mjs.map +1 -1
  273. package/build/tile/Tile.js +24 -2
  274. package/build/tile/Tile.js.map +1 -1
  275. package/build/tile/Tile.mjs +24 -2
  276. package/build/tile/Tile.mjs.map +1 -1
  277. package/build/title/Title.js +23 -1
  278. package/build/title/Title.js.map +1 -1
  279. package/build/title/Title.mjs +23 -1
  280. package/build/title/Title.mjs.map +1 -1
  281. package/build/tooltip/Tooltip.js +22 -1
  282. package/build/tooltip/Tooltip.js.map +1 -1
  283. package/build/tooltip/Tooltip.mjs +22 -1
  284. package/build/tooltip/Tooltip.mjs.map +1 -1
  285. package/build/typeahead/Typeahead.js +22 -4
  286. package/build/typeahead/Typeahead.js.map +1 -1
  287. package/build/typeahead/Typeahead.mjs +22 -4
  288. package/build/typeahead/Typeahead.mjs.map +1 -1
  289. package/build/types/button/Button.d.ts.map +1 -1
  290. package/build/types/button/Button.messages.d.ts +7 -7
  291. package/build/types/button/Button.messages.d.ts.map +1 -1
  292. package/build/types/button/classMap.d.ts +10 -10
  293. package/build/types/button/classMap.d.ts.map +1 -1
  294. package/build/types/button/legacyUtils/index.d.ts +1 -1
  295. package/build/types/button/legacyUtils/index.d.ts.map +1 -1
  296. package/build/types/button/legacyUtils/legacyUtils.d.ts +20 -6
  297. package/build/types/button/legacyUtils/legacyUtils.d.ts.map +1 -1
  298. package/build/types/checkboxButton/index.d.ts +1 -1
  299. package/build/types/checkboxButton/index.d.ts.map +1 -1
  300. package/build/types/common/dateUtils/getDateView/getDateView.d.ts +2 -0
  301. package/build/types/common/dateUtils/getDateView/getDateView.d.ts.map +1 -0
  302. package/build/types/common/dateUtils/index.d.ts +1 -0
  303. package/build/types/common/dateUtils/index.d.ts.map +1 -1
  304. package/build/types/common/fakeEvents.d.ts +23 -0
  305. package/build/types/common/fakeEvents.d.ts.map +1 -0
  306. package/build/types/common/hooks/index.d.ts +4 -4
  307. package/build/types/common/hooks/index.d.ts.map +1 -1
  308. package/build/types/common/hooks/useConditionalListener/index.d.ts +1 -1
  309. package/build/types/common/hooks/useConditionalListener/index.d.ts.map +1 -1
  310. package/build/types/common/hooks/useDirection/index.d.ts +1 -1
  311. package/build/types/common/hooks/useDirection/index.d.ts.map +1 -1
  312. package/build/types/common/hooks/useHasIntersected/index.d.ts +1 -1
  313. package/build/types/common/hooks/useHasIntersected/index.d.ts.map +1 -1
  314. package/build/types/common/hooks/useHasIntersected/useHasIntersected.d.ts +15 -4
  315. package/build/types/common/hooks/useHasIntersected/useHasIntersected.d.ts.map +1 -1
  316. package/build/types/common/index.d.ts +28 -28
  317. package/build/types/common/index.d.ts.map +1 -1
  318. package/build/types/common/responsivePanel/index.d.ts +1 -1
  319. package/build/types/common/responsivePanel/index.d.ts.map +1 -1
  320. package/build/types/dateLookup/DateLookup.d.ts +1 -1
  321. package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
  322. package/build/types/dateLookup/dayCalendar/table/DayCalendarTable.d.ts +1 -1
  323. package/build/types/dateLookup/dayCalendar/table/DayCalendarTable.d.ts.map +1 -1
  324. package/build/types/index.d.ts +1 -0
  325. package/build/types/index.d.ts.map +1 -1
  326. package/build/types/navigationOption/NavigationOption.d.ts +1 -0
  327. package/build/types/navigationOption/NavigationOption.d.ts.map +1 -1
  328. package/build/types/stepper/deviceDetection.d.ts +1 -1
  329. package/build/types/stepper/deviceDetection.d.ts.map +1 -1
  330. package/build/types/test-utils/style-mock.d.ts +1 -0
  331. package/build/types/test-utils/style-mock.d.ts.map +1 -0
  332. package/build/types/utilities/deprecatedProperty/deprecatedProperty.d.ts +8 -6
  333. package/build/types/utilities/deprecatedProperty/deprecatedProperty.d.ts.map +1 -1
  334. package/build/types/utilities/deprecatedProperty/index.d.ts +1 -1
  335. package/build/types/utilities/deprecatedProperty/index.d.ts.map +1 -1
  336. package/build/types/utilities/index.d.ts +2 -2
  337. package/build/types/utilities/index.d.ts.map +1 -1
  338. package/build/types/utilities/logActionRequired.d.ts +2 -2
  339. package/build/types/utilities/logActionRequired.d.ts.map +1 -1
  340. package/build/upload/Upload.js +21 -2
  341. package/build/upload/Upload.js.map +1 -1
  342. package/build/upload/Upload.mjs +21 -2
  343. package/build/upload/Upload.mjs.map +1 -1
  344. package/build/upload/steps/processingStep/processingStep.js +25 -3
  345. package/build/upload/steps/processingStep/processingStep.js.map +1 -1
  346. package/build/upload/steps/processingStep/processingStep.mjs +25 -3
  347. package/build/upload/steps/processingStep/processingStep.mjs.map +1 -1
  348. package/build/upload/steps/uploadImageStep/uploadImageStep.js +23 -3
  349. package/build/upload/steps/uploadImageStep/uploadImageStep.js.map +1 -1
  350. package/build/upload/steps/uploadImageStep/uploadImageStep.mjs +23 -3
  351. package/build/upload/steps/uploadImageStep/uploadImageStep.mjs.map +1 -1
  352. package/build/uploadInput/UploadInput.js +22 -3
  353. package/build/uploadInput/UploadInput.js.map +1 -1
  354. package/build/uploadInput/UploadInput.mjs +22 -3
  355. package/build/uploadInput/UploadInput.mjs.map +1 -1
  356. package/build/uploadInput/uploadButton/UploadButton.js +21 -2
  357. package/build/uploadInput/uploadButton/UploadButton.js.map +1 -1
  358. package/build/uploadInput/uploadButton/UploadButton.mjs +21 -2
  359. package/build/uploadInput/uploadButton/UploadButton.mjs.map +1 -1
  360. package/build/uploadInput/uploadButton/defaults.js +24 -0
  361. package/build/uploadInput/uploadButton/defaults.js.map +1 -1
  362. package/build/uploadInput/uploadButton/defaults.mjs +24 -0
  363. package/build/uploadInput/uploadButton/defaults.mjs.map +1 -1
  364. package/build/uploadInput/uploadItem/UploadItem.js +21 -4
  365. package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
  366. package/build/uploadInput/uploadItem/UploadItem.mjs +21 -4
  367. package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -1
  368. package/build/utilities/logActionRequired.js.map +1 -1
  369. package/build/utilities/logActionRequired.mjs.map +1 -1
  370. package/build/withDisplayFormat/WithDisplayFormat.js +25 -1
  371. package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
  372. package/build/withDisplayFormat/WithDisplayFormat.mjs +25 -1
  373. package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
  374. package/package.json +2 -2
  375. package/src/button/Button.tsx +0 -3
  376. package/src/button/legacyUtils/legacyUtils.ts +74 -0
  377. package/src/common/dateUtils/getDateView/getDateView.ts +5 -0
  378. package/src/common/dateUtils/index.ts +1 -0
  379. package/src/common/{fakeEvents.js → fakeEvents.ts} +1 -1
  380. package/src/common/hooks/useHasIntersected/{useHasIntersected.js → useHasIntersected.ts} +20 -11
  381. package/src/dateLookup/DateLookup.tests.story.tsx +40 -5
  382. package/src/dateLookup/DateLookup.tsx +9 -11
  383. package/src/dateLookup/dayCalendar/table/DayCalendarTable.tsx +5 -2
  384. package/src/flowNavigation/{FlowNavigation.story.js → FlowNavigation.story.tsx} +34 -16
  385. package/src/index.ts +1 -0
  386. package/src/inputWithDisplayFormat/InputWithDisplayFormat.story.tsx +78 -0
  387. package/src/navigationOption/{NavigationOption.story.js → NavigationOption.story.tsx} +23 -5
  388. package/src/navigationOption/NavigationOption.tsx +1 -1
  389. package/src/select/{Select.story.js → Select.story.tsx} +97 -47
  390. package/src/stepper/{deviceDetection.js → deviceDetection.ts} +2 -6
  391. package/src/utilities/deprecatedProperty/{deprecatedProperty.spec.js → deprecatedProperty.spec.ts} +7 -13
  392. package/src/utilities/deprecatedProperty/{deprecatedProperty.js → deprecatedProperty.ts} +23 -4
  393. package/src/utilities/{logActionRequired.js → logActionRequired.ts} +2 -2
  394. package/src/button/legacyUtils/legacyUtils.js +0 -54
  395. package/src/common/requirements.js +0 -440
  396. package/src/inputWithDisplayFormat/InputWithDisplayFormat.story.js +0 -85
  397. /package/src/button/{Button.messages.js → Button.messages.ts} +0 -0
  398. /package/src/button/{classMap.js → classMap.ts} +0 -0
  399. /package/src/button/legacyUtils/{index.js → index.ts} +0 -0
  400. /package/src/checkboxButton/{index.js → index.ts} +0 -0
  401. /package/src/common/hooks/{index.js → index.ts} +0 -0
  402. /package/src/common/hooks/useConditionalListener/{index.js → index.ts} +0 -0
  403. /package/src/common/hooks/useDirection/{index.js → index.ts} +0 -0
  404. /package/src/common/hooks/useHasIntersected/{index.js → index.ts} +0 -0
  405. /package/src/common/{index.js → index.ts} +0 -0
  406. /package/src/common/responsivePanel/{index.js → index.ts} +0 -0
  407. /package/src/test-utils/{style-mock.js → style-mock.ts} +0 -0
  408. /package/src/utilities/deprecatedProperty/{index.js → index.ts} +0 -0
  409. /package/src/utilities/{index.js → index.ts} +0 -0
@@ -3,19 +3,37 @@
3
3
  var React = require('react');
4
4
  var clsx = require('clsx');
5
5
  var Option = require('../common/Option/Option.js');
6
+ require('../common/theme.js');
7
+ require('../common/direction.js');
8
+ require('../common/propsValues/control.js');
9
+ var breakpoint = require('../common/propsValues/breakpoint.js');
10
+ require('../common/propsValues/size.js');
11
+ require('../common/propsValues/typography.js');
12
+ require('../common/propsValues/width.js');
13
+ require('../common/propsValues/type.js');
14
+ require('../common/propsValues/dateMode.js');
15
+ require('../common/propsValues/monthFormat.js');
16
+ var position = require('../common/propsValues/position.js');
17
+ require('../common/propsValues/layouts.js');
18
+ require('../common/propsValues/status.js');
19
+ require('../common/propsValues/sentiment.js');
20
+ require('../common/propsValues/profileType.js');
21
+ require('../common/propsValues/variant.js');
22
+ require('../common/propsValues/scroll.js');
23
+ require('../common/propsValues/markdownNodeType.js');
24
+ require('../common/fileType.js');
25
+ var icons = require('@transferwise/icons');
26
+ var reactIntl = require('react-intl');
27
+ require('../common/closeButton/CloseButton.messages.js');
28
+ var jsxRuntime = require('react/jsx-runtime');
6
29
  var Section = require('../section/Section.js');
7
30
  var Header = require('../header/Header.js');
8
31
  var NavigationOption = require('../navigationOption/NavigationOption.js');
9
32
  var NavigationOptionsList = require('../navigationOptionsList/NavigationOptionsList.js');
10
33
  var contexts = require('../inputs/contexts.js');
11
34
  var SelectOption_messages = require('./SelectOption.messages.js');
12
- var reactIntl = require('react-intl');
13
- var useScreenSize = require('../common/hooks/useScreenSize.js');
14
- var icons = require('@transferwise/icons');
15
- var jsxRuntime = require('react/jsx-runtime');
16
- var breakpoint = require('../common/propsValues/breakpoint.js');
17
35
  var ResponsivePanel = require('../common/responsivePanel/ResponsivePanel.js');
18
- var position = require('../common/propsValues/position.js');
36
+ var useScreenSize = require('../common/hooks/useScreenSize.js');
19
37
 
20
38
  function SelectOption({
21
39
  selected = undefined,
@@ -1 +1 @@
1
- {"version":3,"file":"SelectOption.js","sources":["../../src/selectOption/SelectOption.tsx"],"sourcesContent":["import { useRef, useState } from 'react';\nimport { ActionButtonProps } from '../actionButton';\nimport { clsx } from 'clsx';\nimport Option from '../common/Option';\nimport type { OptionProps } from '../common/Option/Option';\nimport { Breakpoint, Position } from '../common';\nimport Section from '../section';\nimport Header from '../header';\nimport { HeaderProps } from '../header/Header';\nimport NavigationOption from '../navigationOption';\nimport NavigationOptionsList from '../navigationOptionsList';\nimport { useInputAttributes } from '../inputs/contexts';\nimport messages from './SelectOption.messages';\nimport { useIntl } from 'react-intl';\nimport ResponsivePanel from '../common/responsivePanel';\nimport { useScreenSize } from '../common/hooks/useScreenSize';\nimport { ChevronDown, Plus } from '@transferwise/icons';\n\nexport type SelectOptiopsSection<T = unknown> = {\n title?: HeaderProps['title'];\n options: SelectOptionValue<T>[];\n};\n\nexport type SelectOptionValue<T = unknown> = Pick<\n OptionProps,\n 'media' | 'title' | 'content' | 'disabled'\n> & {\n value?: T;\n};\n\nexport type SelectOptionPlaceholder = Pick<OptionProps, 'media' | 'title' | 'content'> & {\n actionLabel?: ActionButtonProps['children'];\n};\n\nexport type SelectOptionProps<T = unknown> = {\n onChange: (selected: SelectOptionValue<T>) => void;\n selected?: SelectOptionValue<T>;\n options: SelectOptiopsSection<T>[];\n placeholder: SelectOptionPlaceholder;\n} & Omit<\n OptionProps,\n 'as' | 'title' | 'media' | 'content' | 'onClick' | 'onChange' | 'showMediaAtAllSizes' | 'decision'\n>;\n\nexport default function SelectOption<T>({\n selected = undefined,\n options,\n onChange,\n placeholder,\n disabled,\n ...props\n}: SelectOptionProps<T>) {\n const intl = useIntl();\n const rootRef = useRef(null);\n const [showOptions, setShowOptions] = useState(false);\n\n const hasSelected = selected !== undefined;\n const isLargeScreen = useScreenSize(Breakpoint.SMALL);\n\n const inputAttributes = useInputAttributes();\n const ariaLabelledBy = props['aria-labelledby'] ?? inputAttributes?.['aria-labelledby'];\n\n function handleOnClick(showOptionsStatus: boolean) {\n return () => {\n setShowOptions(showOptionsStatus);\n };\n }\n\n function handleOnChange(data: SelectOptionValue<T>) {\n return () => {\n setShowOptions(false);\n onChange(data);\n };\n }\n\n function getOptions(isLargeScreen = false) {\n return (\n <div className={clsx({ 'np-select-option-list': isLargeScreen })}>\n {options.map((optionsSection, index) => (\n <Section key={index} className={clsx({ 'p-x-2 p-y-1': isLargeScreen })}>\n {optionsSection.title && <Header title={optionsSection.title} />}\n <NavigationOptionsList>\n {optionsSection.options.map((option, index) => {\n return (\n <NavigationOption\n key={index}\n isContainerAligned={!isLargeScreen}\n showMediaCircle\n showMediaAtAllSizes\n onClick={handleOnChange(option)}\n {...option}\n />\n );\n })}\n </NavigationOptionsList>\n </Section>\n ))}\n </div>\n );\n }\n\n return (\n <>\n <Option\n ref={rootRef}\n as=\"div\"\n showMediaAtAllSizes\n disabled={disabled}\n decision={false}\n media={hasSelected ? selected.media : (placeholder.media ?? <Plus size={24} />)}\n title={(hasSelected ? selected : placeholder).title}\n content={(hasSelected ? selected : placeholder).content}\n className={clsx(\n 'np-select-option',\n 'clickable',\n hasSelected ? 'np-select-option-selected' : 'np-select-option-placeholder',\n props.className,\n )}\n button={\n <button\n {...inputAttributes}\n type=\"button\"\n disabled={disabled}\n aria-labelledby={ariaLabelledBy}\n aria-haspopup=\"dialog\"\n aria-expanded={showOptions}\n className={hasSelected ? 'btn-unstyled' : 'np-action-btn'}\n aria-label={hasSelected ? undefined : props['aria-label']}\n onClick={handleOnClick(true)}\n >\n {hasSelected ? (\n <ChevronDown title={intl.formatMessage(messages.selectedActionLabel)} />\n ) : (\n placeholder.actionLabel || intl.formatMessage(messages.actionLabel)\n )}\n </button>\n }\n />\n <ResponsivePanel\n anchorWidth\n altAxis\n anchorRef={rootRef}\n open={showOptions}\n position={Position.BOTTOM}\n onClose={handleOnClick(false)}\n >\n {getOptions(isLargeScreen)}\n </ResponsivePanel>\n </>\n );\n}\n"],"names":["SelectOption","selected","undefined","options","onChange","placeholder","disabled","props","intl","useIntl","rootRef","useRef","showOptions","setShowOptions","useState","hasSelected","isLargeScreen","useScreenSize","Breakpoint","SMALL","inputAttributes","useInputAttributes","ariaLabelledBy","handleOnClick","showOptionsStatus","handleOnChange","data","getOptions","_jsx","className","clsx","children","map","optionsSection","index","_jsxs","Section","title","Header","NavigationOptionsList","option","NavigationOption","isContainerAligned","showMediaCircle","showMediaAtAllSizes","onClick","_Fragment","Option","ref","as","decision","media","Plus","size","content","button","type","ChevronDown","formatMessage","messages","selectedActionLabel","actionLabel","ResponsivePanel","anchorWidth","altAxis","anchorRef","open","position","Position","BOTTOM","onClose"],"mappings":";;;;;;;;;;;;;;;;;;;AA4CwB,SAAAA,YAAYA,CAAI;AACtCC,EAAAA,QAAQ,GAAGC,SAAS;EACpBC,OAAO;EACPC,QAAQ;EACRC,WAAW;EACXC,QAAQ;EACR,GAAGC,KAAAA;AACkB,CAAA,EAAA;AACrB,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE,CAAA;AACtB,EAAA,MAAMC,OAAO,GAAGC,YAAM,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oC,QAAAA,IAAI,EAAC,QAAQ;AACblD,QAAAA,QAAQ,EAAEA,QAAS;AACnB,QAAA,iBAAA,EAAiBgB,cAAe;AAChC,QAAA,eAAA,EAAc,QAAQ;AACtB,QAAA,eAAA,EAAeV,WAAY;AAC3BiB,QAAAA,SAAS,EAAEd,WAAW,GAAG,cAAc,GAAG,eAAgB;AAC1D,QAAA,YAAA,EAAYA,WAAW,GAAGb,SAAS,GAAGK,KAAK,CAAC,YAAY,CAAE;AAC1DsC,QAAAA,OAAO,EAAEtB,aAAa,CAAC,IAAI,CAAE;AAAAQ,QAAAA,QAAA,EAE5BhB,WAAW,gBACVa,cAAA,CAAC6B,iBAAW,EAAA;AAACpB,UAAAA,KAAK,EAAE7B,IAAI,CAACkD,aAAa,CAACC,qBAAQ,CAACC,mBAAmB,CAAA;AAAE,SAAA,CAAG,GAExEvD,WAAW,CAACwD,WAAW,IAAIrD,IAAI,CAACkD,aAAa,CAACC,qBAAQ,CAACE,WAAW,CAAA;OAE9D,CAAA;AACT,KAEH,CAAA,eAAAjC,cAAA,CAACkC,eAAe,EAAA;MACdC,WAAW,EAAA,IAAA;MACXC,OAAO,EAAA,IAAA;AACPC,MAAAA,SAAS,EAAEvD,OAAQ;AACnBwD,MAAAA,IAAI,EAAEtD,WAAY;MAClBuD,QAAQ,EAAEC,iBAAQ,CAACC,MAAO;AAC1BC,MAAAA,OAAO,EAAE/C,aAAa,CAAC,KAAK,CAAE;MAAAQ,QAAA,EAE7BJ,UAAU,CAACX,aAAa,CAAA;AAAC,KACX,CACnB,CAAA;AAAA,GAAA,CAAG,CAAA;AAEP;;;;"}
1
+ {"version":3,"file":"SelectOption.js","sources":["../../src/selectOption/SelectOption.tsx"],"sourcesContent":["import { useRef, useState } from 'react';\nimport { ActionButtonProps } from '../actionButton';\nimport { clsx } from 'clsx';\nimport Option from '../common/Option';\nimport type { OptionProps } from '../common/Option/Option';\nimport { Breakpoint, Position } from '../common';\nimport Section from '../section';\nimport Header from '../header';\nimport { HeaderProps } from '../header/Header';\nimport NavigationOption from '../navigationOption';\nimport NavigationOptionsList from '../navigationOptionsList';\nimport { useInputAttributes } from '../inputs/contexts';\nimport messages from './SelectOption.messages';\nimport { useIntl } from 'react-intl';\nimport ResponsivePanel from '../common/responsivePanel';\nimport { useScreenSize } from '../common/hooks/useScreenSize';\nimport { ChevronDown, Plus } from '@transferwise/icons';\n\nexport type SelectOptiopsSection<T = unknown> = {\n title?: HeaderProps['title'];\n options: SelectOptionValue<T>[];\n};\n\nexport type SelectOptionValue<T = unknown> = Pick<\n OptionProps,\n 'media' | 'title' | 'content' | 'disabled'\n> & {\n value?: T;\n};\n\nexport type SelectOptionPlaceholder = Pick<OptionProps, 'media' | 'title' | 'content'> & {\n actionLabel?: ActionButtonProps['children'];\n};\n\nexport type SelectOptionProps<T = unknown> = {\n onChange: (selected: SelectOptionValue<T>) => void;\n selected?: SelectOptionValue<T>;\n options: SelectOptiopsSection<T>[];\n placeholder: SelectOptionPlaceholder;\n} & Omit<\n OptionProps,\n 'as' | 'title' | 'media' | 'content' | 'onClick' | 'onChange' | 'showMediaAtAllSizes' | 'decision'\n>;\n\nexport default function SelectOption<T>({\n selected = undefined,\n options,\n onChange,\n placeholder,\n disabled,\n ...props\n}: SelectOptionProps<T>) {\n const intl = useIntl();\n const rootRef = useRef(null);\n const [showOptions, setShowOptions] = useState(false);\n\n const hasSelected = selected !== undefined;\n const isLargeScreen = useScreenSize(Breakpoint.SMALL);\n\n const inputAttributes = useInputAttributes();\n const ariaLabelledBy = props['aria-labelledby'] ?? inputAttributes?.['aria-labelledby'];\n\n function handleOnClick(showOptionsStatus: boolean) {\n return () => {\n setShowOptions(showOptionsStatus);\n };\n }\n\n function handleOnChange(data: SelectOptionValue<T>) {\n return () => {\n setShowOptions(false);\n onChange(data);\n };\n }\n\n function getOptions(isLargeScreen = false) {\n return (\n <div className={clsx({ 'np-select-option-list': isLargeScreen })}>\n {options.map((optionsSection, index) => (\n <Section key={index} className={clsx({ 'p-x-2 p-y-1': isLargeScreen })}>\n {optionsSection.title && <Header title={optionsSection.title} />}\n <NavigationOptionsList>\n {optionsSection.options.map((option, index) => {\n return (\n <NavigationOption\n key={index}\n isContainerAligned={!isLargeScreen}\n showMediaCircle\n showMediaAtAllSizes\n onClick={handleOnChange(option)}\n {...option}\n />\n );\n })}\n </NavigationOptionsList>\n </Section>\n ))}\n </div>\n );\n }\n\n return (\n <>\n <Option\n ref={rootRef}\n as=\"div\"\n showMediaAtAllSizes\n disabled={disabled}\n decision={false}\n media={hasSelected ? selected.media : (placeholder.media ?? <Plus size={24} />)}\n title={(hasSelected ? selected : placeholder).title}\n content={(hasSelected ? selected : placeholder).content}\n className={clsx(\n 'np-select-option',\n 'clickable',\n hasSelected ? 'np-select-option-selected' : 'np-select-option-placeholder',\n props.className,\n )}\n button={\n <button\n {...inputAttributes}\n type=\"button\"\n disabled={disabled}\n aria-labelledby={ariaLabelledBy}\n aria-haspopup=\"dialog\"\n aria-expanded={showOptions}\n className={hasSelected ? 'btn-unstyled' : 'np-action-btn'}\n aria-label={hasSelected ? undefined : props['aria-label']}\n onClick={handleOnClick(true)}\n >\n {hasSelected ? (\n <ChevronDown title={intl.formatMessage(messages.selectedActionLabel)} />\n ) : (\n placeholder.actionLabel || intl.formatMessage(messages.actionLabel)\n )}\n </button>\n }\n />\n <ResponsivePanel\n anchorWidth\n altAxis\n anchorRef={rootRef}\n open={showOptions}\n position={Position.BOTTOM}\n onClose={handleOnClick(false)}\n >\n {getOptions(isLargeScreen)}\n </ResponsivePanel>\n </>\n );\n}\n"],"names":["SelectOption","selected","undefined","options","onChange","placeholder","disabled","props","intl","useIntl","rootRef","useRef","showOptions","setShowOptions","useState","hasSelected","isLargeScreen","useScreenSize","Breakpoint","SMALL","inputAttributes","useInputAttributes","ariaLabelledBy","handleOnClick","showOptionsStatus","handleOnChange","data","getOptions","_jsx","className","clsx","children","map","optionsSection","index","_jsxs","Section","title","Header","NavigationOptionsList","option","NavigationOption","isContainerAligned","showMediaCircle","showMediaAtAllSizes","onClick","_Fragment","Option","ref","as","decision","media","Plus","size","content","button","type","ChevronDown","formatMessage","messages","selectedActionLabel","actionLabel","ResponsivePanel","anchorWidth","altAxis","anchorRef","open","position","Position","BOTTOM","onClose"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CwB,SAAAA,YAAYA,CAAI;AACtCC,EAAAA,QAAQ,GAAGC,SAAS;EACpBC,OAAO;EACPC,QAAQ;EACRC,WAAW;EACXC,QAAQ;EACR,GAAGC,KAAAA;AACkB,CAAA,EAAA;AACrB,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE,CAAA;AACtB,EAAA,MAAMC,OAAO,GAAGC,YAAM,CAAC,IAAI,CAAC,CAAA;EAC5B,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGC,cAAQ,CAAC,KAAK,CAAC,CAAA;AAErD,EAAA,MAAMC,WAAW,GAAGd,QAAQ,KAAKC,SAAS,CAAA;AAC1C,EAAA,MAAMc,aAAa,GAAGC,2BAAa,CAACC,qBAAU,CAACC,KAAK,CAAC,CAAA;AAErD,EAAA,MAAMC,eAAe,GAAGC,2BAAkB,EAAE,CAAA;EAC5C,MAAMC,cAAc,GAAGf,KAAK,CAAC,iBAAiB,CAAC,IAAIa,eAAe,GAAG,iBAAiB,CAAC,CAAA;EAEvF,SAASG,aAAaA,CAACC,iBAA0B,EAAA;AAC/C,IAAA,OAAO,MAAK;MACVX,cAAc,CAACW,iBAAiB,CAAC,CAAA;KAClC,CAAA;AACH,GAAA;EAEA,SAASC,cAAcA,CAACC,IAA0B,EAAA;AAChD,IAAA,OAAO,MAAK;MACVb,cAAc,CAAC,KAAK,CAAC,CAAA;MACrBT,QAAQ,CAACsB,IAAI,CAAC,CAAA;KACf,CAAA;AACH,GAAA;AAEA,EAAA,SAASC,UAAUA,CAACX,aAAa,GAAG,KAAK,EAAA;AACvC,IAAA,oBACEY,cAAA,CAAA,KAAA,EAAA;M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IAAI,EAAEtD,WAAY;MAClBuD,QAAQ,EAAEC,iBAAQ,CAACC,MAAO;AAC1BC,MAAAA,OAAO,EAAE/C,aAAa,CAAC,KAAK,CAAE;MAAAQ,QAAA,EAE7BJ,UAAU,CAACX,aAAa,CAAA;AAAC,KACX,CACnB,CAAA;AAAA,GAAA,CAAG,CAAA;AAEP;;;;"}
@@ -1,19 +1,37 @@
1
1
  import { useRef, useState } from 'react';
2
2
  import { clsx } from 'clsx';
3
3
  import Option from '../common/Option/Option.mjs';
4
+ import '../common/theme.mjs';
5
+ import '../common/direction.mjs';
6
+ import '../common/propsValues/control.mjs';
7
+ import { Breakpoint } from '../common/propsValues/breakpoint.mjs';
8
+ import '../common/propsValues/size.mjs';
9
+ import '../common/propsValues/typography.mjs';
10
+ import '../common/propsValues/width.mjs';
11
+ import '../common/propsValues/type.mjs';
12
+ import '../common/propsValues/dateMode.mjs';
13
+ import '../common/propsValues/monthFormat.mjs';
14
+ import { Position } from '../common/propsValues/position.mjs';
15
+ import '../common/propsValues/layouts.mjs';
16
+ import '../common/propsValues/status.mjs';
17
+ import '../common/propsValues/sentiment.mjs';
18
+ import '../common/propsValues/profileType.mjs';
19
+ import '../common/propsValues/variant.mjs';
20
+ import '../common/propsValues/scroll.mjs';
21
+ import '../common/propsValues/markdownNodeType.mjs';
22
+ import '../common/fileType.mjs';
23
+ import { Plus, ChevronDown } from '@transferwise/icons';
24
+ import { useIntl } from 'react-intl';
25
+ import '../common/closeButton/CloseButton.messages.mjs';
26
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
4
27
  import Section from '../section/Section.mjs';
5
28
  import { Header } from '../header/Header.mjs';
6
29
  import NavigationOption from '../navigationOption/NavigationOption.mjs';
7
30
  import NavigationOptionList from '../navigationOptionsList/NavigationOptionsList.mjs';
8
31
  import { useInputAttributes } from '../inputs/contexts.mjs';
9
32
  import messages from './SelectOption.messages.mjs';
10
- import { useIntl } from 'react-intl';
11
- import { useScreenSize } from '../common/hooks/useScreenSize.mjs';
12
- import { Plus, ChevronDown } from '@transferwise/icons';
13
- import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
14
- import { Breakpoint } from '../common/propsValues/breakpoint.mjs';
15
33
  import ResponsivePanel from '../common/responsivePanel/ResponsivePanel.mjs';
16
- import { Position } from '../common/propsValues/position.mjs';
34
+ import { useScreenSize } from '../common/hooks/useScreenSize.mjs';
17
35
 
18
36
  function SelectOption({
19
37
  selected = undefined,
@@ -1 +1 @@
1
- {"version":3,"file":"SelectOption.mjs","sources":["../../src/selectOption/SelectOption.tsx"],"sourcesContent":["import { useRef, useState } from 'react';\nimport { ActionButtonProps } from '../actionButton';\nimport { clsx } from 'clsx';\nimport Option from '../common/Option';\nimport type { OptionProps } from '../common/Option/Option';\nimport { Breakpoint, Position } from '../common';\nimport Section from '../section';\nimport Header from '../header';\nimport { HeaderProps } from '../header/Header';\nimport NavigationOption from '../navigationOption';\nimport NavigationOptionsList from '../navigationOptionsList';\nimport { useInputAttributes } from '../inputs/contexts';\nimport messages from './SelectOption.messages';\nimport { useIntl } from 'react-intl';\nimport ResponsivePanel from '../common/responsivePanel';\nimport { useScreenSize } from '../common/hooks/useScreenSize';\nimport { ChevronDown, Plus } from '@transferwise/icons';\n\nexport type SelectOptiopsSection<T = unknown> = {\n title?: HeaderProps['title'];\n options: SelectOptionValue<T>[];\n};\n\nexport type SelectOptionValue<T = unknown> = Pick<\n OptionProps,\n 'media' | 'title' | 'content' | 'disabled'\n> & {\n value?: T;\n};\n\nexport type SelectOptionPlaceholder = Pick<OptionProps, 'media' | 'title' | 'content'> & {\n actionLabel?: ActionButtonProps['children'];\n};\n\nexport type SelectOptionProps<T = unknown> = {\n onChange: (selected: SelectOptionValue<T>) => void;\n selected?: SelectOptionValue<T>;\n options: SelectOptiopsSection<T>[];\n placeholder: SelectOptionPlaceholder;\n} & Omit<\n OptionProps,\n 'as' | 'title' | 'media' | 'content' | 'onClick' | 'onChange' | 'showMediaAtAllSizes' | 'decision'\n>;\n\nexport default function SelectOption<T>({\n selected = undefined,\n options,\n onChange,\n placeholder,\n disabled,\n ...props\n}: SelectOptionProps<T>) {\n const intl = useIntl();\n const rootRef = useRef(null);\n const [showOptions, setShowOptions] = useState(false);\n\n const hasSelected = selected !== undefined;\n const isLargeScreen = useScreenSize(Breakpoint.SMALL);\n\n const inputAttributes = useInputAttributes();\n const ariaLabelledBy = props['aria-labelledby'] ?? inputAttributes?.['aria-labelledby'];\n\n function handleOnClick(showOptionsStatus: boolean) {\n return () => {\n setShowOptions(showOptionsStatus);\n };\n }\n\n function handleOnChange(data: SelectOptionValue<T>) {\n return () => {\n setShowOptions(false);\n onChange(data);\n };\n }\n\n function getOptions(isLargeScreen = false) {\n return (\n <div className={clsx({ 'np-select-option-list': isLargeScreen })}>\n {options.map((optionsSection, index) => (\n <Section key={index} className={clsx({ 'p-x-2 p-y-1': isLargeScreen })}>\n {optionsSection.title && <Header title={optionsSection.title} />}\n <NavigationOptionsList>\n {optionsSection.options.map((option, index) => {\n return (\n <NavigationOption\n key={index}\n isContainerAligned={!isLargeScreen}\n showMediaCircle\n showMediaAtAllSizes\n onClick={handleOnChange(option)}\n {...option}\n />\n );\n })}\n </NavigationOptionsList>\n </Section>\n ))}\n </div>\n );\n }\n\n return (\n <>\n <Option\n ref={rootRef}\n as=\"div\"\n showMediaAtAllSizes\n disabled={disabled}\n decision={false}\n media={hasSelected ? selected.media : (placeholder.media ?? <Plus size={24} />)}\n title={(hasSelected ? selected : placeholder).title}\n content={(hasSelected ? selected : placeholder).content}\n className={clsx(\n 'np-select-option',\n 'clickable',\n hasSelected ? 'np-select-option-selected' : 'np-select-option-placeholder',\n props.className,\n )}\n button={\n <button\n {...inputAttributes}\n type=\"button\"\n disabled={disabled}\n aria-labelledby={ariaLabelledBy}\n aria-haspopup=\"dialog\"\n aria-expanded={showOptions}\n className={hasSelected ? 'btn-unstyled' : 'np-action-btn'}\n aria-label={hasSelected ? undefined : props['aria-label']}\n onClick={handleOnClick(true)}\n >\n {hasSelected ? (\n <ChevronDown title={intl.formatMessage(messages.selectedActionLabel)} />\n ) : (\n placeholder.actionLabel || intl.formatMessage(messages.actionLabel)\n )}\n </button>\n }\n />\n <ResponsivePanel\n anchorWidth\n altAxis\n anchorRef={rootRef}\n open={showOptions}\n position={Position.BOTTOM}\n onClose={handleOnClick(false)}\n >\n {getOptions(isLargeScreen)}\n </ResponsivePanel>\n </>\n );\n}\n"],"names":["SelectOption","selected","undefined","options","onChange","placeholder","disabled","props","intl","useIntl","rootRef","useRef","showOptions","setShowOptions","useState","hasSelected","isLargeScreen","useScreenSize","Breakpoint","SMALL","inputAttributes","useInputAttributes","ariaLabelledBy","handleOnClick","showOptionsStatus","handleOnChange","data","getOptions","_jsx","className","clsx","children","map","optionsSection","index","_jsxs","Section","title","Header","NavigationOptionsList","option","NavigationOption","isContainerAligned","showMediaCircle","showMediaAtAllSizes","onClick","_Fragment","Option","ref","as","decision","media","Plus","size","content","button","type","ChevronDown","formatMessage","messages","selectedActionLabel","actionLabel","ResponsivePanel","anchorWidth","altAxis","anchorRef","open","position","Position","BOTTOM","onClose"],"mappings":";;;;;;;;;;;;;;;;;AA4CwB,SAAAA,YAAYA,CAAI;AACtCC,EAAAA,QAAQ,GAAGC,SAAS;EACpBC,OAAO;EACPC,QAAQ;EACRC,WAAW;EACXC,QAAQ;EACR,GAAGC,KAAAA;AACkB,CAAA,EAAA;AACrB,EAAA,MAAMC,IAAI,GAAGC,OAAO,EAAE,CAAA;AACtB,EAAA,MAAMC,OAAO,GAAGC,MAAM,CAAC,IAAI,CAAC,CAAA;EAC5B,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGC,QAAQ,CAAC,KAAK,CAAC,CAAA;AAErD,EAAA,MAAMC,WAAW,GAAGd,QAAQ,KAAKC,SAAS,CAAA;AAC1C,EAAA,MAAMc,aAAa,GAAGC,aAAa,CAACC,UAAU,CAACC,KAAK,CAAC,CAAA;AAErD,EAAA,MAAMC,eAAe,GAAGC,kBAA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AAC,YAAY,CAAE;AAC1DsC,QAAAA,OAAO,EAAEtB,aAAa,CAAC,IAAI,CAAE;AAAAQ,QAAAA,QAAA,EAE5BhB,WAAW,gBACVa,GAAA,CAAC6B,WAAW,EAAA;AAACpB,UAAAA,KAAK,EAAE7B,IAAI,CAACkD,aAAa,CAACC,QAAQ,CAACC,mBAAmB,CAAA;AAAE,SAAA,CAAG,GAExEvD,WAAW,CAACwD,WAAW,IAAIrD,IAAI,CAACkD,aAAa,CAACC,QAAQ,CAACE,WAAW,CAAA;OAE9D,CAAA;AACT,KAEH,CAAA,eAAAjC,GAAA,CAACkC,eAAe,EAAA;MACdC,WAAW,EAAA,IAAA;MACXC,OAAO,EAAA,IAAA;AACPC,MAAAA,SAAS,EAAEvD,OAAQ;AACnBwD,MAAAA,IAAI,EAAEtD,WAAY;MAClBuD,QAAQ,EAAEC,QAAQ,CAACC,MAAO;AAC1BC,MAAAA,OAAO,EAAE/C,aAAa,CAAC,KAAK,CAAE;MAAAQ,QAAA,EAE7BJ,UAAU,CAACX,aAAa,CAAA;AAAC,KACX,CACnB,CAAA;AAAA,GAAA,CAAG,CAAA;AAEP;;;;"}
1
+ {"version":3,"file":"SelectOption.mjs","sources":["../../src/selectOption/SelectOption.tsx"],"sourcesContent":["import { useRef, useState } from 'react';\nimport { ActionButtonProps } from '../actionButton';\nimport { clsx } from 'clsx';\nimport Option from '../common/Option';\nimport type { OptionProps } from '../common/Option/Option';\nimport { Breakpoint, Position } from '../common';\nimport Section from '../section';\nimport Header from '../header';\nimport { HeaderProps } from '../header/Header';\nimport NavigationOption from '../navigationOption';\nimport NavigationOptionsList from '../navigationOptionsList';\nimport { useInputAttributes } from '../inputs/contexts';\nimport messages from './SelectOption.messages';\nimport { useIntl } from 'react-intl';\nimport ResponsivePanel from '../common/responsivePanel';\nimport { useScreenSize } from '../common/hooks/useScreenSize';\nimport { ChevronDown, Plus } from '@transferwise/icons';\n\nexport type SelectOptiopsSection<T = unknown> = {\n title?: HeaderProps['title'];\n options: SelectOptionValue<T>[];\n};\n\nexport type SelectOptionValue<T = unknown> = Pick<\n OptionProps,\n 'media' | 'title' | 'content' | 'disabled'\n> & {\n value?: T;\n};\n\nexport type SelectOptionPlaceholder = Pick<OptionProps, 'media' | 'title' | 'content'> & {\n actionLabel?: ActionButtonProps['children'];\n};\n\nexport type SelectOptionProps<T = unknown> = {\n onChange: (selected: SelectOptionValue<T>) => void;\n selected?: SelectOptionValue<T>;\n options: SelectOptiopsSection<T>[];\n placeholder: SelectOptionPlaceholder;\n} & Omit<\n OptionProps,\n 'as' | 'title' | 'media' | 'content' | 'onClick' | 'onChange' | 'showMediaAtAllSizes' | 'decision'\n>;\n\nexport default function SelectOption<T>({\n selected = undefined,\n options,\n onChange,\n placeholder,\n disabled,\n ...props\n}: SelectOptionProps<T>) {\n const intl = useIntl();\n const rootRef = useRef(null);\n const [showOptions, setShowOptions] = useState(false);\n\n const hasSelected = selected !== undefined;\n const isLargeScreen = useScreenSize(Breakpoint.SMALL);\n\n const inputAttributes = useInputAttributes();\n const ariaLabelledBy = props['aria-labelledby'] ?? inputAttributes?.['aria-labelledby'];\n\n function handleOnClick(showOptionsStatus: boolean) {\n return () => {\n setShowOptions(showOptionsStatus);\n };\n }\n\n function handleOnChange(data: SelectOptionValue<T>) {\n return () => {\n setShowOptions(false);\n onChange(data);\n };\n }\n\n function getOptions(isLargeScreen = false) {\n return (\n <div className={clsx({ 'np-select-option-list': isLargeScreen })}>\n {options.map((optionsSection, index) => (\n <Section key={index} className={clsx({ 'p-x-2 p-y-1': isLargeScreen })}>\n {optionsSection.title && <Header title={optionsSection.title} />}\n <NavigationOptionsList>\n {optionsSection.options.map((option, index) => {\n return (\n <NavigationOption\n key={index}\n isContainerAligned={!isLargeScreen}\n showMediaCircle\n showMediaAtAllSizes\n onClick={handleOnChange(option)}\n {...option}\n />\n );\n })}\n </NavigationOptionsList>\n </Section>\n ))}\n </div>\n );\n }\n\n return (\n <>\n <Option\n ref={rootRef}\n as=\"div\"\n showMediaAtAllSizes\n disabled={disabled}\n decision={false}\n media={hasSelected ? selected.media : (placeholder.media ?? <Plus size={24} />)}\n title={(hasSelected ? selected : placeholder).title}\n content={(hasSelected ? selected : placeholder).content}\n className={clsx(\n 'np-select-option',\n 'clickable',\n hasSelected ? 'np-select-option-selected' : 'np-select-option-placeholder',\n props.className,\n )}\n button={\n <button\n {...inputAttributes}\n type=\"button\"\n disabled={disabled}\n aria-labelledby={ariaLabelledBy}\n aria-haspopup=\"dialog\"\n aria-expanded={showOptions}\n className={hasSelected ? 'btn-unstyled' : 'np-action-btn'}\n aria-label={hasSelected ? undefined : props['aria-label']}\n onClick={handleOnClick(true)}\n >\n {hasSelected ? (\n <ChevronDown title={intl.formatMessage(messages.selectedActionLabel)} />\n ) : (\n placeholder.actionLabel || intl.formatMessage(messages.actionLabel)\n )}\n </button>\n }\n />\n <ResponsivePanel\n anchorWidth\n altAxis\n anchorRef={rootRef}\n open={showOptions}\n position={Position.BOTTOM}\n onClose={handleOnClick(false)}\n >\n {getOptions(isLargeScreen)}\n </ResponsivePanel>\n </>\n );\n}\n"],"names":["SelectOption","selected","undefined","options","onChange","placeholder","disabled","props","intl","useIntl","rootRef","useRef","showOptions","setShowOptions","useState","hasSelected","isLargeScreen","useScreenSize","Breakpoint","SMALL","inputAttributes","useInputAttributes","ariaLabelledBy","handleOnClick","showOptionsStatus","handleOnChange","data","getOptions","_jsx","className","clsx","children","map","optionsSection","index","_jsxs","Section","title","Header","NavigationOptionsList","option","NavigationOption","isContainerAligned","showMediaCircle","showMediaAtAllSizes","onClick","_Fragment","Option","ref","as","decision","media","Plus","size","content","button","type","ChevronDown","formatMessage","messages","selectedActionLabel","actionLabel","ResponsivePanel","anchorWidth","altAxis","anchorRef","open","position","Position","BOTTOM","onClose"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CwB,SAAAA,YAAYA,CAAI;AACtCC,EAAAA,QAAQ,GAAGC,SAAS;EACpBC,OAAO;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var reactIntl = require('react-intl');
6
+ require('../common/theme.js');
7
+ require('../common/direction.js');
8
+ require('../common/propsValues/control.js');
9
+ var breakpoint = require('../common/propsValues/breakpoint.js');
10
+ var size = require('../common/propsValues/size.js');
11
+ require('../common/propsValues/typography.js');
12
+ require('../common/propsValues/width.js');
13
+ require('../common/propsValues/type.js');
14
+ require('../common/propsValues/dateMode.js');
15
+ require('../common/propsValues/monthFormat.js');
16
+ require('../common/propsValues/position.js');
17
+ require('../common/propsValues/layouts.js');
18
+ require('../common/propsValues/status.js');
19
+ var sentiment = require('../common/propsValues/sentiment.js');
20
+ require('../common/propsValues/profileType.js');
21
+ require('../common/propsValues/variant.js');
22
+ require('../common/propsValues/scroll.js');
23
+ require('../common/propsValues/markdownNodeType.js');
24
+ require('../common/fileType.js');
25
+ require('react');
26
+ require('../common/closeButton/CloseButton.messages.js');
27
+ var jsxRuntime = require('react/jsx-runtime');
6
28
  var Circle = require('../common/circle/Circle.js');
7
29
  var useMedia = require('../common/hooks/useMedia.js');
8
30
  var StatusIcon_messages = require('./StatusIcon.messages.js');
9
- var jsxRuntime = require('react/jsx-runtime');
10
- var sentiment = require('../common/propsValues/sentiment.js');
11
- var breakpoint = require('../common/propsValues/breakpoint.js');
12
- var size = require('../common/propsValues/size.js');
13
31
 
14
32
  const mapLegacySize = {
15
33
  [String(size.Size.SMALL)]: 16,
@@ -1 +1 @@
1
- {"version":3,"file":"StatusIcon.js","sources":["../../src/statusIcon/StatusIcon.tsx"],"sourcesContent":["import { Info, Alert, Cross, Check, ClockBorderless } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { SizeSmall, SizeMedium, SizeLarge, Sentiment, Size, Breakpoint } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\nimport messages from './StatusIcon.messages';\n\n/**\n * @deprecated use `16 | 24 | 32 | 40 | 48 | 56 | 72` component instead\n */\ntype LegacySizes = SizeSmall | SizeMedium | SizeLarge;\n\nexport type StatusIconProps = {\n sentiment?: `${Sentiment}`;\n size?: LegacySizes | 16 | 24 | 32 | 40 | 48 | 56 | 72;\n /**\n * Override for the sentiment's-derived, default, accessible\n * name announced by the screen readers. <br />\n * Using `null` will render the icon purely presentational.\n * */\n iconLabel?: string | null;\n};\n\nconst mapLegacySize = {\n [String(Size.SMALL)]: 16,\n [String(Size.MEDIUM)]: 40,\n [String(Size.LARGE)]: 48,\n} satisfies Record<string, CircleProps['size']>;\n\nconst StatusIcon = ({ sentiment = 'neutral', size: sizeProp = 40, iconLabel }: StatusIconProps) => {\n const intl = useIntl();\n\n const iconMetaBySentiment: Record<\n `${Sentiment}`,\n {\n Icon: React.ElementType;\n defaultIconLabel: string;\n }\n > = {\n [Sentiment.NEGATIVE]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.POSITIVE]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n [Sentiment.WARNING]: {\n Icon: Alert,\n defaultIconLabel: intl.formatMessage(messages.warningLabel),\n },\n [Sentiment.PENDING]: {\n Icon: ClockBorderless,\n defaultIconLabel: intl.formatMessage(messages.pendingLabel),\n },\n [Sentiment.NEUTRAL]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n // deprecated\n [Sentiment.ERROR]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.INFO]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n [Sentiment.SUCCESS]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n };\n const { Icon, defaultIconLabel } = iconMetaBySentiment[sentiment];\n\n const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n const size = mapLegacySize[sizeProp] ?? sizeProp;\n return (\n <Circle\n as=\"span\"\n size={isTinyViewport && size < 40 ? 32 : size}\n data-testid=\"status-icon\"\n className={clsx('status-circle', sentiment)}\n >\n <Icon\n className={clsx('status-icon', iconColor)}\n title={iconLabel === null ? undefined : iconLabel || defaultIconLabel}\n />\n </Circle>\n );\n};\n\nexport default StatusIcon;\n"],"names":["mapLegacySize","String","Size","SMALL","MEDIUM","LARGE","StatusIcon","sentiment","size","sizeProp","iconLabel","intl","useIntl","iconMetaBySentiment","Sentiment","NEGATIVE","Icon","Cross","defaultIconLabel","formatMessage","messages","errorLabel","POSITIVE","Check","successLabel","WARNING","Alert","warningLabel","PENDING","ClockBorderless","pendingLabel","NEUTRAL","Info","informationLabel","ERROR","INFO","SUCCESS","iconColor","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","Circle","as","className","clsx","children","title","undefined"],"mappings":";;;;;;;;;;;;;AA0BA,MAAMA,aAAa,GAAG;AACpB,EAAA,CAACC,MAAM,CAACC,SAAI,CAACC,KAAK,CAAC,GAAG,EAAE;AACxB,EAAA,CAACF,MAAM,CAACC,SAAI,CAACE,MAAM,CAAC,GAAG,EAAE;AACzB,EAAA,CAACH,MAAM,CAACC,SAAI,CAACG,KAAK,CAAC,GAAG,EAAA;CACuB,CAAA;AAEzCC,MAAAA,UAAU,GAAGA,CAAC;AAAEC,aAAAA,WAAS,GAAG,SAAS;EAAEC,IAAI,EAAEC,QAAQ,GAAG,EAAE;AAAEC,EAAAA,SAAAA;AAAS,CAAmB,KAAI;AAChG,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE,CAAA;AAEtB,EAAA,MAAMC,mBAAmB,GAMrB;IACF,CAACC,mBAAS,CAACC,QAAQ,GAAG;AACpBC,MAAAA,IAAI,EAAEC,WAAK;AACXC,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,mBAAQ,CAACC,UAAU,CAAA;KACzD;IACD,CAACP,mBAAS,CAACQ,QAAQ,GAAG;AACpBN,MAAAA,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AAS,KAAK,SAAS,IAAIA,WAAS,KAAK,SAAS,GAAG,MAAM,GAAG,OAAO,CAAA;EACvF,MAAM+B,cAAc,GAAGC,iBAAQ,CAAC,eAAeC,qBAAU,CAACC,QAAQ,CAAA,GAAA,CAAK,CAAC,CAAA;AACxE,EAAA,MAAMjC,IAAI,GAAGR,aAAa,CAACS,QAAQ,CAAC,IAAIA,QAAQ,CAAA;EAChD,oBACEiC,cAAA,CAACC,MAAM,EAAA;AACLC,IAAAA,EAAE,EAAC,MAAM;IACTpC,IAAI,EAAE8B,cAAc,IAAI9B,IAAI,GAAG,EAAE,GAAG,EAAE,GAAGA,IAAK;AAC9C,IAAA,aAAA,EAAY,aAAa;AACzBqC,IAAAA,SAAS,EAAEC,SAAI,CAAC,eAAe,EAAEvC,WAAS,CAAE;IAAAwC,QAAA,eAE5CL,cAAA,CAAC1B,IAAI,EAAA;AACH6B,MAAAA,SAAS,EAAEC,SAAI,CAAC,aAAa,EAAET,SAAS,CAAE;MAC1CW,KAAK,EAAEtC,SAAS,KAAK,IAAI,GAAGuC,SAAS,GAAGvC,SAAS,IAAIQ,gBAAAA;KAEzD,CAAA;AAAA,GAAQ,CAAC,CAAA;AAEb;;;;"}
1
+ {"version":3,"file":"StatusIcon.js","sources":["../../src/statusIcon/StatusIcon.tsx"],"sourcesContent":["import { Info, Alert, Cross, Check, ClockBorderless } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { SizeSmall, SizeMedium, SizeLarge, Sentiment, Size, Breakpoint } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\nimport messages from './StatusIcon.messages';\n\n/**\n * @deprecated use `16 | 24 | 32 | 40 | 48 | 56 | 72` component instead\n */\ntype LegacySizes = SizeSmall | SizeMedium | SizeLarge;\n\nexport type StatusIconProps = {\n sentiment?: `${Sentiment}`;\n size?: LegacySizes | 16 | 24 | 32 | 40 | 48 | 56 | 72;\n /**\n * Override for the sentiment's-derived, default, accessible\n * name announced by the screen readers. <br />\n * Using `null` will render the icon purely presentational.\n * */\n iconLabel?: string | null;\n};\n\nconst mapLegacySize = {\n [String(Size.SMALL)]: 16,\n [String(Size.MEDIUM)]: 40,\n [String(Size.LARGE)]: 48,\n} satisfies Record<string, CircleProps['size']>;\n\nconst StatusIcon = ({ sentiment = 'neutral', size: sizeProp = 40, iconLabel }: StatusIconProps) => {\n const intl = useIntl();\n\n const iconMetaBySentiment: Record<\n `${Sentiment}`,\n {\n Icon: React.ElementType;\n defaultIconLabel: string;\n }\n > = {\n [Sentiment.NEGATIVE]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.POSITIVE]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n [Sentiment.WARNING]: {\n Icon: Alert,\n defaultIconLabel: intl.formatMessage(messages.warningLabel),\n },\n [Sentiment.PENDING]: {\n Icon: ClockBorderless,\n defaultIconLabel: intl.formatMessage(messages.pendingLabel),\n },\n [Sentiment.NEUTRAL]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n // deprecated\n [Sentiment.ERROR]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.INFO]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n [Sentiment.SUCCESS]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n };\n const { Icon, defaultIconLabel } = iconMetaBySentiment[sentiment];\n\n const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n const size = mapLegacySize[sizeProp] ?? sizeProp;\n return (\n <Circle\n as=\"span\"\n size={isTinyViewport && size < 40 ? 32 : size}\n data-testid=\"status-icon\"\n className={clsx('status-circle', sentiment)}\n >\n <Icon\n className={clsx('status-icon', iconColor)}\n title={iconLabel === null ? undefined : iconLabel || defaultIconLabel}\n />\n </Circle>\n );\n};\n\nexport default StatusIcon;\n"],"names":["mapLegacySize","String","Size","SMALL","MEDIUM","LARGE","StatusIcon","sentiment","size","sizeProp","iconLabel","intl","useIntl","iconMetaBySentiment","Sentiment","NEGATIVE","Icon","Cross","defaultIconLabel","formatMessage","messages","errorLabel","POSITIVE","Check","successLabel","WARNING","Alert","warningLabel","PENDING","ClockBorderless","pendingLabel","NEUTRAL","Info","informationLabel","ERROR","INFO","SUCCESS","iconColor","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","Circle","as","className","clsx","children","title","undefined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAMA,aAAa,GAAG;AACpB,EAAA,CAACC,MAAM,CAACC,SAAI,CAACC,KAAK,CAAC,GAAG,EAAE;AACxB,EAAA,CAACF,MAAM,CAACC,SAAI,CAACE,MAAM,CAAC,GAAG,EAAE;AACzB,EAAA,CAACH,MAAM,CAACC,SAAI,CAACG,KAAK,CAAC,GAAG,EAAA;CACuB,CAAA;AAEzCC,MAAAA,UAAU,GAAGA,CAAC;AAAEC,aAAAA,WAAS,GAAG,SAAS;EAAEC,IAAI,EAAEC,QAAQ,GAAG,EAAE;AAAEC,EAAAA,SAAAA;AAAS,CAAmB,KAAI;AAChG,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE,CAAA;AAEtB,EAAA,MAAMC,mBAAmB,GAMrB;IACF,CAACC,mBAAS,CAACC,QAAQ,GAAG;AACpBC,MAAAA,IAAI,EAAEC,WAAK;AACXC,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,mBAAQ,CAACC,UAAU,CAAA;KACzD;IACD,CAACP,mBAAS,CAACQ,QAAQ,GAAG;AACpBN,MAAAA,IAAI,EAAEO,WAAK;AACXL,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,mBAAQ,CAACI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cAAc,GAAGC,iBAAQ,CAAC,eAAeC,qBAAU,CAACC,QAAQ,CAAA,GAAA,CAAK,CAAC,CAAA;AACxE,EAAA,MAAMjC,IAAI,GAAGR,aAAa,CAACS,QAAQ,CAAC,IAAIA,QAAQ,CAAA;EAChD,oBACEiC,cAAA,CAACC,MAAM,EAAA;AACLC,IAAAA,EAAE,EAAC,MAAM;IACTpC,IAAI,EAAE8B,cAAc,IAAI9B,IAAI,GAAG,EAAE,GAAG,EAAE,GAAGA,IAAK;AAC9C,IAAA,aAAA,EAAY,aAAa;AACzBqC,IAAAA,SAAS,EAAEC,SAAI,CAAC,eAAe,EAAEvC,WAAS,CAAE;IAAAwC,QAAA,eAE5CL,cAAA,CAAC1B,IAAI,EAAA;AACH6B,MAAAA,SAAS,EAAEC,SAAI,CAAC,aAAa,EAAET,SAAS,CAAE;MAC1CW,KAAK,EAAEtC,SAAS,KAAK,IAAI,GAAGuC,SAAS,GAAGvC,SAAS,IAAIQ,gBAAAA;KAEzD,CAAA;AAAA,GAAQ,CAAC,CAAA;AAEb;;;;"}
@@ -1,13 +1,31 @@
1
1
  import { Cross, Check, Alert, ClockBorderless, Info } from '@transferwise/icons';
2
2
  import { clsx } from 'clsx';
3
3
  import { useIntl } from 'react-intl';
4
+ import '../common/theme.mjs';
5
+ import '../common/direction.mjs';
6
+ import '../common/propsValues/control.mjs';
7
+ import { Breakpoint } from '../common/propsValues/breakpoint.mjs';
8
+ import { Size } from '../common/propsValues/size.mjs';
9
+ import '../common/propsValues/typography.mjs';
10
+ import '../common/propsValues/width.mjs';
11
+ import '../common/propsValues/type.mjs';
12
+ import '../common/propsValues/dateMode.mjs';
13
+ import '../common/propsValues/monthFormat.mjs';
14
+ import '../common/propsValues/position.mjs';
15
+ import '../common/propsValues/layouts.mjs';
16
+ import '../common/propsValues/status.mjs';
17
+ import { Sentiment } from '../common/propsValues/sentiment.mjs';
18
+ import '../common/propsValues/profileType.mjs';
19
+ import '../common/propsValues/variant.mjs';
20
+ import '../common/propsValues/scroll.mjs';
21
+ import '../common/propsValues/markdownNodeType.mjs';
22
+ import '../common/fileType.mjs';
23
+ import 'react';
24
+ import '../common/closeButton/CloseButton.messages.mjs';
25
+ import { jsx } from 'react/jsx-runtime';
4
26
  import Circle from '../common/circle/Circle.mjs';
5
27
  import { useMedia } from '../common/hooks/useMedia.mjs';
6
28
  import messages from './StatusIcon.messages.mjs';
7
- import { jsx } from 'react/jsx-runtime';
8
- import { Sentiment } from '../common/propsValues/sentiment.mjs';
9
- import { Breakpoint } from '../common/propsValues/breakpoint.mjs';
10
- import { Size } from '../common/propsValues/size.mjs';
11
29
 
12
30
  const mapLegacySize = {
13
31
  [String(Size.SMALL)]: 16,
@@ -1 +1 @@
1
- {"version":3,"file":"StatusIcon.mjs","sources":["../../src/statusIcon/StatusIcon.tsx"],"sourcesContent":["import { Info, Alert, Cross, Check, ClockBorderless } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { SizeSmall, SizeMedium, SizeLarge, Sentiment, Size, Breakpoint } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\nimport messages from './StatusIcon.messages';\n\n/**\n * @deprecated use `16 | 24 | 32 | 40 | 48 | 56 | 72` component instead\n */\ntype LegacySizes = SizeSmall | SizeMedium | SizeLarge;\n\nexport type StatusIconProps = {\n sentiment?: `${Sentiment}`;\n size?: LegacySizes | 16 | 24 | 32 | 40 | 48 | 56 | 72;\n /**\n * Override for the sentiment's-derived, default, accessible\n * name announced by the screen readers. <br />\n * Using `null` will render the icon purely presentational.\n * */\n iconLabel?: string | null;\n};\n\nconst mapLegacySize = {\n [String(Size.SMALL)]: 16,\n [String(Size.MEDIUM)]: 40,\n [String(Size.LARGE)]: 48,\n} satisfies Record<string, CircleProps['size']>;\n\nconst StatusIcon = ({ sentiment = 'neutral', size: sizeProp = 40, iconLabel }: StatusIconProps) => {\n const intl = useIntl();\n\n const iconMetaBySentiment: Record<\n `${Sentiment}`,\n {\n Icon: React.ElementType;\n defaultIconLabel: string;\n }\n > = {\n [Sentiment.NEGATIVE]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.POSITIVE]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n [Sentiment.WARNING]: {\n Icon: Alert,\n defaultIconLabel: intl.formatMessage(messages.warningLabel),\n },\n [Sentiment.PENDING]: {\n Icon: ClockBorderless,\n defaultIconLabel: intl.formatMessage(messages.pendingLabel),\n },\n [Sentiment.NEUTRAL]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n // deprecated\n [Sentiment.ERROR]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.INFO]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n [Sentiment.SUCCESS]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n };\n const { Icon, defaultIconLabel } = iconMetaBySentiment[sentiment];\n\n const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n const size = mapLegacySize[sizeProp] ?? sizeProp;\n return (\n <Circle\n as=\"span\"\n size={isTinyViewport && size < 40 ? 32 : size}\n data-testid=\"status-icon\"\n className={clsx('status-circle', sentiment)}\n >\n <Icon\n className={clsx('status-icon', iconColor)}\n title={iconLabel === null ? undefined : iconLabel || defaultIconLabel}\n />\n </Circle>\n );\n};\n\nexport default StatusIcon;\n"],"names":["mapLegacySize","String","Size","SMALL","MEDIUM","LARGE","StatusIcon","sentiment","size","sizeProp","iconLabel","intl","useIntl","iconMetaBySentiment","Sentiment","NEGATIVE","Icon","Cross","defaultIconLabel","formatMessage","messages","errorLabel","POSITIVE","Check","successLabel","WARNING","Alert","warningLabel","PENDING","ClockBorderless","pendingLabel","NEUTRAL","Info","informationLabel","ERROR","INFO","SUCCESS","iconColor","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","Circle","as","className","clsx","children","title","undefined"],"mappings":";;;;;;;;;;;AA0BA,MAAMA,aAAa,GAAG;AACpB,EAAA,CAACC,MAAM,CAACC,IAAI,CAACC,KAAK,CAAC,GAAG,EAAE;AACxB,EAAA,CAACF,MAAM,CAACC,IAAI,CAACE,MAAM,CAAC,GAAG,EAAE;AACzB,EAAA,CAACH,MAAM,CAACC,IAAI,CAACG,KAAK,CAAC,GAAG,EAAA;CACuB,CAAA;AAEzCC,MAAAA,UAAU,GAAGA,CAAC;AAAEC,EAAAA,SAAS,GAAG,SAAS;EAAEC,IAAI,EAAEC,QAAQ,GAAG,EAAE;AAAEC,EAAAA,SAAAA;AAAS,CAAmB,KAAI;AAChG,EAAA,MAAMC,IAAI,GAAGC,OAAO,EAAE,CAAA;AAEtB,EAAA,MAAMC,mBAAmB,GAMrB;IACF,CAACC,SAAS,CAACC,QAAQ,GAAG;AACpBC,MAAAA,IAAI,EAAEC,KAAK;AACXC,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,QAAQ,CAACC,UAAU,CAAA;KACzD;IACD,CAACP,SAAS,CAACQ,QAAQ,GAAG;AACpBN,MAAAA,IAAI,EAAEO,KAAK;AACXL,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,QAAQ,CAACI,YAAY,CAAA;KAC3D;IACD,CAACV,SAAS,CAACW,OAAO,GAAG;AACnBT,MAAAA,IAAI,EAAEU,KAAK;AACXR,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,QAAQ,CAACO,YAAY,CAAA;KAC3D;IACD,CAACb,SAAS,CAACc,OAAO,GAAG;AACnBZ,MAAAA,IAAI,EAAEa,eAAe;AACrBX,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,QAAQ,CAACU,YAAY,CAAA;KA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ACzBqC,IAAAA,SAAS,EAAEC,IAAI,CAAC,eAAe,EAAEvC,SAAS,CAAE;IAAAwC,QAAA,eAE5CL,GAAA,CAAC1B,IAAI,EAAA;AACH6B,MAAAA,SAAS,EAAEC,IAAI,CAAC,aAAa,EAAET,SAAS,CAAE;MAC1CW,KAAK,EAAEtC,SAAS,KAAK,IAAI,GAAGuC,SAAS,GAAGvC,SAAS,IAAIQ,gBAAAA;KAEzD,CAAA;AAAA,GAAQ,CAAC,CAAA;AAEb;;;;"}
1
+ {"version":3,"file":"StatusIcon.mjs","sources":["../../src/statusIcon/StatusIcon.tsx"],"sourcesContent":["import { Info, Alert, Cross, Check, ClockBorderless } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { SizeSmall, SizeMedium, SizeLarge, Sentiment, Size, Breakpoint } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\nimport messages from './StatusIcon.messages';\n\n/**\n * @deprecated use `16 | 24 | 32 | 40 | 48 | 56 | 72` component instead\n */\ntype LegacySizes = SizeSmall | SizeMedium | SizeLarge;\n\nexport type StatusIconProps = {\n sentiment?: `${Sentiment}`;\n size?: LegacySizes | 16 | 24 | 32 | 40 | 48 | 56 | 72;\n /**\n * Override for the sentiment's-derived, default, accessible\n * name announced by the screen readers. <br />\n * Using `null` will render the icon purely presentational.\n * */\n iconLabel?: string | null;\n};\n\nconst mapLegacySize = {\n [String(Size.SMALL)]: 16,\n [String(Size.MEDIUM)]: 40,\n [String(Size.LARGE)]: 48,\n} satisfies Record<string, CircleProps['size']>;\n\nconst StatusIcon = ({ sentiment = 'neutral', size: sizeProp = 40, iconLabel }: StatusIconProps) => {\n const intl = useIntl();\n\n const iconMetaBySentiment: Record<\n `${Sentiment}`,\n {\n Icon: React.ElementType;\n defaultIconLabel: string;\n }\n > = {\n [Sentiment.NEGATIVE]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.POSITIVE]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n [Sentiment.WARNING]: {\n Icon: Alert,\n defaultIconLabel: intl.formatMessage(messages.warningLabel),\n },\n [Sentiment.PENDING]: {\n Icon: ClockBorderless,\n defaultIconLabel: intl.formatMessage(messages.pendingLabel),\n },\n [Sentiment.NEUTRAL]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n // deprecated\n [Sentiment.ERROR]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.INFO]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n [Sentiment.SUCCESS]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n };\n const { Icon, defaultIconLabel } = iconMetaBySentiment[sentiment];\n\n const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n const size = mapLegacySize[sizeProp] ?? sizeProp;\n return (\n <Circle\n as=\"span\"\n size={isTinyViewport && size < 40 ? 32 : size}\n data-testid=\"status-icon\"\n className={clsx('status-circle', sentiment)}\n >\n <Icon\n className={clsx('status-icon', iconColor)}\n title={iconLabel === null ? undefined : iconLabel || defaultIconLabel}\n />\n </Circle>\n );\n};\n\nexport default StatusIcon;\n"],"names":["mapLegacySize","String","Size","SMALL","MEDIUM","LARGE","StatusIcon","sentiment","size","sizeProp","iconLabel","intl","useIntl","iconMetaBySentiment","Sentiment","NEGATIVE","Icon","Cross","defaultIconLabel","formatMessage","messages","errorLabel","POSITIVE","Check","successLabel","WARNING","Alert","warningLabel","PENDING","ClockBorderless","pendingLabel","NEUTRAL","Info","informationLabel","ERROR","INFO","SUCCESS","iconColor","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","Circle","as","className","clsx","children","title","undefined"],"mappings":";;;;;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AAA;AACH6B,MAAAA,SAAS,EAAEC,IAAI,CAAC,aAAa,EAAET,SAAS,CAAE;MAC1CW,KAAK,EAAEtC,SAAS,KAAK,IAAI,GAAGuC,SAAS,GAAGvC,SAAS,IAAIQ,gBAAAA;KAEzD,CAAA;AAAA,GAAQ,CAAC,CAAA;AAEb;;;;"}
@@ -2,11 +2,33 @@
2
2
 
3
3
  var clsx = require('clsx');
4
4
  require('react');
5
- var Tooltip = require('../tooltip/Tooltip.js');
6
- var deviceDetection = require('./deviceDetection.js');
5
+ require('../common/theme.js');
6
+ require('../common/direction.js');
7
+ require('../common/propsValues/control.js');
8
+ require('../common/propsValues/breakpoint.js');
9
+ require('../common/propsValues/size.js');
10
+ require('../common/propsValues/typography.js');
11
+ require('../common/propsValues/width.js');
12
+ require('../common/propsValues/type.js');
13
+ require('../common/propsValues/dateMode.js');
14
+ require('../common/propsValues/monthFormat.js');
15
+ var position = require('../common/propsValues/position.js');
16
+ require('../common/propsValues/layouts.js');
17
+ require('../common/propsValues/status.js');
18
+ require('../common/propsValues/sentiment.js');
19
+ require('../common/propsValues/profileType.js');
20
+ require('../common/propsValues/variant.js');
21
+ require('../common/propsValues/scroll.js');
22
+ require('../common/propsValues/markdownNodeType.js');
23
+ require('../common/fileType.js');
24
+ require('@transferwise/icons');
25
+ require('react-intl');
26
+ require('../common/closeButton/CloseButton.messages.js');
7
27
  var jsxRuntime = require('react/jsx-runtime');
28
+ require('@transferwise/neptune-validation');
8
29
  var useDirection = require('../common/hooks/useDirection/useDirection.js');
9
- var position = require('../common/propsValues/position.js');
30
+ var Tooltip = require('../tooltip/Tooltip.js');
31
+ var deviceDetection = require('./deviceDetection.js');
10
32
 
11
33
  function clamp(from, to, value) {
12
34
  return Math.max(Math.min(to, value), from);
@@ -1 +1 @@
1
- {"version":3,"file":"Stepper.js","sources":["../../src/stepper/Stepper.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport * as React from 'react';\n\nimport { Position } from '../common';\nimport { useDirection } from '../common/hooks';\nimport Tooltip from '../tooltip';\n\nimport { isTouchDevice } from './deviceDetection';\n\nfunction clamp(from: number, to: number, value: number) {\n return Math.max(Math.min(to, value), from);\n}\n\nexport interface Step {\n label: React.ReactNode;\n onClick?: () => void;\n hoverLabel?: React.ReactNode;\n}\n\nexport interface StepperProps {\n steps: readonly Step[];\n activeStep?: number;\n className?: string;\n}\n\n/**\n * This component is considered user-unfriendly and inaccessible on its own and will likely be made internal in the future. Please use `FlowNavigation` instead.\n * @see https://storybook.wise.design/?path=/story/navigation-flownavigation--variants\n */\nconst Stepper = ({ steps, activeStep = 0, className }: StepperProps) => {\n const { isRTL } = useDirection();\n\n if (steps.length === 0) {\n return null;\n }\n\n const activeStepIndex = clamp(0, steps.length - 1, activeStep);\n const stepPercentage = 1 / (steps.length - 1);\n const percentageCompleted = activeStepIndex / (steps.length - 1);\n\n const getProgressWidth = (): string => {\n if (percentageCompleted === 0) {\n return '0px';\n }\n /**\n * Progress bar starts with left/right (depends on rtl) shift `--progress-bar-start-shift` for hiding Progress bar's left and right borders\n * which are used for progress vertical delimiter.\n * When progress is completed, we need to add `--progress-bar-border-width` to the width to allow the right border be outside of the progress area.\n */\n return `calc(${percentageCompleted * 100}% + var(--progress-bar-start-shift) + var(--progress-bar-border-width))`;\n };\n\n const renderStep = (step: Step, index: number) => {\n const active = index === activeStepIndex;\n const clickable = step.onClick && !active;\n\n const labelButton = clickable ? (\n <button\n type=\"button\"\n className=\"btn-unstyled tw-stepper__step-label\"\n onClick={() => clickable && step.onClick?.()}\n >\n <small>{step.label}</small>\n </button>\n ) : (\n <span className=\"tw-stepper__step-label\">{step.label}</span>\n );\n\n return (\n <li\n key={index}\n className={clsx(\n 'hidden-xs',\n 'tw-stepper__step',\n active ? 'np-text-body-default-bold tw-stepper__step--active' : 'np-text-body-default',\n clickable && 'tw-stepper__step--clickable',\n step.hoverLabel && 'tw-stepper__step--has-tooltip',\n )}\n aria-current={active ? 'step' : false}\n style={\n isRTL\n ? { right: `${index * stepPercentage * 100}%` }\n : { left: `${index * stepPercentage * 100}%` }\n }\n >\n {step.hoverLabel && !isTouchDevice() ? (\n <Tooltip position={Position.BOTTOM} label={step.hoverLabel}>\n {labelButton}\n </Tooltip>\n ) : (\n labelButton\n )}\n </li>\n );\n };\n\n return (\n <div className={clsx('tw-stepper', className)}>\n <div className=\"progress\">\n <div className=\"progress-bar\" style={{ width: getProgressWidth() }} />\n </div>\n <ol className=\"tw-stepper-steps p-t-1 m-b-0\">{steps.map(renderStep)}</ol>\n </div>\n );\n};\n\nexport default Stepper;\n"],"names":["clamp","from","to","value","Math","max","min","Stepper","steps","activeStep","className","isRTL","useDirection","length","activeStepIndex","stepPercentage","percentageCompleted","getProgressWidth","renderStep","step","index","active","clickable","onClick","labelButton","_jsx","type","children","label","clsx","hoverLabel","style","right","left","isTouchDevice","Tooltip","position","Position","BOTTOM","_jsxs","width","map"],"mappings":";;;;;;;;;;AASA,SAASA,KAAKA,CAACC,IAAY,EAAEC,EAAU,EAAEC,KAAa,EAAA;AACpD,EAAA,OAAOC,IAAI,CAACC,GAAG,CAACD,IAAI,CAACE,GAAG,CAACJ,EAAE,EAAEC,KAAK,CAAC,EAAEF,IAAI,CAAC,CAAA;AAC5C,CAAA;AAcA;;;AAGG;AACGM,MAAAA,OAAO,GAAGA,CAAC;EAAEC,KAAK;AAAEC,EAAAA,UAAU,GAAG,CAAC;AAAEC,EAAAA,SAAAA;AAAS,CAAgB,KAAI;EACrE,MAAM;AAAEC,IAAAA,KAAAA;GAAO,GAAGC,yBAAY,EAAE,CAAA;AAEhC,EAAA,IAAIJ,KAAK,CAACK,MAAM,KAAK,CAAC,EAAE;AACtB,IAAA,OAAO,IAAI,CAAA;AACb,GAAA;AAEA,EAAA,MAAMC,eAAe,GAAGd,KAAK,CAAC,CAAC,EAAEQ,KAAK,CAACK,MAAM,GAAG,CAAC,EAAEJ,UAAU,CAAC,CAAA;EAC9D,MAAMM,cAAc,GAAG,CAAC,IAAIP,KAAK,CAAC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* as React from 'react';\n\nimport { Position } from '../common';\nimport { useDirection } from '../common/hooks';\nimport Tooltip from '../tooltip';\n\nimport { isTouchDevice } from './deviceDetection';\n\nfunction clamp(from: number, to: number, value: number) {\n return Math.max(Math.min(to, value), from);\n}\n\nexport interface Step {\n label: React.ReactNode;\n onClick?: () => void;\n hoverLabel?: React.ReactNode;\n}\n\nexport interface StepperProps {\n steps: readonly Step[];\n activeStep?: number;\n className?: string;\n}\n\n/**\n * This component is considered user-unfriendly and inaccessible on its own and will likely be made internal in the future. Please use `FlowNavigation` instead.\n * @see https://storybook.wise.design/?path=/story/navigation-flownavigation--variants\n */\nconst Stepper = ({ steps, activeStep = 0, className }: StepperProps) => {\n const { isRTL } = useDirection();\n\n if (steps.length === 0) {\n return null;\n }\n\n const activeStepIndex = clamp(0, steps.length - 1, activeStep);\n const stepPercentage = 1 / (steps.length - 1);\n const percentageCompleted = activeStepIndex / (steps.length - 1);\n\n const getProgressWidth = (): string => {\n if (percentageCompleted === 0) {\n return '0px';\n }\n /**\n * Progress bar starts with left/right (depends on rtl) shift `--progress-bar-start-shift` for hiding Progress bar's left and right borders\n * which are used for progress vertical delimiter.\n * When progress is completed, we need to add `--progress-bar-border-width` to the width to allow the right border be outside of the progress area.\n */\n return `calc(${percentageCompleted * 100}% + var(--progress-bar-start-shift) + var(--progress-bar-border-width))`;\n };\n\n const renderStep = (step: Step, index: number) => {\n const active = index === activeStepIndex;\n const clickable = step.onClick && !active;\n\n const labelButton = clickable ? (\n <button\n type=\"button\"\n className=\"btn-unstyled tw-stepper__step-label\"\n onClick={() => clickable && step.onClick?.()}\n >\n <small>{step.label}</small>\n </button>\n ) : (\n <span className=\"tw-stepper__step-label\">{step.label}</span>\n );\n\n return (\n <li\n key={index}\n className={clsx(\n 'hidden-xs',\n 'tw-stepper__step',\n active ? 'np-text-body-default-bold tw-stepper__step--active' : 'np-text-body-default',\n clickable && 'tw-stepper__step--clickable',\n step.hoverLabel && 'tw-stepper__step--has-tooltip',\n )}\n aria-current={active ? 'step' : false}\n style={\n isRTL\n ? { right: `${index * stepPercentage * 100}%` }\n : { left: `${index * stepPercentage * 100}%` }\n }\n >\n {step.hoverLabel && !isTouchDevice() ? (\n <Tooltip position={Position.BOTTOM} label={step.hoverLabel}>\n {labelButton}\n </Tooltip>\n ) : (\n labelButton\n )}\n </li>\n );\n };\n\n return (\n <div className={clsx('tw-stepper', className)}>\n <div className=\"progress\">\n <div className=\"progress-bar\" style={{ width: getProgressWidth() }} />\n </div>\n <ol className=\"tw-stepper-steps p-t-1 m-b-0\">{steps.map(renderStep)}</ol>\n </div>\n );\n};\n\nexport default Stepper;\n"],"names":["clamp","from","to","value","Math","max","min","Stepper","steps","activeStep","className","isRTL","useDirection","length","activeStepIndex","stepPercentage","percentageCompleted","getProgressWidth","renderStep","step","index","active","clickable","onClick","labelButton","_jsx","type","children","label","clsx","hoverLabel","style","right","left","isTouchDevice","Tooltip","position","Position","BOTTOM","_jsxs","width","map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,SAASA,KAAKA,CAACC,IAAY,EAAEC,EAAU,EAAEC,KAAa,EAAA;AACpD,EAAA,OAAOC,IAAI,CAACC,GAAG,CAACD,IAAI,CAACE,GAAG,CAACJ,EAAE,EAAEC,KAAK,CAAC,EAAEF,IAAI,CAAC,CAAA;AAC5C,CAAA;AAcA;;;AAGG;AACGM,MAAAA,OAAO,GAAGA,CAAC;EAAEC,KAAK;AAAEC,EAAAA,UAAU,GAAG,CAAC;AAAEC,EAAAA,SAAAA;AAAS,CAAgB,KAAI;EACrE,MAAM;AAAEC,IAAAA,KAAAA;GAAO,GAAGC,yBAAY,EAAE,CAAA;AAEhC,EAAA,IAAIJ,KAAK,CAACK,MAAM,KAAK,CAAC,EAAE;AACtB,IAAA,OAAO,IAAI,CAAA;AACb,GAAA;AAEA,EAAA,MAAMC,eAAe,GAAGd,KAAK,CAAC,CAAC,EAAEQ,KAAK,CAACK,MAAM,GAAG,CAAC,EAAEJ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32 @@
1
1
  import { clsx } from 'clsx';
2
2
  import 'react';
3
- import Tooltip from '../tooltip/Tooltip.mjs';
4
- import { isTouchDevice } from './deviceDetection.mjs';
3
+ import '../common/theme.mjs';
4
+ import '../common/direction.mjs';
5
+ import '../common/propsValues/control.mjs';
6
+ import '../common/propsValues/breakpoint.mjs';
7
+ import '../common/propsValues/size.mjs';
8
+ import '../common/propsValues/typography.mjs';
9
+ import '../common/propsValues/width.mjs';
10
+ import '../common/propsValues/type.mjs';
11
+ import '../common/propsValues/dateMode.mjs';
12
+ import '../common/propsValues/monthFormat.mjs';
13
+ import { Position } from '../common/propsValues/position.mjs';
14
+ import '../common/propsValues/layouts.mjs';
15
+ import '../common/propsValues/status.mjs';
16
+ import '../common/propsValues/sentiment.mjs';
17
+ import '../common/propsValues/profileType.mjs';
18
+ import '../common/propsValues/variant.mjs';
19
+ import '../common/propsValues/scroll.mjs';
20
+ import '../common/propsValues/markdownNodeType.mjs';
21
+ import '../common/fileType.mjs';
22
+ import '@transferwise/icons';
23
+ import 'react-intl';
24
+ import '../common/closeButton/CloseButton.messages.mjs';
5
25
  import { jsxs, jsx } from 'react/jsx-runtime';
26
+ import '@transferwise/neptune-validation';
6
27
  import { useDirection } from '../common/hooks/useDirection/useDirection.mjs';
7
- import { Position } from '../common/propsValues/position.mjs';
28
+ import Tooltip from '../tooltip/Tooltip.mjs';
29
+ import { isTouchDevice } from './deviceDetection.mjs';
8
30
 
9
31
  function clamp(from, to, value) {
10
32
  return Math.max(Math.min(to, value), from);
@@ -1 +1 @@
1
- {"version":3,"file":"Stepper.mjs","sources":["../../src/stepper/Stepper.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport * as React from 'react';\n\nimport { Position } from '../common';\nimport { useDirection } from '../common/hooks';\nimport Tooltip from '../tooltip';\n\nimport { isTouchDevice } from './deviceDetection';\n\nfunction clamp(from: number, to: number, value: number) {\n return Math.max(Math.min(to, value), from);\n}\n\nexport interface Step {\n label: React.ReactNode;\n onClick?: () => void;\n hoverLabel?: React.ReactNode;\n}\n\nexport interface StepperProps {\n steps: readonly Step[];\n activeStep?: number;\n className?: string;\n}\n\n/**\n * This component is considered user-unfriendly and inaccessible on its own and will likely be made internal in the future. Please use `FlowNavigation` instead.\n * @see https://storybook.wise.design/?path=/story/navigation-flownavigation--variants\n */\nconst Stepper = ({ steps, activeStep = 0, className }: StepperProps) => {\n const { isRTL } = useDirection();\n\n if (steps.length === 0) {\n return null;\n }\n\n const activeStepIndex = clamp(0, steps.length - 1, activeStep);\n const stepPercentage = 1 / (steps.length - 1);\n const percentageCompleted = activeStepIndex / (steps.length - 1);\n\n const getProgressWidth = (): string => {\n if (percentageCompleted === 0) {\n return '0px';\n }\n /**\n * Progress bar starts with left/right (depends on rtl) shift `--progress-bar-start-shift` for hiding Progress bar's left and right borders\n * which are used for progress vertical delimiter.\n * When progress is completed, we need to add `--progress-bar-border-width` to the width to allow the right border be outside of the progress area.\n */\n return `calc(${percentageCompleted * 100}% + var(--progress-bar-start-shift) + var(--progress-bar-border-width))`;\n };\n\n const renderStep = (step: Step, index: number) => {\n const active = index === activeStepIndex;\n const clickable = step.onClick && !active;\n\n const labelButton = clickable ? (\n <button\n type=\"button\"\n className=\"btn-unstyled tw-stepper__step-label\"\n onClick={() => clickable && step.onClick?.()}\n >\n <small>{step.label}</small>\n </button>\n ) : (\n <span className=\"tw-stepper__step-label\">{step.label}</span>\n );\n\n return (\n <li\n key={index}\n className={clsx(\n 'hidden-xs',\n 'tw-stepper__step',\n active ? 'np-text-body-default-bold tw-stepper__step--active' : 'np-text-body-default',\n clickable && 'tw-stepper__step--clickable',\n step.hoverLabel && 'tw-stepper__step--has-tooltip',\n )}\n aria-current={active ? 'step' : false}\n style={\n isRTL\n ? { right: `${index * stepPercentage * 100}%` }\n : { left: `${index * stepPercentage * 100}%` }\n }\n >\n {step.hoverLabel && !isTouchDevice() ? (\n <Tooltip position={Position.BOTTOM} label={step.hoverLabel}>\n {labelButton}\n </Tooltip>\n ) : (\n labelButton\n )}\n </li>\n );\n };\n\n return (\n <div className={clsx('tw-stepper', className)}>\n <div className=\"progress\">\n <div className=\"progress-bar\" style={{ width: getProgressWidth() }} />\n </div>\n <ol className=\"tw-stepper-steps p-t-1 m-b-0\">{steps.map(renderStep)}</ol>\n </div>\n );\n};\n\nexport default Stepper;\n"],"names":["clamp","from","to","value","Math","max","min","Stepper","steps","activeStep","className","isRTL","useDirection","length","activeStepIndex","stepPercentage","percentageCompleted","getProgressWidth","renderStep","step","index","active","clickable","onClick","labelButton","_jsx","type","children","label","clsx","hoverLabel","style","right","left","isTouchDevice","Tooltip","position","Position","BOTTOM","_jsxs","width","map"],"mappings":";;;;;;;;AASA,SAASA,KAAKA,CAACC,IAAY,EAAEC,EAAU,EAAEC,KAAa,EAAA;AACpD,EAAA,OAAOC,IAAI,CAACC,GAAG,CAACD,IAAI,CAACE,GAAG,CAACJ,EAAE,EAAEC,KAAK,CAAC,EAAEF,IAAI,CAAC,CAAA;AAC5C,CAAA;AAcA;;;AAGG;AACGM,MAAAA,OAAO,GAAGA,CAAC;EAAEC,KAAK;AAAEC,EAAAA,UAAU,GAAG,CAAC;AAAEC,EAAAA,SAAAA;AAAS,CAAgB,KAAI;EACrE,MAAM;AAAEC,IAAAA,KAAAA;GAAO,GAAGC,YAAY,EAAE,CAAA;AAEhC,EAAA,IAAIJ,KAAK,CAACK,MAAM,KAAK,CAAC,EAAE;AACtB,IAAA,OAAO,IAAI,CAAA;AACb,GAAA;AAEA,EAAA,MAAMC,eAAe,GAAGd,KAAK,CAAC,CAAC,EAAEQ,KAAK,CAACK,MAAM,GAAG,CAAC,EAAEJ,UAAU,CAAC,CAAA;EAC9D,MAAMM,cAAc,GAAG,CAAC,IAAIP,KAAK,CAACK,MAAM,GAAG,CAAC,CAAC,CAAA;EAC7C,MAAMG,mBAAmB,GAAGF,eAAe,IAAIN,KAAK,CAACK,MAAM,GAAG,CAAC,CAAC,CAAA;EAEhE,MAAMI,gBAAgB,GAAGA,MAA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AA;AAAK,OAAA,GAC7C;AAAEkB,QAAAA,IAAI,EAAE,CAAGb,EAAAA,KAAK,GAAGL,cAAc,GAAG,GAAG,CAAA,CAAA,CAAA;OAC5C;AAAAY,MAAAA,QAAA,EAEAR,IAAI,CAACW,UAAU,IAAI,CAACI,aAAa,EAAE,gBAClCT,GAAA,CAACU,OAAO,EAAA;QAACC,QAAQ,EAAEC,QAAQ,CAACC,MAAO;QAACV,KAAK,EAAET,IAAI,CAACW,UAAW;AAAAH,QAAAA,QAAA,EACxDH,WAAAA;AAAW,OACL,CAAC,GAEVA,WAAAA;AACD,KAAA,EArBIJ,KAsBH,CAAC,CAAA;GAER,CAAA;AAED,EAAA,oBACEmB,IAAA,CAAA,KAAA,EAAA;AAAK7B,IAAAA,SAAS,EAAEmB,IAAI,CAAC,YAAY,EAAEnB,SAAS,CAAE;AAAAiB,IAAAA,QAAA,gBAC5CF,GAAA,CAAA,KAAA,EAAA;AAAKf,MAAAA,SAAS,EAAC,UAAU;AAAAiB,MAAAA,QAAA,eACvBF,GAAA,CAAA,KAAA,EAAA;AAAKf,QAAAA,SAAS,EAAC,cAAc;AAACqB,QAAAA,KAAK,EAAE;UAAES,KAAK,EAAEvB,gBAAgB,EAAE;AAAA,SAAA;OAClE,CAAA;KAAK,CACL,eAAAQ,GAAA,CAAA,IAAA,EAAA;AAAIf,MAAAA,SAAS,EAAC,8BAA8B;AAAAiB,MAAAA,QAAA,EAAEnB,KAAK,CAACiC,GAAG,CAACvB,UAAU,CAAA;AAAC,KAAK,CAC1E,CAAA;AAAA,GAAK,CAAC,CAAA;AAEV;;;;"}
1
+ {"version":3,"file":"Stepper.mjs","sources":["../../src/stepper/Stepper.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport * as React from 'react';\n\nimport { Position } from '../common';\nimport { useDirection } from '../common/hooks';\nimport Tooltip from '../tooltip';\n\nimport { isTouchDevice } from './deviceDetection';\n\nfunction clamp(from: number, to: number, value: number) {\n return Math.max(Math.min(to, value), from);\n}\n\nexport interface Step {\n label: React.ReactNode;\n onClick?: () => void;\n hoverLabel?: React.ReactNode;\n}\n\nexport interface StepperProps {\n steps: readonly Step[];\n activeStep?: number;\n className?: string;\n}\n\n/**\n * This component is considered user-unfriendly and inaccessible on its own and will likely be made internal in the future. Please use `FlowNavigation` instead.\n * @see https://storybook.wise.design/?path=/story/navigation-flownavigation--variants\n */\nconst Stepper = ({ steps, activeStep = 0, className }: StepperProps) => {\n const { isRTL } = useDirection();\n\n if (steps.length === 0) {\n return null;\n }\n\n const activeStepIndex = clamp(0, steps.length - 1, activeStep);\n const stepPercentage = 1 / (steps.length - 1);\n const percentageCompleted = activeStepIndex / (steps.length - 1);\n\n const getProgressWidth = (): string => {\n if (percentageCompleted === 0) {\n return '0px';\n }\n /**\n * Progress bar starts with left/right (depends on rtl) shift `--progress-bar-start-shift` for hiding Progress bar's left and right borders\n * which are used for progress vertical delimiter.\n * When progress is completed, we need to add `--progress-bar-border-width` to the width to allow the right border be outside of the progress area.\n */\n return `calc(${percentageCompleted * 100}% + var(--progress-bar-start-shift) + var(--progress-bar-border-width))`;\n };\n\n const renderStep = (step: Step, index: number) => {\n const active = index === activeStepIndex;\n const clickable = step.onClick && !active;\n\n const labelButton = clickable ? (\n <button\n type=\"button\"\n className=\"btn-unstyled tw-stepper__step-label\"\n onClick={() => clickable && step.onClick?.()}\n >\n <small>{step.label}</small>\n </button>\n ) : (\n <span className=\"tw-stepper__step-label\">{step.label}</span>\n );\n\n return (\n <li\n key={index}\n className={clsx(\n 'hidden-xs',\n 'tw-stepper__step',\n active ? 'np-text-body-default-bold tw-stepper__step--active' : 'np-text-body-default',\n clickable && 'tw-stepper__step--clickable',\n step.hoverLabel && 'tw-stepper__step--has-tooltip',\n )}\n aria-current={active ? 'step' : false}\n style={\n isRTL\n ? { right: `${index * stepPercentage * 100}%` }\n : { left: `${index * stepPercentage * 100}%` }\n }\n >\n {step.hoverLabel && !isTouchDevice() ? (\n <Tooltip position={Position.BOTTOM} label={step.hoverLabel}>\n {labelButton}\n </Tooltip>\n ) : (\n labelButton\n )}\n </li>\n );\n };\n\n return (\n <div className={clsx('tw-stepper', className)}>\n <div className=\"progress\">\n <div className=\"progress-bar\" style={{ width: getProgressWidth() }} />\n </div>\n <ol className=\"tw-stepper-steps p-t-1 m-b-0\">{steps.map(renderStep)}</ol>\n </div>\n );\n};\n\nexport default Stepper;\n"],"names":["clamp","from","to","value","Math","max","min","Stepper","steps","activeStep","className","isRTL","useDirection","length","activeStepIndex","stepPercentage","percentageCompleted","getProgressWidth","renderStep","step","index","active","clickable","onClick","labelButton","_jsx","type","children","label","clsx","hoverLabel","style","right","left","isTouchDevice","Tooltip","position","Position","BOTTOM","_jsxs","width","map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,SAASA,KAAKA,CAACC,IAAY,EAAEC,EAAU,EAAEC,KAAa,EAAA;AACpD,EAAA,OAAOC,IAAI,CAACC,GAAG,CAACD,IAAI,CAACE,GAAG,CAACJ,EAAE,EAAEC,KAAK,CAAC,EAAEF,IAAI,CAAC,CAAA;AAC5C,CAAA;AAcA;;;AAGG;AACGM,MAAAA,OAAO,GAAGA,CAAC;EAAEC,KAAK;AAAEC,EAAAA,UAAU,GAAG,CAAC;AAAEC,EAAAA,SAAAA;AAAS,CAAgB,KAAI;EACrE,MAAM;AAAEC,IAAAA,KAAAA;GAAO,GAAGC,YAAY,EAAE,CAAA;AAEhC,EAAA,IAAIJ,KAAK,CAACK,MAAM,KAAK,CAAC,EAAE;AACtB,IAAA,OAAO,IAAI,CAAA;AACb,GAAA;AAEA,EAAA,MAAMC,eAAe,GAAGd,KAAK,CAAC,CAAC,EAAEQ,KAAK,CAACK,MAAM,GAAG,CAAC,EAAEJ,UAAU,CAAC,CAAA;EAC9D,MAAMM,cAAc,GAAG,CAAC,IAAIP,KAAK,CAACK,MAAM,GAAG,CAAC,CAAC,CAAA;EAC7C,MAAMG,mBAAmB,GAAGF,eAAe,IAAIN,KAAK,CAAC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AAE,CAAGZ,EAAAA,KAAK,GAAGL,cAAc,GAAG,GAAG,CAAA,CAAA,CAAA;AAAK,OAAA,GAC7C;AAAEkB,QAAAA,IAAI,EAAE,CAAGb,EAAAA,KAAK,GAAGL,cAAc,GAAG,GAAG,CAAA,CAAA,CAAA;OAC5C;AAAAY,MAAAA,QAAA,EAEAR,IAAI,CAACW,UAAU,IAAI,CAACI,aAAa,EAAE,gBAClCT,GAAA,CAACU,OAAO,EAAA;QAACC,QAAQ,EAAEC,QAAQ,CAACC,MAAO;QAACV,KAAK,EAAET,IAAI,CAACW,UAAW;AAAAH,QAAAA,QAAA,EACxDH,WAAAA;AAAW,OACL,CAAC,GAEVA,WAAAA;AACD,KAAA,EArBIJ,KAsBH,CAAC,CAAA;GAER,CAAA;AAED,EAAA,oBACEmB,IAAA,CAAA,KAAA,EAAA;AAAK7B,IAAAA,SAAS,EAAEmB,IAAI,CAAC,YAAY,EAAEnB,SAAS,CAAE;AAAAiB,IAAAA,QAAA,gBAC5CF,GAAA,CAAA,KAAA,EAAA;AAAKf,MAAAA,SAAS,EAAC,UAAU;AAAAiB,MAAAA,QAAA,eACvBF,GAAA,CAAA,KAAA,EAAA;AAAKf,QAAAA,SAAS,EAAC,cAAc;AAACqB,QAAAA,KAAK,EAAE;UAAES,KAAK,EAAEvB,gBAAgB,EAAE;AAAA,SAAA;OAClE,CAAA;KAAK,CACL,eAAAQ,GAAA,CAAA,IAAA,EAAA;AAAIf,MAAAA,SAAS,EAAC,8BAA8B;AAAAiB,MAAAA,QAAA,EAAEnB,KAAK,CAACiC,GAAG,CAACvB,UAAU,CAAA;AAAC,KAAK,CAC1E,CAAA;AAAA,GAAK,CAAC,CAAA;AAEV;;;;"}
@@ -3,14 +3,13 @@
3
3
  function supportsTouchEvents() {
4
4
  const onTouchStartIsDefined = typeof window !== 'undefined' && window.ontouchstart !== undefined;
5
5
  const maxTouchPointsIsDefined = typeof navigator !== 'undefined' && navigator.maxTouchPoints;
6
- const documentTouchIsDefined = typeof window !== 'undefined' && window.DocumentTouch && document instanceof window.DocumentTouch;
7
- return !!(onTouchStartIsDefined || maxTouchPointsIsDefined || documentTouchIsDefined);
6
+ return !!(onTouchStartIsDefined || maxTouchPointsIsDefined);
8
7
  }
9
8
  function userAgentSuggestsTouchDevice() {
10
9
  const sampleTouchDevices = ['android', 'iemobile', 'iphone', 'ipad', 'ipod', 'blackberry', 'bada'];
11
10
  const matchString = sampleTouchDevices.map(device => `(${device})`).join('|');
12
11
  const regex = new RegExp(matchString, 'gi');
13
- return typeof navigator !== 'undefined' && !!navigator.userAgent.match(regex);
12
+ return typeof navigator !== 'undefined' && !!regex.test(navigator.userAgent);
14
13
  }
15
14
  // Important: this is not fool-proof! It gives false positives and negatives, and will be outdated.
16
15
  // Only use this for small vanity changes where it still works either way.
@@ -1 +1 @@
1
- {"version":3,"file":"deviceDetection.js","sources":["../../src/stepper/deviceDetection.js"],"sourcesContent":["function supportsTouchEvents() {\n const onTouchStartIsDefined = typeof window !== 'undefined' && window.ontouchstart !== undefined;\n const maxTouchPointsIsDefined = typeof navigator !== 'undefined' && navigator.maxTouchPoints;\n const documentTouchIsDefined =\n typeof window !== 'undefined' &&\n window.DocumentTouch &&\n document instanceof window.DocumentTouch;\n\n return !!(onTouchStartIsDefined || maxTouchPointsIsDefined || documentTouchIsDefined);\n}\n\nfunction userAgentSuggestsTouchDevice() {\n const sampleTouchDevices = [\n 'android',\n 'iemobile',\n 'iphone',\n 'ipad',\n 'ipod',\n 'blackberry',\n 'bada',\n ];\n const matchString = sampleTouchDevices.map((device) => `(${device})`).join('|');\n const regex = new RegExp(matchString, 'gi');\n return typeof navigator !== 'undefined' && !!navigator.userAgent.match(regex);\n}\n// Important: this is not fool-proof! It gives false positives and negatives, and will be outdated.\n// Only use this for small vanity changes where it still works either way.\nexport function isTouchDevice() {\n return supportsTouchEvents() || userAgentSuggestsTouchDevice();\n}\n"],"names":["supportsTouchEvents","onTouchStartIsDefined","window","ontouchstart","undefined","maxTouchPointsIsDefined","navigator","maxTouchPoints","documentTouchIsDefined","DocumentTouch","document","userAgentSuggestsTouchDevice","sampleTouchDevices","matchString","map","device","join","regex","RegExp","userAgent","match","isTouchDevice"],"mappings":";;AAAA,SAASA,mBAAmBA,GAAG;EAC7B,MAAMC,qBAAqB,GAAG,OAAOC,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACC,YAAY,KAAKC,SAAS,CAAA;EAChG,MAAMC,uBAAuB,GAAG,OAAOC,SAAS,KAAK,WAAW,IAAIA,SAAS,CAACC,cAAc,CAAA;AAC5F,EAAA,MAAMC,sBAAsB,GAC1B,OAAON,MAAM,KAAK,WAAW,IAC7BA,MAAM,CAACO,aAAa,IACpBC,QAAQ,YAAYR,MAAM,CAACO,aAAa,CAAA;AAE1C,EAAA,OAAO,CAAC,EAAER,qBAAqB,IAAII,uBAAuB,IAAIG,sBAAsB,CAAC,CAAA;AACvF,CAAA;AAEA,SAASG,4BAA4BA,GAAG;AACtC,EAAA,MAAMC,kBAAkB,GAAG,CACzB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,MAAM,EACN,YAAY,EACZ,MAAM,CACP,CAAA;AACD,EAAA,MAAMC,WAAW,GAAGD,kBAAkB,CAACE,GAAG,CAAEC,MAAM,IAAK,CAAIA,CAAAA,EAAAA,MAAM,GAAG,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAA;EAC/E,MAAMC,KAAK,GAAG,IAAIC,MAAM,CAACL,WAAW,EAAE,IAAI,CAAC,CAAA;AAC3C,EAAA,OAAO,OAAOP,SAAS,KAAK,WAAW,IAAI,CAAC,CAACA,SAAS,CAACa,SAAS,CAACC,KAAK,CAACH,KAAK,CAAC,CAAA;AAC/E,CAAA;AACA;AACA;AACO,SAASI,aAAaA,GAAG;AAC9B,EAAA,OAAOrB,mBAAmB,EAAE,IAAIW,4BAA4B,EAAE,CAAA;AAChE;;;;"}
1
+ {"version":3,"file":"deviceDetection.js","sources":["../../src/stepper/deviceDetection.ts"],"sourcesContent":["function supportsTouchEvents() {\n const onTouchStartIsDefined = typeof window !== 'undefined' && window.ontouchstart !== undefined;\n const maxTouchPointsIsDefined = typeof navigator !== 'undefined' && navigator.maxTouchPoints;\n\n return !!(onTouchStartIsDefined || maxTouchPointsIsDefined);\n}\n\nfunction userAgentSuggestsTouchDevice() {\n const sampleTouchDevices = [\n 'android',\n 'iemobile',\n 'iphone',\n 'ipad',\n 'ipod',\n 'blackberry',\n 'bada',\n ];\n const matchString = sampleTouchDevices.map((device) => `(${device})`).join('|');\n const regex = new RegExp(matchString, 'gi');\n return typeof navigator !== 'undefined' && !!regex.test(navigator.userAgent);\n}\n// Important: this is not fool-proof! It gives false positives and negatives, and will be outdated.\n// Only use this for small vanity changes where it still works either way.\nexport function isTouchDevice() {\n return supportsTouchEvents() || userAgentSuggestsTouchDevice();\n}\n"],"names":["supportsTouchEvents","onTouchStartIsDefined","window","ontouchstart","undefined","maxTouchPointsIsDefined","navigator","maxTouchPoints","userAgentSuggestsTouchDevice","sampleTouchDevices","matchString","map","device","join","regex","RegExp","test","userAgent","isTouchDevice"],"mappings":";;AAAA,SAASA,mBAAmBA,GAAA;EAC1B,MAAMC,qBAAqB,GAAG,OAAOC,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACC,YAAY,KAAKC,SAAS,CAAA;EAChG,MAAMC,uBAAuB,GAAG,OAAOC,SAAS,KAAK,WAAW,IAAIA,SAAS,CAACC,cAAc,CAAA;AAE5F,EAAA,OAAO,CAAC,EAAEN,qBAAqB,IAAII,uBAAuB,CAAC,CAAA;AAC7D,CAAA;AAEA,SAASG,4BAA4BA,GAAA;AACnC,EAAA,MAAMC,kBAAkB,GAAG,CACzB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,MAAM,EACN,YAAY,EACZ,MAAM,CACP,CAAA;AACD,EAAA,MAAMC,WAAW,GAAGD,kBAAkB,CAACE,GAAG,CAAEC,MAAM,IAAK,CAAIA,CAAAA,EAAAA,MAAM,GAAG,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAA;EAC/E,MAAMC,KAAK,GAAG,IAAIC,MAAM,CAACL,WAAW,EAAE,IAAI,CAAC,CAAA;AAC3C,EAAA,OAAO,OAAOJ,SAAS,KAAK,WAAW,IAAI,CAAC,CAACQ,KAAK,CAACE,IAAI,CAACV,SAAS,CAACW,SAAS,CAAC,CAAA;AAC9E,CAAA;AACA;AACA;SACgBC,aAAaA,GAAA;AAC3B,EAAA,OAAOlB,mBAAmB,EAAE,IAAIQ,4BAA4B,EAAE,CAAA;AAChE;;;;"}
@@ -1,14 +1,13 @@
1
1
  function supportsTouchEvents() {
2
2
  const onTouchStartIsDefined = typeof window !== 'undefined' && window.ontouchstart !== undefined;
3
3
  const maxTouchPointsIsDefined = typeof navigator !== 'undefined' && navigator.maxTouchPoints;
4
- const documentTouchIsDefined = typeof window !== 'undefined' && window.DocumentTouch && document instanceof window.DocumentTouch;
5
- return !!(onTouchStartIsDefined || maxTouchPointsIsDefined || documentTouchIsDefined);
4
+ return !!(onTouchStartIsDefined || maxTouchPointsIsDefined);
6
5
  }
7
6
  function userAgentSuggestsTouchDevice() {
8
7
  const sampleTouchDevices = ['android', 'iemobile', 'iphone', 'ipad', 'ipod', 'blackberry', 'bada'];
9
8
  const matchString = sampleTouchDevices.map(device => `(${device})`).join('|');
10
9
  const regex = new RegExp(matchString, 'gi');
11
- return typeof navigator !== 'undefined' && !!navigator.userAgent.match(regex);
10
+ return typeof navigator !== 'undefined' && !!regex.test(navigator.userAgent);
12
11
  }
13
12
  // Important: this is not fool-proof! It gives false positives and negatives, and will be outdated.
14
13
  // Only use this for small vanity changes where it still works either way.
@@ -1 +1 @@
1
- {"version":3,"file":"deviceDetection.mjs","sources":["../../src/stepper/deviceDetection.js"],"sourcesContent":["function supportsTouchEvents() {\n const onTouchStartIsDefined = typeof window !== 'undefined' && window.ontouchstart !== undefined;\n const maxTouchPointsIsDefined = typeof navigator !== 'undefined' && navigator.maxTouchPoints;\n const documentTouchIsDefined =\n typeof window !== 'undefined' &&\n window.DocumentTouch &&\n document instanceof window.DocumentTouch;\n\n return !!(onTouchStartIsDefined || maxTouchPointsIsDefined || documentTouchIsDefined);\n}\n\nfunction userAgentSuggestsTouchDevice() {\n const sampleTouchDevices = [\n 'android',\n 'iemobile',\n 'iphone',\n 'ipad',\n 'ipod',\n 'blackberry',\n 'bada',\n ];\n const matchString = sampleTouchDevices.map((device) => `(${device})`).join('|');\n const regex = new RegExp(matchString, 'gi');\n return typeof navigator !== 'undefined' && !!navigator.userAgent.match(regex);\n}\n// Important: this is not fool-proof! It gives false positives and negatives, and will be outdated.\n// Only use this for small vanity changes where it still works either way.\nexport function isTouchDevice() {\n return supportsTouchEvents() || userAgentSuggestsTouchDevice();\n}\n"],"names":["supportsTouchEvents","onTouchStartIsDefined","window","ontouchstart","undefined","maxTouchPointsIsDefined","navigator","maxTouchPoints","documentTouchIsDefined","DocumentTouch","document","userAgentSuggestsTouchDevice","sampleTouchDevices","matchString","map","device","join","regex","RegExp","userAgent","match","isTouchDevice"],"mappings":"AAAA,SAASA,mBAAmBA,GAAG;EAC7B,MAAMC,qBAAqB,GAAG,OAAOC,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACC,YAAY,KAAKC,SAAS,CAAA;EAChG,MAAMC,uBAAuB,GAAG,OAAOC,SAAS,KAAK,WAAW,IAAIA,SAAS,CAACC,cAAc,CAAA;AAC5F,EAAA,MAAMC,sBAAsB,GAC1B,OAAON,MAAM,KAAK,WAAW,IAC7BA,MAAM,CAACO,aAAa,IACpBC,QAAQ,YAAYR,MAAM,CAACO,aAAa,CAAA;AAE1C,EAAA,OAAO,CAAC,EAAER,qBAAqB,IAAII,uBAAuB,IAAIG,sBAAsB,CAAC,CAAA;AACvF,CAAA;AAEA,SAASG,4BAA4BA,GAAG;AACtC,EAAA,MAAMC,kBAAkB,GAAG,CACzB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,MAAM,EACN,YAAY,EACZ,MAAM,CACP,CAAA;AACD,EAAA,MAAMC,WAAW,GAAGD,kBAAkB,CAACE,GAAG,CAAEC,MAAM,IAAK,CAAIA,CAAAA,EAAAA,MAAM,GAAG,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAA;EAC/E,MAAMC,KAAK,GAAG,IAAIC,MAAM,CAACL,WAAW,EAAE,IAAI,CAAC,CAAA;AAC3C,EAAA,OAAO,OAAOP,SAAS,KAAK,WAAW,IAAI,CAAC,CAACA,SAAS,CAACa,SAAS,CAACC,KAAK,CAACH,KAAK,CAAC,CAAA;AAC/E,CAAA;AACA;AACA;AACO,SAASI,aAAaA,GAAG;AAC9B,EAAA,OAAOrB,mBAAmB,EAAE,IAAIW,4BAA4B,EAAE,CAAA;AAChE;;;;"}
1
+ {"version":3,"file":"deviceDetection.mjs","sources":["../../src/stepper/deviceDetection.ts"],"sourcesContent":["function supportsTouchEvents() {\n const onTouchStartIsDefined = typeof window !== 'undefined' && window.ontouchstart !== undefined;\n const maxTouchPointsIsDefined = typeof navigator !== 'undefined' && navigator.maxTouchPoints;\n\n return !!(onTouchStartIsDefined || maxTouchPointsIsDefined);\n}\n\nfunction userAgentSuggestsTouchDevice() {\n const sampleTouchDevices = [\n 'android',\n 'iemobile',\n 'iphone',\n 'ipad',\n 'ipod',\n 'blackberry',\n 'bada',\n ];\n const matchString = sampleTouchDevices.map((device) => `(${device})`).join('|');\n const regex = new RegExp(matchString, 'gi');\n return typeof navigator !== 'undefined' && !!regex.test(navigator.userAgent);\n}\n// Important: this is not fool-proof! It gives false positives and negatives, and will be outdated.\n// Only use this for small vanity changes where it still works either way.\nexport function isTouchDevice() {\n return supportsTouchEvents() || userAgentSuggestsTouchDevice();\n}\n"],"names":["supportsTouchEvents","onTouchStartIsDefined","window","ontouchstart","undefined","maxTouchPointsIsDefined","navigator","maxTouchPoints","userAgentSuggestsTouchDevice","sampleTouchDevices","matchString","map","device","join","regex","RegExp","test","userAgent","isTouchDevice"],"mappings":"AAAA,SAASA,mBAAmBA,GAAA;EAC1B,MAAMC,qBAAqB,GAAG,OAAOC,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACC,YAAY,KAAKC,SAAS,CAAA;EAChG,MAAMC,uBAAuB,GAAG,OAAOC,SAAS,KAAK,WAAW,IAAIA,SAAS,CAACC,cAAc,CAAA;AAE5F,EAAA,OAAO,CAAC,EAAEN,qBAAqB,IAAII,uBAAuB,CAAC,CAAA;AAC7D,CAAA;AAEA,SAASG,4BAA4BA,GAAA;AACnC,EAAA,MAAMC,kBAAkB,GAAG,CACzB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,MAAM,EACN,YAAY,EACZ,MAAM,CACP,CAAA;AACD,EAAA,MAAMC,WAAW,GAAGD,kBAAkB,CAACE,GAAG,CAAEC,MAAM,IAAK,CAAIA,CAAAA,EAAAA,MAAM,GAAG,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAA;EAC/E,MAAMC,KAAK,GAAG,IAAIC,MAAM,CAACL,WAAW,EAAE,IAAI,CAAC,CAAA;AAC3C,EAAA,OAAO,OAAOJ,SAAS,KAAK,WAAW,IAAI,CAAC,CAACQ,KAAK,CAACE,IAAI,CAACV,SAAS,CAACW,SAAS,CAAC,CAAA;AAC9E,CAAA;AACA;AACA;SACgBC,aAAaA,GAAA;AAC3B,EAAA,OAAOlB,mBAAmB,EAAE,IAAIQ,4BAA4B,EAAE,CAAA;AAChE;;;;"}
@@ -1,8 +1,31 @@
1
1
  'use strict';
2
2
 
3
- var SlidingPanel = require('../slidingPanel/SlidingPanel.js');
4
- var jsxRuntime = require('react/jsx-runtime');
3
+ require('../common/theme.js');
4
+ require('../common/direction.js');
5
+ require('../common/propsValues/control.js');
6
+ require('../common/propsValues/breakpoint.js');
7
+ require('../common/propsValues/size.js');
8
+ require('../common/propsValues/typography.js');
9
+ require('../common/propsValues/width.js');
10
+ require('../common/propsValues/type.js');
11
+ require('../common/propsValues/dateMode.js');
12
+ require('../common/propsValues/monthFormat.js');
5
13
  var position = require('../common/propsValues/position.js');
14
+ require('../common/propsValues/layouts.js');
15
+ require('../common/propsValues/status.js');
16
+ require('../common/propsValues/sentiment.js');
17
+ require('../common/propsValues/profileType.js');
18
+ require('../common/propsValues/variant.js');
19
+ require('../common/propsValues/scroll.js');
20
+ require('../common/propsValues/markdownNodeType.js');
21
+ require('../common/fileType.js');
22
+ require('@transferwise/icons');
23
+ require('clsx');
24
+ require('react');
25
+ require('react-intl');
26
+ require('../common/closeButton/CloseButton.messages.js');
27
+ var jsxRuntime = require('react/jsx-runtime');
28
+ var SlidingPanel = require('../slidingPanel/SlidingPanel.js');
6
29
 
7
30
  const Sticky = ({
8
31
  children,