@transferwise/components 46.161.0 → 46.161.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 (715) 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/AvatarLayout/AvatarLayout.js.map +1 -1
  6. package/build/AvatarLayout/AvatarLayout.mjs.map +1 -1
  7. package/build/AvatarView/AvatarView.js.map +1 -1
  8. package/build/AvatarView/AvatarView.mjs.map +1 -1
  9. package/build/AvatarView/Dot/Dot.js.map +1 -1
  10. package/build/AvatarView/Dot/Dot.mjs.map +1 -1
  11. package/build/Body/Body.js.map +1 -1
  12. package/build/Body/Body.mjs.map +1 -1
  13. package/build/Button/Button.js.map +1 -1
  14. package/build/Button/Button.mjs.map +1 -1
  15. package/build/Button/Button.resolver.js.map +1 -1
  16. package/build/Button/Button.resolver.mjs.map +1 -1
  17. package/build/Button/LegacyButton/LegacyButton.js.map +1 -1
  18. package/build/Button/LegacyButton/LegacyButton.mjs.map +1 -1
  19. package/build/Button/LegacyButton/utils/legacyUtils.js.map +1 -1
  20. package/build/Button/LegacyButton/utils/legacyUtils.mjs.map +1 -1
  21. package/build/Button/classMap.js.map +1 -1
  22. package/build/Button/classMap.mjs.map +1 -1
  23. package/build/Calendar/Calendar.constants.js.map +1 -1
  24. package/build/Calendar/Calendar.constants.mjs.map +1 -1
  25. package/build/Calendar/Calendar.js.map +1 -1
  26. package/build/Calendar/Calendar.messages.js.map +1 -1
  27. package/build/Calendar/Calendar.messages.mjs.map +1 -1
  28. package/build/Calendar/Calendar.mjs.map +1 -1
  29. package/build/Calendar/DateHeader/DateHeader.js.map +1 -1
  30. package/build/Calendar/DateHeader/DateHeader.mjs.map +1 -1
  31. package/build/Calendar/DayCalendar/DayCalendar.js.map +1 -1
  32. package/build/Calendar/DayCalendar/DayCalendar.mjs.map +1 -1
  33. package/build/Calendar/DayCalendar/Table/DayCalendarTable.js.map +1 -1
  34. package/build/Calendar/DayCalendar/Table/DayCalendarTable.mjs.map +1 -1
  35. package/build/Calendar/GetFocusableTime/GetFocusableTime.js.map +1 -1
  36. package/build/Calendar/GetFocusableTime/GetFocusableTime.mjs.map +1 -1
  37. package/build/Calendar/GetStartOfDay/GetStartOfDay.js.map +1 -1
  38. package/build/Calendar/GetStartOfDay/GetStartOfDay.mjs.map +1 -1
  39. package/build/Calendar/MonthCalendar/MonthCalendar.js.map +1 -1
  40. package/build/Calendar/MonthCalendar/MonthCalendar.mjs.map +1 -1
  41. package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.js.map +1 -1
  42. package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.mjs.map +1 -1
  43. package/build/Calendar/TableLink/TableLink.js.map +1 -1
  44. package/build/Calendar/TableLink/TableLink.mjs.map +1 -1
  45. package/build/Calendar/YearCalendar/Table/YearCalendarTable.js.map +1 -1
  46. package/build/Calendar/YearCalendar/Table/YearCalendarTable.mjs.map +1 -1
  47. package/build/Calendar/YearCalendar/YearCalendar.js.map +1 -1
  48. package/build/Calendar/YearCalendar/YearCalendar.mjs.map +1 -1
  49. package/build/Calendar/_helpers/clampToDayViewBoundary/clampToDayViewBoundary.js.map +1 -1
  50. package/build/Calendar/_helpers/clampToDayViewBoundary/clampToDayViewBoundary.mjs.map +1 -1
  51. package/build/Calendar/_helpers/hasDisabledDatesInMonth/hasDisabledDatesInMonth.js.map +1 -1
  52. package/build/Calendar/_helpers/hasDisabledDatesInMonth/hasDisabledDatesInMonth.mjs.map +1 -1
  53. package/build/Calendar/_helpers/isDateDisabled/isDateDisabled.js.map +1 -1
  54. package/build/Calendar/_helpers/isDateDisabled/isDateDisabled.mjs.map +1 -1
  55. package/build/Carousel/Carousel.js.map +1 -1
  56. package/build/Carousel/Carousel.mjs.map +1 -1
  57. package/build/Checkbox/Checkbox.js.map +1 -1
  58. package/build/Checkbox/Checkbox.mjs.map +1 -1
  59. package/build/CheckboxButton/CheckboxButton.js.map +1 -1
  60. package/build/CheckboxButton/CheckboxButton.mjs.map +1 -1
  61. package/build/Chevron/Chevron.js.map +1 -1
  62. package/build/Chevron/Chevron.mjs.map +1 -1
  63. package/build/Chips/Chip/Chip.js.map +1 -1
  64. package/build/Chips/Chip/Chip.mjs.map +1 -1
  65. package/build/Chips/Chips.js.map +1 -1
  66. package/build/Chips/Chips.messages.js.map +1 -1
  67. package/build/Chips/Chips.messages.mjs.map +1 -1
  68. package/build/Chips/Chips.mjs.map +1 -1
  69. package/build/CircularButton/CircularButton.js.map +1 -1
  70. package/build/CircularButton/CircularButton.mjs.map +1 -1
  71. package/build/Container/Container.js.map +1 -1
  72. package/build/Container/Container.mjs.map +1 -1
  73. package/build/DateInput/DateInput.js.map +1 -1
  74. package/build/DateInput/DateInput.messages.js.map +1 -1
  75. package/build/DateInput/DateInput.messages.mjs.map +1 -1
  76. package/build/DateInput/DateInput.mjs.map +1 -1
  77. package/build/DateInput/utils/convertToLocalMidnight/convertToLocalMidnight.js.map +1 -1
  78. package/build/DateInput/utils/convertToLocalMidnight/convertToLocalMidnight.mjs.map +1 -1
  79. package/build/DateLookup/DateLookup.js.map +1 -1
  80. package/build/DateLookup/DateLookup.mjs.map +1 -1
  81. package/build/DateLookup/DateTrigger/DateTrigger.js.map +1 -1
  82. package/build/DateLookup/DateTrigger/DateTrigger.messages.js.map +1 -1
  83. package/build/DateLookup/DateTrigger/DateTrigger.messages.mjs.map +1 -1
  84. package/build/DateLookup/DateTrigger/DateTrigger.mjs.map +1 -1
  85. package/build/Decision/Decision.js.map +1 -1
  86. package/build/Decision/Decision.mjs.map +1 -1
  87. package/build/DefinitionList/DefinitionList.js.map +1 -1
  88. package/build/DefinitionList/DefinitionList.mjs.map +1 -1
  89. package/build/Dimmer/Dimmer.js.map +1 -1
  90. package/build/Dimmer/Dimmer.mjs.map +1 -1
  91. package/build/Dimmer/dimmerManager/dimmerManager.js.map +1 -1
  92. package/build/Dimmer/dimmerManager/dimmerManager.mjs.map +1 -1
  93. package/build/Display/Display.js.map +1 -1
  94. package/build/Display/Display.mjs.map +1 -1
  95. package/build/Divider/Divider.js.map +1 -1
  96. package/build/Divider/Divider.mjs.map +1 -1
  97. package/build/Drawer/Drawer.js.map +1 -1
  98. package/build/Drawer/Drawer.mjs.map +1 -1
  99. package/build/DropFade/DropFade.js.map +1 -1
  100. package/build/DropFade/DropFade.mjs.map +1 -1
  101. package/build/Emphasis/Emphasis.js.map +1 -1
  102. package/build/Emphasis/Emphasis.mjs.map +1 -1
  103. package/build/Emphasis/EmphasisHtmlTransformer.js.map +1 -1
  104. package/build/Emphasis/EmphasisHtmlTransformer.mjs.map +1 -1
  105. package/build/ExpressiveMoneyInput/AmountInput/AmountInput.js.map +1 -1
  106. package/build/ExpressiveMoneyInput/AmountInput/AmountInput.mjs.map +1 -1
  107. package/build/ExpressiveMoneyInput/AmountInput/utils.js.map +1 -1
  108. package/build/ExpressiveMoneyInput/AmountInput/utils.mjs.map +1 -1
  109. package/build/ExpressiveMoneyInput/AnimatedNumber/AnimatedNumber.js.map +1 -1
  110. package/build/ExpressiveMoneyInput/AnimatedNumber/AnimatedNumber.mjs.map +1 -1
  111. package/build/ExpressiveMoneyInput/Chevron/Chevron.js.map +1 -1
  112. package/build/ExpressiveMoneyInput/Chevron/Chevron.mjs.map +1 -1
  113. package/build/ExpressiveMoneyInput/CurrencySelector/CurrencySelector.js.map +1 -1
  114. package/build/ExpressiveMoneyInput/CurrencySelector/CurrencySelector.mjs.map +1 -1
  115. package/build/ExpressiveMoneyInput/ExpressiveMoneyInput.js.map +1 -1
  116. package/build/ExpressiveMoneyInput/ExpressiveMoneyInput.messages.js.map +1 -1
  117. package/build/ExpressiveMoneyInput/ExpressiveMoneyInput.messages.mjs.map +1 -1
  118. package/build/ExpressiveMoneyInput/ExpressiveMoneyInput.mjs.map +1 -1
  119. package/build/ExpressiveMoneyInput/hooks/useFocus.js.map +1 -1
  120. package/build/ExpressiveMoneyInput/hooks/useFocus.mjs.map +1 -1
  121. package/build/ExpressiveMoneyInput/hooks/useInputStyle.js.map +1 -1
  122. package/build/ExpressiveMoneyInput/hooks/useInputStyle.mjs.map +1 -1
  123. package/build/Field/Field.js.map +1 -1
  124. package/build/Field/Field.messages.js.map +1 -1
  125. package/build/Field/Field.messages.mjs.map +1 -1
  126. package/build/Field/Field.mjs.map +1 -1
  127. package/build/FlowNavigation/AnimatedLabel/AnimatedLabel.js.map +1 -1
  128. package/build/FlowNavigation/AnimatedLabel/AnimatedLabel.mjs.map +1 -1
  129. package/build/FlowNavigation/FlowNavigation.js.map +1 -1
  130. package/build/FlowNavigation/FlowNavigation.messages.js.map +1 -1
  131. package/build/FlowNavigation/FlowNavigation.messages.mjs.map +1 -1
  132. package/build/FlowNavigation/FlowNavigation.mjs.map +1 -1
  133. package/build/Header/Header.js.map +1 -1
  134. package/build/Header/Header.mjs.map +1 -1
  135. package/build/IconButton/IconButton.js.map +1 -1
  136. package/build/IconButton/IconButton.mjs.map +1 -1
  137. package/build/Image/Image.js.map +1 -1
  138. package/build/Image/Image.mjs.map +1 -1
  139. package/build/Info/Info.js.map +1 -1
  140. package/build/Info/Info.messages.js.map +1 -1
  141. package/build/Info/Info.messages.mjs.map +1 -1
  142. package/build/Info/Info.mjs.map +1 -1
  143. package/build/Info/infoPresentations.js.map +1 -1
  144. package/build/Info/infoPresentations.mjs.map +1 -1
  145. package/build/InputWithDisplayFormat/InputWithDisplayFormat.js.map +1 -1
  146. package/build/InputWithDisplayFormat/InputWithDisplayFormat.mjs.map +1 -1
  147. package/build/Inputs/Input/Input.js.map +1 -1
  148. package/build/Inputs/Input/Input.mjs.map +1 -1
  149. package/build/Inputs/InputGroup/InputGroup.js.map +1 -1
  150. package/build/Inputs/InputGroup/InputGroup.mjs.map +1 -1
  151. package/build/Inputs/SearchInput/SearchInput.js.map +1 -1
  152. package/build/Inputs/SearchInput/SearchInput.mjs.map +1 -1
  153. package/build/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.js.map +1 -1
  154. package/build/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.mjs.map +1 -1
  155. package/build/Inputs/SelectInput/ButtonInput/SelectInputButtonInput.js.map +1 -1
  156. package/build/Inputs/SelectInput/ButtonInput/SelectInputButtonInput.mjs.map +1 -1
  157. package/build/Inputs/SelectInput/ClearButton/SelectInputClearButton.js.map +1 -1
  158. package/build/Inputs/SelectInput/ClearButton/SelectInputClearButton.mjs.map +1 -1
  159. package/build/Inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.js.map +1 -1
  160. package/build/Inputs/SelectInput/DefaultRenderTrigger/SelectInputDefaultRenderTrigger.mjs.map +1 -1
  161. package/build/Inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.js.map +1 -1
  162. package/build/Inputs/SelectInput/ItemView/GroupItemView/SelectInputGroupItemView.mjs.map +1 -1
  163. package/build/Inputs/SelectInput/ItemView/SelectInputItemView.js.map +1 -1
  164. package/build/Inputs/SelectInput/ItemView/SelectInputItemView.mjs.map +1 -1
  165. package/build/Inputs/SelectInput/Option/SelectInputOption.js.map +1 -1
  166. package/build/Inputs/SelectInput/Option/SelectInputOption.mjs.map +1 -1
  167. package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.js.map +1 -1
  168. package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.mjs.map +1 -1
  169. package/build/Inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.js.map +1 -1
  170. package/build/Inputs/SelectInput/Options/OptionsContainer/SelectInputOptionsContainer.mjs.map +1 -1
  171. package/build/Inputs/SelectInput/Options/SelectInputOptions.js.map +1 -1
  172. package/build/Inputs/SelectInput/Options/SelectInputOptions.mjs.map +1 -1
  173. package/build/Inputs/SelectInput/Popover/SelectInputPopover.js.map +1 -1
  174. package/build/Inputs/SelectInput/Popover/SelectInputPopover.mjs.map +1 -1
  175. package/build/Inputs/SelectInput/SelectInput.contexts.js.map +1 -1
  176. package/build/Inputs/SelectInput/SelectInput.contexts.mjs.map +1 -1
  177. package/build/Inputs/SelectInput/SelectInput.js.map +1 -1
  178. package/build/Inputs/SelectInput/SelectInput.messages.js.map +1 -1
  179. package/build/Inputs/SelectInput/SelectInput.messages.mjs.map +1 -1
  180. package/build/Inputs/SelectInput/SelectInput.mjs.map +1 -1
  181. package/build/Inputs/SelectInput/SelectInput.utils.js.map +1 -1
  182. package/build/Inputs/SelectInput/SelectInput.utils.mjs.map +1 -1
  183. package/build/Inputs/SelectInput/TriggerButton/SelectInputTriggerButton.js.map +1 -1
  184. package/build/Inputs/SelectInput/TriggerButton/SelectInputTriggerButton.mjs.map +1 -1
  185. package/build/Inputs/SelectInput/constants.js.map +1 -1
  186. package/build/Inputs/SelectInput/constants.mjs.map +1 -1
  187. package/build/Inputs/SelectInput/hooks/useTypeahead.js.map +1 -1
  188. package/build/Inputs/SelectInput/hooks/useTypeahead.mjs.map +1 -1
  189. package/build/Inputs/TextArea/TextArea.js.map +1 -1
  190. package/build/Inputs/TextArea/TextArea.mjs.map +1 -1
  191. package/build/Inputs/_common.js.map +1 -1
  192. package/build/Inputs/_common.mjs.map +1 -1
  193. package/build/Inputs/contexts.js.map +1 -1
  194. package/build/Inputs/contexts.mjs.map +1 -1
  195. package/build/InstructionsList/InstructionsList.js.map +1 -1
  196. package/build/InstructionsList/InstructionsList.mjs.map +1 -1
  197. package/build/Label/Label.js.map +1 -1
  198. package/build/Label/Label.messages.js.map +1 -1
  199. package/build/Label/Label.messages.mjs.map +1 -1
  200. package/build/Label/Label.mjs.map +1 -1
  201. package/build/Link/Link.js.map +1 -1
  202. package/build/Link/Link.messages.js.map +1 -1
  203. package/build/Link/Link.messages.mjs.map +1 -1
  204. package/build/Link/Link.mjs.map +1 -1
  205. package/build/List/List.js.map +1 -1
  206. package/build/List/List.mjs.map +1 -1
  207. package/build/ListItem/AdditionalInfo/ListItemAdditionalInfo.js.map +1 -1
  208. package/build/ListItem/AdditionalInfo/ListItemAdditionalInfo.mjs.map +1 -1
  209. package/build/ListItem/AvatarLayout/ListItemAvatarLayout.js.map +1 -1
  210. package/build/ListItem/AvatarLayout/ListItemAvatarLayout.mjs.map +1 -1
  211. package/build/ListItem/AvatarView/ListItemAvatarView.js.map +1 -1
  212. package/build/ListItem/AvatarView/ListItemAvatarView.mjs.map +1 -1
  213. package/build/ListItem/Button/ListItemButton.js.map +1 -1
  214. package/build/ListItem/Button/ListItemButton.mjs.map +1 -1
  215. package/build/ListItem/Checkbox/ListItemCheckbox.js.map +1 -1
  216. package/build/ListItem/Checkbox/ListItemCheckbox.mjs.map +1 -1
  217. package/build/ListItem/IconButton/ListItemIconButton.js.map +1 -1
  218. package/build/ListItem/IconButton/ListItemIconButton.mjs.map +1 -1
  219. package/build/ListItem/Image/ListItemImage.js.map +1 -1
  220. package/build/ListItem/Image/ListItemImage.mjs.map +1 -1
  221. package/build/ListItem/ListItem.js.map +1 -1
  222. package/build/ListItem/ListItem.mjs.map +1 -1
  223. package/build/ListItem/ListItemContext.js.map +1 -1
  224. package/build/ListItem/ListItemContext.mjs.map +1 -1
  225. package/build/ListItem/Navigation/ListItemNavigation.js.map +1 -1
  226. package/build/ListItem/Navigation/ListItemNavigation.mjs.map +1 -1
  227. package/build/ListItem/Prompt/ListItemPrompt.js.map +1 -1
  228. package/build/ListItem/Prompt/ListItemPrompt.mjs.map +1 -1
  229. package/build/ListItem/Radio/ListItemRadio.js.map +1 -1
  230. package/build/ListItem/Radio/ListItemRadio.mjs.map +1 -1
  231. package/build/ListItem/Switch/ListItemSwitch.js.map +1 -1
  232. package/build/ListItem/Switch/ListItemSwitch.mjs.map +1 -1
  233. package/build/ListItem/useListItemControl.js.map +1 -1
  234. package/build/ListItem/useListItemControl.mjs.map +1 -1
  235. package/build/ListItem/useListItemMedia.js.map +1 -1
  236. package/build/ListItem/useListItemMedia.mjs.map +1 -1
  237. package/build/Loader/Loader.js.map +1 -1
  238. package/build/Loader/Loader.mjs.map +1 -1
  239. package/build/Logo/Logo.js.map +1 -1
  240. package/build/Logo/Logo.mjs.map +1 -1
  241. package/build/Logo/logo-assets.js.map +1 -1
  242. package/build/Logo/logo-assets.mjs.map +1 -1
  243. package/build/Markdown/Markdown.js.map +1 -1
  244. package/build/Markdown/Markdown.mjs.map +1 -1
  245. package/build/Markup/Markup.js.map +1 -1
  246. package/build/Markup/Markup.mjs.map +1 -1
  247. package/build/Markup/constants.js.map +1 -1
  248. package/build/Markup/constants.mjs.map +1 -1
  249. package/build/Markup/utils/parseMarkup.js.map +1 -1
  250. package/build/Markup/utils/parseMarkup.mjs.map +1 -1
  251. package/build/Markup/utils/sanitise.js.map +1 -1
  252. package/build/Markup/utils/sanitise.mjs.map +1 -1
  253. package/build/Modal/Modal.js.map +1 -1
  254. package/build/Modal/Modal.mjs.map +1 -1
  255. package/build/Money/Money.js.map +1 -1
  256. package/build/Money/Money.mjs.map +1 -1
  257. package/build/MoneyInput/MoneyInput.js.map +1 -1
  258. package/build/MoneyInput/MoneyInput.messages.js.map +1 -1
  259. package/build/MoneyInput/MoneyInput.messages.mjs.map +1 -1
  260. package/build/MoneyInput/MoneyInput.mjs.map +1 -1
  261. package/build/MoneyInput/currencyFormatting.js.map +1 -1
  262. package/build/MoneyInput/currencyFormatting.mjs.map +1 -1
  263. package/build/Nudge/Nudge.js.map +1 -1
  264. package/build/Nudge/Nudge.mjs.map +1 -1
  265. package/build/PhoneNumberInput/Data/countries.js.map +1 -1
  266. package/build/PhoneNumberInput/Data/countries.mjs.map +1 -1
  267. package/build/PhoneNumberInput/PhoneNumberInput.js.map +1 -1
  268. package/build/PhoneNumberInput/PhoneNumberInput.messages.js.map +1 -1
  269. package/build/PhoneNumberInput/PhoneNumberInput.messages.mjs.map +1 -1
  270. package/build/PhoneNumberInput/PhoneNumberInput.mjs.map +1 -1
  271. package/build/PhoneNumberInput/utils/cleanNumber/cleanNumber.js.map +1 -1
  272. package/build/PhoneNumberInput/utils/cleanNumber/cleanNumber.mjs.map +1 -1
  273. package/build/PhoneNumberInput/utils/excludeCountries/excludeCountries.js.map +1 -1
  274. package/build/PhoneNumberInput/utils/excludeCountries/excludeCountries.mjs.map +1 -1
  275. package/build/PhoneNumberInput/utils/explodeNumberModel/index.js.map +1 -1
  276. package/build/PhoneNumberInput/utils/explodeNumberModel/index.mjs.map +1 -1
  277. package/build/PhoneNumberInput/utils/findCountryByCode/index.js.map +1 -1
  278. package/build/PhoneNumberInput/utils/findCountryByCode/index.mjs.map +1 -1
  279. package/build/PhoneNumberInput/utils/findCountryByPrefix/index.js.map +1 -1
  280. package/build/PhoneNumberInput/utils/findCountryByPrefix/index.mjs.map +1 -1
  281. package/build/PhoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.js.map +1 -1
  282. package/build/PhoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.mjs.map +1 -1
  283. package/build/PhoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js.map +1 -1
  284. package/build/PhoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.mjs.map +1 -1
  285. package/build/PhoneNumberInput/utils/longestMatchingPrefix/index.js.map +1 -1
  286. package/build/PhoneNumberInput/utils/longestMatchingPrefix/index.mjs.map +1 -1
  287. package/build/PhoneNumberInput/utils/setDefaultPrefix/index.js.map +1 -1
  288. package/build/PhoneNumberInput/utils/setDefaultPrefix/index.mjs.map +1 -1
  289. package/build/PhoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.js.map +1 -1
  290. package/build/PhoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.mjs.map +1 -1
  291. package/build/Popover/Popover.js.map +1 -1
  292. package/build/Popover/Popover.mjs.map +1 -1
  293. package/build/Primitives/PrimitiveAnchor/PrimitiveAnchor.js.map +1 -1
  294. package/build/Primitives/PrimitiveAnchor/PrimitiveAnchor.mjs.map +1 -1
  295. package/build/Primitives/PrimitiveButton/PrimitiveButton.js.map +1 -1
  296. package/build/Primitives/PrimitiveButton/PrimitiveButton.mjs.map +1 -1
  297. package/build/ProcessIndicator/ProcessIndicator.js.map +1 -1
  298. package/build/ProcessIndicator/ProcessIndicator.mjs.map +1 -1
  299. package/build/Progress/Progress.js.map +1 -1
  300. package/build/Progress/Progress.mjs.map +1 -1
  301. package/build/ProgressBar/ProgressBar.js.map +1 -1
  302. package/build/ProgressBar/ProgressBar.mjs.map +1 -1
  303. package/build/PromoCard/CardGroup/PromoCardGroup.js.map +1 -1
  304. package/build/PromoCard/CardGroup/PromoCardGroup.mjs.map +1 -1
  305. package/build/PromoCard/Indicator/PromoCardIndicator.js.map +1 -1
  306. package/build/PromoCard/Indicator/PromoCardIndicator.mjs.map +1 -1
  307. package/build/PromoCard/PromoCard.js.map +1 -1
  308. package/build/PromoCard/PromoCard.mjs.map +1 -1
  309. package/build/PromoCard/PromoCardContext.js.map +1 -1
  310. package/build/PromoCard/PromoCardContext.mjs.map +1 -1
  311. package/build/Prompt/ActionPrompt/ActionPrompt.js.map +1 -1
  312. package/build/Prompt/ActionPrompt/ActionPrompt.mjs.map +1 -1
  313. package/build/Prompt/CriticalBanner/CriticalBanner.js.map +1 -1
  314. package/build/Prompt/CriticalBanner/CriticalBanner.mjs.map +1 -1
  315. package/build/Prompt/CriticalBanner/helpers.js.map +1 -1
  316. package/build/Prompt/CriticalBanner/helpers.mjs.map +1 -1
  317. package/build/Prompt/InfoPrompt/InfoPrompt.js.map +1 -1
  318. package/build/Prompt/InfoPrompt/InfoPrompt.mjs.map +1 -1
  319. package/build/Prompt/InlinePrompt/InlinePrompt.js.map +1 -1
  320. package/build/Prompt/InlinePrompt/InlinePrompt.mjs.map +1 -1
  321. package/build/Prompt/PrimitivePrompt/PrimitivePrompt.js.map +1 -1
  322. package/build/Prompt/PrimitivePrompt/PrimitivePrompt.mjs.map +1 -1
  323. package/build/Prompt/common/Expander/Expander.js.map +1 -1
  324. package/build/Prompt/common/Expander/Expander.messages.js.map +1 -1
  325. package/build/Prompt/common/Expander/Expander.messages.mjs.map +1 -1
  326. package/build/Prompt/common/Expander/Expander.mjs.map +1 -1
  327. package/build/Prompt/helpers/promptMedia.js.map +1 -1
  328. package/build/Prompt/helpers/promptMedia.mjs.map +1 -1
  329. package/build/Provider/Direction/DirectionProvider.js.map +1 -1
  330. package/build/Provider/Direction/DirectionProvider.mjs.map +1 -1
  331. package/build/Provider/Language/LanguageProvider.js.map +1 -1
  332. package/build/Provider/Language/LanguageProvider.mjs.map +1 -1
  333. package/build/Provider/Provider.js.map +1 -1
  334. package/build/Provider/Provider.mjs.map +1 -1
  335. package/build/Provider/overlay/OverlayIdProvider.js.map +1 -1
  336. package/build/Provider/overlay/OverlayIdProvider.mjs.map +1 -1
  337. package/build/Radio/Radio.js.map +1 -1
  338. package/build/Radio/Radio.mjs.map +1 -1
  339. package/build/RadioGroup/RadioGroup.js.map +1 -1
  340. package/build/RadioGroup/RadioGroup.mjs.map +1 -1
  341. package/build/Section/Section.js.map +1 -1
  342. package/build/Section/Section.mjs.map +1 -1
  343. package/build/SegmentedControl/SegmentedControl.js.map +1 -1
  344. package/build/SegmentedControl/SegmentedControl.mjs.map +1 -1
  345. package/build/SentimentSurface/SentimentSurface.js.map +1 -1
  346. package/build/SentimentSurface/SentimentSurface.mjs.map +1 -1
  347. package/build/SlidingPanel/SlidingPanel.js.map +1 -1
  348. package/build/SlidingPanel/SlidingPanel.mjs.map +1 -1
  349. package/build/Snackbar/Snackbar.js.map +1 -1
  350. package/build/Snackbar/Snackbar.mjs.map +1 -1
  351. package/build/Snackbar/SnackbarContext.js.map +1 -1
  352. package/build/Snackbar/SnackbarContext.mjs.map +1 -1
  353. package/build/Snackbar/SnackbarProvider.js.map +1 -1
  354. package/build/Snackbar/SnackbarProvider.mjs.map +1 -1
  355. package/build/Snackbar/useSnackbar.js.map +1 -1
  356. package/build/Snackbar/useSnackbar.mjs.map +1 -1
  357. package/build/StatusIcon/StatusIcon.js.map +1 -1
  358. package/build/StatusIcon/StatusIcon.messages.js.map +1 -1
  359. package/build/StatusIcon/StatusIcon.messages.mjs.map +1 -1
  360. package/build/StatusIcon/StatusIcon.mjs.map +1 -1
  361. package/build/Stepper/Stepper.js.map +1 -1
  362. package/build/Stepper/Stepper.mjs.map +1 -1
  363. package/build/Stepper/deviceDetection.js.map +1 -1
  364. package/build/Stepper/deviceDetection.mjs.map +1 -1
  365. package/build/Sticky/Sticky.js.map +1 -1
  366. package/build/Sticky/Sticky.mjs.map +1 -1
  367. package/build/Switch/Switch.js.map +1 -1
  368. package/build/Switch/Switch.mjs.map +1 -1
  369. package/build/Table/Cell/TableCell.js.map +1 -1
  370. package/build/Table/Cell/TableCell.mjs.map +1 -1
  371. package/build/Table/Header/TableHeader.js.map +1 -1
  372. package/build/Table/Header/TableHeader.mjs.map +1 -1
  373. package/build/Table/Row/TableRow.js.map +1 -1
  374. package/build/Table/Row/TableRow.mjs.map +1 -1
  375. package/build/Table/StatusText/TableStatusText.js.map +1 -1
  376. package/build/Table/StatusText/TableStatusText.mjs.map +1 -1
  377. package/build/Table/Table.js.map +1 -1
  378. package/build/Table/Table.messages.js.map +1 -1
  379. package/build/Table/Table.messages.mjs.map +1 -1
  380. package/build/Table/Table.mjs.map +1 -1
  381. package/build/Tabs/Tab/Tab.js.map +1 -1
  382. package/build/Tabs/Tab/Tab.mjs.map +1 -1
  383. package/build/Tabs/TabList/TabList.js.map +1 -1
  384. package/build/Tabs/TabList/TabList.mjs.map +1 -1
  385. package/build/Tabs/TabPanel/TabPanel.js.map +1 -1
  386. package/build/Tabs/TabPanel/TabPanel.mjs.map +1 -1
  387. package/build/Tabs/Tabs.js.map +1 -1
  388. package/build/Tabs/Tabs.mjs.map +1 -1
  389. package/build/Tabs/utils.js.map +1 -1
  390. package/build/Tabs/utils.mjs.map +1 -1
  391. package/build/Tag/Tag.js.map +1 -1
  392. package/build/Tag/Tag.mjs.map +1 -1
  393. package/build/TextareaWithDisplayFormat/TextareaWithDisplayFormat.js.map +1 -1
  394. package/build/TextareaWithDisplayFormat/TextareaWithDisplayFormat.mjs.map +1 -1
  395. package/build/Tile/Tile.js.map +1 -1
  396. package/build/Tile/Tile.mjs.map +1 -1
  397. package/build/Title/Title.js.map +1 -1
  398. package/build/Title/Title.mjs.map +1 -1
  399. package/build/Tooltip/Tooltip.js.map +1 -1
  400. package/build/Tooltip/Tooltip.mjs.map +1 -1
  401. package/build/Typeahead/Typeahead.js.map +1 -1
  402. package/build/Typeahead/Typeahead.messages.js.map +1 -1
  403. package/build/Typeahead/Typeahead.messages.mjs.map +1 -1
  404. package/build/Typeahead/Typeahead.mjs.map +1 -1
  405. package/build/Typeahead/TypeaheadInput/TypeaheadInput.js.map +1 -1
  406. package/build/Typeahead/TypeaheadInput/TypeaheadInput.mjs.map +1 -1
  407. package/build/Typeahead/TypeaheadOption/TypeaheadOption.js.map +1 -1
  408. package/build/Typeahead/TypeaheadOption/TypeaheadOption.mjs.map +1 -1
  409. package/build/Typeahead/Util/highlight.js.map +1 -1
  410. package/build/Typeahead/Util/highlight.mjs.map +1 -1
  411. package/build/Upload/Steps/CompleteStep/CompleteStep.js.map +1 -1
  412. package/build/Upload/Steps/CompleteStep/CompleteStep.mjs.map +1 -1
  413. package/build/Upload/Steps/ProcessingStep/ProcessingStep.js.map +1 -1
  414. package/build/Upload/Steps/ProcessingStep/ProcessingStep.mjs.map +1 -1
  415. package/build/Upload/Steps/UploadImageStep/UploadImageStep.js.map +1 -1
  416. package/build/Upload/Steps/UploadImageStep/UploadImageStep.mjs.map +1 -1
  417. package/build/Upload/Upload.js.map +1 -1
  418. package/build/Upload/Upload.messages.js.map +1 -1
  419. package/build/Upload/Upload.messages.mjs.map +1 -1
  420. package/build/Upload/Upload.mjs.map +1 -1
  421. package/build/Upload/utils/asyncFileRead/asyncFileRead.js.map +1 -1
  422. package/build/Upload/utils/asyncFileRead/asyncFileRead.mjs.map +1 -1
  423. package/build/Upload/utils/getFileType/getFileType.js.map +1 -1
  424. package/build/Upload/utils/getFileType/getFileType.mjs.map +1 -1
  425. package/build/Upload/utils/isSizeValid/isSizeValid.js.map +1 -1
  426. package/build/Upload/utils/isSizeValid/isSizeValid.mjs.map +1 -1
  427. package/build/Upload/utils/isTypeValid/isTypeValid.js.map +1 -1
  428. package/build/Upload/utils/isTypeValid/isTypeValid.mjs.map +1 -1
  429. package/build/Upload/utils/postData/postData.js.map +1 -1
  430. package/build/Upload/utils/postData/postData.mjs.map +1 -1
  431. package/build/UploadInput/UploadButton/UploadButton.js.map +1 -1
  432. package/build/UploadInput/UploadButton/UploadButton.messages.js.map +1 -1
  433. package/build/UploadInput/UploadButton/UploadButton.messages.mjs.map +1 -1
  434. package/build/UploadInput/UploadButton/UploadButton.mjs.map +1 -1
  435. package/build/UploadInput/UploadButton/defaults.js.map +1 -1
  436. package/build/UploadInput/UploadButton/defaults.mjs.map +1 -1
  437. package/build/UploadInput/UploadButton/getAllowedFileTypes.js.map +1 -1
  438. package/build/UploadInput/UploadButton/getAllowedFileTypes.mjs.map +1 -1
  439. package/build/UploadInput/UploadInput.js.map +1 -1
  440. package/build/UploadInput/UploadInput.messages.js.map +1 -1
  441. package/build/UploadInput/UploadInput.messages.mjs.map +1 -1
  442. package/build/UploadInput/UploadInput.mjs.map +1 -1
  443. package/build/UploadInput/UploadItem/UploadItem.js.map +1 -1
  444. package/build/UploadInput/UploadItem/UploadItem.messages.js.map +1 -1
  445. package/build/UploadInput/UploadItem/UploadItem.messages.mjs.map +1 -1
  446. package/build/UploadInput/UploadItem/UploadItem.mjs.map +1 -1
  447. package/build/UploadInput/UploadItem/UploadItemLink.js.map +1 -1
  448. package/build/UploadInput/UploadItem/UploadItemLink.mjs.map +1 -1
  449. package/build/WithDisplayFormat/WithDisplayFormat.js.map +1 -1
  450. package/build/WithDisplayFormat/WithDisplayFormat.mjs.map +1 -1
  451. package/build/WithId/WithId.js.map +1 -1
  452. package/build/WithId/WithId.mjs.map +1 -1
  453. package/build/WithNextPortal/WithNextPortal.js.map +1 -1
  454. package/build/WithNextPortal/WithNextPortal.mjs.map +1 -1
  455. package/build/_deprecated/ActionButton/ActionButton.js.map +1 -1
  456. package/build/_deprecated/ActionButton/ActionButton.mjs.map +1 -1
  457. package/build/_deprecated/ActionOption/ActionOption.js.map +1 -1
  458. package/build/_deprecated/ActionOption/ActionOption.mjs.map +1 -1
  459. package/build/_deprecated/Alert/Alert.js.map +1 -1
  460. package/build/_deprecated/Alert/Alert.mjs.map +1 -1
  461. package/build/_deprecated/Alert/InlineMarkdown/InlineMarkdown.js.map +1 -1
  462. package/build/_deprecated/Alert/InlineMarkdown/InlineMarkdown.mjs.map +1 -1
  463. package/build/_deprecated/Avatar/Avatar.js.map +1 -1
  464. package/build/_deprecated/Avatar/Avatar.mjs.map +1 -1
  465. package/build/_deprecated/Avatar/types.js.map +1 -1
  466. package/build/_deprecated/Avatar/types.mjs.map +1 -1
  467. package/build/_deprecated/AvatarWrapper/AvatarWrapper.js.map +1 -1
  468. package/build/_deprecated/AvatarWrapper/AvatarWrapper.mjs.map +1 -1
  469. package/build/_deprecated/Badge/Badge.js.map +1 -1
  470. package/build/_deprecated/Badge/Badge.mjs.map +1 -1
  471. package/build/_deprecated/Badge/BadgeAssets.js.map +1 -1
  472. package/build/_deprecated/Badge/BadgeAssets.mjs.map +1 -1
  473. package/build/_deprecated/Card/Card.js.map +1 -1
  474. package/build/_deprecated/Card/Card.mjs.map +1 -1
  475. package/build/_deprecated/CheckboxOption/CheckboxOption.js.map +1 -1
  476. package/build/_deprecated/CheckboxOption/CheckboxOption.mjs.map +1 -1
  477. package/build/_deprecated/CriticalBanner/CriticalCommsBanner.js.map +1 -1
  478. package/build/_deprecated/CriticalBanner/CriticalCommsBanner.mjs.map +1 -1
  479. package/build/_deprecated/InlineAlert/InlineAlert.js.map +1 -1
  480. package/build/_deprecated/InlineAlert/InlineAlert.mjs.map +1 -1
  481. package/build/_deprecated/LegacyListItem/LegacyListItem.js.map +1 -1
  482. package/build/_deprecated/LegacyListItem/LegacyListItem.mjs.map +1 -1
  483. package/build/_deprecated/NavigationOption/NavigationOption.js.map +1 -1
  484. package/build/_deprecated/NavigationOption/NavigationOption.mjs.map +1 -1
  485. package/build/_deprecated/NavigationOptionsList/NavigationOptionsList.js.map +1 -1
  486. package/build/_deprecated/NavigationOptionsList/NavigationOptionsList.mjs.map +1 -1
  487. package/build/_deprecated/OverlayHeader/OverlayHeader.js.map +1 -1
  488. package/build/_deprecated/OverlayHeader/OverlayHeader.mjs.map +1 -1
  489. package/build/_deprecated/RadioOption/RadioOption.js.map +1 -1
  490. package/build/_deprecated/RadioOption/RadioOption.mjs.map +1 -1
  491. package/build/_deprecated/Select/Option/Option.js.map +1 -1
  492. package/build/_deprecated/Select/Option/Option.mjs.map +1 -1
  493. package/build/_deprecated/Select/SearchBox/SearchBox.js.map +1 -1
  494. package/build/_deprecated/Select/SearchBox/SearchBox.mjs.map +1 -1
  495. package/build/_deprecated/Select/Select.js.map +1 -1
  496. package/build/_deprecated/Select/Select.messages.js.map +1 -1
  497. package/build/_deprecated/Select/Select.messages.mjs.map +1 -1
  498. package/build/_deprecated/Select/Select.mjs.map +1 -1
  499. package/build/_deprecated/Summary/Summary.js.map +1 -1
  500. package/build/_deprecated/Summary/Summary.messages.js.map +1 -1
  501. package/build/_deprecated/Summary/Summary.messages.mjs.map +1 -1
  502. package/build/_deprecated/Summary/Summary.mjs.map +1 -1
  503. package/build/_deprecated/SwitchOption/SwitchOption.js.map +1 -1
  504. package/build/_deprecated/SwitchOption/SwitchOption.mjs.map +1 -1
  505. package/build/common/BaseCard/BaseCard.js.map +1 -1
  506. package/build/common/BaseCard/BaseCard.mjs.map +1 -1
  507. package/build/common/BottomSheet/BottomSheet.js.map +1 -1
  508. package/build/common/BottomSheet/BottomSheet.mjs.map +1 -1
  509. package/build/common/Circle/Circle.js.map +1 -1
  510. package/build/common/Circle/Circle.mjs.map +1 -1
  511. package/build/common/CloseButton/CloseButton.js.map +1 -1
  512. package/build/common/CloseButton/CloseButton.messages.js.map +1 -1
  513. package/build/common/CloseButton/CloseButton.messages.mjs.map +1 -1
  514. package/build/common/CloseButton/CloseButton.mjs.map +1 -1
  515. package/build/common/DOMOperations/DOMOperations.js.map +1 -1
  516. package/build/common/DOMOperations/DOMOperations.mjs.map +1 -1
  517. package/build/common/DateUtils/getDateView/getDateView.js.map +1 -1
  518. package/build/common/DateUtils/getDateView/getDateView.mjs.map +1 -1
  519. package/build/common/DateUtils/getDayNames/getDayNames.js.map +1 -1
  520. package/build/common/DateUtils/getDayNames/getDayNames.mjs.map +1 -1
  521. package/build/common/DateUtils/getFormatForLocale/getFormatForLocale.js.map +1 -1
  522. package/build/common/DateUtils/getFormatForLocale/getFormatForLocale.mjs.map +1 -1
  523. package/build/common/DateUtils/getMonthNames/getMonthNames.js.map +1 -1
  524. package/build/common/DateUtils/getMonthNames/getMonthNames.mjs.map +1 -1
  525. package/build/common/DateUtils/isDateValid/isDateValid.js.map +1 -1
  526. package/build/common/DateUtils/isDateValid/isDateValid.mjs.map +1 -1
  527. package/build/common/DateUtils/isMonthAndYearFormat/isMonthAndYearFormat.js.map +1 -1
  528. package/build/common/DateUtils/isMonthAndYearFormat/isMonthAndYearFormat.mjs.map +1 -1
  529. package/build/common/DateUtils/isWithinRange/isWithinRange.js.map +1 -1
  530. package/build/common/DateUtils/isWithinRange/isWithinRange.mjs.map +1 -1
  531. package/build/common/DateUtils/moveToWithinRange/moveToWithinRange.js.map +1 -1
  532. package/build/common/DateUtils/moveToWithinRange/moveToWithinRange.mjs.map +1 -1
  533. package/build/common/DomHelpers/documentIosClick.js.map +1 -1
  534. package/build/common/DomHelpers/documentIosClick.mjs.map +1 -1
  535. package/build/common/FlowHeader/FlowHeader.js.map +1 -1
  536. package/build/common/FlowHeader/FlowHeader.mjs.map +1 -1
  537. package/build/common/FocusBoundary/FocusBoundary.js.map +1 -1
  538. package/build/common/FocusBoundary/FocusBoundary.mjs.map +1 -1
  539. package/build/common/LiveRegion/LiveRegion.js.map +1 -1
  540. package/build/common/LiveRegion/LiveRegion.mjs.map +1 -1
  541. package/build/common/Locale/index.js.map +1 -1
  542. package/build/common/Locale/index.mjs.map +1 -1
  543. package/build/common/Option/Option.js.map +1 -1
  544. package/build/common/Option/Option.mjs.map +1 -1
  545. package/build/common/Panel/Panel.js.map +1 -1
  546. package/build/common/Panel/Panel.mjs.map +1 -1
  547. package/build/common/Panel/Panel.positionUtils.js.map +1 -1
  548. package/build/common/Panel/Panel.positionUtils.mjs.map +1 -1
  549. package/build/common/PolymorphicWithOverrides/PolymorphicWithOverrides.js.map +1 -1
  550. package/build/common/PolymorphicWithOverrides/PolymorphicWithOverrides.mjs.map +1 -1
  551. package/build/common/PreventScroll/PreventScroll.js.map +1 -1
  552. package/build/common/PreventScroll/PreventScroll.mjs.map +1 -1
  553. package/build/common/PropsValues/control.js.map +1 -1
  554. package/build/common/PropsValues/control.mjs.map +1 -1
  555. package/build/common/PropsValues/dateMode.js.map +1 -1
  556. package/build/common/PropsValues/dateMode.mjs.map +1 -1
  557. package/build/common/PropsValues/layouts.js.map +1 -1
  558. package/build/common/PropsValues/layouts.mjs.map +1 -1
  559. package/build/common/PropsValues/markdownNodeType.js.map +1 -1
  560. package/build/common/PropsValues/markdownNodeType.mjs.map +1 -1
  561. package/build/common/PropsValues/monthFormat.js.map +1 -1
  562. package/build/common/PropsValues/monthFormat.mjs.map +1 -1
  563. package/build/common/PropsValues/position.js.map +1 -1
  564. package/build/common/PropsValues/position.mjs.map +1 -1
  565. package/build/common/PropsValues/profileType.js.map +1 -1
  566. package/build/common/PropsValues/profileType.mjs.map +1 -1
  567. package/build/common/PropsValues/scroll.js.map +1 -1
  568. package/build/common/PropsValues/scroll.mjs.map +1 -1
  569. package/build/common/PropsValues/sentiment.js.map +1 -1
  570. package/build/common/PropsValues/sentiment.mjs.map +1 -1
  571. package/build/common/PropsValues/size.js.map +1 -1
  572. package/build/common/PropsValues/size.mjs.map +1 -1
  573. package/build/common/PropsValues/status.js.map +1 -1
  574. package/build/common/PropsValues/status.mjs.map +1 -1
  575. package/build/common/PropsValues/type.js.map +1 -1
  576. package/build/common/PropsValues/type.mjs.map +1 -1
  577. package/build/common/PropsValues/typography.js.map +1 -1
  578. package/build/common/PropsValues/typography.mjs.map +1 -1
  579. package/build/common/PropsValues/variant.js.map +1 -1
  580. package/build/common/PropsValues/variant.mjs.map +1 -1
  581. package/build/common/PropsValues/width.js.map +1 -1
  582. package/build/common/PropsValues/width.mjs.map +1 -1
  583. package/build/common/RadioButton/RadioButton.js.map +1 -1
  584. package/build/common/RadioButton/RadioButton.mjs.map +1 -1
  585. package/build/common/ResponsivePanel/ResponsivePanel.js.map +1 -1
  586. package/build/common/ResponsivePanel/ResponsivePanel.mjs.map +1 -1
  587. package/build/common/TextFormat/formatWithPattern/formatWithPattern.js.map +1 -1
  588. package/build/common/TextFormat/formatWithPattern/formatWithPattern.mjs.map +1 -1
  589. package/build/common/TextFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.js.map +1 -1
  590. package/build/common/TextFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.mjs.map +1 -1
  591. package/build/common/TextFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js.map +1 -1
  592. package/build/common/TextFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.mjs.map +1 -1
  593. package/build/common/TextFormat/getDistanceToSymbol/getDistanceToSymbol.js.map +1 -1
  594. package/build/common/TextFormat/getDistanceToSymbol/getDistanceToSymbol.mjs.map +1 -1
  595. package/build/common/TextFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js.map +1 -1
  596. package/build/common/TextFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.mjs.map +1 -1
  597. package/build/common/TextFormat/unformatWithPattern/unformatWithPattern.js.map +1 -1
  598. package/build/common/TextFormat/unformatWithPattern/unformatWithPattern.mjs.map +1 -1
  599. package/build/common/colors.js.map +1 -1
  600. package/build/common/colors.mjs.map +1 -1
  601. package/build/common/constants.js.map +1 -1
  602. package/build/common/constants.mjs.map +1 -1
  603. package/build/common/deviceDetection/deviceDetection.js.map +1 -1
  604. package/build/common/deviceDetection/deviceDetection.mjs.map +1 -1
  605. package/build/common/direction.js.map +1 -1
  606. package/build/common/direction.mjs.map +1 -1
  607. package/build/common/fileType.js.map +1 -1
  608. package/build/common/fileType.mjs.map +1 -1
  609. package/build/common/historyNavigator/historyNavigator.js.map +1 -1
  610. package/build/common/historyNavigator/historyNavigator.mjs.map +1 -1
  611. package/build/common/hooks/useConditionalListener/useConditionalListener.js.map +1 -1
  612. package/build/common/hooks/useConditionalListener/useConditionalListener.mjs.map +1 -1
  613. package/build/common/hooks/useContainerSize.js.map +1 -1
  614. package/build/common/hooks/useContainerSize.mjs.map +1 -1
  615. package/build/common/hooks/useDirection/useDirection.js.map +1 -1
  616. package/build/common/hooks/useDirection/useDirection.mjs.map +1 -1
  617. package/build/common/hooks/useEffectEvent.js.map +1 -1
  618. package/build/common/hooks/useEffectEvent.mjs.map +1 -1
  619. package/build/common/hooks/useHasIntersected/useHasIntersected.js.map +1 -1
  620. package/build/common/hooks/useHasIntersected/useHasIntersected.mjs.map +1 -1
  621. package/build/common/hooks/useLayout/useLayout.js.map +1 -1
  622. package/build/common/hooks/useLayout/useLayout.mjs.map +1 -1
  623. package/build/common/hooks/useMedia.js.map +1 -1
  624. package/build/common/hooks/useMedia.mjs.map +1 -1
  625. package/build/common/hooks/useResizeObserver.js.map +1 -1
  626. package/build/common/hooks/useResizeObserver.mjs.map +1 -1
  627. package/build/common/hooks/useScreenSize.js.map +1 -1
  628. package/build/common/hooks/useScreenSize.mjs.map +1 -1
  629. package/build/common/hooks/useVirtualKeyboard.js.map +1 -1
  630. package/build/common/hooks/useVirtualKeyboard.mjs.map +1 -1
  631. package/build/common/initials.js.map +1 -1
  632. package/build/common/initials.mjs.map +1 -1
  633. package/build/common/injectIntl.js.map +1 -1
  634. package/build/common/injectIntl.mjs.map +1 -1
  635. package/build/common/theme.js.map +1 -1
  636. package/build/common/theme.mjs.map +1 -1
  637. package/build/i18n/commonMessages/Button.messages.js.map +1 -1
  638. package/build/i18n/commonMessages/Button.messages.mjs.map +1 -1
  639. package/build/i18n/cs.json.js.map +1 -1
  640. package/build/i18n/cs.json.mjs.map +1 -1
  641. package/build/i18n/de.json.js.map +1 -1
  642. package/build/i18n/de.json.mjs.map +1 -1
  643. package/build/i18n/en.json.js.map +1 -1
  644. package/build/i18n/en.json.mjs.map +1 -1
  645. package/build/i18n/es.json.js.map +1 -1
  646. package/build/i18n/es.json.mjs.map +1 -1
  647. package/build/i18n/fr.json.js.map +1 -1
  648. package/build/i18n/fr.json.mjs.map +1 -1
  649. package/build/i18n/hu.json.js.map +1 -1
  650. package/build/i18n/hu.json.mjs.map +1 -1
  651. package/build/i18n/id.json.js.map +1 -1
  652. package/build/i18n/id.json.mjs.map +1 -1
  653. package/build/i18n/index.js.map +1 -1
  654. package/build/i18n/index.mjs.map +1 -1
  655. package/build/i18n/it.json.js.map +1 -1
  656. package/build/i18n/it.json.mjs.map +1 -1
  657. package/build/i18n/ja.json.js.map +1 -1
  658. package/build/i18n/ja.json.mjs.map +1 -1
  659. package/build/i18n/nl.json.js.map +1 -1
  660. package/build/i18n/nl.json.mjs.map +1 -1
  661. package/build/i18n/pl.json.js.map +1 -1
  662. package/build/i18n/pl.json.mjs.map +1 -1
  663. package/build/i18n/pt.json.js.map +1 -1
  664. package/build/i18n/pt.json.mjs.map +1 -1
  665. package/build/i18n/ro.json.js.map +1 -1
  666. package/build/i18n/ro.json.mjs.map +1 -1
  667. package/build/i18n/ru.json.js.map +1 -1
  668. package/build/i18n/ru.json.mjs.map +1 -1
  669. package/build/i18n/th.json.js.map +1 -1
  670. package/build/i18n/th.json.mjs.map +1 -1
  671. package/build/i18n/tr.json.js.map +1 -1
  672. package/build/i18n/tr.json.mjs.map +1 -1
  673. package/build/i18n/uk.json.js.map +1 -1
  674. package/build/i18n/uk.json.mjs.map +1 -1
  675. package/build/i18n/zh-CN.json.js.map +1 -1
  676. package/build/i18n/zh-CN.json.mjs.map +1 -1
  677. package/build/i18n/zh-HK.json.js.map +1 -1
  678. package/build/i18n/zh-HK.json.mjs.map +1 -1
  679. package/build/main.css +6 -38
  680. package/build/mocks.js.map +1 -1
  681. package/build/mocks.mjs.map +1 -1
  682. package/build/styles/FlowNavigation/FlowNavigation.css +5 -6
  683. package/build/styles/css/neptune-core.css +1 -32
  684. package/build/styles/css/neptune.css +1 -32
  685. package/build/styles/main.css +6 -38
  686. package/build/styles/styles/less/neptune-core.css +1 -32
  687. package/build/styles/styles/less/neptune.css +1 -32
  688. package/build/utilities/cssValueWithUnit.js.map +1 -1
  689. package/build/utilities/cssValueWithUnit.mjs.map +1 -1
  690. package/build/utilities/logActionRequired.js.map +1 -1
  691. package/build/utilities/logActionRequired.mjs.map +1 -1
  692. package/package.json +14 -14
  693. package/src/FlowNavigation/FlowNavigation.css +5 -6
  694. package/src/FlowNavigation/FlowNavigation.less +7 -8
  695. package/src/main.css +6 -38
  696. package/src/styles/less/core/_fonts.less +9 -29
  697. package/src/styles/less/core/_scaffolding.less +1 -12
  698. package/src/styles/less/neptune-core.css +1 -32
  699. package/src/styles/less/neptune.css +1 -32
  700. package/build/styles/fonts/TW-Averta-Bold.woff +0 -0
  701. package/build/styles/fonts/TW-Averta-Bold.woff2 +0 -0
  702. package/build/styles/fonts/TW-Averta-Regular.woff +0 -0
  703. package/build/styles/fonts/TW-Averta-Regular.woff2 +0 -0
  704. package/build/styles/fonts/TW-Averta-Semibold.woff +0 -0
  705. package/build/styles/fonts/TW-Averta-Semibold.woff2 +0 -0
  706. package/build/styles/fonts/TransferWise-IconFont.svg +0 -81
  707. package/build/styles/fonts/TransferWise-IconFont.woff +0 -0
  708. package/src/styles/fonts/TW-Averta-Bold.woff +0 -0
  709. package/src/styles/fonts/TW-Averta-Bold.woff2 +0 -0
  710. package/src/styles/fonts/TW-Averta-Regular.woff +0 -0
  711. package/src/styles/fonts/TW-Averta-Regular.woff2 +0 -0
  712. package/src/styles/fonts/TW-Averta-Semibold.woff +0 -0
  713. package/src/styles/fonts/TW-Averta-Semibold.woff2 +0 -0
  714. package/src/styles/fonts/TransferWise-IconFont.svg +0 -81
  715. package/src/styles/fonts/TransferWise-IconFont.woff +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ExpressiveMoneyInput.js","sources":["../../src/ExpressiveMoneyInput/ExpressiveMoneyInput.tsx"],"sourcesContent":["import Body from '../Body';\nimport { clsx } from 'clsx';\nimport { AnimatePresence, motion } from 'motion/react';\nimport { useId, type ReactNode } from 'react';\n\nimport { CurrencySelector, type CurrencySelectorProps } from './CurrencySelector/CurrencySelector';\nimport { CommonProps } from '../common';\nimport { AmountInput } from './AmountInput/AmountInput';\nimport { Chevron } from './Chevron/Chevron';\nimport { InlinePrompt, type InlinePromptProps } from '../Prompt/InlinePrompt';\nimport Label from '../Label';\n\ntype AmountType = number | null;\nexport type CurrencyType = string;\n\ntype DefaultCurrencySelectorInstanceType = Pick<\n CurrencySelectorProps,\n 'addons' | 'options' | 'onChange' | 'onOpen' | 'onSearchChange'\n>;\ntype CustomCurrencySelectorInstanceType = {\n customRender?: (props: { id: string; labelId: string }) => ReactNode;\n};\ntype CurrencySelectorType = DefaultCurrencySelectorInstanceType &\n CustomCurrencySelectorInstanceType;\n\nexport type ExpressiveMoneyInputProps = {\n label?: ReactNode;\n currencySelector?: CurrencySelectorType;\n amount?: AmountType;\n /**\n * The currency code, e.g. `USD`, `EUR`, `GBP`, etc. Governs the flag rendered in the currency selector.\n */\n currency: CurrencyType;\n inlinePrompt?: {\n sentiment?: InlinePromptProps['sentiment'];\n message: InlinePromptProps['children'];\n media?: InlinePromptProps['media'];\n };\n showChevron?: boolean;\n /**\n * If set, it auto-focuses the amount input upon component mount.<br />\n * ⚠️ **Use with caution**, as it may impact user experience and\n * fail [WCAG 2.4.3 requirements](https://www.w3.org/WAI/WCAG21/Understanding/focus-order.html)\n */\n autoFocus?: boolean;\n /**\n * Dims the input to indicate a loading state. Does not disable it.\n */\n loading?: boolean;\n onAmountChange: (amount: AmountType) => void;\n onFocusChange?: (focused: boolean) => void;\n} & CommonProps;\n\n/**\n * This component has been kindly contributed by our friends at the `Send` team 🎉.\n *\n * Some patterns and implementation details used in this component may differ\n * from what's commonly used in the Design System. The overall build and QA was managed\n * by the contributing team directly, and such did not follow a typical DS lifecycle.\n *\n * While we house this component and will help facilitate its future iterations,\n * direct contributions by consuming product teams are highly encouraged.\n *\n * > ⚠️ **Prerequisite:** <br />The component depends on the\n * [motion](https://www.npmjs.com/package/motion) package, which has been\n * deliberately excluded from the Design System bundle and kept as an opt-in only.\n * **Make sure to add it to your project dependencies.**\n */\nexport default function ExpressiveMoneyInput({\n label,\n currency,\n currencySelector = { options: [] },\n amount,\n onAmountChange,\n className,\n inlinePrompt,\n showChevron,\n autoFocus,\n loading,\n onFocusChange,\n}: ExpressiveMoneyInputProps) {\n const inputId = useId();\n const labelId = useId();\n const customAlertId = useId();\n const currencyId = useId();\n\n return (\n <div className={clsx('wds-expressive-money-input', className)}>\n <Label id={labelId} htmlFor={inputId} className={clsx('m-b-1', 'font-weight-normal')}>\n {label}\n </Label>\n <div\n className={clsx('d-flex')}\n role=\"group\"\n aria-labelledby={labelId}\n {...(inlinePrompt ? { 'aria-describedby': customAlertId } : {})}\n >\n <div className=\"wds-expressive-money-input-currency-selector\">\n {currencySelector.customRender?.({ id: currencyId, labelId }) ?? (\n <CurrencySelector\n id={currencyId}\n labelId={labelId}\n currency={currency}\n {...currencySelector}\n />\n )}\n </div>\n <AmountInput\n id={inputId}\n describedById={currencyId}\n amount={amount}\n currency={currency}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n loading={loading}\n onChange={onAmountChange}\n onFocusChange={onFocusChange}\n />\n <div className={clsx('d-flex align-items-center', 'wds-expressive-money-input-chevron')}>\n <Chevron shouldShow={Boolean(showChevron)} />\n </div>\n </div>\n <AnimatePresence initial={false}>\n {inlinePrompt && (\n <div className={clsx('d-flex justify-content-end', inlinePrompt && 'm-t-1')}>\n <motion.div\n key={customAlertId}\n initial={{ opacity: 0, height: 0 }}\n animate={{\n opacity: 1,\n height: 'auto',\n transition: { delay: 0.75, duration: 0.3 },\n }}\n exit={{ opacity: 0, height: 0 }}\n >\n {inlinePrompt.sentiment && Object.keys(inlinePrompt.sentiment).length > 0 ? (\n <InlinePrompt\n id={customAlertId}\n media={inlinePrompt.media}\n sentiment={inlinePrompt.sentiment}\n >\n {inlinePrompt.message}\n </InlinePrompt>\n ) : (\n <Body>{inlinePrompt.message}</Body>\n )}\n </motion.div>\n </div>\n )}\n </AnimatePresence>\n </div>\n );\n}\n"],"names":["ExpressiveMoneyInput","label","currency","currencySelector","options","amount","onAmountChange","className","inlinePrompt","showChevron","autoFocus","loading","onFocusChange","inputId","useId","labelId","customAlertId","currencyId","_jsxs","clsx","children","_jsx","Label","id","htmlFor","role","customRender","CurrencySelector","AmountInput","describedById","onChange","Chevron","shouldShow","Boolean","AnimatePresence","initial","motion","div","opacity","height","animate","transition","delay","duration","exit","sentiment","Object","keys","length","InlinePrompt","media","message","Body"],"mappings":";;;;;;;;;;;;;;;AAoEc,SAAUA,oBAAoBA,CAAC;EAC3CC,KAAK;EACLC,QAAQ;AACRC,EAAAA,gBAAgB,GAAG;AAAEC,IAAAA,OAAO,EAAE;GAAI;EAClCC,MAAM;EACNC,cAAc;EACdC,SAAS;EACTC,YAAY;EACZC,WAAW;EACXC,SAAS;EACTC,OAAO;AACPC,EAAAA;AAAa,CACa,EAAA;AAC1B,EAAA,MAAMC,OAAO,GAAGC,WAAK,EAAE;AACvB,EAAA,MAAMC,OAAO,GAAGD,WAAK,EAAE;AACvB,EAAA,MAAME,aAAa,GAAGF,WAAK,EAAE;AAC7B,EAAA,MAAMG,UAAU,GAAGH,WAAK,EAAE;AAE1B,EAAA,oBACEI,eAAA,CAAA,KAAA,EAAA;AAAKX,IAAAA,SAAS,EAAEY,SAAI,CAAC,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AAA,EAnBInC,aAoBK;OACT;AACN,KACc,CACnB;AAAA,GAAK,CAAC;AAEV;;;;"}
1
+ {"version":3,"file":"ExpressiveMoneyInput.js","sources":["../../src/ExpressiveMoneyInput/ExpressiveMoneyInput.tsx"],"sourcesContent":["import Body from '../Body';\nimport { clsx } from 'clsx';\nimport { AnimatePresence, motion } from 'motion/react';\nimport { useId, type ReactNode } from 'react';\n\nimport { CurrencySelector, type CurrencySelectorProps } from './CurrencySelector/CurrencySelector';\nimport { CommonProps } from '../common';\nimport { AmountInput } from './AmountInput/AmountInput';\nimport { Chevron } from './Chevron/Chevron';\nimport { InlinePrompt, type InlinePromptProps } from '../Prompt/InlinePrompt';\nimport Label from '../Label';\n\ntype AmountType = number | null;\nexport type CurrencyType = string;\n\ntype DefaultCurrencySelectorInstanceType = Pick<\n CurrencySelectorProps,\n 'addons' | 'options' | 'onChange' | 'onOpen' | 'onSearchChange'\n>;\ntype CustomCurrencySelectorInstanceType = {\n customRender?: (props: { id: string; labelId: string }) => ReactNode;\n};\ntype CurrencySelectorType = DefaultCurrencySelectorInstanceType &\n CustomCurrencySelectorInstanceType;\n\nexport type ExpressiveMoneyInputProps = {\n label?: ReactNode;\n currencySelector?: CurrencySelectorType;\n amount?: AmountType;\n /**\n * The currency code, e.g. `USD`, `EUR`, `GBP`, etc. Governs the flag rendered in the currency selector.\n */\n currency: CurrencyType;\n inlinePrompt?: {\n sentiment?: InlinePromptProps['sentiment'];\n message: InlinePromptProps['children'];\n media?: InlinePromptProps['media'];\n };\n showChevron?: boolean;\n /**\n * If set, it auto-focuses the amount input upon component mount.<br />\n * ⚠️ **Use with caution**, as it may impact user experience and\n * fail [WCAG 2.4.3 requirements](https://www.w3.org/WAI/WCAG21/Understanding/focus-order.html)\n */\n autoFocus?: boolean;\n /**\n * Dims the input to indicate a loading state. Does not disable it.\n */\n loading?: boolean;\n onAmountChange: (amount: AmountType) => void;\n onFocusChange?: (focused: boolean) => void;\n} & CommonProps;\n\n/**\n * This component has been kindly contributed by our friends at the `Send` team 🎉.\n *\n * Some patterns and implementation details used in this component may differ\n * from what's commonly used in the Design System. The overall build and QA was managed\n * by the contributing team directly, and such did not follow a typical DS lifecycle.\n *\n * While we house this component and will help facilitate its future iterations,\n * direct contributions by consuming product teams are highly encouraged.\n *\n * > ⚠️ **Prerequisite:** <br />The component depends on the\n * [motion](https://www.npmjs.com/package/motion) package, which has been\n * deliberately excluded from the Design System bundle and kept as an opt-in only.\n * **Make sure to add it to your project dependencies.**\n */\nexport default function ExpressiveMoneyInput({\n label,\n currency,\n currencySelector = { options: [] },\n amount,\n onAmountChange,\n className,\n inlinePrompt,\n showChevron,\n autoFocus,\n loading,\n onFocusChange,\n}: ExpressiveMoneyInputProps) {\n const inputId = useId();\n const labelId = useId();\n const customAlertId = useId();\n const currencyId = useId();\n\n return (\n <div className={clsx('wds-expressive-money-input', className)}>\n <Label id={labelId} htmlFor={inputId} className={clsx('m-b-1', 'font-weight-normal')}>\n {label}\n </Label>\n <div\n className={clsx('d-flex')}\n role=\"group\"\n aria-labelledby={labelId}\n {...(inlinePrompt ? { 'aria-describedby': customAlertId } : {})}\n >\n <div className=\"wds-expressive-money-input-currency-selector\">\n {currencySelector.customRender?.({ id: currencyId, labelId }) ?? (\n <CurrencySelector\n id={currencyId}\n labelId={labelId}\n currency={currency}\n {...currencySelector}\n />\n )}\n </div>\n <AmountInput\n id={inputId}\n describedById={currencyId}\n amount={amount}\n currency={currency}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n loading={loading}\n onChange={onAmountChange}\n onFocusChange={onFocusChange}\n />\n <div className={clsx('d-flex align-items-center', 'wds-expressive-money-input-chevron')}>\n <Chevron shouldShow={Boolean(showChevron)} />\n </div>\n </div>\n <AnimatePresence initial={false}>\n {inlinePrompt && (\n <div className={clsx('d-flex justify-content-end', inlinePrompt && 'm-t-1')}>\n <motion.div\n key={customAlertId}\n initial={{ opacity: 0, height: 0 }}\n animate={{\n opacity: 1,\n height: 'auto',\n transition: { delay: 0.75, duration: 0.3 },\n }}\n exit={{ opacity: 0, height: 0 }}\n >\n {inlinePrompt.sentiment && Object.keys(inlinePrompt.sentiment).length > 0 ? (\n <InlinePrompt\n id={customAlertId}\n media={inlinePrompt.media}\n sentiment={inlinePrompt.sentiment}\n >\n {inlinePrompt.message}\n </InlinePrompt>\n ) : (\n <Body>{inlinePrompt.message}</Body>\n )}\n </motion.div>\n </div>\n )}\n </AnimatePresence>\n </div>\n );\n}\n"],"names":["ExpressiveMoneyInput","label","currency","currencySelector","options","amount","onAmountChange","className","inlinePrompt","showChevron","autoFocus","loading","onFocusChange","inputId","useId","labelId","customAlertId","currencyId","_jsxs","clsx","children","_jsx","Label","id","htmlFor","role","customRender","CurrencySelector","AmountInput","describedById","onChange","Chevron","shouldShow","Boolean","AnimatePresence","initial","motion","div","opacity","height","animate","transition","delay","duration","exit","sentiment","Object","keys","length","InlinePrompt","media","message","Body"],"mappings":";;;;;;;;;;;;;;;AAoEc,SAAUA,oBAAoBA,CAAC;EAC3CC,KAAK;EACLC,QAAQ;AACRC,EAAAA,gBAAgB,GAAG;AAAEC,IAAAA,OAAO,EAAE;GAAI;EAClCC,MAAM;EACNC,cAAc;EACdC,SAAS;EACTC,YAAY;EACZC,WAAW;EACXC,SAAS;EACTC,OAAO;AACPC,EAAAA;AAAa,CACa,EAAA;AAC1B,EAAA,MAAMC,OAAO,GAAGC,WAAK,EAAE;AACvB,EAAA,MAAMC,OAAO,GAAGD,WAAK,EAAE;AACvB,EAAA,MAAME,aAAa,GAAGF,WAAK,EAAE;AAC7B,EAAA,MAAMG,UAAU,GAAGH,WAAK,EAAE;AAE1B,EAAA,oBACEI,eAAA,CAAA,KAAA,EAAA;AAAKX,IAAAA,SAAS,EAAEY,SAAI,CAAC,4BAA4B,EAAEZ,SAAS,CAAE;IAAAa,QAAA,EAAA,cAC5DC,cAAA,CAACC,aAAK,EAAA;AAACC,MAAAA,EAAE,EAAER,OAAQ;AAACS,MAAAA,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../../src/ExpressiveMoneyInput/ExpressiveMoneyInput.messages.ts"],"sourcesContent":["import { defineMessages } from 'react-intl';\n\nexport default defineMessages({\n currencySelectorSearchPlaceholder: {\n id: 'neptune.ExpressiveMoneyInput.currency.search.placeholder',\n defaultMessage: 'Type a currency / country',\n },\n\n currencySelectorSelectCurrency: {\n id: 'neptune.ExpressiveMoneyInput.currency.select.currency',\n defaultMessage: 'Select currency',\n },\n});\n"],"names":["defineMessages","currencySelectorSearchPlaceholder","id","currencySelectorSelectCurrency"],"mappings":";;;;;;AAEA,eAAeA,wBAAc,CAAC;AAC5BC,EAAAA,iCAAiC,EAAE;IACjCC,EAAE,EAAA;GAEH;AAEDC,EAAAA,8BAA8B,EAAE;IAC9BD,EAAE,EAAA;AAEH;AACF,CAAA,CAAC;;;;"}
1
+ {"version":3,"file":"ExpressiveMoneyInput.messages.js","sources":["../../src/ExpressiveMoneyInput/ExpressiveMoneyInput.messages.ts"],"sourcesContent":["import { defineMessages } from 'react-intl';\n\nexport default defineMessages({\n currencySelectorSearchPlaceholder: {\n id: 'neptune.ExpressiveMoneyInput.currency.search.placeholder',\n defaultMessage: 'Type a currency / country',\n },\n\n currencySelectorSelectCurrency: {\n id: 'neptune.ExpressiveMoneyInput.currency.select.currency',\n defaultMessage: 'Select currency',\n },\n});\n"],"names":["defineMessages","currencySelectorSearchPlaceholder","id","currencySelectorSelectCurrency"],"mappings":";;;;;;AAEA,eAAeA,wBAAc,CAAC;AAC5BC,EAAAA,iCAAiC,EAAE;IACjCC,EAAE,EAAA;GAEH;AAEDC,EAAAA,8BAA8B,EAAE;IAC9BD,EAAE,EAAA;AAEH;AACF,CAAA,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExpressiveMoneyInput.messages.mjs","sources":["../../src/ExpressiveMoneyInput/ExpressiveMoneyInput.messages.ts"],"sourcesContent":["import { defineMessages } from 'react-intl';\n\nexport default defineMessages({\n currencySelectorSearchPlaceholder: {\n id: 'neptune.ExpressiveMoneyInput.currency.search.placeholder',\n defaultMessage: 'Type a currency / country',\n },\n\n currencySelectorSelectCurrency: {\n id: 'neptune.ExpressiveMoneyInput.currency.select.currency',\n defaultMessage: 'Select currency',\n },\n});\n"],"names":["defineMessages","currencySelectorSearchPlaceholder","id","currencySelectorSelectCurrency"],"mappings":";;AAEA,eAAeA,cAAc,CAAC;AAC5BC,EAAAA,iCAAiC,EAAE;IACjCC,EAAE,EAAA;GAEH;AAEDC,EAAAA,8BAA8B,EAAE;IAC9BD,EAAE,EAAA;AAEH;AACF,CAAA,CAAC;;;;"}
1
+ {"version":3,"file":"ExpressiveMoneyInput.messages.mjs","sources":["../../src/ExpressiveMoneyInput/ExpressiveMoneyInput.messages.ts"],"sourcesContent":["import { defineMessages } from 'react-intl';\n\nexport default defineMessages({\n currencySelectorSearchPlaceholder: {\n id: 'neptune.ExpressiveMoneyInput.currency.search.placeholder',\n defaultMessage: 'Type a currency / country',\n },\n\n currencySelectorSelectCurrency: {\n id: 'neptune.ExpressiveMoneyInput.currency.select.currency',\n defaultMessage: 'Select currency',\n },\n});\n"],"names":["defineMessages","currencySelectorSearchPlaceholder","id","currencySelectorSelectCurrency"],"mappings":";;AAEA,eAAeA,cAAc,CAAC;AAC5BC,EAAAA,iCAAiC,EAAE;IACjCC,EAAE,EAAA;GAEH;AAEDC,EAAAA,8BAA8B,EAAE;IAC9BD,EAAE,EAAA;AAEH;AACF,CAAA,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExpressiveMoneyInput.mjs","sources":["../../src/ExpressiveMoneyInput/ExpressiveMoneyInput.tsx"],"sourcesContent":["import Body from '../Body';\nimport { clsx } from 'clsx';\nimport { AnimatePresence, motion } from 'motion/react';\nimport { useId, type ReactNode } from 'react';\n\nimport { CurrencySelector, type CurrencySelectorProps } from './CurrencySelector/CurrencySelector';\nimport { CommonProps } from '../common';\nimport { AmountInput } from './AmountInput/AmountInput';\nimport { Chevron } from './Chevron/Chevron';\nimport { InlinePrompt, type InlinePromptProps } from '../Prompt/InlinePrompt';\nimport Label from '../Label';\n\ntype AmountType = number | null;\nexport type CurrencyType = string;\n\ntype DefaultCurrencySelectorInstanceType = Pick<\n CurrencySelectorProps,\n 'addons' | 'options' | 'onChange' | 'onOpen' | 'onSearchChange'\n>;\ntype CustomCurrencySelectorInstanceType = {\n customRender?: (props: { id: string; labelId: string }) => ReactNode;\n};\ntype CurrencySelectorType = DefaultCurrencySelectorInstanceType &\n CustomCurrencySelectorInstanceType;\n\nexport type ExpressiveMoneyInputProps = {\n label?: ReactNode;\n currencySelector?: CurrencySelectorType;\n amount?: AmountType;\n /**\n * The currency code, e.g. `USD`, `EUR`, `GBP`, etc. Governs the flag rendered in the currency selector.\n */\n currency: CurrencyType;\n inlinePrompt?: {\n sentiment?: InlinePromptProps['sentiment'];\n message: InlinePromptProps['children'];\n media?: InlinePromptProps['media'];\n };\n showChevron?: boolean;\n /**\n * If set, it auto-focuses the amount input upon component mount.<br />\n * ⚠️ **Use with caution**, as it may impact user experience and\n * fail [WCAG 2.4.3 requirements](https://www.w3.org/WAI/WCAG21/Understanding/focus-order.html)\n */\n autoFocus?: boolean;\n /**\n * Dims the input to indicate a loading state. Does not disable it.\n */\n loading?: boolean;\n onAmountChange: (amount: AmountType) => void;\n onFocusChange?: (focused: boolean) => void;\n} & CommonProps;\n\n/**\n * This component has been kindly contributed by our friends at the `Send` team 🎉.\n *\n * Some patterns and implementation details used in this component may differ\n * from what's commonly used in the Design System. The overall build and QA was managed\n * by the contributing team directly, and such did not follow a typical DS lifecycle.\n *\n * While we house this component and will help facilitate its future iterations,\n * direct contributions by consuming product teams are highly encouraged.\n *\n * > ⚠️ **Prerequisite:** <br />The component depends on the\n * [motion](https://www.npmjs.com/package/motion) package, which has been\n * deliberately excluded from the Design System bundle and kept as an opt-in only.\n * **Make sure to add it to your project dependencies.**\n */\nexport default function ExpressiveMoneyInput({\n label,\n currency,\n currencySelector = { options: [] },\n amount,\n onAmountChange,\n className,\n inlinePrompt,\n showChevron,\n autoFocus,\n loading,\n onFocusChange,\n}: ExpressiveMoneyInputProps) {\n const inputId = useId();\n const labelId = useId();\n const customAlertId = useId();\n const currencyId = useId();\n\n return (\n <div className={clsx('wds-expressive-money-input', className)}>\n <Label id={labelId} htmlFor={inputId} className={clsx('m-b-1', 'font-weight-normal')}>\n {label}\n </Label>\n <div\n className={clsx('d-flex')}\n role=\"group\"\n aria-labelledby={labelId}\n {...(inlinePrompt ? { 'aria-describedby': customAlertId } : {})}\n >\n <div className=\"wds-expressive-money-input-currency-selector\">\n {currencySelector.customRender?.({ id: currencyId, labelId }) ?? (\n <CurrencySelector\n id={currencyId}\n labelId={labelId}\n currency={currency}\n {...currencySelector}\n />\n )}\n </div>\n <AmountInput\n id={inputId}\n describedById={currencyId}\n amount={amount}\n currency={currency}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n loading={loading}\n onChange={onAmountChange}\n onFocusChange={onFocusChange}\n />\n <div className={clsx('d-flex align-items-center', 'wds-expressive-money-input-chevron')}>\n <Chevron shouldShow={Boolean(showChevron)} />\n </div>\n </div>\n <AnimatePresence initial={false}>\n {inlinePrompt && (\n <div className={clsx('d-flex justify-content-end', inlinePrompt && 'm-t-1')}>\n <motion.div\n key={customAlertId}\n initial={{ opacity: 0, height: 0 }}\n animate={{\n opacity: 1,\n height: 'auto',\n transition: { delay: 0.75, duration: 0.3 },\n }}\n exit={{ opacity: 0, height: 0 }}\n >\n {inlinePrompt.sentiment && Object.keys(inlinePrompt.sentiment).length > 0 ? (\n <InlinePrompt\n id={customAlertId}\n media={inlinePrompt.media}\n sentiment={inlinePrompt.sentiment}\n >\n {inlinePrompt.message}\n </InlinePrompt>\n ) : (\n <Body>{inlinePrompt.message}</Body>\n )}\n </motion.div>\n </div>\n )}\n </AnimatePresence>\n </div>\n );\n}\n"],"names":["ExpressiveMoneyInput","label","currency","currencySelector","options","amount","onAmountChange","className","inlinePrompt","showChevron","autoFocus","loading","onFocusChange","inputId","useId","labelId","customAlertId","currencyId","_jsxs","clsx","children","_jsx","Label","id","htmlFor","role","customRender","CurrencySelector","AmountInput","describedById","onChange","Chevron","shouldShow","Boolean","AnimatePresence","initial","motion","div","opacity","height","animate","transition","delay","duration","exit","sentiment","Object","keys","length","InlinePrompt","media","message","Body"],"mappings":";;;;;;;;;;;AAoEc,SAAUA,oBAAoBA,CAAC;EAC3CC,KAAK;EACLC,QAAQ;AACRC,EAAAA,gBAAgB,GAAG;AAAEC,IAAAA,OAAO,EAAE;GAAI;EAClCC,MAAM;EACNC,cAAc;EACdC,SAAS;EACTC,YAAY;EACZC,WAAW;EACXC,SAAS;EACTC,OAAO;AACPC,EAAAA;AAAa,CACa,EAAA;AAC1B,EAAA,MAAMC,OAAO,GAAGC,KAAK,EAAE;AACvB,EAAA,MAAMC,OAAO,GAAGD,KAAK,EAAE;AACvB,EAAA,MAAME,aAAa,GAAGF,KAAK,EAAE;AAC7B,EAAA,MAAMG,UAAU,GAAGH,KAAK,EAAE;AAE1B,EAAA,oBACEI,IAAA,CAAA,KAAA,EAAA;AAAKX,IAAAA,SAAS,EAAEY,IAAI,CAAC,4BAA4B,EAAEZ,SAAS,CAAE;IAAAa,QAAA,EAAA,cAC5DC,GAAA,CAACC,cAAK,EAAA;AAACC,MAAAA,EAAE,EAAER,OAAQ;AAACS,MAAAA,OAAO,EAAEX,OAAQ;AAACN,MAAAA,SAAS,EAAEY,IAAI,CAAC,OAAO,EAAE,oBAAoB,CAAE;AAAAC,MAAAA,QAAA,EAClFnB;KACI,CACP,eAAAiB,IAAA,CAAA,KAAA,EAAA;AACEX,MAAAA,SAAS,EAAEY,IAAI,CAAC,QAAQ,CAAE;AAC1BM,MAAAA,IAAI,EAAC,OAAO;AACZ,MAAA,iBAAA,EAAiBV,OAAQ;AAAA,MAAA,IACpBP,YAAY,GAAG;AAAE,QAAA,kBAAkB,EAAEQ;OAAe,GAAG,EAAE,CAAA;AAAAI,MAAAA,QAAA,gBAE9DC,GAAA,CAAA,KAA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nCC,UAAAA,OAAO,EAAE;AACPF,YAAAA,OAAO,EAAE,CAAC;AACVC,YAAAA,MAAM,EAAE,MAAM;AACdE,YAAAA,UAAU,EAAE;AAAEC,cAAAA,KAAK,EAAE,IAAI;AAAEC,cAAAA,QAAQ,EAAE;AAAG;WACxC;AACFC,UAAAA,IAAI,EAAE;AAAEN,YAAAA,OAAO,EAAE,CAAC;AAAEC,YAAAA,MAAM,EAAE;WAAI;UAAAnB,QAAA,EAE/BZ,YAAY,CAACqC,SAAS,IAAIC,MAAM,CAACC,IAAI,CAACvC,YAAY,CAACqC,SAAS,CAAC,CAACG,MAAM,GAAG,CAAC,gBACvE3B,GAAA,CAAC4B,YAAY,EAAA;AACX1B,YAAAA,EAAE,EAAEP,aAAc;YAClBkC,KAAK,EAAE1C,YAAY,CAAC0C,KAAM;YAC1BL,SAAS,EAAErC,YAAY,CAACqC,SAAU;YAAAzB,QAAA,EAEjCZ,YAAY,CAAC2C;AAAO,WACT,CAAC,gBAEf9B,GAAA,CAAC+B,IAAI,EAAA;YAAAhC,QAAA,EAAEZ,YAAY,CAAC2C;WAAc;AACnC,SAAA,EAnBInC,aAoBK;OACT;AACN,KACc,CACnB;AAAA,GAAK,CAAC;AAEV;;;;"}
1
+ {"version":3,"file":"ExpressiveMoneyInput.mjs","sources":["../../src/ExpressiveMoneyInput/ExpressiveMoneyInput.tsx"],"sourcesContent":["import Body from '../Body';\nimport { clsx } from 'clsx';\nimport { AnimatePresence, motion } from 'motion/react';\nimport { useId, type ReactNode } from 'react';\n\nimport { CurrencySelector, type CurrencySelectorProps } from './CurrencySelector/CurrencySelector';\nimport { CommonProps } from '../common';\nimport { AmountInput } from './AmountInput/AmountInput';\nimport { Chevron } from './Chevron/Chevron';\nimport { InlinePrompt, type InlinePromptProps } from '../Prompt/InlinePrompt';\nimport Label from '../Label';\n\ntype AmountType = number | null;\nexport type CurrencyType = string;\n\ntype DefaultCurrencySelectorInstanceType = Pick<\n CurrencySelectorProps,\n 'addons' | 'options' | 'onChange' | 'onOpen' | 'onSearchChange'\n>;\ntype CustomCurrencySelectorInstanceType = {\n customRender?: (props: { id: string; labelId: string }) => ReactNode;\n};\ntype CurrencySelectorType = DefaultCurrencySelectorInstanceType &\n CustomCurrencySelectorInstanceType;\n\nexport type ExpressiveMoneyInputProps = {\n label?: ReactNode;\n currencySelector?: CurrencySelectorType;\n amount?: AmountType;\n /**\n * The currency code, e.g. `USD`, `EUR`, `GBP`, etc. Governs the flag rendered in the currency selector.\n */\n currency: CurrencyType;\n inlinePrompt?: {\n sentiment?: InlinePromptProps['sentiment'];\n message: InlinePromptProps['children'];\n media?: InlinePromptProps['media'];\n };\n showChevron?: boolean;\n /**\n * If set, it auto-focuses the amount input upon component mount.<br />\n * ⚠️ **Use with caution**, as it may impact user experience and\n * fail [WCAG 2.4.3 requirements](https://www.w3.org/WAI/WCAG21/Understanding/focus-order.html)\n */\n autoFocus?: boolean;\n /**\n * Dims the input to indicate a loading state. Does not disable it.\n */\n loading?: boolean;\n onAmountChange: (amount: AmountType) => void;\n onFocusChange?: (focused: boolean) => void;\n} & CommonProps;\n\n/**\n * This component has been kindly contributed by our friends at the `Send` team 🎉.\n *\n * Some patterns and implementation details used in this component may differ\n * from what's commonly used in the Design System. The overall build and QA was managed\n * by the contributing team directly, and such did not follow a typical DS lifecycle.\n *\n * While we house this component and will help facilitate its future iterations,\n * direct contributions by consuming product teams are highly encouraged.\n *\n * > ⚠️ **Prerequisite:** <br />The component depends on the\n * [motion](https://www.npmjs.com/package/motion) package, which has been\n * deliberately excluded from the Design System bundle and kept as an opt-in only.\n * **Make sure to add it to your project dependencies.**\n */\nexport default function ExpressiveMoneyInput({\n label,\n currency,\n currencySelector = { options: [] },\n amount,\n onAmountChange,\n className,\n inlinePrompt,\n showChevron,\n autoFocus,\n loading,\n onFocusChange,\n}: ExpressiveMoneyInputProps) {\n const inputId = useId();\n const labelId = useId();\n const customAlertId = useId();\n const currencyId = useId();\n\n return (\n <div className={clsx('wds-expressive-money-input', className)}>\n <Label id={labelId} htmlFor={inputId} className={clsx('m-b-1', 'font-weight-normal')}>\n {label}\n </Label>\n <div\n className={clsx('d-flex')}\n role=\"group\"\n aria-labelledby={labelId}\n {...(inlinePrompt ? { 'aria-describedby': customAlertId } : {})}\n >\n <div className=\"wds-expressive-money-input-currency-selector\">\n {currencySelector.customRender?.({ id: currencyId, labelId }) ?? (\n <CurrencySelector\n id={currencyId}\n labelId={labelId}\n currency={currency}\n {...currencySelector}\n />\n )}\n </div>\n <AmountInput\n id={inputId}\n describedById={currencyId}\n amount={amount}\n currency={currency}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n loading={loading}\n onChange={onAmountChange}\n onFocusChange={onFocusChange}\n />\n <div className={clsx('d-flex align-items-center', 'wds-expressive-money-input-chevron')}>\n <Chevron shouldShow={Boolean(showChevron)} />\n </div>\n </div>\n <AnimatePresence initial={false}>\n {inlinePrompt && (\n <div className={clsx('d-flex justify-content-end', inlinePrompt && 'm-t-1')}>\n <motion.div\n key={customAlertId}\n initial={{ opacity: 0, height: 0 }}\n animate={{\n opacity: 1,\n height: 'auto',\n transition: { delay: 0.75, duration: 0.3 },\n }}\n exit={{ opacity: 0, height: 0 }}\n >\n {inlinePrompt.sentiment && Object.keys(inlinePrompt.sentiment).length > 0 ? (\n <InlinePrompt\n id={customAlertId}\n media={inlinePrompt.media}\n sentiment={inlinePrompt.sentiment}\n >\n {inlinePrompt.message}\n </InlinePrompt>\n ) : (\n <Body>{inlinePrompt.message}</Body>\n )}\n </motion.div>\n </div>\n )}\n </AnimatePresence>\n </div>\n );\n}\n"],"names":["ExpressiveMoneyInput","label","currency","currencySelector","options","amount","onAmountChange","className","inlinePrompt","showChevron","autoFocus","loading","onFocusChange","inputId","useId","labelId","customAlertId","currencyId","_jsxs","clsx","children","_jsx","Label","id","htmlFor","role","customRender","CurrencySelector","AmountInput","describedById","onChange","Chevron","shouldShow","Boolean","AnimatePresence","initial","motion","div","opacity","height","animate","transition","delay","duration","exit","sentiment","Object","keys","length","InlinePrompt","media","message","Body"],"mappings":";;;;;;;;;;;AAoEc,SAAUA,oBAAoBA,CAAC;EAC3CC,KAAK;EACLC,QAAQ;AACRC,EAAAA,gBAAgB,GAAG;AAAEC,IAAAA,OAAO,EAAE;GAAI;EAClCC,MAAM;EACNC,cAAc;EACdC,SAAS;EACTC,YAAY;EACZC,WAAW;EACXC,SAAS;EACTC,OAAO;AACPC,EAAAA;AAAa,CACa,EAAA;AAC1B,EAAA,MAAMC,OAAO,GAAGC,KAAK,EAAE;AACvB,EAAA,MAAMC,OAAO,GAAGD,KAAK,EAAE;AACvB,EAAA,MAAME,aAAa,GAAGF,KAAK,EAAE;AAC7B,EAAA,MAAMG,UAAU,GAAGH,KAAK,EAAE;AAE1B,EAAA,oBACEI,IAAA,CAAA,KAAA,EAAA;AAAKX,IAAAA,SAAS,EAAEY,IAAI,CAAC,4BAA4B,EAAEZ,SAAS,CAAE;IAAAa,QAAA,EAAA,cAC5DC,GAAA,CAACC,cAAK,EAAA;AAACC,MAAAA,EAAE,EAAER,OAAQ;AAACS,MAAAA,OAAO,EAAEX,OAAQ;AAACN,MAAAA,SAAS,EAAEY,IAAI,CAAC,OAAO,EAAE,oBAAoB,CAAE;AAAAC,MAAAA,QAAA,EAClFnB;KACI,CACP,eAAAiB,IAAA,CAAA,KAAA,EAAA;AACEX,MAAAA,SAAS,EAAEY,IAAI,CAAC,QAAQ,CAAE;AAC1BM,MAAAA,IAAI,EAAC,OAAO;AACZ,MAAA,iBAAA,EAAiBV,OAAQ;AAAA,MAAA,IACpBP,YAAY,GAAG;AAAE,QAAA,kBAAkB,EAAEQ;OAAe,GAAG,EAAE,CAAA;AAAAI,MAAAA,QAAA,gBAE9DC,GAAA,CAAA,KAAA,EAAA;AAAKd,QAAAA,SAAS,EAAC,8CAA8C;AAAAa,QAAAA,QAAA,EAC1DjB,gBAAgB,CAACuB,YAAY,GAAG;AAAEH,UAAAA,EAAE,EAAEN,UAA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EAAE,IAAI;AAAEC,cAAAA,QAAQ,EAAE;AAAG;WACxC;AACFC,UAAAA,IAAI,EAAE;AAAEN,YAAAA,OAAO,EAAE,CAAC;AAAEC,YAAAA,MAAM,EAAE;WAAI;UAAAnB,QAAA,EAE/BZ,YAAY,CAACqC,SAAS,IAAIC,MAAM,CAACC,IAAI,CAACvC,YAAY,CAACqC,SAAS,CAAC,CAACG,MAAM,GAAG,CAAC,gBACvE3B,GAAA,CAAC4B,YAAY,EAAA;AACX1B,YAAAA,EAAE,EAAEP,aAAc;YAClBkC,KAAK,EAAE1C,YAAY,CAAC0C,KAAM;YAC1BL,SAAS,EAAErC,YAAY,CAACqC,SAAU;YAAAzB,QAAA,EAEjCZ,YAAY,CAAC2C;AAAO,WACT,CAAC,gBAEf9B,GAAA,CAAC+B,IAAI,EAAA;YAAAhC,QAAA,EAAEZ,YAAY,CAAC2C;WAAc;AACnC,SAAA,EAnBInC,aAoBK;OACT;AACN,KACc,CACnB;AAAA,GAAK,CAAC;AAEV;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useFocus.js","sources":["../../../src/ExpressiveMoneyInput/hooks/useFocus.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nconst focusTimeout = 5 * 1000;\n\nexport const useFocus = () => {\n const [focus, setFocus] = useState(false);\n const [visualFocus, setVisualFocus] = useState(false);\n const [counter, setCounter] = useState(0);\n\n useEffect(() => {\n if (focus) {\n const timeout = setTimeout(() => {\n setVisualFocus(false);\n }, focusTimeout);\n return () => clearTimeout(timeout);\n }\n }, [focus, counter]);\n\n return {\n focus,\n setFocus: (value: boolean) => {\n setFocus(value);\n if (value) {\n setVisualFocus(true);\n }\n // any call to setFocus should reset the timeout, even if the input was already in focus\n // updating the counter will trigger the useEffect to reset the timeout\n setCounter((prev) => prev + 1);\n },\n visualFocus,\n setVisualFocus: (value: boolean) => {\n setVisualFocus(value);\n },\n };\n};\n"],"names":["focusTimeout","useFocus","focus","setFocus","useState","visualFocus","setVisualFocus","counter","setCounter","useEffect","timeout","setTimeout","clearTimeout","value","prev"],"mappings":";;;;AAEA,MAAMA,YAAY,GAAG,CAAC,GAAG,IAAI;AAEtB,MAAMC,QAAQ,GAAGA,MAAK;EAC3B,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGC,cAAQ,CAAC,KAAK,CAAC;EACzC,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGF,cAAQ,CAAC,KAAK,CAAC;EACrD,MAAM,CAACG,OAAO,EAAEC,UAAU,CAAC,GAAGJ,cAAQ,CAAC,CAAC,CAAC;AAEzCK,EAAAA,eAAS,CAAC,MAAK;AACb,IAAA,IAAIP,KAAK,EAAE;AACT,MAAA,MAAMQ,OAAO,GAAGC,UAAU,CAAC,MAAK;QAC9BL,cAAc,CAAC,KAAK,CAAC;MACvB,CAAC,EAAEN,YAAY,CAAC;AAChB,MAAA,OAAO,MAAMY,YAAY,CAACF,OAAO,CAAC;AACpC,IAAA;AACF,EAAA,CAAC,EAAE,CAACR,KAAK,EAAEK,OAAO,CAAC,CAAC;EAEpB,OAAO;IACLL,KAAK;IACLC,QAAQ,EAAGU,KAAc,IAAI;MAC3BV,QAAQ,CAACU,KAAK,CAAC;AACf,MAAA,IAAIA,KAAK,EAAE;QACTP,cAAc,CAAC,IAAI,CAAC;AACtB,MAAA;AACA;AACA;AACAE,MAAAA,UAAU,CAAEM,IAAI,IAAKA,IAAI,GAAG,CAAC,CAAC;IAChC,CAAC;IACDT,WAAW;IACXC,cAAc,EAAGO,KAAc,IAAI;MACjCP,cAAc,CAACO,KAAK,CAAC;AACvB,IAAA;GACD;AACH;;;;"}
1
+ {"version":3,"file":"useFocus.js","sources":["../../../src/ExpressiveMoneyInput/hooks/useFocus.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nconst focusTimeout = 5 * 1000;\n\nexport const useFocus = () => {\n const [focus, setFocus] = useState(false);\n const [visualFocus, setVisualFocus] = useState(false);\n const [counter, setCounter] = useState(0);\n\n useEffect(() => {\n if (focus) {\n const timeout = setTimeout(() => {\n setVisualFocus(false);\n }, focusTimeout);\n return () => clearTimeout(timeout);\n }\n }, [focus, counter]);\n\n return {\n focus,\n setFocus: (value: boolean) => {\n setFocus(value);\n if (value) {\n setVisualFocus(true);\n }\n // any call to setFocus should reset the timeout, even if the input was already in focus\n // updating the counter will trigger the useEffect to reset the timeout\n setCounter((prev) => prev + 1);\n },\n visualFocus,\n setVisualFocus: (value: boolean) => {\n setVisualFocus(value);\n },\n };\n};\n"],"names":["focusTimeout","useFocus","focus","setFocus","useState","visualFocus","setVisualFocus","counter","setCounter","useEffect","timeout","setTimeout","clearTimeout","value","prev"],"mappings":";;;;AAEA,MAAMA,YAAY,GAAG,CAAC,GAAG,IAAI;AAEtB,MAAMC,QAAQ,GAAGA,MAAK;EAC3B,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGC,cAAQ,CAAC,KAAK,CAAC;EACzC,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGF,cAAQ,CAAC,KAAK,CAAC;EACrD,MAAM,CAACG,OAAO,EAAEC,UAAU,CAAC,GAAGJ,cAAQ,CAAC,CAAC,CAAC;AAEzCK,EAAAA,eAAS,CAAC,MAAK;AACb,IAAA,IAAIP,KAAK,EAAE;AACT,MAAA,MAAMQ,OAAO,GAAGC,UAAU,CAAC,MAAK;QAC9BL,cAAc,CAAC,KAAK,CAAC;MACvB,CAAC,EAAEN,YAAY,CAAC;AAChB,MAAA,OAAO,MAAMY,YAAY,CAACF,OAAO,CAAC;AACpC,IAAA;AACF,EAAA,CAAC,EAAE,CAACR,KAAK,EAAEK,OAAO,CAAC,CAAC;EAEpB,OAAO;IACLL,KAAK;IACLC,QAAQ,EAAGU,KAAc,IAAI;MAC3BV,QAAQ,CAACU,KAAK,CAAC;AACf,MAAA,IAAIA,KAAK,EAAE;QACTP,cAAc,CAAC,IAAI,CAAC;AACtB,MAAA;AACA;AACA;AACAE,MAAAA,UAAU,CAAEM,IAAI,IAAKA,IAAI,GAAG,CAAC,CAAC;IAChC,CAAC;IACDT,WAAW;IACXC,cAAc,EAAGO,KAAc,IAAI;MACjCP,cAAc,CAACO,KAAK,CAAC;AACvB,IAAA;GACD;AACH;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useFocus.mjs","sources":["../../../src/ExpressiveMoneyInput/hooks/useFocus.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nconst focusTimeout = 5 * 1000;\n\nexport const useFocus = () => {\n const [focus, setFocus] = useState(false);\n const [visualFocus, setVisualFocus] = useState(false);\n const [counter, setCounter] = useState(0);\n\n useEffect(() => {\n if (focus) {\n const timeout = setTimeout(() => {\n setVisualFocus(false);\n }, focusTimeout);\n return () => clearTimeout(timeout);\n }\n }, [focus, counter]);\n\n return {\n focus,\n setFocus: (value: boolean) => {\n setFocus(value);\n if (value) {\n setVisualFocus(true);\n }\n // any call to setFocus should reset the timeout, even if the input was already in focus\n // updating the counter will trigger the useEffect to reset the timeout\n setCounter((prev) => prev + 1);\n },\n visualFocus,\n setVisualFocus: (value: boolean) => {\n setVisualFocus(value);\n },\n };\n};\n"],"names":["focusTimeout","useFocus","focus","setFocus","useState","visualFocus","setVisualFocus","counter","setCounter","useEffect","timeout","setTimeout","clearTimeout","value","prev"],"mappings":";;AAEA,MAAMA,YAAY,GAAG,CAAC,GAAG,IAAI;AAEtB,MAAMC,QAAQ,GAAGA,MAAK;EAC3B,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGC,QAAQ,CAAC,KAAK,CAAC;EACzC,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGF,QAAQ,CAAC,KAAK,CAAC;EACrD,MAAM,CAACG,OAAO,EAAEC,UAAU,CAAC,GAAGJ,QAAQ,CAAC,CAAC,CAAC;AAEzCK,EAAAA,SAAS,CAAC,MAAK;AACb,IAAA,IAAIP,KAAK,EAAE;AACT,MAAA,MAAMQ,OAAO,GAAGC,UAAU,CAAC,MAAK;QAC9BL,cAAc,CAAC,KAAK,CAAC;MACvB,CAAC,EAAEN,YAAY,CAAC;AAChB,MAAA,OAAO,MAAMY,YAAY,CAACF,OAAO,CAAC;AACpC,IAAA;AACF,EAAA,CAAC,EAAE,CAACR,KAAK,EAAEK,OAAO,CAAC,CAAC;EAEpB,OAAO;IACLL,KAAK;IACLC,QAAQ,EAAGU,KAAc,IAAI;MAC3BV,QAAQ,CAACU,KAAK,CAAC;AACf,MAAA,IAAIA,KAAK,EAAE;QACTP,cAAc,CAAC,IAAI,CAAC;AACtB,MAAA;AACA;AACA;AACAE,MAAAA,UAAU,CAAEM,IAAI,IAAKA,IAAI,GAAG,CAAC,CAAC;IAChC,CAAC;IACDT,WAAW;IACXC,cAAc,EAAGO,KAAc,IAAI;MACjCP,cAAc,CAACO,KAAK,CAAC;AACvB,IAAA;GACD;AACH;;;;"}
1
+ {"version":3,"file":"useFocus.mjs","sources":["../../../src/ExpressiveMoneyInput/hooks/useFocus.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nconst focusTimeout = 5 * 1000;\n\nexport const useFocus = () => {\n const [focus, setFocus] = useState(false);\n const [visualFocus, setVisualFocus] = useState(false);\n const [counter, setCounter] = useState(0);\n\n useEffect(() => {\n if (focus) {\n const timeout = setTimeout(() => {\n setVisualFocus(false);\n }, focusTimeout);\n return () => clearTimeout(timeout);\n }\n }, [focus, counter]);\n\n return {\n focus,\n setFocus: (value: boolean) => {\n setFocus(value);\n if (value) {\n setVisualFocus(true);\n }\n // any call to setFocus should reset the timeout, even if the input was already in focus\n // updating the counter will trigger the useEffect to reset the timeout\n setCounter((prev) => prev + 1);\n },\n visualFocus,\n setVisualFocus: (value: boolean) => {\n setVisualFocus(value);\n },\n };\n};\n"],"names":["focusTimeout","useFocus","focus","setFocus","useState","visualFocus","setVisualFocus","counter","setCounter","useEffect","timeout","setTimeout","clearTimeout","value","prev"],"mappings":";;AAEA,MAAMA,YAAY,GAAG,CAAC,GAAG,IAAI;AAEtB,MAAMC,QAAQ,GAAGA,MAAK;EAC3B,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGC,QAAQ,CAAC,KAAK,CAAC;EACzC,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGF,QAAQ,CAAC,KAAK,CAAC;EACrD,MAAM,CAACG,OAAO,EAAEC,UAAU,CAAC,GAAGJ,QAAQ,CAAC,CAAC,CAAC;AAEzCK,EAAAA,SAAS,CAAC,MAAK;AACb,IAAA,IAAIP,KAAK,EAAE;AACT,MAAA,MAAMQ,OAAO,GAAGC,UAAU,CAAC,MAAK;QAC9BL,cAAc,CAAC,KAAK,CAAC;MACvB,CAAC,EAAEN,YAAY,CAAC;AAChB,MAAA,OAAO,MAAMY,YAAY,CAACF,OAAO,CAAC;AACpC,IAAA;AACF,EAAA,CAAC,EAAE,CAACR,KAAK,EAAEK,OAAO,CAAC,CAAC;EAEpB,OAAO;IACLL,KAAK;IACLC,QAAQ,EAAGU,KAAc,IAAI;MAC3BV,QAAQ,CAACU,KAAK,CAAC;AACf,MAAA,IAAIA,KAAK,EAAE;QACTP,cAAc,CAAC,IAAI,CAAC;AACtB,MAAA;AACA;AACA;AACAE,MAAAA,UAAU,CAAEM,IAAI,IAAKA,IAAI,GAAG,CAAC,CAAC;IAChC,CAAC;IACDT,WAAW;IACXC,cAAc,EAAGO,KAAc,IAAI;MACjCP,cAAc,CAACO,KAAK,CAAC;AACvB,IAAA;GACD;AACH;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useInputStyle.js","sources":["../../../src/ExpressiveMoneyInput/hooks/useInputStyle.ts"],"sourcesContent":["import {\n type CSSProperties,\n type RefObject,\n useCallback,\n useEffect,\n useLayoutEffect,\n useState,\n} from 'react';\nimport type { ExpressiveMoneyInputProps } from '../ExpressiveMoneyInput';\n\ntype InputStyleObject = {\n value: string;\n focus: boolean;\n inputElement: RefObject<HTMLInputElement> | null;\n} & Pick<ExpressiveMoneyInputProps, 'loading'>;\n\nexport const useInputStyle = ({ value, focus, inputElement, loading }: InputStyleObject) => {\n const initialRender = !useTimeout(300);\n const inputWidth = useFirstDefinedValue(inputElement?.current?.parentElement?.clientWidth, [\n inputElement?.current,\n value,\n ]);\n\n const getStyle = useCallback((): CSSProperties => {\n const fontSize = getFontSize(value, focus, inputWidth);\n return {\n fontSize,\n height: fontSize,\n // aligns the top of the digit with the currency button\n marginTop: fontSize * -0.19,\n // if the input loads with a pre-filled value, we don't want to animate the font-size immediately\n transition: initialRender ? 'none' : undefined,\n color: loading ? 'var(--color-interactive-secondary)' : undefined,\n };\n }, [value, focus, inputWidth, loading, initialRender]);\n\n const [style, setStyle] = useState<CSSProperties>(() => getStyle());\n\n useLayoutEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect -- Computing style based on layout measurements\n setStyle(getStyle());\n }, [value, focus, loading, inputWidth, getStyle]);\n\n return style;\n};\n\nfunction getFontSize(inputValue: string, isFocused: boolean, inputWidth: number | undefined) {\n const defaultFontSize = 52;\n const focusFontSize = 90;\n const minimumFontSize = 34;\n\n let fontSize = isFocused ? focusFontSize : defaultFontSize;\n\n if (typeof inputWidth === 'undefined') {\n return fontSize;\n }\n const textLength = inputValue.length;\n const maxCharactersWithoutShrinking = Math.floor(inputWidth / 40);\n\n if (textLength > maxCharactersWithoutShrinking) {\n const adjustedSize = Math.round((inputWidth / textLength) * 1.9);\n fontSize = Math.min(fontSize, adjustedSize);\n }\n\n return Math.max(fontSize, minimumFontSize);\n}\n\nconst useFirstDefinedValue = (newValue: number | undefined, dependencies: unknown[]) => {\n const [value, setValue] = useState<number | undefined>(newValue);\n\n useLayoutEffect(() => {\n if (typeof newValue !== 'undefined' && typeof value === 'undefined') {\n // eslint-disable-next-line react-hooks/set-state-in-effect -- Lazy initialization from prop\n setValue(newValue);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [...dependencies, value, newValue]);\n\n return value;\n};\n\nconst useTimeout = (delay: number) => {\n const [ready, setReady] = useState(false);\n\n useEffect(() => {\n const timeout = setTimeout(() => {\n setReady(true);\n }, delay);\n\n return () => {\n clearTimeout(timeout);\n };\n }, [delay]);\n\n return ready;\n};\n"],"names":["useInputStyle","value","focus","inputElement","loading","initialRender","useTimeout","inputWidth","useFirstDefinedValue","current","parentElement","clientWidth","getStyle","useCallback","fontSize","getFontSize","height","marginTop","transition","undefined","color","style","setStyle","useState","useLayoutEffect","inputValue","isFocused","defaultFontSize","focusFontSize","minimumFontSize","textLength","length","maxCharactersWithoutShrinking","Math","floor","adjustedSize","round","min","max","newValue","dependencies","setValue","delay","ready","setReady","useEffect","timeout","setTimeout","clearTimeout"],"mappings":";;;;AAgBO,MAAMA,aAAa,GAAGA,CAAC;EAAEC,KAAK;EAAEC,KAAK;EAAEC,YAAY;AAAEC,EAAAA;AAAO,CAAoB,KAAI;AACzF,EAAA,MAAMC,aAAa,GAAG,CAACC,UAAU,CAAC,GAAG,CAAC;AACtC,EAAA,MAAMC,UAAU,GAAGC,oBAAoB,CAACL,YAAY,EAAEM,OAAO,EAAEC,aAAa,EAAEC,WAAW,EAAE,CACzFR,YAAY,EAAEM,OAAO,EACrBR,KAAK,CACN,CAAC;AAEF,EAAA,MAAMW,QAAQ,GAAGC,iBAAW,CAAC,MAAoB;IAC/C,MAAMC,QAAQ,GAAGC,WAAW,CAACd,KAAK,EAAEC,KAAK,EAAEK,UAAU,CAAC;IACtD,OAAO;MACLO,QAAQ;AACRE,MAAAA,MAAM,EAAEF,QAAQ;AAChB;AACAG,MAAAA,SAAS,EAAEH,QAAQ,GAAG,KAAK;AAC3B;AACAI,MAAAA,UAAU,EAAEb,aAAa,GAAG,MAAM,GAAGc,SAAS;AAC9CC,MAAAA,KAAK,EAAEhB,OAAO,GAAG,oCAAoC,GAAGe;KACzD;AACH,EAAA,CAAC,EAAE,CAAClB,KAAK,EAAEC,KAAK,EAAEK,UAAU,EAAEH,OAAO,EAAEC,aAAa,CAAC,CAAC;AAEtD,EAAA,MAAM,CAACgB,KAAK,EAAEC,QAAQ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OAAOe,QAAQ,KAAK,WAAW,IAAI,OAAOtC,KAAK,KAAK,WAAW,EAAE;AACnE;MACAwC,QAAQ,CAACF,QAAQ,CAAC;AACpB,IAAA;AACA;EACF,CAAC,EAAE,CAAC,GAAGC,YAAY,EAAEvC,KAAK,EAAEsC,QAAQ,CAAC,CAAC;AAEtC,EAAA,OAAOtC,KAAK;AACd,CAAC;AAED,MAAMK,UAAU,GAAIoC,KAAa,IAAI;EACnC,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGrB,cAAQ,CAAC,KAAK,CAAC;AAEzCsB,EAAAA,eAAS,CAAC,MAAK;AACb,IAAA,MAAMC,OAAO,GAAGC,UAAU,CAAC,MAAK;MAC9BH,QAAQ,CAAC,IAAI,CAAC;IAChB,CAAC,EAAEF,KAAK,CAAC;AAET,IAAA,OAAO,MAAK;MACVM,YAAY,CAACF,OAAO,CAAC;IACvB,CAAC;AACH,EAAA,CAAC,EAAE,CAACJ,KAAK,CAAC,CAAC;AAEX,EAAA,OAAOC,KAAK;AACd,CAAC;;;;"}
1
+ {"version":3,"file":"useInputStyle.js","sources":["../../../src/ExpressiveMoneyInput/hooks/useInputStyle.ts"],"sourcesContent":["import {\n type CSSProperties,\n type RefObject,\n useCallback,\n useEffect,\n useLayoutEffect,\n useState,\n} from 'react';\nimport type { ExpressiveMoneyInputProps } from '../ExpressiveMoneyInput';\n\ntype InputStyleObject = {\n value: string;\n focus: boolean;\n inputElement: RefObject<HTMLInputElement> | null;\n} & Pick<ExpressiveMoneyInputProps, 'loading'>;\n\nexport const useInputStyle = ({ value, focus, inputElement, loading }: InputStyleObject) => {\n const initialRender = !useTimeout(300);\n const inputWidth = useFirstDefinedValue(inputElement?.current?.parentElement?.clientWidth, [\n inputElement?.current,\n value,\n ]);\n\n const getStyle = useCallback((): CSSProperties => {\n const fontSize = getFontSize(value, focus, inputWidth);\n return {\n fontSize,\n height: fontSize,\n // aligns the top of the digit with the currency button\n marginTop: fontSize * -0.19,\n // if the input loads with a pre-filled value, we don't want to animate the font-size immediately\n transition: initialRender ? 'none' : undefined,\n color: loading ? 'var(--color-interactive-secondary)' : undefined,\n };\n }, [value, focus, inputWidth, loading, initialRender]);\n\n const [style, setStyle] = useState<CSSProperties>(() => getStyle());\n\n useLayoutEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect -- Computing style based on layout measurements\n setStyle(getStyle());\n }, [value, focus, loading, inputWidth, getStyle]);\n\n return style;\n};\n\nfunction getFontSize(inputValue: string, isFocused: boolean, inputWidth: number | undefined) {\n const defaultFontSize = 52;\n const focusFontSize = 90;\n const minimumFontSize = 34;\n\n let fontSize = isFocused ? focusFontSize : defaultFontSize;\n\n if (typeof inputWidth === 'undefined') {\n return fontSize;\n }\n const textLength = inputValue.length;\n const maxCharactersWithoutShrinking = Math.floor(inputWidth / 40);\n\n if (textLength > maxCharactersWithoutShrinking) {\n const adjustedSize = Math.round((inputWidth / textLength) * 1.9);\n fontSize = Math.min(fontSize, adjustedSize);\n }\n\n return Math.max(fontSize, minimumFontSize);\n}\n\nconst useFirstDefinedValue = (newValue: number | undefined, dependencies: unknown[]) => {\n const [value, setValue] = useState<number | undefined>(newValue);\n\n useLayoutEffect(() => {\n if (typeof newValue !== 'undefined' && typeof value === 'undefined') {\n // eslint-disable-next-line react-hooks/set-state-in-effect -- Lazy initialization from prop\n setValue(newValue);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [...dependencies, value, newValue]);\n\n return value;\n};\n\nconst useTimeout = (delay: number) => {\n const [ready, setReady] = useState(false);\n\n useEffect(() => {\n const timeout = setTimeout(() => {\n setReady(true);\n }, delay);\n\n return () => {\n clearTimeout(timeout);\n };\n }, [delay]);\n\n return ready;\n};\n"],"names":["useInputStyle","value","focus","inputElement","loading","initialRender","useTimeout","inputWidth","useFirstDefinedValue","current","parentElement","clientWidth","getStyle","useCallback","fontSize","getFontSize","height","marginTop","transition","undefined","color","style","setStyle","useState","useLayoutEffect","inputValue","isFocused","defaultFontSize","focusFontSize","minimumFontSize","textLength","length","maxCharactersWithoutShrinking","Math","floor","adjustedSize","round","min","max","newValue","dependencies","setValue","delay","ready","setReady","useEffect","timeout","setTimeout","clearTimeout"],"mappings":";;;;AAgBO,MAAMA,aAAa,GAAGA,CAAC;EAAEC,KAAK;EAAEC,KAAK;EAAEC,YAAY;AAAEC,EAAAA;AAAO,CAAoB,KAAI;AACzF,EAAA,MAAMC,aAAa,GAAG,CAACC,UAAU,CAAC,GAAG,CAAC;AACtC,EAAA,MAAMC,UAAU,GAAGC,oBAAoB,CAACL,YAAY,EAAEM,OAAO,EAAEC,aAAa,EAAEC,WAAW,EAAE,CACzFR,YAAY,EAAEM,OAAO,EACrBR,KAAK,CACN,CAAC;AAEF,EAAA,MAAMW,QAAQ,GAAGC,iBAAW,CAAC,MAAoB;IAC/C,MAAMC,QAAQ,GAAGC,WAAW,CAACd,KAAK,EAAEC,KAAK,EAAEK,UAAU,CAAC;IACtD,OAAO;MACLO,QAAQ;AACRE,MAAAA,MAAM,EAAEF,QAAQ;AAChB;AACAG,MAAAA,SAAS,EAAEH,QAAQ,GAAG,KAAK;AAC3B;AACAI,MAAAA,UAAU,EAAEb,aAAa,GAAG,MAAM,GAAGc,SAAS;AAC9CC,MAAAA,KAAK,EAAEhB,OAAO,GAAG,oCAAoC,GAAGe;KACzD;AACH,EAAA,CAAC,EAAE,CAAClB,KAAK,EAAEC,KAAK,EAAEK,UAAU,EAAEH,OAAO,EAAEC,aAAa,CAAC,CAAC;AAEtD,EAAA,MAAM,CAACgB,KAAK,EAAEC,QAAQ,CAAC,GAAGC,cAAQ,CAAgB,MAAMX,QAAQ,EAAE,CAAC;AAEnEY,EAAAA,qBAAe,CAAC,MAAK;AACnB;AACAF,IAAAA,QAAQ,CAACV,QAAQ,EAAE,CAAC;AACtB,EAAA,CAAC,EAAE,CAACX,KAAK,EAAEC,KAAK,EAAEE,OAAO,EAAEG,UAAU,EAAEK,QAAQ,CAAC,CAAC;AAEjD,EAAA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AAIoC,KAAa,IAAI;EACnC,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGrB,cAAQ,CAAC,KAAK,CAAC;AAEzCsB,EAAAA,eAAS,CAAC,MAAK;AACb,IAAA,MAAMC,OAAO,GAAGC,UAAU,CAAC,MAAK;MAC9BH,QAAQ,CAAC,IAAI,CAAC;IAChB,CAAC,EAAEF,KAAK,CAAC;AAET,IAAA,OAAO,MAAK;MACVM,YAAY,CAACF,OAAO,CAAC;IACvB,CAAC;AACH,EAAA,CAAC,EAAE,CAACJ,KAAK,CAAC,CAAC;AAEX,EAAA,OAAOC,KAAK;AACd,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useInputStyle.mjs","sources":["../../../src/ExpressiveMoneyInput/hooks/useInputStyle.ts"],"sourcesContent":["import {\n type CSSProperties,\n type RefObject,\n useCallback,\n useEffect,\n useLayoutEffect,\n useState,\n} from 'react';\nimport type { ExpressiveMoneyInputProps } from '../ExpressiveMoneyInput';\n\ntype InputStyleObject = {\n value: string;\n focus: boolean;\n inputElement: RefObject<HTMLInputElement> | null;\n} & Pick<ExpressiveMoneyInputProps, 'loading'>;\n\nexport const useInputStyle = ({ value, focus, inputElement, loading }: InputStyleObject) => {\n const initialRender = !useTimeout(300);\n const inputWidth = useFirstDefinedValue(inputElement?.current?.parentElement?.clientWidth, [\n inputElement?.current,\n value,\n ]);\n\n const getStyle = useCallback((): CSSProperties => {\n const fontSize = getFontSize(value, focus, inputWidth);\n return {\n fontSize,\n height: fontSize,\n // aligns the top of the digit with the currency button\n marginTop: fontSize * -0.19,\n // if the input loads with a pre-filled value, we don't want to animate the font-size immediately\n transition: initialRender ? 'none' : undefined,\n color: loading ? 'var(--color-interactive-secondary)' : undefined,\n };\n }, [value, focus, inputWidth, loading, initialRender]);\n\n const [style, setStyle] = useState<CSSProperties>(() => getStyle());\n\n useLayoutEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect -- Computing style based on layout measurements\n setStyle(getStyle());\n }, [value, focus, loading, inputWidth, getStyle]);\n\n return style;\n};\n\nfunction getFontSize(inputValue: string, isFocused: boolean, inputWidth: number | undefined) {\n const defaultFontSize = 52;\n const focusFontSize = 90;\n const minimumFontSize = 34;\n\n let fontSize = isFocused ? focusFontSize : defaultFontSize;\n\n if (typeof inputWidth === 'undefined') {\n return fontSize;\n }\n const textLength = inputValue.length;\n const maxCharactersWithoutShrinking = Math.floor(inputWidth / 40);\n\n if (textLength > maxCharactersWithoutShrinking) {\n const adjustedSize = Math.round((inputWidth / textLength) * 1.9);\n fontSize = Math.min(fontSize, adjustedSize);\n }\n\n return Math.max(fontSize, minimumFontSize);\n}\n\nconst useFirstDefinedValue = (newValue: number | undefined, dependencies: unknown[]) => {\n const [value, setValue] = useState<number | undefined>(newValue);\n\n useLayoutEffect(() => {\n if (typeof newValue !== 'undefined' && typeof value === 'undefined') {\n // eslint-disable-next-line react-hooks/set-state-in-effect -- Lazy initialization from prop\n setValue(newValue);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [...dependencies, value, newValue]);\n\n return value;\n};\n\nconst useTimeout = (delay: number) => {\n const [ready, setReady] = useState(false);\n\n useEffect(() => {\n const timeout = setTimeout(() => {\n setReady(true);\n }, delay);\n\n return () => {\n clearTimeout(timeout);\n };\n }, [delay]);\n\n return ready;\n};\n"],"names":["useInputStyle","value","focus","inputElement","loading","initialRender","useTimeout","inputWidth","useFirstDefinedValue","current","parentElement","clientWidth","getStyle","useCallback","fontSize","getFontSize","height","marginTop","transition","undefined","color","style","setStyle","useState","useLayoutEffect","inputValue","isFocused","defaultFontSize","focusFontSize","minimumFontSize","textLength","length","maxCharactersWithoutShrinking","Math","floor","adjustedSize","round","min","max","newValue","dependencies","setValue","delay","ready","setReady","useEffect","timeout","setTimeout","clearTimeout"],"mappings":";;AAgBO,MAAMA,aAAa,GAAGA,CAAC;EAAEC,KAAK;EAAEC,KAAK;EAAEC,YAAY;AAAEC,EAAAA;AAAO,CAAoB,KAAI;A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,IAAA,OAAO,MAAK;MACVM,YAAY,CAACF,OAAO,CAAC;IACvB,CAAC;AACH,EAAA,CAAC,EAAE,CAACJ,KAAK,CAAC,CAAC;AAEX,EAAA,OAAOC,KAAK;AACd,CAAC;;;;"}
1
+ {"version":3,"file":"useInputStyle.mjs","sources":["../../../src/ExpressiveMoneyInput/hooks/useInputStyle.ts"],"sourcesContent":["import {\n type CSSProperties,\n type RefObject,\n useCallback,\n useEffect,\n useLayoutEffect,\n useState,\n} from 'react';\nimport type { ExpressiveMoneyInputProps } from '../ExpressiveMoneyInput';\n\ntype InputStyleObject = {\n value: string;\n focus: boolean;\n inputElement: RefObject<HTMLInputElement> | null;\n} & Pick<ExpressiveMoneyInputProps, 'loading'>;\n\nexport const useInputStyle = ({ value, focus, inputElement, loading }: InputStyleObject) => {\n const initialRender = !useTimeout(300);\n const inputWidth = useFirstDefinedValue(inputElement?.current?.parentElement?.clientWidth, [\n inputElement?.current,\n value,\n ]);\n\n const getStyle = useCallback((): CSSProperties => {\n const fontSize = getFontSize(value, focus, inputWidth);\n return {\n fontSize,\n height: fontSize,\n // aligns the top of the digit with the currency button\n marginTop: fontSize * -0.19,\n // if the input loads with a pre-filled value, we don't want to animate the font-size immediately\n transition: initialRender ? 'none' : undefined,\n color: loading ? 'var(--color-interactive-secondary)' : undefined,\n };\n }, [value, focus, inputWidth, loading, initialRender]);\n\n const [style, setStyle] = useState<CSSProperties>(() => getStyle());\n\n useLayoutEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect -- Computing style based on layout measurements\n setStyle(getStyle());\n }, [value, focus, loading, inputWidth, getStyle]);\n\n return style;\n};\n\nfunction getFontSize(inputValue: string, isFocused: boolean, inputWidth: number | undefined) {\n const defaultFontSize = 52;\n const focusFontSize = 90;\n const minimumFontSize = 34;\n\n let fontSize = isFocused ? focusFontSize : defaultFontSize;\n\n if (typeof inputWidth === 'undefined') {\n return fontSize;\n }\n const textLength = inputValue.length;\n const maxCharactersWithoutShrinking = Math.floor(inputWidth / 40);\n\n if (textLength > maxCharactersWithoutShrinking) {\n const adjustedSize = Math.round((inputWidth / textLength) * 1.9);\n fontSize = Math.min(fontSize, adjustedSize);\n }\n\n return Math.max(fontSize, minimumFontSize);\n}\n\nconst useFirstDefinedValue = (newValue: number | undefined, dependencies: unknown[]) => {\n const [value, setValue] = useState<number | undefined>(newValue);\n\n useLayoutEffect(() => {\n if (typeof newValue !== 'undefined' && typeof value === 'undefined') {\n // eslint-disable-next-line react-hooks/set-state-in-effect -- Lazy initialization from prop\n setValue(newValue);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [...dependencies, value, newValue]);\n\n return value;\n};\n\nconst useTimeout = (delay: number) => {\n const [ready, setReady] = useState(false);\n\n useEffect(() => {\n const timeout = setTimeout(() => {\n setReady(true);\n }, delay);\n\n return () => {\n clearTimeout(timeout);\n };\n }, [delay]);\n\n return ready;\n};\n"],"names":["useInputStyle","value","focus","inputElement","loading","initialRender","useTimeout","inputWidth","useFirstDefinedValue","current","parentElement","clientWidth","getStyle","useCallback","fontSize","getFontSize","height","marginTop","transition","undefined","color","style","setStyle","useState","useLayoutEffect","inputValue","isFocused","defaultFontSize","focusFontSize","minimumFontSize","textLength","length","maxCharactersWithoutShrinking","Math","floor","adjustedSize","round","min","max","newValue","dependencies","setValue","delay","ready","setReady","useEffect","timeout","setTimeout","clearTimeout"],"mappings":";;AAgBO,MAAMA,aAAa,GAAGA,CAAC;EAAEC,KAAK;EAAEC,KAAK;EAAEC,YAAY;AAAEC,EAAAA;AAAO,CAAoB,KAAI;AACzF,EAAA,MAAMC,aAAa,GAAG,CAACC,UAAU,CAAC,GAAG,CAAC;AACtC,EAAA,MAAMC,UAAU,GAAGC,oBAAoB,CAACL,YAAY,EAAEM,OAAO,EAAEC,aAAa,EAAEC,WAAW,EAAE,CACzFR,YAAY,EAAEM,OAAO,EACrBR,KAAK,CACN,CAAC;AAEF,EAAA,MAAMW,QAAQ,GAAGC,WAAW,CAAC,MAAoB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AAE;IAC9C,MAAMG,YAAY,GAAGF,IAAI,CAACG,KAAK,CAAE7B,UAAU,GAAGuB,UAAU,GAAI,GAAG,CAAC;IAChEhB,QAAQ,GAAGmB,IAAI,CAACI,GAAG,CAACvB,QAAQ,EAAEqB,YAAY,CAAC;AAC7C,EAAA;AAEA,EAAA,OAAOF,IAAI,CAACK,GAAG,CAACxB,QAAQ,EAAEe,eAAe,CAAC;AAC5C;AAEA,MAAMrB,oBAAoB,GAAGA,CAAC+B,QAA4B,EAAEC,YAAuB,KAAI;EACrF,MAAM,CAACvC,KAAK,EAAEwC,QAAQ,CAAC,GAAGlB,QAAQ,CAAqBgB,QAAQ,CAAC;AAEhEf,EAAAA,eAAe,CAAC,MAAK;IACnB,IAAI,OAAOe,QAAQ,KAAK,WAAW,IAAI,OAAOtC,KAAK,KAAK,WAAW,EAAE;AACnE;MACAwC,QAAQ,CAACF,QAAQ,CAAC;AACpB,IAAA;AACA;EACF,CAAC,EAAE,CAAC,GAAGC,YAAY,EAAEvC,KAAK,EAAEsC,QAAQ,CAAC,CAAC;AAEtC,EAAA,OAAOtC,KAAK;AACd,CAAC;AAED,MAAMK,UAAU,GAAIoC,KAAa,IAAI;EACnC,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGrB,QAAQ,CAAC,KAAK,CAAC;AAEzCsB,EAAAA,SAAS,CAAC,MAAK;AACb,IAAA,MAAMC,OAAO,GAAGC,UAAU,CAAC,MAAK;MAC9BH,QAAQ,CAAC,IAAI,CAAC;IAChB,CAAC,EAAEF,KAAK,CAAC;AAET,IAAA,OAAO,MAAK;MACVM,YAAY,CAACF,OAAO,CAAC;IACvB,CAAC;AACH,EAAA,CAAC,EAAE,CAACJ,KAAK,CAAC,CAAC;AAEX,EAAA,OAAOC,KAAK;AACd,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Field.js","sources":["../../src/Field/Field.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useCallback, useId, useRef, useState } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport Body from '../Body';\nimport { Sentiment } from '../common';\nimport messages from './Field.messages';\nimport { InlinePrompt, type InlinePromptProps } from '../Prompt';\nimport {\n TextareaCharacterCountProvider,\n type TextareaCharacterCountState,\n FieldLabelContextProvider,\n InputDescribedByProvider,\n InputIdContextProvider,\n InputInvalidProvider,\n} from '../Inputs/contexts';\nimport Label from '../Label';\n\nexport type FieldProps = {\n /** `null` disables auto-generating the `id` attribute, falling back to nesting-based label association over setting `htmlFor` explicitly. */\n id?: string | null;\n /** Should be specified unless the wrapped control has its own labeling mechanism, e.g. `Checkbox`. */\n label?: React.ReactNode;\n /** @default true */\n required?: boolean;\n /** @deprecated Use `description` prop instead. */\n hint?: React.ReactNode;\n message?: React.ReactNode;\n /**\n * Override for the [InlinePrompt icon's default, accessible name](/?path=/docs/other-statusicon-accessibility--docs)\n * announced by the screen readers\n * */\n messageIconLabel?: string;\n /**\n * If true, shows a loading spinner in place of the message icon of the InlinePrompt\n * @default false\n */\n messageLoading?: boolean;\n description?: React.ReactNode;\n /** @deprecated Use `message` and `type={Sentiment.NEGATIVE}` prop instead. */\n error?: React.ReactNode;\n /** @default Sentiment.NEUTRAL */\n sentiment?: InlinePromptProps['sentiment'];\n className?: string;\n children?: React.ReactNode;\n};\n\nconst Field = ({\n id,\n label,\n required = true,\n message: propMessage,\n messageIconLabel,\n messageLoading,\n hint,\n description = hint,\n sentiment: propType = Sentiment.NEUTRAL,\n className,\n children,\n ...props\n}: FieldProps) => {\n const { formatMessage } = useIntl();\n const labelRef = useRef<HTMLLabelElement>(null);\n const sentiment = props.error ? Sentiment.NEGATIVE : propType;\n const message = propMessage || props.error;\n const hasError = sentiment === Sentiment.NEGATIVE;\n\n const labelId = useId();\n\n const fallbackInputId = useId();\n const inputId = id !== null ? (id ?? fallbackInputId) : undefined;\n\n const messageId = useId();\n const descriptionId = useId();\n const textareaCharCounterId = useId();\n\n const [textareaCharacterCount, setTextareaCharacterCount] =\n useState<TextareaCharacterCountState>(null);\n const handleTextareaCharacterCount = useCallback(\n (state: TextareaCharacterCountState) => setTextareaCharacterCount(state),\n [],\n );\n\n const isNearCharLimit =\n textareaCharacterCount != null &&\n textareaCharacterCount.current >= textareaCharacterCount.max * 0.8;\n\n /**\n * form control can have multiple messages to describe it,\n * e.g the description underneath the label and inline alert\n */\n function ariaDescribedbyByIds() {\n const messageIds = [];\n if (description) {\n messageIds.push(descriptionId);\n }\n if (message) {\n messageIds.push(messageId);\n }\n if (textareaCharacterCount) {\n messageIds.push(textareaCharCounterId);\n }\n return messageIds.length > 0 ? messageIds.join(' ') : undefined;\n }\n\n return (\n <FieldLabelContextProvider value={{ id: labelId, ref: labelRef }}>\n <InputIdContextProvider value={inputId}>\n <InputDescribedByProvider value={ariaDescribedbyByIds()}>\n <InputInvalidProvider value={hasError}>\n <TextareaCharacterCountProvider value={handleTextareaCharacterCount}>\n <div\n className={clsx(\n 'np-field form-group d-block',\n {\n 'has-success': sentiment === Sentiment.POSITIVE,\n 'has-warning': sentiment === Sentiment.WARNING,\n 'has-error': hasError,\n 'has-info': sentiment === Sentiment.NEUTRAL,\n },\n className,\n )}\n >\n {label != null ? (\n <>\n <Label ref={labelRef} id={labelId} htmlFor={inputId}>\n {required ? label : <Label.Optional>{label}</Label.Optional>}\n </Label>\n <Label.Description id={descriptionId}>{description}</Label.Description>\n <div className=\"np-field-control\">{children}</div>\n </>\n ) : (\n children\n )}\n\n {(message || textareaCharacterCount) && (\n <div className=\"np-field-validation\">\n {message && (\n <InlinePrompt\n sentiment={sentiment}\n id={messageId}\n mediaLabel={messageIconLabel}\n className=\"np-field__prompt\"\n loading={messageLoading}\n width=\"full\"\n >\n {message}\n </InlinePrompt>\n )}\n {textareaCharacterCount && (\n <Body\n as=\"span\"\n id={textareaCharCounterId}\n {...(isNearCharLimit\n ? {\n role: 'status' as const,\n 'aria-live': 'polite' as const,\n 'aria-atomic': 'true' as const,\n }\n : {})}\n aria-label={formatMessage(messages.characterCount, {\n current: textareaCharacterCount.current,\n max: textareaCharacterCount.max,\n })}\n className=\"np-field-textarea-char-counter\"\n >\n {textareaCharacterCount.current}/{textareaCharacterCount.max}\n </Body>\n )}\n </div>\n )}\n </div>\n </TextareaCharacterCountProvider>\n </InputInvalidProvider>\n </InputDescribedByProvider>\n </InputIdContextProvider>\n </FieldLabelContextProvider>\n );\n};\n\nexport default Field;\n"],"names":["Field","id","label","required","message","propMessage","messageIconLabel","messageLoading","hint","description","sentiment","propType","Sentiment","NEUTRAL","className","children","props","formatMessage","useIntl","labelRef","useRef","error","NEGATIVE","hasError","labelId","useId","fallbackInputId","inputId","undefined","messageId","descriptionId","textareaCharCounterId","textareaCharacterCount","setTextareaCharacterCount","useState","handleTextareaCharacterCount","useCallback","state","isNearCharLimit","current","max","ariaDescribedbyByIds","messageIds","push","length","join","_jsx","FieldLabelContextProvider","value","ref","InputIdContextProvider","InputDescribedByProvider","InputInvalidProvider","TextareaCharacterCountProvider","_jsxs","clsx","POSITIVE","WARNING","_Fragment","Label","htmlFor","Optional","Description","InlinePrompt","mediaLabel","loading","width","Body","as","role","messages","characterCount"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,MAAMA,KAAK,GAAGA,CAAC;EACbC,EAAE;EACFC,KAAK;AACLC,EAAAA,QAAQ,GAAG,IAAI;AACfC,EAAAA,OAAO,EAAEC,WAAW;EACpBC,gBAAgB;EAChBC,cAAc;EACdC,IAAI;AACJC,EAAAA,WAAW,GAAGD,IAAI;AAClBE,EAAAA,SAAS,EAAEC,QAAQ,GAAGC,mBAAS,CAACC,OAAO;EACvCC,SAAS;EACTC,QAAQ;EACR,GAAGC;AAAK,CACG,KAAI;EACf,MAAM;AAAEC,IAAAA;GAAe,GAAGC,iBAAO,EAAE;AACnC,EAAA,MAAMC,QAAQ,GAAGC,YAAM,CAAmB,IAAI,CAAC;EAC/C,MAAMV,WAAS,GAAGM,KAAK,CAACK,KAAK,GAAG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EAAA,CAEzCiB,sBAAsB,CAACO,OAAO,EAAC,GAAC,EAACP,sBAAsB,CAACQ,GAAG;AAAA,iBACxD,CACP;AAAA,eACE,CACN;aACE;WACyB;SACZ;OACE;KACJ;AAC1B,GAA2B,CAAC;AAEhC;;;;"}
1
+ {"version":3,"file":"Field.js","sources":["../../src/Field/Field.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useCallback, useId, useRef, useState } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport Body from '../Body';\nimport { Sentiment } from '../common';\nimport messages from './Field.messages';\nimport { InlinePrompt, type InlinePromptProps } from '../Prompt';\nimport {\n TextareaCharacterCountProvider,\n type TextareaCharacterCountState,\n FieldLabelContextProvider,\n InputDescribedByProvider,\n InputIdContextProvider,\n InputInvalidProvider,\n} from '../Inputs/contexts';\nimport Label from '../Label';\n\nexport type FieldProps = {\n /** `null` disables auto-generating the `id` attribute, falling back to nesting-based label association over setting `htmlFor` explicitly. */\n id?: string | null;\n /** Should be specified unless the wrapped control has its own labeling mechanism, e.g. `Checkbox`. */\n label?: React.ReactNode;\n /** @default true */\n required?: boolean;\n /** @deprecated Use `description` prop instead. */\n hint?: React.ReactNode;\n message?: React.ReactNode;\n /**\n * Override for the [InlinePrompt icon's default, accessible name](/?path=/docs/other-statusicon-accessibility--docs)\n * announced by the screen readers\n * */\n messageIconLabel?: string;\n /**\n * If true, shows a loading spinner in place of the message icon of the InlinePrompt\n * @default false\n */\n messageLoading?: boolean;\n description?: React.ReactNode;\n /** @deprecated Use `message` and `type={Sentiment.NEGATIVE}` prop instead. */\n error?: React.ReactNode;\n /** @default Sentiment.NEUTRAL */\n sentiment?: InlinePromptProps['sentiment'];\n className?: string;\n children?: React.ReactNode;\n};\n\nconst Field = ({\n id,\n label,\n required = true,\n message: propMessage,\n messageIconLabel,\n messageLoading,\n hint,\n description = hint,\n sentiment: propType = Sentiment.NEUTRAL,\n className,\n children,\n ...props\n}: FieldProps) => {\n const { formatMessage } = useIntl();\n const labelRef = useRef<HTMLLabelElement>(null);\n const sentiment = props.error ? Sentiment.NEGATIVE : propType;\n const message = propMessage || props.error;\n const hasError = sentiment === Sentiment.NEGATIVE;\n\n const labelId = useId();\n\n const fallbackInputId = useId();\n const inputId = id !== null ? (id ?? fallbackInputId) : undefined;\n\n const messageId = useId();\n const descriptionId = useId();\n const textareaCharCounterId = useId();\n\n const [textareaCharacterCount, setTextareaCharacterCount] =\n useState<TextareaCharacterCountState>(null);\n const handleTextareaCharacterCount = useCallback(\n (state: TextareaCharacterCountState) => setTextareaCharacterCount(state),\n [],\n );\n\n const isNearCharLimit =\n textareaCharacterCount != null &&\n textareaCharacterCount.current >= textareaCharacterCount.max * 0.8;\n\n /**\n * form control can have multiple messages to describe it,\n * e.g the description underneath the label and inline alert\n */\n function ariaDescribedbyByIds() {\n const messageIds = [];\n if (description) {\n messageIds.push(descriptionId);\n }\n if (message) {\n messageIds.push(messageId);\n }\n if (textareaCharacterCount) {\n messageIds.push(textareaCharCounterId);\n }\n return messageIds.length > 0 ? messageIds.join(' ') : undefined;\n }\n\n return (\n <FieldLabelContextProvider value={{ id: labelId, ref: labelRef }}>\n <InputIdContextProvider value={inputId}>\n <InputDescribedByProvider value={ariaDescribedbyByIds()}>\n <InputInvalidProvider value={hasError}>\n <TextareaCharacterCountProvider value={handleTextareaCharacterCount}>\n <div\n className={clsx(\n 'np-field form-group d-block',\n {\n 'has-success': sentiment === Sentiment.POSITIVE,\n 'has-warning': sentiment === Sentiment.WARNING,\n 'has-error': hasError,\n 'has-info': sentiment === Sentiment.NEUTRAL,\n },\n className,\n )}\n >\n {label != null ? (\n <>\n <Label ref={labelRef} id={labelId} htmlFor={inputId}>\n {required ? label : <Label.Optional>{label}</Label.Optional>}\n </Label>\n <Label.Description id={descriptionId}>{description}</Label.Description>\n <div className=\"np-field-control\">{children}</div>\n </>\n ) : (\n children\n )}\n\n {(message || textareaCharacterCount) && (\n <div className=\"np-field-validation\">\n {message && (\n <InlinePrompt\n sentiment={sentiment}\n id={messageId}\n mediaLabel={messageIconLabel}\n className=\"np-field__prompt\"\n loading={messageLoading}\n width=\"full\"\n >\n {message}\n </InlinePrompt>\n )}\n {textareaCharacterCount && (\n <Body\n as=\"span\"\n id={textareaCharCounterId}\n {...(isNearCharLimit\n ? {\n role: 'status' as const,\n 'aria-live': 'polite' as const,\n 'aria-atomic': 'true' as const,\n }\n : {})}\n aria-label={formatMessage(messages.characterCount, {\n current: textareaCharacterCount.current,\n max: textareaCharacterCount.max,\n })}\n className=\"np-field-textarea-char-counter\"\n >\n {textareaCharacterCount.current}/{textareaCharacterCount.max}\n </Body>\n )}\n </div>\n )}\n </div>\n </TextareaCharacterCountProvider>\n </InputInvalidProvider>\n </InputDescribedByProvider>\n </InputIdContextProvider>\n </FieldLabelContextProvider>\n );\n};\n\nexport default Field;\n"],"names":["Field","id","label","required","message","propMessage","messageIconLabel","messageLoading","hint","description","sentiment","propType","Sentiment","NEUTRAL","className","children","props","formatMessage","useIntl","labelRef","useRef","error","NEGATIVE","hasError","labelId","useId","fallbackInputId","inputId","undefined","messageId","descriptionId","textareaCharCounterId","textareaCharacterCount","setTextareaCharacterCount","useState","handleTextareaCharacterCount","useCallback","state","isNearCharLimit","current","max","ariaDescribedbyByIds","messageIds","push","length","join","_jsx","FieldLabelContextProvider","value","ref","InputIdContextProvider","InputDescribedByProvider","InputInvalidProvider","TextareaCharacterCountProvider","_jsxs","clsx","POSITIVE","WARNING","_Fragment","Label","htmlFor","Optional","Description","InlinePrompt","mediaLabel","loading","width","Body","as","role","messages","characterCount"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,MAAMA,KAAK,GAAGA,CAAC;EACbC,EAAE;EACFC,KAAK;AACLC,EAAAA,QAAQ,GAAG,IAAI;AACfC,EAAAA,OAAO,EAAEC,WAAW;EACpBC,gBAAgB;EAChBC,cAAc;EACdC,IAAI;AACJC,EAAAA,WAAW,GAAGD,IAAI;AAClBE,E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B;AAC9B,oBAAA,aAAa,EAAE;mBAChB,GACD,EAAE,CAAA;AACN,kBAAA,YAAA,EAAYpD,aAAa,CAACqD,sBAAQ,CAACC,cAAc,EAAE;oBACjDhC,OAAO,EAAEP,sBAAsB,CAACO,OAAO;oBACvCC,GAAG,EAAER,sBAAsB,CAACQ;AAC7B,mBAAA,CAAE;AACH1B,kBAAAA,SAAS,EAAC,gCAAgC;kBAAAC,QAAA,EAAA,CAEzCiB,sBAAsB,CAACO,OAAO,EAAC,GAAC,EAACP,sBAAsB,CAACQ,GAAG;AAAA,iBACxD,CACP;AAAA,eACE,CACN;aACE;WACyB;SACZ;OACE;KACJ;AAC1B,GAA2B,CAAC;AAEhC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Field.messages.js","sources":["../../src/Field/Field.messages.ts"],"sourcesContent":["import { defineMessages } from 'react-intl';\n\nexport default defineMessages({\n characterCount: {\n id: 'neptune.Field.characterCount',\n defaultMessage: '{current} of {max} characters used',\n },\n});\n"],"names":["defineMessages","characterCount","id"],"mappings":";;;;;;AAEA,eAAeA,wBAAc,CAAC;AAC5BC,EAAAA,cAAc,EAAE;IACdC,EAAE,EAAA;AAEH;AACF,CAAA,CAAC;;;;"}
1
+ {"version":3,"file":"Field.messages.js","sources":["../../src/Field/Field.messages.ts"],"sourcesContent":["import { defineMessages } from 'react-intl';\n\nexport default defineMessages({\n characterCount: {\n id: 'neptune.Field.characterCount',\n defaultMessage: '{current} of {max} characters used',\n },\n});\n"],"names":["defineMessages","characterCount","id"],"mappings":";;;;;;AAEA,eAAeA,wBAAc,CAAC;AAC5BC,EAAAA,cAAc,EAAE;IACdC,EAAE,EAAA;AAEH;AACF,CAAA,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Field.messages.mjs","sources":["../../src/Field/Field.messages.ts"],"sourcesContent":["import { defineMessages } from 'react-intl';\n\nexport default defineMessages({\n characterCount: {\n id: 'neptune.Field.characterCount',\n defaultMessage: '{current} of {max} characters used',\n },\n});\n"],"names":["defineMessages","characterCount","id"],"mappings":";;AAEA,eAAeA,cAAc,CAAC;AAC5BC,EAAAA,cAAc,EAAE;IACdC,EAAE,EAAA;AAEH;AACF,CAAA,CAAC;;;;"}
1
+ {"version":3,"file":"Field.messages.mjs","sources":["../../src/Field/Field.messages.ts"],"sourcesContent":["import { defineMessages } from 'react-intl';\n\nexport default defineMessages({\n characterCount: {\n id: 'neptune.Field.characterCount',\n defaultMessage: '{current} of {max} characters used',\n },\n});\n"],"names":["defineMessages","characterCount","id"],"mappings":";;AAEA,eAAeA,cAAc,CAAC;AAC5BC,EAAAA,cAAc,EAAE;IACdC,EAAE,EAAA;AAEH;AACF,CAAA,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Field.mjs","sources":["../../src/Field/Field.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useCallback, useId, useRef, useState } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport Body from '../Body';\nimport { Sentiment } from '../common';\nimport messages from './Field.messages';\nimport { InlinePrompt, type InlinePromptProps } from '../Prompt';\nimport {\n TextareaCharacterCountProvider,\n type TextareaCharacterCountState,\n FieldLabelContextProvider,\n InputDescribedByProvider,\n InputIdContextProvider,\n InputInvalidProvider,\n} from '../Inputs/contexts';\nimport Label from '../Label';\n\nexport type FieldProps = {\n /** `null` disables auto-generating the `id` attribute, falling back to nesting-based label association over setting `htmlFor` explicitly. */\n id?: string | null;\n /** Should be specified unless the wrapped control has its own labeling mechanism, e.g. `Checkbox`. */\n label?: React.ReactNode;\n /** @default true */\n required?: boolean;\n /** @deprecated Use `description` prop instead. */\n hint?: React.ReactNode;\n message?: React.ReactNode;\n /**\n * Override for the [InlinePrompt icon's default, accessible name](/?path=/docs/other-statusicon-accessibility--docs)\n * announced by the screen readers\n * */\n messageIconLabel?: string;\n /**\n * If true, shows a loading spinner in place of the message icon of the InlinePrompt\n * @default false\n */\n messageLoading?: boolean;\n description?: React.ReactNode;\n /** @deprecated Use `message` and `type={Sentiment.NEGATIVE}` prop instead. */\n error?: React.ReactNode;\n /** @default Sentiment.NEUTRAL */\n sentiment?: InlinePromptProps['sentiment'];\n className?: string;\n children?: React.ReactNode;\n};\n\nconst Field = ({\n id,\n label,\n required = true,\n message: propMessage,\n messageIconLabel,\n messageLoading,\n hint,\n description = hint,\n sentiment: propType = Sentiment.NEUTRAL,\n className,\n children,\n ...props\n}: FieldProps) => {\n const { formatMessage } = useIntl();\n const labelRef = useRef<HTMLLabelElement>(null);\n const sentiment = props.error ? Sentiment.NEGATIVE : propType;\n const message = propMessage || props.error;\n const hasError = sentiment === Sentiment.NEGATIVE;\n\n const labelId = useId();\n\n const fallbackInputId = useId();\n const inputId = id !== null ? (id ?? fallbackInputId) : undefined;\n\n const messageId = useId();\n const descriptionId = useId();\n const textareaCharCounterId = useId();\n\n const [textareaCharacterCount, setTextareaCharacterCount] =\n useState<TextareaCharacterCountState>(null);\n const handleTextareaCharacterCount = useCallback(\n (state: TextareaCharacterCountState) => setTextareaCharacterCount(state),\n [],\n );\n\n const isNearCharLimit =\n textareaCharacterCount != null &&\n textareaCharacterCount.current >= textareaCharacterCount.max * 0.8;\n\n /**\n * form control can have multiple messages to describe it,\n * e.g the description underneath the label and inline alert\n */\n function ariaDescribedbyByIds() {\n const messageIds = [];\n if (description) {\n messageIds.push(descriptionId);\n }\n if (message) {\n messageIds.push(messageId);\n }\n if (textareaCharacterCount) {\n messageIds.push(textareaCharCounterId);\n }\n return messageIds.length > 0 ? messageIds.join(' ') : undefined;\n }\n\n return (\n <FieldLabelContextProvider value={{ id: labelId, ref: labelRef }}>\n <InputIdContextProvider value={inputId}>\n <InputDescribedByProvider value={ariaDescribedbyByIds()}>\n <InputInvalidProvider value={hasError}>\n <TextareaCharacterCountProvider value={handleTextareaCharacterCount}>\n <div\n className={clsx(\n 'np-field form-group d-block',\n {\n 'has-success': sentiment === Sentiment.POSITIVE,\n 'has-warning': sentiment === Sentiment.WARNING,\n 'has-error': hasError,\n 'has-info': sentiment === Sentiment.NEUTRAL,\n },\n className,\n )}\n >\n {label != null ? (\n <>\n <Label ref={labelRef} id={labelId} htmlFor={inputId}>\n {required ? label : <Label.Optional>{label}</Label.Optional>}\n </Label>\n <Label.Description id={descriptionId}>{description}</Label.Description>\n <div className=\"np-field-control\">{children}</div>\n </>\n ) : (\n children\n )}\n\n {(message || textareaCharacterCount) && (\n <div className=\"np-field-validation\">\n {message && (\n <InlinePrompt\n sentiment={sentiment}\n id={messageId}\n mediaLabel={messageIconLabel}\n className=\"np-field__prompt\"\n loading={messageLoading}\n width=\"full\"\n >\n {message}\n </InlinePrompt>\n )}\n {textareaCharacterCount && (\n <Body\n as=\"span\"\n id={textareaCharCounterId}\n {...(isNearCharLimit\n ? {\n role: 'status' as const,\n 'aria-live': 'polite' as const,\n 'aria-atomic': 'true' as const,\n }\n : {})}\n aria-label={formatMessage(messages.characterCount, {\n current: textareaCharacterCount.current,\n max: textareaCharacterCount.max,\n })}\n className=\"np-field-textarea-char-counter\"\n >\n {textareaCharacterCount.current}/{textareaCharacterCount.max}\n </Body>\n )}\n </div>\n )}\n </div>\n </TextareaCharacterCountProvider>\n </InputInvalidProvider>\n </InputDescribedByProvider>\n </InputIdContextProvider>\n </FieldLabelContextProvider>\n );\n};\n\nexport default Field;\n"],"names":["Field","id","label","required","message","propMessage","messageIconLabel","messageLoading","hint","description","sentiment","propType","Sentiment","NEUTRAL","className","children","props","formatMessage","useIntl","labelRef","useRef","error","NEGATIVE","hasError","labelId","useId","fallbackInputId","inputId","undefined","messageId","descriptionId","textareaCharCounterId","textareaCharacterCount","setTextareaCharacterCount","useState","handleTextareaCharacterCount","useCallback","state","isNearCharLimit","current","max","ariaDescribedbyByIds","messageIds","push","length","join","_jsx","FieldLabelContextProvider","value","ref","InputIdContextProvider","InputDescribedByProvider","InputInvalidProvider","TextareaCharacterCountProvider","_jsxs","clsx","POSITIVE","WARNING","_Fragment","Label","htmlFor","Optional","Description","InlinePrompt","mediaLabel","loading","width","Body","as","role","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AnD,kBAAAA,QAAA,EAEXX;AAAO,iBACI,CACf,EACA4B,sBAAsB,iBACrBsB,IAAA,CAACa,IAAI,EAAA;AACHC,kBAAAA,EAAE,EAAC,MAAM;AACTnE,kBAAAA,EAAE,EAAE8B,qBAAsB;AAAA,kBAAA,IACrBO,eAAe,GAChB;AACE+B,oBAAAA,IAAI,EAAE,QAAiB;AACvB,oBAAA,WAAW,EAAE,QAAiB;AAC9B,oBAAA,aAAa,EAAE;mBAChB,GACD,EAAE,CAAA;AACN,kBAAA,YAAA,EAAYpD,aAAa,CAACqD,QAAQ,CAACC,cAAc,EAAE;oBACjDhC,OAAO,EAAEP,sBAAsB,CAACO,OAAO;oBACvCC,GAAG,EAAER,sBAAsB,CAACQ;AAC7B,mBAAA,CAAE;AACH1B,kBAAAA,SAAS,EAAC,gCAAgC;kBAAAC,QAAA,EAAA,CAEzCiB,sBAAsB,CAACO,OAAO,EAAC,GAAC,EAACP,sBAAsB,CAACQ,GAAG;AAAA,iBACxD,CACP;AAAA,eACE,CACN;aACE;WACyB;SACZ;OACE;KACJ;AAC1B,GAA2B,CAAC;AAEhC;;;;"}
1
+ {"version":3,"file":"Field.mjs","sources":["../../src/Field/Field.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useCallback, useId, useRef, useState } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport Body from '../Body';\nimport { Sentiment } from '../common';\nimport messages from './Field.messages';\nimport { InlinePrompt, type InlinePromptProps } from '../Prompt';\nimport {\n TextareaCharacterCountProvider,\n type TextareaCharacterCountState,\n FieldLabelContextProvider,\n InputDescribedByProvider,\n InputIdContextProvider,\n InputInvalidProvider,\n} from '../Inputs/contexts';\nimport Label from '../Label';\n\nexport type FieldProps = {\n /** `null` disables auto-generating the `id` attribute, falling back to nesting-based label association over setting `htmlFor` explicitly. */\n id?: string | null;\n /** Should be specified unless the wrapped control has its own labeling mechanism, e.g. `Checkbox`. */\n label?: React.ReactNode;\n /** @default true */\n required?: boolean;\n /** @deprecated Use `description` prop instead. */\n hint?: React.ReactNode;\n message?: React.ReactNode;\n /**\n * Override for the [InlinePrompt icon's default, accessible name](/?path=/docs/other-statusicon-accessibility--docs)\n * announced by the screen readers\n * */\n messageIconLabel?: string;\n /**\n * If true, shows a loading spinner in place of the message icon of the InlinePrompt\n * @default false\n */\n messageLoading?: boolean;\n description?: React.ReactNode;\n /** @deprecated Use `message` and `type={Sentiment.NEGATIVE}` prop instead. */\n error?: React.ReactNode;\n /** @default Sentiment.NEUTRAL */\n sentiment?: InlinePromptProps['sentiment'];\n className?: string;\n children?: React.ReactNode;\n};\n\nconst Field = ({\n id,\n label,\n required = true,\n message: propMessage,\n messageIconLabel,\n messageLoading,\n hint,\n description = hint,\n sentiment: propType = Sentiment.NEUTRAL,\n className,\n children,\n ...props\n}: FieldProps) => {\n const { formatMessage } = useIntl();\n const labelRef = useRef<HTMLLabelElement>(null);\n const sentiment = props.error ? Sentiment.NEGATIVE : propType;\n const message = propMessage || props.error;\n const hasError = sentiment === Sentiment.NEGATIVE;\n\n const labelId = useId();\n\n const fallbackInputId = useId();\n const inputId = id !== null ? (id ?? fallbackInputId) : undefined;\n\n const messageId = useId();\n const descriptionId = useId();\n const textareaCharCounterId = useId();\n\n const [textareaCharacterCount, setTextareaCharacterCount] =\n useState<TextareaCharacterCountState>(null);\n const handleTextareaCharacterCount = useCallback(\n (state: TextareaCharacterCountState) => setTextareaCharacterCount(state),\n [],\n );\n\n const isNearCharLimit =\n textareaCharacterCount != null &&\n textareaCharacterCount.current >= textareaCharacterCount.max * 0.8;\n\n /**\n * form control can have multiple messages to describe it,\n * e.g the description underneath the label and inline alert\n */\n function ariaDescribedbyByIds() {\n const messageIds = [];\n if (description) {\n messageIds.push(descriptionId);\n }\n if (message) {\n messageIds.push(messageId);\n }\n if (textareaCharacterCount) {\n messageIds.push(textareaCharCounterId);\n }\n return messageIds.length > 0 ? messageIds.join(' ') : undefined;\n }\n\n return (\n <FieldLabelContextProvider value={{ id: labelId, ref: labelRef }}>\n <InputIdContextProvider value={inputId}>\n <InputDescribedByProvider value={ariaDescribedbyByIds()}>\n <InputInvalidProvider value={hasError}>\n <TextareaCharacterCountProvider value={handleTextareaCharacterCount}>\n <div\n className={clsx(\n 'np-field form-group d-block',\n {\n 'has-success': sentiment === Sentiment.POSITIVE,\n 'has-warning': sentiment === Sentiment.WARNING,\n 'has-error': hasError,\n 'has-info': sentiment === Sentiment.NEUTRAL,\n },\n className,\n )}\n >\n {label != null ? (\n <>\n <Label ref={labelRef} id={labelId} htmlFor={inputId}>\n {required ? label : <Label.Optional>{label}</Label.Optional>}\n </Label>\n <Label.Description id={descriptionId}>{description}</Label.Description>\n <div className=\"np-field-control\">{children}</div>\n </>\n ) : (\n children\n )}\n\n {(message || textareaCharacterCount) && (\n <div className=\"np-field-validation\">\n {message && (\n <InlinePrompt\n sentiment={sentiment}\n id={messageId}\n mediaLabel={messageIconLabel}\n className=\"np-field__prompt\"\n loading={messageLoading}\n width=\"full\"\n >\n {message}\n </InlinePrompt>\n )}\n {textareaCharacterCount && (\n <Body\n as=\"span\"\n id={textareaCharCounterId}\n {...(isNearCharLimit\n ? {\n role: 'status' as const,\n 'aria-live': 'polite' as const,\n 'aria-atomic': 'true' as const,\n }\n : {})}\n aria-label={formatMessage(messages.characterCount, {\n current: textareaCharacterCount.current,\n max: textareaCharacterCount.max,\n })}\n className=\"np-field-textarea-char-counter\"\n >\n {textareaCharacterCount.current}/{textareaCharacterCount.max}\n </Body>\n )}\n </div>\n )}\n </div>\n </TextareaCharacterCountProvider>\n </InputInvalidProvider>\n </InputDescribedByProvider>\n </InputIdContextProvider>\n </FieldLabelContextProvider>\n );\n};\n\nexport default Field;\n"],"names":["Field","id","label","required","message","propMessage","messageIconLabel","messageLoading","hint","description","sentiment","propType","Sentiment","NEUTRAL","className","children","props","formatMessage","useIntl","labelRef","useRef","error","NEGATIVE","hasError","labelId","useId","fallbackInputId","inputId","undefined","messageId","descriptionId","textareaCharCounterId","textareaCharacterCount","setTextareaCharacterCount","useState","handleTextareaCharacterCount","useCallback","state","isNearCharLimit","current","max","ariaDescribedbyByIds","messageIds","push","length","join","_jsx","FieldLabelContextProvider","value","ref","InputIdContextProvider","InputDescribedByProvider","InputInvalidProvider","TextareaCharacterCountProvider","_jsxs","clsx","POSITIVE","WARNING","_Fragment","Label","htmlFor","Optional","Description","InlinePrompt","mediaLabel","loading","width","Body","as","role","messages","characterCount"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,MAAMA,KAAK,GAAGA,CAAC;EACbC,EAAE;EACFC,KAAK;AACLC,EAAAA,QAAQ,GAAG,IAAI;AACfC,EAAAA,OAAO,EAAEC,WAAW;EACpBC,gBAAgB;EAChBC,cAAc;EACdC,IAAI;AACJC,EAAAA,WAAW,GAAGD,IAAI;AAClBE,EAAAA,SAAS,EAAEC,QAAQ,GAAGC,SAAS,CAACC,OAAO;EACvCC,SAAS;EACTC,QAAQ;EACR,GAAGC;AAAK,CACG,KAAI;EACf,MAAM;AAAEC,IAAAA;GAAe,GAAGC,OAAO,EAAE;AACnC,EAAA,MAAMC,QAAQ,GAAGC,MAAM,CAAmB,IAAI,CAAC;EAC/C,MAAMV,SAAS,GAAGM,KAAK,CAACK,KAAK,GAAGT,SAAS,CAACU,QAAQ,GAAGX,QAAQ;AAC7D,EAAA,MAAMP,OAAO,GAAGC,WAAW,IAAIW,KAAK,CAACK,KAAK;AAC1C,EAAA,MAAME,QAAQ,GAAGb,SAAS,KAAKE,SAAS,CAACU,QAAQ;AAEjD,EAAA,MAAME,OAAO,GAAGC,KAAK,EAAE;AAEvB,EAAA,MAAMC,eAAe,GAAGD,KAAK,EAAE;EAC/B,MAAME,OAAO,GAAG1B,EAAE,KAAK,IAAI,GAAIA,EAAE,IAAIyB,eAAe,GAAIE,SAAS;AAEjE,EAAA,MAAMC,SAAS,GAAGJ,KAAK,EAAE;AACzB,EAAA,MAAMK,aAAa,GAAGL,KAAK,EAAE;AA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0C,GAAA,CAACiB,YAAY,EAAA;AACXrD,kBAAAA,SAAS,EAAEA,SAAU;AACrBT,kBAAAA,EAAE,EAAE4B,SAAU;AACdmC,kBAAAA,UAAU,EAAE1D,gBAAiB;AAC7BQ,kBAAAA,SAAS,EAAC,kBAAkB;AAC5BmD,kBAAAA,OAAO,EAAE1D,cAAe;AACxB2D,kBAAAA,KAAK,EAAC,MAAM;AAAAnD,kBAAAA,QAAA,EAEXX;AAAO,iBACI,CACf,EACA4B,sBAAsB,iBACrBsB,IAAA,CAACa,IAAI,EAAA;AACHC,kBAAAA,EAAE,EAAC,MAAM;AACTnE,kBAAAA,EAAE,EAAE8B,qBAAsB;AAAA,kBAAA,IACrBO,eAAe,GAChB;AACE+B,oBAAAA,IAAI,EAAE,QAAiB;AACvB,oBAAA,WAAW,EAAE,QAAiB;AAC9B,oBAAA,aAAa,EAAE;mBAChB,GACD,EAAE,CAAA;AACN,kBAAA,YAAA,EAAYpD,aAAa,CAACqD,QAAQ,CAACC,cAAc,EAAE;oBACjDhC,OAAO,EAAEP,sBAAsB,CAACO,OAAO;oBACvCC,GAAG,EAAER,sBAAsB,CAACQ;AAC7B,mBAAA,CAAE;AACH1B,kBAAAA,SAAS,EAAC,gCAAgC;kBAAAC,QAAA,EAAA,CAEzCiB,sBAAsB,CAACO,OAAO,EAAC,GAAC,EAACP,sBAAsB,CAACQ,GAAG;AAAA,iBACxD,CACP;AAAA,eACE,CACN;aACE;WACyB;SACZ;OACE;KACJ;AAC1B,GAA2B,CAAC;AAEhC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AnimatedLabel.js","sources":["../../../src/FlowNavigation/AnimatedLabel/AnimatedLabel.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useId, useState } from 'react';\n\nimport type { Step } from '../../Stepper/Stepper';\nimport BottomSheet from '../../common/BottomSheet';\nimport Option from '../../common/Option';\nimport { Check, ChevronDown } from '@transferwise/icons';\nimport { OverlayIdContext, OverlayIdProvider } from '../../Provider/overlay/OverlayIdProvider';\nimport List from '../../List';\n\nexport interface AnimatedLabelProps {\n activeLabel: number;\n className?: string;\n steps: readonly Step[];\n}\n\nconst AnimatedLabel = ({ activeLabel, className, steps }: AnimatedLabelProps) => {\n const labelId = useId();\n const [showSteps, setShowSteps] = useState(false);\n\n function handleStepAction(onClick: Step['onClick']) {\n return () => {\n setShowSteps(false);\n onClick?.();\n };\n }\n\n return (\n <OverlayIdProvider open={showSteps}>\n <OverlayIdContext.Consumer>\n {(overlayId) => {\n return (\n <>\n <button\n type=\"button\"\n id={labelId}\n aria-haspopup=\"menu\"\n aria-controls={overlayId}\n aria-expanded={showSteps}\n className={clsx(\n 'np-animated-label',\n 'btn-unstyled',\n 'np-text-body-large-bold',\n className,\n )}\n onClick={() => setShowSteps(true)}\n >\n {steps.map(({ label }, index) => {\n const isCurrentStep = activeLabel === index;\n const previousIndex = index - 1;\n return (\n <div\n key={previousIndex}\n aria-hidden={!isCurrentStep}\n className={clsx('text-xs-center', 'd-inline-flex', 'align-items-center', {\n 'np-animated-label--active text-ellipsis': isCurrentStep,\n })}\n >\n {label} <ChevronDown />\n </div>\n );\n })}\n </button>\n <BottomSheet\n role=\"menu\"\n aria-labelledby={labelId}\n open={showSteps}\n onClose={() => setShowSteps(false)}\n >\n <List className=\"m-b-0 p-a-1\">\n {steps.map((step, index) => {\n const isCurrentStep = activeLabel === index;\n const isDisabled = activeLabel < index;\n const itemId = `step-${index}`;\n return (\n <Option\n key={itemId}\n id={itemId}\n as=\"li\"\n role=\"menuitem\"\n decision={false}\n className={clsx('np-animated-label-option', 'p-x-3', 'p-y-1', 'm-y-1', {\n clickable: !isDisabled,\n })}\n title={step.label}\n content={step.hoverLabel}\n button={isCurrentStep ? <Check size={24} /> : null}\n aria-current={isCurrentStep ? 'step' : false}\n aria-disabled={isDisabled}\n disabled={isDisabled}\n isContainerAligned\n {...(!isDisabled && {\n tabIndex: 0,\n onClick: handleStepAction(step.onClick),\n onKeyDown: (event) => {\n event.preventDefault();\n if (event.code === 'Enter' || event.code === 'Space') {\n handleStepAction(step.onClick)();\n }\n },\n })}\n />\n );\n })}\n </List>\n </BottomSheet>\n </>\n );\n }}\n </OverlayIdContext.Consumer>\n </OverlayIdProvider>\n );\n};\n\nexport default AnimatedLabel;\n"],"names":["AnimatedLabel","activeLabel","className","steps","labelId","useId","showSteps","setShowSteps","useState","handleStepAction","onClick","_jsx","OverlayIdProvider","open","children","OverlayIdContext","Consumer","overlayId","_jsxs","_Fragment","type","id","clsx","map","label","index","isCurrentStep","previousIndex","ChevronDown","BottomSheet","role","onClose","List","step","isDisabled","itemId","Option","as","decision","clickable","title","content","hoverLabel","button","Check","size","disabled","isContainerAligned","tabIndex","onKeyDown","event","preventDefault","code"],"mappings":";;;;;;;;;;;;;AAgBA,MAAMA,aAAa,GAAGA,CAAC;EAAEC,WAAW;EAAEC,SAAS;AAAEC,EAAAA;AAAK,CAAsB,KAAI;AAC9E,EAAA,MAAMC,OAAO,GAAGC,WAAK,EAAE;EACvB,MAAM,CAACC,SAAS,EAAEC,YAAY,CAAC,GAAGC,cAAQ,CAAC,KAAK,CAAC;EAEjD,SAASC,gBAAgBA,CAACC,OAAwB,EAAA;AAChD,IAAA,OAAO,MAAK;MACVH,YAAY,CAAC,KAAK,CAAC;AACnBG,MAAAA,OAAO,IAAI;IACb,CAAC;AACH,EAAA;EAEA,oBACEC,cAAA,CAACC,mCAAiB,EAAA;AAACC,IAAAA,IAAI,EAAEP,SAAU;AAAAQ,IAAAA,QAAA,eACjCH,cAAA,CAACI,kCAAgB,CAACC,QAAQ,EAAA;MAAAF,QAAA,EACtBG,SAAS,IAAI;QACb,oBACEC,eAAA,CAAAC,mBAAA,EAAA;AAAAL,UAAAA,QAAA,gBACEH,cAAA,CAAA,QAAA,EAAA;AACES,YAAAA,IAAI,EAAC,QAAQ;AACbC,YAAAA,EAAE,EAAEjB,OAAQ;AACZ,YAAA,eAAA,EAAc,MAAM;AACpB,YAAA,eAAA,EAAea,SAAU;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}
1
+ {"version":3,"file":"AnimatedLabel.js","sources":["../../../src/FlowNavigation/AnimatedLabel/AnimatedLabel.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useId, useState } from 'react';\n\nimport type { Step } from '../../Stepper/Stepper';\nimport BottomSheet from '../../common/BottomSheet';\nimport Option from '../../common/Option';\nimport { Check, ChevronDown } from '@transferwise/icons';\nimport { OverlayIdContext, OverlayIdProvider } from '../../Provider/overlay/OverlayIdProvider';\nimport List from '../../List';\n\nexport interface AnimatedLabelProps {\n activeLabel: number;\n className?: string;\n steps: readonly Step[];\n}\n\nconst AnimatedLabel = ({ activeLabel, className, steps }: AnimatedLabelProps) => {\n const labelId = useId();\n const [showSteps, setShowSteps] = useState(false);\n\n function handleStepAction(onClick: Step['onClick']) {\n return () => {\n setShowSteps(false);\n onClick?.();\n };\n }\n\n return (\n <OverlayIdProvider open={showSteps}>\n <OverlayIdContext.Consumer>\n {(overlayId) => {\n return (\n <>\n <button\n type=\"button\"\n id={labelId}\n aria-haspopup=\"menu\"\n aria-controls={overlayId}\n aria-expanded={showSteps}\n className={clsx(\n 'np-animated-label',\n 'btn-unstyled',\n 'np-text-body-large-bold',\n className,\n )}\n onClick={() => setShowSteps(true)}\n >\n {steps.map(({ label }, index) => {\n const isCurrentStep = activeLabel === index;\n const previousIndex = index - 1;\n return (\n <div\n key={previousIndex}\n aria-hidden={!isCurrentStep}\n className={clsx('text-xs-center', 'd-inline-flex', 'align-items-center', {\n 'np-animated-label--active text-ellipsis': isCurrentStep,\n })}\n >\n {label} <ChevronDown />\n </div>\n );\n })}\n </button>\n <BottomSheet\n role=\"menu\"\n aria-labelledby={labelId}\n open={showSteps}\n onClose={() => setShowSteps(false)}\n >\n <List className=\"m-b-0 p-a-1\">\n {steps.map((step, index) => {\n const isCurrentStep = activeLabel === index;\n const isDisabled = activeLabel < index;\n const itemId = `step-${index}`;\n return (\n <Option\n key={itemId}\n id={itemId}\n as=\"li\"\n role=\"menuitem\"\n decision={false}\n className={clsx('np-animated-label-option', 'p-x-3', 'p-y-1', 'm-y-1', {\n clickable: !isDisabled,\n })}\n title={step.label}\n content={step.hoverLabel}\n button={isCurrentStep ? <Check size={24} /> : null}\n aria-current={isCurrentStep ? 'step' : false}\n aria-disabled={isDisabled}\n disabled={isDisabled}\n isContainerAligned\n {...(!isDisabled && {\n tabIndex: 0,\n onClick: handleStepAction(step.onClick),\n onKeyDown: (event) => {\n event.preventDefault();\n if (event.code === 'Enter' || event.code === 'Space') {\n handleStepAction(step.onClick)();\n }\n },\n })}\n />\n );\n })}\n </List>\n </BottomSheet>\n </>\n );\n }}\n </OverlayIdContext.Consumer>\n </OverlayIdProvider>\n );\n};\n\nexport default AnimatedLabel;\n"],"names":["AnimatedLabel","activeLabel","className","steps","labelId","useId","showSteps","setShowSteps","useState","handleStepAction","onClick","_jsx","OverlayIdProvider","open","children","OverlayIdContext","Consumer","overlayId","_jsxs","_Fragment","type","id","clsx","map","label","index","isCurrentStep","previousIndex","ChevronDown","BottomSheet","role","onClose","List","step","isDisabled","itemId","Option","as","decision","clickable","title","content","hoverLabel","button","Check","size","disabled","isContainerAligned","tabIndex","onKeyDown","event","preventDefault","code"],"mappings":";;;;;;;;;;;;;AAgBA,MAAMA,aAAa,GAAGA,CAAC;EAAEC,WAAW;EAAEC,SAAS;AAAEC,EAAAA;AAAK,CAAsB,KAAI;AAC9E,EAAA,MAAMC,OAAO,GAAGC,WAAK,EAAE;EACvB,MAAM,CAACC,SAAS,EAAEC,YAAY,CAAC,GAAGC,cAAQ,CAAC,KAAK,CAAC;EAEjD,SAASC,gBAAgBA,CAACC,OAAwB,EAAA;AAChD,IAAA,OAAO,MAAK;MACVH,YAAY,CAAC,KAAK,CAAC;AACnBG,MAAAA,OAAO,IAAI;IACb,CAAC;AACH,EAAA;EAEA,oBACEC,cAAA,CAACC,mCAAiB,EAAA;AAACC,IAAAA,IAAI,EAAEP,SAAU;AAAAQ,IAAAA,QAAA,eACjCH,cAAA,CAACI,kCAAgB,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F,KAAK,CAACE,IAAI,KAAK,OAAO,EAAE;AACpD3C,wBAAAA,gBAAgB,CAACwB,IAAI,CAACvB,OAAO,CAAC,EAAE;AAClC,sBAAA;AACF,oBAAA;mBACD;AAAA,iBAAA,EAxBIyB,MAwBF,CACH;cAEN,CAAC;aACG;AACR,WAAa,CACf;AAAA,SAAA,CAAG;AAEP,MAAA;KACyB;AAC7B,GAAmB,CAAC;AAExB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AnimatedLabel.mjs","sources":["../../../src/FlowNavigation/AnimatedLabel/AnimatedLabel.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useId, useState } from 'react';\n\nimport type { Step } from '../../Stepper/Stepper';\nimport BottomSheet from '../../common/BottomSheet';\nimport Option from '../../common/Option';\nimport { Check, ChevronDown } from '@transferwise/icons';\nimport { OverlayIdContext, OverlayIdProvider } from '../../Provider/overlay/OverlayIdProvider';\nimport List from '../../List';\n\nexport interface AnimatedLabelProps {\n activeLabel: number;\n className?: string;\n steps: readonly Step[];\n}\n\nconst AnimatedLabel = ({ activeLabel, className, steps }: AnimatedLabelProps) => {\n const labelId = useId();\n const [showSteps, setShowSteps] = useState(false);\n\n function handleStepAction(onClick: Step['onClick']) {\n return () => {\n setShowSteps(false);\n onClick?.();\n };\n }\n\n return (\n <OverlayIdProvider open={showSteps}>\n <OverlayIdContext.Consumer>\n {(overlayId) => {\n return (\n <>\n <button\n type=\"button\"\n id={labelId}\n aria-haspopup=\"menu\"\n aria-controls={overlayId}\n aria-expanded={showSteps}\n className={clsx(\n 'np-animated-label',\n 'btn-unstyled',\n 'np-text-body-large-bold',\n className,\n )}\n onClick={() => setShowSteps(true)}\n >\n {steps.map(({ label }, index) => {\n const isCurrentStep = activeLabel === index;\n const previousIndex = index - 1;\n return (\n <div\n key={previousIndex}\n aria-hidden={!isCurrentStep}\n className={clsx('text-xs-center', 'd-inline-flex', 'align-items-center', {\n 'np-animated-label--active text-ellipsis': isCurrentStep,\n })}\n >\n {label} <ChevronDown />\n </div>\n );\n })}\n </button>\n <BottomSheet\n role=\"menu\"\n aria-labelledby={labelId}\n open={showSteps}\n onClose={() => setShowSteps(false)}\n >\n <List className=\"m-b-0 p-a-1\">\n {steps.map((step, index) => {\n const isCurrentStep = activeLabel === index;\n const isDisabled = activeLabel < index;\n const itemId = `step-${index}`;\n return (\n <Option\n key={itemId}\n id={itemId}\n as=\"li\"\n role=\"menuitem\"\n decision={false}\n className={clsx('np-animated-label-option', 'p-x-3', 'p-y-1', 'm-y-1', {\n clickable: !isDisabled,\n })}\n title={step.label}\n content={step.hoverLabel}\n button={isCurrentStep ? <Check size={24} /> : null}\n aria-current={isCurrentStep ? 'step' : false}\n aria-disabled={isDisabled}\n disabled={isDisabled}\n isContainerAligned\n {...(!isDisabled && {\n tabIndex: 0,\n onClick: handleStepAction(step.onClick),\n onKeyDown: (event) => {\n event.preventDefault();\n if (event.code === 'Enter' || event.code === 'Space') {\n handleStepAction(step.onClick)();\n }\n },\n })}\n />\n );\n })}\n </List>\n </BottomSheet>\n </>\n );\n }}\n </OverlayIdContext.Consumer>\n </OverlayIdProvider>\n );\n};\n\nexport default AnimatedLabel;\n"],"names":["AnimatedLabel","activeLabel","className","steps","labelId","useId","showSteps","setShowSteps","useState","handleStepAction","onClick","_jsx","OverlayIdProvider","open","children","OverlayIdContext","Consumer","overlayId","_jsxs","_Fragment","type","id","clsx","map","label","index","isCurrentStep","previousIndex","ChevronDown","BottomSheet","role","onClose","List","step","isDisabled","itemId","Option","as","decision","clickable","title","content","hoverLabel","button","Check","size","disabled","isContainerAligned","tabIndex","onKeyDown","event","preventDefault","code"],"mappings":";;;;;;;;;AAgBA,MAAMA,aAAa,GAAGA,CAAC;EAAEC,WAAW;EAAEC,SAAS;AAAEC,EAAAA;AAAK,CAAsB,KAAI;AAC9E,EAAA,MAAMC,OAAO,GAAGC,KAAK,EAAE;EACvB,MAAM,CAACC,SAAS,EAAEC,YAAY,CAAC,GAAGC,QAAQ,CAAC,K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Ba,kBAAkB,EAAA,IAAA;kBAAA,IACb,CAACb,UAAU,IAAI;AAClBc,oBAAAA,QAAQ,EAAE,CAAC;AACXtC,oBAAAA,OAAO,EAAED,gBAAgB,CAACwB,IAAI,CAACvB,OAAO,CAAC;oBACvCuC,SAAS,EAAGC,KAAK,IAAI;sBACnBA,KAAK,CAACC,cAAc,EAAE;sBACtB,IAAID,KAAK,CAACE,IAAI,KAAK,OAAO,IAAIF,KAAK,CAACE,IAAI,KAAK,OAAO,EAAE;AACpD3C,wBAAAA,gBAAgB,CAACwB,IAAI,CAACvB,OAAO,CAAC,EAAE;AAClC,sBAAA;AACF,oBAAA;mBACD;AAAA,iBAAA,EAxBIyB,MAwBF,CACH;cAEN,CAAC;aACG;AACR,WAAa,CACf;AAAA,SAAA,CAAG;AAEP,MAAA;KACyB;AAC7B,GAAmB,CAAC;AAExB;;;;"}
1
+ {"version":3,"file":"AnimatedLabel.mjs","sources":["../../../src/FlowNavigation/AnimatedLabel/AnimatedLabel.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useId, useState } from 'react';\n\nimport type { Step } from '../../Stepper/Stepper';\nimport BottomSheet from '../../common/BottomSheet';\nimport Option from '../../common/Option';\nimport { Check, ChevronDown } from '@transferwise/icons';\nimport { OverlayIdContext, OverlayIdProvider } from '../../Provider/overlay/OverlayIdProvider';\nimport List from '../../List';\n\nexport interface AnimatedLabelProps {\n activeLabel: number;\n className?: string;\n steps: readonly Step[];\n}\n\nconst AnimatedLabel = ({ activeLabel, className, steps }: AnimatedLabelProps) => {\n const labelId = useId();\n const [showSteps, setShowSteps] = useState(false);\n\n function handleStepAction(onClick: Step['onClick']) {\n return () => {\n setShowSteps(false);\n onClick?.();\n };\n }\n\n return (\n <OverlayIdProvider open={showSteps}>\n <OverlayIdContext.Consumer>\n {(overlayId) => {\n return (\n <>\n <button\n type=\"button\"\n id={labelId}\n aria-haspopup=\"menu\"\n aria-controls={overlayId}\n aria-expanded={showSteps}\n className={clsx(\n 'np-animated-label',\n 'btn-unstyled',\n 'np-text-body-large-bold',\n className,\n )}\n onClick={() => setShowSteps(true)}\n >\n {steps.map(({ label }, index) => {\n const isCurrentStep = activeLabel === index;\n const previousIndex = index - 1;\n return (\n <div\n key={previousIndex}\n aria-hidden={!isCurrentStep}\n className={clsx('text-xs-center', 'd-inline-flex', 'align-items-center', {\n 'np-animated-label--active text-ellipsis': isCurrentStep,\n })}\n >\n {label} <ChevronDown />\n </div>\n );\n })}\n </button>\n <BottomSheet\n role=\"menu\"\n aria-labelledby={labelId}\n open={showSteps}\n onClose={() => setShowSteps(false)}\n >\n <List className=\"m-b-0 p-a-1\">\n {steps.map((step, index) => {\n const isCurrentStep = activeLabel === index;\n const isDisabled = activeLabel < index;\n const itemId = `step-${index}`;\n return (\n <Option\n key={itemId}\n id={itemId}\n as=\"li\"\n role=\"menuitem\"\n decision={false}\n className={clsx('np-animated-label-option', 'p-x-3', 'p-y-1', 'm-y-1', {\n clickable: !isDisabled,\n })}\n title={step.label}\n content={step.hoverLabel}\n button={isCurrentStep ? <Check size={24} /> : null}\n aria-current={isCurrentStep ? 'step' : false}\n aria-disabled={isDisabled}\n disabled={isDisabled}\n isContainerAligned\n {...(!isDisabled && {\n tabIndex: 0,\n onClick: handleStepAction(step.onClick),\n onKeyDown: (event) => {\n event.preventDefault();\n if (event.code === 'Enter' || event.code === 'Space') {\n handleStepAction(step.onClick)();\n }\n },\n })}\n />\n );\n })}\n </List>\n </BottomSheet>\n </>\n );\n }}\n </OverlayIdContext.Consumer>\n </OverlayIdProvider>\n );\n};\n\nexport default AnimatedLabel;\n"],"names":["AnimatedLabel","activeLabel","className","steps","labelId","useId","showSteps","setShowSteps","useState","handleStepAction","onClick","_jsx","OverlayIdProvider","open","children","OverlayIdContext","Consumer","overlayId","_jsxs","_Fragment","type","id","clsx","map","label","index","isCurrentStep","previousIndex","ChevronDown","BottomSheet","role","onClose","List","step","isDisabled","itemId","Option","as","decision","clickable","title","content","hoverLabel","button","Check","size","disab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AACS,UAAW;AACzBC,kBAAAA,MAAM,EAAEjB,aAAa,gBAAGf,GAAA,CAACiC,KAAK,EAAA;AAACC,oBAAAA,IAAI,EAAE;oBAAM,GAAG,IAAK;AACnD,kBAAA,cAAA,EAAcnB,aAAa,GAAG,MAAM,GAAG,KAAM;AAC7C,kBAAA,eAAA,EAAeQ,UAAW;AAC1BY,kBAAAA,QAAQ,EAAEZ,UAAW;kBACrBa,kBAAkB,EAAA,IAAA;kBAAA,IACb,CAACb,UAAU,IAAI;AAClBc,oBAAAA,QAAQ,EAAE,CAAC;AACXtC,oBAAAA,OAAO,EAAED,gBAAgB,CAACwB,IAAI,CAACvB,OAAO,CAAC;oBACvCuC,SAAS,EAAGC,KAAK,IAAI;sBACnBA,KAAK,CAACC,cAAc,EAAE;sBACtB,IAAID,KAAK,CAACE,IAAI,KAAK,OAAO,IAAIF,KAAK,CAACE,IAAI,KAAK,OAAO,EAAE;AACpD3C,wBAAAA,gBAAgB,CAACwB,IAAI,CAACvB,OAAO,CAAC,EAAE;AAClC,sBAAA;AACF,oBAAA;mBACD;AAAA,iBAAA,EAxBIyB,MAwBF,CACH;cAEN,CAAC;aACG;AACR,WAAa,CACf;AAAA,SAAA,CAAG;AAEP,MAAA;KACyB;AAC7B,GAAmB,CAAC;AAExB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FlowNavigation.js","sources":["../../src/FlowNavigation/FlowNavigation.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\nimport { Breakpoint } from '@transferwise/neptune-tokens';\n\nimport { Layout } from '../common';\nimport { CloseButton } from '../common/CloseButton';\nimport FlowHeader from '../common/FlowHeader/FlowHeader';\nimport Logo from '../Logo';\nimport Stepper, { type Step } from '../Stepper/Stepper';\nimport Container from '../Container';\n\nimport { useScreenSize } from '../common/hooks/useScreenSize';\nimport messages from './FlowNavigation.messages';\nimport AnimatedLabel from './AnimatedLabel';\nimport IconButton from '../IconButton';\nimport { ArrowLeft } from '@transferwise/icons';\n\nconst defaultLogo = <Logo />;\n\nexport interface FlowNavigationProps {\n /** @default 0 */\n activeStep?: number;\n avatar?: React.ReactNode;\n /** @default <Logo /> */\n logo?: React.ReactNode;\n /** @default false */\n done?: boolean;\n /** Called when the close button is clicked. If not provided the close button won't show */\n onClose?: (() => void) | React.MouseEventHandler<HTMLButtonElement>;\n /** Called when the back button is clicked. If not provided the back button won't show. The back button only shows on small screens */\n onGoBack?: () => void;\n /** Steps to be displayed in stepper. If not provided, the stepper won't show. */\n steps?: readonly Step[];\n /**\n * Controls whether the bottom border is displayed.\n * @default true\n */\n showBottomBorder?: boolean;\n}\n\nconst FlowNavigation = ({\n activeStep = 0,\n avatar,\n logo = defaultLogo,\n done = false,\n onClose,\n onGoBack,\n steps,\n showBottomBorder = true,\n}: FlowNavigationProps) => {\n const intl = useIntl();\n const screenSm = useScreenSize(Breakpoint.SMALL);\n const screenLg = useScreenSize(Breakpoint.LARGE);\n\n const hasSteps = steps && steps.length > 0;\n const displayGoBack = onGoBack != null && activeStep > 0;\n\n const closeButton = onClose != null && <CloseButton size=\"lg\" onClick={onClose} />;\n const newAvatar = done ? null : avatar;\n\n const flowHeaderContent = (\n <FlowHeader\n className={clsx(\n 'np-flow-navigation__content',\n screenSm == null\n ? 'np-flow-navigation--hidden'\n : {\n 'np-flow-navigation--xs-max': !screenSm,\n // Size switches on parent container which may or may not have the same size as the window.\n 'np-flow-navigation--sm': screenSm,\n 'np-flow-navigation--lg': screenLg,\n },\n )}\n leftContent={\n <>\n {!screenSm && displayGoBack ? (\n <IconButton\n size={40}\n priority=\"tertiary\"\n type=\"default\"\n aria-label={intl.formatMessage(messages.back)}\n onClick={onGoBack}\n >\n <ArrowLeft />\n </IconButton>\n ) : (\n <div className=\"np-flow-header__left\">{logo}</div>\n )}\n {!screenSm && !done && hasSteps && (\n <AnimatedLabel className=\"m-x-1\" steps={steps} activeLabel={activeStep} />\n )}\n </>\n }\n rightContent={\n <div className=\"np-flow-header__right d-flex align-items-center justify-content-end order-2--lg\">\n {newAvatar}\n {newAvatar && closeButton && <span className=\"m-x-1\" />}\n {closeButton}\n </div>\n }\n bottomContent={\n !done && hasSteps ? (\n <Stepper\n activeStep={activeStep}\n steps={steps}\n className={clsx('np-flow-navigation__stepper')}\n />\n ) : null\n }\n layout={!screenLg ? Layout.VERTICAL : Layout.HORIZONTAL}\n />\n );\n\n return (\n <Container\n size=\"fluid\"\n className={clsx('np-flow-navigation', {\n 'np-flow-navigation--border-bottom': showBottomBorder,\n 'np-flow-navigation--no-steps': !hasSteps || done,\n })}\n >\n {flowHeaderContent}\n </Container>\n );\n};\n\nexport default FlowNavigation;\n"],"names":["defaultLogo","_jsx","Logo","FlowNavigation","activeStep","avatar","logo","done","onClose","onGoBack","steps","showBottomBorder","intl","useIntl","screenSm","useScreenSize","Breakpoint","SMALL","screenLg","LARGE","hasSteps","length","displayGoBack","closeButton","CloseButton","size","onClick","newAvatar","flowHeaderContent","FlowHeader","className","clsx","leftContent","_jsxs","_Fragment","children","IconButton","priority","type","formatMessage","messages","back","ArrowLeft","AnimatedLabel","activeLabel","rightContent","bottomContent","Stepper","layout","Layout","VERTICAL","HORIZONTAL","Container"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAMA,WAAW,gBAAGC,cAAA,CAACC,YAAI,KAAG;AAuB5B,MAAMC,cAAc,GAAGA,CAAC;AACtBC,EAAAA,UAAU,GAAG,CAAC;EACdC,MAAM;AACNC,EAAAA,IAAI,GAAGN,WAAW;AAClBO,EAAAA,IAAI,GAAG,KAAK;EACZC,OAAO;EACPC,QAAQ;EACRC,KAAK;AACLC,EAAAA,gBAAgB,GAAG;AAAI,CACH,KAAI;AACxB,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE;AACtB,EAAA,MAAMC,QAAQ,GAAGC,2BAAa,CAACC,wBAAU,CAACC,KAAK,CAAC;AAChD,EAAA,MAAMC,QAAQ,GAAGH,2BAAa,CAACC,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,IAAIa,QAAQ,iBAC7BnB,cAAA,CAAC0C,qBAAa,EAAA;AAACb,QAAAA,SAAS,EAAC,OAAO;AAACpB,QAAAA,KAAK,EAAEA,KAAM;AAACkC,QAAAA,WAAW,EAAExC;AAAW,OAAA,CACxE;AAAA,KACH,CACD;AACDyC,IAAAA,YAAY,eACVZ,eAAA,CAAA,KAAA,EAAA;AAAKH,MAAAA,SAAS,EAAC,iFAAiF;AAAAK,MAAAA,QAAA,GAC7FR,SAAS,EACTA,SAAS,IAAIJ,WAAW,iBAAItB,cAAA,CAAA,MAAA,EAAA;AAAM6B,QAAAA,SAAS,EAAC;OAAO,CAAG,EACtDP,WAAW;AAAA,KACT,CACN;IACDuB,aAAa,EACX,CAACvC,IAAI,IAAIa,QAAQ,gBACfnB,cAAA,CAAC8C,eAAO,EAAA;AACN3C,MAAAA,UAAU,EAAEA,UAAW;AACvBM,MAAAA,KAAK,EAAEA,KAAM;MACboB,SAAS,EAAEC,SAAI,CAAC,6BAA6B;KAAE,CAC/C,GACA,IACL;IACDiB,MAAM,EAAE,CAAC9B,QAAQ,GAAG+B,cAAM,CAACC,QAAQ,GAAGD,cAAM,CAACE;AAAW,GAAA,CAE3D;EAED,oBACElD,cAAA,CAACmD,iBAAS,EAAA;AACR3B,IAAAA,IAAI,EAAC,OAAO;AACZK,IAAAA,SAAS,EAAEC,SAAI,CAAC,oBAAoB,EAAE;AACpC,MAAA,mCAAmC,EAAEpB,gBAAgB;MACrD,8BAA8B,EAAE,CAACS,QAAQ,IAAIb;AAC9C,KAAA,CAAE;AAAA4B,IAAAA,QAAA,EAEFP;AAAiB,GACT,CAAC;AAEhB;;;;"}
1
+ {"version":3,"file":"FlowNavigation.js","sources":["../../src/FlowNavigation/FlowNavigation.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\nimport { Breakpoint } from '@transferwise/neptune-tokens';\n\nimport { Layout } from '../common';\nimport { CloseButton } from '../common/CloseButton';\nimport FlowHeader from '../common/FlowHeader/FlowHeader';\nimport Logo from '../Logo';\nimport Stepper, { type Step } from '../Stepper/Stepper';\nimport Container from '../Container';\n\nimport { useScreenSize } from '../common/hooks/useScreenSize';\nimport messages from './FlowNavigation.messages';\nimport AnimatedLabel from './AnimatedLabel';\nimport IconButton from '../IconButton';\nimport { ArrowLeft } from '@transferwise/icons';\n\nconst defaultLogo = <Logo />;\n\nexport interface FlowNavigationProps {\n /** @default 0 */\n activeStep?: number;\n avatar?: React.ReactNode;\n /** @default <Logo /> */\n logo?: React.ReactNode;\n /** @default false */\n done?: boolean;\n /** Called when the close button is clicked. If not provided the close button won't show */\n onClose?: (() => void) | React.MouseEventHandler<HTMLButtonElement>;\n /** Called when the back button is clicked. If not provided the back button won't show. The back button only shows on small screens */\n onGoBack?: () => void;\n /** Steps to be displayed in stepper. If not provided, the stepper won't show. */\n steps?: readonly Step[];\n /**\n * Controls whether the bottom border is displayed.\n * @default true\n */\n showBottomBorder?: boolean;\n}\n\nconst FlowNavigation = ({\n activeStep = 0,\n avatar,\n logo = defaultLogo,\n done = false,\n onClose,\n onGoBack,\n steps,\n showBottomBorder = true,\n}: FlowNavigationProps) => {\n const intl = useIntl();\n const screenSm = useScreenSize(Breakpoint.SMALL);\n const screenLg = useScreenSize(Breakpoint.LARGE);\n\n const hasSteps = steps && steps.length > 0;\n const displayGoBack = onGoBack != null && activeStep > 0;\n\n const closeButton = onClose != null && <CloseButton size=\"lg\" onClick={onClose} />;\n const newAvatar = done ? null : avatar;\n\n const flowHeaderContent = (\n <FlowHeader\n className={clsx(\n 'np-flow-navigation__content',\n screenSm == null\n ? 'np-flow-navigation--hidden'\n : {\n 'np-flow-navigation--xs-max': !screenSm,\n // Size switches on parent container which may or may not have the same size as the window.\n 'np-flow-navigation--sm': screenSm,\n 'np-flow-navigation--lg': screenLg,\n },\n )}\n leftContent={\n <>\n {!screenSm && displayGoBack ? (\n <IconButton\n size={40}\n priority=\"tertiary\"\n type=\"default\"\n aria-label={intl.formatMessage(messages.back)}\n onClick={onGoBack}\n >\n <ArrowLeft />\n </IconButton>\n ) : (\n <div className=\"np-flow-header__left\">{logo}</div>\n )}\n {!screenSm && !done && hasSteps && (\n <AnimatedLabel className=\"m-x-1\" steps={steps} activeLabel={activeStep} />\n )}\n </>\n }\n rightContent={\n <div className=\"np-flow-header__right d-flex align-items-center justify-content-end order-2--lg\">\n {newAvatar}\n {newAvatar && closeButton && <span className=\"m-x-1\" />}\n {closeButton}\n </div>\n }\n bottomContent={\n !done && hasSteps ? (\n <Stepper\n activeStep={activeStep}\n steps={steps}\n className={clsx('np-flow-navigation__stepper')}\n />\n ) : null\n }\n layout={!screenLg ? Layout.VERTICAL : Layout.HORIZONTAL}\n />\n );\n\n return (\n <Container\n size=\"fluid\"\n className={clsx('np-flow-navigation', {\n 'np-flow-navigation--border-bottom': showBottomBorder,\n 'np-flow-navigation--no-steps': !hasSteps || done,\n })}\n >\n {flowHeaderContent}\n </Container>\n );\n};\n\nexport default FlowNavigation;\n"],"names":["defaultLogo","_jsx","Logo","FlowNavigation","activeStep","avatar","logo","done","onClose","onGoBack","steps","showBottomBorder","intl","useIntl","screenSm","useScreenSize","Breakpoint","SMALL","screenLg","LARGE","hasSteps","length","displayGoBack","closeButton","CloseButton","size","onClick","newAvatar","flowHeaderContent","FlowHeader","className","clsx","leftContent","_jsxs","_Fragment","children","IconButton","priority","type","formatMessage","messages","back","ArrowLeft","AnimatedLabel","activeLabel","rightContent","bottomContent","Stepper","layout","Layout","VERTICAL","HORIZONTAL","Container"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAMA,WAAW,gBAAGC,cAAA,CAACC,YAAI,KAAG;AAuB5B,MAAMC,cAAc,GAAGA,CAAC;AACtBC,EAAAA,UAAU,GAAG,CAAC;EACdC,MAAM;AACNC,EAAAA,IAAI,GAAGN,WAAW;AAClBO,EAAAA,IAAI,GAAG,KAAK;EACZC,OAAO;EACPC,QAAQ;EACRC,KAAK;AAC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-1 +1 @@
1
- {"version":3,"file":"FlowNavigation.messages.js","sources":["../../src/FlowNavigation/FlowNavigation.messages.ts"],"sourcesContent":["import { defineMessages } from 'react-intl';\n\nexport default defineMessages({\n back: {\n id: 'neptune.FlowNavigation.back',\n defaultMessage: 'back to previous step',\n },\n});\n"],"names":["defineMessages","back","id"],"mappings":";;;;;;AAEA,eAAeA,wBAAc,CAAC;AAC5BC,EAAAA,IAAI,EAAE;IACJC,EAAE,EAAA;AAEH;AACF,CAAA,CAAC;;;;"}
1
+ {"version":3,"file":"FlowNavigation.messages.js","sources":["../../src/FlowNavigation/FlowNavigation.messages.ts"],"sourcesContent":["import { defineMessages } from 'react-intl';\n\nexport default defineMessages({\n back: {\n id: 'neptune.FlowNavigation.back',\n defaultMessage: 'back to previous step',\n },\n});\n"],"names":["defineMessages","back","id"],"mappings":";;;;;;AAEA,eAAeA,wBAAc,CAAC;AAC5BC,EAAAA,IAAI,EAAE;IACJC,EAAE,EAAA;AAEH;AACF,CAAA,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FlowNavigation.messages.mjs","sources":["../../src/FlowNavigation/FlowNavigation.messages.ts"],"sourcesContent":["import { defineMessages } from 'react-intl';\n\nexport default defineMessages({\n back: {\n id: 'neptune.FlowNavigation.back',\n defaultMessage: 'back to previous step',\n },\n});\n"],"names":["defineMessages","back","id"],"mappings":";;AAEA,eAAeA,cAAc,CAAC;AAC5BC,EAAAA,IAAI,EAAE;IACJC,EAAE,EAAA;AAEH;AACF,CAAA,CAAC;;;;"}
1
+ {"version":3,"file":"FlowNavigation.messages.mjs","sources":["../../src/FlowNavigation/FlowNavigation.messages.ts"],"sourcesContent":["import { defineMessages } from 'react-intl';\n\nexport default defineMessages({\n back: {\n id: 'neptune.FlowNavigation.back',\n defaultMessage: 'back to previous step',\n },\n});\n"],"names":["defineMessages","back","id"],"mappings":";;AAEA,eAAeA,cAAc,CAAC;AAC5BC,EAAAA,IAAI,EAAE;IACJC,EAAE,EAAA;AAEH;AACF,CAAA,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FlowNavigation.mjs","sources":["../../src/FlowNavigation/FlowNavigation.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\nimport { Breakpoint } from '@transferwise/neptune-tokens';\n\nimport { Layout } from '../common';\nimport { CloseButton } from '../common/CloseButton';\nimport FlowHeader from '../common/FlowHeader/FlowHeader';\nimport Logo from '../Logo';\nimport Stepper, { type Step } from '../Stepper/Stepper';\nimport Container from '../Container';\n\nimport { useScreenSize } from '../common/hooks/useScreenSize';\nimport messages from './FlowNavigation.messages';\nimport AnimatedLabel from './AnimatedLabel';\nimport IconButton from '../IconButton';\nimport { ArrowLeft } from '@transferwise/icons';\n\nconst defaultLogo = <Logo />;\n\nexport interface FlowNavigationProps {\n /** @default 0 */\n activeStep?: number;\n avatar?: React.ReactNode;\n /** @default <Logo /> */\n logo?: React.ReactNode;\n /** @default false */\n done?: boolean;\n /** Called when the close button is clicked. If not provided the close button won't show */\n onClose?: (() => void) | React.MouseEventHandler<HTMLButtonElement>;\n /** Called when the back button is clicked. If not provided the back button won't show. The back button only shows on small screens */\n onGoBack?: () => void;\n /** Steps to be displayed in stepper. If not provided, the stepper won't show. */\n steps?: readonly Step[];\n /**\n * Controls whether the bottom border is displayed.\n * @default true\n */\n showBottomBorder?: boolean;\n}\n\nconst FlowNavigation = ({\n activeStep = 0,\n avatar,\n logo = defaultLogo,\n done = false,\n onClose,\n onGoBack,\n steps,\n showBottomBorder = true,\n}: FlowNavigationProps) => {\n const intl = useIntl();\n const screenSm = useScreenSize(Breakpoint.SMALL);\n const screenLg = useScreenSize(Breakpoint.LARGE);\n\n const hasSteps = steps && steps.length > 0;\n const displayGoBack = onGoBack != null && activeStep > 0;\n\n const closeButton = onClose != null && <CloseButton size=\"lg\" onClick={onClose} />;\n const newAvatar = done ? null : avatar;\n\n const flowHeaderContent = (\n <FlowHeader\n className={clsx(\n 'np-flow-navigation__content',\n screenSm == null\n ? 'np-flow-navigation--hidden'\n : {\n 'np-flow-navigation--xs-max': !screenSm,\n // Size switches on parent container which may or may not have the same size as the window.\n 'np-flow-navigation--sm': screenSm,\n 'np-flow-navigation--lg': screenLg,\n },\n )}\n leftContent={\n <>\n {!screenSm && displayGoBack ? (\n <IconButton\n size={40}\n priority=\"tertiary\"\n type=\"default\"\n aria-label={intl.formatMessage(messages.back)}\n onClick={onGoBack}\n >\n <ArrowLeft />\n </IconButton>\n ) : (\n <div className=\"np-flow-header__left\">{logo}</div>\n )}\n {!screenSm && !done && hasSteps && (\n <AnimatedLabel className=\"m-x-1\" steps={steps} activeLabel={activeStep} />\n )}\n </>\n }\n rightContent={\n <div className=\"np-flow-header__right d-flex align-items-center justify-content-end order-2--lg\">\n {newAvatar}\n {newAvatar && closeButton && <span className=\"m-x-1\" />}\n {closeButton}\n </div>\n }\n bottomContent={\n !done && hasSteps ? (\n <Stepper\n activeStep={activeStep}\n steps={steps}\n className={clsx('np-flow-navigation__stepper')}\n />\n ) : null\n }\n layout={!screenLg ? Layout.VERTICAL : Layout.HORIZONTAL}\n />\n );\n\n return (\n <Container\n size=\"fluid\"\n className={clsx('np-flow-navigation', {\n 'np-flow-navigation--border-bottom': showBottomBorder,\n 'np-flow-navigation--no-steps': !hasSteps || done,\n })}\n >\n {flowHeaderContent}\n </Container>\n );\n};\n\nexport default FlowNavigation;\n"],"names":["defaultLogo","_jsx","Logo","FlowNavigation","activeStep","avatar","logo","done","onClose","onGoBack","steps","showBottomBorder","intl","useIntl","screenSm","useScreenSize","Breakpoint","SMALL","screenLg","LARGE","hasSteps","length","displayGoBack","closeButton","CloseButton","size","onClick","newAvatar","flowHeaderContent","FlowHeader","className","clsx","leftContent","_jsxs","_Fragment","children","IconButton","priority","type","formatMessage","messages","back","ArrowLeft","AnimatedLabel","activeLabel","rightContent","bottomContent","Stepper","layout","Layout","VERTICAL","HORIZONTAL","Container"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAI,EAAC,OAAO;AACZK,IAAAA,SAAS,EAAEC,IAAI,CAAC,oBAAoB,EAAE;AACpC,MAAA,mCAAmC,EAAEpB,gBAAgB;MACrD,8BAA8B,EAAE,CAACS,QAAQ,IAAIb;AAC9C,KAAA,CAAE;AAAA4B,IAAAA,QAAA,EAEFP;AAAiB,GACT,CAAC;AAEhB;;;;"}
1
+ {"version":3,"file":"FlowNavigation.mjs","sources":["../../src/FlowNavigation/FlowNavigation.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\nimport { Breakpoint } from '@transferwise/neptune-tokens';\n\nimport { Layout } from '../common';\nimport { CloseButton } from '../common/CloseButton';\nimport FlowHeader from '../common/FlowHeader/FlowHeader';\nimport Logo from '../Logo';\nimport Stepper, { type Step } from '../Stepper/Stepper';\nimport Container from '../Container';\n\nimport { useScreenSize } from '../common/hooks/useScreenSize';\nimport messages from './FlowNavigation.messages';\nimport AnimatedLabel from './AnimatedLabel';\nimport IconButton from '../IconButton';\nimport { ArrowLeft } from '@transferwise/icons';\n\nconst defaultLogo = <Logo />;\n\nexport interface FlowNavigationProps {\n /** @default 0 */\n activeStep?: number;\n avatar?: React.ReactNode;\n /** @default <Logo /> */\n logo?: React.ReactNode;\n /** @default false */\n done?: boolean;\n /** Called when the close button is clicked. If not provided the close button won't show */\n onClose?: (() => void) | React.MouseEventHandler<HTMLButtonElement>;\n /** Called when the back button is clicked. If not provided the back button won't show. The back button only shows on small screens */\n onGoBack?: () => void;\n /** Steps to be displayed in stepper. If not provided, the stepper won't show. */\n steps?: readonly Step[];\n /**\n * Controls whether the bottom border is displayed.\n * @default true\n */\n showBottomBorder?: boolean;\n}\n\nconst FlowNavigation = ({\n activeStep = 0,\n avatar,\n logo = defaultLogo,\n done = false,\n onClose,\n onGoBack,\n steps,\n showBottomBorder = true,\n}: FlowNavigationProps) => {\n const intl = useIntl();\n const screenSm = useScreenSize(Breakpoint.SMALL);\n const screenLg = useScreenSize(Breakpoint.LARGE);\n\n const hasSteps = steps && steps.length > 0;\n const displayGoBack = onGoBack != null && activeStep > 0;\n\n const closeButton = onClose != null && <CloseButton size=\"lg\" onClick={onClose} />;\n const newAvatar = done ? null : avatar;\n\n const flowHeaderContent = (\n <FlowHeader\n className={clsx(\n 'np-flow-navigation__content',\n screenSm == null\n ? 'np-flow-navigation--hidden'\n : {\n 'np-flow-navigation--xs-max': !screenSm,\n // Size switches on parent container which may or may not have the same size as the window.\n 'np-flow-navigation--sm': screenSm,\n 'np-flow-navigation--lg': screenLg,\n },\n )}\n leftContent={\n <>\n {!screenSm && displayGoBack ? (\n <IconButton\n size={40}\n priority=\"tertiary\"\n type=\"default\"\n aria-label={intl.formatMessage(messages.back)}\n onClick={onGoBack}\n >\n <ArrowLeft />\n </IconButton>\n ) : (\n <div className=\"np-flow-header__left\">{logo}</div>\n )}\n {!screenSm && !done && hasSteps && (\n <AnimatedLabel className=\"m-x-1\" steps={steps} activeLabel={activeStep} />\n )}\n </>\n }\n rightContent={\n <div className=\"np-flow-header__right d-flex align-items-center justify-content-end order-2--lg\">\n {newAvatar}\n {newAvatar && closeButton && <span className=\"m-x-1\" />}\n {closeButton}\n </div>\n }\n bottomContent={\n !done && hasSteps ? (\n <Stepper\n activeStep={activeStep}\n steps={steps}\n className={clsx('np-flow-navigation__stepper')}\n />\n ) : null\n }\n layout={!screenLg ? Layout.VERTICAL : Layout.HORIZONTAL}\n />\n );\n\n return (\n <Container\n size=\"fluid\"\n className={clsx('np-flow-navigation', {\n 'np-flow-navigation--border-bottom': showBottomBorder,\n 'np-flow-navigation--no-steps': !hasSteps || done,\n })}\n >\n {flowHeaderContent}\n </Container>\n );\n};\n\nexport default FlowNavigation;\n"],"names":["defaultLogo","_jsx","Logo","FlowNavigation","activeStep","avatar","logo","done","onClose","onGoBack","steps","showBottomBorder","intl","useIntl","screenSm","useScreenSize","Breakpoint","SMALL","screenLg","LARGE","hasSteps","length","displayGoBack","closeButton","CloseButton","size","onClick","newAvatar","flowHeaderContent","FlowHeader","className","clsx","leftContent","_jsxs","_Fragment","children","IconButton","priority","type","formatMessage","messages","back","ArrowLeft","AnimatedLabel","activeLabel","rightContent","bottomContent","Stepper","layout","Layout","VERTICAL","HORIZONTAL","Container"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAMA,WAAW,gBAAGC,GAAA,CAACC,IAAI,KAAG;AAuB5B,MAAMC,cAAc,GAAGA,CAAC;AACtBC,EAAAA,UAAU,GAAG,CAAC;EACdC,MAAM;AACNC,EAAAA,IAAI,GAAGN,WAAW;AAClBO,EAAAA,IAAI,GAAG,KAAK;EACZC,OAAO;EACPC,QAAQ;EACRC,KAAK;AACLC,EAAAA,gBAAgB,GAAG;AAAI,CACH,KAAI;AACxB,EAAA,MAAMC,IAAI,GAAGC,OAAO,EAAE;AACtB,EAAA,MAAMC,QAAQ,GAAGC,aAAa,CAACC,UAAU,CAACC,KAAK,CAAC;AAChD,EAAA,MAAMC,QAAQ,GAAGH,aAAa,CAACC,UAAU,CAACG,KAAK,CAAC;EAEhD,MAAMC,QAAQ,GAAGV,KAAK,IAAIA,KAAK,CAACW,MAAM,GAAG,CAAC;EAC1C,MAAMC,aAAa,GAAGb,QAAQ,IAAI,IAAI,IAAIL,UAAU,GAAG,CAAC;EAExD,MAAMmB,WAAW,GAAGf,OAAO,IAAI,IAAI,iBAAIP,GAAA,CAACuB,WAAW,EAAA;AAACC,IAAAA,IAAI,EAAC,IAAI;AAACC,IAAAA,OAAO,EAAElB;AAAQ,IAAG;AAClF,EAAA,MAAMmB,SAAS,GAAGpB,IAAI,GAAG,IAAI,GAAGF,MAAM;AAEtC,EAAA,MAAMuB,iBAAiB,gBACrB3B,GAAA,CAAC4B,UAAU,EAAA;IACTC,SAAS,EAAEC,IAAI,CACb,6BAA6B,EAC7BjB,QAAQ,IAAI,IAAI,GACZ,4BAA4B,GAC5B;MACE,4BAA4B,EAAE,CAACA,QAAQ;AACvC;AACA,MAAA,wBAAw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AAC,6BAA6B;KAAE,CAC/C,GACA,IACL;IACDiB,MAAM,EAAE,CAAC9B,QAAQ,GAAG+B,MAAM,CAACC,QAAQ,GAAGD,MAAM,CAACE;AAAW,GAAA,CAE3D;EAED,oBACElD,GAAA,CAACmD,SAAS,EAAA;AACR3B,IAAAA,IAAI,EAAC,OAAO;AACZK,IAAAA,SAAS,EAAEC,IAAI,CAAC,oBAAoB,EAAE;AACpC,MAAA,mCAAmC,EAAEpB,gBAAgB;MACrD,8BAA8B,EAAE,CAACS,QAAQ,IAAIb;AAC9C,KAAA,CAAE;AAAA4B,IAAAA,QAAA,EAEFP;AAAiB,GACT,CAAC;AAEhB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Header.js","sources":["../../src/Header/Header.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport { AriaLabelProperty, CommonProps, Heading, LinkProps, Typography } from '../common';\nimport Link from '../Link';\nimport Title from '../Title';\nimport React, { useEffect, useRef, FunctionComponent, ReactNode } from 'react';\n\ntype ActionProps = AriaLabelProperty & {\n text: string;\n onClick?: (event: React.MouseEvent) => void;\n disabled?: boolean;\n};\n\ntype ButtonActionProps = ActionProps;\ntype LinkActionProps = ActionProps & LinkProps;\n\nexport interface HeaderProps extends CommonProps {\n /**\n * Optional prop to define the action for the header. If the `href` property\n * is provided, a `Link` will be rendered instead of a `Button`.\n */\n action?: ButtonActionProps | LinkActionProps;\n\n /**\n * Option prop to specify DOM render element of the title\n *\n * - When `as=\"legend\"`, the `Header` will render as a `<legend>` element.\n * **Note:** `<legend>` elements must be the first child of a `<fieldset>` to comply with HTML semantics.\n * If this condition is not met, a warning will be logged to the console.\n *\n * - Other valid values include standard heading tags (`h1` to `h6`) or `header`.\n * @default 'h5'\n */\n as?: Heading | 'legend' | 'header';\n\n /** Required prop to set the title of the Header. */\n title: ReactNode;\n\n /**\n * Optional prop to specify the level of the Header\n * @default 'group'\n */\n level?: 'section' | 'group';\n\n className?: string;\n testId?: string;\n}\n\n/**\n * Renders a header action which can be either a button or a link.\n *\n * @param {Object} props - The properties object.\n * @param {ButtonActionProps | LinkActionProps} props.action - The action object which can be either a button or a link.\n * @returns {JSX.Element} The rendered header action component.\n */\nconst HeaderAction = React.forwardRef<\n HTMLButtonElement | HTMLAnchorElement,\n { action: ButtonActionProps | LinkActionProps }\n>(({ action }, ref) => {\n return (\n <Link\n className=\"np-header__action-button\"\n aria-label={action['aria-label']}\n href={'href' in action ? action.href : undefined}\n target={'target' in action ? action.target : undefined}\n disabled={action.disabled}\n onClick={action.onClick}\n >\n {action.text}\n </Link>\n );\n});\n\nHeaderAction.displayName = 'HeaderAction';\n\n/**\n * @param {ButtonActionProps | LinkActionProps} [action] - Optional prop to specify the action button or link.\n * @param {Heading | 'legend'} [as='h5'] - Optional prop to override the heading element rendered for the title.\n * @param {string} title - Required prop to set the title of the section header.\n * @param {'group' | 'section'} [level='group'] - Optional prop to specify the level of the section header.\n * @param {string} [className]\n * @param {string} [testId]\n *\n * @see {@link Header } for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/typography-header--docs|Storybook Wise Design}\n */\nconst Header: FunctionComponent<HeaderProps> = React.forwardRef(\n (\n { as = 'h5', action, className, testId, title, level = 'group', ...props },\n ref: React.Ref<HTMLDivElement | HTMLHeadingElement | HTMLLegendElement>,\n ) => {\n const internalRef = useRef<HTMLLegendElement>(null);\n const levelTypography =\n level === 'group' ? Typography.TITLE_GROUP : Typography.TITLE_SUBSECTION;\n const headerClasses = clsx('np-header', className, {\n 'np-header--group': level === 'group',\n });\n\n const commonProps = {\n className: headerClasses,\n 'data-testid': testId,\n };\n\n useEffect(() => {\n if (as === 'legend' && internalRef.current) {\n const { parentElement } = internalRef.current;\n if (parentElement?.tagName.toLowerCase() !== 'fieldset') {\n console.warn(\n 'Legends should be the first child in a fieldset, and this is not possible when including an action',\n );\n }\n }\n }, [as]);\n\n if (!action) {\n return (\n <Title ref={internalRef} as={as} type={levelTypography} {...commonProps} {...props}>\n {title}\n </Title>\n );\n }\n\n return (\n <div {...commonProps} {...props} ref={ref}>\n <Title as={as} type={levelTypography} className=\"np-header__title\">\n {title}\n </Title>\n <HeaderAction action={action} />\n </div>\n );\n },\n);\n\nHeader.displayName = 'Header';\n\nexport default Header;\n"],"names":["HeaderAction","React","forwardRef","action","ref","_jsx","Link","className","href","undefined","target","disabled","onClick","children","text","displayName","Header","as","testId","title","level","props","internalRef","useRef","levelTypography","Typography","TITLE_GROUP","TITLE_SUBSECTION","headerClasses","clsx","commonProps","useEffect","current","parentElement","tagName","toLowerCase","console","warn","Title","type","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,MAAMA,YAAY,gBAAGC,sBAAK,CAACC,UAAU,CAGnC,CAAC;AAAEC,EAAAA;AAAM,CAAE,EAAEC,GAAG,KAAI;EACpB,oBACEC,cAAA,CAACC,YAAI,EAAA;AACHC,IAAAA,SAAS,EAAC,0BAA0B;IACpC,YAAA,EAAYJ,MAAM,CAAC,YAAY,CAAE;IACjCK,IAAI,EAAE,MAAM,IAAIL,MAAM,GAAGA,MAAM,CAACK,IAAI,GAAGC,SAAU;IACjDC,MAAM,EAAE,QAAQ,IAAIP,MAAM,GAAGA,MAAM,CAACO,MAAM,GAAGD,SAAU;IACvDE,QAAQ,EAAER,MAAM,CAACQ,QAAS;IAC1BC,OAAO,EAAET,MAAM,CAACS,OAAQ;IAAAC,QAAA,EAEvBV,MAAM,CAACW;AAAI,GACR,CAAC;AAEX,CAAC,CAAC;AAEFd,YAAY,CAACe,WAAW,GAAG,cAAc;AAEzC;;;;;;;;;;AAUG;AACH,MAAMC,MAAM,gBAAmCf,sBAAK,CAACC,UAAU,CAC7D,CACE;AAAEe,EAAAA,EAAE,GAAG,IAAI;EAAEd,MAAM;EAAEI,SAAS;EAAEW,MAAM;EAAEC,KAAK;AAAEC,EAAAA,KAAK,GAAG,OAAO;EAAE,GAAGC;AAAK,CAAE,EAC1EjB,GAAuE,KACrE;AACF,EAAA,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A,IAAI,EAAEf,eAAgB;AAACjB,MAAAA,SAAS,EAAC,kBAAkB;AAAAM,MAAAA,QAAA,EAC/DM;AAAK,KACD,CACP,eAAAd,cAAA,CAACL,YAAY,EAAA;AAACG,MAAAA,MAAM,EAAEA;AAAO,KAAA,CAC/B;AAAA,GAAK,CAAC;AAEV,CAAC;AAGHa,MAAM,CAACD,WAAW,GAAG,QAAQ;;;;"}
1
+ {"version":3,"file":"Header.js","sources":["../../src/Header/Header.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport { AriaLabelProperty, CommonProps, Heading, LinkProps, Typography } from '../common';\nimport Link from '../Link';\nimport Title from '../Title';\nimport React, { useEffect, useRef, FunctionComponent, ReactNode } from 'react';\n\ntype ActionProps = AriaLabelProperty & {\n text: string;\n onClick?: (event: React.MouseEvent) => void;\n disabled?: boolean;\n};\n\ntype ButtonActionProps = ActionProps;\ntype LinkActionProps = ActionProps & LinkProps;\n\nexport interface HeaderProps extends CommonProps {\n /**\n * Optional prop to define the action for the header. If the `href` property\n * is provided, a `Link` will be rendered instead of a `Button`.\n */\n action?: ButtonActionProps | LinkActionProps;\n\n /**\n * Option prop to specify DOM render element of the title\n *\n * - When `as=\"legend\"`, the `Header` will render as a `<legend>` element.\n * **Note:** `<legend>` elements must be the first child of a `<fieldset>` to comply with HTML semantics.\n * If this condition is not met, a warning will be logged to the console.\n *\n * - Other valid values include standard heading tags (`h1` to `h6`) or `header`.\n * @default 'h5'\n */\n as?: Heading | 'legend' | 'header';\n\n /** Required prop to set the title of the Header. */\n title: ReactNode;\n\n /**\n * Optional prop to specify the level of the Header\n * @default 'group'\n */\n level?: 'section' | 'group';\n\n className?: string;\n testId?: string;\n}\n\n/**\n * Renders a header action which can be either a button or a link.\n *\n * @param {Object} props - The properties object.\n * @param {ButtonActionProps | LinkActionProps} props.action - The action object which can be either a button or a link.\n * @returns {JSX.Element} The rendered header action component.\n */\nconst HeaderAction = React.forwardRef<\n HTMLButtonElement | HTMLAnchorElement,\n { action: ButtonActionProps | LinkActionProps }\n>(({ action }, ref) => {\n return (\n <Link\n className=\"np-header__action-button\"\n aria-label={action['aria-label']}\n href={'href' in action ? action.href : undefined}\n target={'target' in action ? action.target : undefined}\n disabled={action.disabled}\n onClick={action.onClick}\n >\n {action.text}\n </Link>\n );\n});\n\nHeaderAction.displayName = 'HeaderAction';\n\n/**\n * @param {ButtonActionProps | LinkActionProps} [action] - Optional prop to specify the action button or link.\n * @param {Heading | 'legend'} [as='h5'] - Optional prop to override the heading element rendered for the title.\n * @param {string} title - Required prop to set the title of the section header.\n * @param {'group' | 'section'} [level='group'] - Optional prop to specify the level of the section header.\n * @param {string} [className]\n * @param {string} [testId]\n *\n * @see {@link Header } for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/typography-header--docs|Storybook Wise Design}\n */\nconst Header: FunctionComponent<HeaderProps> = React.forwardRef(\n (\n { as = 'h5', action, className, testId, title, level = 'group', ...props },\n ref: React.Ref<HTMLDivElement | HTMLHeadingElement | HTMLLegendElement>,\n ) => {\n const internalRef = useRef<HTMLLegendElement>(null);\n const levelTypography =\n level === 'group' ? Typography.TITLE_GROUP : Typography.TITLE_SUBSECTION;\n const headerClasses = clsx('np-header', className, {\n 'np-header--group': level === 'group',\n });\n\n const commonProps = {\n className: headerClasses,\n 'data-testid': testId,\n };\n\n useEffect(() => {\n if (as === 'legend' && internalRef.current) {\n const { parentElement } = internalRef.current;\n if (parentElement?.tagName.toLowerCase() !== 'fieldset') {\n console.warn(\n 'Legends should be the first child in a fieldset, and this is not possible when including an action',\n );\n }\n }\n }, [as]);\n\n if (!action) {\n return (\n <Title ref={internalRef} as={as} type={levelTypography} {...commonProps} {...props}>\n {title}\n </Title>\n );\n }\n\n return (\n <div {...commonProps} {...props} ref={ref}>\n <Title as={as} type={levelTypography} className=\"np-header__title\">\n {title}\n </Title>\n <HeaderAction action={action} />\n </div>\n );\n },\n);\n\nHeader.displayName = 'Header';\n\nexport default Header;\n"],"names":["HeaderAction","React","forwardRef","action","ref","_jsx","Link","className","href","undefined","target","disabled","onClick","children","text","displayName","Header","as","testId","title","level","props","internalRef","useRef","levelTypography","Typography","TITLE_GROUP","TITLE_SUBSECTION","headerClasses","clsx","commonProps","useEffect","current","parentElement","tagName","toLowerCase","console","warn","Title","type","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,MAAMA,YAAY,gBAAGC,sBAAK,CAACC,UAAU,CAGnC,CAAC;AAAEC,EAAAA;AAAM,CAAE,EAAEC,GAAG,KAAI;EACpB,oBACEC,cAAA,CAACC,YAAI,EAAA;AACHC,IAAAA,SAAS,EAAC,0BAA0B;IACpC,YAAA,EAAYJ,MAAM,CAAC,YAAY,CAAE;IACjCK,IAAI,EAAE,MAAM,IAAIL,MAAM,GAAGA,MAAM,CAACK,IAAI,GAAGC,SAAU;IACjDC,MAAM,EAAE,QAAQ,IAAIP,MAAM,GAAGA,MAAM,CAACO,MAAM,GAAGD,SAAU;IACvDE,QAAQ,EAAER,MAAM,CAACQ,QAAS;IAC1BC,OAAO,EAAET,MAAM,CAACS,OAAQ;IAAAC,QAAA,EAEvBV,MAAM,CAACW;AAAI,GACR,CAAC;AAEX,CAAC,CAAC;AAEFd,YAAY,CAACe,WAAW,GAAG,cAAc;AAEzC;;;;;;;;;;AAUG;AACH,MAAMC,MAAM,gBAAmCf,sBAAK,CAACC,UAAU,CAC7D,CACE;AAAEe,EAAAA,EAAE,GAAG,IAAI;EAAEd,MAAM;EAAEI,SAAS;EAAEW,MAAM;EAAEC,KAAK;AAAEC,EAAAA,KAAK,GAAG,OAAO;EAAE,GAAGC;AAAK,CAAE,EAC1EjB,GAAuE,KACrE;AACF,EAAA,MAAMkB,WAAW,GAAGC,YAAM,CAAoB,IAAI,CAAC;AACnD,EAAA,MAAMC,eAAe,GACnBJ,KAAK,KAAK,OAAO,GAAGK,qBAAU,CAACC,WAAW,GAAGD,qBAAU,CAACE,gBAAgB;AAC1E,EAAA,MAAMC,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