@transferwise/components 0.0.0-experimental-033dd15 → 0.0.0-experimental-64ea603

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 (663) hide show
  1. package/build/accordion/Accordion.js +4 -2
  2. package/build/accordion/Accordion.js.map +1 -1
  3. package/build/accordion/AccordionItem/AccordionItem.js +6 -4
  4. package/build/accordion/AccordionItem/AccordionItem.js.map +1 -1
  5. package/build/actionButton/ActionButton.js +3 -1
  6. package/build/actionButton/ActionButton.js.map +1 -1
  7. package/build/actionOption/ActionOption.js +5 -3
  8. package/build/actionOption/ActionOption.js.map +1 -1
  9. package/build/alert/Alert.js +4 -4
  10. package/build/alert/Alert.js.map +1 -1
  11. package/build/alert/inlineMarkdown/InlineMarkdown.js +4 -2
  12. package/build/alert/inlineMarkdown/InlineMarkdown.js.map +1 -1
  13. package/build/avatar/Avatar.js +3 -1
  14. package/build/avatar/Avatar.js.map +1 -1
  15. package/build/avatarLayout/AvatarLayout.js +5 -3
  16. package/build/avatarLayout/AvatarLayout.js.map +1 -1
  17. package/build/avatarView/AvatarView.js +9 -7
  18. package/build/avatarView/AvatarView.js.map +1 -1
  19. package/build/avatarView/NotificationDot.js +3 -1
  20. package/build/avatarView/NotificationDot.js.map +1 -1
  21. package/build/avatarWrapper/AvatarWrapper.js +8 -6
  22. package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
  23. package/build/avatarWrapper/AvatarWrapper.mjs +1 -1
  24. package/build/avatarWrapper/index.js +3 -1
  25. package/build/avatarWrapper/index.js.map +1 -1
  26. package/build/badge/Badge.js +3 -1
  27. package/build/badge/Badge.js.map +1 -1
  28. package/build/badge/Badge.mjs.map +1 -1
  29. package/build/badge/BadgeAssets.js +9 -7
  30. package/build/badge/BadgeAssets.js.map +1 -1
  31. package/build/badge/BadgeAssets.mjs +2 -2
  32. package/build/badge/BadgeAssets.mjs.map +1 -1
  33. package/build/body/Body.js +3 -1
  34. package/build/body/Body.js.map +1 -1
  35. package/build/button/Button.js +8 -6
  36. package/build/button/Button.js.map +1 -1
  37. package/build/button/Button.resolver.js +5 -3
  38. package/build/button/Button.resolver.js.map +1 -1
  39. package/build/button/LegacyButton.js +5 -5
  40. package/build/button/LegacyButton.js.map +1 -1
  41. package/build/button/LegacyButton.mjs +0 -2
  42. package/build/button/LegacyButton.mjs.map +1 -1
  43. package/build/card/Card.js +6 -4
  44. package/build/card/Card.js.map +1 -1
  45. package/build/carousel/Carousel.js +8 -8
  46. package/build/carousel/Carousel.js.map +1 -1
  47. package/build/carousel/Carousel.mjs +1 -3
  48. package/build/carousel/Carousel.mjs.map +1 -1
  49. package/build/checkbox/Checkbox.js +6 -4
  50. package/build/checkbox/Checkbox.js.map +1 -1
  51. package/build/checkbox/Checkbox.mjs.map +1 -1
  52. package/build/checkboxButton/CheckboxButton.js +4 -2
  53. package/build/checkboxButton/CheckboxButton.js.map +1 -1
  54. package/build/checkboxButton/CheckboxButton.mjs +1 -1
  55. package/build/checkboxButton/CheckboxButton.mjs.map +1 -1
  56. package/build/checkboxOption/CheckboxOption.js +5 -3
  57. package/build/checkboxOption/CheckboxOption.js.map +1 -1
  58. package/build/checkboxOption/CheckboxOption.mjs.map +1 -1
  59. package/build/chevron/Chevron.js +3 -1
  60. package/build/chevron/Chevron.js.map +1 -1
  61. package/build/chips/Chip.js +4 -2
  62. package/build/chips/Chip.js.map +1 -1
  63. package/build/chips/Chips.js +5 -3
  64. package/build/chips/Chips.js.map +1 -1
  65. package/build/chips/Chips.messages.js +3 -1
  66. package/build/chips/Chips.messages.js.map +1 -1
  67. package/build/circularButton/CircularButton.js +5 -3
  68. package/build/circularButton/CircularButton.js.map +1 -1
  69. package/build/common/Option/Option.js +7 -5
  70. package/build/common/Option/Option.js.map +1 -1
  71. package/build/common/Option/Option.mjs +2 -2
  72. package/build/common/Option/Option.mjs.map +1 -1
  73. package/build/common/RadioButton/RadioButton.js +3 -1
  74. package/build/common/RadioButton/RadioButton.js.map +1 -1
  75. package/build/common/action/Action.js +2 -2
  76. package/build/common/action/Action.js.map +1 -1
  77. package/build/common/bottomSheet/BottomSheet.js +4 -2
  78. package/build/common/bottomSheet/BottomSheet.js.map +1 -1
  79. package/build/common/bottomSheet/BottomSheet.mjs.map +1 -1
  80. package/build/common/card/Card.js +3 -1
  81. package/build/common/card/Card.js.map +1 -1
  82. package/build/common/circle/Circle.js +3 -1
  83. package/build/common/circle/Circle.js.map +1 -1
  84. package/build/common/closeButton/CloseButton.js +1 -1
  85. package/build/common/closeButton/CloseButton.js.map +1 -1
  86. package/build/common/closeButton/CloseButton.messages.js +3 -1
  87. package/build/common/closeButton/CloseButton.messages.js.map +1 -1
  88. package/build/common/dateUtils/isDateValid/isDateValid.js +3 -3
  89. package/build/common/dateUtils/isDateValid/isDateValid.js.map +1 -1
  90. package/build/common/dateUtils/isDateValid/isDateValid.mjs +3 -3
  91. package/build/common/dateUtils/isDateValid/isDateValid.mjs.map +1 -1
  92. package/build/common/flowHeader/FlowHeader.js +3 -1
  93. package/build/common/flowHeader/FlowHeader.js.map +1 -1
  94. package/build/common/focusBoundary/FocusBoundary.js +3 -1
  95. package/build/common/focusBoundary/FocusBoundary.js.map +1 -1
  96. package/build/common/historyNavigator/historyNavigator.js +3 -1
  97. package/build/common/historyNavigator/historyNavigator.js.map +1 -1
  98. package/build/common/locale/index.js +0 -24
  99. package/build/common/locale/index.js.map +1 -1
  100. package/build/common/locale/index.mjs +0 -24
  101. package/build/common/locale/index.mjs.map +1 -1
  102. package/build/common/panel/Panel.js +6 -9
  103. package/build/common/panel/Panel.js.map +1 -1
  104. package/build/common/panel/Panel.mjs +3 -8
  105. package/build/common/panel/Panel.mjs.map +1 -1
  106. package/build/common/responsivePanel/ResponsivePanel.js +5 -3
  107. package/build/common/responsivePanel/ResponsivePanel.js.map +1 -1
  108. package/build/common/textFormat/formatWithPattern/formatWithPattern.js +4 -2
  109. package/build/common/textFormat/formatWithPattern/formatWithPattern.js.map +1 -1
  110. package/build/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.js +4 -2
  111. package/build/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.js.map +1 -1
  112. package/build/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js +4 -2
  113. package/build/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js.map +1 -1
  114. package/build/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js +2 -2
  115. package/build/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js.map +1 -1
  116. package/build/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js +3 -1
  117. package/build/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js.map +1 -1
  118. package/build/common/textFormat/unformatWithPattern/unformatWithPattern.js +3 -1
  119. package/build/common/textFormat/unformatWithPattern/unformatWithPattern.js.map +1 -1
  120. package/build/criticalBanner/CriticalCommsBanner.js +3 -1
  121. package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
  122. package/build/dateInput/DateInput.js +15 -13
  123. package/build/dateInput/DateInput.js.map +1 -1
  124. package/build/dateInput/DateInput.messages.js +3 -1
  125. package/build/dateInput/DateInput.messages.js.map +1 -1
  126. package/build/dateInput/DateInput.mjs +3 -3
  127. package/build/dateInput/DateInput.mjs.map +1 -1
  128. package/build/dateLookup/DateLookup.js +8 -6
  129. package/build/dateLookup/DateLookup.js.map +1 -1
  130. package/build/dateLookup/DateLookup.messages.js +3 -1
  131. package/build/dateLookup/DateLookup.messages.js.map +1 -1
  132. package/build/dateLookup/dateHeader/DateHeader.js +33 -26
  133. package/build/dateLookup/dateHeader/DateHeader.js.map +1 -1
  134. package/build/dateLookup/dateHeader/DateHeader.mjs +27 -22
  135. package/build/dateLookup/dateHeader/DateHeader.mjs.map +1 -1
  136. package/build/dateLookup/dateTrigger/DateTrigger.js +8 -6
  137. package/build/dateLookup/dateTrigger/DateTrigger.js.map +1 -1
  138. package/build/dateLookup/dateTrigger/DateTrigger.messages.js +4 -2
  139. package/build/dateLookup/dateTrigger/DateTrigger.messages.js.map +1 -1
  140. package/build/dateLookup/dateTrigger/DateTrigger.messages.mjs +2 -2
  141. package/build/dateLookup/dateTrigger/DateTrigger.messages.mjs.map +1 -1
  142. package/build/dateLookup/dateTrigger/DateTrigger.mjs +2 -2
  143. package/build/dateLookup/dateTrigger/DateTrigger.mjs.map +1 -1
  144. package/build/dateLookup/dayCalendar/DayCalendar.js +6 -4
  145. package/build/dateLookup/dayCalendar/DayCalendar.js.map +1 -1
  146. package/build/dateLookup/dayCalendar/table/DayCalendarTable.js +4 -2
  147. package/build/dateLookup/dayCalendar/table/DayCalendarTable.js.map +1 -1
  148. package/build/dateLookup/monthCalendar/MonthCalendar.js +6 -4
  149. package/build/dateLookup/monthCalendar/MonthCalendar.js.map +1 -1
  150. package/build/dateLookup/monthCalendar/table/MonthCalendarTable.js +4 -2
  151. package/build/dateLookup/monthCalendar/table/MonthCalendarTable.js.map +1 -1
  152. package/build/dateLookup/tableLink/TableLink.js +4 -2
  153. package/build/dateLookup/tableLink/TableLink.js.map +1 -1
  154. package/build/dateLookup/yearCalendar/YearCalendar.js +6 -4
  155. package/build/dateLookup/yearCalendar/YearCalendar.js.map +1 -1
  156. package/build/dateLookup/yearCalendar/table/YearCalendarTable.js +4 -2
  157. package/build/dateLookup/yearCalendar/table/YearCalendarTable.js.map +1 -1
  158. package/build/decision/Decision.js +2 -2
  159. package/build/decision/Decision.js.map +1 -1
  160. package/build/definitionList/DefinitionList.js +4 -2
  161. package/build/definitionList/DefinitionList.js.map +1 -1
  162. package/build/dimmer/Dimmer.js +3 -3
  163. package/build/dimmer/Dimmer.js.map +1 -1
  164. package/build/dimmer/dimmerManager/DimmerManager.js +3 -1
  165. package/build/dimmer/dimmerManager/DimmerManager.js.map +1 -1
  166. package/build/dimmer/dimmerManager/DimmerManager.mjs.map +1 -1
  167. package/build/display/Display.js +3 -1
  168. package/build/display/Display.js.map +1 -1
  169. package/build/divider/Divider.js +35 -0
  170. package/build/divider/Divider.js.map +1 -0
  171. package/build/divider/Divider.mjs +31 -0
  172. package/build/divider/Divider.mjs.map +1 -0
  173. package/build/drawer/Drawer.js +4 -2
  174. package/build/drawer/Drawer.js.map +1 -1
  175. package/build/dropFade/DropFade.js +3 -1
  176. package/build/dropFade/DropFade.js.map +1 -1
  177. package/build/dropFade/DropFade.mjs.map +1 -1
  178. package/build/emphasis/Emphasis.js +4 -2
  179. package/build/emphasis/Emphasis.js.map +1 -1
  180. package/build/emphasis/EmphasisHtmlTransformer.js +3 -1
  181. package/build/emphasis/EmphasisHtmlTransformer.js.map +1 -1
  182. package/build/emphasis/EmphasisHtmlTransformer.mjs.map +1 -1
  183. package/build/field/Field.js +1 -1
  184. package/build/field/Field.js.map +1 -1
  185. package/build/flowNavigation/FlowNavigation.js +8 -6
  186. package/build/flowNavigation/FlowNavigation.js.map +1 -1
  187. package/build/flowNavigation/FlowNavigation.messages.js +3 -1
  188. package/build/flowNavigation/FlowNavigation.messages.js.map +1 -1
  189. package/build/flowNavigation/animatedLabel/AnimatedLabel.js +5 -3
  190. package/build/flowNavigation/animatedLabel/AnimatedLabel.js.map +1 -1
  191. package/build/header/Header.js +83 -42
  192. package/build/header/Header.js.map +1 -1
  193. package/build/header/Header.mjs +76 -38
  194. package/build/header/Header.mjs.map +1 -1
  195. package/build/i18n/commonMessages/Button.messages.js +3 -1
  196. package/build/i18n/commonMessages/Button.messages.js.map +1 -1
  197. package/build/i18n/cs.json +22 -5
  198. package/build/i18n/cs.json.js +25 -6
  199. package/build/i18n/cs.json.js.map +1 -1
  200. package/build/i18n/cs.json.mjs +22 -5
  201. package/build/i18n/cs.json.mjs.map +1 -1
  202. package/build/i18n/de.json.js +3 -1
  203. package/build/i18n/de.json.js.map +1 -1
  204. package/build/i18n/en.json.js +3 -1
  205. package/build/i18n/en.json.js.map +1 -1
  206. package/build/i18n/es.json.js +3 -1
  207. package/build/i18n/es.json.js.map +1 -1
  208. package/build/i18n/fr.json.js +3 -1
  209. package/build/i18n/fr.json.js.map +1 -1
  210. package/build/i18n/hu.json.js +3 -1
  211. package/build/i18n/hu.json.js.map +1 -1
  212. package/build/i18n/id.json.js +3 -1
  213. package/build/i18n/id.json.js.map +1 -1
  214. package/build/i18n/index.js +22 -20
  215. package/build/i18n/index.js.map +1 -1
  216. package/build/i18n/it.json.js +3 -1
  217. package/build/i18n/it.json.js.map +1 -1
  218. package/build/i18n/ja.json.js +3 -1
  219. package/build/i18n/ja.json.js.map +1 -1
  220. package/build/i18n/nl.json +73 -0
  221. package/build/i18n/pl.json.js +3 -1
  222. package/build/i18n/pl.json.js.map +1 -1
  223. package/build/i18n/pt.json.js +3 -1
  224. package/build/i18n/pt.json.js.map +1 -1
  225. package/build/i18n/ro.json.js +3 -1
  226. package/build/i18n/ro.json.js.map +1 -1
  227. package/build/i18n/ru.json.js +3 -1
  228. package/build/i18n/ru.json.js.map +1 -1
  229. package/build/i18n/th.json.js +3 -1
  230. package/build/i18n/th.json.js.map +1 -1
  231. package/build/i18n/tr.json.js +3 -1
  232. package/build/i18n/tr.json.js.map +1 -1
  233. package/build/i18n/uk.json.js +3 -1
  234. package/build/i18n/uk.json.js.map +1 -1
  235. package/build/i18n/zh-CN.json.js +3 -1
  236. package/build/i18n/zh-CN.json.js.map +1 -1
  237. package/build/i18n/zh-HK.json.js +3 -1
  238. package/build/i18n/zh-HK.json.js.map +1 -1
  239. package/build/iconButton/IconButton.js +5 -3
  240. package/build/iconButton/IconButton.js.map +1 -1
  241. package/build/index.js +85 -84
  242. package/build/index.js.map +1 -1
  243. package/build/index.mjs +5 -4
  244. package/build/index.mjs.map +1 -1
  245. package/build/info/Info.js +13 -17
  246. package/build/info/Info.js.map +1 -1
  247. package/build/info/Info.messages.js +3 -1
  248. package/build/info/Info.messages.js.map +1 -1
  249. package/build/info/Info.mjs +7 -13
  250. package/build/info/Info.mjs.map +1 -1
  251. package/build/inlineAlert/InlineAlert.js +5 -3
  252. package/build/inlineAlert/InlineAlert.js.map +1 -1
  253. package/build/inputWithDisplayFormat/InputWithDisplayFormat.js +4 -2
  254. package/build/inputWithDisplayFormat/InputWithDisplayFormat.js.map +1 -1
  255. package/build/inputs/Input.js +1 -3
  256. package/build/inputs/Input.js.map +1 -1
  257. package/build/inputs/Input.mjs +1 -3
  258. package/build/inputs/Input.mjs.map +1 -1
  259. package/build/inputs/SelectInput.js +5 -7
  260. package/build/inputs/SelectInput.js.map +1 -1
  261. package/build/inputs/SelectInput.messages.js +3 -1
  262. package/build/inputs/SelectInput.messages.js.map +1 -1
  263. package/build/inputs/SelectInput.mjs +4 -6
  264. package/build/inputs/SelectInput.mjs.map +1 -1
  265. package/build/inputs/_ButtonInput.js +1 -3
  266. package/build/inputs/_ButtonInput.js.map +1 -1
  267. package/build/inputs/_ButtonInput.mjs +1 -3
  268. package/build/inputs/_ButtonInput.mjs.map +1 -1
  269. package/build/inputs/_Popover.js +1 -3
  270. package/build/inputs/_Popover.js.map +1 -1
  271. package/build/inputs/_Popover.mjs +1 -3
  272. package/build/inputs/_Popover.mjs.map +1 -1
  273. package/build/instructionsList/InstructionsList.js +4 -2
  274. package/build/instructionsList/InstructionsList.js.map +1 -1
  275. package/build/label/Label.js +3 -3
  276. package/build/label/Label.js.map +1 -1
  277. package/build/label/Label.messages.js +3 -1
  278. package/build/label/Label.messages.js.map +1 -1
  279. package/build/link/Link.js +5 -3
  280. package/build/link/Link.js.map +1 -1
  281. package/build/link/Link.messages.js +3 -1
  282. package/build/link/Link.messages.js.map +1 -1
  283. package/build/listItem/ListItem.js +6 -4
  284. package/build/listItem/ListItem.js.map +1 -1
  285. package/build/listItem/ListItem.mjs +1 -1
  286. package/build/listItem/ListItem.mjs.map +1 -1
  287. package/build/loader/Loader.js +3 -1
  288. package/build/loader/Loader.js.map +1 -1
  289. package/build/main.css +55 -102
  290. package/build/markdown/Markdown.js +3 -1
  291. package/build/markdown/Markdown.js.map +1 -1
  292. package/build/modal/Modal.js +5 -3
  293. package/build/modal/Modal.js.map +1 -1
  294. package/build/money/Money.js +3 -1
  295. package/build/money/Money.js.map +1 -1
  296. package/build/moneyInput/MoneyInput.js +7 -5
  297. package/build/moneyInput/MoneyInput.js.map +1 -1
  298. package/build/moneyInput/MoneyInput.messages.js +3 -1
  299. package/build/moneyInput/MoneyInput.messages.js.map +1 -1
  300. package/build/moneyInput/currencyFormatting.js +2 -2
  301. package/build/moneyInput/currencyFormatting.js.map +1 -1
  302. package/build/moneyInput/currencyFormatting.mjs +2 -2
  303. package/build/moneyInput/currencyFormatting.mjs.map +1 -1
  304. package/build/navigationOption/NavigationOption.js +5 -3
  305. package/build/navigationOption/NavigationOption.js.map +1 -1
  306. package/build/navigationOptionsList/NavigationOptionsList.js +3 -1
  307. package/build/navigationOptionsList/NavigationOptionsList.js.map +1 -1
  308. package/build/nudge/Nudge.js +2 -4
  309. package/build/nudge/Nudge.js.map +1 -1
  310. package/build/nudge/Nudge.mjs +0 -2
  311. package/build/nudge/Nudge.mjs.map +1 -1
  312. package/build/overlayHeader/OverlayHeader.js +4 -2
  313. package/build/overlayHeader/OverlayHeader.js.map +1 -1
  314. package/build/phoneNumberInput/PhoneNumberInput.js +5 -3
  315. package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
  316. package/build/phoneNumberInput/PhoneNumberInput.messages.js +3 -1
  317. package/build/phoneNumberInput/PhoneNumberInput.messages.js.map +1 -1
  318. package/build/phoneNumberInput/data/countries.js +3 -1
  319. package/build/phoneNumberInput/data/countries.js.map +1 -1
  320. package/build/phoneNumberInput/utils/findCountryByCode/index.js +1 -1
  321. package/build/phoneNumberInput/utils/findCountryByCode/index.js.map +1 -1
  322. package/build/phoneNumberInput/utils/findCountryByPrefix/index.js +1 -1
  323. package/build/phoneNumberInput/utils/findCountryByPrefix/index.js.map +1 -1
  324. package/build/popover/Popover.js +5 -3
  325. package/build/popover/Popover.js.map +1 -1
  326. package/build/primitives/PrimitiveAnchor/PrimitiveAnchor.js +3 -1
  327. package/build/primitives/PrimitiveAnchor/PrimitiveAnchor.js.map +1 -1
  328. package/build/primitives/PrimitiveButton/PrimitiveButton.js +4 -2
  329. package/build/primitives/PrimitiveButton/PrimitiveButton.js.map +1 -1
  330. package/build/processIndicator/ProcessIndicator.js +3 -1
  331. package/build/processIndicator/ProcessIndicator.js.map +1 -1
  332. package/build/progress/Progress.js +3 -1
  333. package/build/progress/Progress.js.map +1 -1
  334. package/build/progressBar/ProgressBar.js +7 -5
  335. package/build/progressBar/ProgressBar.js.map +1 -1
  336. package/build/promoCard/PromoCard.js +8 -6
  337. package/build/promoCard/PromoCard.js.map +1 -1
  338. package/build/promoCard/PromoCardContext.js +0 -1
  339. package/build/promoCard/PromoCardContext.js.map +1 -1
  340. package/build/promoCard/PromoCardContext.mjs +0 -1
  341. package/build/promoCard/PromoCardContext.mjs.map +1 -1
  342. package/build/promoCard/PromoCardGroup.js +3 -2
  343. package/build/promoCard/PromoCardGroup.js.map +1 -1
  344. package/build/promoCard/PromoCardGroup.mjs +0 -1
  345. package/build/promoCard/PromoCardGroup.mjs.map +1 -1
  346. package/build/promoCard/PromoCardIndicator.js +5 -3
  347. package/build/promoCard/PromoCardIndicator.js.map +1 -1
  348. package/build/provider/Provider.js +4 -2
  349. package/build/provider/Provider.js.map +1 -1
  350. package/build/radio/Radio.js +6 -4
  351. package/build/radio/Radio.js.map +1 -1
  352. package/build/radioGroup/RadioGroup.js +4 -2
  353. package/build/radioGroup/RadioGroup.js.map +1 -1
  354. package/build/radioOption/RadioOption.js +5 -3
  355. package/build/radioOption/RadioOption.js.map +1 -1
  356. package/build/section/Section.js +3 -1
  357. package/build/section/Section.js.map +1 -1
  358. package/build/segmentedControl/SegmentedControl.js +5 -3
  359. package/build/segmentedControl/SegmentedControl.js.map +1 -1
  360. package/build/select/Select.js +31 -35
  361. package/build/select/Select.js.map +1 -1
  362. package/build/select/Select.messages.js +3 -1
  363. package/build/select/Select.messages.js.map +1 -1
  364. package/build/select/Select.mjs +19 -25
  365. package/build/select/Select.mjs.map +1 -1
  366. package/build/select/option/Option.js +9 -5
  367. package/build/select/option/Option.js.map +1 -1
  368. package/build/select/option/Option.mjs +3 -1
  369. package/build/select/option/Option.mjs.map +1 -1
  370. package/build/select/option/index.js +3 -1
  371. package/build/select/option/index.js.map +1 -1
  372. package/build/select/searchBox/SearchBox.js +3 -1
  373. package/build/select/searchBox/SearchBox.js.map +1 -1
  374. package/build/selectOption/SelectOption.js +11 -9
  375. package/build/selectOption/SelectOption.js.map +1 -1
  376. package/build/selectOption/SelectOption.messages.js +3 -1
  377. package/build/selectOption/SelectOption.messages.js.map +1 -1
  378. package/build/selectOption/SelectOption.mjs +1 -1
  379. package/build/snackbar/Snackbar.js +3 -3
  380. package/build/snackbar/Snackbar.js.map +1 -1
  381. package/build/snackbar/SnackbarProvider.js +3 -1
  382. package/build/snackbar/SnackbarProvider.js.map +1 -1
  383. package/build/snackbar/useSnackbar.js +3 -1
  384. package/build/snackbar/useSnackbar.js.map +1 -1
  385. package/build/statusIcon/StatusIcon.js +12 -10
  386. package/build/statusIcon/StatusIcon.js.map +1 -1
  387. package/build/statusIcon/StatusIcon.messages.js +3 -1
  388. package/build/statusIcon/StatusIcon.messages.js.map +1 -1
  389. package/build/stepper/Stepper.js +4 -2
  390. package/build/stepper/Stepper.js.map +1 -1
  391. package/build/sticky/Sticky.js +3 -1
  392. package/build/sticky/Sticky.js.map +1 -1
  393. package/build/styles/button/Button.css +2 -2
  394. package/build/styles/common/Option/Option.css +1 -1
  395. package/build/styles/dateLookup/DateLookup.css +0 -5
  396. package/build/styles/divider/Divider.css +24 -0
  397. package/build/styles/header/Header.css +28 -11
  398. package/build/styles/info/Info.css +0 -23
  399. package/build/styles/main.css +55 -102
  400. package/build/summary/Summary.js +11 -9
  401. package/build/summary/Summary.js.map +1 -1
  402. package/build/summary/Summary.messages.js +3 -1
  403. package/build/summary/Summary.messages.js.map +1 -1
  404. package/build/summary/Summary.mjs +2 -2
  405. package/build/summary/Summary.mjs.map +1 -1
  406. package/build/switch/Switch.js +3 -1
  407. package/build/switch/Switch.js.map +1 -1
  408. package/build/switchOption/SwitchOption.js +5 -3
  409. package/build/switchOption/SwitchOption.js.map +1 -1
  410. package/build/table/Table.js +17 -17
  411. package/build/table/Table.js.map +1 -1
  412. package/build/table/Table.messages.js +3 -1
  413. package/build/table/Table.messages.js.map +1 -1
  414. package/build/table/Table.mjs +1 -3
  415. package/build/table/Table.mjs.map +1 -1
  416. package/build/table/TableCell.js +9 -7
  417. package/build/table/TableCell.js.map +1 -1
  418. package/build/table/TableHeader.js +6 -4
  419. package/build/table/TableHeader.js.map +1 -1
  420. package/build/table/TableRow.js +6 -4
  421. package/build/table/TableRow.js.map +1 -1
  422. package/build/table/TableStatusText.js +4 -2
  423. package/build/table/TableStatusText.js.map +1 -1
  424. package/build/tabs/Tab.js +3 -1
  425. package/build/tabs/Tab.js.map +1 -1
  426. package/build/tabs/TabList.js +3 -1
  427. package/build/tabs/TabList.js.map +1 -1
  428. package/build/tabs/TabPanel.js +3 -1
  429. package/build/tabs/TabPanel.js.map +1 -1
  430. package/build/tabs/Tabs.js +6 -4
  431. package/build/tabs/Tabs.js.map +1 -1
  432. package/build/textareaWithDisplayFormat/TextareaWithDisplayFormat.js +4 -2
  433. package/build/textareaWithDisplayFormat/TextareaWithDisplayFormat.js.map +1 -1
  434. package/build/tile/Tile.js +5 -3
  435. package/build/tile/Tile.js.map +1 -1
  436. package/build/title/Title.js +9 -5
  437. package/build/title/Title.js.map +1 -1
  438. package/build/title/Title.mjs +6 -4
  439. package/build/title/Title.mjs.map +1 -1
  440. package/build/tooltip/Tooltip.js +5 -7
  441. package/build/tooltip/Tooltip.js.map +1 -1
  442. package/build/tooltip/Tooltip.mjs +2 -6
  443. package/build/tooltip/Tooltip.mjs.map +1 -1
  444. package/build/typeahead/Typeahead.js +8 -6
  445. package/build/typeahead/Typeahead.js.map +1 -1
  446. package/build/typeahead/Typeahead.messages.js +3 -1
  447. package/build/typeahead/Typeahead.messages.js.map +1 -1
  448. package/build/typeahead/typeaheadInput/TypeaheadInput.js +3 -1
  449. package/build/typeahead/typeaheadInput/TypeaheadInput.js.map +1 -1
  450. package/build/typeahead/typeaheadOption/TypeaheadOption.js +5 -3
  451. package/build/typeahead/typeaheadOption/TypeaheadOption.js.map +1 -1
  452. package/build/typeahead/util/highlight.js +3 -1
  453. package/build/typeahead/util/highlight.js.map +1 -1
  454. package/build/types/badge/Badge.d.ts +1 -1
  455. package/build/types/badge/Badge.d.ts.map +1 -1
  456. package/build/types/badge/BadgeAssets.d.ts.map +1 -1
  457. package/build/types/button/LegacyButton.d.ts.map +1 -1
  458. package/build/types/carousel/Carousel.d.ts.map +1 -1
  459. package/build/types/checkbox/Checkbox.d.ts.map +1 -1
  460. package/build/types/checkboxOption/CheckboxOption.d.ts +1 -2
  461. package/build/types/checkboxOption/CheckboxOption.d.ts.map +1 -1
  462. package/build/types/common/bottomSheet/BottomSheet.d.ts.map +1 -1
  463. package/build/types/common/dateUtils/isDateValid/isDateValid.d.ts.map +1 -1
  464. package/build/types/common/locale/index.d.ts +1 -1
  465. package/build/types/common/locale/index.d.ts.map +1 -1
  466. package/build/types/common/panel/Panel.d.ts.map +1 -1
  467. package/build/types/dateInput/DateInput.d.ts +1 -1
  468. package/build/types/dateInput/DateInput.d.ts.map +1 -1
  469. package/build/types/dateLookup/dateHeader/DateHeader.d.ts.map +1 -1
  470. package/build/types/dimmer/dimmerManager/DimmerManager.d.ts +1 -1
  471. package/build/types/dimmer/dimmerManager/DimmerManager.d.ts.map +1 -1
  472. package/build/types/divider/Divider.d.ts +29 -0
  473. package/build/types/divider/Divider.d.ts.map +1 -0
  474. package/build/types/divider/index.d.ts +3 -0
  475. package/build/types/divider/index.d.ts.map +1 -0
  476. package/build/types/dropFade/DropFade.d.ts.map +1 -1
  477. package/build/types/emphasis/EmphasisHtmlTransformer.d.ts +2 -2
  478. package/build/types/emphasis/EmphasisHtmlTransformer.d.ts.map +1 -1
  479. package/build/types/header/Header.d.ts +28 -11
  480. package/build/types/header/Header.d.ts.map +1 -1
  481. package/build/types/header/index.d.ts +1 -0
  482. package/build/types/header/index.d.ts.map +1 -1
  483. package/build/types/index.d.ts +3 -2
  484. package/build/types/index.d.ts.map +1 -1
  485. package/build/types/info/Info.d.ts.map +1 -1
  486. package/build/types/inputs/Input.d.ts.map +1 -1
  487. package/build/types/inputs/SelectInput.d.ts.map +1 -1
  488. package/build/types/inputs/_ButtonInput.d.ts.map +1 -1
  489. package/build/types/inputs/_Popover.d.ts.map +1 -1
  490. package/build/types/nudge/Nudge.d.ts.map +1 -1
  491. package/build/types/promoCard/PromoCardContext.d.ts.map +1 -1
  492. package/build/types/promoCard/PromoCardGroup.d.ts.map +1 -1
  493. package/build/types/select/Select.d.ts.map +1 -1
  494. package/build/types/select/option/Option.d.ts +2 -1
  495. package/build/types/select/option/Option.d.ts.map +1 -1
  496. package/build/types/table/Table.d.ts.map +1 -1
  497. package/build/types/title/Title.d.ts +3 -4
  498. package/build/types/title/Title.d.ts.map +1 -1
  499. package/build/types/tooltip/Tooltip.d.ts.map +1 -1
  500. package/build/types/upload/Upload.d.ts.map +1 -1
  501. package/build/upload/Upload.js +20 -18
  502. package/build/upload/Upload.js.map +1 -1
  503. package/build/upload/Upload.messages.js +3 -1
  504. package/build/upload/Upload.messages.js.map +1 -1
  505. package/build/upload/Upload.mjs +3 -1
  506. package/build/upload/Upload.mjs.map +1 -1
  507. package/build/upload/steps/completeStep/completeStep.js +30 -6
  508. package/build/upload/steps/completeStep/completeStep.js.map +1 -1
  509. package/build/upload/steps/completeStep/completeStep.mjs +24 -2
  510. package/build/upload/steps/completeStep/completeStep.mjs.map +1 -1
  511. package/build/upload/steps/processingStep/processingStep.js +6 -4
  512. package/build/upload/steps/processingStep/processingStep.js.map +1 -1
  513. package/build/upload/steps/uploadImageStep/uploadImageStep.js +5 -3
  514. package/build/upload/steps/uploadImageStep/uploadImageStep.js.map +1 -1
  515. package/build/uploadInput/UploadInput.js +13 -11
  516. package/build/uploadInput/UploadInput.js.map +1 -1
  517. package/build/uploadInput/UploadInput.messages.js +3 -1
  518. package/build/uploadInput/UploadInput.messages.js.map +1 -1
  519. package/build/uploadInput/uploadButton/UploadButton.js +8 -8
  520. package/build/uploadInput/uploadButton/UploadButton.js.map +1 -1
  521. package/build/uploadInput/uploadButton/UploadButton.messages.js +3 -1
  522. package/build/uploadInput/uploadButton/UploadButton.messages.js.map +1 -1
  523. package/build/uploadInput/uploadButton/getAllowedFileTypes.js +3 -1
  524. package/build/uploadInput/uploadButton/getAllowedFileTypes.js.map +1 -1
  525. package/build/uploadInput/uploadItem/UploadItem.js +12 -12
  526. package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
  527. package/build/uploadInput/uploadItem/UploadItem.messages.js +3 -1
  528. package/build/uploadInput/uploadItem/UploadItem.messages.js.map +1 -1
  529. package/build/withDisplayFormat/WithDisplayFormat.js +19 -17
  530. package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
  531. package/build/withId/withId.js +3 -1
  532. package/build/withId/withId.js.map +1 -1
  533. package/build/withNextPortal/withNextPortal.js +3 -1
  534. package/build/withNextPortal/withNextPortal.js.map +1 -1
  535. package/package.json +12 -10
  536. package/src/accordion/Accordion.story.tsx +2 -2
  537. package/src/accordion/AccordionItem/__snapshots__/AccordionItem.spec.js.snap +6 -2
  538. package/src/alert/Alert.story.tsx +2 -2
  539. package/src/alert/Alert.tests.story.tsx +1 -1
  540. package/src/avatarWrapper/__snapshots__/AvatarWrapper.spec.tsx.snap +12 -4
  541. package/src/badge/Badge.tsx +1 -1
  542. package/src/badge/BadgeAssets.tsx +2 -2
  543. package/src/button/Button.css +2 -2
  544. package/src/button/Button.less +2 -2
  545. package/src/button/LegacyButton.tsx +0 -2
  546. package/src/carousel/Carousel.spec.tsx +0 -4
  547. package/src/carousel/Carousel.tsx +0 -1
  548. package/src/checkbox/Checkbox.tsx +0 -1
  549. package/src/checkboxButton/CheckboxButton.story.tsx +0 -2
  550. package/src/checkboxButton/CheckboxButton.tsx +1 -1
  551. package/src/checkboxOption/CheckboxOption.tsx +1 -2
  552. package/src/chips/__snapshots__/Chips.spec.tsx.snap +1 -1
  553. package/src/common/Option/Option.css +1 -1
  554. package/src/common/Option/Option.less +2 -2
  555. package/src/common/Option/Option.tsx +1 -1
  556. package/src/common/bottomSheet/BottomSheet.spec.tsx +0 -1
  557. package/src/common/bottomSheet/BottomSheet.story.tsx +1 -1
  558. package/src/common/bottomSheet/BottomSheet.tsx +0 -1
  559. package/src/common/bottomSheet/__snapshots__/BottomSheet.spec.tsx.snap +1 -1
  560. package/src/common/closeButton/__snapshots__/CloseButton.spec.tsx.snap +1 -1
  561. package/src/common/dateUtils/isDateValid/isDateValid.ts +5 -3
  562. package/src/common/hooks/useHasIntersected/useHasIntersected.spec.js +0 -2
  563. package/src/common/locale/index.ts +1 -1
  564. package/src/common/panel/Panel.tsx +2 -13
  565. package/src/dateInput/DateInput.tsx +7 -1
  566. package/src/dateLookup/DateLookup.css +0 -5
  567. package/src/dateLookup/DateLookup.less +0 -4
  568. package/src/dateLookup/dateHeader/DateHeader.tsx +24 -26
  569. package/src/dimmer/Dimmer.story.tsx +0 -1
  570. package/src/dimmer/dimmerManager/DimmerManager.ts +1 -1
  571. package/src/display/Display.story.tsx +0 -2
  572. package/src/divider/Divider.accessibility.docs.mdx +61 -0
  573. package/src/divider/Divider.css +24 -0
  574. package/src/divider/Divider.less +31 -0
  575. package/src/divider/Divider.spec.tsx +60 -0
  576. package/src/divider/Divider.story.tsx +130 -0
  577. package/src/divider/Divider.tsx +54 -0
  578. package/src/divider/index.ts +2 -0
  579. package/src/dropFade/DropFade.story.tsx +0 -1
  580. package/src/dropFade/DropFade.tsx +0 -1
  581. package/src/emphasis/EmphasisHtmlTransformer.spec.tsx +4 -4
  582. package/src/emphasis/EmphasisHtmlTransformer.ts +2 -2
  583. package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +5 -3
  584. package/src/header/Header.accessibility.docs.mdx +85 -0
  585. package/src/header/Header.css +28 -11
  586. package/src/header/Header.less +29 -7
  587. package/src/header/Header.spec.tsx +68 -50
  588. package/src/header/Header.story.tsx +184 -39
  589. package/src/header/Header.tsx +123 -69
  590. package/src/header/index.ts +1 -0
  591. package/src/i18n/cs.json +22 -5
  592. package/src/i18n/nl.json +73 -0
  593. package/src/index.ts +3 -2
  594. package/src/info/Info.css +0 -23
  595. package/src/info/Info.less +0 -28
  596. package/src/info/Info.tsx +8 -14
  597. package/src/inputs/Input.tsx +0 -1
  598. package/src/inputs/SelectInput.tsx +1 -7
  599. package/src/inputs/_ButtonInput.tsx +0 -1
  600. package/src/inputs/_Popover.tsx +0 -1
  601. package/src/link/Link.story.tsx +0 -1
  602. package/src/listItem/ListItem.story.tsx +4 -11
  603. package/src/listItem/ListItem.tests.story.tsx +52 -0
  604. package/src/listItem/ListItem.tsx +1 -1
  605. package/src/main.css +55 -102
  606. package/src/main.less +1 -1
  607. package/src/markdown/Markdown.spec.tsx +0 -1
  608. package/src/modal/Modal.story.tsx +1 -1
  609. package/src/moneyInput/currencyFormatting.ts +3 -3
  610. package/src/nudge/Nudge.tsx +0 -2
  611. package/src/overlayHeader/__snapshots__/OverlayHeader.spec.tsx.snap +1 -1
  612. package/src/promoCard/PromoCardContext.tsx +0 -1
  613. package/src/promoCard/PromoCardGroup.story.tsx +3 -15
  614. package/src/promoCard/PromoCardGroup.tsx +0 -1
  615. package/src/provider/theme/ThemeProvider.story.tsx +3 -5
  616. package/src/select/Select.spec.tsx +0 -1
  617. package/src/select/Select.tsx +0 -3
  618. package/src/select/option/Option.spec.tsx +51 -0
  619. package/src/select/option/Option.tsx +3 -1
  620. package/src/selectOption/SelectOption.story.tsx +1 -2
  621. package/src/summary/Summary.tests.story.tsx +55 -0
  622. package/src/summary/Summary.tsx +2 -2
  623. package/src/table/Table.tsx +0 -1
  624. package/src/test-utils/jest.setup.ts +0 -1
  625. package/src/title/Title.tsx +25 -11
  626. package/src/tooltip/Tooltip.tsx +0 -2
  627. package/src/upload/Upload.spec.tsx +295 -0
  628. package/src/upload/Upload.tsx +5 -1
  629. package/src/upload/steps/completeStep/completeStep.spec.tsx +51 -0
  630. package/src/upload/steps/completeStep/completeStep.tsx +1 -1
  631. package/src/upload/steps/processingStep/processingStep.spec.tsx +59 -0
  632. package/src/upload/steps/uploadImageStep/uploadImageStep.spec.tsx +79 -0
  633. package/build/styles/item/Item.css +0 -60
  634. package/build/types/item/Item.d.ts +0 -39
  635. package/build/types/item/Item.d.ts.map +0 -1
  636. package/build/types/item/ItemAdditionalInfo.d.ts +0 -7
  637. package/build/types/item/ItemAdditionalInfo.d.ts.map +0 -1
  638. package/build/types/item/ItemCheckbox.d.ts +0 -4
  639. package/build/types/item/ItemCheckbox.d.ts.map +0 -1
  640. package/build/types/item/ItemIconButton.d.ts +0 -4
  641. package/build/types/item/ItemIconButton.d.ts.map +0 -1
  642. package/build/types/item/ItemImage.d.ts +0 -4
  643. package/build/types/item/ItemImage.d.ts.map +0 -1
  644. package/build/types/item/ItemNavigation.d.ts +0 -4
  645. package/build/types/item/ItemNavigation.d.ts.map +0 -1
  646. package/build/types/item/index.d.ts +0 -5
  647. package/build/types/item/index.d.ts.map +0 -1
  648. package/src/item/Item.css +0 -60
  649. package/src/item/Item.less +0 -60
  650. package/src/item/Item.story.tsx +0 -39
  651. package/src/item/Item.tsx +0 -153
  652. package/src/item/ItemAdditionalInfo.tsx +0 -14
  653. package/src/item/ItemCheckbox.tsx +0 -16
  654. package/src/item/ItemIconButton.tsx +0 -15
  655. package/src/item/ItemImage.tsx +0 -11
  656. package/src/item/ItemNavigation.tsx +0 -16
  657. package/src/item/index.ts +0 -4
  658. package/src/select/option/Option.spec.js +0 -43
  659. package/src/upload/Upload.events.spec.js +0 -49
  660. package/src/upload/Upload.spec.js +0 -305
  661. package/src/upload/steps/completeStep/completeStep.spec.js +0 -51
  662. package/src/upload/steps/processingStep/processingStep.spec.js +0 -55
  663. package/src/upload/steps/uploadImageStep/uploadImageStep.spec.js +0 -91
@@ -1 +1 @@
1
- {"version":3,"file":"BottomSheet.mjs","sources":["../../../src/common/bottomSheet/BottomSheet.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport {\n CSSProperties,\n HTMLAttributes,\n PropsWithChildren,\n SyntheticEvent,\n useContext,\n useRef,\n useState,\n} from 'react';\n\nimport Dimmer from '../../dimmer';\nimport Drawer from '../../drawer';\nimport { OverlayIdContext } from '../../provider/overlay/OverlayIdProvider';\nimport SlidingPanel from '../../slidingPanel';\nimport { CloseButton } from '../closeButton';\nimport { CommonProps } from '../commonProps';\nimport { isServerSide } from '../domHelpers';\nimport { useConditionalListener } from '../hooks';\nimport { useMedia } from '../hooks/useMedia';\nimport { Breakpoint } from '../propsValues/breakpoint';\nimport { Position } from '../propsValues/position';\n\nconst INITIAL_Y_POSITION = 0;\n\nconst CONTENT_SCROLL_THRESHOLD = 1;\n\nconst MOVE_OFFSET_THRESHOLD = 50;\n\nexport type BottomSheetProps = PropsWithChildren<\n {\n onClose?: (event: Event | SyntheticEvent) => void;\n open: boolean;\n } & CommonProps &\n Pick<HTMLAttributes<HTMLDivElement>, 'role' | 'aria-labelledby' | 'aria-label'>\n>;\n\n/**\n * Neptune: https://transferwise.github.io/neptune/components/bottom-sheet/\n *\n * Neptune Web: https://transferwise.github.io/neptune-web/components/overlays/BottomSheet\n *\n */\nconst BottomSheet = ({ role = 'dialog', ...props }: BottomSheetProps) => {\n const bottomSheetReference = useRef<HTMLDivElement>(null);\n const topBarReference = useRef<HTMLDivElement>(null);\n const contentReference = useRef<HTMLDivElement>(null);\n\n const [pressed, setPressed] = useState<boolean>(false);\n\n /**\n * Used to track `requestAnimationFrame` requests\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame#return_value\n */\n const animationId = useRef<number>(0);\n\n /**\n * Difference between initial coordinate ({@link initialYCoordinate})\n * and new position (when user moves component), it's get calculated on `onTouchMove` and `onMouseMove` events\n *\n * @see {@link calculateOffsetAfterMove}\n */\n const moveOffset = useRef<number>(0);\n const initialYCoordinate = useRef<number>(0);\n\n // apply shadow to the bottom of top-bar when scroll over content\n useConditionalListener({\n attachListener: props.open && !isServerSide(),\n callback: () => {\n if (topBarReference.current !== null) {\n const { classList } = topBarReference.current;\n if (!isContentScrollPositionAtTop()) {\n classList.add('np-bottom-sheet--top-bar--shadow');\n } else {\n classList.remove('np-bottom-sheet--top-bar--shadow');\n }\n }\n },\n eventType: 'scroll',\n parent: isServerSide() ? undefined : document,\n });\n\n function move(newHeight: number): void {\n if (bottomSheetReference.current !== null) {\n bottomSheetReference.current.style.transform = `translateY(${newHeight}px)`;\n }\n }\n\n function close(event: Event | SyntheticEvent): void {\n setPressed(false);\n moveOffset.current = INITIAL_Y_POSITION;\n if (bottomSheetReference.current !== null) {\n bottomSheetReference.current.style.removeProperty('transform');\n }\n if (props.onClose) {\n props.onClose(event);\n }\n }\n\n const onSwipeStart = (\n event: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>,\n ): void => {\n initialYCoordinate.current = ('touches' in event ? event.touches[0] : event).clientY;\n setPressed(true);\n };\n\n const onSwipeMove = (\n event: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>,\n ): void => {\n if (pressed) {\n const { clientY } = 'touches' in event ? event.touches[0] : event;\n\n const offset = calculateOffsetAfterMove(clientY);\n // check whether move is to the bottom only and content scroll position is at the top\n if (offset > INITIAL_Y_POSITION && isContentScrollPositionAtTop()) {\n moveOffset.current = offset;\n animationId.current = requestAnimationFrame(() => {\n if (animationId.current !== undefined && bottomSheetReference.current !== null) {\n move(offset);\n }\n });\n }\n }\n };\n\n function onSwipeEnd(\n event: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>,\n ): void {\n // stop moving component\n cancelAnimationFrame(animationId.current);\n setPressed(false);\n // check whether move down is strong enough\n // and content scroll position is at the top to close the component\n if (moveOffset.current > MOVE_OFFSET_THRESHOLD && isContentScrollPositionAtTop()) {\n close(event);\n }\n // otherwise move component back to default (initial) position\n else {\n move(INITIAL_Y_POSITION);\n }\n moveOffset.current = INITIAL_Y_POSITION;\n }\n\n function isContentScrollPositionAtTop(): boolean {\n return (\n contentReference?.current?.scrollTop !== undefined &&\n contentReference.current.scrollTop <= CONTENT_SCROLL_THRESHOLD\n );\n }\n\n /**\n * Calculates how hard user moves component,\n * result value used to determine whether to hide component or re-position to default state\n *\n * @param afterMoveYCoordinate\n */\n function calculateOffsetAfterMove(afterMoveYCoordinate: number): number {\n return afterMoveYCoordinate - initialYCoordinate.current;\n }\n\n /**\n * Set `max-height` for content part (in order to keep it scrollable for content overflow cases) of the component\n * and ensures space for safe zone (32px) at the top.\n */\n function setContentMaxHeight(): CSSProperties {\n const safeZoneHeight = '64px';\n const topbarHeight = '32px';\n const windowHight: number = isServerSide() ? 0 : window.innerHeight;\n /**\n * Calculate _real_ height of the screen (taking into account parts of browser interface).\n *\n * See https://css-tricks.com/the-trick-to-viewport-units-on-mobile for more details.\n */\n const screenHeight = `${windowHight * 0.01 * 100}px`;\n return {\n maxHeight: `calc(${screenHeight} - ${safeZoneHeight} - ${topbarHeight})`,\n };\n }\n\n const is400Zoom = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n\n const overlayId = useContext(OverlayIdContext);\n\n return is400Zoom ? (\n <Drawer\n aria-labelledby={props['aria-labelledby']}\n aria-label={props['aria-label']}\n role={role}\n open={props.open}\n className={props.className}\n onClose={close}\n >\n {props.children}\n </Drawer>\n ) : (\n <Dimmer open={props.open} fadeContentOnEnter fadeContentOnExit onClose={close}>\n <SlidingPanel\n ref={bottomSheetReference}\n open={props.open}\n position={Position.BOTTOM}\n className={clsx('np-bottom-sheet', props.className)}\n >\n {/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}\n <div\n id={overlayId}\n aria-labelledby={props['aria-labelledby'] || undefined}\n aria-label={props['aria-label'] || undefined}\n role={role}\n aria-modal\n onTouchStart={onSwipeStart}\n onTouchMove={onSwipeMove}\n onTouchEnd={onSwipeEnd}\n onMouseDown={onSwipeStart}\n onMouseMove={onSwipeMove}\n onMouseUp={onSwipeEnd}\n >\n <div ref={topBarReference} className=\"np-bottom-sheet--top-bar\">\n <div className=\"np-bottom-sheet--handler\" />\n <CloseButton size=\"sm\" className=\"sr-only np-bottom-sheet--close-btn\" onClick={close} />\n </div>\n <div\n ref={contentReference}\n style={setContentMaxHeight()}\n className=\"np-bottom-sheet--content\"\n >\n {props.children}\n </div>\n </div>\n </SlidingPanel>\n </Dimmer>\n );\n};\n\nexport default BottomSheet;\n"],"names":["INITIAL_Y_POSITION","CONTENT_SCROLL_THRESHOLD","MOVE_OFFSET_THRESHOLD","BottomSheet","role","props","bottomSheetReference","useRef","topBarReference","contentReference","pressed","setPressed","useState","animationId","moveOffset","initialYCoordinate","useConditionalListener","attachListener","open","isServerSide","callback","current","classList","isContentScrollPositionAtTop","add","remove","eventType","parent","undefined","document","move","newHeight","style","transform","close","event","removeProperty","onClose","onSwipeStart","touches","clientY","onSwipeMove","offset","calculateOffsetAfterMove","requestAnimationFrame","onSwipeEnd","cancelAnimationFrame","scrollTop","afterMoveYCoordinate","setContentMaxHeight","safeZoneHeight","topbarHeight","windowHight","window","innerHeight","screenHeight","maxHeight","is400Zoom","useMedia","Breakpoint","ZOOM_400","overlayId","useContext","OverlayIdContext","_jsx","Drawer","className","children","Dimmer","fadeContentOnEnter","fadeContentOnExit","SlidingPanel","ref","position","Position","BOTTOM","clsx","_jsxs","id","onTouchStart","onTouchMove","onTouchEnd","onMouseDown","onMouseMove","onMouseUp","CloseButton","size","onClick"],"mappings":";;;;;;;;;;;;;;;AAuBA,MAAMA,kBAAkB,GAAG,CAAC,CAAA;AAE5B,MAAMC,wBAAwB,GAAG,CAAC,CAAA;AAElC,MAAMC,qBAAqB,GAAG,EAAE,CAAA;AAUhC;;;;;AAKG;AACGC,MAAAA,WAAW,GAAGA,CAAC;AAAEC,EAAAA,IAAI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vB,KAAK,CAAC,YAAY,CAAC,IAAIuB,SAAU;AAC7CxB,QAAAA,IAAI,EAAEA,IAAK;QACX,YAAU,EAAA,IAAA;AACV2E,QAAAA,YAAY,EAAEzC,YAAa;AAC3B0C,QAAAA,WAAW,EAAEvC,WAAY;AACzBwC,QAAAA,UAAU,EAAEpC,UAAW;AACvBqC,QAAAA,WAAW,EAAE5C,YAAa;AAC1B6C,QAAAA,WAAW,EAAE1C,WAAY;AACzB2C,QAAAA,SAAS,EAAEvC,UAAW;AAAAsB,QAAAA,QAAA,gBAEtBU,IAAA,CAAA,KAAA,EAAA;AAAKL,UAAAA,GAAG,EAAEhE,eAAgB;AAAC0D,UAAAA,SAAS,EAAC,0BAA0B;AAAAC,UAAAA,QAAA,gBAC7DH,GAAA,CAAA,KAAA,EAAA;AAAKE,YAAAA,SAAS,EAAC,0BAAA;AAA0B,WACzC,CAAA,eAAAF,GAAA,CAACqB,WAAW,EAAA;AAACC,YAAAA,IAAI,EAAC,IAAI;AAACpB,YAAAA,SAAS,EAAC,oCAAoC;AAACqB,YAAAA,OAAO,EAAErD,KAAAA;AAAM,WACvF,CAAA,CAAA;SAAK,CACL,eAAA8B,GAAA,CAAA,KAAA,EAAA;AACEQ,UAAAA,GAAG,EAAE/D,gBAAiB;UACtBuB,KAAK,EAAEiB,mBAAmB,EAAG;AAC7BiB,UAAAA,SAAS,EAAC,0BAA0B;UAAAC,QAAA,EAEnC9D,KAAK,CAAC8D,QAAAA;AAAQ,SACZ,CACP,CAAA;OAAK,CAAA;KACO,CAAA;AAChB,GAAQ,CACT,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"BottomSheet.mjs","sources":["../../../src/common/bottomSheet/BottomSheet.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport {\n CSSProperties,\n HTMLAttributes,\n PropsWithChildren,\n SyntheticEvent,\n useContext,\n useRef,\n useState,\n} from 'react';\n\nimport Dimmer from '../../dimmer';\nimport Drawer from '../../drawer';\nimport { OverlayIdContext } from '../../provider/overlay/OverlayIdProvider';\nimport SlidingPanel from '../../slidingPanel';\nimport { CloseButton } from '../closeButton';\nimport { CommonProps } from '../commonProps';\nimport { isServerSide } from '../domHelpers';\nimport { useConditionalListener } from '../hooks';\nimport { useMedia } from '../hooks/useMedia';\nimport { Breakpoint } from '../propsValues/breakpoint';\nimport { Position } from '../propsValues/position';\n\nconst INITIAL_Y_POSITION = 0;\n\nconst CONTENT_SCROLL_THRESHOLD = 1;\n\nconst MOVE_OFFSET_THRESHOLD = 50;\n\nexport type BottomSheetProps = PropsWithChildren<\n {\n onClose?: (event: Event | SyntheticEvent) => void;\n open: boolean;\n } & CommonProps &\n Pick<HTMLAttributes<HTMLDivElement>, 'role' | 'aria-labelledby' | 'aria-label'>\n>;\n\n/**\n * Neptune: https://transferwise.github.io/neptune/components/bottom-sheet/\n *\n * Neptune Web: https://transferwise.github.io/neptune-web/components/overlays/BottomSheet\n *\n */\nconst BottomSheet = ({ role = 'dialog', ...props }: BottomSheetProps) => {\n const bottomSheetReference = useRef<HTMLDivElement>(null);\n const topBarReference = useRef<HTMLDivElement>(null);\n const contentReference = useRef<HTMLDivElement>(null);\n\n const [pressed, setPressed] = useState<boolean>(false);\n\n /**\n * Used to track `requestAnimationFrame` requests\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame#return_value\n */\n const animationId = useRef<number>(0);\n\n /**\n * Difference between initial coordinate ({@link initialYCoordinate})\n * and new position (when user moves component), it's get calculated on `onTouchMove` and `onMouseMove` events\n *\n * @see {@link calculateOffsetAfterMove}\n */\n const moveOffset = useRef<number>(0);\n const initialYCoordinate = useRef<number>(0);\n\n // apply shadow to the bottom of top-bar when scroll over content\n useConditionalListener({\n attachListener: props.open && !isServerSide(),\n callback: () => {\n if (topBarReference.current !== null) {\n const { classList } = topBarReference.current;\n if (!isContentScrollPositionAtTop()) {\n classList.add('np-bottom-sheet--top-bar--shadow');\n } else {\n classList.remove('np-bottom-sheet--top-bar--shadow');\n }\n }\n },\n eventType: 'scroll',\n parent: isServerSide() ? undefined : document,\n });\n\n function move(newHeight: number): void {\n if (bottomSheetReference.current !== null) {\n bottomSheetReference.current.style.transform = `translateY(${newHeight}px)`;\n }\n }\n\n function close(event: Event | SyntheticEvent): void {\n setPressed(false);\n moveOffset.current = INITIAL_Y_POSITION;\n if (bottomSheetReference.current !== null) {\n bottomSheetReference.current.style.removeProperty('transform');\n }\n if (props.onClose) {\n props.onClose(event);\n }\n }\n\n const onSwipeStart = (\n event: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>,\n ): void => {\n initialYCoordinate.current = ('touches' in event ? event.touches[0] : event).clientY;\n setPressed(true);\n };\n\n const onSwipeMove = (\n event: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>,\n ): void => {\n if (pressed) {\n const { clientY } = 'touches' in event ? event.touches[0] : event;\n\n const offset = calculateOffsetAfterMove(clientY);\n // check whether move is to the bottom only and content scroll position is at the top\n if (offset > INITIAL_Y_POSITION && isContentScrollPositionAtTop()) {\n moveOffset.current = offset;\n animationId.current = requestAnimationFrame(() => {\n if (animationId.current !== undefined && bottomSheetReference.current !== null) {\n move(offset);\n }\n });\n }\n }\n };\n\n function onSwipeEnd(\n event: React.MouseEvent<HTMLDivElement> | React.TouchEvent<HTMLDivElement>,\n ): void {\n // stop moving component\n cancelAnimationFrame(animationId.current);\n setPressed(false);\n // check whether move down is strong enough\n // and content scroll position is at the top to close the component\n if (moveOffset.current > MOVE_OFFSET_THRESHOLD && isContentScrollPositionAtTop()) {\n close(event);\n }\n // otherwise move component back to default (initial) position\n else {\n move(INITIAL_Y_POSITION);\n }\n moveOffset.current = INITIAL_Y_POSITION;\n }\n\n function isContentScrollPositionAtTop(): boolean {\n return (\n contentReference?.current?.scrollTop !== undefined &&\n contentReference.current.scrollTop <= CONTENT_SCROLL_THRESHOLD\n );\n }\n\n /**\n * Calculates how hard user moves component,\n * result value used to determine whether to hide component or re-position to default state\n *\n * @param afterMoveYCoordinate\n */\n function calculateOffsetAfterMove(afterMoveYCoordinate: number): number {\n return afterMoveYCoordinate - initialYCoordinate.current;\n }\n\n /**\n * Set `max-height` for content part (in order to keep it scrollable for content overflow cases) of the component\n * and ensures space for safe zone (32px) at the top.\n */\n function setContentMaxHeight(): CSSProperties {\n const safeZoneHeight = '64px';\n const topbarHeight = '32px';\n const windowHight: number = isServerSide() ? 0 : window.innerHeight;\n /**\n * Calculate _real_ height of the screen (taking into account parts of browser interface).\n *\n * See https://css-tricks.com/the-trick-to-viewport-units-on-mobile for more details.\n */\n const screenHeight = `${windowHight * 0.01 * 100}px`;\n return {\n maxHeight: `calc(${screenHeight} - ${safeZoneHeight} - ${topbarHeight})`,\n };\n }\n\n const is400Zoom = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n\n const overlayId = useContext(OverlayIdContext);\n\n return is400Zoom ? (\n <Drawer\n aria-labelledby={props['aria-labelledby']}\n aria-label={props['aria-label']}\n role={role}\n open={props.open}\n className={props.className}\n onClose={close}\n >\n {props.children}\n </Drawer>\n ) : (\n <Dimmer open={props.open} fadeContentOnEnter fadeContentOnExit onClose={close}>\n <SlidingPanel\n ref={bottomSheetReference}\n open={props.open}\n position={Position.BOTTOM}\n className={clsx('np-bottom-sheet', props.className)}\n >\n <div\n id={overlayId}\n aria-labelledby={props['aria-labelledby'] || undefined}\n aria-label={props['aria-label'] || undefined}\n role={role}\n aria-modal\n onTouchStart={onSwipeStart}\n onTouchMove={onSwipeMove}\n onTouchEnd={onSwipeEnd}\n onMouseDown={onSwipeStart}\n onMouseMove={onSwipeMove}\n onMouseUp={onSwipeEnd}\n >\n <div ref={topBarReference} className=\"np-bottom-sheet--top-bar\">\n <div className=\"np-bottom-sheet--handler\" />\n <CloseButton size=\"sm\" className=\"sr-only np-bottom-sheet--close-btn\" onClick={close} />\n </div>\n <div\n ref={contentReference}\n style={setContentMaxHeight()}\n className=\"np-bottom-sheet--content\"\n >\n {props.children}\n </div>\n </div>\n </SlidingPanel>\n </Dimmer>\n );\n};\n\nexport default BottomSheet;\n"],"names":["INITIAL_Y_POSITION","CONTENT_SCROLL_THRESHOLD","MOVE_OFFSET_THRESHOLD","BottomSheet","role","props","bottomSheetReference","useRef","topBarReference","contentReference","pressed","setPressed","useState","animationId","moveOffset","initialYCoordinate","useConditionalListener","attachListener","open","isServerSide","callback","current","classList","isContentScrollPositionAtTop","add","remove","eventType","parent","undefined","document","move","newHeight","style","transform","close","event","removeProperty","onClose","onSwipeStart","touches","clientY","onSwipeMove","offset","calculateOffsetAfterMove","requestAnimationFrame","onSwipeEnd","cancelAnimationFrame","scrollTop","afterMoveYCoordinate","setContentMaxHeight","safeZoneHeight","topbarHeight","windowHight","window","innerHeight","screenHeight","maxHeight","is400Zoom","useMedia","Breakpoint","ZOOM_400","overlayId","useContext","OverlayIdContext","_jsx","Drawer","className","children","Dimmer","fadeContentOnEnter","fadeContentOnExit","SlidingPanel","ref","position","Position","BOTTOM","clsx","_jsxs","id","onTouchStart","onTouchMove","onTouchEnd","onMouseDown","onMouseMove","onMouseUp","CloseButton","size","onClick"],"mappings":";;;;;;;;;;;;;;;AAuBA,MAAMA,kBAAkB,GAAG,CAAC,CAAA;AAE5B,MAAMC,wBAAwB,GAAG,CAAC,CAAA;AAElC,MAAMC,qBAAqB,GAAG,EAAE,CAAA;AAUhC;;;;;AAKG;AACGC,MAAAA,WAAW,GAAGA,CAAC;AAAEC,EAAAA,IAAI,GAAG,QAAQ;EAAE,GAAGC,KAAAA;AAAyB,CAAA,KAAI;AACtE,EAAA,MAAMC,oBAAoB,GAAGC,MAAM,CAAiB,IAAI,CAAC,CAAA;AACzD,EAAA,MAAMC,eAAe,GAAGD,MAAM,CAAiB,IAAI,CAAC,CAAA;AACpD,EAAA,MAAME,gBAAgB,GAAGF,MAAM,CAAiB,IAAI,CAAC,CAAA;EAErD,MAAM,CAACG,OAAO,EAAEC,UAAU,CAAC,GAAGC,QAAQ,CAAU,KAAK,CAAC,CAAA;AAE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QAAA,gBAEtBU,IAAA,CAAA,KAAA,EAAA;AAAKL,UAAAA,GAAG,EAAEhE,eAAgB;AAAC0D,UAAAA,SAAS,EAAC,0BAA0B;AAAAC,UAAAA,QAAA,gBAC7DH,GAAA,CAAA,KAAA,EAAA;AAAKE,YAAAA,SAAS,EAAC,0BAAA;AAA0B,WACzC,CAAA,eAAAF,GAAA,CAACqB,WAAW,EAAA;AAACC,YAAAA,IAAI,EAAC,IAAI;AAACpB,YAAAA,SAAS,EAAC,oCAAoC;AAACqB,YAAAA,OAAO,EAAErD,KAAAA;AAAM,WACvF,CAAA,CAAA;SAAK,CACL,eAAA8B,GAAA,CAAA,KAAA,EAAA;AACEQ,UAAAA,GAAG,EAAE/D,gBAAiB;UACtBuB,KAAK,EAAEiB,mBAAmB,EAAG;AAC7BiB,UAAAA,SAAS,EAAC,0BAA0B;UAAAC,QAAA,EAEnC9D,KAAK,CAAC8D,QAAAA;AAAQ,SACZ,CACP,CAAA;OAAK,CAAA;KACO,CAAA;AAChB,GAAQ,CACT,CAAA;AACH;;;;"}
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var clsx = require('clsx');
4
6
  var React = require('react');
5
7
  var CloseButton = require('../closeButton/CloseButton.js');
@@ -41,5 +43,5 @@ const Card = /*#__PURE__*/React.forwardRef(({
41
43
  });
42
44
  Card.displayName = 'Card';
43
45
 
44
- module.exports = Card;
46
+ exports.default = Card;
45
47
  //# sourceMappingURL=Card.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","sources":["../../../src/common/card/Card.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { MouseEvent, type ReactNode, forwardRef, useRef } from 'react';\n\nimport { CloseButton } from '../closeButton';\nimport { stopPropagation } from '../domHelpers';\n\nexport interface CardProps {\n /** Content to display inside Card. */\n children: ReactNode;\n\n /** Optional prop to specify classNames onto the Card */\n className?: string;\n\n /** Optional prop to specify the ID on to Card */\n id?: string;\n\n /** Specify whether the Card is disabled, or not */\n isDisabled?: boolean;\n\n /** Specify whether the Card is sized small or not */\n isSmall?: boolean;\n\n /** Optionally specify Card onDismiss function */\n onDismiss?: () => void;\n\n /** Optional prop to specify the ID used for testing */\n testId?: string;\n}\n\n/**\n * Card component.\n *\n * A card is a container for content that is used to group related information.\n * It can be used to display information in a structured way, and can be\n * customized with various props to suit different use cases.\n *\n * @param {Object} props - The component props.\n * @param {ReactNode} children - The content to display inside the card.\n * @param {string} className - Optional class name(s) to add to the card container.\n * @param {string} id - Optional ID to add to the card container.\n * @param {boolean} isDisabled - Whether the card is disabled or not.\n * @param {boolean} isSmall - Whether the card is small or not.\n * @param {(event_: MouseEvent<HTMLButtonElement>) => void} onDismiss - Optional function to call when the card is dismissed.\n * @param {string} testId - Optional ID to add to the card container for testing purposes.\n * @returns {React.JSX.Element} - The card component.\n * @example\n * <Card>\n * <p>Hello World!</p>\n * </Card>\n */\nconst Card = forwardRef<HTMLDivElement, CardProps>(\n (\n {\n className,\n children = null,\n id,\n isDisabled = false,\n isSmall = false,\n onDismiss,\n testId,\n ...props\n },\n ref,\n ) => {\n const closeButtonReference = useRef(null);\n\n return (\n <div\n ref={ref}\n className={clsx(\n 'np-Card',\n {\n 'np-Card--small': !!isSmall,\n 'is-disabled': !!isDisabled,\n },\n className,\n )}\n id={id}\n data-testid={testId}\n {...props}\n >\n {onDismiss && (\n <CloseButton\n ref={closeButtonReference}\n className=\"np-Card-closeButton\"\n size={isSmall ? 'sm' : 'md'}\n isDisabled={isDisabled}\n testId=\"close-button\"\n onClick={(e) => {\n stopPropagation(e);\n onDismiss();\n }}\n />\n )}\n {children}\n </div>\n );\n },\n);\n\nCard.displayName = 'Card';\n\nexport default Card;\n"],"names":["Card","forwardRef","className","children","id","isDisabled","isSmall","onDismiss","testId","props","ref","closeButtonReference","useRef","_jsxs","clsx","_jsx","CloseButton","size","onClick","e","stopPropagation","displayName"],"mappings":";;;;;;;;AAkDA,MAAMA,IAAI,gBAAGC,gBAAU,CACrB,CACE;EACEC,SAAS;AACTC,EAAAA,QAAQ,GAAG,IAAI;EACfC,EAAE;AACFC,EAAAA,UAAU,GAAG,KAAK;AAClBC,EAAAA,OAAO,GAAG,KAAK;EACfC,SAAS;EACTC,MAAM;EACN,GAAGC,KAAAA;AAAK,CACT,EACDC,GAAG,KACD;AACF,EAAA,MAAMC,oBAAoB,GAAGC,YAAM,CAAC,IAAI,CAAC,CAAA;AAEzC,EAAA,oBACEC,eAAA,CAAA,KAAA,EAAA;AACEH,IAAAA,GAAG,EAAEA,GAAI;AACTR,IAAAA,SAAS,EAAEY,SAAI,CACb,SAAS,EACT;MACE,gBAAgB,EAAE,CAAC,CAACR,OAAO;MAC3B,aAAa,EAAE,CAAC,CAACD,UAAAA;KAClB,EACDH,SAAS,CACT;AACFE,IAAAA,EAAE,EAAEA,EAAG;AACP,IAAA,aAAA,EAAaI,MAAO;AAAA,IAAA,GAChBC,KAAK;AAAAN,IAAAA,QAAA,EAERI,CAAAA,SAAS,iBACRQ,cAAA,CAACC,uBAAW,EAAA;AACVN,MAAAA,GAAG,EAAEC,oBAAqB;AAC1BT,MAAAA,SAAS,EAAC,qBAAqB;AAC/Be,MAAAA,IAAI,EAAEX,OAAO,GAAG,IAAI,GAAG,IAAK;AAC5BD,MAAAA,UAAU,EAAEA,UAAW;AACvBG,MAAAA,MAAM,EAAC,cAAc;MACrBU,OAAO,EAAGC,CAAC,IAAI;QACbC,gCAAe,CAACD,CAAC,CAAC,CAAA;AAClBZ,QAAAA,SAAS,EAAE,CAAA;AACb,OAAA;KACA,CACH,EACAJ,QAAQ,CAAA;AAAA,GACN,CAAC,CAAA;AAEV,CAAC,EACF;AAEDH,IAAI,CAACqB,WAAW,GAAG,MAAM;;;;"}
1
+ {"version":3,"file":"Card.js","sources":["../../../src/common/card/Card.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { MouseEvent, type ReactNode, forwardRef, useRef } from 'react';\n\nimport { CloseButton } from '../closeButton';\nimport { stopPropagation } from '../domHelpers';\n\nexport interface CardProps {\n /** Content to display inside Card. */\n children: ReactNode;\n\n /** Optional prop to specify classNames onto the Card */\n className?: string;\n\n /** Optional prop to specify the ID on to Card */\n id?: string;\n\n /** Specify whether the Card is disabled, or not */\n isDisabled?: boolean;\n\n /** Specify whether the Card is sized small or not */\n isSmall?: boolean;\n\n /** Optionally specify Card onDismiss function */\n onDismiss?: () => void;\n\n /** Optional prop to specify the ID used for testing */\n testId?: string;\n}\n\n/**\n * Card component.\n *\n * A card is a container for content that is used to group related information.\n * It can be used to display information in a structured way, and can be\n * customized with various props to suit different use cases.\n *\n * @param {Object} props - The component props.\n * @param {ReactNode} children - The content to display inside the card.\n * @param {string} className - Optional class name(s) to add to the card container.\n * @param {string} id - Optional ID to add to the card container.\n * @param {boolean} isDisabled - Whether the card is disabled or not.\n * @param {boolean} isSmall - Whether the card is small or not.\n * @param {(event_: MouseEvent<HTMLButtonElement>) => void} onDismiss - Optional function to call when the card is dismissed.\n * @param {string} testId - Optional ID to add to the card container for testing purposes.\n * @returns {React.JSX.Element} - The card component.\n * @example\n * <Card>\n * <p>Hello World!</p>\n * </Card>\n */\nconst Card = forwardRef<HTMLDivElement, CardProps>(\n (\n {\n className,\n children = null,\n id,\n isDisabled = false,\n isSmall = false,\n onDismiss,\n testId,\n ...props\n },\n ref,\n ) => {\n const closeButtonReference = useRef(null);\n\n return (\n <div\n ref={ref}\n className={clsx(\n 'np-Card',\n {\n 'np-Card--small': !!isSmall,\n 'is-disabled': !!isDisabled,\n },\n className,\n )}\n id={id}\n data-testid={testId}\n {...props}\n >\n {onDismiss && (\n <CloseButton\n ref={closeButtonReference}\n className=\"np-Card-closeButton\"\n size={isSmall ? 'sm' : 'md'}\n isDisabled={isDisabled}\n testId=\"close-button\"\n onClick={(e) => {\n stopPropagation(e);\n onDismiss();\n }}\n />\n )}\n {children}\n </div>\n );\n },\n);\n\nCard.displayName = 'Card';\n\nexport default Card;\n"],"names":["Card","forwardRef","className","children","id","isDisabled","isSmall","onDismiss","testId","props","ref","closeButtonReference","useRef","_jsxs","clsx","_jsx","CloseButton","size","onClick","e","stopPropagation","displayName"],"mappings":";;;;;;;;;;AAkDA,MAAMA,IAAI,gBAAGC,gBAAU,CACrB,CACE;EACEC,SAAS;AACTC,EAAAA,QAAQ,GAAG,IAAI;EACfC,EAAE;AACFC,EAAAA,UAAU,GAAG,KAAK;AAClBC,EAAAA,OAAO,GAAG,KAAK;EACfC,SAAS;EACTC,MAAM;EACN,GAAGC,KAAAA;AAAK,CACT,EACDC,GAAG,KACD;AACF,EAAA,MAAMC,oBAAoB,GAAGC,YAAM,CAAC,IAAI,CAAC,CAAA;AAEzC,EAAA,oBACEC,eAAA,CAAA,KAAA,EAAA;AACEH,IAAAA,GAAG,EAAEA,GAAI;AACTR,IAAAA,SAAS,EAAEY,SAAI,CACb,SAAS,EACT;MACE,gBAAgB,EAAE,CAAC,CAACR,OAAO;MAC3B,aAAa,EAAE,CAAC,CAACD,UAAAA;KAClB,EACDH,SAAS,CACT;AACFE,IAAAA,EAAE,EAAEA,EAAG;AACP,IAAA,aAAA,EAAaI,MAAO;AAAA,IAAA,GAChBC,KAAK;AAAAN,IAAAA,QAAA,EAERI,CAAAA,SAAS,iBACRQ,cAAA,CAACC,uBAAW,EAAA;AACVN,MAAAA,GAAG,EAAEC,oBAAqB;AAC1BT,MAAAA,SAAS,EAAC,qBAAqB;AAC/Be,MAAAA,IAAI,EAAEX,OAAO,GAAG,IAAI,GAAG,IAAK;AAC5BD,MAAAA,UAAU,EAAEA,UAAW;AACvBG,MAAAA,MAAM,EAAC,cAAc;MACrBU,OAAO,EAAGC,CAAC,IAAI;QACbC,gCAAe,CAACD,CAAC,CAAC,CAAA;AAClBZ,QAAAA,SAAS,EAAE,CAAA;AACb,OAAA;KACA,CACH,EACAJ,QAAQ,CAAA;AAAA,GACN,CAAC,CAAA;AAEV,CAAC,EACF;AAEDH,IAAI,CAACqB,WAAW,GAAG,MAAM;;;;"}
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var React = require('react');
4
6
  var clsx = require('clsx');
5
7
  var useMedia = require('../hooks/useMedia.js');
@@ -56,5 +58,5 @@ const Circle = /*#__PURE__*/React.forwardRef(function Circle({
56
58
  });
57
59
  });
58
60
 
59
- module.exports = Circle;
61
+ exports.default = Circle;
60
62
  //# sourceMappingURL=Circle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Circle.js","sources":["../../../src/common/circle/Circle.tsx"],"sourcesContent":["import { HTMLAttributes, forwardRef } from 'react';\nimport { clsx } from 'clsx';\nimport { useMedia } from '../hooks/useMedia';\nimport { Breakpoint } from '../propsValues/breakpoint';\n\nexport type ShapeSize = 16 | 24 | 32 | 40 | 48 | 56 | 72;\n\nexport type Props = {\n /**\n * Modify underlying element, `div` by default\n */\n as?: React.ElementType;\n /**\n * Set size of the circle in px, `48` by default\n */\n size?: ShapeSize;\n /**\n * When `true` will use the fixed size (`48px`) instead of the CSS spacing variable (`--size-*`)\n * as those can be dynamic a at certain viewport sizes\n */\n fixedSize?: boolean;\n enableBorder?: boolean;\n} & HTMLAttributes<HTMLDivElement>;\n\n/**\n * circle like components has custom sizes for icons\n */\nconst MAP_ICON_SIZE = {\n 16: 12,\n 24: 16,\n 32: 18,\n 40: 20,\n 48: 24,\n 56: 28,\n 72: 36,\n};\n\n/**\n * circle like components have custom typography styles for for default (Inter) font\n *\n * circle size : font size (px)\n */\nconst MAP_FONT_SIZE = {\n 16: 8,\n 24: 12,\n 32: 14,\n 40: 18,\n 48: 22,\n 56: 26,\n 72: 30,\n};\n\nconst Circle = forwardRef(function Circle(\n {\n as: Element = 'div',\n children,\n size = 48,\n fixedSize = false,\n enableBorder = false,\n className,\n style,\n ...props\n }: Props,\n ref,\n) {\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n return (\n <Element\n {...props}\n ref={ref}\n style={{\n '--circle-size': fixedSize ? `${size}px` : `var(--size-${size})`,\n '--circle-icon-size':\n isTinyViewport && !fixedSize\n ? `${MAP_ICON_SIZE[size] / 2}px`\n : `${MAP_ICON_SIZE[size]}px`,\n '--circle-font-size': `${MAP_FONT_SIZE[size]}px`,\n ...style,\n }}\n className={clsx(\n 'np-circle',\n { 'np-circle-border': enableBorder },\n 'd-flex align-items-center justify-content-center',\n className,\n )}\n >\n {children}\n </Element>\n );\n});\n\nexport default Circle;\n"],"names":["MAP_ICON_SIZE","MAP_FONT_SIZE","Circle","forwardRef","as","Element","children","size","fixedSize","enableBorder","className","style","props","ref","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","clsx"],"mappings":";;;;;;;;AA2BA,MAAMA,aAAa,GAAG;AACpB,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAA;CACL,CAAA;AAED;;;;AAIG;AACH,MAAMC,aAAa,GAAG;AACpB,EAAA,EAAE,EAAE,CAAC;AACL,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAA;CACL,CAAA;AAED,MAAMC,MAAM,gBAAGC,gBAAU,CAAC,SAASD,MAAMA,CACvC;EACEE,EAAE,EAAEC,OAAO,GAAG,KAAK;EACnBC,QAAQ;AACRC,EAAAA,IAAI,GAAG,EAAE;AACTC,EAAAA,SAAS,GAAG,KAAK;AACjBC,EAAAA,YAAY,GAAG,KAAK;EACpBC,SAAS;EACTC,KAAK;EACL,GAAGC,KAAAA;AAAK,CACF,EACRC,GAAG,EAAA;EAEH,MAAMC,cAAc,GAAGC,iBAAQ,CAAC,eAAeC,qBAAU,CAACC,QAAQ,CAAA,GAAA,CAAK,CAAC,CAAA;EACxE,oBACEC,cAAA,CAACb,OAAO,EAAA;AAAA,IAAA,GACFO,KAAK;AACTC,IAAAA,GAAG,EAAEA,GAAI;AACTF,IAAAA,KAAK,EAAE;MACL,eAAe,EAAEH,SAAS,GAAG,CAAA,EAAGD,IAAI,CAAI,EAAA,CAAA,GAAG,CAAcA,WAAAA,EAAAA,IAAI,CAAG,CAAA,CAAA;MAChE,oBAAoB,EAClBO,cAAc,IAAI,CAACN,SAAS,GACxB,CAAA,EAAGR,aAAa,CAACO,IAAI,CAAC,GAAG,CAAC,IAAI,GAC9B,CAAA,EAAGP,aAAa,CAACO,IAAI,CAAC,CAAI,EAAA,CAAA;AAChC,MAAA,oBAAoB,EAAE,CAAGN,EAAAA,aAAa,CAACM,IAAI,CAAC,CAAI,EAAA,CAAA;MAChD,GAAGI,KAAAA;KACH;AACFD,IAAAA,SAAS,EAAES,SAAI,CACb,WAAW,EACX;AAAE,MAAA,kBAAkB,EAAEV,YAAAA;KAAc,EACpC,kDAAkD,EAClDC,SAAS,CACT;AAAAJ,IAAAA,QAAA,EAEDA,QAAAA;AAAQ,GACF,CAAC,CAAA;AAEd,CAAC;;;;"}
1
+ {"version":3,"file":"Circle.js","sources":["../../../src/common/circle/Circle.tsx"],"sourcesContent":["import { HTMLAttributes, forwardRef } from 'react';\nimport { clsx } from 'clsx';\nimport { useMedia } from '../hooks/useMedia';\nimport { Breakpoint } from '../propsValues/breakpoint';\n\nexport type ShapeSize = 16 | 24 | 32 | 40 | 48 | 56 | 72;\n\nexport type Props = {\n /**\n * Modify underlying element, `div` by default\n */\n as?: React.ElementType;\n /**\n * Set size of the circle in px, `48` by default\n */\n size?: ShapeSize;\n /**\n * When `true` will use the fixed size (`48px`) instead of the CSS spacing variable (`--size-*`)\n * as those can be dynamic a at certain viewport sizes\n */\n fixedSize?: boolean;\n enableBorder?: boolean;\n} & HTMLAttributes<HTMLDivElement>;\n\n/**\n * circle like components has custom sizes for icons\n */\nconst MAP_ICON_SIZE = {\n 16: 12,\n 24: 16,\n 32: 18,\n 40: 20,\n 48: 24,\n 56: 28,\n 72: 36,\n};\n\n/**\n * circle like components have custom typography styles for for default (Inter) font\n *\n * circle size : font size (px)\n */\nconst MAP_FONT_SIZE = {\n 16: 8,\n 24: 12,\n 32: 14,\n 40: 18,\n 48: 22,\n 56: 26,\n 72: 30,\n};\n\nconst Circle = forwardRef(function Circle(\n {\n as: Element = 'div',\n children,\n size = 48,\n fixedSize = false,\n enableBorder = false,\n className,\n style,\n ...props\n }: Props,\n ref,\n) {\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n return (\n <Element\n {...props}\n ref={ref}\n style={{\n '--circle-size': fixedSize ? `${size}px` : `var(--size-${size})`,\n '--circle-icon-size':\n isTinyViewport && !fixedSize\n ? `${MAP_ICON_SIZE[size] / 2}px`\n : `${MAP_ICON_SIZE[size]}px`,\n '--circle-font-size': `${MAP_FONT_SIZE[size]}px`,\n ...style,\n }}\n className={clsx(\n 'np-circle',\n { 'np-circle-border': enableBorder },\n 'd-flex align-items-center justify-content-center',\n className,\n )}\n >\n {children}\n </Element>\n );\n});\n\nexport default Circle;\n"],"names":["MAP_ICON_SIZE","MAP_FONT_SIZE","Circle","forwardRef","as","Element","children","size","fixedSize","enableBorder","className","style","props","ref","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","clsx"],"mappings":";;;;;;;;;;AA2BA,MAAMA,aAAa,GAAG;AACpB,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAE;AACN,EAAA,EAAE,EAAE,EAAA;CACL,CAAA;AAED;;;;AAIG;AACH,MAAMC,aAA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CACT;AAAAJ,IAAAA,QAAA,EAEDA,QAAAA;AAAQ,GACF,CAAC,CAAA;AAEd,CAAC;;;;"}
@@ -18,7 +18,7 @@ const CloseButton = /*#__PURE__*/React.forwardRef(function CloseButton({
18
18
  testId
19
19
  }, reference) {
20
20
  const intl = reactIntl.useIntl();
21
- ariaLabel ??= intl.formatMessage(CloseButton_messages.ariaLabel);
21
+ ariaLabel ??= intl.formatMessage(CloseButton_messages.default.ariaLabel);
22
22
  const Icon = filled ? icons.CrossCircleFill : icons.Cross;
23
23
  return /*#__PURE__*/jsxRuntime.jsx("button", {
24
24
  ref: reference,
@@ -1 +1 @@
1
- {"version":3,"file":"CloseButton.js","sources":["../../../src/common/closeButton/CloseButton.tsx"],"sourcesContent":["import { Cross, CrossCircleFill } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { forwardRef } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport { Size, SizeLarge, SizeMedium, SizeSmall, SizeExtraSmall } from '../propsValues/size';\n\nimport messages from './CloseButton.messages';\n\nexport type CloseButtonProps = Pick<\n React.ComponentPropsWithoutRef<'button'>,\n 'aria-label' | 'className' | 'onClick'\n> & {\n size?: SizeExtraSmall | SizeSmall | SizeMedium | SizeLarge;\n filled?: boolean;\n isDisabled?: boolean;\n testId?: string;\n};\n\n/**\n * @deprecated Use `<IconButton />` component instead\n */\nexport const CloseButton = forwardRef(function CloseButton(\n {\n 'aria-label': ariaLabel,\n size = Size.MEDIUM,\n filled = false,\n className,\n onClick,\n isDisabled,\n testId,\n }: CloseButtonProps,\n reference: React.ForwardedRef<HTMLButtonElement | null>,\n) {\n const intl = useIntl();\n ariaLabel ??= intl.formatMessage(messages.ariaLabel);\n const Icon = filled ? CrossCircleFill : Cross;\n\n return (\n <button\n ref={reference}\n type=\"button\"\n className={clsx(\n 'np-close-button',\n 'close btn-link',\n 'text-no-decoration',\n {\n 'np-close-button--x-small': size === Size.EXTRA_SMALL,\n 'np-close-button--large': size === Size.MEDIUM,\n 'np-close-button--x-large': size === Size.LARGE,\n },\n className,\n )}\n aria-label={ariaLabel}\n aria-disabled={isDisabled}\n disabled={isDisabled}\n data-testid={testId}\n onClick={onClick}\n >\n <Icon size={size === Size.SMALL || size === Size.EXTRA_SMALL ? 16 : 24} />\n </button>\n );\n});\n"],"names":["CloseButton","forwardRef","ariaLabel","size","Size","MEDIUM","filled","className","onClick","isDisabled","testId","reference","intl","useIntl","formatMessage","messages","Icon","CrossCircleFill","Cross","_jsx","ref","type","clsx","EXTRA_SMALL","LARGE","disabled","children","SMALL"],"mappings":";;;;;;;;;;MAsBaA,WAAW,gBAAGC,gBAAU,CAAC,SAASD,WAAWA,CACxD;AACE,EAAA,YAAY,EAAEE,SAAS;QACvBC,MAAI,GAAGC,SAAI,CAACC,MAAM;AAClBC,EAAAA,MAAM,GAAG,KAAK;EACdC,SAAS;EACTC,OAAO;EACPC,UAAU;AACVC,EAAAA,MAAAA;AAAM,CACW,EACnBC,SAAuD,EAAA;AAEvD,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE,CAAA;EACtBX,SAAS,KAAKU,IAAI,CAACE,aAAa,CAACC,oBAAQ,CAACb,SAAS,CAAC,CAAA;AACpD,EAAA,MAAMc,IAAI,GAAGV,MAAM,GAAGW,qBAAe,GAAGC,WAAK,CAAA;AAE7C,EAAA,oBACEC,cAAA,CAAA,QAAA,EAAA;AACEC,IAAAA,GAAG,EAAET,SAAU;AACfU,IAAAA,IAAI,EAAC,QAAQ;IACbd,SAAS,EAAEe,SAAI,CACb,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB;AACE,MAAA,0BAA0B,EAAEnB,MAAI,KAAKC,SAAI,CAACmB,WAAW;AACrD,MAAA,wBAAwB,EAAEpB,MAAI,KAAKC,SAAI,CAACC,MAAM;AAC9C,MAAA,0BAA0B,EAAEF,MAAI,KAAKC,SAAI,CAACoB,KAAAA;KAC3C,EACDjB,SAAS,CACT;AACF,IAAA,YAAA,EAAYL,SAAU;AACtB,IAAA,eAAA,EAAeO,UAAW;AAC1BgB,IAAAA,QAAQ,EAAEhB,UAAW;AACrB,IAAA,aAAA,EAAaC,MAAO;AACpBF,IAAAA,OAAO,EAAEA,OAAQ;IAAAkB,QAAA,eAEjBP,cAAA,CAACH,IAAI,EAAA;AAACb,MAAAA,IAAI,EAAEA,MAAI,KAAKC,SAAI,CAACuB,KAAK,IAAIxB,MAAI,KAAKC,SAAI,CAACmB,WAAW,GAAG,EAAE,GAAG,EAAA;KACtE,CAAA;AAAA,GAAQ,CAAC,CAAA;AAEb,CAAC;;;;"}
1
+ {"version":3,"file":"CloseButton.js","sources":["../../../src/common/closeButton/CloseButton.tsx"],"sourcesContent":["import { Cross, CrossCircleFill } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { forwardRef } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport { Size, SizeLarge, SizeMedium, SizeSmall, SizeExtraSmall } from '../propsValues/size';\n\nimport messages from './CloseButton.messages';\n\nexport type CloseButtonProps = Pick<\n React.ComponentPropsWithoutRef<'button'>,\n 'aria-label' | 'className' | 'onClick'\n> & {\n size?: SizeExtraSmall | SizeSmall | SizeMedium | SizeLarge;\n filled?: boolean;\n isDisabled?: boolean;\n testId?: string;\n};\n\n/**\n * @deprecated Use `<IconButton />` component instead\n */\nexport const CloseButton = forwardRef(function CloseButton(\n {\n 'aria-label': ariaLabel,\n size = Size.MEDIUM,\n filled = false,\n className,\n onClick,\n isDisabled,\n testId,\n }: CloseButtonProps,\n reference: React.ForwardedRef<HTMLButtonElement | null>,\n) {\n const intl = useIntl();\n ariaLabel ??= intl.formatMessage(messages.ariaLabel);\n const Icon = filled ? CrossCircleFill : Cross;\n\n return (\n <button\n ref={reference}\n type=\"button\"\n className={clsx(\n 'np-close-button',\n 'close btn-link',\n 'text-no-decoration',\n {\n 'np-close-button--x-small': size === Size.EXTRA_SMALL,\n 'np-close-button--large': size === Size.MEDIUM,\n 'np-close-button--x-large': size === Size.LARGE,\n },\n className,\n )}\n aria-label={ariaLabel}\n aria-disabled={isDisabled}\n disabled={isDisabled}\n data-testid={testId}\n onClick={onClick}\n >\n <Icon size={size === Size.SMALL || size === Size.EXTRA_SMALL ? 16 : 24} />\n </button>\n );\n});\n"],"names":["CloseButton","forwardRef","ariaLabel","size","Size","MEDIUM","filled","className","onClick","isDisabled","testId","reference","intl","useIntl","formatMessage","messages","Icon","CrossCircleFill","Cross","_jsx","ref","type","clsx","EXTRA_SMALL","LARGE","disabled","children","SMALL"],"mappings":";;;;;;;;;;MAsBaA,WAAW,gBAAGC,gBAAU,CAAC,SAASD,WAAWA,CACxD;AACE,EAAA,YAAY,EAAEE,SAAS;QACvBC,MAAI,GAAGC,SAAI,CAACC,MAAM;AAClBC,EAAAA,MAAM,GAAG,KAAK;EACdC,SAAS;EACTC,OAAO;EACPC,UAAU;AACVC,EAAAA,MAAAA;AAAM,CACW,EACnBC,SAAuD,EAAA;AAEvD,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE,CAAA;EACtBX,SAAS,KAAKU,IAAI,CAACE,aAAa,CAACC,4BAAQ,CAACb,SAAS,CAAC,CAAA;AACpD,EAAA,MAAMc,IAAI,GAAGV,MAAM,GAAGW,qBAAe,GAAGC,WAAK,CAAA;AAE7C,EAAA,oBACEC,cAAA,CAAA,QAAA,EAAA;AACEC,IAAAA,GAAG,EAAET,SAAU;AACfU,IAAAA,IAAI,EAAC,QAAQ;IACbd,SAAS,EAAEe,SAAI,CACb,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB;AACE,MAAA,0BAA0B,EAAEnB,MAAI,KAAKC,SAAI,CAACmB,WAAW;AACrD,MAAA,wBAAwB,EAAEpB,MAAI,KAAKC,SAAI,CAACC,MAAM;AAC9C,MAAA,0BAA0B,EAAEF,MAAI,KAAKC,SAAI,CAACoB,KAAAA;KAC3C,EACDjB,SAAS,CACT;AACF,IAAA,YAAA,EAAYL,SAAU;AACtB,IAAA,eAAA,EAAeO,UAAW;AAC1BgB,IAAAA,QAAQ,EAAEhB,UAAW;AACrB,IAAA,aAAA,EAAaC,MAAO;AACpBF,IAAAA,OAAO,EAAEA,OAAQ;IAAAkB,QAAA,eAEjBP,cAAA,CAACH,IAAI,EAAA;AAACb,MAAAA,IAAI,EAAEA,MAAI,KAAKC,SAAI,CAACuB,KAAK,IAAIxB,MAAI,KAAKC,SAAI,CAACmB,WAAW,GAAG,EAAE,GAAG,EAAA;KACtE,CAAA;AAAA,GAAQ,CAAC,CAAA;AAEb,CAAC;;;;"}
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var reactIntl = require('react-intl');
4
6
 
5
7
  var messages = reactIntl.defineMessages({
@@ -8,5 +10,5 @@ var messages = reactIntl.defineMessages({
8
10
  }
9
11
  });
10
12
 
11
- module.exports = messages;
13
+ exports.default = messages;
12
14
  //# sourceMappingURL=CloseButton.messages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CloseButton.messages.js","sources":["../../../src/common/closeButton/CloseButton.messages.ts"],"sourcesContent":["import { defineMessages } from 'react-intl';\n\nexport default defineMessages({\n ariaLabel: {\n id: 'neptune.CloseButton.ariaLabel',\n defaultMessage: 'Close',\n description: 'Description of close button',\n },\n});\n"],"names":["defineMessages","ariaLabel","id"],"mappings":";;;;AAEA,eAAeA,wBAAc,CAAC;AAC5BC,EAAAA,SAAS,EAAE;IACTC,EAAE,EAAA,+BAAA;AAGH,GAAA;AACF,CAAA,CAAC;;;;"}
1
+ {"version":3,"file":"CloseButton.messages.js","sources":["../../../src/common/closeButton/CloseButton.messages.ts"],"sourcesContent":["import { defineMessages } from 'react-intl';\n\nexport default defineMessages({\n ariaLabel: {\n id: 'neptune.CloseButton.ariaLabel',\n defaultMessage: 'Close',\n description: 'Description of close button',\n },\n});\n"],"names":["defineMessages","ariaLabel","id"],"mappings":";;;;;;AAEA,eAAeA,wBAAc,CAAC;AAC5BC,EAAAA,SAAS,EAAE;IACTC,EAAE,EAAA,+BAAA;AAGH,GAAA;AACF,CAAA,CAAC;;;;"}
@@ -3,11 +3,11 @@
3
3
  const isDateValid = date => {
4
4
  if (date === null) {
5
5
  return false;
6
- } else if (date instanceof Date) {
6
+ }
7
+ if (date instanceof Date) {
7
8
  return validDateObject(date);
8
- } else {
9
- return validDateString(date);
10
9
  }
10
+ return validDateString(date);
11
11
  };
12
12
  const validDateString = dateString => validDateObject(new Date(dateString));
13
13
  const validDateObject = dateObject => !isNaN(dateObject.getTime());
@@ -1 +1 @@
1
- {"version":3,"file":"isDateValid.js","sources":["../../../../src/common/dateUtils/isDateValid/isDateValid.ts"],"sourcesContent":["export const isDateValid = (date: Date | string | null) => {\n if (date === null) {\n return false;\n } else if (date instanceof Date) {\n return validDateObject(date);\n } else {\n return validDateString(date);\n }\n};\n\nexport const validDateString = (dateString: string) => validDateObject(new Date(dateString));\n\nconst validDateObject = (dateObject: Date) => !isNaN(dateObject.getTime());\n"],"names":["isDateValid","date","Date","validDateObject","validDateString","dateString","dateObject","isNaN","getTime"],"mappings":";;AAAaA,MAAAA,WAAW,GAAIC,IAA0B,IAAI;EACxD,IAAIA,IAAI,KAAK,IAAI,EAAE;AACjB,IAAA,OAAO,KAAK,CAAA;AACd,GAAC,MAAM,IAAIA,IAAI,YAAYC,IAAI,EAAE;IAC/B,OAAOC,eAAe,CAACF,IAAI,CAAC,CAAA;AAC9B,GAAC,MAAM;IACL,OAAOG,eAAe,CAACH,IAAI,CAAC,CAAA;AAC9B,GAAA;AACF,EAAC;AAEYG,MAAAA,eAAe,GAAIC,UAAkB,IAAKF,eAAe,CAAC,IAAID,IAAI,CAACG,UAAU,CAAC,EAAC;AAE5F,MAAMF,eAAe,GAAIG,UAAgB,IAAK,CAACC,KAAK,CAACD,UAAU,CAACE,OAAO,EAAE,CAAC;;;;;"}
1
+ {"version":3,"file":"isDateValid.js","sources":["../../../../src/common/dateUtils/isDateValid/isDateValid.ts"],"sourcesContent":["export const isDateValid = (date: Date | string | null) => {\n if (date === null) {\n return false;\n }\n\n if (date instanceof Date) {\n return validDateObject(date);\n }\n\n return validDateString(date);\n};\n\nexport const validDateString = (dateString: string) => validDateObject(new Date(dateString));\n\nconst validDateObject = (dateObject: Date) => !isNaN(dateObject.getTime());\n"],"names":["isDateValid","date","Date","validDateObject","validDateString","dateString","dateObject","isNaN","getTime"],"mappings":";;AAAaA,MAAAA,WAAW,GAAIC,IAA0B,IAAI;EACxD,IAAIA,IAAI,KAAK,IAAI,EAAE;AACjB,IAAA,OAAO,KAAK,CAAA;AACd,GAAA;EAEA,IAAIA,IAAI,YAAYC,IAAI,EAAE;IACxB,OAAOC,eAAe,CAACF,IAAI,CAAC,CAAA;AAC9B,GAAA;EAEA,OAAOG,eAAe,CAACH,IAAI,CAAC,CAAA;AAC9B,EAAC;AAEYG,MAAAA,eAAe,GAAIC,UAAkB,IAAKF,eAAe,CAAC,IAAID,IAAI,CAACG,UAAU,CAAC,EAAC;AAE5F,MAAMF,eAAe,GAAIG,UAAgB,IAAK,CAACC,KAAK,CAACD,UAAU,CAACE,OAAO,EAAE,CAAC;;;;;"}
@@ -1,11 +1,11 @@
1
1
  const isDateValid = date => {
2
2
  if (date === null) {
3
3
  return false;
4
- } else if (date instanceof Date) {
4
+ }
5
+ if (date instanceof Date) {
5
6
  return validDateObject(date);
6
- } else {
7
- return validDateString(date);
8
7
  }
8
+ return validDateString(date);
9
9
  };
10
10
  const validDateString = dateString => validDateObject(new Date(dateString));
11
11
  const validDateObject = dateObject => !isNaN(dateObject.getTime());
@@ -1 +1 @@
1
- {"version":3,"file":"isDateValid.mjs","sources":["../../../../src/common/dateUtils/isDateValid/isDateValid.ts"],"sourcesContent":["export const isDateValid = (date: Date | string | null) => {\n if (date === null) {\n return false;\n } else if (date instanceof Date) {\n return validDateObject(date);\n } else {\n return validDateString(date);\n }\n};\n\nexport const validDateString = (dateString: string) => validDateObject(new Date(dateString));\n\nconst validDateObject = (dateObject: Date) => !isNaN(dateObject.getTime());\n"],"names":["isDateValid","date","Date","validDateObject","validDateString","dateString","dateObject","isNaN","getTime"],"mappings":"AAAaA,MAAAA,WAAW,GAAIC,IAA0B,IAAI;EACxD,IAAIA,IAAI,KAAK,IAAI,EAAE;AACjB,IAAA,OAAO,KAAK,CAAA;AACd,GAAC,MAAM,IAAIA,IAAI,YAAYC,IAAI,EAAE;IAC/B,OAAOC,eAAe,CAACF,IAAI,CAAC,CAAA;AAC9B,GAAC,MAAM;IACL,OAAOG,eAAe,CAACH,IAAI,CAAC,CAAA;AAC9B,GAAA;AACF,EAAC;AAEYG,MAAAA,eAAe,GAAIC,UAAkB,IAAKF,eAAe,CAAC,IAAID,IAAI,CAACG,UAAU,CAAC,EAAC;AAE5F,MAAMF,eAAe,GAAIG,UAAgB,IAAK,CAACC,KAAK,CAACD,UAAU,CAACE,OAAO,EAAE,CAAC;;;;"}
1
+ {"version":3,"file":"isDateValid.mjs","sources":["../../../../src/common/dateUtils/isDateValid/isDateValid.ts"],"sourcesContent":["export const isDateValid = (date: Date | string | null) => {\n if (date === null) {\n return false;\n }\n\n if (date instanceof Date) {\n return validDateObject(date);\n }\n\n return validDateString(date);\n};\n\nexport const validDateString = (dateString: string) => validDateObject(new Date(dateString));\n\nconst validDateObject = (dateObject: Date) => !isNaN(dateObject.getTime());\n"],"names":["isDateValid","date","Date","validDateObject","validDateString","dateString","dateObject","isNaN","getTime"],"mappings":"AAAaA,MAAAA,WAAW,GAAIC,IAA0B,IAAI;EACxD,IAAIA,IAAI,KAAK,IAAI,EAAE;AACjB,IAAA,OAAO,KAAK,CAAA;AACd,GAAA;EAEA,IAAIA,IAAI,YAAYC,IAAI,EAAE;IACxB,OAAOC,eAAe,CAACF,IAAI,CAAC,CAAA;AAC9B,GAAA;EAEA,OAAOG,eAAe,CAACH,IAAI,CAAC,CAAA;AAC9B,EAAC;AAEYG,MAAAA,eAAe,GAAIC,UAAkB,IAAKF,eAAe,CAAC,IAAID,IAAI,CAACG,UAAU,CAAC,EAAC;AAE5F,MAAMF,eAAe,GAAIG,UAAgB,IAAK,CAACC,KAAK,CAACD,UAAU,CAACE,OAAO,EAAE,CAAC;;;;"}
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var clsx = require('clsx');
4
6
  var React = require('react');
5
7
  var layouts = require('../propsValues/layouts.js');
@@ -46,5 +48,5 @@ const FlowHeader = /*#__PURE__*/React__namespace.forwardRef(({
46
48
  });
47
49
  });
48
50
 
49
- module.exports = FlowHeader;
51
+ exports.default = FlowHeader;
50
52
  //# sourceMappingURL=FlowHeader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FlowHeader.js","sources":["../../../src/common/flowHeader/FlowHeader.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport * as React from 'react';\n\nimport { Layout } from '../propsValues/layouts';\n\nexport interface FlowHeaderProps {\n bottomContent?: React.ReactNode;\n className?: string;\n layout?: Layout.VERTICAL | Layout.HORIZONTAL;\n leftContent?: React.ReactNode;\n rightContent?: React.ReactNode;\n}\n\nconst FlowHeader = React.forwardRef(\n (\n {\n bottomContent,\n className,\n layout = Layout.HORIZONTAL,\n leftContent,\n rightContent,\n }: FlowHeaderProps,\n reference: React.ForwardedRef<HTMLDivElement | null>,\n ) => {\n const isVertical = layout === Layout.VERTICAL;\n\n return (\n <div\n ref={reference}\n className={clsx(\n 'np-flow-header',\n 'd-flex',\n 'flex-wrap',\n 'align-items-center',\n 'justify-content-between',\n 'flex__item--12',\n className,\n )}\n >\n {leftContent}\n {rightContent}\n <div\n className={clsx('align-items-center', 'd-flex', 'justify-content-center', {\n 'flex__item--12': isVertical,\n 'order-1 flex-grow-1': !isVertical,\n })}\n >\n {bottomContent}\n </div>\n </div>\n );\n },\n);\n\nexport default FlowHeader;\n"],"names":["FlowHeader","React","forwardRef","bottomContent","className","layout","Layout","HORIZONTAL","leftContent","rightContent","reference","isVertical","VERTICAL","_jsxs","ref","clsx","children","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,MAAMA,UAAU,gBAAGC,gBAAK,CAACC,UAAU,CACjC,CACE;EACEC,aAAa;EACbC,SAAS;EACTC,MAAM,GAAGC,cAAM,CAACC,UAAU;EAC1BC,WAAW;AACXC,EAAAA,YAAAA;AACgB,CAAA,EAClBC,SAAoD,KAClD;AACF,EAAA,MAAMC,UAAU,GAAGN,MAAM,KAAKC,cAAM,CAACM,QAAQ,CAAA;AAE7C,EAAA,oBACEC,eAAA,CAAA,KAAA,EAAA;AACEC,IAAAA,GAAG,EAAEJ,SAAU;AACfN,IAAAA,SAAS,EAAEW,SAAI,CACb,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACX,oBAAoB,EACpB,yBAAyB,EACzB,gBAAgB,EAChBX,SAAS,CACT;AAAAY,IAAAA,QAAA,EAEDR,CAAAA,WAAW,EACXC,YAAY,eACbQ,cAAA,CAAA,KAAA,EAAA;MACEb,SAAS,EAAEW,SAAI,CAAC,oBAAoB,EAAE,QAAQ,EAAE,wBAAwB,EAAE;AACxE,QAAA,gBAAgB,EAAEJ,UAAU;AAC5B,QAAA,qBAAqB,EAAE,CAACA,UAAAA;AACzB,OAAA,CAAE;AAAAK,MAAAA,QAAA,EAEFb,aAAAA;AAAa,KACX,CACP,CAAA;AAAA,GAAK,CAAC,CAAA;AAEV,CAAC;;;;"}
1
+ {"version":3,"file":"FlowHeader.js","sources":["../../../src/common/flowHeader/FlowHeader.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport * as React from 'react';\n\nimport { Layout } from '../propsValues/layouts';\n\nexport interface FlowHeaderProps {\n bottomContent?: React.ReactNode;\n className?: string;\n layout?: Layout.VERTICAL | Layout.HORIZONTAL;\n leftContent?: React.ReactNode;\n rightContent?: React.ReactNode;\n}\n\nconst FlowHeader = React.forwardRef(\n (\n {\n bottomContent,\n className,\n layout = Layout.HORIZONTAL,\n leftContent,\n rightContent,\n }: FlowHeaderProps,\n reference: React.ForwardedRef<HTMLDivElement | null>,\n ) => {\n const isVertical = layout === Layout.VERTICAL;\n\n return (\n <div\n ref={reference}\n className={clsx(\n 'np-flow-header',\n 'd-flex',\n 'flex-wrap',\n 'align-items-center',\n 'justify-content-between',\n 'flex__item--12',\n className,\n )}\n >\n {leftContent}\n {rightContent}\n <div\n className={clsx('align-items-center', 'd-flex', 'justify-content-center', {\n 'flex__item--12': isVertical,\n 'order-1 flex-grow-1': !isVertical,\n })}\n >\n {bottomContent}\n </div>\n </div>\n );\n },\n);\n\nexport default FlowHeader;\n"],"names":["FlowHeader","React","forwardRef","bottomContent","className","layout","Layout","HORIZONTAL","leftContent","rightContent","reference","isVertical","VERTICAL","_jsxs","ref","clsx","children","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,MAAMA,UAAU,gBAAGC,gBAAK,CAACC,UAAU,CACjC,CACE;EACEC,aAAa;EACbC,SAAS;EACTC,MAAM,GAAGC,cAAM,CAACC,UAAU;EAC1BC,WAAW;AACXC,EAAAA,YAAAA;AACgB,CAAA,EAClBC,SAAoD,KAClD;AACF,EAAA,MAAMC,UAAU,GAAGN,MAAM,KAAKC,cAAM,CAACM,QAAQ,CAAA;AAE7C,EAAA,oBACEC,eAAA,CAAA,KAAA,EAAA;AACEC,IAAAA,GAAG,EAAEJ,SAAU;AACfN,IAAAA,SAAS,EAAEW,SAAI,CACb,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACX,oBAAoB,EACpB,yBAAyB,EACzB,gBAAgB,EAChBX,SAAS,CACT;AAAAY,IAAAA,QAAA,EAEDR,CAAAA,WAAW,EACXC,YAAY,eACbQ,cAAA,CAAA,KAAA,EAAA;MACEb,SAAS,EAAEW,SAAI,CAAC,oBAAoB,EAAE,QAAQ,EAAE,wBAAwB,EAAE;AACxE,QAAA,gBAAgB,EAAEJ,UAAU;AAC5B,QAAA,qBAAqB,EAAE,CAACA,UAAAA;AACzB,OAAA,CAAE;AAAAK,MAAAA,QAAA,EAEFb,aAAAA;AAAa,KACX,CACP,CAAA;AAAA,GAAK,CAAC,CAAA;AAEV,CAAC;;;;"}
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var focus = require('@react-aria/focus');
4
6
  var React = require('react');
5
7
  var jsxRuntime = require('react/jsx-runtime');
@@ -24,5 +26,5 @@ const FocusBoundary = ({
24
26
  });
25
27
  };
26
28
 
27
- module.exports = FocusBoundary;
29
+ exports.default = FocusBoundary;
28
30
  //# sourceMappingURL=FocusBoundary.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FocusBoundary.js","sources":["../../../src/common/focusBoundary/FocusBoundary.tsx"],"sourcesContent":["import { FocusScope } from '@react-aria/focus';\nimport { useEffect, useRef } from 'react';\n\ntype FocusBoundaryProps = {\n children: React.ReactNode;\n};\n\nconst FocusBoundary = ({ children }: FocusBoundaryProps) => {\n const wrapperReference = useRef<HTMLDivElement>(null);\n useEffect(() => {\n wrapperReference.current?.focus({ preventScroll: true });\n }, []);\n\n return (\n <FocusScope contain restoreFocus>\n <div ref={wrapperReference} tabIndex={-1}>\n {children}\n </div>\n </FocusScope>\n );\n};\n\nexport default FocusBoundary;\n"],"names":["FocusBoundary","children","wrapperReference","useRef","useEffect","current","focus","preventScroll","_jsx","FocusScope","contain","restoreFocus","ref","tabIndex"],"mappings":";;;;;;AAOMA,MAAAA,aAAa,GAAGA,CAAC;AAAEC,EAAAA,QAAAA;AAAQ,CAAsB,KAAI;AACzD,EAAA,MAAMC,gBAAgB,GAAGC,YAAM,CAAiB,IAAI,CAAC,CAAA;AACrDC,EAAAA,eAAS,CAAC,MAAK;AACbF,IAAAA,gBAAgB,CAACG,OAAO,EAAEC,KAAK,CAAC;AAAEC,MAAAA,aAAa,EAAE,IAAA;AAAM,KAAA,CAAC,CAAA;GACzD,EAAE,EAAE,CAAC,CAAA;EAEN,oBACEC,cAAA,CAACC,gBAAU,EAAA;IAACC,OAAO,EAAA,IAAA;IAACC,YAAY,EAAA,IAAA;AAAAV,IAAAA,QAAA,eAC9BO,cAAA,CAAA,KAAA,EAAA;AAAKI,MAAAA,GAAG,EAAEV,gBAAiB;MAACW,QAAQ,EAAE,CAAC,CAAE;AAAAZ,MAAAA,QAAA,EACtCA,QAAAA;KACE,CAAA;AACP,GAAY,CAAC,CAAA;AAEjB;;;;"}
1
+ {"version":3,"file":"FocusBoundary.js","sources":["../../../src/common/focusBoundary/FocusBoundary.tsx"],"sourcesContent":["import { FocusScope } from '@react-aria/focus';\nimport { useEffect, useRef } from 'react';\n\ntype FocusBoundaryProps = {\n children: React.ReactNode;\n};\n\nconst FocusBoundary = ({ children }: FocusBoundaryProps) => {\n const wrapperReference = useRef<HTMLDivElement>(null);\n useEffect(() => {\n wrapperReference.current?.focus({ preventScroll: true });\n }, []);\n\n return (\n <FocusScope contain restoreFocus>\n <div ref={wrapperReference} tabIndex={-1}>\n {children}\n </div>\n </FocusScope>\n );\n};\n\nexport default FocusBoundary;\n"],"names":["FocusBoundary","children","wrapperReference","useRef","useEffect","current","focus","preventScroll","_jsx","FocusScope","contain","restoreFocus","ref","tabIndex"],"mappings":";;;;;;;;AAOMA,MAAAA,aAAa,GAAGA,CAAC;AAAEC,EAAAA,QAAAA;AAAQ,CAAsB,KAAI;AACzD,EAAA,MAAMC,gBAAgB,GAAGC,YAAM,CAAiB,IAAI,CAAC,CAAA;AACrDC,EAAAA,eAAS,CAAC,MAAK;AACbF,IAAAA,gBAAgB,CAACG,OAAO,EAAEC,KAAK,CAAC;AAAEC,MAAAA,aAAa,EAAE,IAAA;AAAM,KAAA,CAAC,CAAA;GACzD,EAAE,EAAE,CAAC,CAAA;EAEN,oBACEC,cAAA,CAACC,gBAAU,EAAA;IAACC,OAAO,EAAA,IAAA;IAACC,YAAY,EAAA,IAAA;AAAAV,IAAAA,QAAA,eAC9BO,cAAA,CAAA,KAAA,EAAA;AAAKI,MAAAA,GAAG,EAAEV,gBAAiB;MAACW,QAAQ,EAAE,CAAC,CAAE;AAAAZ,MAAAA,QAAA,EACtCA,QAAAA;KACE,CAAA;AACP,GAAY,CAAC,CAAA;AAEjB;;;;"}
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  class HistoryNavigator {
4
6
  history;
5
7
  currIndex;
@@ -35,5 +37,5 @@ class HistoryNavigator {
35
37
  };
36
38
  }
37
39
 
38
- module.exports = HistoryNavigator;
40
+ exports.default = HistoryNavigator;
39
41
  //# sourceMappingURL=historyNavigator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"historyNavigator.js","sources":["../../../src/common/historyNavigator/historyNavigator.ts"],"sourcesContent":["class HistoryNavigator {\n history: (string | number)[];\n currIndex: number;\n historyLimit: number | undefined;\n\n constructor(history?: (string | number)[], historyLimit?: number) {\n this.history = history && history.length > 0 ? history : [''];\n this.currIndex = this.history.length - 1;\n this.historyLimit = historyLimit;\n }\n\n reset = (newHistory?: (string | number)[], historyLimit = 20) => {\n this.history = newHistory && newHistory.length > 0 ? newHistory : [''];\n this.currIndex = this.history.length - 1;\n this.historyLimit = historyLimit;\n };\n\n add = (element: string | number) => {\n if (!this.historyLimit || this.history.length <= this.historyLimit) {\n this.history.push(element);\n // Always keep the current Index to the latest change\n this.currIndex = this.history.length - 1;\n } else {\n // @TODO not needed now but maybe it can be useful to implement a limit.\n this.currIndex = this.history.length - 1;\n }\n };\n\n redo = () => {\n const historyLength = this.history.length;\n this.currIndex = this.currIndex + 1 < historyLength ? this.currIndex + 1 : historyLength - 1;\n return this.history[this.currIndex];\n };\n\n undo = () => {\n this.currIndex = this.currIndex - 1 > 0 ? this.currIndex - 1 : 0;\n return this.history[this.currIndex];\n };\n}\n\nexport default HistoryNavigator;\n"],"names":["HistoryNavigator","history","currIndex","historyLimit","constructor","length","reset","newHistory","add","element","push","redo","historyLength","undo"],"mappings":";;AAAA,MAAMA,gBAAgB,CAAA;EACpBC,OAAO,CAAA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,IAAI,CAACA,SAAS,GAAG,CAAC,GAAGU,aAAa,GAAG,IAAI,CAACV,SAAS,GAAG,CAAC,GAAGU,aAAa,GAAG,CAAC,CAAA;AAC5F,IAAA,OAAO,IAAI,CAACX,OAAO,CAAC,IAAI,CAACC,SAAS,CAAC,CAAA;GACpC,CAAA;EAEDW,IAAI,GAAGA,MAAK;AACV,IAAA,IAAI,CAACX,SAAS,GAAG,IAAI,CAACA,SAAS,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAACA,SAAS,GAAG,CAAC,GAAG,CAAC,CAAA;AAChE,IAAA,OAAO,IAAI,CAACD,OAAO,CAAC,IAAI,CAACC,SAAS,CAAC,CAAA;GACpC,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"historyNavigator.js","sources":["../../../src/common/historyNavigator/historyNavigator.ts"],"sourcesContent":["class HistoryNavigator {\n history: (string | number)[];\n currIndex: number;\n historyLimit: number | undefined;\n\n constructor(history?: (string | number)[], historyLimit?: number) {\n this.history = history && history.length > 0 ? history : [''];\n this.currIndex = this.history.length - 1;\n this.historyLimit = historyLimit;\n }\n\n reset = (newHistory?: (string | number)[], historyLimit = 20) => {\n this.history = newHistory && newHistory.length > 0 ? newHistory : [''];\n this.currIndex = this.history.length - 1;\n this.historyLimit = historyLimit;\n };\n\n add = (element: string | number) => {\n if (!this.historyLimit || this.history.length <= this.historyLimit) {\n this.history.push(element);\n // Always keep the current Index to the latest change\n this.currIndex = this.history.length - 1;\n } else {\n // @TODO not needed now but maybe it can be useful to implement a limit.\n this.currIndex = this.history.length - 1;\n }\n };\n\n redo = () => {\n const historyLength = this.history.length;\n this.currIndex = this.currIndex + 1 < historyLength ? this.currIndex + 1 : historyLength - 1;\n return this.history[this.currIndex];\n };\n\n undo = () => {\n this.currIndex = this.currIndex - 1 > 0 ? this.currIndex - 1 : 0;\n return this.history[this.currIndex];\n };\n}\n\nexport default HistoryNavigator;\n"],"names":["HistoryNavigator","history","currIndex","historyLimit","constructor","length","reset","newHist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Aa,GAAG,IAAI,CAACX,OAAO,CAACI,MAAM,CAAA;AACzC,IAAA,IAAI,CAACH,SAAS,GAAG,IAAI,CAACA,SAAS,GAAG,CAAC,GAAGU,aAAa,GAAG,IAAI,CAACV,SAAS,GAAG,CAAC,GAAGU,aAAa,GAAG,CAAC,CAAA;AAC5F,IAAA,OAAO,IAAI,CAACX,OAAO,CAAC,IAAI,CAACC,SAAS,CAAC,CAAA;GACpC,CAAA;EAEDW,IAAI,GAAGA,MAAK;AACV,IAAA,IAAI,CAACX,SAAS,GAAG,IAAI,CAACA,SAAS,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAACA,SAAS,GAAG,CAAC,GAAG,CAAC,CAAA;AAChE,IAAA,OAAO,IAAI,CAACD,OAAO,CAAC,IAAI,CAACC,SAAS,CAAC,CAAA;GACpC,CAAA;AACF;;;;"}
@@ -1,30 +1,6 @@
1
1
  'use strict';
2
2
 
3
- require('../theme.js');
4
3
  var direction = require('../direction.js');
5
- require('../propsValues/control.js');
6
- require('../propsValues/breakpoint.js');
7
- require('../propsValues/size.js');
8
- require('../propsValues/typography.js');
9
- require('../propsValues/width.js');
10
- require('../propsValues/type.js');
11
- require('../propsValues/dateMode.js');
12
- require('../propsValues/monthFormat.js');
13
- require('../propsValues/position.js');
14
- require('../propsValues/layouts.js');
15
- require('../propsValues/status.js');
16
- require('../propsValues/sentiment.js');
17
- require('../propsValues/profileType.js');
18
- require('../propsValues/variant.js');
19
- require('../propsValues/scroll.js');
20
- require('../propsValues/markdownNodeType.js');
21
- require('../fileType.js');
22
- require('@transferwise/icons');
23
- require('clsx');
24
- require('react');
25
- require('react-intl');
26
- require('../closeButton/CloseButton.messages.js');
27
- require('react/jsx-runtime');
28
4
 
29
5
  const DEFAULT_LANG = 'en';
30
6
  const DEFAULT_LOCALE = 'en-GB';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/common/locale/index.ts"],"sourcesContent":["import { Direction } from '..';\n\nexport const DEFAULT_LANG = 'en';\nexport const DEFAULT_LOCALE = 'en-GB';\n\n/**\n * Languages written right-to-left.\n */\nexport const RTL_LANGUAGES = ['ar', 'he'];\n\n/**\n * @deprecated The source of truth for supported languages lives in Crab.\n */\nexport const SUPPORTED_LANGUAGES = [\n DEFAULT_LANG,\n 'de',\n 'es',\n 'fr',\n 'hu',\n 'id',\n 'it',\n 'ja',\n 'pl',\n 'pt',\n 'ro',\n 'ru',\n 'th',\n 'tr',\n 'uk',\n 'zh',\n];\n\n/**\n * Verifies and adjusts locale, replacing `_` with `-`.\n *\n * @param locale `es`, `es_ES`, `en-GB`, `en`, `ja`, `ja-JP`, etc.\n * @returns `null` if locale is unrecognized by `Intl.Locale`.\n */\nexport function adjustLocale(locale: string) {\n const localeTrimmed = locale?.trim();\n if (localeTrimmed) {\n try {\n return new Intl.Locale(localeTrimmed.replace('_', '-')).baseName;\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(error);\n }\n }\n return null;\n}\n\n/**\n * Provides corresponding lang (iso2) for provided locale.\n *\n * @deprecated The use of this function almost always breaks language variants\n * e.g. Simplified and Traditional Chinese.\n * There should be no use case for this function.\n * To select the correct translations from a translations object, pass the\n * locale directly into Crab's getLocalisedMessages.\n * @param locale `es`, `es-ES`, `en-GB`, `en`, `ja`, `ja-JP`, etc.\n * @returns Two-letter ISO 639-1 language code, falling back to `null` if locale is invalid or language is unsupported.\n */\nexport function getLangFromLocale(locale: string) {\n const adjustedLocale = adjustLocale(locale);\n if (adjustedLocale != null) {\n const { language } = new Intl.Locale(adjustedLocale);\n if (SUPPORTED_LANGUAGES.includes(language)) {\n return language;\n }\n }\n return null;\n}\n\n/**\n * Provides corresponding country code (iso2) for locales code with explicit region value.\n *\n * @param locale `es-ES`, `en-GB`, `ja-JP`, etc.\n * @returns `null` if the locale is invalid or the region can‘t be identified.\n */\nexport function getCountryFromLocale(locale: string) {\n const adjustedLocale = adjustLocale(locale);\n return adjustedLocale != null ? (new Intl.Locale(adjustedLocale).region ?? null) : null;\n}\n\n/**\n * Provides the layout direction for a given locale.\n *\n * @param locale `es`, `es-ES`, `en-GB`, `en`, `ja`, `ja-JP`, etc.\n * @returns The layout direction based on the locale, falling back to `Direction.LTR` if the locale is invalid or unsupported.\n */\nexport function getDirectionFromLocale(locale: string) {\n const adjustedLocale = adjustLocale(locale);\n return adjustedLocale != null && RTL_LANGUAGES.includes(new Intl.Locale(adjustedLocale).language)\n ? Direction.RTL\n : Direction.LTR;\n}\n"],"names":["DEFAULT_LANG","DEFAULT_LOCALE","RTL_LANGUAGES","SUPPORTED_LANGUAGES","adjustLocale","locale","localeTrimmed","trim","Intl","Locale","replace","baseName","error","console","getLangFromLocale","adjustedLocale","language","includes","getCountryFromLocale","region","getDirectionFromLocale","Direction","RTL","LTR"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,MAAMA,YAAY,GAAG,KAAI;AACzB,MAAMC,cAAc,GAAG,QAAO;AAErC;;AAEG;MACUC,aAAa,GAAG,CAAC,IAAI,EAAE,IAAI,EAAC;AAEzC;;AAEG;AACUC,MAAAA,mBAAmB,GAAG,CACjCH,YAAY,EACZ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACL;AAED;;;;;AAKG;AACG,SAAUI,YAAYA,CAACC,MAAc,EAAA;AACzC,EAAA,MAAMC,aAAa,GAAGD,MAAM,EAAEE,IAAI,EAAE,CAAA;AACpC,EAAA,IAAID,aAAa,EAAE;IACjB,IAAI;AACF,MAAA,OAAO,IAAIE,IAAI,CAACC,MAAM,CAACH,aAAa,CAACI,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAACC,QAAQ,CAAA;KACjE,CAAC,OAAOC,KAAK,EAAE;AACd;AACAC,MAAAA,OAAO,CAACD,KAAK,CAACA,KAAK,CAAC,CAAA;AACtB,KAAA;AACF,GAAA;AACA,EAAA,OAAO,IAAI,CAAA;AACb,CAAA;AAEA;;;;;;;;;;AAUG;AACG,SAAUE,iBAAiBA,CAACT,MAAc,EAAA;AAC9C,EAAA,MAAMU,cAAc,GAAGX,YAAY,CAACC,MAAM,CAAC,CAAA;EAC3C,IAAIU,cAAc,IAAI,IAAI,EAAE;IAC1B,MAAM;AAAEC,MAAAA,QAAAA;AAAQ,KAAE,GAAG,IAAIR,IAAI,CAACC,MAAM,CAACM,cAAc,CAAC,CAAA;AACpD,IAAA,IAAIZ,mBAAmB,CAACc,QAAQ,CAACD,QAAQ,CAAC,EAAE;AAC1C,MAAA,OAAOA,QAAQ,CAAA;AACjB,KAAA;AACF,GAAA;AACA,EAAA,OAAO,IAAI,CAAA;AACb,CAAA;AAEA;;;;;AAKG;AACG,SAAUE,oBAAoBA,CAACb,MAAc,EAAA;AACjD,EAAA,MAAMU,cAAc,GAAGX,YAAY,CAACC,MAAM,CAAC,CAAA;AAC3C,EAAA,OAAOU,cAAc,IAAI,IAAI,GAAI,IAAIP,IAAI,CAACC,MAAM,CAACM,cAAc,CAAC,CAACI,MAAM,IAAI,IAAI,GAAI,IAAI,CAAA;AACzF,CAAA;AAEA;;;;;AAKG;AACG,SAAUC,sBAAsBA,CAACf,MAAc,EAAA;AACnD,EAAA,MAAMU,cAAc,GAAGX,YAAY,CAACC,MAAM,CAAC,CAAA;EAC3C,OAAOU,cAAc,IAAI,IAAI,IAAIb,aAAa,CAACe,QAAQ,CAAC,IAAIT,IAAI,CAACC,MAAM,CAACM,cAAc,CAAC,CAACC,QAAQ,CAAC,GAC7FK,mBAAS,CAACC,GAAG,GACbD,mBAAS,CAACE,GAAG,CAAA;AACnB;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/common/locale/index.ts"],"sourcesContent":["import { Direction } from '../direction';\n\nexport const DEFAULT_LANG = 'en';\nexport const DEFAULT_LOCALE = 'en-GB';\n\n/**\n * Languages written right-to-left.\n */\nexport const RTL_LANGUAGES = ['ar', 'he'];\n\n/**\n * @deprecated The source of truth for supported languages lives in Crab.\n */\nexport const SUPPORTED_LANGUAGES = [\n DEFAULT_LANG,\n 'de',\n 'es',\n 'fr',\n 'hu',\n 'id',\n 'it',\n 'ja',\n 'pl',\n 'pt',\n 'ro',\n 'ru',\n 'th',\n 'tr',\n 'uk',\n 'zh',\n];\n\n/**\n * Verifies and adjusts locale, replacing `_` with `-`.\n *\n * @param locale `es`, `es_ES`, `en-GB`, `en`, `ja`, `ja-JP`, etc.\n * @returns `null` if locale is unrecognized by `Intl.Locale`.\n */\nexport function adjustLocale(locale: string) {\n const localeTrimmed = locale?.trim();\n if (localeTrimmed) {\n try {\n return new Intl.Locale(localeTrimmed.replace('_', '-')).baseName;\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(error);\n }\n }\n return null;\n}\n\n/**\n * Provides corresponding lang (iso2) for provided locale.\n *\n * @deprecated The use of this function almost always breaks language variants\n * e.g. Simplified and Traditional Chinese.\n * There should be no use case for this function.\n * To select the correct translations from a translations object, pass the\n * locale directly into Crab's getLocalisedMessages.\n * @param locale `es`, `es-ES`, `en-GB`, `en`, `ja`, `ja-JP`, etc.\n * @returns Two-letter ISO 639-1 language code, falling back to `null` if locale is invalid or language is unsupported.\n */\nexport function getLangFromLocale(locale: string) {\n const adjustedLocale = adjustLocale(locale);\n if (adjustedLocale != null) {\n const { language } = new Intl.Locale(adjustedLocale);\n if (SUPPORTED_LANGUAGES.includes(language)) {\n return language;\n }\n }\n return null;\n}\n\n/**\n * Provides corresponding country code (iso2) for locales code with explicit region value.\n *\n * @param locale `es-ES`, `en-GB`, `ja-JP`, etc.\n * @returns `null` if the locale is invalid or the region can‘t be identified.\n */\nexport function getCountryFromLocale(locale: string) {\n const adjustedLocale = adjustLocale(locale);\n return adjustedLocale != null ? (new Intl.Locale(adjustedLocale).region ?? null) : null;\n}\n\n/**\n * Provides the layout direction for a given locale.\n *\n * @param locale `es`, `es-ES`, `en-GB`, `en`, `ja`, `ja-JP`, etc.\n * @returns The layout direction based on the locale, falling back to `Direction.LTR` if the locale is invalid or unsupported.\n */\nexport function getDirectionFromLocale(locale: string) {\n const adjustedLocale = adjustLocale(locale);\n return adjustedLocale != null && RTL_LANGUAGES.includes(new Intl.Locale(adjustedLocale).language)\n ? Direction.RTL\n : Direction.LTR;\n}\n"],"names":["DEFAULT_LANG","DEFAULT_LOCALE","RTL_LANGUAGES","SUPPORTED_LANGUAGES","adjustLocale","locale","localeTrimmed","trim","Intl","Locale","replace","baseName","error","console","getLangFromLocale","adjustedLocale","language","includes","getCountryFromLocale","region","getDirectionFromLocale","Direction","RTL","LTR"],"mappings":";;;;AAEO,MAAMA,YAAY,GAAG,KAAI;AACzB,MAAMC,cAAc,GAAG,QAAO;AAErC;;AAEG;MACUC,aAAa,GAAG,CAAC,IAAI,EAAE,IAAI,EAAC;AAEzC;;AAEG;AACUC,MAAAA,mBAAmB,GAAG,CACjCH,YAAY,EACZ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACL;AAED;;;;;AAKG;AACG,SAAUI,YAAYA,CAACC,MAAc,EAAA;AACzC,EAAA,MAAMC,aAAa,GAAGD,MAAM,EAAEE,IAAI,EAAE,CAAA;AACpC,EAAA,IAAID,aAAa,EAAE;IACjB,IAAI;AACF,MAAA,OAAO,IAAIE,IAAI,CAACC,MAAM,CAACH,aAAa,CAACI,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAACC,QAAQ,CAAA;KACjE,CAAC,OAAOC,KAAK,EAAE;AACd;AACAC,MAAAA,OAAO,CAACD,KAAK,CAACA,KAAK,CAAC,CAAA;AACtB,KAAA;AACF,GAAA;AACA,EAAA,OAAO,IAAI,CAAA;AACb,CAAA;AAEA;;;;;;;;;;AAUG;AACG,SAAUE,iBAAiBA,CAACT,MAAc,EAAA;AAC9C,EAAA,MAAMU,cAAc,GAAGX,YAAY,CAACC,MAAM,CAAC,CAAA;EAC3C,IAAIU,cAAc,IAAI,IAAI,EAAE;IAC1B,MAAM;AAAEC,MAAAA,QAAAA;AAAQ,KAAE,GAAG,IAAIR,IAAI,CAACC,MAAM,CAACM,cAAc,CAAC,CAAA;AACpD,IAAA,IAAIZ,mBAAmB,CAACc,QAAQ,CAACD,QAAQ,CAAC,EAAE;AAC1C,MAAA,OAAOA,QAAQ,CAAA;AACjB,KAAA;AACF,GAAA;AACA,EAAA,OAAO,IAAI,CAAA;AACb,CAAA;AAEA;;;;;AAKG;AACG,SAAUE,oBAAoBA,CAACb,MAAc,EAAA;AACjD,EAAA,MAAMU,cAAc,GAAGX,YAAY,CAACC,MAAM,CAAC,CAAA;AAC3C,EAAA,OAAOU,cAAc,IAAI,IAAI,GAAI,IAAIP,IAAI,CAACC,MAAM,CAACM,cAAc,CAAC,CAACI,MAAM,IAAI,IAAI,GAAI,IAAI,CAAA;AACzF,CAAA;AAEA;;;;;AAKG;AACG,SAAUC,sBAAsBA,CAACf,MAAc,EAAA;AACnD,EAAA,MAAMU,cAAc,GAAGX,YAAY,CAACC,MAAM,CAAC,CAAA;EAC3C,OAAOU,cAAc,IAAI,IAAI,IAAIb,aAAa,CAACe,QAAQ,CAAC,IAAIT,IAAI,CAACC,MAAM,CAACM,cAAc,CAAC,CAACC,QAAQ,CAAC,GAC7FK,mBAAS,CAACC,GAAG,GACbD,mBAAS,CAACE,GAAG,CAAA;AACnB;;;;;;;;;;;"}
@@ -1,28 +1,4 @@
1
- import '../theme.mjs';
2
1
  import { Direction } from '../direction.mjs';
3
- import '../propsValues/control.mjs';
4
- import '../propsValues/breakpoint.mjs';
5
- import '../propsValues/size.mjs';
6
- import '../propsValues/typography.mjs';
7
- import '../propsValues/width.mjs';
8
- import '../propsValues/type.mjs';
9
- import '../propsValues/dateMode.mjs';
10
- import '../propsValues/monthFormat.mjs';
11
- import '../propsValues/position.mjs';
12
- import '../propsValues/layouts.mjs';
13
- import '../propsValues/status.mjs';
14
- import '../propsValues/sentiment.mjs';
15
- import '../propsValues/profileType.mjs';
16
- import '../propsValues/variant.mjs';
17
- import '../propsValues/scroll.mjs';
18
- import '../propsValues/markdownNodeType.mjs';
19
- import '../fileType.mjs';
20
- import '@transferwise/icons';
21
- import 'clsx';
22
- import 'react';
23
- import 'react-intl';
24
- import '../closeButton/CloseButton.messages.mjs';
25
- import 'react/jsx-runtime';
26
2
 
27
3
  const DEFAULT_LANG = 'en';
28
4
  const DEFAULT_LOCALE = 'en-GB';
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../src/common/locale/index.ts"],"sourcesContent":["import { Direction } from '..';\n\nexport const DEFAULT_LANG = 'en';\nexport const DEFAULT_LOCALE = 'en-GB';\n\n/**\n * Languages written right-to-left.\n */\nexport const RTL_LANGUAGES = ['ar', 'he'];\n\n/**\n * @deprecated The source of truth for supported languages lives in Crab.\n */\nexport const SUPPORTED_LANGUAGES = [\n DEFAULT_LANG,\n 'de',\n 'es',\n 'fr',\n 'hu',\n 'id',\n 'it',\n 'ja',\n 'pl',\n 'pt',\n 'ro',\n 'ru',\n 'th',\n 'tr',\n 'uk',\n 'zh',\n];\n\n/**\n * Verifies and adjusts locale, replacing `_` with `-`.\n *\n * @param locale `es`, `es_ES`, `en-GB`, `en`, `ja`, `ja-JP`, etc.\n * @returns `null` if locale is unrecognized by `Intl.Locale`.\n */\nexport function adjustLocale(locale: string) {\n const localeTrimmed = locale?.trim();\n if (localeTrimmed) {\n try {\n return new Intl.Locale(localeTrimmed.replace('_', '-')).baseName;\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(error);\n }\n }\n return null;\n}\n\n/**\n * Provides corresponding lang (iso2) for provided locale.\n *\n * @deprecated The use of this function almost always breaks language variants\n * e.g. Simplified and Traditional Chinese.\n * There should be no use case for this function.\n * To select the correct translations from a translations object, pass the\n * locale directly into Crab's getLocalisedMessages.\n * @param locale `es`, `es-ES`, `en-GB`, `en`, `ja`, `ja-JP`, etc.\n * @returns Two-letter ISO 639-1 language code, falling back to `null` if locale is invalid or language is unsupported.\n */\nexport function getLangFromLocale(locale: string) {\n const adjustedLocale = adjustLocale(locale);\n if (adjustedLocale != null) {\n const { language } = new Intl.Locale(adjustedLocale);\n if (SUPPORTED_LANGUAGES.includes(language)) {\n return language;\n }\n }\n return null;\n}\n\n/**\n * Provides corresponding country code (iso2) for locales code with explicit region value.\n *\n * @param locale `es-ES`, `en-GB`, `ja-JP`, etc.\n * @returns `null` if the locale is invalid or the region can‘t be identified.\n */\nexport function getCountryFromLocale(locale: string) {\n const adjustedLocale = adjustLocale(locale);\n return adjustedLocale != null ? (new Intl.Locale(adjustedLocale).region ?? null) : null;\n}\n\n/**\n * Provides the layout direction for a given locale.\n *\n * @param locale `es`, `es-ES`, `en-GB`, `en`, `ja`, `ja-JP`, etc.\n * @returns The layout direction based on the locale, falling back to `Direction.LTR` if the locale is invalid or unsupported.\n */\nexport function getDirectionFromLocale(locale: string) {\n const adjustedLocale = adjustLocale(locale);\n return adjustedLocale != null && RTL_LANGUAGES.includes(new Intl.Locale(adjustedLocale).language)\n ? Direction.RTL\n : Direction.LTR;\n}\n"],"names":["DEFAULT_LANG","DEFAULT_LOCALE","RTL_LANGUAGES","SUPPORTED_LANGUAGES","adjustLocale","locale","localeTrimmed","trim","Intl","Locale","replace","baseName","error","console","getLangFromLocale","adjustedLocale","language","includes","getCountryFromLocale","region","getDirectionFromLocale","Direction","RTL","LTR"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,MAAMA,YAAY,GAAG,KAAI;AACzB,MAAMC,cAAc,GAAG,QAAO;AAErC;;AAEG;MACUC,aAAa,GAAG,CAAC,IAAI,EAAE,IAAI,EAAC;AAEzC;;AAEG;AACUC,MAAAA,mBAAmB,GAAG,CACjCH,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I,CAACC,MAAM,CAACM,cAAc,CAAC,CAACI,MAAM,IAAI,IAAI,GAAI,IAAI,CAAA;AACzF,CAAA;AAEA;;;;;AAKG;AACG,SAAUC,sBAAsBA,CAACf,MAAc,EAAA;AACnD,EAAA,MAAMU,cAAc,GAAGX,YAAY,CAACC,MAAM,CAAC,CAAA;EAC3C,OAAOU,cAAc,IAAI,IAAI,IAAIb,aAAa,CAACe,QAAQ,CAAC,IAAIT,IAAI,CAACC,MAAM,CAACM,cAAc,CAAC,CAACC,QAAQ,CAAC,GAC7FK,SAAS,CAACC,GAAG,GACbD,SAAS,CAACE,GAAG,CAAA;AACnB;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../src/common/locale/index.ts"],"sourcesContent":["import { Direction } from '../direction';\n\nexport const DEFAULT_LANG = 'en';\nexport const DEFAULT_LOCALE = 'en-GB';\n\n/**\n * Languages written right-to-left.\n */\nexport const RTL_LANGUAGES = ['ar', 'he'];\n\n/**\n * @deprecated The source of truth for supported languages lives in Crab.\n */\nexport const SUPPORTED_LANGUAGES = [\n DEFAULT_LANG,\n 'de',\n 'es',\n 'fr',\n 'hu',\n 'id',\n 'it',\n 'ja',\n 'pl',\n 'pt',\n 'ro',\n 'ru',\n 'th',\n 'tr',\n 'uk',\n 'zh',\n];\n\n/**\n * Verifies and adjusts locale, replacing `_` with `-`.\n *\n * @param locale `es`, `es_ES`, `en-GB`, `en`, `ja`, `ja-JP`, etc.\n * @returns `null` if locale is unrecognized by `Intl.Locale`.\n */\nexport function adjustLocale(locale: string) {\n const localeTrimmed = locale?.trim();\n if (localeTrimmed) {\n try {\n return new Intl.Locale(localeTrimmed.replace('_', '-')).baseName;\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(error);\n }\n }\n return null;\n}\n\n/**\n * Provides corresponding lang (iso2) for provided locale.\n *\n * @deprecated The use of this function almost always breaks language variants\n * e.g. Simplified and Traditional Chinese.\n * There should be no use case for this function.\n * To select the correct translations from a translations object, pass the\n * locale directly into Crab's getLocalisedMessages.\n * @param locale `es`, `es-ES`, `en-GB`, `en`, `ja`, `ja-JP`, etc.\n * @returns Two-letter ISO 639-1 language code, falling back to `null` if locale is invalid or language is unsupported.\n */\nexport function getLangFromLocale(locale: string) {\n const adjustedLocale = adjustLocale(locale);\n if (adjustedLocale != null) {\n const { language } = new Intl.Locale(adjustedLocale);\n if (SUPPORTED_LANGUAGES.includes(language)) {\n return language;\n }\n }\n return null;\n}\n\n/**\n * Provides corresponding country code (iso2) for locales code with explicit region value.\n *\n * @param locale `es-ES`, `en-GB`, `ja-JP`, etc.\n * @returns `null` if the locale is invalid or the region can‘t be identified.\n */\nexport function getCountryFromLocale(locale: string) {\n const adjustedLocale = adjustLocale(locale);\n return adjustedLocale != null ? (new Intl.Locale(adjustedLocale).region ?? null) : null;\n}\n\n/**\n * Provides the layout direction for a given locale.\n *\n * @param locale `es`, `es-ES`, `en-GB`, `en`, `ja`, `ja-JP`, etc.\n * @returns The layout direction based on the locale, falling back to `Direction.LTR` if the locale is invalid or unsupported.\n */\nexport function getDirectionFromLocale(locale: string) {\n const adjustedLocale = adjustLocale(locale);\n return adjustedLocale != null && RTL_LANGUAGES.includes(new Intl.Locale(adjustedLocale).language)\n ? Direction.RTL\n : Direction.LTR;\n}\n"],"names":["DEFAULT_LANG","DEFAULT_LOCALE","RTL_LANGUAGES","SUPPORTED_LANGUAGES","adjustLocale","locale","localeTrimmed","trim","Intl","Locale","replace","baseName","error","console","getLangFromLocale","adjustedLocale","language","includes","getCountryFromLocale","region","getDirectionFromLocale","Direction","RTL","LTR"],"mappings":";;AAEO,MAAMA,YAAY,GAAG,KAAI;AACzB,MAAMC,cAAc,GAAG,QAAO;AAErC;;AAEG;MACUC,aAAa,GAAG,CAAC,IAAI,EAAE,IAAI,EAAC;AAEzC;;AAEG;AACUC,MAAAA,mBAAmB,GAAG,CACjCH,YAAY,EACZ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI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zF,CAAA;AAEA;;;;;AAKG;AACG,SAAUC,sBAAsBA,CAACf,MAAc,EAAA;AACnD,EAAA,MAAMU,cAAc,GAAGX,YAAY,CAACC,MAAM,CAAC,CAAA;EAC3C,OAAOU,cAAc,IAAI,IAAI,IAAIb,aAAa,CAACe,QAAQ,CAAC,IAAIT,IAAI,CAACC,MAAM,CAACM,cAAc,CAAC,CAACC,QAAQ,CAAC,GAC7FK,SAAS,CAACC,GAAG,GACbD,SAAS,CAACE,GAAG,CAAA;AACnB;;;;"}
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var clsx = require('clsx');
4
6
  var React = require('react');
5
7
  var reactPopper = require('react-popper');
@@ -121,9 +123,7 @@ const Panel = /*#__PURE__*/React.forwardRef(function Panel({
121
123
  id: overlayId,
122
124
  ...rest,
123
125
  ref: setPopperElement,
124
- role: "dialog"
125
- // eslint-disable-next-line react/forbid-dom-props
126
- ,
126
+ role: "dialog",
127
127
  style: {
128
128
  ...styles.popper
129
129
  },
@@ -132,15 +132,12 @@ const Panel = /*#__PURE__*/React.forwardRef(function Panel({
132
132
  'np-panel--open': open
133
133
  }, rest.className),
134
134
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
135
- ref: reference
136
- /* eslint-disable-next-line react/forbid-dom-props */,
135
+ ref: reference,
137
136
  style: contentStyle,
138
137
  className: clsx.clsx('np-panel__content'),
139
138
  children: [children, arrow && /*#__PURE__*/jsxRuntime.jsx("div", {
140
139
  ref: setArrowElement,
141
- className: clsx.clsx('np-panel__arrow')
142
- // eslint-disable-next-line react/forbid-dom-props
143
- ,
140
+ className: clsx.clsx('np-panel__arrow'),
144
141
  style: styles.arrow
145
142
  })]
146
143
  })
@@ -148,5 +145,5 @@ const Panel = /*#__PURE__*/React.forwardRef(function Panel({
148
145
  });
149
146
  });
150
147
 
151
- module.exports = Panel;
148
+ exports.default = Panel;
152
149
  //# sourceMappingURL=Panel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Panel.js","sources":["../../../src/common/panel/Panel.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport {\n CSSProperties,\n HTMLAttributes,\n MutableRefObject,\n PropsWithChildren,\n SyntheticEvent,\n forwardRef,\n useContext,\n useEffect,\n useState,\n} from 'react';\nimport { usePopper } from 'react-popper';\n\nimport { Position, PositionBottom, PositionLeft, PositionRight, PositionTop } from '..';\nimport Dimmer from '../../dimmer';\nimport { OverlayIdContext } from '../../provider/overlay/OverlayIdProvider';\n\nconst POPOVER_OFFSET = [0, 16];\n\n// By default the flip positioning explores only the opposite alternative. So if left is passed and there's no enough space\n// the right one gets chosen. If there's no space on both sides popover goes back to the initially chosen one left.\n// This mapping forces popover to try the four available positions before going back to the initial chosen one.\nconst fallbackPlacements = {\n [Position.TOP]: [Position.BOTTOM, Position.RIGHT, Position.LEFT],\n [Position.BOTTOM]: [Position.TOP, Position.RIGHT, Position.LEFT],\n [Position.LEFT]: [Position.RIGHT, Position.TOP, Position.BOTTOM],\n [Position.RIGHT]: [Position.LEFT, Position.TOP, Position.BOTTOM],\n};\n\nexport type PanelProps = PropsWithChildren<{\n arrow?: boolean;\n flip?: boolean;\n altAxis?: boolean;\n open?: boolean;\n onClose?: (event: Event | SyntheticEvent) => void;\n position?: PositionBottom | PositionLeft | PositionRight | PositionTop;\n anchorRef: MutableRefObject<Element | null>;\n anchorWidth?: boolean;\n}> &\n HTMLAttributes<HTMLDivElement>;\n\nconst Panel = forwardRef<HTMLDivElement, PanelProps>(function Panel(\n {\n arrow = false,\n flip = true,\n altAxis = false,\n children,\n open = false,\n onClose,\n position = Position.BOTTOM,\n anchorRef,\n anchorWidth = false,\n ...rest\n }: PanelProps,\n reference,\n) {\n const [arrowElement, setArrowElement] = useState<HTMLDivElement | null>(null);\n const [popperElement, setPopperElement] = useState<HTMLDivElement | null>(null);\n\n const modifiers = [];\n\n if (altAxis) {\n modifiers.push({\n // https://popper.js.org/docs/v2/modifiers/prevent-overflow\n name: 'preventOverflow',\n options: {\n altAxis: true,\n tether: false,\n },\n });\n }\n\n if (arrow) {\n modifiers.push({\n name: 'arrow',\n options: {\n element: arrowElement,\n options: {\n padding: 8, // 8px from the edges of the popper\n },\n },\n });\n // This lets you displace a popper element from its reference element.\n modifiers.push({ name: 'offset', options: { offset: POPOVER_OFFSET } });\n }\n if (flip && fallbackPlacements[position]) {\n modifiers.push({\n name: 'flip',\n options: {\n fallbackPlacements: fallbackPlacements[position],\n },\n });\n }\n\n const { styles, attributes, forceUpdate } = usePopper(anchorRef.current, popperElement, {\n placement: position,\n modifiers,\n });\n\n // If the trigger is not visible when the position is calculated, it will be incorrect. Because this can happen repeatedly (on resize for example),\n // it is most simple just to always position before opening\n useEffect(() => {\n if (open && forceUpdate) {\n forceUpdate();\n }\n }, [open]);\n\n const contentStyle: CSSProperties = {\n ...(anchorWidth ? { width: anchorRef.current?.clientWidth } : undefined),\n };\n\n const overlayId = useContext(OverlayIdContext);\n\n return (\n <Dimmer open={open} transparent fadeContentOnEnter fadeContentOnExit onClose={onClose}>\n <div\n id={overlayId}\n {...rest}\n ref={setPopperElement}\n role=\"dialog\"\n // eslint-disable-next-line react/forbid-dom-props\n style={{ ...styles.popper }}\n {...attributes.popper}\n className={clsx('np-panel', { 'np-panel--open': open }, rest.className)}\n >\n <div\n ref={reference}\n /* eslint-disable-next-line react/forbid-dom-props */\n style={contentStyle}\n className={clsx('np-panel__content')}\n >\n {children}\n {/* Arrow has to stay inside content to get the same animations as the \"dialog\" and to get hidden when panel is closed. */}\n {arrow && (\n <div\n ref={setArrowElement}\n className={clsx('np-panel__arrow')}\n // eslint-disable-next-line react/forbid-dom-props\n style={styles.arrow}\n />\n )}\n </div>\n </div>\n </Dimmer>\n );\n});\n\nexport default Panel;\n"],"names":["POPOVER_OFFSET","fallbackPlacements","Position","TOP","BOTTOM","RIGHT","LEFT","Panel","forwardRef","arrow","flip","altAxis","children","open","onClose","position","anchorRef","anchorWidth","rest","reference","arrowElement","setArrowElement","useState","popperElement","setPopperElement","modifiers","push","name","options","tether","element","padding","offset","styles","attributes","forceUpdate","usePopper","current","placement","useEffect","contentStyle","width","clientWidth","undefined","overlayId","useContext","OverlayIdContext","_jsx","Dimmer","transparent","fadeContentOnEnter","fadeContentOnExit","id","ref","role","style","popper","className","clsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAMA,cAAc,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;AAE9B;AACA;AACA;AACA,MAAMC,kBAAkB,GAAG;AACzB,EAAA,CAACC,iBAAQ,CAACC,GAAG,GAAG,CAACD,iBAAQ,CAACE,MAAM,EAAEF,iBAAQ,CAACG,KAAK,EAAEH,iBAAQ,CAACI,IAAI,CAAC;AAChE,EAAA,CAACJ,iBAAQ,CAACE,MAAM,GAAG,CAACF,iBAAQ,CAACC,GAAG,EAAED,iBAAQ,CAACG,KAAK,EAAEH,iBAAQ,CAACI,IAAI,CAAC;AAChE,EAAA,CAACJ,iBAAQ,CAACI,IAAI,GAAG,CAACJ,iBAAQ,CAACG,KAAK,EAAEH,iBAAQ,CAACC,GAAG,EAAED,iBAAQ,CAACE,MAAM,CAAC;AAChE,EAAA,CAACF,iBAAQ,CAACG,KAAK,GAAG,CAACH,iBAAQ,CAACI,IAAI,EAAEJ,iBAAQ,CAACC,GAAG,EAAED,iBAAQ,CAACE,MAAM,CAAA;CAChE,CAAA;AAcD,MAAMG,KAAK,gBAAGC,gBAAU,CAA6B,SAASD,KAAKA,CACjE;AACEE,EAAAA,KAAK,GAAG,KAAK;AACbC,EAAAA,IAAI,GAAG,IAAI;AACXC,EAAAA,OAAO,GAAG,KAAK;EACfC,QAAQ;AACRC,EAAAA,IAAI,GAAG,KAAK;EACZC,OAAO;YACPC,UAAQ,GAAGb,iBAAQ,CAACE,MAAM;EAC1BY,SAAS;AACTC,EAAAA,WAAW,GAAG,KAAK;EACnB,GAAGC,IAAAA;AAAI,C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AA;AACL;AACAoC,QAAAA,KAAK,EAAEf,YAAa;AACpBiB,QAAAA,SAAS,EAAEC,SAAI,CAAC,mBAAmB,CAAE;AAAA9C,QAAAA,QAAA,EAEpCA,CAAAA,QAAQ,EAERH,KAAK,iBACJsC,cAAA,CAAA,KAAA,EAAA;AACEM,UAAAA,GAAG,EAAEhC,eAAgB;UACrBoC,SAAS,EAAEC,SAAI,CAAC,iBAAiB,CAAA;AACjC;AAAA;UACAH,KAAK,EAAEtB,MAAM,CAACxB,KAAAA;AAAM,SAAA,CAEvB,CAAA;OACE,CAAA;KACF,CAAA;AACP,GAAQ,CAAC,CAAA;AAEb,CAAC;;;;"}
1
+ {"version":3,"file":"Panel.js","sources":["../../../src/common/panel/Panel.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport {\n CSSProperties,\n HTMLAttributes,\n MutableRefObject,\n PropsWithChildren,\n SyntheticEvent,\n forwardRef,\n useContext,\n useEffect,\n useState,\n} from 'react';\nimport { usePopper } from 'react-popper';\n\nimport { Position, PositionBottom, PositionLeft, PositionRight, PositionTop } from '..';\nimport Dimmer from '../../dimmer';\nimport { OverlayIdContext } from '../../provider/overlay/OverlayIdProvider';\n\nconst POPOVER_OFFSET = [0, 16];\n\n// By default the flip positioning explores only the opposite alternative. So if left is passed and there's no enough space\n// the right one gets chosen. If there's no space on both sides popover goes back to the initially chosen one left.\n// This mapping forces popover to try the four available positions before going back to the initial chosen one.\nconst fallbackPlacements = {\n [Position.TOP]: [Position.BOTTOM, Position.RIGHT, Position.LEFT],\n [Position.BOTTOM]: [Position.TOP, Position.RIGHT, Position.LEFT],\n [Position.LEFT]: [Position.RIGHT, Position.TOP, Position.BOTTOM],\n [Position.RIGHT]: [Position.LEFT, Position.TOP, Position.BOTTOM],\n};\n\nexport type PanelProps = PropsWithChildren<{\n arrow?: boolean;\n flip?: boolean;\n altAxis?: boolean;\n open?: boolean;\n onClose?: (event: Event | SyntheticEvent) => void;\n position?: PositionBottom | PositionLeft | PositionRight | PositionTop;\n anchorRef: MutableRefObject<Element | null>;\n anchorWidth?: boolean;\n}> &\n HTMLAttributes<HTMLDivElement>;\n\nconst Panel = forwardRef<HTMLDivElement, PanelProps>(function Panel(\n {\n arrow = false,\n flip = true,\n altAxis = false,\n children,\n open = false,\n onClose,\n position = Position.BOTTOM,\n anchorRef,\n anchorWidth = false,\n ...rest\n }: PanelProps,\n reference,\n) {\n const [arrowElement, setArrowElement] = useState<HTMLDivElement | null>(null);\n const [popperElement, setPopperElement] = useState<HTMLDivElement | null>(null);\n\n const modifiers = [];\n\n if (altAxis) {\n modifiers.push({\n // https://popper.js.org/docs/v2/modifiers/prevent-overflow\n name: 'preventOverflow',\n options: {\n altAxis: true,\n tether: false,\n },\n });\n }\n\n if (arrow) {\n modifiers.push({\n name: 'arrow',\n options: {\n element: arrowElement,\n options: {\n padding: 8, // 8px from the edges of the popper\n },\n },\n });\n // This lets you displace a popper element from its reference element.\n modifiers.push({ name: 'offset', options: { offset: POPOVER_OFFSET } });\n }\n if (flip && fallbackPlacements[position]) {\n modifiers.push({\n name: 'flip',\n options: {\n fallbackPlacements: fallbackPlacements[position],\n },\n });\n }\n\n const { styles, attributes, forceUpdate } = usePopper(anchorRef.current, popperElement, {\n placement: position,\n modifiers,\n });\n\n // If the trigger is not visible when the position is calculated, it will be incorrect. Because this can happen repeatedly (on resize for example),\n // it is most simple just to always position before opening\n useEffect(() => {\n if (open && forceUpdate) {\n forceUpdate();\n }\n }, [open]);\n\n const contentStyle: CSSProperties = {\n ...(anchorWidth ? { width: anchorRef.current?.clientWidth } : undefined),\n };\n\n const overlayId = useContext(OverlayIdContext);\n\n return (\n <Dimmer open={open} transparent fadeContentOnEnter fadeContentOnExit onClose={onClose}>\n <div\n id={overlayId}\n {...rest}\n ref={setPopperElement}\n role=\"dialog\"\n style={{ ...styles.popper }}\n {...attributes.popper}\n className={clsx('np-panel', { 'np-panel--open': open }, rest.className)}\n >\n <div ref={reference} style={contentStyle} className={clsx('np-panel__content')}>\n {children}\n {/* Arrow has to stay inside content to get the same animations as the \"dialog\" and to get hidden when panel is closed. */}\n {arrow && (\n <div ref={setArrowElement} className={clsx('np-panel__arrow')} style={styles.arrow} />\n )}\n </div>\n </div>\n </Dimmer>\n );\n});\n\nexport default Panel;\n"],"names":["POPOVER_OFFSET","fallbackPlacements","Position","TOP","BOTTOM","RIGHT","LEFT","Panel","forwardRef","arrow","flip","altAxis","children","open","onClose","position","anchorRef","anchorWidth","rest","reference","arrowElement","setArrowElement","useState","popperElement","setPopperElement","modifiers","push","name","options","tether","element","padding","offset","styles","attributes","forceUpdate","usePopper","current","placement","useEffect","contentStyle","width","clientWidth","undefined","overlayId","useContext","OverlayIdContext","_jsx","Dimmer","transparent","fadeContentOnEnter","fadeContentOnExit","id","ref","role","style","popper","className","clsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAMA,cAAc,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;AAE9B;AACA;AACA;AACA,MAAMC,kBAAkB,GAAG;AACzB,EAAA,CAACC,iBAAQ,CAACC,GAAG,GAAG,CAACD,iBAAQ,CAACE,MAAM,EAAEF,iBAAQ,CAACG,KAAK,EAAEH,iBAAQ,CAACI,IAAI,CAAC;AAChE,EAAA,CAACJ,iBAAQ,CAACE,MAAM,GAAG,CAACF,iBAAQ,CAACC,GAAG,EAAED,iBAAQ,CAACG,KAAK,EAAEH,iBAAQ,CAACI,IAAI,CAAC;AAChE,EAAA,CAACJ,iBAAQ,CAACI,IAAI,GAAG,CAACJ,iBAAQ,CAACG,KAAK,EAAEH,iBAAQ,CAACC,GAAG,EAAED,iBAAQ,CAACE,MAAM,CAAC;AAChE,EAAA,CAACF,iBAAQ,CAACG,KAAK,GAAG,CAACH,iBAAQ,CAACI,IAAI,EAAEJ,iBAAQ,CAACC,GAAG,EAAED,iBAAQ,CAACE,MAAM,CAAA;CAChE,CAAA;AAcD,MAAMG,KAAK,gBAAGC,gBAA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AAGtB,MAAM,CAACuB,MAAAA;OAAS;MAAA,GACxBtB,UAAU,CAACsB,MAAM;AACrBC,MAAAA,SAAS,EAAEC,SAAI,CAAC,UAAU,EAAE;AAAE,QAAA,gBAAgB,EAAE7C,IAAAA;AAAI,OAAE,EAAEK,IAAI,CAACuC,SAAS,CAAE;AAAA7C,MAAAA,QAAA,eAExE+C,eAAA,CAAA,KAAA,EAAA;AAAKN,QAAAA,GAAG,EAAElC,SAAU;AAACoC,QAAAA,KAAK,EAAEf,YAAa;AAACiB,QAAAA,SAAS,EAAEC,SAAI,CAAC,mBAAmB,CAAE;AAAA9C,QAAAA,QAAA,EAC5EA,CAAAA,QAAQ,EAERH,KAAK,iBACJsC,cAAA,CAAA,KAAA,EAAA;AAAKM,UAAAA,GAAG,EAAEhC,eAAgB;AAACoC,UAAAA,SAAS,EAAEC,SAAI,CAAC,iBAAiB,CAAE;UAACH,KAAK,EAAEtB,MAAM,CAACxB,KAAAA;AAAM,SAAA,CACpF,CAAA;OACE,CAAA;KACF,CAAA;AACP,GAAQ,CAAC,CAAA;AAEb,CAAC;;;;"}
@@ -119,9 +119,7 @@ const Panel = /*#__PURE__*/forwardRef(function Panel({
119
119
  id: overlayId,
120
120
  ...rest,
121
121
  ref: setPopperElement,
122
- role: "dialog"
123
- // eslint-disable-next-line react/forbid-dom-props
124
- ,
122
+ role: "dialog",
125
123
  style: {
126
124
  ...styles.popper
127
125
  },
@@ -130,15 +128,12 @@ const Panel = /*#__PURE__*/forwardRef(function Panel({
130
128
  'np-panel--open': open
131
129
  }, rest.className),
132
130
  children: /*#__PURE__*/jsxs("div", {
133
- ref: reference
134
- /* eslint-disable-next-line react/forbid-dom-props */,
131
+ ref: reference,
135
132
  style: contentStyle,
136
133
  className: clsx('np-panel__content'),
137
134
  children: [children, arrow && /*#__PURE__*/jsx("div", {
138
135
  ref: setArrowElement,
139
- className: clsx('np-panel__arrow')
140
- // eslint-disable-next-line react/forbid-dom-props
141
- ,
136
+ className: clsx('np-panel__arrow'),
142
137
  style: styles.arrow
143
138
  })]
144
139
  })