@transferwise/components 46.100.0 → 46.100.2

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 (606) hide show
  1. package/build/accordion/Accordion.js.map +1 -1
  2. package/build/accordion/Accordion.mjs.map +1 -1
  3. package/build/accordion/AccordionItem/AccordionItem.js.map +1 -1
  4. package/build/accordion/AccordionItem/AccordionItem.mjs.map +1 -1
  5. package/build/actionButton/ActionButton.js.map +1 -1
  6. package/build/actionButton/ActionButton.mjs.map +1 -1
  7. package/build/actionOption/ActionOption.js.map +1 -1
  8. package/build/actionOption/ActionOption.mjs.map +1 -1
  9. package/build/alert/Alert.js.map +1 -1
  10. package/build/alert/Alert.mjs.map +1 -1
  11. package/build/alert/inlineMarkdown/InlineMarkdown.js.map +1 -1
  12. package/build/alert/inlineMarkdown/InlineMarkdown.mjs.map +1 -1
  13. package/build/avatar/Avatar.js.map +1 -1
  14. package/build/avatar/Avatar.mjs.map +1 -1
  15. package/build/avatar/avatarTypes.js.map +1 -1
  16. package/build/avatar/avatarTypes.mjs.map +1 -1
  17. package/build/avatarLayout/AvatarLayout.js +1 -1
  18. package/build/avatarLayout/AvatarLayout.js.map +1 -1
  19. package/build/avatarLayout/AvatarLayout.mjs +1 -1
  20. package/build/avatarLayout/AvatarLayout.mjs.map +1 -1
  21. package/build/avatarView/AvatarView.js.map +1 -1
  22. package/build/avatarView/AvatarView.mjs.map +1 -1
  23. package/build/avatarView/NotificationDot.js.map +1 -1
  24. package/build/avatarView/NotificationDot.mjs.map +1 -1
  25. package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
  26. package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -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.map +1 -1
  30. package/build/badge/BadgeAssets.mjs.map +1 -1
  31. package/build/body/Body.js.map +1 -1
  32. package/build/body/Body.mjs.map +1 -1
  33. package/build/button/Button.js.map +1 -1
  34. package/build/button/Button.mjs.map +1 -1
  35. package/build/button/Button.resolver.js.map +1 -1
  36. package/build/button/Button.resolver.mjs.map +1 -1
  37. package/build/button/LegacyButton.js.map +1 -1
  38. package/build/button/LegacyButton.mjs.map +1 -1
  39. package/build/button/legacyUtils/legacyUtils.js.map +1 -1
  40. package/build/button/legacyUtils/legacyUtils.mjs.map +1 -1
  41. package/build/card/Card.js.map +1 -1
  42. package/build/card/Card.mjs.map +1 -1
  43. package/build/carousel/Carousel.js.map +1 -1
  44. package/build/carousel/Carousel.mjs.map +1 -1
  45. package/build/checkbox/Checkbox.js.map +1 -1
  46. package/build/checkbox/Checkbox.mjs.map +1 -1
  47. package/build/checkboxButton/CheckboxButton.js.map +1 -1
  48. package/build/checkboxButton/CheckboxButton.mjs.map +1 -1
  49. package/build/checkboxOption/CheckboxOption.js.map +1 -1
  50. package/build/checkboxOption/CheckboxOption.mjs.map +1 -1
  51. package/build/chevron/Chevron.js.map +1 -1
  52. package/build/chevron/Chevron.mjs.map +1 -1
  53. package/build/chips/Chip.js.map +1 -1
  54. package/build/chips/Chip.mjs.map +1 -1
  55. package/build/chips/Chips.js.map +1 -1
  56. package/build/chips/Chips.mjs.map +1 -1
  57. package/build/circularButton/CircularButton.js.map +1 -1
  58. package/build/circularButton/CircularButton.mjs.map +1 -1
  59. package/build/common/DOMOperations/DOMOperations.js.map +1 -1
  60. package/build/common/DOMOperations/DOMOperations.mjs.map +1 -1
  61. package/build/common/Option/Option.js.map +1 -1
  62. package/build/common/Option/Option.mjs.map +1 -1
  63. package/build/common/RadioButton/RadioButton.js.map +1 -1
  64. package/build/common/RadioButton/RadioButton.mjs.map +1 -1
  65. package/build/common/bottomSheet/BottomSheet.js.map +1 -1
  66. package/build/common/bottomSheet/BottomSheet.mjs.map +1 -1
  67. package/build/common/card/Card.js.map +1 -1
  68. package/build/common/card/Card.mjs.map +1 -1
  69. package/build/common/circle/Circle.js.map +1 -1
  70. package/build/common/circle/Circle.mjs.map +1 -1
  71. package/build/common/closeButton/CloseButton.js.map +1 -1
  72. package/build/common/closeButton/CloseButton.mjs.map +1 -1
  73. package/build/common/colors.js.map +1 -1
  74. package/build/common/colors.mjs.map +1 -1
  75. package/build/common/dateUtils/getDayNames/getDayNames.js.map +1 -1
  76. package/build/common/dateUtils/getDayNames/getDayNames.mjs.map +1 -1
  77. package/build/common/dateUtils/getMonthNames/getMonthNames.js.map +1 -1
  78. package/build/common/dateUtils/getMonthNames/getMonthNames.mjs.map +1 -1
  79. package/build/common/dateUtils/isDateValid/isDateValid.js.map +1 -1
  80. package/build/common/dateUtils/isDateValid/isDateValid.mjs.map +1 -1
  81. package/build/common/dateUtils/moveToWithinRange/moveToWithinRange.js.map +1 -1
  82. package/build/common/dateUtils/moveToWithinRange/moveToWithinRange.mjs.map +1 -1
  83. package/build/common/deviceDetection/deviceDetection.js.map +1 -1
  84. package/build/common/deviceDetection/deviceDetection.mjs.map +1 -1
  85. package/build/common/direction.js.map +1 -1
  86. package/build/common/direction.mjs.map +1 -1
  87. package/build/common/domHelpers/documentIosClick.js.map +1 -1
  88. package/build/common/domHelpers/documentIosClick.mjs.map +1 -1
  89. package/build/common/fileType.js.map +1 -1
  90. package/build/common/fileType.mjs.map +1 -1
  91. package/build/common/flowHeader/FlowHeader.js.map +1 -1
  92. package/build/common/flowHeader/FlowHeader.mjs.map +1 -1
  93. package/build/common/focusBoundary/FocusBoundary.js.map +1 -1
  94. package/build/common/focusBoundary/FocusBoundary.mjs.map +1 -1
  95. package/build/common/historyNavigator/historyNavigator.js.map +1 -1
  96. package/build/common/historyNavigator/historyNavigator.mjs.map +1 -1
  97. package/build/common/hooks/useConditionalListener/useConditionalListener.js.map +1 -1
  98. package/build/common/hooks/useConditionalListener/useConditionalListener.mjs.map +1 -1
  99. package/build/common/hooks/useDirection/useDirection.js.map +1 -1
  100. package/build/common/hooks/useDirection/useDirection.mjs.map +1 -1
  101. package/build/common/hooks/useEffectEvent.js.map +1 -1
  102. package/build/common/hooks/useEffectEvent.mjs.map +1 -1
  103. package/build/common/hooks/useHasIntersected/useHasIntersected.js.map +1 -1
  104. package/build/common/hooks/useHasIntersected/useHasIntersected.mjs.map +1 -1
  105. package/build/common/hooks/useLayout/useLayout.js.map +1 -1
  106. package/build/common/hooks/useLayout/useLayout.mjs.map +1 -1
  107. package/build/common/hooks/useMedia.js.map +1 -1
  108. package/build/common/hooks/useMedia.mjs.map +1 -1
  109. package/build/common/hooks/useResizeObserver.js.map +1 -1
  110. package/build/common/hooks/useResizeObserver.mjs.map +1 -1
  111. package/build/common/hooks/useScreenSize.js.map +1 -1
  112. package/build/common/hooks/useScreenSize.mjs.map +1 -1
  113. package/build/common/hooks/useVirtualKeyboard.js.map +1 -1
  114. package/build/common/hooks/useVirtualKeyboard.mjs.map +1 -1
  115. package/build/common/initials.js.map +1 -1
  116. package/build/common/initials.mjs.map +1 -1
  117. package/build/common/locale/index.js +1 -1
  118. package/build/common/locale/index.js.map +1 -1
  119. package/build/common/locale/index.mjs +1 -1
  120. package/build/common/locale/index.mjs.map +1 -1
  121. package/build/common/panel/Panel.js.map +1 -1
  122. package/build/common/panel/Panel.mjs.map +1 -1
  123. package/build/common/propsValues/breakpoint.js.map +1 -1
  124. package/build/common/propsValues/breakpoint.mjs.map +1 -1
  125. package/build/common/propsValues/control.js.map +1 -1
  126. package/build/common/propsValues/control.mjs.map +1 -1
  127. package/build/common/propsValues/dateMode.js.map +1 -1
  128. package/build/common/propsValues/dateMode.mjs.map +1 -1
  129. package/build/common/propsValues/layouts.js.map +1 -1
  130. package/build/common/propsValues/layouts.mjs.map +1 -1
  131. package/build/common/propsValues/markdownNodeType.js.map +1 -1
  132. package/build/common/propsValues/markdownNodeType.mjs.map +1 -1
  133. package/build/common/propsValues/monthFormat.js.map +1 -1
  134. package/build/common/propsValues/monthFormat.mjs.map +1 -1
  135. package/build/common/propsValues/position.js.map +1 -1
  136. package/build/common/propsValues/position.mjs.map +1 -1
  137. package/build/common/propsValues/profileType.js.map +1 -1
  138. package/build/common/propsValues/profileType.mjs.map +1 -1
  139. package/build/common/propsValues/scroll.js.map +1 -1
  140. package/build/common/propsValues/scroll.mjs.map +1 -1
  141. package/build/common/propsValues/sentiment.js.map +1 -1
  142. package/build/common/propsValues/sentiment.mjs.map +1 -1
  143. package/build/common/propsValues/size.js.map +1 -1
  144. package/build/common/propsValues/size.mjs.map +1 -1
  145. package/build/common/propsValues/status.js.map +1 -1
  146. package/build/common/propsValues/status.mjs.map +1 -1
  147. package/build/common/propsValues/type.js.map +1 -1
  148. package/build/common/propsValues/type.mjs.map +1 -1
  149. package/build/common/propsValues/typography.js.map +1 -1
  150. package/build/common/propsValues/typography.mjs.map +1 -1
  151. package/build/common/propsValues/variant.js.map +1 -1
  152. package/build/common/propsValues/variant.mjs.map +1 -1
  153. package/build/common/propsValues/width.js.map +1 -1
  154. package/build/common/propsValues/width.mjs.map +1 -1
  155. package/build/common/responsivePanel/ResponsivePanel.js.map +1 -1
  156. package/build/common/responsivePanel/ResponsivePanel.mjs.map +1 -1
  157. package/build/common/textFormat/formatWithPattern/formatWithPattern.js.map +1 -1
  158. package/build/common/textFormat/formatWithPattern/formatWithPattern.mjs.map +1 -1
  159. package/build/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js.map +1 -1
  160. package/build/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.mjs.map +1 -1
  161. package/build/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js.map +1 -1
  162. package/build/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.mjs.map +1 -1
  163. package/build/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js.map +1 -1
  164. package/build/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.mjs.map +1 -1
  165. package/build/common/textFormat/unformatWithPattern/unformatWithPattern.js.map +1 -1
  166. package/build/common/textFormat/unformatWithPattern/unformatWithPattern.mjs.map +1 -1
  167. package/build/common/theme.js.map +1 -1
  168. package/build/common/theme.mjs.map +1 -1
  169. package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
  170. package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
  171. package/build/dateInput/DateInput.js.map +1 -1
  172. package/build/dateInput/DateInput.mjs.map +1 -1
  173. package/build/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.js.map +1 -1
  174. package/build/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.mjs.map +1 -1
  175. package/build/dateLookup/DateLookup.js +3 -2
  176. package/build/dateLookup/DateLookup.js.map +1 -1
  177. package/build/dateLookup/DateLookup.mjs +3 -2
  178. package/build/dateLookup/DateLookup.mjs.map +1 -1
  179. package/build/dateLookup/dateHeader/DateHeader.js.map +1 -1
  180. package/build/dateLookup/dateHeader/DateHeader.mjs.map +1 -1
  181. package/build/dateLookup/dateTrigger/DateTrigger.js.map +1 -1
  182. package/build/dateLookup/dateTrigger/DateTrigger.mjs.map +1 -1
  183. package/build/dateLookup/dayCalendar/DayCalendar.js.map +1 -1
  184. package/build/dateLookup/dayCalendar/DayCalendar.mjs.map +1 -1
  185. package/build/dateLookup/dayCalendar/table/DayCalendarTable.js.map +1 -1
  186. package/build/dateLookup/dayCalendar/table/DayCalendarTable.mjs.map +1 -1
  187. package/build/dateLookup/getStartOfDay/getStartOfDay.js.map +1 -1
  188. package/build/dateLookup/getStartOfDay/getStartOfDay.mjs.map +1 -1
  189. package/build/dateLookup/monthCalendar/MonthCalendar.js.map +1 -1
  190. package/build/dateLookup/monthCalendar/MonthCalendar.mjs.map +1 -1
  191. package/build/dateLookup/monthCalendar/table/MonthCalendarTable.js.map +1 -1
  192. package/build/dateLookup/monthCalendar/table/MonthCalendarTable.mjs.map +1 -1
  193. package/build/dateLookup/tableLink/TableLink.js.map +1 -1
  194. package/build/dateLookup/tableLink/TableLink.mjs.map +1 -1
  195. package/build/dateLookup/yearCalendar/YearCalendar.js.map +1 -1
  196. package/build/dateLookup/yearCalendar/YearCalendar.mjs.map +1 -1
  197. package/build/dateLookup/yearCalendar/table/YearCalendarTable.js.map +1 -1
  198. package/build/dateLookup/yearCalendar/table/YearCalendarTable.mjs.map +1 -1
  199. package/build/decision/Decision.js.map +1 -1
  200. package/build/decision/Decision.mjs.map +1 -1
  201. package/build/definitionList/DefinitionList.js.map +1 -1
  202. package/build/definitionList/DefinitionList.mjs.map +1 -1
  203. package/build/dimmer/Dimmer.js.map +1 -1
  204. package/build/dimmer/Dimmer.mjs.map +1 -1
  205. package/build/dimmer/dimmerManager/DimmerManager.js.map +1 -1
  206. package/build/dimmer/dimmerManager/DimmerManager.mjs.map +1 -1
  207. package/build/display/Display.js.map +1 -1
  208. package/build/display/Display.mjs.map +1 -1
  209. package/build/divider/Divider.js.map +1 -1
  210. package/build/divider/Divider.mjs.map +1 -1
  211. package/build/drawer/Drawer.js.map +1 -1
  212. package/build/drawer/Drawer.mjs.map +1 -1
  213. package/build/dropFade/DropFade.js.map +1 -1
  214. package/build/dropFade/DropFade.mjs.map +1 -1
  215. package/build/emphasis/Emphasis.js.map +1 -1
  216. package/build/emphasis/Emphasis.mjs.map +1 -1
  217. package/build/emphasis/EmphasisHtmlTransformer.js.map +1 -1
  218. package/build/emphasis/EmphasisHtmlTransformer.mjs.map +1 -1
  219. package/build/field/Field.js.map +1 -1
  220. package/build/field/Field.mjs.map +1 -1
  221. package/build/flowNavigation/FlowNavigation.js.map +1 -1
  222. package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
  223. package/build/flowNavigation/animatedLabel/AnimatedLabel.js.map +1 -1
  224. package/build/flowNavigation/animatedLabel/AnimatedLabel.mjs.map +1 -1
  225. package/build/header/Header.js.map +1 -1
  226. package/build/header/Header.mjs.map +1 -1
  227. package/build/i18n/index.js +2 -0
  228. package/build/i18n/index.js.map +1 -1
  229. package/build/i18n/index.mjs +2 -0
  230. package/build/i18n/index.mjs.map +1 -1
  231. package/build/i18n/nl.json.js +81 -0
  232. package/build/i18n/nl.json.js.map +1 -0
  233. package/build/i18n/nl.json.mjs +77 -0
  234. package/build/i18n/nl.json.mjs.map +1 -0
  235. package/build/image/Image.js.map +1 -1
  236. package/build/image/Image.mjs.map +1 -1
  237. package/build/info/Info.js.map +1 -1
  238. package/build/info/Info.mjs.map +1 -1
  239. package/build/info/infoPresentations.js.map +1 -1
  240. package/build/info/infoPresentations.mjs.map +1 -1
  241. package/build/inlineAlert/InlineAlert.js.map +1 -1
  242. package/build/inlineAlert/InlineAlert.mjs.map +1 -1
  243. package/build/inputs/Input.js.map +1 -1
  244. package/build/inputs/Input.mjs.map +1 -1
  245. package/build/inputs/InputGroup.js.map +1 -1
  246. package/build/inputs/InputGroup.mjs.map +1 -1
  247. package/build/inputs/SearchInput.js.map +1 -1
  248. package/build/inputs/SearchInput.mjs.map +1 -1
  249. package/build/inputs/SelectInput.js.map +1 -1
  250. package/build/inputs/SelectInput.mjs.map +1 -1
  251. package/build/inputs/_BottomSheet.js.map +1 -1
  252. package/build/inputs/_BottomSheet.mjs.map +1 -1
  253. package/build/inputs/_ButtonInput.js.map +1 -1
  254. package/build/inputs/_ButtonInput.mjs.map +1 -1
  255. package/build/inputs/_Popover.js.map +1 -1
  256. package/build/inputs/_Popover.mjs.map +1 -1
  257. package/build/inputs/contexts.js.map +1 -1
  258. package/build/inputs/contexts.mjs.map +1 -1
  259. package/build/instructionsList/InstructionsList.js.map +1 -1
  260. package/build/instructionsList/InstructionsList.mjs.map +1 -1
  261. package/build/label/Label.js.map +1 -1
  262. package/build/label/Label.mjs.map +1 -1
  263. package/build/legacylistItem/LegacyListItem.js.map +1 -1
  264. package/build/legacylistItem/LegacyListItem.mjs.map +1 -1
  265. package/build/legacylistItem/List.js.map +1 -1
  266. package/build/legacylistItem/List.mjs.map +1 -1
  267. package/build/link/Link.js.map +1 -1
  268. package/build/link/Link.mjs.map +1 -1
  269. package/build/loader/Loader.js.map +1 -1
  270. package/build/loader/Loader.mjs.map +1 -1
  271. package/build/logo/Logo.js.map +1 -1
  272. package/build/logo/Logo.mjs.map +1 -1
  273. package/build/logo/logo-assets.js.map +1 -1
  274. package/build/logo/logo-assets.mjs.map +1 -1
  275. package/build/main.css +4 -94
  276. package/build/markdown/Markdown.js.map +1 -1
  277. package/build/markdown/Markdown.mjs.map +1 -1
  278. package/build/mocks.js.map +1 -1
  279. package/build/mocks.mjs.map +1 -1
  280. package/build/modal/Modal.js.map +1 -1
  281. package/build/modal/Modal.mjs.map +1 -1
  282. package/build/money/Money.js.map +1 -1
  283. package/build/money/Money.mjs.map +1 -1
  284. package/build/moneyInput/MoneyInput.js.map +1 -1
  285. package/build/moneyInput/MoneyInput.mjs.map +1 -1
  286. package/build/moneyInput/currencyFormatting.js.map +1 -1
  287. package/build/moneyInput/currencyFormatting.mjs.map +1 -1
  288. package/build/navigationOption/NavigationOption.js.map +1 -1
  289. package/build/navigationOption/NavigationOption.mjs.map +1 -1
  290. package/build/navigationOptionsList/NavigationOptionsList.js.map +1 -1
  291. package/build/navigationOptionsList/NavigationOptionsList.mjs.map +1 -1
  292. package/build/nudge/Nudge.js.map +1 -1
  293. package/build/nudge/Nudge.mjs.map +1 -1
  294. package/build/overlayHeader/OverlayHeader.js.map +1 -1
  295. package/build/overlayHeader/OverlayHeader.mjs.map +1 -1
  296. package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
  297. package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
  298. package/build/phoneNumberInput/data/countries.js.map +1 -1
  299. package/build/phoneNumberInput/data/countries.mjs.map +1 -1
  300. package/build/phoneNumberInput/utils/explodeNumberModel/index.js.map +1 -1
  301. package/build/phoneNumberInput/utils/explodeNumberModel/index.mjs.map +1 -1
  302. package/build/phoneNumberInput/utils/findCountryByCode/index.js.map +1 -1
  303. package/build/phoneNumberInput/utils/findCountryByCode/index.mjs.map +1 -1
  304. package/build/phoneNumberInput/utils/findCountryByPrefix/index.js.map +1 -1
  305. package/build/phoneNumberInput/utils/findCountryByPrefix/index.mjs.map +1 -1
  306. package/build/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.js.map +1 -1
  307. package/build/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.mjs.map +1 -1
  308. package/build/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js.map +1 -1
  309. package/build/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.mjs.map +1 -1
  310. package/build/phoneNumberInput/utils/longestMatchingPrefix/index.js.map +1 -1
  311. package/build/phoneNumberInput/utils/longestMatchingPrefix/index.mjs.map +1 -1
  312. package/build/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.js.map +1 -1
  313. package/build/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.mjs.map +1 -1
  314. package/build/popover/Popover.js.map +1 -1
  315. package/build/popover/Popover.mjs.map +1 -1
  316. package/build/primitives/PrimitiveAnchor/PrimitiveAnchor.js.map +1 -1
  317. package/build/primitives/PrimitiveAnchor/PrimitiveAnchor.mjs.map +1 -1
  318. package/build/primitives/PrimitiveButton/PrimitiveButton.js.map +1 -1
  319. package/build/primitives/PrimitiveButton/PrimitiveButton.mjs.map +1 -1
  320. package/build/processIndicator/ProcessIndicator.js.map +1 -1
  321. package/build/processIndicator/ProcessIndicator.mjs.map +1 -1
  322. package/build/progress/Progress.js.map +1 -1
  323. package/build/progress/Progress.mjs.map +1 -1
  324. package/build/progressBar/ProgressBar.js.map +1 -1
  325. package/build/progressBar/ProgressBar.mjs.map +1 -1
  326. package/build/promoCard/PromoCard.js.map +1 -1
  327. package/build/promoCard/PromoCard.mjs.map +1 -1
  328. package/build/promoCard/PromoCardContext.js.map +1 -1
  329. package/build/promoCard/PromoCardContext.mjs.map +1 -1
  330. package/build/promoCard/PromoCardGroup.js.map +1 -1
  331. package/build/promoCard/PromoCardGroup.mjs.map +1 -1
  332. package/build/promoCard/PromoCardIndicator.js.map +1 -1
  333. package/build/promoCard/PromoCardIndicator.mjs.map +1 -1
  334. package/build/provider/Provider.js.map +1 -1
  335. package/build/provider/Provider.mjs.map +1 -1
  336. package/build/provider/direction/DirectionProvider.js.map +1 -1
  337. package/build/provider/direction/DirectionProvider.mjs.map +1 -1
  338. package/build/provider/language/LanguageProvider.js.map +1 -1
  339. package/build/provider/language/LanguageProvider.mjs.map +1 -1
  340. package/build/provider/overlay/OverlayIdProvider.js.map +1 -1
  341. package/build/provider/overlay/OverlayIdProvider.mjs.map +1 -1
  342. package/build/radio/Radio.js.map +1 -1
  343. package/build/radio/Radio.mjs.map +1 -1
  344. package/build/radioGroup/RadioGroup.js.map +1 -1
  345. package/build/radioGroup/RadioGroup.mjs.map +1 -1
  346. package/build/radioOption/RadioOption.js.map +1 -1
  347. package/build/radioOption/RadioOption.mjs.map +1 -1
  348. package/build/section/Section.js.map +1 -1
  349. package/build/section/Section.mjs.map +1 -1
  350. package/build/segmentedControl/SegmentedControl.js.map +1 -1
  351. package/build/segmentedControl/SegmentedControl.mjs.map +1 -1
  352. package/build/select/Select.js.map +1 -1
  353. package/build/select/Select.mjs.map +1 -1
  354. package/build/select/option/Option.js.map +1 -1
  355. package/build/select/option/Option.mjs.map +1 -1
  356. package/build/select/searchBox/SearchBox.js.map +1 -1
  357. package/build/select/searchBox/SearchBox.mjs.map +1 -1
  358. package/build/slidingPanel/SlidingPanel.js.map +1 -1
  359. package/build/slidingPanel/SlidingPanel.mjs.map +1 -1
  360. package/build/snackbar/Snackbar.js.map +1 -1
  361. package/build/snackbar/Snackbar.mjs.map +1 -1
  362. package/build/snackbar/SnackbarContext.js.map +1 -1
  363. package/build/snackbar/SnackbarContext.mjs.map +1 -1
  364. package/build/snackbar/SnackbarProvider.js.map +1 -1
  365. package/build/snackbar/SnackbarProvider.mjs.map +1 -1
  366. package/build/snackbar/useSnackbar.js.map +1 -1
  367. package/build/snackbar/useSnackbar.mjs.map +1 -1
  368. package/build/statusIcon/StatusIcon.js.map +1 -1
  369. package/build/statusIcon/StatusIcon.mjs.map +1 -1
  370. package/build/stepper/Stepper.js.map +1 -1
  371. package/build/stepper/Stepper.mjs.map +1 -1
  372. package/build/stepper/deviceDetection.js.map +1 -1
  373. package/build/stepper/deviceDetection.mjs.map +1 -1
  374. package/build/sticky/Sticky.js.map +1 -1
  375. package/build/sticky/Sticky.mjs.map +1 -1
  376. package/build/styles/accordion/Accordion.css +27 -16
  377. package/build/styles/avatar/Avatar.css +95 -50
  378. package/build/styles/inputs/Input.css +37 -21
  379. package/build/styles/inputs/TextArea.css +35 -20
  380. package/build/styles/loader/Loader.css +4 -90
  381. package/build/styles/main.css +4 -94
  382. package/build/styles/popover/Popover.css +19 -12
  383. package/build/styles/select/Select.css +131 -68
  384. package/build/styles/switch/Switch.css +27 -16
  385. package/build/styles/tile/Tile.css +31 -18
  386. package/build/summary/Summary.js.map +1 -1
  387. package/build/summary/Summary.mjs.map +1 -1
  388. package/build/switch/Switch.js.map +1 -1
  389. package/build/switch/Switch.mjs.map +1 -1
  390. package/build/switchOption/SwitchOption.js.map +1 -1
  391. package/build/switchOption/SwitchOption.mjs.map +1 -1
  392. package/build/table/Table.js.map +1 -1
  393. package/build/table/Table.mjs.map +1 -1
  394. package/build/table/TableCell.js.map +1 -1
  395. package/build/table/TableCell.mjs.map +1 -1
  396. package/build/table/TableHeader.js.map +1 -1
  397. package/build/table/TableHeader.mjs.map +1 -1
  398. package/build/table/TableRow.js.map +1 -1
  399. package/build/table/TableRow.mjs.map +1 -1
  400. package/build/table/TableStatusText.js.map +1 -1
  401. package/build/table/TableStatusText.mjs.map +1 -1
  402. package/build/tabs/Tab.js.map +1 -1
  403. package/build/tabs/Tab.mjs.map +1 -1
  404. package/build/tabs/TabList.js.map +1 -1
  405. package/build/tabs/TabList.mjs.map +1 -1
  406. package/build/tabs/TabPanel.js.map +1 -1
  407. package/build/tabs/TabPanel.mjs.map +1 -1
  408. package/build/tabs/Tabs.js.map +1 -1
  409. package/build/tabs/Tabs.mjs.map +1 -1
  410. package/build/tabs/utils.js.map +1 -1
  411. package/build/tabs/utils.mjs.map +1 -1
  412. package/build/tile/Tile.js.map +1 -1
  413. package/build/tile/Tile.mjs.map +1 -1
  414. package/build/title/Title.js.map +1 -1
  415. package/build/title/Title.mjs.map +1 -1
  416. package/build/tooltip/Tooltip.js.map +1 -1
  417. package/build/tooltip/Tooltip.mjs.map +1 -1
  418. package/build/typeahead/Typeahead.js.map +1 -1
  419. package/build/typeahead/Typeahead.mjs.map +1 -1
  420. package/build/typeahead/typeaheadInput/TypeaheadInput.js.map +1 -1
  421. package/build/typeahead/typeaheadInput/TypeaheadInput.mjs.map +1 -1
  422. package/build/typeahead/typeaheadOption/TypeaheadOption.js.map +1 -1
  423. package/build/typeahead/typeaheadOption/TypeaheadOption.mjs.map +1 -1
  424. package/build/typeahead/util/highlight.js.map +1 -1
  425. package/build/typeahead/util/highlight.mjs.map +1 -1
  426. package/build/types/common/locale/index.d.ts.map +1 -1
  427. package/build/types/dateLookup/DateLookup.d.ts +2 -2
  428. package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
  429. package/build/types/i18n/index.d.ts.map +1 -1
  430. package/build/types/test-utils/story-config.d.ts +2 -3
  431. package/build/types/test-utils/story-config.d.ts.map +1 -1
  432. package/build/upload/Upload.js.map +1 -1
  433. package/build/upload/Upload.mjs.map +1 -1
  434. package/build/upload/steps/completeStep/completeStep.js.map +1 -1
  435. package/build/upload/steps/completeStep/completeStep.mjs.map +1 -1
  436. package/build/upload/steps/processingStep/processingStep.js.map +1 -1
  437. package/build/upload/steps/processingStep/processingStep.mjs.map +1 -1
  438. package/build/upload/steps/uploadImageStep/uploadImageStep.js.map +1 -1
  439. package/build/upload/steps/uploadImageStep/uploadImageStep.mjs.map +1 -1
  440. package/build/upload/utils/asyncFileRead/asyncFileRead.js.map +1 -1
  441. package/build/upload/utils/asyncFileRead/asyncFileRead.mjs.map +1 -1
  442. package/build/upload/utils/getFileType/getFileType.js.map +1 -1
  443. package/build/upload/utils/getFileType/getFileType.mjs.map +1 -1
  444. package/build/upload/utils/isSizeValid/isSizeValid.js.map +1 -1
  445. package/build/upload/utils/isSizeValid/isSizeValid.mjs.map +1 -1
  446. package/build/upload/utils/isTypeValid/isTypeValid.js.map +1 -1
  447. package/build/upload/utils/isTypeValid/isTypeValid.mjs.map +1 -1
  448. package/build/upload/utils/postData/postData.js.map +1 -1
  449. package/build/upload/utils/postData/postData.mjs.map +1 -1
  450. package/build/uploadInput/UploadInput.js.map +1 -1
  451. package/build/uploadInput/UploadInput.mjs.map +1 -1
  452. package/build/uploadInput/uploadButton/UploadButton.js.map +1 -1
  453. package/build/uploadInput/uploadButton/UploadButton.mjs.map +1 -1
  454. package/build/uploadInput/uploadButton/defaults.js.map +1 -1
  455. package/build/uploadInput/uploadButton/defaults.mjs.map +1 -1
  456. package/build/uploadInput/uploadButton/getAllowedFileTypes.js.map +1 -1
  457. package/build/uploadInput/uploadButton/getAllowedFileTypes.mjs.map +1 -1
  458. package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
  459. package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -1
  460. package/build/uploadInput/uploadItem/UploadItemLink.js.map +1 -1
  461. package/build/uploadInput/uploadItem/UploadItemLink.mjs.map +1 -1
  462. package/build/utilities/cssValueWithUnit.js.map +1 -1
  463. package/build/utilities/cssValueWithUnit.mjs.map +1 -1
  464. package/build/utilities/logActionRequired.js.map +1 -1
  465. package/build/utilities/logActionRequired.mjs.map +1 -1
  466. package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
  467. package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
  468. package/build/withId/withId.js.map +1 -1
  469. package/build/withId/withId.mjs.map +1 -1
  470. package/build/withNextPortal/withNextPortal.js.map +1 -1
  471. package/build/withNextPortal/withNextPortal.mjs.map +1 -1
  472. package/package.json +37 -45
  473. package/src/accordion/Accordion.css +27 -16
  474. package/src/accordion/Accordion.story.tsx +31 -22
  475. package/src/actionButton/ActionButton.story.tsx +3 -3
  476. package/src/actionOption/ActionOption.story.tsx +2 -3
  477. package/src/alert/Alert.story.tsx +3 -3
  478. package/src/alert/Alert.tests.story.tsx +2 -2
  479. package/src/avatar/Avatar.css +95 -50
  480. package/src/avatar/Avatar.spec.tsx +7 -4
  481. package/src/avatar/Avatar.story.tsx +3 -3
  482. package/src/avatarLayout/AvatarLayout.story.tsx +1 -4
  483. package/src/avatarLayout/AvatarLayout.tsx +1 -1
  484. package/src/avatarView/AvatarView.story.tsx +1 -7
  485. package/src/avatarWrapper/AvatarWrapper.story.tsx +3 -3
  486. package/src/badge/Badge.story.tsx +49 -29
  487. package/src/body/Body.story.tsx +0 -1
  488. package/src/button/Button.accessibility.docs.mdx +1 -1
  489. package/src/button/Button.story.tsx +3 -3
  490. package/src/button/Button.tests.story.tsx +2 -2
  491. package/src/button/LegacyButton.story.tsx +4 -3
  492. package/src/card/Card.story.tsx +2 -3
  493. package/src/carousel/Carousel.story.tsx +1 -1
  494. package/src/checkbox/Checkbox.story.tsx +2 -3
  495. package/src/checkboxButton/CheckboxButton.story.tsx +3 -3
  496. package/src/checkboxOption/CheckboxOption.story.tsx +35 -30
  497. package/src/chevron/Chevron.story.tsx +1 -2
  498. package/src/chips/Chips.story.tsx +1 -2
  499. package/src/circularButton/CircularButton.story.tsx +2 -2
  500. package/src/circularButton/CircularButton.tests.story.tsx +1 -1
  501. package/src/common/bottomSheet/BottomSheet.story.tsx +7 -6
  502. package/src/common/card/Card.story.tsx +1 -2
  503. package/src/common/circle/Circle.story.tsx +2 -3
  504. package/src/common/locale/index.spec.ts +29 -17
  505. package/src/common/locale/index.ts +2 -0
  506. package/src/common/responsivePanel/ResponsivePanel.spec.js +8 -29
  507. package/src/criticalBanner/CriticalCommsBanner.story.tsx +1 -2
  508. package/src/dateInput/DateInput.story.tsx +2 -3
  509. package/src/dateInput/DateInput.tests.story.tsx +2 -2
  510. package/src/dateLookup/DateLookup.spec.tsx +5 -5
  511. package/src/dateLookup/DateLookup.story.tsx +43 -71
  512. package/src/dateLookup/DateLookup.tests.story.tsx +3 -3
  513. package/src/dateLookup/DateLookup.tsx +4 -1
  514. package/src/decision/Decision.story.tsx +24 -49
  515. package/src/definitionList/DefinitionList.story.tsx +1 -1
  516. package/src/dimmer/Dimmer.story.tsx +2 -2
  517. package/src/divider/Divider.accessibility.docs.mdx +1 -1
  518. package/src/divider/Divider.story.tsx +2 -2
  519. package/src/drawer/Drawer.story.tsx +13 -7
  520. package/src/dropFade/DropFade.story.tsx +1 -1
  521. package/src/emphasis/Emphasis.spec.tsx +8 -8
  522. package/src/emphasis/Emphasis.story.tsx +1 -2
  523. package/src/field/Field.story.tsx +4 -4
  524. package/src/flowNavigation/FlowNavigation.story.tsx +305 -260
  525. package/src/i18n/index.ts +2 -0
  526. package/src/iconButton/IconButton.story.tsx +2 -3
  527. package/src/image/Image.story.tsx +27 -54
  528. package/src/info/Info.story.tsx +3 -2
  529. package/src/inlineAlert/InlineAlert.story.tsx +1 -1
  530. package/src/inputWithDisplayFormat/InputWithDisplayFormat.story.tsx +3 -2
  531. package/src/inputs/Input.css +37 -21
  532. package/src/inputs/InputGroup.story.tsx +1 -1
  533. package/src/inputs/SearchInput.story.tsx +1 -1
  534. package/src/inputs/SelectInput.docs.mdx +1 -1
  535. package/src/inputs/SelectInput.story.tsx +3 -3
  536. package/src/inputs/TextArea.css +35 -20
  537. package/src/instructionsList/InstructionsList.story.tsx +2 -3
  538. package/src/label/Label.story.tsx +0 -1
  539. package/src/legacylistItem/LegacyListItem.story.tsx +1 -2
  540. package/src/loader/Loader.css +4 -90
  541. package/src/loader/Loader.story.tsx +1 -2
  542. package/src/logo/Logo.story.tsx +1 -2
  543. package/src/main.css +4 -94
  544. package/src/markdown/Markdown.story.tsx +1 -2
  545. package/src/modal/Modal.story.tsx +13 -8
  546. package/src/money/Money.story.tsx +1 -1
  547. package/src/moneyInput/MoneyInput.docs.mdx +1 -1
  548. package/src/moneyInput/MoneyInput.spec.tsx +8 -5
  549. package/src/moneyInput/MoneyInput.story.tsx +2 -3
  550. package/src/moneyInput/currencyFormatting.spec.ts +1 -1
  551. package/src/navigationOption/NavigationOption.story.tsx +264 -226
  552. package/src/nudge/Nudge.story.tsx +1 -1
  553. package/src/overlayHeader/OverlayHeader.story.tsx +32 -24
  554. package/src/phoneNumberInput/PhoneNumberInput.story.tsx +1 -2
  555. package/src/phoneNumberInput/utils/setDefaultPrefix/setDefaultPrefix.spec.ts +6 -3
  556. package/src/popover/Popover.css +19 -12
  557. package/src/popover/Popover.story.tsx +3 -3
  558. package/src/primitives/PrimitiveAnchor/stories/PrimitiveAnchor.story.tsx +2 -3
  559. package/src/primitives/PrimitiveAnchor/stories/PrimitiveAnchor.tests.story.tsx +2 -2
  560. package/src/primitives/PrimitiveButton/stories/PrimitiveButton.story.tsx +2 -3
  561. package/src/primitives/PrimitiveButton/stories/PrimitiveButton.tests.story.tsx +2 -3
  562. package/src/processIndicator/ProcessIndicator.story.tsx +1 -2
  563. package/src/progress/Progress.story.tsx +1 -1
  564. package/src/progressBar/ProgressBar.story.tsx +1 -2
  565. package/src/promoCard/PromoCard.story.tsx +2 -2
  566. package/src/promoCard/PromoCardGroup.story.tsx +1 -2
  567. package/src/provider/Provider.spec.tsx +2 -2
  568. package/src/provider/Provider.story.tsx +1 -1
  569. package/src/provider/direction/DirectionProvider.spec.tsx +1 -1
  570. package/src/provider/language/LanguageProvider.spec.tsx +1 -1
  571. package/src/provider/theme/ThemeProvider.story.tsx +1 -1
  572. package/src/radio/Radio.story.tsx +59 -42
  573. package/src/radioGroup/RadioGroup.story.tsx +2 -2
  574. package/src/radioOption/RadioOption.story.tsx +73 -38
  575. package/src/segmentedControl/SegmentedControl.story.tsx +1 -1
  576. package/src/select/Select.css +131 -68
  577. package/src/select/Select.story.tsx +385 -397
  578. package/src/slidingPanel/SlidingPanel.story.tsx +30 -13
  579. package/src/snackbar/Snackbar.story.tsx +50 -36
  580. package/src/snackbar/Snackbar.tests.story.tsx +3 -2
  581. package/src/statusIcon/StatusIcon.docs.mdx +1 -1
  582. package/src/statusIcon/StatusIcon.spec.tsx +8 -5
  583. package/src/statusIcon/StatusIcon.story.tsx +2 -2
  584. package/src/stepper/Stepper.story.tsx +2 -3
  585. package/src/stepper/Stepper.tests.story.tsx +2 -2
  586. package/src/sticky/Sticky.story.tsx +2 -2
  587. package/src/summary/Summary.story.tsx +18 -17
  588. package/src/switch/Switch.css +27 -16
  589. package/src/switch/Switch.story.tsx +2 -3
  590. package/src/switchOption/SwitchOption.story.tsx +2 -2
  591. package/src/table/Table.story.tsx +1 -2
  592. package/src/tabs/Tabs.story.tsx +0 -1
  593. package/src/test-utils/story-config.ts +9 -6
  594. package/src/textareaWithDisplayFormat/TextareaWithDisplayFormat.story.tsx +2 -2
  595. package/src/tile/Tile.css +31 -18
  596. package/src/tile/Tile.story.tsx +43 -43
  597. package/src/tooltip/Tooltip.story.tsx +2 -3
  598. package/src/typeahead/Typeahead.story.tsx +3 -2
  599. package/src/upload/Upload.story.tsx +3 -3
  600. package/src/upload/Upload.tests.story.tsx +2 -2
  601. package/src/upload/utils/isTypeValid/isTypeValid.spec.ts +3 -1
  602. package/src/uploadInput/UploadInput.story.tsx +1 -2
  603. package/src/uploadInput/UploadInput.tests.story.tsx +3 -3
  604. package/src/withId/withId.docs.mdx +1 -1
  605. package/src/withId/withId.story.tsx +1 -1
  606. package/src/common/responsivePanel/__snapshots__/ResponsivePanel.spec.js.snap +0 -21
@@ -1 +1 @@
1
- {"version":3,"file":"Snackbar.js","sources":["../../src/snackbar/Snackbar.tsx"],"sourcesContent":["import { Component, createRef } from 'react';\nimport { CSSTransition } from 'react-transition-group';\n\nimport Button from '../button';\nimport Body from '../body';\nimport { Theme, type ThemeDark, type ThemeLight } from '../common';\nimport { DirectionContext } from '../provider/direction';\nimport withNextPortal from '../withNextPortal/withNextPortal';\n\nconst CSS_TRANSITION_DURATION = 400;\n\nexport interface SnackbarProps {\n action?: {\n label: string;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n };\n text: React.ReactNode;\n /** @deprecated */\n theme?: ThemeLight | ThemeDark;\n timeout: number;\n timestamp: number;\n}\n\ninterface SnackbarState extends Pick<SnackbarProps, 'action' | 'text' | 'theme'> {\n visible: boolean;\n}\n\nexport class Snackbar extends Component<SnackbarProps, SnackbarState> {\n bodyRef = createRef<HTMLSpanElement>();\n timeout = 0;\n transitionTimeout = 0;\n\n constructor(props: SnackbarProps) {\n super(props);\n this.state = {\n visible: false,\n text: '',\n };\n }\n\n componentWillUnmount() {\n window.clearTimeout(this.timeout);\n window.clearTimeout(this.transitionTimeout);\n }\n\n shouldComponentUpdate(nextProps: SnackbarProps, nextState: SnackbarState) {\n if (!nextProps.text) {\n return false;\n }\n if (\n nextProps.timestamp === this.props.timestamp &&\n nextState.visible === this.state.visible &&\n nextState.text === this.state.text\n ) {\n return false;\n }\n\n return true;\n }\n\n setLeaveTimeout = () => {\n const { timeout } = this.props;\n\n this.timeout = window.setTimeout(() => {\n this.setState({ visible: false });\n }, timeout);\n };\n\n componentDidUpdate(previousProps: SnackbarProps) {\n const { action, text, timestamp } = this.props;\n\n if (!previousProps.text) {\n this.setState({ visible: true, action, text }, () => {\n this.setLeaveTimeout();\n });\n } else if (previousProps.timestamp !== timestamp) {\n window.clearTimeout(this.timeout);\n\n if (this.state.visible) {\n this.setState({ visible: false }, () => {\n this.transitionTimeout = window.setTimeout(() => {\n this.setState({ visible: true, action, text });\n this.setLeaveTimeout();\n }, CSS_TRANSITION_DURATION);\n });\n } else {\n this.setState({ visible: true, action, text });\n this.setLeaveTimeout();\n }\n }\n }\n\n render() {\n const { action, text, visible } = this.state;\n const { timeout } = this.props;\n\n return (\n <div className=\"snackbar\" aria-live=\"assertive\" role=\"alert\">\n <CSSTransition\n nodeRef={this.bodyRef}\n in={visible}\n classNames=\"snackbar__text-container\"\n timeout={{\n appear: 0,\n enter: timeout,\n exit: CSS_TRANSITION_DURATION,\n }}\n unmountOnExit\n >\n <Body ref={this.bodyRef} as=\"span\" className=\"snackbar__text\">\n {text}\n {action ? (\n <Button className=\"snackbar__text__action\" v2 size=\"sm\" onClick={action.onClick}>\n {action.label}\n </Button>\n ) : null}\n </Body>\n </CSSTransition>\n </div>\n );\n }\n}\n\nSnackbar.contextType = DirectionContext;\n\nexport default withNextPortal(Snackbar);\n"],"names":["CSS_TRANSITION_DURATION","Snackbar","Component","bodyRef","createRef","timeout","transitionTimeout","constructor","props","state","visible","text","componentWillUnmount","window","clearTimeout","shouldComponentUpdate","nextProps","nextState","timestamp","setLeaveTimeout","setTimeout","setState","componentDidUpdate","previousProps","action","render","_jsx","className","role","children","CSSTransition","nodeRef","in","classNames","appear","enter","exit","unmountOnExit","_jsxs","Body","ref","as","Button","v2","size","onClick","label","contextType","DirectionContext","withNextPortal"],"mappings":";;;;;;;;;;;;AASA,MAAMA,uBAAuB,GAAG,GAAG;AAkB7B,MAAOC,QAAS,SAAQC,eAAuC,CAAA;EACnEC,OAAO,gBAAGC,eAAS,EAAmB;AACtCC,EAAAA,OAAO,GAAG,CAAC;AACXC,EAAAA,iBAAiB,GAAG,CAAC;EAErBC,WAAAA,CAAYC,KAAoB,EAAA;IAC9B,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,KAAK,GAAG;AACXC,MAAAA,OAAO,EAAE,KAAK;AACdC,MAAAA,IAAI,EAAE;KACP;AACH;AAEAC,EAAAA,oBAAoBA,GAAA;AAClBC,IAAAA,MAAM,CAACC,YAAY,CAAC,IAAI,CAACT,OAAO,CAAC;AACjCQ,IAAAA,MAAM,CAACC,YAAY,CAAC,IAAI,CAACR,iBAAiB,CAAC;AAC7C;AAEAS,EAAAA,qBAAqBA,CAACC,SAAwB,EAAEC,SAAwB,EAAA;AACtE,IAAA,IAAI,CAACD,SAAS,CAACL,IAAI,EAAE;AACnB,MAAA,OAAO,KAAK;AACd;AACA,IAAA,IACEK,SAAS,CAACE,SAAS,KAAK,IAAI,CAACV,KAAK,CAACU,SAAS,IAC5CD,SAAS,CAACP,OAAO,KAAK,IAAI,CAACD,KAAK,C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AAI;SACJ;OACO;AACjB,KAAK,CAAC;AAEV;AACD;AAED7C,QAAQ,CAAC8C,WAAW,GAAGC,kCAAgB;AAEvC,qBAAeC,sBAAc,CAAChD,QAAQ,CAAC;;;;;"}
1
+ {"version":3,"file":"Snackbar.js","sources":["../../src/snackbar/Snackbar.tsx"],"sourcesContent":["import { Component, createRef } from 'react';\nimport { CSSTransition } from 'react-transition-group';\n\nimport Button from '../button';\nimport Body from '../body';\nimport { Theme, type ThemeDark, type ThemeLight } from '../common';\nimport { DirectionContext } from '../provider/direction';\nimport withNextPortal from '../withNextPortal/withNextPortal';\n\nconst CSS_TRANSITION_DURATION = 400;\n\nexport interface SnackbarProps {\n action?: {\n label: string;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n };\n text: React.ReactNode;\n /** @deprecated */\n theme?: ThemeLight | ThemeDark;\n timeout: number;\n timestamp: number;\n}\n\ninterface SnackbarState extends Pick<SnackbarProps, 'action' | 'text' | 'theme'> {\n visible: boolean;\n}\n\nexport class Snackbar extends Component<SnackbarProps, SnackbarState> {\n bodyRef = createRef<HTMLSpanElement>();\n timeout = 0;\n transitionTimeout = 0;\n\n constructor(props: SnackbarProps) {\n super(props);\n this.state = {\n visible: false,\n text: '',\n };\n }\n\n componentWillUnmount() {\n window.clearTimeout(this.timeout);\n window.clearTimeout(this.transitionTimeout);\n }\n\n shouldComponentUpdate(nextProps: SnackbarProps, nextState: SnackbarState) {\n if (!nextProps.text) {\n return false;\n }\n if (\n nextProps.timestamp === this.props.timestamp &&\n nextState.visible === this.state.visible &&\n nextState.text === this.state.text\n ) {\n return false;\n }\n\n return true;\n }\n\n setLeaveTimeout = () => {\n const { timeout } = this.props;\n\n this.timeout = window.setTimeout(() => {\n this.setState({ visible: false });\n }, timeout);\n };\n\n componentDidUpdate(previousProps: SnackbarProps) {\n const { action, text, timestamp } = this.props;\n\n if (!previousProps.text) {\n this.setState({ visible: true, action, text }, () => {\n this.setLeaveTimeout();\n });\n } else if (previousProps.timestamp !== timestamp) {\n window.clearTimeout(this.timeout);\n\n if (this.state.visible) {\n this.setState({ visible: false }, () => {\n this.transitionTimeout = window.setTimeout(() => {\n this.setState({ visible: true, action, text });\n this.setLeaveTimeout();\n }, CSS_TRANSITION_DURATION);\n });\n } else {\n this.setState({ visible: true, action, text });\n this.setLeaveTimeout();\n }\n }\n }\n\n render() {\n const { action, text, visible } = this.state;\n const { timeout } = this.props;\n\n return (\n <div className=\"snackbar\" aria-live=\"assertive\" role=\"alert\">\n <CSSTransition\n nodeRef={this.bodyRef}\n in={visible}\n classNames=\"snackbar__text-container\"\n timeout={{\n appear: 0,\n enter: timeout,\n exit: CSS_TRANSITION_DURATION,\n }}\n unmountOnExit\n >\n <Body ref={this.bodyRef} as=\"span\" className=\"snackbar__text\">\n {text}\n {action ? (\n <Button className=\"snackbar__text__action\" v2 size=\"sm\" onClick={action.onClick}>\n {action.label}\n </Button>\n ) : null}\n </Body>\n </CSSTransition>\n </div>\n );\n }\n}\n\nSnackbar.contextType = DirectionContext;\n\nexport default withNextPortal(Snackbar);\n"],"names":["CSS_TRANSITION_DURATION","Snackbar","Component","bodyRef","createRef","timeout","transitionTimeout","constructor","props","state","visible","text","componentWillUnmount","window","clearTimeout","shouldComponentUpdate","nextProps","nextState","timestamp","setLeaveTimeout","setTimeout","setState","componentDidUpdate","previousProps","action","render","_jsx","className","role","children","CSSTransition","nodeRef","in","classNames","appear","enter","exit","unmountOnExit","_jsxs","Body","ref","as","Button","v2","size","onClick","label","contextType","DirectionContext","withNextPortal"],"mappings":";;;;;;;;;;;;AASA,MAAMA,uBAAuB,GAAG,GAAG;AAkB7B,MAAOC,QAAS,SAAQC,eAAuC,CAAA;EACnEC,OAAO,gBAAGC,eAAS,EAAmB;AACtCC,EAAAA,OAAO,GAAG,CAAC;AACXC,EAAAA,iBAAiB,GAAG,CAAC;EAErBC,WAAAA,CAAYC,KAAoB,EAAA;IAC9B,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,KAAK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AAU,EAAC,0BAA0B;AACrC5B,QAAAA,OAAO,EAAE;AACP6B,UAAAA,MAAM,EAAE,CAAC;AACTC,UAAAA,KAAK,EAAE9B,OAAO;AACd+B,UAAAA,IAAI,EAAEpC;SACN;QACFqC,aAAa,EAAA,IAAA;QAAAR,QAAA,eAEbS,eAAA,CAACC,YAAI,EAAA;UAACC,GAAG,EAAE,IAAI,CAACrC,OAAQ;AAACsC,UAAAA,EAAE,EAAC,MAAM;AAACd,UAAAA,SAAS,EAAC,gBAAgB;AAAAE,UAAAA,QAAA,GAC1DlB,IAAI,EACJa,MAAM,gBACLE,cAAA,CAACgB,uBAAM,EAAA;AAACf,YAAAA,SAAS,EAAC,wBAAwB;YAACgB,EAAE,EAAA,IAAA;AAACC,YAAAA,IAAI,EAAC,IAAI;YAACC,OAAO,EAAErB,MAAM,CAACqB,OAAQ;YAAAhB,QAAA,EAC7EL,MAAM,CAACsB;WACF,CAAC,GACP,IAAI;SACJ;OACO;AACjB,KAAK,CAAC;AAEV,EAAA;AACD;AAED7C,QAAQ,CAAC8C,WAAW,GAAGC,kCAAgB;AAEvC,qBAAeC,sBAAc,CAAChD,QAAQ,CAAC;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Snackbar.mjs","sources":["../../src/snackbar/Snackbar.tsx"],"sourcesContent":["import { Component, createRef } from 'react';\nimport { CSSTransition } from 'react-transition-group';\n\nimport Button from '../button';\nimport Body from '../body';\nimport { Theme, type ThemeDark, type ThemeLight } from '../common';\nimport { DirectionContext } from '../provider/direction';\nimport withNextPortal from '../withNextPortal/withNextPortal';\n\nconst CSS_TRANSITION_DURATION = 400;\n\nexport interface SnackbarProps {\n action?: {\n label: string;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n };\n text: React.ReactNode;\n /** @deprecated */\n theme?: ThemeLight | ThemeDark;\n timeout: number;\n timestamp: number;\n}\n\ninterface SnackbarState extends Pick<SnackbarProps, 'action' | 'text' | 'theme'> {\n visible: boolean;\n}\n\nexport class Snackbar extends Component<SnackbarProps, SnackbarState> {\n bodyRef = createRef<HTMLSpanElement>();\n timeout = 0;\n transitionTimeout = 0;\n\n constructor(props: SnackbarProps) {\n super(props);\n this.state = {\n visible: false,\n text: '',\n };\n }\n\n componentWillUnmount() {\n window.clearTimeout(this.timeout);\n window.clearTimeout(this.transitionTimeout);\n }\n\n shouldComponentUpdate(nextProps: SnackbarProps, nextState: SnackbarState) {\n if (!nextProps.text) {\n return false;\n }\n if (\n nextProps.timestamp === this.props.timestamp &&\n nextState.visible === this.state.visible &&\n nextState.text === this.state.text\n ) {\n return false;\n }\n\n return true;\n }\n\n setLeaveTimeout = () => {\n const { timeout } = this.props;\n\n this.timeout = window.setTimeout(() => {\n this.setState({ visible: false });\n }, timeout);\n };\n\n componentDidUpdate(previousProps: SnackbarProps) {\n const { action, text, timestamp } = this.props;\n\n if (!previousProps.text) {\n this.setState({ visible: true, action, text }, () => {\n this.setLeaveTimeout();\n });\n } else if (previousProps.timestamp !== timestamp) {\n window.clearTimeout(this.timeout);\n\n if (this.state.visible) {\n this.setState({ visible: false }, () => {\n this.transitionTimeout = window.setTimeout(() => {\n this.setState({ visible: true, action, text });\n this.setLeaveTimeout();\n }, CSS_TRANSITION_DURATION);\n });\n } else {\n this.setState({ visible: true, action, text });\n this.setLeaveTimeout();\n }\n }\n }\n\n render() {\n const { action, text, visible } = this.state;\n const { timeout } = this.props;\n\n return (\n <div className=\"snackbar\" aria-live=\"assertive\" role=\"alert\">\n <CSSTransition\n nodeRef={this.bodyRef}\n in={visible}\n classNames=\"snackbar__text-container\"\n timeout={{\n appear: 0,\n enter: timeout,\n exit: CSS_TRANSITION_DURATION,\n }}\n unmountOnExit\n >\n <Body ref={this.bodyRef} as=\"span\" className=\"snackbar__text\">\n {text}\n {action ? (\n <Button className=\"snackbar__text__action\" v2 size=\"sm\" onClick={action.onClick}>\n {action.label}\n </Button>\n ) : null}\n </Body>\n </CSSTransition>\n </div>\n );\n }\n}\n\nSnackbar.contextType = DirectionContext;\n\nexport default withNextPortal(Snackbar);\n"],"names":["CSS_TRANSITION_DURATION","Snackbar","Component","bodyRef","createRef","timeout","transitionTimeout","constructor","props","state","visible","text","componentWillUnmount","window","clearTimeout","shouldComponentUpdate","nextProps","nextState","timestamp","setLeaveTimeout","setTimeout","setState","componentDidUpdate","previousProps","action","render","_jsx","className","role","children","CSSTransition","nodeRef","in","classNames","appear","enter","exit","unmountOnExit","_jsxs","Body","ref","as","Button","v2","size","onClick","label","contextType","DirectionContext","withNextPortal"],"mappings":";;;;;;;;AASA,MAAMA,uBAAuB,GAAG,GAAG;AAkB7B,MAAOC,QAAS,SAAQC,SAAuC,CAAA;EACnEC,OAAO,gBAAGC,SAAS,EAAmB;AACtCC,EAAAA,OAAO,GAAG,CAAC;AACXC,EAAAA,iBAAiB,GAAG,CAAC;EAErBC,WAAAA,CAAYC,KAAoB,EAAA;IAC9B,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,KAAK,GAAG;AACXC,MAAAA,OAAO,EAAE,KAAK;AACdC,MAAAA,IAAI,EAAE;KACP;AACH;AAEAC,EAAAA,oBAAoBA,GAAA;AAClBC,IAAAA,MAAM,CAACC,YAAY,CAAC,IAAI,CAACT,OAAO,CAAC;AACjCQ,IAAAA,MAAM,CAACC,YAAY,CAAC,IAAI,CAACR,iBAAiB,CAAC;AAC7C;AAEAS,EAAAA,qBAAqBA,CAACC,SAAwB,EAAEC,SAAwB,EAAA;AACtE,IAAA,IAAI,CAACD,SAAS,CAACL,IAAI,EAAE;AACnB,MAAA,OAAO,KAAK;AACd;AACA,IAAA,IACEK,SAAS,CAACE,SAAS,KAAK,IAAI,CAACV,KAAK,CAACU,SAAS,IAC5CD,SAAS,CAACP,OAAO,KAAK,IAAI,CAACD,KAAK,CAACC,OAAO,IACxCO,SAAS,CAACN,IAAI,KAAK,IAAI,CAACF,KAAK,CAACE,IAAI,EAClC;AACA,MAAA,OAAO,KAAK;AACd;AAEA,IAAA,OAAO,IAAI;AAC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;"}
1
+ {"version":3,"file":"Snackbar.mjs","sources":["../../src/snackbar/Snackbar.tsx"],"sourcesContent":["import { Component, createRef } from 'react';\nimport { CSSTransition } from 'react-transition-group';\n\nimport Button from '../button';\nimport Body from '../body';\nimport { Theme, type ThemeDark, type ThemeLight } from '../common';\nimport { DirectionContext } from '../provider/direction';\nimport withNextPortal from '../withNextPortal/withNextPortal';\n\nconst CSS_TRANSITION_DURATION = 400;\n\nexport interface SnackbarProps {\n action?: {\n label: string;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n };\n text: React.ReactNode;\n /** @deprecated */\n theme?: ThemeLight | ThemeDark;\n timeout: number;\n timestamp: number;\n}\n\ninterface SnackbarState extends Pick<SnackbarProps, 'action' | 'text' | 'theme'> {\n visible: boolean;\n}\n\nexport class Snackbar extends Component<SnackbarProps, SnackbarState> {\n bodyRef = createRef<HTMLSpanElement>();\n timeout = 0;\n transitionTimeout = 0;\n\n constructor(props: SnackbarProps) {\n super(props);\n this.state = {\n visible: false,\n text: '',\n };\n }\n\n componentWillUnmount() {\n window.clearTimeout(this.timeout);\n window.clearTimeout(this.transitionTimeout);\n }\n\n shouldComponentUpdate(nextProps: SnackbarProps, nextState: SnackbarState) {\n if (!nextProps.text) {\n return false;\n }\n if (\n nextProps.timestamp === this.props.timestamp &&\n nextState.visible === this.state.visible &&\n nextState.text === this.state.text\n ) {\n return false;\n }\n\n return true;\n }\n\n setLeaveTimeout = () => {\n const { timeout } = this.props;\n\n this.timeout = window.setTimeout(() => {\n this.setState({ visible: false });\n }, timeout);\n };\n\n componentDidUpdate(previousProps: SnackbarProps) {\n const { action, text, timestamp } = this.props;\n\n if (!previousProps.text) {\n this.setState({ visible: true, action, text }, () => {\n this.setLeaveTimeout();\n });\n } else if (previousProps.timestamp !== timestamp) {\n window.clearTimeout(this.timeout);\n\n if (this.state.visible) {\n this.setState({ visible: false }, () => {\n this.transitionTimeout = window.setTimeout(() => {\n this.setState({ visible: true, action, text });\n this.setLeaveTimeout();\n }, CSS_TRANSITION_DURATION);\n });\n } else {\n this.setState({ visible: true, action, text });\n this.setLeaveTimeout();\n }\n }\n }\n\n render() {\n const { action, text, visible } = this.state;\n const { timeout } = this.props;\n\n return (\n <div className=\"snackbar\" aria-live=\"assertive\" role=\"alert\">\n <CSSTransition\n nodeRef={this.bodyRef}\n in={visible}\n classNames=\"snackbar__text-container\"\n timeout={{\n appear: 0,\n enter: timeout,\n exit: CSS_TRANSITION_DURATION,\n }}\n unmountOnExit\n >\n <Body ref={this.bodyRef} as=\"span\" className=\"snackbar__text\">\n {text}\n {action ? (\n <Button className=\"snackbar__text__action\" v2 size=\"sm\" onClick={action.onClick}>\n {action.label}\n </Button>\n ) : null}\n </Body>\n </CSSTransition>\n </div>\n );\n }\n}\n\nSnackbar.contextType = DirectionContext;\n\nexport default withNextPortal(Snackbar);\n"],"names":["CSS_TRANSITION_DURATION","Snackbar","Component","bodyRef","createRef","timeout","transitionTimeout","constructor","props","state","visible","text","componentWillUnmount","window","clearTimeout","shouldComponentUpdate","nextProps","nextState","timestamp","setLeaveTimeout","setTimeout","setState","componentDidUpdate","previousProps","action","render","_jsx","className","role","children","CSSTransition","nodeRef","in","classNames","appear","enter","exit","unmountOnExit","_jsxs","Body","ref","as","Button","v2","size","onClick","label","contextType","DirectionContext","withNextPortal"],"mappings":";;;;;;;;AASA,MAAMA,uBAAuB,GAAG,GAAG;AAkB7B,MAAOC,QAAS,SAAQC,SAAuC,CAAA;EACnEC,OAAO,gBAAGC,SAAS,EAAmB;AACtCC,EAAAA,OAAO,GAAG,CAAC;AACXC,EAAAA,iBAAiB,GAAG,CAAC;EAErBC,WAAAA,CAAYC,KAAoB,EAAA;IAC9B,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,KAAK,GAAG;AACXC,MAAAA,OAAO,EAAE,KAAK;AACdC,MAAAA,IAAI,EAAE;KACP;AACH,EAAA;AAEAC,EAAAA,oBAAoBA,GAAA;AAClBC,IAAAA,MAAM,CAACC,YA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C;SACN;QACFqC,aAAa,EAAA,IAAA;QAAAR,QAAA,eAEbS,IAAA,CAACC,IAAI,EAAA;UAACC,GAAG,EAAE,IAAI,CAACrC,OAAQ;AAACsC,UAAAA,EAAE,EAAC,MAAM;AAACd,UAAAA,SAAS,EAAC,gBAAgB;AAAAE,UAAAA,QAAA,GAC1DlB,IAAI,EACJa,MAAM,gBACLE,GAAA,CAACgB,MAAM,EAAA;AAACf,YAAAA,SAAS,EAAC,wBAAwB;YAACgB,EAAE,EAAA,IAAA;AAACC,YAAAA,IAAI,EAAC,IAAI;YAACC,OAAO,EAAErB,MAAM,CAACqB,OAAQ;YAAAhB,QAAA,EAC7EL,MAAM,CAACsB;WACF,CAAC,GACP,IAAI;SACJ;OACO;AACjB,KAAK,CAAC;AAEV,EAAA;AACD;AAED7C,QAAQ,CAAC8C,WAAW,GAAGC,gBAAgB;AAEvC,qBAAeC,qBAAc,CAAChD,QAAQ,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SnackbarContext.js","sources":["../../src/snackbar/SnackbarContext.ts"],"sourcesContent":["import { createContext } from 'react';\n\nimport { SnackbarProps } from './Snackbar';\n\nexport type SnackbarContextType = {\n createSnackbar: (props: Omit<SnackbarProps, 'timeout' | 'timestamp'>) => void;\n};\n\nexport const SnackbarContext = createContext<SnackbarContextType>({ createSnackbar: () => {} });\n\nexport const SnackbarConsumer = SnackbarContext.Consumer;\n"],"names":["SnackbarContext","createContext","createSnackbar","SnackbarConsumer","Consumer"],"mappings":";;;;AAQaA,MAAAA,eAAe,gBAAGC,mBAAa,CAAsB;EAAEC,cAAc,EAAEA,MAAK;AAAG,CAAE;AAEjFC,MAAAA,gBAAgB,GAAGH,eAAe,CAACI;;;;;"}
1
+ {"version":3,"file":"SnackbarContext.js","sources":["../../src/snackbar/SnackbarContext.ts"],"sourcesContent":["import { createContext } from 'react';\n\nimport { SnackbarProps } from './Snackbar';\n\nexport type SnackbarContextType = {\n createSnackbar: (props: Omit<SnackbarProps, 'timeout' | 'timestamp'>) => void;\n};\n\nexport const SnackbarContext = createContext<SnackbarContextType>({ createSnackbar: () => {} });\n\nexport const SnackbarConsumer = SnackbarContext.Consumer;\n"],"names":["SnackbarContext","createContext","createSnackbar","SnackbarConsumer","Consumer"],"mappings":";;;;AAQO,MAAMA,eAAe,gBAAGC,mBAAa,CAAsB;EAAEC,cAAc,EAAEA,MAAK,CAAE;AAAC,CAAE;AAEvF,MAAMC,gBAAgB,GAAGH,eAAe,CAACI;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SnackbarContext.mjs","sources":["../../src/snackbar/SnackbarContext.ts"],"sourcesContent":["import { createContext } from 'react';\n\nimport { SnackbarProps } from './Snackbar';\n\nexport type SnackbarContextType = {\n createSnackbar: (props: Omit<SnackbarProps, 'timeout' | 'timestamp'>) => void;\n};\n\nexport const SnackbarContext = createContext<SnackbarContextType>({ createSnackbar: () => {} });\n\nexport const SnackbarConsumer = SnackbarContext.Consumer;\n"],"names":["SnackbarContext","createContext","createSnackbar","SnackbarConsumer","Consumer"],"mappings":";;AAQaA,MAAAA,eAAe,gBAAGC,aAAa,CAAsB;EAAEC,cAAc,EAAEA,MAAK;AAAG,CAAE;AAEjFC,MAAAA,gBAAgB,GAAGH,eAAe,CAACI;;;;"}
1
+ {"version":3,"file":"SnackbarContext.mjs","sources":["../../src/snackbar/SnackbarContext.ts"],"sourcesContent":["import { createContext } from 'react';\n\nimport { SnackbarProps } from './Snackbar';\n\nexport type SnackbarContextType = {\n createSnackbar: (props: Omit<SnackbarProps, 'timeout' | 'timestamp'>) => void;\n};\n\nexport const SnackbarContext = createContext<SnackbarContextType>({ createSnackbar: () => {} });\n\nexport const SnackbarConsumer = SnackbarContext.Consumer;\n"],"names":["SnackbarContext","createContext","createSnackbar","SnackbarConsumer","Consumer"],"mappings":";;AAQO,MAAMA,eAAe,gBAAGC,aAAa,CAAsB;EAAEC,cAAc,EAAEA,MAAK,CAAE;AAAC,CAAE;AAEvF,MAAMC,gBAAgB,GAAGH,eAAe,CAACI;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SnackbarProvider.js","sources":["../../src/snackbar/SnackbarProvider.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\n\nimport SnackbarPortal, { SnackbarProps } from './Snackbar';\nimport { SnackbarContext } from './SnackbarContext';\n\nexport interface SnackbarProviderProps {\n timeout?: number;\n children?: React.ReactNode;\n}\n\nexport default function SnackbarProvider({ timeout = 4500, children }: SnackbarProviderProps) {\n const [state, setState] = useState<Omit<SnackbarProps, 'timeout'>>({\n text: '',\n timestamp: 0,\n });\n const { action, text, theme, timestamp } = state;\n\n return (\n <SnackbarContext.Provider\n value={useMemo(\n () => ({\n createSnackbar: ({ action, text, theme }) => {\n setState({ action, text, theme, timestamp: Date.now() });\n },\n }),\n [],\n )}\n >\n <SnackbarPortal\n action={action}\n text={text}\n timestamp={timestamp}\n timeout={timeout}\n theme={theme}\n />\n {children}\n </SnackbarContext.Provider>\n );\n}\n"],"names":["SnackbarProvider","timeout","children","state","setState","useState","text","timestamp","action","theme","_jsxs","SnackbarContext","Provider","value","useMemo","createSnackbar","Date","now","_jsx","SnackbarPortal"],"mappings":";;;;;;;;;AAUc,SAAUA,gBAAgBA,CAAC;AAAEC,EAAAA,OAAO,GAAG,IAAI;AAAEC,EAAAA;AAAiC,CAAA,EAAA;AAC1F,EAAA,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGC,cAAQ,CAAiC;AACjEC,IAAAA,IAAI,EAAE,EAAE;AACRC,IAAAA,SAAS,EAAE;AACZ,GAAA,CAAC;EACF,MAAM;IAAEC,MAAM;IAAEF,IAAI;IAAEG,KAAK;AAAEF,IAAAA;AAAS,GAAE,GAAGJ,KAAK;AAEhD,EAAA,oBACEO,eAAA,CAACC,+BAAe,CAACC,QAAQ,EAAA;IACvBC,KAAK,EAAEC,aAAO,CACZ,OAAO;AACLC,MAAAA,cAAc,EAAEA,CAAC;QAAEP,MAAM;QAAEF,IAAI;AAAEG,QAAAA;AAAO,OAAA,KAAI;AAC1CL,QAAAA,QAAQ,CAAC;UAAEI,MAAM;UAAEF,IAAI;UAAEG,KAAK;AAAEF,UAAAA,SAAS,EAAES,IAAI,CAACC,GAAG;AAAE,SAAE,CAAC;AAC1D;KACD,CAAC,EACF,EAAE,CACF;IAAAf,QAAA,EAAA,cAEFgB,cAAA,CAACC,gBAAc,EAAA;AACbX,MAAAA,MAAM,EAAEA,MAAO;AACfF,MAAAA,IAAI,EAAEA,IAAK;AACXC,MAAAA,SAAS,EAAEA,SAAU;AACrBN,MAAAA,OAAO,EAAEA,OAAQ;AACjBQ,MAAAA,KAAK,EAAEA;KAET,CAAA,EAACP,QAAQ;AAAA,GACe,CAAC;AAE/B;;;;"}
1
+ {"version":3,"file":"SnackbarProvider.js","sources":["../../src/snackbar/SnackbarProvider.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\n\nimport SnackbarPortal, { SnackbarProps } from './Snackbar';\nimport { SnackbarContext } from './SnackbarContext';\n\nexport interface SnackbarProviderProps {\n timeout?: number;\n children?: React.ReactNode;\n}\n\nexport default function SnackbarProvider({ timeout = 4500, children }: SnackbarProviderProps) {\n const [state, setState] = useState<Omit<SnackbarProps, 'timeout'>>({\n text: '',\n timestamp: 0,\n });\n const { action, text, theme, timestamp } = state;\n\n return (\n <SnackbarContext.Provider\n value={useMemo(\n () => ({\n createSnackbar: ({ action, text, theme }) => {\n setState({ action, text, theme, timestamp: Date.now() });\n },\n }),\n [],\n )}\n >\n <SnackbarPortal\n action={action}\n text={text}\n timestamp={timestamp}\n timeout={timeout}\n theme={theme}\n />\n {children}\n </SnackbarContext.Provider>\n );\n}\n"],"names":["SnackbarProvider","timeout","children","state","setState","useState","text","timestamp","action","theme","_jsxs","SnackbarContext","Provider","value","useMemo","createSnackbar","Date","now","_jsx","SnackbarPortal"],"mappings":";;;;;;;;;AAUc,SAAUA,gBAAgBA,CAAC;AAAEC,EAAAA,OAAO,GAAG,IAAI;AAAEC,EAAAA;AAAQ,CAAyB,EAAA;AAC1F,EAAA,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGC,cAAQ,CAAiC;AACjEC,IAAAA,IAAI,EAAE,EAAE;AACRC,IAAAA,SAAS,EAAE;AACZ,GAAA,CAAC;EACF,MAAM;IAAEC,MAAM;IAAEF,IAAI;IAAEG,KAAK;AAAEF,IAAAA;AAAS,GAAE,GAAGJ,KAAK;AAEhD,EAAA,oBACEO,eAAA,CAACC,+BAAe,CAACC,QAAQ,EAAA;IACvBC,KAAK,EAAEC,aAAO,CACZ,OAAO;AACLC,MAAAA,cAAc,EAAEA,CAAC;QAAEP,MAAM;QAAEF,IAAI;AAAEG,QAAAA;AAAK,OAAE,KAAI;AAC1CL,QAAAA,QAAQ,CAAC;UAAEI,MAAM;UAAEF,IAAI;UAAEG,KAAK;AAAEF,UAAAA,SAAS,EAAES,IAAI,CAACC,GAAG;AAAE,SAAE,CAAC;AAC1D,MAAA;KACD,CAAC,EACF,EAAE,CACF;IAAAf,QAAA,EAAA,cAEFgB,cAAA,CAACC,gBAAc,EAAA;AACbX,MAAAA,MAAM,EAAEA,MAAO;AACfF,MAAAA,IAAI,EAAEA,IAAK;AACXC,MAAAA,SAAS,EAAEA,SAAU;AACrBN,MAAAA,OAAO,EAAEA,OAAQ;AACjBQ,MAAAA,KAAK,EAAEA;KAAM,CAEf,EAACP,QAAQ;AAAA,GACe,CAAC;AAE/B;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SnackbarProvider.mjs","sources":["../../src/snackbar/SnackbarProvider.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\n\nimport SnackbarPortal, { SnackbarProps } from './Snackbar';\nimport { SnackbarContext } from './SnackbarContext';\n\nexport interface SnackbarProviderProps {\n timeout?: number;\n children?: React.ReactNode;\n}\n\nexport default function SnackbarProvider({ timeout = 4500, children }: SnackbarProviderProps) {\n const [state, setState] = useState<Omit<SnackbarProps, 'timeout'>>({\n text: '',\n timestamp: 0,\n });\n const { action, text, theme, timestamp } = state;\n\n return (\n <SnackbarContext.Provider\n value={useMemo(\n () => ({\n createSnackbar: ({ action, text, theme }) => {\n setState({ action, text, theme, timestamp: Date.now() });\n },\n }),\n [],\n )}\n >\n <SnackbarPortal\n action={action}\n text={text}\n timestamp={timestamp}\n timeout={timeout}\n theme={theme}\n />\n {children}\n </SnackbarContext.Provider>\n );\n}\n"],"names":["SnackbarProvider","timeout","children","state","setState","useState","text","timestamp","action","theme","_jsxs","SnackbarContext","Provider","value","useMemo","createSnackbar","Date","now","_jsx","SnackbarPortal"],"mappings":";;;;;AAUc,SAAUA,gBAAgBA,CAAC;AAAEC,EAAAA,OAAO,GAAG,IAAI;AAAEC,EAAAA;AAAiC,CAAA,EAAA;AAC1F,EAAA,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGC,QAAQ,CAAiC;AACjEC,IAAAA,IAAI,EAAE,EAAE;AACRC,IAAAA,SAAS,EAAE;AACZ,GAAA,CAAC;EACF,MAAM;IAAEC,MAAM;IAAEF,IAAI;IAAEG,KAAK;AAAEF,IAAAA;AAAS,GAAE,GAAGJ,KAAK;AAEhD,EAAA,oBACEO,IAAA,CAACC,eAAe,CAACC,QAAQ,EAAA;IACvBC,KAAK,EAAEC,OAAO,CACZ,OAAO;AACLC,MAAAA,cAAc,EAAEA,CAAC;QAAEP,MAAM;QAAEF,IAAI;AAAEG,QAAAA;AAAO,OAAA,KAAI;AAC1CL,QAAAA,QAAQ,CAAC;UAAEI,MAAM;UAAEF,IAAI;UAAEG,KAAK;AAAEF,UAAAA,SAAS,EAAES,IAAI,CAACC,GAAG;AAAE,SAAE,CAAC;AAC1D;KACD,CAAC,EACF,EAAE,CACF;IAAAf,QAAA,EAAA,cAEFgB,GAAA,CAACC,cAAc,EAAA;AACbX,MAAAA,MAAM,EAAEA,MAAO;AACfF,MAAAA,IAAI,EAAEA,IAAK;AACXC,MAAAA,SAAS,EAAEA,SAAU;AACrBN,MAAAA,OAAO,EAAEA,OAAQ;AACjBQ,MAAAA,KAAK,EAAEA;KAET,CAAA,EAACP,QAAQ;AAAA,GACe,CAAC;AAE/B;;;;"}
1
+ {"version":3,"file":"SnackbarProvider.mjs","sources":["../../src/snackbar/SnackbarProvider.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\n\nimport SnackbarPortal, { SnackbarProps } from './Snackbar';\nimport { SnackbarContext } from './SnackbarContext';\n\nexport interface SnackbarProviderProps {\n timeout?: number;\n children?: React.ReactNode;\n}\n\nexport default function SnackbarProvider({ timeout = 4500, children }: SnackbarProviderProps) {\n const [state, setState] = useState<Omit<SnackbarProps, 'timeout'>>({\n text: '',\n timestamp: 0,\n });\n const { action, text, theme, timestamp } = state;\n\n return (\n <SnackbarContext.Provider\n value={useMemo(\n () => ({\n createSnackbar: ({ action, text, theme }) => {\n setState({ action, text, theme, timestamp: Date.now() });\n },\n }),\n [],\n )}\n >\n <SnackbarPortal\n action={action}\n text={text}\n timestamp={timestamp}\n timeout={timeout}\n theme={theme}\n />\n {children}\n </SnackbarContext.Provider>\n );\n}\n"],"names":["SnackbarProvider","timeout","children","state","setState","useState","text","timestamp","action","theme","_jsxs","SnackbarContext","Provider","value","useMemo","createSnackbar","Date","now","_jsx","SnackbarPortal"],"mappings":";;;;;AAUc,SAAUA,gBAAgBA,CAAC;AAAEC,EAAAA,OAAO,GAAG,IAAI;AAAEC,EAAAA;AAAQ,CAAyB,EAAA;AAC1F,EAAA,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGC,QAAQ,CAAiC;AACjEC,IAAAA,IAAI,EAAE,EAAE;AACRC,IAAAA,SAAS,EAAE;AACZ,GAAA,CAAC;EACF,MAAM;IAAEC,MAAM;IAAEF,IAAI;IAAEG,KAAK;AAAEF,IAAAA;AAAS,GAAE,GAAGJ,KAAK;AAEhD,EAAA,oBACEO,IAAA,CAACC,eAAe,CAACC,QAAQ,EAAA;IACvBC,KAAK,EAAEC,OAAO,CACZ,OAAO;AACLC,MAAAA,cAAc,EAAEA,CAAC;QAAEP,MAAM;QAAEF,IAAI;AAAEG,QAAAA;AAAK,OAAE,KAAI;AAC1CL,QAAAA,QAAQ,CAAC;UAAEI,MAAM;UAAEF,IAAI;UAAEG,KAAK;AAAEF,UAAAA,SAAS,EAAES,IAAI,CAACC,GAAG;AAAE,SAAE,CAAC;AAC1D,MAAA;KACD,CAAC,EACF,EAAE,CACF;IAAAf,QAAA,EAAA,cAEFgB,GAAA,CAACC,cAAc,EAAA;AACbX,MAAAA,MAAM,EAAEA,MAAO;AACfF,MAAAA,IAAI,EAAEA,IAAK;AACXC,MAAAA,SAAS,EAAEA,SAAU;AACrBN,MAAAA,OAAO,EAAEA,OAAQ;AACjBQ,MAAAA,KAAK,EAAEA;KAAM,CAEf,EAACP,QAAQ;AAAA,GACe,CAAC;AAE/B;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useSnackbar.js","sources":["../../src/snackbar/useSnackbar.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport { SnackbarContext } from './SnackbarContext';\n\nfunction useSnackbar() {\n const { createSnackbar } = useContext(SnackbarContext);\n\n return createSnackbar;\n}\n\nexport default useSnackbar;\n"],"names":["useSnackbar","createSnackbar","useContext","SnackbarContext"],"mappings":";;;;;;;AAIA,SAASA,WAAWA,GAAA;EAClB,MAAM;AAAEC,IAAAA;AAAgB,GAAA,GAAGC,gBAAU,CAACC,+BAAe,CAAC;AAEtD,EAAA,OAAOF,cAAc;AACvB;;;;"}
1
+ {"version":3,"file":"useSnackbar.js","sources":["../../src/snackbar/useSnackbar.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport { SnackbarContext } from './SnackbarContext';\n\nfunction useSnackbar() {\n const { createSnackbar } = useContext(SnackbarContext);\n\n return createSnackbar;\n}\n\nexport default useSnackbar;\n"],"names":["useSnackbar","createSnackbar","useContext","SnackbarContext"],"mappings":";;;;;;;AAIA,SAASA,WAAWA,GAAA;EAClB,MAAM;AAAEC,IAAAA;AAAc,GAAE,GAAGC,gBAAU,CAACC,+BAAe,CAAC;AAEtD,EAAA,OAAOF,cAAc;AACvB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useSnackbar.mjs","sources":["../../src/snackbar/useSnackbar.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport { SnackbarContext } from './SnackbarContext';\n\nfunction useSnackbar() {\n const { createSnackbar } = useContext(SnackbarContext);\n\n return createSnackbar;\n}\n\nexport default useSnackbar;\n"],"names":["useSnackbar","createSnackbar","useContext","SnackbarContext"],"mappings":";;;AAIA,SAASA,WAAWA,GAAA;EAClB,MAAM;AAAEC,IAAAA;AAAgB,GAAA,GAAGC,UAAU,CAACC,eAAe,CAAC;AAEtD,EAAA,OAAOF,cAAc;AACvB;;;;"}
1
+ {"version":3,"file":"useSnackbar.mjs","sources":["../../src/snackbar/useSnackbar.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport { SnackbarContext } from './SnackbarContext';\n\nfunction useSnackbar() {\n const { createSnackbar } = useContext(SnackbarContext);\n\n return createSnackbar;\n}\n\nexport default useSnackbar;\n"],"names":["useSnackbar","createSnackbar","useContext","SnackbarContext"],"mappings":";;;AAIA,SAASA,WAAWA,GAAA;EAClB,MAAM;AAAEC,IAAAA;AAAc,GAAE,GAAGC,UAAU,CAACC,eAAe,CAAC;AAEtD,EAAA,OAAOF,cAAc;AACvB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"StatusIcon.js","sources":["../../src/statusIcon/StatusIcon.tsx"],"sourcesContent":["import { Info, Alert, Cross, Check, ClockBorderless } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { SizeSmall, SizeMedium, SizeLarge, Sentiment, Size, Breakpoint, Status } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\nimport messages from './StatusIcon.messages';\n\n/**\n * @deprecated use `16 | 24 | 32 | 40 | 48 | 56 | 72` component instead\n */\ntype LegacySizes = SizeSmall | SizeMedium | SizeLarge;\n\nexport type StatusIconSentiment = Sentiment | Status.PENDING;\n\nexport type StatusIconProps = {\n sentiment?: `${StatusIconSentiment}`;\n size?: LegacySizes | 16 | 24 | 32 | 40 | 48 | 56 | 72;\n /**\n * Override for the sentiment's-derived, default, accessible\n * name announced by the screen readers. <br />\n * Using `null` will render the icon purely presentational.\n * */\n iconLabel?: string | null;\n};\n\nconst mapLegacySize = {\n [String(Size.SMALL)]: 16,\n [String(Size.MEDIUM)]: 40,\n [String(Size.LARGE)]: 48,\n} satisfies Record<string, CircleProps['size']>;\n\nconst StatusIcon = ({ sentiment = 'neutral', size: sizeProp = 40, iconLabel }: StatusIconProps) => {\n const intl = useIntl();\n\n const iconMetaBySentiment: Record<\n `${Sentiment}` | Status.PENDING,\n {\n Icon: React.ElementType;\n defaultIconLabel: string;\n }\n > = {\n [Sentiment.NEGATIVE]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.POSITIVE]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n [Sentiment.WARNING]: {\n Icon: Alert,\n defaultIconLabel: intl.formatMessage(messages.warningLabel),\n },\n [Status.PENDING]: {\n Icon: ClockBorderless,\n defaultIconLabel: intl.formatMessage(messages.pendingLabel),\n },\n [Sentiment.NEUTRAL]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n // deprecated\n [Sentiment.ERROR]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.INFO]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n [Sentiment.SUCCESS]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n };\n const { Icon, defaultIconLabel } = iconMetaBySentiment[sentiment];\n\n const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n const size = mapLegacySize[sizeProp] ?? sizeProp;\n return (\n <Circle\n as=\"span\"\n size={isTinyViewport && size < 40 ? 32 : size}\n data-testid=\"status-icon\"\n className={clsx('status-circle', sentiment)}\n >\n <Icon\n className={clsx('status-icon', iconColor)}\n title={iconLabel === null ? undefined : iconLabel || defaultIconLabel}\n />\n </Circle>\n );\n};\n\nexport default StatusIcon;\n"],"names":["mapLegacySize","String","Size","SMALL","MEDIUM","LARGE","StatusIcon","sentiment","size","sizeProp","iconLabel","intl","useIntl","iconMetaBySentiment","Sentiment","NEGATIVE","Icon","Cross","defaultIconLabel","formatMessage","messages","errorLabel","POSITIVE","Check","successLabel","WARNING","Alert","warningLabel","Status","PENDING","ClockBorderless","pendingLabel","NEUTRAL","Info","informationLabel","ERROR","INFO","SUCCESS","iconColor","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","Circle","as","className","clsx","children","title","undefined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAMA,aAAa,GAAG;AACpB,EAAA,CAACC,MAAM,CAACC,SAAI,CAACC,KAAK,CAAC,GAAG,EAAE;AACxB,EAAA,CAACF,MAAM,CAACC,SAAI,CAACE,MAAM,CAAC,GAAG,EAAE;AACzB,EAAA,CAACH,MAAM,CAACC,SAAI,CAACG,KAAK,CAAC,GAAG;CACuB;AAEzCC,MAAAA,UAAU,GAAGA,CAAC;AAAEC,aAAAA,WAAS,GAAG,SAAS;EAAEC,IAAI,EAAEC,QAAQ,GAAG,EAAE;AAAEC,EAAAA;AAAS,CAAmB,KAAI;AAChG,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE;AAEtB,EAAA,MAAMC,mBAAmB,GAMrB;IACF,CAACC,mBAAS,CAACC,QAAQ,GAAG;AACpBC,MAAAA,IAAI,EAAEC,WAAK;AACXC,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,2BAAQ,CAACC,UAAU;K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SAAS,IAAIA,WAAS,KAAK,SAAS,GAAG,MAAM,GAAG,OAAO;EACvF,MAAMgC,cAAc,GAAGC,iBAAQ,CAAC,eAAeC,qBAAU,CAACC,QAAQ,CAAA,GAAA,CAAK,CAAC;AACxE,EAAA,MAAMlC,IAAI,GAAGR,aAAa,CAACS,QAAQ,CAAC,IAAIA,QAAQ;EAChD,oBACEkC,cAAA,CAACC,cAAM,EAAA;AACLC,IAAAA,EAAE,EAAC,MAAM;IACTrC,IAAI,EAAE+B,cAAc,IAAI/B,IAAI,GAAG,EAAE,GAAG,EAAE,GAAGA,IAAK;AAC9C,IAAA,aAAA,EAAY,aAAa;AACzBsC,IAAAA,SAAS,EAAEC,SAAI,CAAC,eAAe,EAAExC,WAAS,CAAE;IAAAyC,QAAA,eAE5CL,cAAA,CAAC3B,IAAI,EAAA;AACH8B,MAAAA,SAAS,EAAEC,SAAI,CAAC,aAAa,EAAET,SAAS,CAAE;MAC1CW,KAAK,EAAEvC,SAAS,KAAK,IAAI,GAAGwC,SAAS,GAAGxC,SAAS,IAAIQ;KAEzD;AAAA,GAAQ,CAAC;AAEb;;;;"}
1
+ {"version":3,"file":"StatusIcon.js","sources":["../../src/statusIcon/StatusIcon.tsx"],"sourcesContent":["import { Info, Alert, Cross, Check, ClockBorderless } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { SizeSmall, SizeMedium, SizeLarge, Sentiment, Size, Breakpoint, Status } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\nimport messages from './StatusIcon.messages';\n\n/**\n * @deprecated use `16 | 24 | 32 | 40 | 48 | 56 | 72` component instead\n */\ntype LegacySizes = SizeSmall | SizeMedium | SizeLarge;\n\nexport type StatusIconSentiment = Sentiment | Status.PENDING;\n\nexport type StatusIconProps = {\n sentiment?: `${StatusIconSentiment}`;\n size?: LegacySizes | 16 | 24 | 32 | 40 | 48 | 56 | 72;\n /**\n * Override for the sentiment's-derived, default, accessible\n * name announced by the screen readers. <br />\n * Using `null` will render the icon purely presentational.\n * */\n iconLabel?: string | null;\n};\n\nconst mapLegacySize = {\n [String(Size.SMALL)]: 16,\n [String(Size.MEDIUM)]: 40,\n [String(Size.LARGE)]: 48,\n} satisfies Record<string, CircleProps['size']>;\n\nconst StatusIcon = ({ sentiment = 'neutral', size: sizeProp = 40, iconLabel }: StatusIconProps) => {\n const intl = useIntl();\n\n const iconMetaBySentiment: Record<\n `${Sentiment}` | Status.PENDING,\n {\n Icon: React.ElementType;\n defaultIconLabel: string;\n }\n > = {\n [Sentiment.NEGATIVE]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.POSITIVE]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n [Sentiment.WARNING]: {\n Icon: Alert,\n defaultIconLabel: intl.formatMessage(messages.warningLabel),\n },\n [Status.PENDING]: {\n Icon: ClockBorderless,\n defaultIconLabel: intl.formatMessage(messages.pendingLabel),\n },\n [Sentiment.NEUTRAL]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n // deprecated\n [Sentiment.ERROR]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.INFO]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n [Sentiment.SUCCESS]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n };\n const { Icon, defaultIconLabel } = iconMetaBySentiment[sentiment];\n\n const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n const size = mapLegacySize[sizeProp] ?? sizeProp;\n return (\n <Circle\n as=\"span\"\n size={isTinyViewport && size < 40 ? 32 : size}\n data-testid=\"status-icon\"\n className={clsx('status-circle', sentiment)}\n >\n <Icon\n className={clsx('status-icon', iconColor)}\n title={iconLabel === null ? undefined : iconLabel || defaultIconLabel}\n />\n </Circle>\n );\n};\n\nexport default StatusIcon;\n"],"names":["mapLegacySize","String","Size","SMALL","MEDIUM","LARGE","StatusIcon","sentiment","size","sizeProp","iconLabel","intl","useIntl","iconMetaBySentiment","Sentiment","NEGATIVE","Icon","Cross","defaultIconLabel","formatMessage","messages","errorLabel","POSITIVE","Check","successLabel","WARNING","Alert","warningLabel","Status","PENDING","ClockBorderless","pendingLabel","NEUTRAL","Info","informationLabel","ERROR","INFO","SUCCESS","iconColor","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","Circle","as","className","clsx","children","title","undefined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAMA,aAAa,GAAG;AACpB,EAAA,CAACC,MAAM,CAACC,SAAI,CAACC,KAAK,CAAC,GAAG,EAAE;AACxB,EAAA,CAACF,MAAM,CAACC,SAAI,CAACE,MAAM,CAAC,GAAG,EAAE;AACzB,EAAA,CAACH,MAAM,CAACC,SAAI,CAACG,KAAK,CAAC,GAAG;CACuB;AAE/C,MAAMC,UAAU,GAAGA,CAAC;AAAEC,aAAAA,WAAS,GAAG,SAAS;EAAEC,IAAI,EAAEC,QAAQ,GAAG,EAAE;AAAEC,EAAAA;AAAS,CAAmB,KAAI;AAChG,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE;AAEtB,EAAA,MAAMC,mBAAmB,GAMrB;IACF,CAACC,mBAAS,CAACC,QAAQ,GAAG;AACpBC,MAAAA,IAAI,EAAEC,WAAK;AACXC,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,2BAAQ,CAACC,UAAU;KACzD;IACD,CAACP,mBAAS,CAACQ,QAAQ,GAAG;AACpBN,MAAAA,IAAI,EAAEO,WAAK;AACXL,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,2BAAQ,CAACI,YAAY;KAC3D;IACD,CAACV,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IAAI,GAAGR,aAAa,CAACS,QAAQ,CAAC,IAAIA,QAAQ;EAChD,oBACEkC,cAAA,CAACC,cAAM,EAAA;AACLC,IAAAA,EAAE,EAAC,MAAM;IACTrC,IAAI,EAAE+B,cAAc,IAAI/B,IAAI,GAAG,EAAE,GAAG,EAAE,GAAGA,IAAK;AAC9C,IAAA,aAAA,EAAY,aAAa;AACzBsC,IAAAA,SAAS,EAAEC,SAAI,CAAC,eAAe,EAAExC,WAAS,CAAE;IAAAyC,QAAA,eAE5CL,cAAA,CAAC3B,IAAI,EAAA;AACH8B,MAAAA,SAAS,EAAEC,SAAI,CAAC,aAAa,EAAET,SAAS,CAAE;MAC1CW,KAAK,EAAEvC,SAAS,KAAK,IAAI,GAAGwC,SAAS,GAAGxC,SAAS,IAAIQ;KAAiB;AAE1E,GAAQ,CAAC;AAEb;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"StatusIcon.mjs","sources":["../../src/statusIcon/StatusIcon.tsx"],"sourcesContent":["import { Info, Alert, Cross, Check, ClockBorderless } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { SizeSmall, SizeMedium, SizeLarge, Sentiment, Size, Breakpoint, Status } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\nimport messages from './StatusIcon.messages';\n\n/**\n * @deprecated use `16 | 24 | 32 | 40 | 48 | 56 | 72` component instead\n */\ntype LegacySizes = SizeSmall | SizeMedium | SizeLarge;\n\nexport type StatusIconSentiment = Sentiment | Status.PENDING;\n\nexport type StatusIconProps = {\n sentiment?: `${StatusIconSentiment}`;\n size?: LegacySizes | 16 | 24 | 32 | 40 | 48 | 56 | 72;\n /**\n * Override for the sentiment's-derived, default, accessible\n * name announced by the screen readers. <br />\n * Using `null` will render the icon purely presentational.\n * */\n iconLabel?: string | null;\n};\n\nconst mapLegacySize = {\n [String(Size.SMALL)]: 16,\n [String(Size.MEDIUM)]: 40,\n [String(Size.LARGE)]: 48,\n} satisfies Record<string, CircleProps['size']>;\n\nconst StatusIcon = ({ sentiment = 'neutral', size: sizeProp = 40, iconLabel }: StatusIconProps) => {\n const intl = useIntl();\n\n const iconMetaBySentiment: Record<\n `${Sentiment}` | Status.PENDING,\n {\n Icon: React.ElementType;\n defaultIconLabel: string;\n }\n > = {\n [Sentiment.NEGATIVE]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.POSITIVE]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n [Sentiment.WARNING]: {\n Icon: Alert,\n defaultIconLabel: intl.formatMessage(messages.warningLabel),\n },\n [Status.PENDING]: {\n Icon: ClockBorderless,\n defaultIconLabel: intl.formatMessage(messages.pendingLabel),\n },\n [Sentiment.NEUTRAL]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n // deprecated\n [Sentiment.ERROR]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.INFO]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n [Sentiment.SUCCESS]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n };\n const { Icon, defaultIconLabel } = iconMetaBySentiment[sentiment];\n\n const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n const size = mapLegacySize[sizeProp] ?? sizeProp;\n return (\n <Circle\n as=\"span\"\n size={isTinyViewport && size < 40 ? 32 : size}\n data-testid=\"status-icon\"\n className={clsx('status-circle', sentiment)}\n >\n <Icon\n className={clsx('status-icon', iconColor)}\n title={iconLabel === null ? undefined : iconLabel || defaultIconLabel}\n />\n </Circle>\n );\n};\n\nexport default StatusIcon;\n"],"names":["mapLegacySize","String","Size","SMALL","MEDIUM","LARGE","StatusIcon","sentiment","size","sizeProp","iconLabel","intl","useIntl","iconMetaBySentiment","Sentiment","NEGATIVE","Icon","Cross","defaultIconLabel","formatMessage","messages","errorLabel","POSITIVE","Check","successLabel","WARNING","Alert","warningLabel","Status","PENDING","ClockBorderless","pendingLabel","NEUTRAL","Info","informationLabel","ERROR","INFO","SUCCESS","iconColor","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","Circle","as","className","clsx","children","title","undefined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAMA,aAAa,GAAG;AACpB,EAAA,CAACC,MAAM,CAACC,IAAI,CAACC,KAAK,CAAC,GAAG,EAAE;AACxB,EAAA,CAACF,MAAM,CAACC,IAAI,CAACE,MAAM,CAAC,GAAG,EAAE;AACzB,EAAA,CAACH,MAAM,CAACC,IAAI,CAACG,KAAK,CAAC,GAAG;CACuB;AAEzCC,MAAAA,UAAU,GAAGA,CAAC;AAAEC,EAAAA,SAAS,GAAG,SAAS;EAAEC,IAAI,EAAEC,QAAQ,GAAG,EAAE;AAAEC,EAAAA;AAAS,CAAmB,KAAI;AAChG,EAAA,MAAMC,IAAI,GAAGC,OAAO,EAAE;AAEtB,EAAA,MAAMC,mBAAmB,GAMrB;IACF,CAACC,SAAS,CAACC,QAAQ,GAAG;AACpBC,MAAAA,IAAI,EAAEC,KAAK;AACXC,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,QAAQ,CAACC,UAAU;KACzD;IACD,CAACP,SAAS,CAACQ,QAAQ,GAAG;AACpBN,MAAAA,IAAI,EAAEO,KAAK;AACXL,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,QAAQ,CAACI,YAAY;KAC3D;IACD,CAACV,SAAS,CAACW,OAAO,GAAG;AACnBT,MAAAA,IAAI,EAAEU,KAAK;AACXR,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,QAAQ,CAACO,YAAY;KAC3D;IACD,CAACC,MAAM,CAACC,O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AG,EAAE,GAAGA,IAAK;AAC9C,IAAA,aAAA,EAAY,aAAa;AACzBsC,IAAAA,SAAS,EAAEC,IAAI,CAAC,eAAe,EAAExC,SAAS,CAAE;IAAAyC,QAAA,eAE5CL,GAAA,CAAC3B,IAAI,EAAA;AACH8B,MAAAA,SAAS,EAAEC,IAAI,CAAC,aAAa,EAAET,SAAS,CAAE;MAC1CW,KAAK,EAAEvC,SAAS,KAAK,IAAI,GAAGwC,SAAS,GAAGxC,SAAS,IAAIQ;KAEzD;AAAA,GAAQ,CAAC;AAEb;;;;"}
1
+ {"version":3,"file":"StatusIcon.mjs","sources":["../../src/statusIcon/StatusIcon.tsx"],"sourcesContent":["import { Info, Alert, Cross, Check, ClockBorderless } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { SizeSmall, SizeMedium, SizeLarge, Sentiment, Size, Breakpoint, Status } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\nimport messages from './StatusIcon.messages';\n\n/**\n * @deprecated use `16 | 24 | 32 | 40 | 48 | 56 | 72` component instead\n */\ntype LegacySizes = SizeSmall | SizeMedium | SizeLarge;\n\nexport type StatusIconSentiment = Sentiment | Status.PENDING;\n\nexport type StatusIconProps = {\n sentiment?: `${StatusIconSentiment}`;\n size?: LegacySizes | 16 | 24 | 32 | 40 | 48 | 56 | 72;\n /**\n * Override for the sentiment's-derived, default, accessible\n * name announced by the screen readers. <br />\n * Using `null` will render the icon purely presentational.\n * */\n iconLabel?: string | null;\n};\n\nconst mapLegacySize = {\n [String(Size.SMALL)]: 16,\n [String(Size.MEDIUM)]: 40,\n [String(Size.LARGE)]: 48,\n} satisfies Record<string, CircleProps['size']>;\n\nconst StatusIcon = ({ sentiment = 'neutral', size: sizeProp = 40, iconLabel }: StatusIconProps) => {\n const intl = useIntl();\n\n const iconMetaBySentiment: Record<\n `${Sentiment}` | Status.PENDING,\n {\n Icon: React.ElementType;\n defaultIconLabel: string;\n }\n > = {\n [Sentiment.NEGATIVE]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.POSITIVE]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n [Sentiment.WARNING]: {\n Icon: Alert,\n defaultIconLabel: intl.formatMessage(messages.warningLabel),\n },\n [Status.PENDING]: {\n Icon: ClockBorderless,\n defaultIconLabel: intl.formatMessage(messages.pendingLabel),\n },\n [Sentiment.NEUTRAL]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n // deprecated\n [Sentiment.ERROR]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.INFO]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n [Sentiment.SUCCESS]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n };\n const { Icon, defaultIconLabel } = iconMetaBySentiment[sentiment];\n\n const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n const size = mapLegacySize[sizeProp] ?? sizeProp;\n return (\n <Circle\n as=\"span\"\n size={isTinyViewport && size < 40 ? 32 : size}\n data-testid=\"status-icon\"\n className={clsx('status-circle', sentiment)}\n >\n <Icon\n className={clsx('status-icon', iconColor)}\n title={iconLabel === null ? undefined : iconLabel || defaultIconLabel}\n />\n </Circle>\n );\n};\n\nexport default StatusIcon;\n"],"names":["mapLegacySize","String","Size","SMALL","MEDIUM","LARGE","StatusIcon","sentiment","size","sizeProp","iconLabel","intl","useIntl","iconMetaBySentiment","Sentiment","NEGATIVE","Icon","Cross","defaultIconLabel","formatMessage","messages","errorLabel","POSITIVE","Check","successLabel","WARNING","Alert","warningLabel","Status","PENDING","ClockBorderless","pendingLabel","NEUTRAL","Info","informationLabel","ERROR","INFO","SUCCESS","iconColor","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","Circle","as","className","clsx","children","title","undefined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAMA,aAAa,GAAG;AACpB,EAAA,CAACC,MAAM,CAACC,IAAI,CAACC,KAAK,CAAC,GAAG,EAAE;AACxB,EAAA,CAACF,MAAM,CAACC,IAAI,CAACE,MAAM,CAAC,GAAG,EAAE;AACzB,EAAA,CAACH,MAAM,CAACC,IAAI,CAACG,KAAK,CAAC,GAAG;CACuB;AAE/C,MAAMC,UAAU,GAAGA,CAAC;AAAEC,EAAAA,SAAS,GAAG,SAAS;EAAEC,IAAI,EAAEC,QAAQ,GAAG,EAAE;AAAEC,EAAAA;AAAS,CAAmB,KAAI;AAChG,EAAA,MAAMC,IAAI,GAAGC,OAAO,EAAE;AAEtB,EAAA,MAAMC,mBAAmB,GAMrB;IACF,CAACC,SAAS,CAACC,QAAQ,GAAG;AACpBC,MAAAA,IAAI,EAAEC,KAAK;AACXC,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,QAAQ,CAACC,UAAU;KACzD;IACD,CAACP,SAAS,CAACQ,QAAQ,GAAG;AACpBN,MAAAA,IAAI,EAAEO,KAAK;AACXL,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,QAAQ,CAACI,YAAY;KAC3D;IACD,CAACV,SAAS,CAACW,OAAO,GAAG;AACnBT,MAAAA,IAAI,EAAEU,KAAK;AACXR,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,QAAQ,CAACO,YAAY;KAC3D;IACD,CAACC,MAAM,CAACC,OAAO,GAAG;AAChBb,MAAAA,IAAI,EAAEc,eAAe;AACrBZ,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,QAAQ,CAACW,YAAY;KAC3D;IACD,CAACjB,SAAS,CAACkB,OAAO,GAAG;AACnBhB,MAAAA,IAAI,EAAEiB,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C,IAAI,CAAC,aAAa,EAAET,SAAS,CAAE;MAC1CW,KAAK,EAAEvC,SAAS,KAAK,IAAI,GAAGwC,SAAS,GAAGxC,SAAS,IAAIQ;KAAiB;AAE1E,GAAQ,CAAC;AAEb;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Stepper.js","sources":["../../src/stepper/Stepper.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport * as React from 'react';\n\nimport { Position } from '../common';\nimport { useDirection } from '../common/hooks';\nimport Tooltip from '../tooltip';\n\nimport { isTouchDevice } from './deviceDetection';\n\nfunction clamp(from: number, to: number, value: number) {\n return Math.max(Math.min(to, value), from);\n}\n\nexport interface Step {\n label: React.ReactNode;\n onClick?: () => void;\n hoverLabel?: React.ReactNode;\n}\n\nexport interface StepperProps {\n steps: readonly Step[];\n activeStep?: number;\n className?: string;\n testId?: string;\n}\n\n/**\n * This component is considered user-unfriendly and inaccessible on its own and will likely be made internal in the future. Please use `FlowNavigation` instead.\n * @see https://storybook.wise.design/?path=/story/navigation-flownavigation--variants\n */\nconst Stepper = ({ steps, activeStep = 0, className, testId }: StepperProps) => {\n const { isRTL } = useDirection();\n\n if (steps.length === 0) {\n return null;\n }\n\n const activeStepIndex = clamp(0, steps.length - 1, activeStep);\n const stepPercentage = 1 / (steps.length - 1);\n const percentageCompleted = activeStepIndex / (steps.length - 1);\n\n const getProgressWidth = (): string => {\n if (percentageCompleted === 0) {\n return '0%';\n }\n /**\n * Progress bar starts with left/right (depends on rtl) shift `--progress-bar-start-shift` for hiding Progress bar's left and right borders\n * which are used for progress vertical delimiter.\n * When progress is completed, we need to add `--progress-bar-border-width` to the width to allow the right border be outside of the progress area.\n */\n return `calc(${percentageCompleted * 100}% + var(--progress-bar-start-shift) + var(--progress-bar-border-width))`;\n };\n\n const renderStep = (step: Step, index: number) => {\n const active = index === activeStepIndex;\n const clickable = step.onClick && !active;\n\n const labelButton = clickable ? (\n <button\n type=\"button\"\n className=\"btn-unstyled tw-stepper__step-label\"\n onClick={() => clickable && step.onClick?.()}\n >\n <small>{step.label}</small>\n </button>\n ) : (\n <span className=\"tw-stepper__step-label\">{step.label}</span>\n );\n\n return (\n <li\n key={index}\n className={clsx(\n 'hidden-xs',\n 'tw-stepper__step',\n active ? 'np-text-body-default-bold tw-stepper__step--active' : 'np-text-body-default',\n clickable && 'tw-stepper__step--clickable',\n step.hoverLabel && 'tw-stepper__step--has-tooltip',\n )}\n aria-current={active ? 'step' : false}\n style={\n isRTL\n ? { right: `${index * stepPercentage * 100}%` }\n : { left: `${index * stepPercentage * 100}%` }\n }\n >\n {step.hoverLabel && !isTouchDevice() ? (\n <Tooltip position={Position.BOTTOM} label={step.hoverLabel}>\n {labelButton}\n </Tooltip>\n ) : (\n labelButton\n )}\n </li>\n );\n };\n\n return (\n <div className={clsx('tw-stepper', className)} data-testid={testId}>\n <div className=\"progress\">\n <div\n className=\"progress-bar\"\n style={{ width: getProgressWidth() }}\n data-testid=\"progress-bar\"\n />\n </div>\n <ol className=\"tw-stepper-steps p-t-1 m-b-0\">{steps.map(renderStep)}</ol>\n </div>\n );\n};\n\nexport default Stepper;\n"],"names":["clamp","from","to","value","Math","max","min","Stepper","steps","activeStep","className","testId","isRTL","useDirection","length","activeStepIndex","stepPercentage","percentageCompleted","getProgressWidth","renderStep","step","index","active","clickable","onClick","labelButton","_jsx","type","children","label","clsx","hoverLabel","style","right","left","isTouchDevice","Tooltip","position","Position","BOTTOM","_jsxs","width","map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,SAASA,KAAKA,CAACC,IAAY,EAAEC,EAAU,EAAEC,KAAa,EAAA;AACpD,EAAA,OAAOC,IAAI,CAACC,GAAG,CAACD,IAAI,CAACE,GAAG,CAACJ,EAAE,EAAEC,KAAK,CAAC,EAAEF,IAAI,CAAC;AAC5C;AAeA;;;AAGG;AACGM,MAAAA,OAAO,GAAGA,CAAC;EAAEC,KAAK;AAAEC,EAAAA,UAAU,GAAG,CAAC;EAA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A,IAAA,EAAA;AAAIhB,MAAAA,SAAS,EAAC,8BAA8B;AAAAkB,MAAAA,QAAA,EAAEpB,KAAK,CAACkC,GAAG,CAACvB,UAAU;AAAC,KAAK,CAC1E;AAAA,GAAK,CAAC;AAEV;;;;"}
1
+ {"version":3,"file":"Stepper.js","sources":["../../src/stepper/Stepper.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport * as React from 'react';\n\nimport { Position } from '../common';\nimport { useDirection } from '../common/hooks';\nimport Tooltip from '../tooltip';\n\nimport { isTouchDevice } from './deviceDetection';\n\nfunction clamp(from: number, to: number, value: number) {\n return Math.max(Math.min(to, value), from);\n}\n\nexport interface Step {\n label: React.ReactNode;\n onClick?: () => void;\n hoverLabel?: React.ReactNode;\n}\n\nexport interface StepperProps {\n steps: readonly Step[];\n activeStep?: number;\n className?: string;\n testId?: string;\n}\n\n/**\n * This component is considered user-unfriendly and inaccessible on its own and will likely be made internal in the future. Please use `FlowNavigation` instead.\n * @see https://storybook.wise.design/?path=/story/navigation-flownavigation--variants\n */\nconst Stepper = ({ steps, activeStep = 0, className, testId }: StepperProps) => {\n const { isRTL } = useDirection();\n\n if (steps.length === 0) {\n return null;\n }\n\n const activeStepIndex = clamp(0, steps.length - 1, activeStep);\n const stepPercentage = 1 / (steps.length - 1);\n const percentageCompleted = activeStepIndex / (steps.length - 1);\n\n const getProgressWidth = (): string => {\n if (percentageCompleted === 0) {\n return '0%';\n }\n /**\n * Progress bar starts with left/right (depends on rtl) shift `--progress-bar-start-shift` for hiding Progress bar's left and right borders\n * which are used for progress vertical delimiter.\n * When progress is completed, we need to add `--progress-bar-border-width` to the width to allow the right border be outside of the progress area.\n */\n return `calc(${percentageCompleted * 100}% + var(--progress-bar-start-shift) + var(--progress-bar-border-width))`;\n };\n\n const renderStep = (step: Step, index: number) => {\n const active = index === activeStepIndex;\n const clickable = step.onClick && !active;\n\n const labelButton = clickable ? (\n <button\n type=\"button\"\n className=\"btn-unstyled tw-stepper__step-label\"\n onClick={() => clickable && step.onClick?.()}\n >\n <small>{step.label}</small>\n </button>\n ) : (\n <span className=\"tw-stepper__step-label\">{step.label}</span>\n );\n\n return (\n <li\n key={index}\n className={clsx(\n 'hidden-xs',\n 'tw-stepper__step',\n active ? 'np-text-body-default-bold tw-stepper__step--active' : 'np-text-body-default',\n clickable && 'tw-stepper__step--clickable',\n step.hoverLabel && 'tw-stepper__step--has-tooltip',\n )}\n aria-current={active ? 'step' : false}\n style={\n isRTL\n ? { right: `${index * stepPercentage * 100}%` }\n : { left: `${index * stepPercentage * 100}%` }\n }\n >\n {step.hoverLabel && !isTouchDevice() ? (\n <Tooltip position={Position.BOTTOM} label={step.hoverLabel}>\n {labelButton}\n </Tooltip>\n ) : (\n labelButton\n )}\n </li>\n );\n };\n\n return (\n <div className={clsx('tw-stepper', className)} data-testid={testId}>\n <div className=\"progress\">\n <div\n className=\"progress-bar\"\n style={{ width: getProgressWidth() }}\n data-testid=\"progress-bar\"\n />\n </div>\n <ol className=\"tw-stepper-steps p-t-1 m-b-0\">{steps.map(renderStep)}</ol>\n </div>\n );\n};\n\nexport default Stepper;\n"],"names":["clamp","from","to","value","Math","max","min","Stepper","steps","activeStep","className","testId","isRTL","useDirection","length","activeStepIndex","stepPercentage","percentageCompleted","getProgressWidth","renderStep","step","index","active","clickable","onClick","labelButton","_jsx","type","children","label","clsx","hoverLabel","style","right","left","isTouchDevice","Tooltip","position","Position","BOTTOM","_jsxs","width","map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,SAASA,KAAKA,CAACC,IAAY,EAAEC,EAAU,EAAEC,KAAa,EAAA;AACpD,EAAA,OAAOC,IAAI,CAACC,GAAG,CAACD,IAAI,CAACE,GAAG,CAACJ,EAAE,EAAEC,KAAK,CAAC,EAAEF,IAAI,CAAC;AAC5C;AAeA;;;AAGG;AACH,MAAMM,OAAO,GAAGA,CAAC;EAAEC,KAAK;AAAEC,EAAAA,UAAU,GAAG,CAAC;EAAEC,SAAS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,cAAA,CAAA,IAAA,EAAA;AAAIhB,MAAAA,SAAS,EAAC,8BAA8B;AAAAkB,MAAAA,QAAA,EAAEpB,KAAK,CAACkC,GAAG,CAACvB,UAAU;AAAC,KAAK,CAC1E;AAAA,GAAK,CAAC;AAEV;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Stepper.mjs","sources":["../../src/stepper/Stepper.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport * as React from 'react';\n\nimport { Position } from '../common';\nimport { useDirection } from '../common/hooks';\nimport Tooltip from '../tooltip';\n\nimport { isTouchDevice } from './deviceDetection';\n\nfunction clamp(from: number, to: number, value: number) {\n return Math.max(Math.min(to, value), from);\n}\n\nexport interface Step {\n label: React.ReactNode;\n onClick?: () => void;\n hoverLabel?: React.ReactNode;\n}\n\nexport interface StepperProps {\n steps: readonly Step[];\n activeStep?: number;\n className?: string;\n testId?: string;\n}\n\n/**\n * This component is considered user-unfriendly and inaccessible on its own and will likely be made internal in the future. Please use `FlowNavigation` instead.\n * @see https://storybook.wise.design/?path=/story/navigation-flownavigation--variants\n */\nconst Stepper = ({ steps, activeStep = 0, className, testId }: StepperProps) => {\n const { isRTL } = useDirection();\n\n if (steps.length === 0) {\n return null;\n }\n\n const activeStepIndex = clamp(0, steps.length - 1, activeStep);\n const stepPercentage = 1 / (steps.length - 1);\n const percentageCompleted = activeStepIndex / (steps.length - 1);\n\n const getProgressWidth = (): string => {\n if (percentageCompleted === 0) {\n return '0%';\n }\n /**\n * Progress bar starts with left/right (depends on rtl) shift `--progress-bar-start-shift` for hiding Progress bar's left and right borders\n * which are used for progress vertical delimiter.\n * When progress is completed, we need to add `--progress-bar-border-width` to the width to allow the right border be outside of the progress area.\n */\n return `calc(${percentageCompleted * 100}% + var(--progress-bar-start-shift) + var(--progress-bar-border-width))`;\n };\n\n const renderStep = (step: Step, index: number) => {\n const active = index === activeStepIndex;\n const clickable = step.onClick && !active;\n\n const labelButton = clickable ? (\n <button\n type=\"button\"\n className=\"btn-unstyled tw-stepper__step-label\"\n onClick={() => clickable && step.onClick?.()}\n >\n <small>{step.label}</small>\n </button>\n ) : (\n <span className=\"tw-stepper__step-label\">{step.label}</span>\n );\n\n return (\n <li\n key={index}\n className={clsx(\n 'hidden-xs',\n 'tw-stepper__step',\n active ? 'np-text-body-default-bold tw-stepper__step--active' : 'np-text-body-default',\n clickable && 'tw-stepper__step--clickable',\n step.hoverLabel && 'tw-stepper__step--has-tooltip',\n )}\n aria-current={active ? 'step' : false}\n style={\n isRTL\n ? { right: `${index * stepPercentage * 100}%` }\n : { left: `${index * stepPercentage * 100}%` }\n }\n >\n {step.hoverLabel && !isTouchDevice() ? (\n <Tooltip position={Position.BOTTOM} label={step.hoverLabel}>\n {labelButton}\n </Tooltip>\n ) : (\n labelButton\n )}\n </li>\n );\n };\n\n return (\n <div className={clsx('tw-stepper', className)} data-testid={testId}>\n <div className=\"progress\">\n <div\n className=\"progress-bar\"\n style={{ width: getProgressWidth() }}\n data-testid=\"progress-bar\"\n />\n </div>\n <ol className=\"tw-stepper-steps p-t-1 m-b-0\">{steps.map(renderStep)}</ol>\n </div>\n );\n};\n\nexport default Stepper;\n"],"names":["clamp","from","to","value","Math","max","min","Stepper","steps","activeStep","className","testId","isRTL","useDirection","length","activeStepIndex","stepPercentage","percentageCompleted","getProgressWidth","renderStep","step","index","active","clickable","onClick","labelButton","_jsx","type","children","label","clsx","hoverLabel","style","right","left","isTouchDevice","Tooltip","position","Position","BOTTOM","_jsxs","width","map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,SAASA,KAAKA,CAACC,IAAY,EAAEC,EAAU,EAAEC,KAAa,EAAA;AACpD,EAAA,OAAOC,IAAI,CAACC,GAAG,CAACD,IAAI,CAACE,GAAG,CAACJ,EAAE,EAAEC,KAAK,CAAC,EAAEF,IAAI,CAAC;AAC5C;AAeA;;;AAGG;AACGM,MAAAA,OAAO,GAAGA,CAAC;EAAEC,KAAK;AAAEC,EAAAA,UAAU,G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,GAAA,CAAA,IAAA,EAAA;AAAIhB,MAAAA,SAAS,EAAC,8BAA8B;AAAAkB,MAAAA,QAAA,EAAEpB,KAAK,CAACkC,GAAG,CAACvB,UAAU;AAAC,KAAK,CAC1E;AAAA,GAAK,CAAC;AAEV;;;;"}
1
+ {"version":3,"file":"Stepper.mjs","sources":["../../src/stepper/Stepper.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport * as React from 'react';\n\nimport { Position } from '../common';\nimport { useDirection } from '../common/hooks';\nimport Tooltip from '../tooltip';\n\nimport { isTouchDevice } from './deviceDetection';\n\nfunction clamp(from: number, to: number, value: number) {\n return Math.max(Math.min(to, value), from);\n}\n\nexport interface Step {\n label: React.ReactNode;\n onClick?: () => void;\n hoverLabel?: React.ReactNode;\n}\n\nexport interface StepperProps {\n steps: readonly Step[];\n activeStep?: number;\n className?: string;\n testId?: string;\n}\n\n/**\n * This component is considered user-unfriendly and inaccessible on its own and will likely be made internal in the future. Please use `FlowNavigation` instead.\n * @see https://storybook.wise.design/?path=/story/navigation-flownavigation--variants\n */\nconst Stepper = ({ steps, activeStep = 0, className, testId }: StepperProps) => {\n const { isRTL } = useDirection();\n\n if (steps.length === 0) {\n return null;\n }\n\n const activeStepIndex = clamp(0, steps.length - 1, activeStep);\n const stepPercentage = 1 / (steps.length - 1);\n const percentageCompleted = activeStepIndex / (steps.length - 1);\n\n const getProgressWidth = (): string => {\n if (percentageCompleted === 0) {\n return '0%';\n }\n /**\n * Progress bar starts with left/right (depends on rtl) shift `--progress-bar-start-shift` for hiding Progress bar's left and right borders\n * which are used for progress vertical delimiter.\n * When progress is completed, we need to add `--progress-bar-border-width` to the width to allow the right border be outside of the progress area.\n */\n return `calc(${percentageCompleted * 100}% + var(--progress-bar-start-shift) + var(--progress-bar-border-width))`;\n };\n\n const renderStep = (step: Step, index: number) => {\n const active = index === activeStepIndex;\n const clickable = step.onClick && !active;\n\n const labelButton = clickable ? (\n <button\n type=\"button\"\n className=\"btn-unstyled tw-stepper__step-label\"\n onClick={() => clickable && step.onClick?.()}\n >\n <small>{step.label}</small>\n </button>\n ) : (\n <span className=\"tw-stepper__step-label\">{step.label}</span>\n );\n\n return (\n <li\n key={index}\n className={clsx(\n 'hidden-xs',\n 'tw-stepper__step',\n active ? 'np-text-body-default-bold tw-stepper__step--active' : 'np-text-body-default',\n clickable && 'tw-stepper__step--clickable',\n step.hoverLabel && 'tw-stepper__step--has-tooltip',\n )}\n aria-current={active ? 'step' : false}\n style={\n isRTL\n ? { right: `${index * stepPercentage * 100}%` }\n : { left: `${index * stepPercentage * 100}%` }\n }\n >\n {step.hoverLabel && !isTouchDevice() ? (\n <Tooltip position={Position.BOTTOM} label={step.hoverLabel}>\n {labelButton}\n </Tooltip>\n ) : (\n labelButton\n )}\n </li>\n );\n };\n\n return (\n <div className={clsx('tw-stepper', className)} data-testid={testId}>\n <div className=\"progress\">\n <div\n className=\"progress-bar\"\n style={{ width: getProgressWidth() }}\n data-testid=\"progress-bar\"\n />\n </div>\n <ol className=\"tw-stepper-steps p-t-1 m-b-0\">{steps.map(renderStep)}</ol>\n </div>\n );\n};\n\nexport default Stepper;\n"],"names":["clamp","from","to","value","Math","max","min","Stepper","steps","activeStep","className","testId","isRTL","useDirection","length","activeStepIndex","stepPercentage","percentageCompleted","getProgressWidth","renderStep","step","index","active","clickable","onClick","labelButton","_jsx","type","children","label","clsx","hoverLabel","style","right","left","isTouchDevice","Tooltip","position","Position","BOTTOM","_jsxs","width","map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,SAASA,KAAKA,CAACC,IAAY,EAAEC,EAAU,EAAEC,KAAa,EAAA;AACpD,EAAA,OAAOC,IAAI,CAACC,GAAG,CAACD,IAAI,CAACE,GAAG,CAACJ,EAAE,EAAEC,KAAK,CAAC,EAAEF,IAAI,CAAC;AAC5C;AAeA;;;AAGG;AACH,MAAMM,OAAO,GAAGA,CAAC;EAAEC,KAAK;AAAEC,EAAAA,UAAU,GAAG,CAAC;EAA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AAQ,GAAA,CAAA,IAAA,EAAA;AAAIhB,MAAAA,SAAS,EAAC,8BAA8B;AAAAkB,MAAAA,QAAA,EAAEpB,KAAK,CAACkC,GAAG,CAACvB,UAAU;AAAC,KAAK,CAC1E;AAAA,GAAK,CAAC;AAEV;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"deviceDetection.js","sources":["../../src/stepper/deviceDetection.ts"],"sourcesContent":["function supportsTouchEvents() {\n const onTouchStartIsDefined = typeof window !== 'undefined' && window.ontouchstart !== undefined;\n const maxTouchPointsIsDefined = typeof navigator !== 'undefined' && navigator.maxTouchPoints;\n\n return !!(onTouchStartIsDefined || maxTouchPointsIsDefined);\n}\n\nfunction userAgentSuggestsTouchDevice() {\n const sampleTouchDevices = [\n 'android',\n 'iemobile',\n 'iphone',\n 'ipad',\n 'ipod',\n 'blackberry',\n 'bada',\n ];\n const matchString = sampleTouchDevices.map((device) => `(${device})`).join('|');\n const regex = new RegExp(matchString, 'gi');\n return typeof navigator !== 'undefined' && !!regex.test(navigator.userAgent);\n}\n// Important: this is not fool-proof! It gives false positives and negatives, and will be outdated.\n// Only use this for small vanity changes where it still works either way.\nexport function isTouchDevice() {\n return supportsTouchEvents() || userAgentSuggestsTouchDevice();\n}\n"],"names":["supportsTouchEvents","onTouchStartIsDefined","window","ontouchstart","undefined","maxTouchPointsIsDefined","navigator","maxTouchPoints","userAgentSuggestsTouchDevice","sampleTouchDevices","matchString","map","device","join","regex","RegExp","test","userAgent","isTouchDevice"],"mappings":";;AAAA,SAASA,mBAAmBA,GAAA;EAC1B,MAAMC,qBAAqB,GAAG,OAAOC,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACC,YAAY,KAAKC,SAAS;EAChG,MAAMC,uBAAuB,GAAG,OAAOC,SAAS,KAAK,WAAW,IAAIA,SAAS,CAACC,cAAc;AAE5F,EAAA,OAAO,CAAC,EAAEN,qBAAqB,IAAII,uBAAuB,CAAC;AAC7D;AAEA,SAASG,4BAA4BA,GAAA;AACnC,EAAA,MAAMC,kBAAkB,GAAG,CACzB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,MAAM,EACN,YAAY,EACZ,MAAM,CACP;AACD,EAAA,MAAMC,WAAW,GAAGD,kBAAkB,CAACE,GAAG,CAAEC,MAAM,IAAK,CAAIA,CAAAA,EAAAA,MAAM,GAAG,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;EAC/E,MAAMC,KAAK,GAAG,IAAIC,MAAM,CAACL,WAAW,EAAE,IAAI,CAAC;AAC3C,EAAA,OAAO,OAAOJ,SAAS,KAAK,WAAW,IAAI,CAAC,CAACQ,KAAK,CAACE,IAAI,CAACV,SAAS,CAACW,SAAS,CAAC;AAC9E;AACA;AACA;SACgBC,aAAaA,GAAA;AAC3B,EAAA,OAAOlB,mBAAmB,EAAE,IAAIQ,4BAA4B,EAAE;AAChE;;;;"}
1
+ {"version":3,"file":"deviceDetection.js","sources":["../../src/stepper/deviceDetection.ts"],"sourcesContent":["function supportsTouchEvents() {\n const onTouchStartIsDefined = typeof window !== 'undefined' && window.ontouchstart !== undefined;\n const maxTouchPointsIsDefined = typeof navigator !== 'undefined' && navigator.maxTouchPoints;\n\n return !!(onTouchStartIsDefined || maxTouchPointsIsDefined);\n}\n\nfunction userAgentSuggestsTouchDevice() {\n const sampleTouchDevices = [\n 'android',\n 'iemobile',\n 'iphone',\n 'ipad',\n 'ipod',\n 'blackberry',\n 'bada',\n ];\n const matchString = sampleTouchDevices.map((device) => `(${device})`).join('|');\n const regex = new RegExp(matchString, 'gi');\n return typeof navigator !== 'undefined' && !!regex.test(navigator.userAgent);\n}\n// Important: this is not fool-proof! It gives false positives and negatives, and will be outdated.\n// Only use this for small vanity changes where it still works either way.\nexport function isTouchDevice() {\n return supportsTouchEvents() || userAgentSuggestsTouchDevice();\n}\n"],"names":["supportsTouchEvents","onTouchStartIsDefined","window","ontouchstart","undefined","maxTouchPointsIsDefined","navigator","maxTouchPoints","userAgentSuggestsTouchDevice","sampleTouchDevices","matchString","map","device","join","regex","RegExp","test","userAgent","isTouchDevice"],"mappings":";;AAAA,SAASA,mBAAmBA,GAAA;EAC1B,MAAMC,qBAAqB,GAAG,OAAOC,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACC,YAAY,KAAKC,SAAS;EAChG,MAAMC,uBAAuB,GAAG,OAAOC,SAAS,KAAK,WAAW,IAAIA,SAAS,CAACC,cAAc;AAE5F,EAAA,OAAO,CAAC,EAAEN,qBAAqB,IAAII,uBAAuB,CAAC;AAC7D;AAEA,SAASG,4BAA4BA,GAAA;AACnC,EAAA,MAAMC,kBAAkB,GAAG,CACzB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,MAAM,EACN,YAAY,EACZ,MAAM,CACP;AACD,EAAA,MAAMC,WAAW,GAAGD,kBAAkB,CAACE,GAAG,CAAEC,MAAM,IAAK,CAAA,CAAA,EAAIA,MAAM,GAAG,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;EAC/E,MAAMC,KAAK,GAAG,IAAIC,MAAM,CAACL,WAAW,EAAE,IAAI,CAAC;AAC3C,EAAA,OAAO,OAAOJ,SAAS,KAAK,WAAW,IAAI,CAAC,CAACQ,KAAK,CAACE,IAAI,CAACV,SAAS,CAACW,SAAS,CAAC;AAC9E;AACA;AACA;SACgBC,aAAaA,GAAA;AAC3B,EAAA,OAAOlB,mBAAmB,EAAE,IAAIQ,4BAA4B,EAAE;AAChE;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"deviceDetection.mjs","sources":["../../src/stepper/deviceDetection.ts"],"sourcesContent":["function supportsTouchEvents() {\n const onTouchStartIsDefined = typeof window !== 'undefined' && window.ontouchstart !== undefined;\n const maxTouchPointsIsDefined = typeof navigator !== 'undefined' && navigator.maxTouchPoints;\n\n return !!(onTouchStartIsDefined || maxTouchPointsIsDefined);\n}\n\nfunction userAgentSuggestsTouchDevice() {\n const sampleTouchDevices = [\n 'android',\n 'iemobile',\n 'iphone',\n 'ipad',\n 'ipod',\n 'blackberry',\n 'bada',\n ];\n const matchString = sampleTouchDevices.map((device) => `(${device})`).join('|');\n const regex = new RegExp(matchString, 'gi');\n return typeof navigator !== 'undefined' && !!regex.test(navigator.userAgent);\n}\n// Important: this is not fool-proof! It gives false positives and negatives, and will be outdated.\n// Only use this for small vanity changes where it still works either way.\nexport function isTouchDevice() {\n return supportsTouchEvents() || userAgentSuggestsTouchDevice();\n}\n"],"names":["supportsTouchEvents","onTouchStartIsDefined","window","ontouchstart","undefined","maxTouchPointsIsDefined","navigator","maxTouchPoints","userAgentSuggestsTouchDevice","sampleTouchDevices","matchString","map","device","join","regex","RegExp","test","userAgent","isTouchDevice"],"mappings":"AAAA,SAASA,mBAAmBA,GAAA;EAC1B,MAAMC,qBAAqB,GAAG,OAAOC,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACC,YAAY,KAAKC,SAAS;EAChG,MAAMC,uBAAuB,GAAG,OAAOC,SAAS,KAAK,WAAW,IAAIA,SAAS,CAACC,cAAc;AAE5F,EAAA,OAAO,CAAC,EAAEN,qBAAqB,IAAII,uBAAuB,CAAC;AAC7D;AAEA,SAASG,4BAA4BA,GAAA;AACnC,EAAA,MAAMC,kBAAkB,GAAG,CACzB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,MAAM,EACN,YAAY,EACZ,MAAM,CACP;AACD,EAAA,MAAMC,WAAW,GAAGD,kBAAkB,CAACE,GAAG,CAAEC,MAAM,IAAK,CAAIA,CAAAA,EAAAA,MAAM,GAAG,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;EAC/E,MAAMC,KAAK,GAAG,IAAIC,MAAM,CAACL,WAAW,EAAE,IAAI,CAAC;AAC3C,EAAA,OAAO,OAAOJ,SAAS,KAAK,WAAW,IAAI,CAAC,CAACQ,KAAK,CAACE,IAAI,CAACV,SAAS,CAACW,SAAS,CAAC;AAC9E;AACA;AACA;SACgBC,aAAaA,GAAA;AAC3B,EAAA,OAAOlB,mBAAmB,EAAE,IAAIQ,4BAA4B,EAAE;AAChE;;;;"}
1
+ {"version":3,"file":"deviceDetection.mjs","sources":["../../src/stepper/deviceDetection.ts"],"sourcesContent":["function supportsTouchEvents() {\n const onTouchStartIsDefined = typeof window !== 'undefined' && window.ontouchstart !== undefined;\n const maxTouchPointsIsDefined = typeof navigator !== 'undefined' && navigator.maxTouchPoints;\n\n return !!(onTouchStartIsDefined || maxTouchPointsIsDefined);\n}\n\nfunction userAgentSuggestsTouchDevice() {\n const sampleTouchDevices = [\n 'android',\n 'iemobile',\n 'iphone',\n 'ipad',\n 'ipod',\n 'blackberry',\n 'bada',\n ];\n const matchString = sampleTouchDevices.map((device) => `(${device})`).join('|');\n const regex = new RegExp(matchString, 'gi');\n return typeof navigator !== 'undefined' && !!regex.test(navigator.userAgent);\n}\n// Important: this is not fool-proof! It gives false positives and negatives, and will be outdated.\n// Only use this for small vanity changes where it still works either way.\nexport function isTouchDevice() {\n return supportsTouchEvents() || userAgentSuggestsTouchDevice();\n}\n"],"names":["supportsTouchEvents","onTouchStartIsDefined","window","ontouchstart","undefined","maxTouchPointsIsDefined","navigator","maxTouchPoints","userAgentSuggestsTouchDevice","sampleTouchDevices","matchString","map","device","join","regex","RegExp","test","userAgent","isTouchDevice"],"mappings":"AAAA,SAASA,mBAAmBA,GAAA;EAC1B,MAAMC,qBAAqB,GAAG,OAAOC,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACC,YAAY,KAAKC,SAAS;EAChG,MAAMC,uBAAuB,GAAG,OAAOC,SAAS,KAAK,WAAW,IAAIA,SAAS,CAACC,cAAc;AAE5F,EAAA,OAAO,CAAC,EAAEN,qBAAqB,IAAII,uBAAuB,CAAC;AAC7D;AAEA,SAASG,4BAA4BA,GAAA;AACnC,EAAA,MAAMC,kBAAkB,GAAG,CACzB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,MAAM,EACN,YAAY,EACZ,MAAM,CACP;AACD,EAAA,MAAMC,WAAW,GAAGD,kBAAkB,CAACE,GAAG,CAAEC,MAAM,IAAK,CAAA,CAAA,EAAIA,MAAM,GAAG,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;EAC/E,MAAMC,KAAK,GAAG,IAAIC,MAAM,CAACL,WAAW,EAAE,IAAI,CAAC;AAC3C,EAAA,OAAO,OAAOJ,SAAS,KAAK,WAAW,IAAI,CAAC,CAACQ,KAAK,CAACE,IAAI,CAACV,SAAS,CAACW,SAAS,CAAC;AAC9E;AACA;AACA;SACgBC,aAAaA,GAAA;AAC3B,EAAA,OAAOlB,mBAAmB,EAAE,IAAIQ,4BAA4B,EAAE;AAChE;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Sticky.js","sources":["../../src/sticky/Sticky.tsx"],"sourcesContent":["import { Position } from '../common';\nimport SlidingPanel from '../slidingPanel';\nimport { FunctionComponent } from 'react';\n\nexport interface StickyProps {\n /** Optional prop for children components to be rendered inside the Sticky component. */\n children?: React.ReactNode;\n\n /** Optional props that determines if the Sticky component is open or closed. Default value is `true`. */\n open?: boolean;\n\n /** Optional props that specifies the position of the Sticky component on the screen. Can be either `top` or `bottom`. */\n position?: `${Position.TOP}` | `${Position.BOTTOM}`;\n\n /** Optional prop to specify the ID used for testing */\n testId?: string;\n}\n\n/**\n * ### Sticky Component\n *\n * `<Sticky />` is a component that renders a `<SlidingPanel />` with specified props.\n * It uses the `<SlidingPanel />` component to create a panel that can slide in and out of view,\n * based on the `open` prop. It can be positioned at the top or bottom of the container,\n * as specified by the `position` prop.\n *\n * @component\n * @param {ReactNode} children - Children content.\n * @param {boolean} open - Determines if the Sticky component is open or closed.\n * @param {('top'|'bottom')} position - Specifies the position.\n * @param {string} testId - ID used for testing.\n * @returns {React.JSX.Element} The `SlidingPanel` component with applied props.\n * @example\n * <Button onClick={() => setOpen(!open)}>Open Sticky</Button>\n * <Sticky open={open} position={'bottom'}>\n * <div>\n * <Button onClick={() => setOpen(!open)}>Close Sticky</Button>\n * </div>\n * </Sticky>\n */\nconst Sticky: FunctionComponent<StickyProps> = ({\n children,\n open = true,\n position = Position.BOTTOM,\n testId,\n}: StickyProps) => {\n return (\n <SlidingPanel\n testId={testId}\n open={open}\n position={position}\n slidingPanelPositionFixed\n showSlidingPanelBorder\n >\n {children}\n </SlidingPanel>\n );\n};\n\nexport default Sticky;\n"],"names":["Sticky","children","open","position","Position","BOTTOM","testId","_jsx","SlidingPanel","slidingPanelPositionFixed","showSlidingPanelBorder"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCMA,MAAAA,MAAM,GAAmCA,CAAC;EAC9CC,QAAQ;AACRC,EAAAA,IAAI,GAAG,IAAI;YACXC,UAAQ,GAAGC,iBAAQ,CAACC,MAAM;AAC1BC,EAAAA;AAAM,CACM,KAAI;EAChB,oBACEC,cAAA,CAACC,oBAAY,EAAA;AACXF,IAAAA,MAAM,EAAEA,MAAO;AACfJ,IAAAA,IAAI,EAAEA,IAAK;AACXC,IAAAA,QAAQ,EAAEA,UAAS;IACnBM,yBAAyB,EAAA,IAAA;IACzBC,sBAAsB,EAAA,IAAA;AAAAT,IAAAA,QAAA,EAErBA;AAAQ,GACG,CAAC;AAEnB;;;;"}
1
+ {"version":3,"file":"Sticky.js","sources":["../../src/sticky/Sticky.tsx"],"sourcesContent":["import { Position } from '../common';\nimport SlidingPanel from '../slidingPanel';\nimport { FunctionComponent } from 'react';\n\nexport interface StickyProps {\n /** Optional prop for children components to be rendered inside the Sticky component. */\n children?: React.ReactNode;\n\n /** Optional props that determines if the Sticky component is open or closed. Default value is `true`. */\n open?: boolean;\n\n /** Optional props that specifies the position of the Sticky component on the screen. Can be either `top` or `bottom`. */\n position?: `${Position.TOP}` | `${Position.BOTTOM}`;\n\n /** Optional prop to specify the ID used for testing */\n testId?: string;\n}\n\n/**\n * ### Sticky Component\n *\n * `<Sticky />` is a component that renders a `<SlidingPanel />` with specified props.\n * It uses the `<SlidingPanel />` component to create a panel that can slide in and out of view,\n * based on the `open` prop. It can be positioned at the top or bottom of the container,\n * as specified by the `position` prop.\n *\n * @component\n * @param {ReactNode} children - Children content.\n * @param {boolean} open - Determines if the Sticky component is open or closed.\n * @param {('top'|'bottom')} position - Specifies the position.\n * @param {string} testId - ID used for testing.\n * @returns {React.JSX.Element} The `SlidingPanel` component with applied props.\n * @example\n * <Button onClick={() => setOpen(!open)}>Open Sticky</Button>\n * <Sticky open={open} position={'bottom'}>\n * <div>\n * <Button onClick={() => setOpen(!open)}>Close Sticky</Button>\n * </div>\n * </Sticky>\n */\nconst Sticky: FunctionComponent<StickyProps> = ({\n children,\n open = true,\n position = Position.BOTTOM,\n testId,\n}: StickyProps) => {\n return (\n <SlidingPanel\n testId={testId}\n open={open}\n position={position}\n slidingPanelPositionFixed\n showSlidingPanelBorder\n >\n {children}\n </SlidingPanel>\n );\n};\n\nexport default Sticky;\n"],"names":["Sticky","children","open","position","Position","BOTTOM","testId","_jsx","SlidingPanel","slidingPanelPositionFixed","showSlidingPanelBorder"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,MAAMA,MAAM,GAAmCA,CAAC;EAC9CC,QAAQ;AACRC,EAAAA,IAAI,GAAG,IAAI;YACXC,UAAQ,GAAGC,iBAAQ,CAACC,MAAM;AAC1BC,EAAAA;AAAM,CACM,KAAI;EAChB,oBACEC,cAAA,CAACC,oBAAY,EAAA;AACXF,IAAAA,MAAM,EAAEA,MAAO;AACfJ,IAAAA,IAAI,EAAEA,IAAK;AACXC,IAAAA,QAAQ,EAAEA,UAAS;IACnBM,yBAAyB,EAAA,IAAA;IACzBC,sBAAsB,EAAA,IAAA;AAAAT,IAAAA,QAAA,EAErBA;AAAQ,GACG,CAAC;AAEnB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Sticky.mjs","sources":["../../src/sticky/Sticky.tsx"],"sourcesContent":["import { Position } from '../common';\nimport SlidingPanel from '../slidingPanel';\nimport { FunctionComponent } from 'react';\n\nexport interface StickyProps {\n /** Optional prop for children components to be rendered inside the Sticky component. */\n children?: React.ReactNode;\n\n /** Optional props that determines if the Sticky component is open or closed. Default value is `true`. */\n open?: boolean;\n\n /** Optional props that specifies the position of the Sticky component on the screen. Can be either `top` or `bottom`. */\n position?: `${Position.TOP}` | `${Position.BOTTOM}`;\n\n /** Optional prop to specify the ID used for testing */\n testId?: string;\n}\n\n/**\n * ### Sticky Component\n *\n * `<Sticky />` is a component that renders a `<SlidingPanel />` with specified props.\n * It uses the `<SlidingPanel />` component to create a panel that can slide in and out of view,\n * based on the `open` prop. It can be positioned at the top or bottom of the container,\n * as specified by the `position` prop.\n *\n * @component\n * @param {ReactNode} children - Children content.\n * @param {boolean} open - Determines if the Sticky component is open or closed.\n * @param {('top'|'bottom')} position - Specifies the position.\n * @param {string} testId - ID used for testing.\n * @returns {React.JSX.Element} The `SlidingPanel` component with applied props.\n * @example\n * <Button onClick={() => setOpen(!open)}>Open Sticky</Button>\n * <Sticky open={open} position={'bottom'}>\n * <div>\n * <Button onClick={() => setOpen(!open)}>Close Sticky</Button>\n * </div>\n * </Sticky>\n */\nconst Sticky: FunctionComponent<StickyProps> = ({\n children,\n open = true,\n position = Position.BOTTOM,\n testId,\n}: StickyProps) => {\n return (\n <SlidingPanel\n testId={testId}\n open={open}\n position={position}\n slidingPanelPositionFixed\n showSlidingPanelBorder\n >\n {children}\n </SlidingPanel>\n );\n};\n\nexport default Sticky;\n"],"names":["Sticky","children","open","position","Position","BOTTOM","testId","_jsx","SlidingPanel","slidingPanelPositionFixed","showSlidingPanelBorder"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCMA,MAAAA,MAAM,GAAmCA,CAAC;EAC9CC,QAAQ;AACRC,EAAAA,IAAI,GAAG,IAAI;EACXC,QAAQ,GAAGC,QAAQ,CAACC,MAAM;AAC1BC,EAAAA;AAAM,CACM,KAAI;EAChB,oBACEC,GAAA,CAACC,YAAY,EAAA;AACXF,IAAAA,MAAM,EAAEA,MAAO;AACfJ,IAAAA,IAAI,EAAEA,IAAK;AACXC,IAAAA,QAAQ,EAAEA,QAAS;IACnBM,yBAAyB,EAAA,IAAA;IACzBC,sBAAsB,EAAA,IAAA;AAAAT,IAAAA,QAAA,EAErBA;AAAQ,GACG,CAAC;AAEnB;;;;"}
1
+ {"version":3,"file":"Sticky.mjs","sources":["../../src/sticky/Sticky.tsx"],"sourcesContent":["import { Position } from '../common';\nimport SlidingPanel from '../slidingPanel';\nimport { FunctionComponent } from 'react';\n\nexport interface StickyProps {\n /** Optional prop for children components to be rendered inside the Sticky component. */\n children?: React.ReactNode;\n\n /** Optional props that determines if the Sticky component is open or closed. Default value is `true`. */\n open?: boolean;\n\n /** Optional props that specifies the position of the Sticky component on the screen. Can be either `top` or `bottom`. */\n position?: `${Position.TOP}` | `${Position.BOTTOM}`;\n\n /** Optional prop to specify the ID used for testing */\n testId?: string;\n}\n\n/**\n * ### Sticky Component\n *\n * `<Sticky />` is a component that renders a `<SlidingPanel />` with specified props.\n * It uses the `<SlidingPanel />` component to create a panel that can slide in and out of view,\n * based on the `open` prop. It can be positioned at the top or bottom of the container,\n * as specified by the `position` prop.\n *\n * @component\n * @param {ReactNode} children - Children content.\n * @param {boolean} open - Determines if the Sticky component is open or closed.\n * @param {('top'|'bottom')} position - Specifies the position.\n * @param {string} testId - ID used for testing.\n * @returns {React.JSX.Element} The `SlidingPanel` component with applied props.\n * @example\n * <Button onClick={() => setOpen(!open)}>Open Sticky</Button>\n * <Sticky open={open} position={'bottom'}>\n * <div>\n * <Button onClick={() => setOpen(!open)}>Close Sticky</Button>\n * </div>\n * </Sticky>\n */\nconst Sticky: FunctionComponent<StickyProps> = ({\n children,\n open = true,\n position = Position.BOTTOM,\n testId,\n}: StickyProps) => {\n return (\n <SlidingPanel\n testId={testId}\n open={open}\n position={position}\n slidingPanelPositionFixed\n showSlidingPanelBorder\n >\n {children}\n </SlidingPanel>\n );\n};\n\nexport default Sticky;\n"],"names":["Sticky","children","open","position","Position","BOTTOM","testId","_jsx","SlidingPanel","slidingPanelPositionFixed","showSlidingPanelBorder"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,MAAMA,MAAM,GAAmCA,CAAC;EAC9CC,QAAQ;AACRC,EAAAA,IAAI,GAAG,IAAI;EACXC,QAAQ,GAAGC,QAAQ,CAACC,MAAM;AAC1BC,EAAAA;AAAM,CACM,KAAI;EAChB,oBACEC,GAAA,CAACC,YAAY,EAAA;AACXF,IAAAA,MAAM,EAAEA,MAAO;AACfJ,IAAAA,IAAI,EAAEA,IAAK;AACXC,IAAAA,QAAQ,EAAEA,QAAS;IACnBM,yBAAyB,EAAA,IAAA;IACzBC,sBAAsB,EAAA,IAAA;AAAAT,IAAAA,QAAA,EAErBA;AAAQ,GACG,CAAC;AAEnB;;;;"}
@@ -1,21 +1,24 @@
1
- @media (min-width: 768px) {
2
- }@media (min-width: 768px) {
3
- }.np-accordion-item {
1
+ .np-accordion-item {
4
2
  display: block;
5
3
  width: 100%;
6
- }.np-accordion-item--open .media {
4
+ }
5
+ .np-accordion-item--open .media {
7
6
  border: 0 !important;
8
- }.np-accordion-item .decision:not(.disabled):not(:disabled):hover {
7
+ }
8
+ .np-accordion-item .decision:not(.disabled):not(:disabled):hover {
9
9
  background-color: transparent;
10
- }.np-accordion-item.np-accordion-item--dark .media-body,
10
+ }
11
+ .np-accordion-item.np-accordion-item--dark .media-body,
11
12
  .np-accordion-item.np-accordion-item--dark .np-text-title-body {
12
13
  color: #ffffff;
13
- }.np-accordion-item__content {
14
+ }
15
+ .np-accordion-item__content {
14
16
  padding: 0 12px 24px 12px;
15
17
  padding: 0 var(--size-12) var(--size-24) var(--size-12);
16
18
  border-bottom: 1px solid rgba(0,0,0,0.10196);
17
19
  border-bottom: 1px solid var(--color-border-neutral);
18
- }@media (min-width: 480px) {
20
+ }
21
+ @media (min-width: 480px) {
19
22
  .np-accordion-item__content.has-icon {
20
23
  padding-left: 68px;
21
24
  }
@@ -24,22 +27,28 @@
24
27
  padding-left: 0;
25
28
  padding-left: initial;
26
29
  }
27
- }.np-accordion-item .np-option .np-option__title {
30
+ }
31
+ .np-accordion-item .np-option .np-option__title {
28
32
  font-weight: 600;
29
33
  font-weight: var(--font-weight-semi-bold);
30
- }.np-theme-personal .np-accordion-item--with-media .media {
34
+ }
35
+ .np-theme-personal .np-accordion-item--with-media .media {
31
36
  display: flex;
32
37
  align-items: center;
33
- }.np-theme-personal .np-accordion-item--with-icon .np-accordion-item__content {
38
+ }
39
+ .np-theme-personal .np-accordion-item--with-icon .np-accordion-item__content {
34
40
  padding: 0 56px 16px;
35
41
  padding: 0 var(--size-56) var(--size-16);
36
- }.np-theme-personal .np-accordion-item--with-icon .media {
42
+ }
43
+ .np-theme-personal .np-accordion-item--with-icon .media {
37
44
  display: flex;
38
45
  align-items: flex-start;
39
- }.np-theme-personal .np-accordion-item .decision__title {
46
+ }
47
+ .np-theme-personal .np-accordion-item .decision__title {
40
48
  font-size: 1.125rem;
41
49
  font-size: var(--font-size-18);
42
- }.np-theme-personal .np-accordion-item .np-option .np-option__title {
50
+ }
51
+ .np-theme-personal .np-accordion-item .np-option .np-option__title {
43
52
  margin-bottom: 0;
44
53
  font-size: 1.125rem;
45
54
  font-size: var(--font-size-18);
@@ -47,14 +56,16 @@
47
56
  letter-spacing: var(--letter-spacing-negative-xs);
48
57
  line-height: 1.5rem;
49
58
  line-height: var(--line-height-24);
50
- }.np-theme-personal .np-accordion-item .np-option .circle-sm {
59
+ }
60
+ .np-theme-personal .np-accordion-item .np-option .circle-sm {
51
61
  background-color: transparent;
52
62
  width: 24px;
53
63
  width: var(--size-24);
54
64
  height: 24px;
55
65
  height: var(--size-24);
56
66
  border-radius: 0;
57
- }.np-theme-personal .np-accordion-item__content {
67
+ }
68
+ .np-theme-personal .np-accordion-item__content {
58
69
  padding: 0 56px 16px 16px;
59
70
  padding: 0 var(--size-56) var(--size-16) var(--size-16);
60
71
  border-bottom: none;