@transferwise/components 46.100.0 → 46.100.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (517) hide show
  1. package/build/accordion/Accordion.js.map +1 -1
  2. package/build/accordion/Accordion.mjs.map +1 -1
  3. package/build/accordion/AccordionItem/AccordionItem.js.map +1 -1
  4. package/build/accordion/AccordionItem/AccordionItem.mjs.map +1 -1
  5. package/build/actionButton/ActionButton.js.map +1 -1
  6. package/build/actionButton/ActionButton.mjs.map +1 -1
  7. package/build/actionOption/ActionOption.js.map +1 -1
  8. package/build/actionOption/ActionOption.mjs.map +1 -1
  9. package/build/alert/Alert.js.map +1 -1
  10. package/build/alert/Alert.mjs.map +1 -1
  11. package/build/alert/inlineMarkdown/InlineMarkdown.js.map +1 -1
  12. package/build/alert/inlineMarkdown/InlineMarkdown.mjs.map +1 -1
  13. package/build/avatar/Avatar.js.map +1 -1
  14. package/build/avatar/Avatar.mjs.map +1 -1
  15. package/build/avatar/avatarTypes.js.map +1 -1
  16. package/build/avatar/avatarTypes.mjs.map +1 -1
  17. package/build/avatarLayout/AvatarLayout.js.map +1 -1
  18. package/build/avatarLayout/AvatarLayout.mjs.map +1 -1
  19. package/build/avatarView/AvatarView.js.map +1 -1
  20. package/build/avatarView/AvatarView.mjs.map +1 -1
  21. package/build/avatarView/NotificationDot.js.map +1 -1
  22. package/build/avatarView/NotificationDot.mjs.map +1 -1
  23. package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
  24. package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -1
  25. package/build/badge/Badge.js.map +1 -1
  26. package/build/badge/Badge.mjs.map +1 -1
  27. package/build/badge/BadgeAssets.js.map +1 -1
  28. package/build/badge/BadgeAssets.mjs.map +1 -1
  29. package/build/body/Body.js.map +1 -1
  30. package/build/body/Body.mjs.map +1 -1
  31. package/build/button/Button.js.map +1 -1
  32. package/build/button/Button.mjs.map +1 -1
  33. package/build/button/Button.resolver.js.map +1 -1
  34. package/build/button/Button.resolver.mjs.map +1 -1
  35. package/build/button/LegacyButton.js.map +1 -1
  36. package/build/button/LegacyButton.mjs.map +1 -1
  37. package/build/button/legacyUtils/legacyUtils.js.map +1 -1
  38. package/build/button/legacyUtils/legacyUtils.mjs.map +1 -1
  39. package/build/card/Card.js.map +1 -1
  40. package/build/card/Card.mjs.map +1 -1
  41. package/build/carousel/Carousel.js.map +1 -1
  42. package/build/carousel/Carousel.mjs.map +1 -1
  43. package/build/checkbox/Checkbox.js.map +1 -1
  44. package/build/checkbox/Checkbox.mjs.map +1 -1
  45. package/build/checkboxButton/CheckboxButton.js.map +1 -1
  46. package/build/checkboxButton/CheckboxButton.mjs.map +1 -1
  47. package/build/checkboxOption/CheckboxOption.js.map +1 -1
  48. package/build/checkboxOption/CheckboxOption.mjs.map +1 -1
  49. package/build/chevron/Chevron.js.map +1 -1
  50. package/build/chevron/Chevron.mjs.map +1 -1
  51. package/build/chips/Chip.js.map +1 -1
  52. package/build/chips/Chip.mjs.map +1 -1
  53. package/build/chips/Chips.js.map +1 -1
  54. package/build/chips/Chips.mjs.map +1 -1
  55. package/build/circularButton/CircularButton.js.map +1 -1
  56. package/build/circularButton/CircularButton.mjs.map +1 -1
  57. package/build/common/DOMOperations/DOMOperations.js.map +1 -1
  58. package/build/common/DOMOperations/DOMOperations.mjs.map +1 -1
  59. package/build/common/Option/Option.js.map +1 -1
  60. package/build/common/Option/Option.mjs.map +1 -1
  61. package/build/common/RadioButton/RadioButton.js.map +1 -1
  62. package/build/common/RadioButton/RadioButton.mjs.map +1 -1
  63. package/build/common/bottomSheet/BottomSheet.js.map +1 -1
  64. package/build/common/bottomSheet/BottomSheet.mjs.map +1 -1
  65. package/build/common/card/Card.js.map +1 -1
  66. package/build/common/card/Card.mjs.map +1 -1
  67. package/build/common/circle/Circle.js.map +1 -1
  68. package/build/common/circle/Circle.mjs.map +1 -1
  69. package/build/common/closeButton/CloseButton.js.map +1 -1
  70. package/build/common/closeButton/CloseButton.mjs.map +1 -1
  71. package/build/common/colors.js.map +1 -1
  72. package/build/common/colors.mjs.map +1 -1
  73. package/build/common/dateUtils/getDayNames/getDayNames.js.map +1 -1
  74. package/build/common/dateUtils/getDayNames/getDayNames.mjs.map +1 -1
  75. package/build/common/dateUtils/getMonthNames/getMonthNames.js.map +1 -1
  76. package/build/common/dateUtils/getMonthNames/getMonthNames.mjs.map +1 -1
  77. package/build/common/dateUtils/isDateValid/isDateValid.js.map +1 -1
  78. package/build/common/dateUtils/isDateValid/isDateValid.mjs.map +1 -1
  79. package/build/common/dateUtils/moveToWithinRange/moveToWithinRange.js.map +1 -1
  80. package/build/common/dateUtils/moveToWithinRange/moveToWithinRange.mjs.map +1 -1
  81. package/build/common/deviceDetection/deviceDetection.js.map +1 -1
  82. package/build/common/deviceDetection/deviceDetection.mjs.map +1 -1
  83. package/build/common/direction.js.map +1 -1
  84. package/build/common/direction.mjs.map +1 -1
  85. package/build/common/domHelpers/documentIosClick.js.map +1 -1
  86. package/build/common/domHelpers/documentIosClick.mjs.map +1 -1
  87. package/build/common/fileType.js.map +1 -1
  88. package/build/common/fileType.mjs.map +1 -1
  89. package/build/common/flowHeader/FlowHeader.js.map +1 -1
  90. package/build/common/flowHeader/FlowHeader.mjs.map +1 -1
  91. package/build/common/focusBoundary/FocusBoundary.js.map +1 -1
  92. package/build/common/focusBoundary/FocusBoundary.mjs.map +1 -1
  93. package/build/common/historyNavigator/historyNavigator.js.map +1 -1
  94. package/build/common/historyNavigator/historyNavigator.mjs.map +1 -1
  95. package/build/common/hooks/useConditionalListener/useConditionalListener.js.map +1 -1
  96. package/build/common/hooks/useConditionalListener/useConditionalListener.mjs.map +1 -1
  97. package/build/common/hooks/useDirection/useDirection.js.map +1 -1
  98. package/build/common/hooks/useDirection/useDirection.mjs.map +1 -1
  99. package/build/common/hooks/useEffectEvent.js.map +1 -1
  100. package/build/common/hooks/useEffectEvent.mjs.map +1 -1
  101. package/build/common/hooks/useHasIntersected/useHasIntersected.js.map +1 -1
  102. package/build/common/hooks/useHasIntersected/useHasIntersected.mjs.map +1 -1
  103. package/build/common/hooks/useLayout/useLayout.js.map +1 -1
  104. package/build/common/hooks/useLayout/useLayout.mjs.map +1 -1
  105. package/build/common/hooks/useMedia.js.map +1 -1
  106. package/build/common/hooks/useMedia.mjs.map +1 -1
  107. package/build/common/hooks/useResizeObserver.js.map +1 -1
  108. package/build/common/hooks/useResizeObserver.mjs.map +1 -1
  109. package/build/common/hooks/useScreenSize.js.map +1 -1
  110. package/build/common/hooks/useScreenSize.mjs.map +1 -1
  111. package/build/common/hooks/useVirtualKeyboard.js.map +1 -1
  112. package/build/common/hooks/useVirtualKeyboard.mjs.map +1 -1
  113. package/build/common/initials.js.map +1 -1
  114. package/build/common/initials.mjs.map +1 -1
  115. package/build/common/locale/index.js +1 -1
  116. package/build/common/locale/index.js.map +1 -1
  117. package/build/common/locale/index.mjs +1 -1
  118. package/build/common/locale/index.mjs.map +1 -1
  119. package/build/common/panel/Panel.js.map +1 -1
  120. package/build/common/panel/Panel.mjs.map +1 -1
  121. package/build/common/propsValues/breakpoint.js.map +1 -1
  122. package/build/common/propsValues/breakpoint.mjs.map +1 -1
  123. package/build/common/propsValues/control.js.map +1 -1
  124. package/build/common/propsValues/control.mjs.map +1 -1
  125. package/build/common/propsValues/dateMode.js.map +1 -1
  126. package/build/common/propsValues/dateMode.mjs.map +1 -1
  127. package/build/common/propsValues/layouts.js.map +1 -1
  128. package/build/common/propsValues/layouts.mjs.map +1 -1
  129. package/build/common/propsValues/markdownNodeType.js.map +1 -1
  130. package/build/common/propsValues/markdownNodeType.mjs.map +1 -1
  131. package/build/common/propsValues/monthFormat.js.map +1 -1
  132. package/build/common/propsValues/monthFormat.mjs.map +1 -1
  133. package/build/common/propsValues/position.js.map +1 -1
  134. package/build/common/propsValues/position.mjs.map +1 -1
  135. package/build/common/propsValues/profileType.js.map +1 -1
  136. package/build/common/propsValues/profileType.mjs.map +1 -1
  137. package/build/common/propsValues/scroll.js.map +1 -1
  138. package/build/common/propsValues/scroll.mjs.map +1 -1
  139. package/build/common/propsValues/sentiment.js.map +1 -1
  140. package/build/common/propsValues/sentiment.mjs.map +1 -1
  141. package/build/common/propsValues/size.js.map +1 -1
  142. package/build/common/propsValues/size.mjs.map +1 -1
  143. package/build/common/propsValues/status.js.map +1 -1
  144. package/build/common/propsValues/status.mjs.map +1 -1
  145. package/build/common/propsValues/type.js.map +1 -1
  146. package/build/common/propsValues/type.mjs.map +1 -1
  147. package/build/common/propsValues/typography.js.map +1 -1
  148. package/build/common/propsValues/typography.mjs.map +1 -1
  149. package/build/common/propsValues/variant.js.map +1 -1
  150. package/build/common/propsValues/variant.mjs.map +1 -1
  151. package/build/common/propsValues/width.js.map +1 -1
  152. package/build/common/propsValues/width.mjs.map +1 -1
  153. package/build/common/responsivePanel/ResponsivePanel.js.map +1 -1
  154. package/build/common/responsivePanel/ResponsivePanel.mjs.map +1 -1
  155. package/build/common/textFormat/formatWithPattern/formatWithPattern.js.map +1 -1
  156. package/build/common/textFormat/formatWithPattern/formatWithPattern.mjs.map +1 -1
  157. package/build/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js.map +1 -1
  158. package/build/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.mjs.map +1 -1
  159. package/build/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js.map +1 -1
  160. package/build/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.mjs.map +1 -1
  161. package/build/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js.map +1 -1
  162. package/build/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.mjs.map +1 -1
  163. package/build/common/textFormat/unformatWithPattern/unformatWithPattern.js.map +1 -1
  164. package/build/common/textFormat/unformatWithPattern/unformatWithPattern.mjs.map +1 -1
  165. package/build/common/theme.js.map +1 -1
  166. package/build/common/theme.mjs.map +1 -1
  167. package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
  168. package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
  169. package/build/dateInput/DateInput.js.map +1 -1
  170. package/build/dateInput/DateInput.mjs.map +1 -1
  171. package/build/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.js.map +1 -1
  172. package/build/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.mjs.map +1 -1
  173. package/build/dateLookup/DateLookup.js.map +1 -1
  174. package/build/dateLookup/DateLookup.mjs.map +1 -1
  175. package/build/dateLookup/dateHeader/DateHeader.js.map +1 -1
  176. package/build/dateLookup/dateHeader/DateHeader.mjs.map +1 -1
  177. package/build/dateLookup/dateTrigger/DateTrigger.js.map +1 -1
  178. package/build/dateLookup/dateTrigger/DateTrigger.mjs.map +1 -1
  179. package/build/dateLookup/dayCalendar/DayCalendar.js.map +1 -1
  180. package/build/dateLookup/dayCalendar/DayCalendar.mjs.map +1 -1
  181. package/build/dateLookup/dayCalendar/table/DayCalendarTable.js.map +1 -1
  182. package/build/dateLookup/dayCalendar/table/DayCalendarTable.mjs.map +1 -1
  183. package/build/dateLookup/getStartOfDay/getStartOfDay.js.map +1 -1
  184. package/build/dateLookup/getStartOfDay/getStartOfDay.mjs.map +1 -1
  185. package/build/dateLookup/monthCalendar/MonthCalendar.js.map +1 -1
  186. package/build/dateLookup/monthCalendar/MonthCalendar.mjs.map +1 -1
  187. package/build/dateLookup/monthCalendar/table/MonthCalendarTable.js.map +1 -1
  188. package/build/dateLookup/monthCalendar/table/MonthCalendarTable.mjs.map +1 -1
  189. package/build/dateLookup/tableLink/TableLink.js.map +1 -1
  190. package/build/dateLookup/tableLink/TableLink.mjs.map +1 -1
  191. package/build/dateLookup/yearCalendar/YearCalendar.js.map +1 -1
  192. package/build/dateLookup/yearCalendar/YearCalendar.mjs.map +1 -1
  193. package/build/dateLookup/yearCalendar/table/YearCalendarTable.js.map +1 -1
  194. package/build/dateLookup/yearCalendar/table/YearCalendarTable.mjs.map +1 -1
  195. package/build/decision/Decision.js.map +1 -1
  196. package/build/decision/Decision.mjs.map +1 -1
  197. package/build/definitionList/DefinitionList.js.map +1 -1
  198. package/build/definitionList/DefinitionList.mjs.map +1 -1
  199. package/build/dimmer/Dimmer.js.map +1 -1
  200. package/build/dimmer/Dimmer.mjs.map +1 -1
  201. package/build/dimmer/dimmerManager/DimmerManager.js.map +1 -1
  202. package/build/dimmer/dimmerManager/DimmerManager.mjs.map +1 -1
  203. package/build/display/Display.js.map +1 -1
  204. package/build/display/Display.mjs.map +1 -1
  205. package/build/divider/Divider.js.map +1 -1
  206. package/build/divider/Divider.mjs.map +1 -1
  207. package/build/drawer/Drawer.js.map +1 -1
  208. package/build/drawer/Drawer.mjs.map +1 -1
  209. package/build/dropFade/DropFade.js.map +1 -1
  210. package/build/dropFade/DropFade.mjs.map +1 -1
  211. package/build/emphasis/Emphasis.js.map +1 -1
  212. package/build/emphasis/Emphasis.mjs.map +1 -1
  213. package/build/emphasis/EmphasisHtmlTransformer.js.map +1 -1
  214. package/build/emphasis/EmphasisHtmlTransformer.mjs.map +1 -1
  215. package/build/field/Field.js.map +1 -1
  216. package/build/field/Field.mjs.map +1 -1
  217. package/build/flowNavigation/FlowNavigation.js.map +1 -1
  218. package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
  219. package/build/flowNavigation/animatedLabel/AnimatedLabel.js.map +1 -1
  220. package/build/flowNavigation/animatedLabel/AnimatedLabel.mjs.map +1 -1
  221. package/build/header/Header.js.map +1 -1
  222. package/build/header/Header.mjs.map +1 -1
  223. package/build/i18n/index.js +2 -0
  224. package/build/i18n/index.js.map +1 -1
  225. package/build/i18n/index.mjs +2 -0
  226. package/build/i18n/index.mjs.map +1 -1
  227. package/build/i18n/nl.json.js +81 -0
  228. package/build/i18n/nl.json.js.map +1 -0
  229. package/build/i18n/nl.json.mjs +77 -0
  230. package/build/i18n/nl.json.mjs.map +1 -0
  231. package/build/image/Image.js.map +1 -1
  232. package/build/image/Image.mjs.map +1 -1
  233. package/build/info/Info.js.map +1 -1
  234. package/build/info/Info.mjs.map +1 -1
  235. package/build/info/infoPresentations.js.map +1 -1
  236. package/build/info/infoPresentations.mjs.map +1 -1
  237. package/build/inlineAlert/InlineAlert.js.map +1 -1
  238. package/build/inlineAlert/InlineAlert.mjs.map +1 -1
  239. package/build/inputs/Input.js.map +1 -1
  240. package/build/inputs/Input.mjs.map +1 -1
  241. package/build/inputs/InputGroup.js.map +1 -1
  242. package/build/inputs/InputGroup.mjs.map +1 -1
  243. package/build/inputs/SearchInput.js.map +1 -1
  244. package/build/inputs/SearchInput.mjs.map +1 -1
  245. package/build/inputs/SelectInput.js.map +1 -1
  246. package/build/inputs/SelectInput.mjs.map +1 -1
  247. package/build/inputs/_BottomSheet.js.map +1 -1
  248. package/build/inputs/_BottomSheet.mjs.map +1 -1
  249. package/build/inputs/_ButtonInput.js.map +1 -1
  250. package/build/inputs/_ButtonInput.mjs.map +1 -1
  251. package/build/inputs/_Popover.js.map +1 -1
  252. package/build/inputs/_Popover.mjs.map +1 -1
  253. package/build/inputs/contexts.js.map +1 -1
  254. package/build/inputs/contexts.mjs.map +1 -1
  255. package/build/instructionsList/InstructionsList.js.map +1 -1
  256. package/build/instructionsList/InstructionsList.mjs.map +1 -1
  257. package/build/label/Label.js.map +1 -1
  258. package/build/label/Label.mjs.map +1 -1
  259. package/build/legacylistItem/LegacyListItem.js.map +1 -1
  260. package/build/legacylistItem/LegacyListItem.mjs.map +1 -1
  261. package/build/legacylistItem/List.js.map +1 -1
  262. package/build/legacylistItem/List.mjs.map +1 -1
  263. package/build/link/Link.js.map +1 -1
  264. package/build/link/Link.mjs.map +1 -1
  265. package/build/loader/Loader.js.map +1 -1
  266. package/build/loader/Loader.mjs.map +1 -1
  267. package/build/logo/Logo.js.map +1 -1
  268. package/build/logo/Logo.mjs.map +1 -1
  269. package/build/logo/logo-assets.js.map +1 -1
  270. package/build/logo/logo-assets.mjs.map +1 -1
  271. package/build/markdown/Markdown.js.map +1 -1
  272. package/build/markdown/Markdown.mjs.map +1 -1
  273. package/build/mocks.js.map +1 -1
  274. package/build/mocks.mjs.map +1 -1
  275. package/build/modal/Modal.js.map +1 -1
  276. package/build/modal/Modal.mjs.map +1 -1
  277. package/build/money/Money.js.map +1 -1
  278. package/build/money/Money.mjs.map +1 -1
  279. package/build/moneyInput/MoneyInput.js.map +1 -1
  280. package/build/moneyInput/MoneyInput.mjs.map +1 -1
  281. package/build/moneyInput/currencyFormatting.js.map +1 -1
  282. package/build/moneyInput/currencyFormatting.mjs.map +1 -1
  283. package/build/navigationOption/NavigationOption.js.map +1 -1
  284. package/build/navigationOption/NavigationOption.mjs.map +1 -1
  285. package/build/navigationOptionsList/NavigationOptionsList.js.map +1 -1
  286. package/build/navigationOptionsList/NavigationOptionsList.mjs.map +1 -1
  287. package/build/nudge/Nudge.js.map +1 -1
  288. package/build/nudge/Nudge.mjs.map +1 -1
  289. package/build/overlayHeader/OverlayHeader.js.map +1 -1
  290. package/build/overlayHeader/OverlayHeader.mjs.map +1 -1
  291. package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
  292. package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
  293. package/build/phoneNumberInput/data/countries.js.map +1 -1
  294. package/build/phoneNumberInput/data/countries.mjs.map +1 -1
  295. package/build/phoneNumberInput/utils/explodeNumberModel/index.js.map +1 -1
  296. package/build/phoneNumberInput/utils/explodeNumberModel/index.mjs.map +1 -1
  297. package/build/phoneNumberInput/utils/findCountryByCode/index.js.map +1 -1
  298. package/build/phoneNumberInput/utils/findCountryByCode/index.mjs.map +1 -1
  299. package/build/phoneNumberInput/utils/findCountryByPrefix/index.js.map +1 -1
  300. package/build/phoneNumberInput/utils/findCountryByPrefix/index.mjs.map +1 -1
  301. package/build/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.js.map +1 -1
  302. package/build/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.mjs.map +1 -1
  303. package/build/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js.map +1 -1
  304. package/build/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.mjs.map +1 -1
  305. package/build/phoneNumberInput/utils/longestMatchingPrefix/index.js.map +1 -1
  306. package/build/phoneNumberInput/utils/longestMatchingPrefix/index.mjs.map +1 -1
  307. package/build/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.js.map +1 -1
  308. package/build/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.mjs.map +1 -1
  309. package/build/popover/Popover.js.map +1 -1
  310. package/build/popover/Popover.mjs.map +1 -1
  311. package/build/primitives/PrimitiveAnchor/PrimitiveAnchor.js.map +1 -1
  312. package/build/primitives/PrimitiveAnchor/PrimitiveAnchor.mjs.map +1 -1
  313. package/build/primitives/PrimitiveButton/PrimitiveButton.js.map +1 -1
  314. package/build/primitives/PrimitiveButton/PrimitiveButton.mjs.map +1 -1
  315. package/build/processIndicator/ProcessIndicator.js.map +1 -1
  316. package/build/processIndicator/ProcessIndicator.mjs.map +1 -1
  317. package/build/progress/Progress.js.map +1 -1
  318. package/build/progress/Progress.mjs.map +1 -1
  319. package/build/progressBar/ProgressBar.js.map +1 -1
  320. package/build/progressBar/ProgressBar.mjs.map +1 -1
  321. package/build/promoCard/PromoCard.js.map +1 -1
  322. package/build/promoCard/PromoCard.mjs.map +1 -1
  323. package/build/promoCard/PromoCardContext.js.map +1 -1
  324. package/build/promoCard/PromoCardContext.mjs.map +1 -1
  325. package/build/promoCard/PromoCardGroup.js.map +1 -1
  326. package/build/promoCard/PromoCardGroup.mjs.map +1 -1
  327. package/build/promoCard/PromoCardIndicator.js.map +1 -1
  328. package/build/promoCard/PromoCardIndicator.mjs.map +1 -1
  329. package/build/provider/Provider.js.map +1 -1
  330. package/build/provider/Provider.mjs.map +1 -1
  331. package/build/provider/direction/DirectionProvider.js.map +1 -1
  332. package/build/provider/direction/DirectionProvider.mjs.map +1 -1
  333. package/build/provider/language/LanguageProvider.js.map +1 -1
  334. package/build/provider/language/LanguageProvider.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/radioOption/RadioOption.js.map +1 -1
  342. package/build/radioOption/RadioOption.mjs.map +1 -1
  343. package/build/section/Section.js.map +1 -1
  344. package/build/section/Section.mjs.map +1 -1
  345. package/build/segmentedControl/SegmentedControl.js.map +1 -1
  346. package/build/segmentedControl/SegmentedControl.mjs.map +1 -1
  347. package/build/select/Select.js.map +1 -1
  348. package/build/select/Select.mjs.map +1 -1
  349. package/build/select/option/Option.js.map +1 -1
  350. package/build/select/option/Option.mjs.map +1 -1
  351. package/build/select/searchBox/SearchBox.js.map +1 -1
  352. package/build/select/searchBox/SearchBox.mjs.map +1 -1
  353. package/build/slidingPanel/SlidingPanel.js.map +1 -1
  354. package/build/slidingPanel/SlidingPanel.mjs.map +1 -1
  355. package/build/snackbar/Snackbar.js.map +1 -1
  356. package/build/snackbar/Snackbar.mjs.map +1 -1
  357. package/build/snackbar/SnackbarContext.js.map +1 -1
  358. package/build/snackbar/SnackbarContext.mjs.map +1 -1
  359. package/build/snackbar/SnackbarProvider.js.map +1 -1
  360. package/build/snackbar/SnackbarProvider.mjs.map +1 -1
  361. package/build/snackbar/useSnackbar.js.map +1 -1
  362. package/build/snackbar/useSnackbar.mjs.map +1 -1
  363. package/build/statusIcon/StatusIcon.js.map +1 -1
  364. package/build/statusIcon/StatusIcon.mjs.map +1 -1
  365. package/build/stepper/Stepper.js.map +1 -1
  366. package/build/stepper/Stepper.mjs.map +1 -1
  367. package/build/stepper/deviceDetection.js.map +1 -1
  368. package/build/stepper/deviceDetection.mjs.map +1 -1
  369. package/build/sticky/Sticky.js.map +1 -1
  370. package/build/sticky/Sticky.mjs.map +1 -1
  371. package/build/summary/Summary.js.map +1 -1
  372. package/build/summary/Summary.mjs.map +1 -1
  373. package/build/switch/Switch.js.map +1 -1
  374. package/build/switch/Switch.mjs.map +1 -1
  375. package/build/switchOption/SwitchOption.js.map +1 -1
  376. package/build/switchOption/SwitchOption.mjs.map +1 -1
  377. package/build/table/Table.js.map +1 -1
  378. package/build/table/Table.mjs.map +1 -1
  379. package/build/table/TableCell.js.map +1 -1
  380. package/build/table/TableCell.mjs.map +1 -1
  381. package/build/table/TableHeader.js.map +1 -1
  382. package/build/table/TableHeader.mjs.map +1 -1
  383. package/build/table/TableRow.js.map +1 -1
  384. package/build/table/TableRow.mjs.map +1 -1
  385. package/build/table/TableStatusText.js.map +1 -1
  386. package/build/table/TableStatusText.mjs.map +1 -1
  387. package/build/tabs/Tab.js.map +1 -1
  388. package/build/tabs/Tab.mjs.map +1 -1
  389. package/build/tabs/TabList.js.map +1 -1
  390. package/build/tabs/TabList.mjs.map +1 -1
  391. package/build/tabs/TabPanel.js.map +1 -1
  392. package/build/tabs/TabPanel.mjs.map +1 -1
  393. package/build/tabs/Tabs.js.map +1 -1
  394. package/build/tabs/Tabs.mjs.map +1 -1
  395. package/build/tabs/utils.js.map +1 -1
  396. package/build/tabs/utils.mjs.map +1 -1
  397. package/build/tile/Tile.js.map +1 -1
  398. package/build/tile/Tile.mjs.map +1 -1
  399. package/build/title/Title.js.map +1 -1
  400. package/build/title/Title.mjs.map +1 -1
  401. package/build/tooltip/Tooltip.js.map +1 -1
  402. package/build/tooltip/Tooltip.mjs.map +1 -1
  403. package/build/typeahead/Typeahead.js.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/types/common/locale/index.d.ts.map +1 -1
  412. package/build/types/i18n/index.d.ts.map +1 -1
  413. package/build/upload/Upload.js.map +1 -1
  414. package/build/upload/Upload.mjs.map +1 -1
  415. package/build/upload/steps/completeStep/completeStep.js.map +1 -1
  416. package/build/upload/steps/completeStep/completeStep.mjs.map +1 -1
  417. package/build/upload/steps/processingStep/processingStep.js.map +1 -1
  418. package/build/upload/steps/processingStep/processingStep.mjs.map +1 -1
  419. package/build/upload/steps/uploadImageStep/uploadImageStep.js.map +1 -1
  420. package/build/upload/steps/uploadImageStep/uploadImageStep.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/UploadInput.js.map +1 -1
  432. package/build/uploadInput/UploadInput.mjs.map +1 -1
  433. package/build/uploadInput/uploadButton/UploadButton.js.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/uploadItem/UploadItem.js.map +1 -1
  440. package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -1
  441. package/build/uploadInput/uploadItem/UploadItemLink.js.map +1 -1
  442. package/build/uploadInput/uploadItem/UploadItemLink.mjs.map +1 -1
  443. package/build/utilities/cssValueWithUnit.js.map +1 -1
  444. package/build/utilities/cssValueWithUnit.mjs.map +1 -1
  445. package/build/utilities/logActionRequired.js.map +1 -1
  446. package/build/utilities/logActionRequired.mjs.map +1 -1
  447. package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
  448. package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
  449. package/build/withId/withId.js.map +1 -1
  450. package/build/withId/withId.mjs.map +1 -1
  451. package/build/withNextPortal/withNextPortal.js.map +1 -1
  452. package/build/withNextPortal/withNextPortal.mjs.map +1 -1
  453. package/package.json +25 -25
  454. package/src/accordion/Accordion.story.tsx +30 -21
  455. package/src/actionButton/ActionButton.story.tsx +0 -1
  456. package/src/actionOption/ActionOption.story.tsx +0 -1
  457. package/src/alert/Alert.story.tsx +1 -1
  458. package/src/avatar/Avatar.spec.tsx +7 -4
  459. package/src/avatar/Avatar.story.tsx +0 -1
  460. package/src/avatarLayout/AvatarLayout.story.tsx +0 -3
  461. package/src/avatarView/AvatarView.story.tsx +0 -6
  462. package/src/avatarWrapper/AvatarWrapper.story.tsx +0 -1
  463. package/src/badge/Badge.story.tsx +0 -1
  464. package/src/body/Body.story.tsx +0 -1
  465. package/src/button/Button.story.tsx +1 -1
  466. package/src/button/LegacyButton.story.tsx +1 -1
  467. package/src/card/Card.story.tsx +0 -1
  468. package/src/checkbox/Checkbox.story.tsx +0 -1
  469. package/src/checkboxButton/CheckboxButton.story.tsx +1 -1
  470. package/src/checkboxOption/CheckboxOption.story.tsx +0 -1
  471. package/src/chevron/Chevron.story.tsx +0 -1
  472. package/src/chips/Chips.story.tsx +0 -1
  473. package/src/circularButton/CircularButton.story.tsx +1 -1
  474. package/src/common/bottomSheet/BottomSheet.story.tsx +5 -4
  475. package/src/common/card/Card.story.tsx +0 -1
  476. package/src/common/circle/Circle.story.tsx +0 -1
  477. package/src/common/locale/index.spec.ts +1 -1
  478. package/src/common/locale/index.ts +2 -0
  479. package/src/criticalBanner/CriticalCommsBanner.story.tsx +0 -1
  480. package/src/dateInput/DateInput.story.tsx +0 -1
  481. package/src/divider/Divider.story.tsx +1 -1
  482. package/src/emphasis/Emphasis.story.tsx +0 -1
  483. package/src/field/Field.story.tsx +1 -1
  484. package/src/i18n/index.ts +2 -0
  485. package/src/iconButton/IconButton.story.tsx +0 -1
  486. package/src/info/Info.story.tsx +1 -0
  487. package/src/inputWithDisplayFormat/InputWithDisplayFormat.story.tsx +1 -0
  488. package/src/inputs/SelectInput.story.tsx +1 -1
  489. package/src/instructionsList/InstructionsList.story.tsx +0 -1
  490. package/src/label/Label.story.tsx +0 -1
  491. package/src/legacylistItem/LegacyListItem.story.tsx +0 -1
  492. package/src/loader/Loader.story.tsx +0 -1
  493. package/src/logo/Logo.story.tsx +0 -1
  494. package/src/markdown/Markdown.story.tsx +0 -1
  495. package/src/modal/Modal.story.tsx +11 -6
  496. package/src/moneyInput/MoneyInput.story.tsx +0 -1
  497. package/src/navigationOption/NavigationOption.story.tsx +0 -1
  498. package/src/phoneNumberInput/PhoneNumberInput.story.tsx +0 -1
  499. package/src/popover/Popover.story.tsx +1 -1
  500. package/src/primitives/PrimitiveAnchor/stories/PrimitiveAnchor.story.tsx +0 -1
  501. package/src/primitives/PrimitiveButton/stories/PrimitiveButton.story.tsx +0 -1
  502. package/src/primitives/PrimitiveButton/stories/PrimitiveButton.tests.story.tsx +0 -1
  503. package/src/processIndicator/ProcessIndicator.story.tsx +0 -1
  504. package/src/progressBar/ProgressBar.story.tsx +0 -1
  505. package/src/promoCard/PromoCard.story.tsx +1 -1
  506. package/src/promoCard/PromoCardGroup.story.tsx +0 -1
  507. package/src/statusIcon/StatusIcon.story.tsx +1 -1
  508. package/src/stepper/Stepper.story.tsx +0 -1
  509. package/src/sticky/Sticky.story.tsx +1 -1
  510. package/src/switch/Switch.story.tsx +0 -1
  511. package/src/switchOption/SwitchOption.story.tsx +1 -1
  512. package/src/table/Table.story.tsx +0 -1
  513. package/src/tabs/Tabs.story.tsx +0 -1
  514. package/src/tooltip/Tooltip.story.tsx +0 -1
  515. package/src/typeahead/Typeahead.story.tsx +1 -0
  516. package/src/upload/Upload.story.tsx +1 -1
  517. package/src/uploadInput/UploadInput.story.tsx +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"PromoCard.mjs","sources":["../../src/promoCard/PromoCard.tsx"],"sourcesContent":["import { Check } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport React, { forwardRef, FunctionComponent, useEffect, useId, useState } from 'react';\n\nimport Body from '../body';\nimport { Typography } from '../common';\nimport Card, { type CardProps } from '../common/card';\nimport Display from '../display';\nimport Image from '../image/Image';\nimport Title from '../title';\n\nimport { usePromoCardContext } from './PromoCardContext';\nimport PromoCardIndicator, { type PromoCardIndicatorProps } from './PromoCardIndicator';\n\nexport type ReferenceType = React.Ref<HTMLInputElement> | React.Ref<HTMLDivElement>;\nexport type RelatedTypes =\n | ''\n | 'alternate'\n | 'author'\n | 'bookmark'\n | 'external'\n | 'help'\n | 'license'\n | 'next'\n | 'nofollow'\n | 'noreferrer'\n | 'noopener'\n | 'prev'\n | 'search'\n | 'tag';\n\nexport interface PromoCardCommonProps {\n /** Optional prop to specify classNames onto the PromoCard */\n className?: string;\n\n /** Optional prop to specify the ID of the PromoCard */\n id?: string;\n\n /** Required prop to specify the descriptive text of the PromoCard */\n description: string;\n\n /**\n * Optional prop to specify the heading level of the PromoCard\n *\n * @default 'h3'\n */\n headingLevel?: 'h3' | 'h4' | 'h5' | 'h6';\n\n /** Optional prop to specify text for the indicator label of the PromoCard */\n indicatorLabel?: string;\n\n /** Optional prop to specify the icon for the indicator icon of the PromoCard */\n indicatorIcon?: PromoCardIndicatorProps['icon'];\n\n /** Optional prop to specify an image alt text */\n imageAlt?: string;\n\n /** Optional prop to specify an image class */\n imageClass?: string;\n\n /** Optional prop to specify an image source url */\n imageSource?: string;\n\n /** Specify whether the PromoCard is disabled, or not */\n isDisabled?: boolean;\n\n /** Specify an onClick event handler */\n onClick?: () => void;\n\n /** Specify an onKeyDown event handler */\n onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;\n\n /** Optional prop to specify the ID used for testing */\n testId?: string;\n\n /** Required prop to specify the title text of the PromoCard */\n title: string;\n\n /** Set to false to use body font style for the title */\n useDisplayFont?: boolean;\n\n ref?: ReferenceType;\n}\n\nexport interface PromoCardLinkProps extends PromoCardCommonProps, Omit<CardProps, 'children'> {\n /**\n * Optional prop to prompts a user to save the linked URL instead of\n * navigating to it\n */\n download?: string;\n\n /** Optionally specify an href for your PromoCard to contain an <a> element */\n href?: string;\n\n /** Optionally specify the language of the linked URL */\n hrefLang?: string;\n\n /** Optional property that can be pass a ref for the anchor. */\n anchorRef?: React.Ref<HTMLAnchorElement>;\n\n /**\n * Optional prop to specify the ID of the anchor element which can be useful when using a ref.\n */\n anchorId?: string;\n\n /**\n * Relationship between the PromoCard href URL and the current page. See\n * [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).\n */\n rel?: RelatedTypes;\n\n /** Optional prop to to display where the linked URL will show */\n target?: React.HTMLAttributeAnchorTarget;\n\n /** Only applies to role=\"radio\" or \"checkbox\" */\n defaultChecked?: never;\n isChecked?: never;\n tabIndex?: never;\n type?: never;\n ref?: ReferenceType;\n value?: never;\n}\n\nexport interface PromoCardCheckedProps extends PromoCardCommonProps, Omit<CardProps, 'children'> {\n /** Specify the initial checked attribute of the PromoCard */\n defaultChecked?: boolean;\n\n /** Specify whether the PromoCard is checked, or not */\n isChecked?: boolean;\n\n /** Optional prop to specify the tabIndex of the PromoCard */\n tabIndex?: number;\n\n /** Optional property to provide component Ref */\n ref?: ReferenceType;\n\n /** Optional prop to specify the input type of the PromoCard */\n type?: 'checkbox' | 'radio';\n\n /** Specify the value attribute of the PromoCard if Checkbox or Radio */\n value?: string;\n\n /** Only applies to <a />s */\n download?: never;\n href?: never;\n anchorRef?: never;\n anchorId?: never;\n hrefLang?: never;\n rel?: never;\n target?: never;\n}\n\nexport type PromoCardProps = PromoCardLinkProps | PromoCardCheckedProps;\n\nexport type PolymorphicPromoCard = (\n props: PromoCardLinkProps | PromoCardCheckedProps,\n) => React.JSX.Element;\n\n/**\n * PromoCard component.\n *\n * PromoCard is a marketing style component that is used to group marketing\n * product related information (such as choosing Card types). It can be used to\n * display information in a structured way, and can be customized with various\n * props to suit different use cases.\n *\n * @component\n * @param {string} className - Additional class name for the PromoCard.\n * @param {string} description - Description text for the PromoCard.\n * @param {boolean} defaultChecked - Initial checked state for checkboxes and radios.\n * @param {string} download - Download file name for links.\n * @param {string} href - URL for links.\n * @param {string} hrefLang - Language code for linked URL.\n * @param {string} id - ID of the PromoCard.\n * @param {string} imageAlt - Alt text for the image.\n * @param {string} imageSource - Source URL of the image.\n * @param {string} indicatorLabel - Label for the indicator icon.\n * @param {boolean} isChecked - Checked state for checkboxes and radios.\n * @param {boolean} isDisabled - Whether the PromoCard is disabled.\n * @param {Function} onClick - Click event handler for the PromoCard.\n * @param {string} rel - Relationship between the URL and the current page.\n * @param {number} tabIndex - Tab index for keyboard navigation.\n * @param {string} target - Target window for links.\n * @param {string} testId - ID used for testing.\n * @param {string} title - Title text of the PromoCard.\n * @param {('checkbox'|'radio')} type - Type of the PromoCard (checkbox, radio).\n * @param {string} value - Value for checkboxes and radios.\n * @returns {React.JSX.Element} The rendered PromoCard component.\n * @example\n * <PromoCard\n * title=\"Example PromoCard\"\n * description=\"This is an example PromoCard with a link variation.\"\n * href=\"https://example.com\"\n * target=\"_blank\"\n * imageSource=\"https://example.com/image.png\"\n * imageAlt=\"Example Image\"\n * indicatorLabel=\"Learn More\"\n * />\n */\nconst PromoCard: FunctionComponent<PromoCardProps> = forwardRef(\n (\n {\n className,\n description,\n defaultChecked,\n download,\n href,\n hrefLang,\n id,\n headingLevel = 'h3',\n imageAlt,\n imageClass,\n imageSource,\n indicatorLabel,\n indicatorIcon,\n isChecked,\n isDisabled,\n onClick,\n onKeyDown,\n rel,\n tabIndex,\n target,\n testId,\n title,\n type,\n value,\n isSmall,\n useDisplayFont = true,\n anchorRef,\n anchorId,\n ...props\n },\n ref: ReferenceType,\n ) => {\n // Set the `checked` state to the value of `defaultChecked` if it is truthy,\n // or the value of `isChecked` if it is truthy, or `false` if neither\n // is truthy.\n const { state, onChange, isDisabled: contextIsDisabled } = usePromoCardContext();\n const [checked, setChecked] = useState(\n type === 'checkbox' ? (defaultChecked ?? isChecked ?? false) : false,\n );\n\n const handleClick = () => {\n if (type === 'radio') {\n onChange(value || ''); // Update the context state for radio\n } else if (type === 'checkbox') {\n setChecked(!checked); // Update local state for checkbox\n }\n };\n\n const fallbackId = useId();\n const componentId = id || fallbackId;\n\n // Set the icon to `'arrow'` if `href` is truthy and `type` is falsy, or\n // `'download'` if `download` is truthy. If neither condition is true, set\n // `icon` to `undefined`.\n\n // Create a function to get icon type\n const getIconType = () => {\n if (indicatorIcon) {\n return indicatorIcon;\n }\n\n if (download) {\n return 'download';\n }\n\n if (href && !type) {\n return 'arrow';\n }\n\n return undefined;\n };\n\n const CardTitle = useDisplayFont ? Display : Title;\n\n // Define all class names string based on the values of the `href`, `type`,\n // `checked`, and `className` props.\n const commonClasses = clsx(\n {\n 'np-Card--promoCard': true,\n 'np-Card--checked': !href && type,\n 'np-Card--link': href && !type,\n 'is-checked':\n type === 'radio' ? value === state : type === 'checkbox' ? checked : undefined,\n },\n className,\n );\n\n // Object with common props that will be passed to the `Card` components\n const commonProps = {\n className: commonClasses,\n id: componentId,\n isDisabled: isDisabled || contextIsDisabled,\n onClick,\n onKeyDown,\n ref,\n 'data-testid': testId,\n isSmall,\n };\n\n // Object with Anchor props that will be passed to the `a` element. These\n // won't be refurned if set to `isDisabled`\n const anchorProps =\n href && !isDisabled\n ? {\n download,\n href: href || undefined,\n hrefLang,\n rel,\n target,\n ref: anchorRef,\n id: anchorId,\n }\n : {};\n\n // Object of all Checked props that will be passed to the root `Card` component\n const checkedProps =\n (type === 'checkbox' || type === 'radio') && !href\n ? {\n ...commonProps,\n 'aria-checked':\n type === 'radio' ? value === state : type === 'checkbox' ? checked : undefined,\n 'aria-describedby': `${componentId}-title`,\n 'aria-disabled': isDisabled,\n 'data-value': value ?? undefined,\n role: type === 'checkbox' || type === 'radio' ? type : undefined,\n onClick: handleClick,\n onKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter' || event.key === ' ') {\n handleClick();\n }\n },\n ref,\n tabIndex: 0,\n }\n : {};\n\n const getTitle = () => {\n const titleContent =\n href && !type ? (\n <a className=\"np-Card-titleLink\" {...anchorProps}>\n {title}\n </a>\n ) : (\n title\n );\n\n const titleProps = {\n id: `${componentId}-title`,\n as: headingLevel,\n className: 'np-Card-title',\n };\n\n return useDisplayFont ? (\n <Display type={Typography.DISPLAY_SMALL} {...titleProps}>\n {titleContent}\n </Display>\n ) : (\n <Title type={Typography.TITLE_SUBSECTION} {...titleProps}>\n {titleContent}\n </Title>\n );\n };\n\n useEffect(() => {\n setChecked(defaultChecked ?? isChecked ?? false);\n }, [defaultChecked, isChecked]);\n\n return (\n <Card {...commonProps} {...checkedProps} {...props}>\n {(value === state || checked) && (\n <span className=\"np-Card-check\">\n <Check size={24} aria-hidden=\"true\" />\n </span>\n )}\n\n {getTitle()}\n\n <Body className=\"np-Card-description\">{description}</Body>\n\n {imageSource && (\n <div className={clsx('np-Card-image', { imageClass })}>\n <Image src={imageSource} alt={imageAlt || ''} loading=\"lazy\" />\n </div>\n )}\n\n <PromoCardIndicator label={indicatorLabel} icon={getIconType()} isSmall={isSmall} />\n </Card>\n );\n },\n) as PolymorphicPromoCard;\n\nexport default React.memo(PromoCard);\n"],"names":["PromoCard","forwardRef","className","description","defaultChecked","download","href","hrefLang","id","headingLevel","imageAlt","imageClass","imageSource","indicatorLabel","indicatorIcon","isChecked","isDisabled","onClick","onKeyDown","rel","tabIndex","target","testId","title","type","value","isSmall","useDisplayFont","anchorRef","anchorId","props","ref","state","onChange","contextIsDisabled","usePromoCardContext","checked","setChecked","useState","handleClick","fallbackId","useId","componentId","getIconType","undefined","commonClasses","clsx","commonProps","anchorProps","checkedProps","role","event","key","getTitle","titleContent","_jsx","children","titleProps","as","Display","Typography","DISPLAY_SMALL","Title","TITLE_SUBSECTION","useEffect","_jsxs","Card","Check","size","Body","Image","src","alt","loading","PromoCardIndicator","label","icon","React","memo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuMA,MAAMA,SAAS,gBAAsCC,UAAU,CAC7D,CACE;EACEC,SAAS;EACTC,WAAW;EACXC,cAAc;EACdC,QAAQ;EACRC,IAAI;EACJC,QAAQ;EACRC,EAAE;AACFC,EAAAA,YAAY,GAAG,IAAI;EACnBC,QAAQ;EACRC,UAAU;EACVC,WAAW;EACXC,cAAc;EACdC,aAAa;EACbC,SAAS;EACTC,UAAU;EACVC,OAAO;EACPC,SAAS;EACTC,GAAG;EACHC,QAAQ;EACRC,MAAM;EACNC,MAAM;EACNC,KAAK;EACLC,IAAI;EACJC,KAAK;EACLC,OAAO;AACPC,EAAAA,cAAc,GAAG,IAAI;EACrBC,SAAS;EACTC,QAAQ;EACR,GAAGC;AAAK,CACT,EACDC,GAAkB,KAChB;AACF;AACA;AACA;EACA,MAAM;IAAEC,KAAK;IAAEC,QAAQ;AAAEjB,IAAAA,UAAU,EAAEkB;GAAmB,GAAGC,mBAAmB,EAAE;AAChF,EAAA,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGC,QAAQ,CACpCd,IAAI,KAAK,UAAU,GAAIpB,cAAc,IAAIW,SAAS,IAAI,KAAK,GAAI,KAAK,CACrE;EAED,MAAMwB,WAAW,GAAGA,MAAK;IACvB,IAAIf,IAAI,KAAK,OAAO,EAAE;AACpBS,MAAAA,QAAQ,CAACR,KAAK,IAAI,EAAE,CAAC,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A,OAAO,EAAC;OACxD;AAAA,KAAK,CACN,eAEDlB,GAAA,CAACmB,kBAAkB,EAAA;AAACC,MAAAA,KAAK,EAAE9D,cAAe;MAAC+D,IAAI,EAAEjC,WAAW,EAAG;AAACjB,MAAAA,OAAO,EAAEA;AAAQ,KACnF,CAAA;AAAA,GAAM,CAAC;AAEX,CAAC,CACsB;AAEzB,kBAAA,aAAemD,cAAK,CAACC,IAAI,CAAC9E,SAAS,CAAC;;;;"}
1
+ {"version":3,"file":"PromoCard.mjs","sources":["../../src/promoCard/PromoCard.tsx"],"sourcesContent":["import { Check } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport React, { forwardRef, FunctionComponent, useEffect, useId, useState } from 'react';\n\nimport Body from '../body';\nimport { Typography } from '../common';\nimport Card, { type CardProps } from '../common/card';\nimport Display from '../display';\nimport Image from '../image/Image';\nimport Title from '../title';\n\nimport { usePromoCardContext } from './PromoCardContext';\nimport PromoCardIndicator, { type PromoCardIndicatorProps } from './PromoCardIndicator';\n\nexport type ReferenceType = React.Ref<HTMLInputElement> | React.Ref<HTMLDivElement>;\nexport type RelatedTypes =\n | ''\n | 'alternate'\n | 'author'\n | 'bookmark'\n | 'external'\n | 'help'\n | 'license'\n | 'next'\n | 'nofollow'\n | 'noreferrer'\n | 'noopener'\n | 'prev'\n | 'search'\n | 'tag';\n\nexport interface PromoCardCommonProps {\n /** Optional prop to specify classNames onto the PromoCard */\n className?: string;\n\n /** Optional prop to specify the ID of the PromoCard */\n id?: string;\n\n /** Required prop to specify the descriptive text of the PromoCard */\n description: string;\n\n /**\n * Optional prop to specify the heading level of the PromoCard\n *\n * @default 'h3'\n */\n headingLevel?: 'h3' | 'h4' | 'h5' | 'h6';\n\n /** Optional prop to specify text for the indicator label of the PromoCard */\n indicatorLabel?: string;\n\n /** Optional prop to specify the icon for the indicator icon of the PromoCard */\n indicatorIcon?: PromoCardIndicatorProps['icon'];\n\n /** Optional prop to specify an image alt text */\n imageAlt?: string;\n\n /** Optional prop to specify an image class */\n imageClass?: string;\n\n /** Optional prop to specify an image source url */\n imageSource?: string;\n\n /** Specify whether the PromoCard is disabled, or not */\n isDisabled?: boolean;\n\n /** Specify an onClick event handler */\n onClick?: () => void;\n\n /** Specify an onKeyDown event handler */\n onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;\n\n /** Optional prop to specify the ID used for testing */\n testId?: string;\n\n /** Required prop to specify the title text of the PromoCard */\n title: string;\n\n /** Set to false to use body font style for the title */\n useDisplayFont?: boolean;\n\n ref?: ReferenceType;\n}\n\nexport interface PromoCardLinkProps extends PromoCardCommonProps, Omit<CardProps, 'children'> {\n /**\n * Optional prop to prompts a user to save the linked URL instead of\n * navigating to it\n */\n download?: string;\n\n /** Optionally specify an href for your PromoCard to contain an <a> element */\n href?: string;\n\n /** Optionally specify the language of the linked URL */\n hrefLang?: string;\n\n /** Optional property that can be pass a ref for the anchor. */\n anchorRef?: React.Ref<HTMLAnchorElement>;\n\n /**\n * Optional prop to specify the ID of the anchor element which can be useful when using a ref.\n */\n anchorId?: string;\n\n /**\n * Relationship between the PromoCard href URL and the current page. See\n * [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).\n */\n rel?: RelatedTypes;\n\n /** Optional prop to to display where the linked URL will show */\n target?: React.HTMLAttributeAnchorTarget;\n\n /** Only applies to role=\"radio\" or \"checkbox\" */\n defaultChecked?: never;\n isChecked?: never;\n tabIndex?: never;\n type?: never;\n ref?: ReferenceType;\n value?: never;\n}\n\nexport interface PromoCardCheckedProps extends PromoCardCommonProps, Omit<CardProps, 'children'> {\n /** Specify the initial checked attribute of the PromoCard */\n defaultChecked?: boolean;\n\n /** Specify whether the PromoCard is checked, or not */\n isChecked?: boolean;\n\n /** Optional prop to specify the tabIndex of the PromoCard */\n tabIndex?: number;\n\n /** Optional property to provide component Ref */\n ref?: ReferenceType;\n\n /** Optional prop to specify the input type of the PromoCard */\n type?: 'checkbox' | 'radio';\n\n /** Specify the value attribute of the PromoCard if Checkbox or Radio */\n value?: string;\n\n /** Only applies to <a />s */\n download?: never;\n href?: never;\n anchorRef?: never;\n anchorId?: never;\n hrefLang?: never;\n rel?: never;\n target?: never;\n}\n\nexport type PromoCardProps = PromoCardLinkProps | PromoCardCheckedProps;\n\nexport type PolymorphicPromoCard = (\n props: PromoCardLinkProps | PromoCardCheckedProps,\n) => React.JSX.Element;\n\n/**\n * PromoCard component.\n *\n * PromoCard is a marketing style component that is used to group marketing\n * product related information (such as choosing Card types). It can be used to\n * display information in a structured way, and can be customized with various\n * props to suit different use cases.\n *\n * @component\n * @param {string} className - Additional class name for the PromoCard.\n * @param {string} description - Description text for the PromoCard.\n * @param {boolean} defaultChecked - Initial checked state for checkboxes and radios.\n * @param {string} download - Download file name for links.\n * @param {string} href - URL for links.\n * @param {string} hrefLang - Language code for linked URL.\n * @param {string} id - ID of the PromoCard.\n * @param {string} imageAlt - Alt text for the image.\n * @param {string} imageSource - Source URL of the image.\n * @param {string} indicatorLabel - Label for the indicator icon.\n * @param {boolean} isChecked - Checked state for checkboxes and radios.\n * @param {boolean} isDisabled - Whether the PromoCard is disabled.\n * @param {Function} onClick - Click event handler for the PromoCard.\n * @param {string} rel - Relationship between the URL and the current page.\n * @param {number} tabIndex - Tab index for keyboard navigation.\n * @param {string} target - Target window for links.\n * @param {string} testId - ID used for testing.\n * @param {string} title - Title text of the PromoCard.\n * @param {('checkbox'|'radio')} type - Type of the PromoCard (checkbox, radio).\n * @param {string} value - Value for checkboxes and radios.\n * @returns {React.JSX.Element} The rendered PromoCard component.\n * @example\n * <PromoCard\n * title=\"Example PromoCard\"\n * description=\"This is an example PromoCard with a link variation.\"\n * href=\"https://example.com\"\n * target=\"_blank\"\n * imageSource=\"https://example.com/image.png\"\n * imageAlt=\"Example Image\"\n * indicatorLabel=\"Learn More\"\n * />\n */\nconst PromoCard: FunctionComponent<PromoCardProps> = forwardRef(\n (\n {\n className,\n description,\n defaultChecked,\n download,\n href,\n hrefLang,\n id,\n headingLevel = 'h3',\n imageAlt,\n imageClass,\n imageSource,\n indicatorLabel,\n indicatorIcon,\n isChecked,\n isDisabled,\n onClick,\n onKeyDown,\n rel,\n tabIndex,\n target,\n testId,\n title,\n type,\n value,\n isSmall,\n useDisplayFont = true,\n anchorRef,\n anchorId,\n ...props\n },\n ref: ReferenceType,\n ) => {\n // Set the `checked` state to the value of `defaultChecked` if it is truthy,\n // or the value of `isChecked` if it is truthy, or `false` if neither\n // is truthy.\n const { state, onChange, isDisabled: contextIsDisabled } = usePromoCardContext();\n const [checked, setChecked] = useState(\n type === 'checkbox' ? (defaultChecked ?? isChecked ?? false) : false,\n );\n\n const handleClick = () => {\n if (type === 'radio') {\n onChange(value || ''); // Update the context state for radio\n } else if (type === 'checkbox') {\n setChecked(!checked); // Update local state for checkbox\n }\n };\n\n const fallbackId = useId();\n const componentId = id || fallbackId;\n\n // Set the icon to `'arrow'` if `href` is truthy and `type` is falsy, or\n // `'download'` if `download` is truthy. If neither condition is true, set\n // `icon` to `undefined`.\n\n // Create a function to get icon type\n const getIconType = () => {\n if (indicatorIcon) {\n return indicatorIcon;\n }\n\n if (download) {\n return 'download';\n }\n\n if (href && !type) {\n return 'arrow';\n }\n\n return undefined;\n };\n\n const CardTitle = useDisplayFont ? Display : Title;\n\n // Define all class names string based on the values of the `href`, `type`,\n // `checked`, and `className` props.\n const commonClasses = clsx(\n {\n 'np-Card--promoCard': true,\n 'np-Card--checked': !href && type,\n 'np-Card--link': href && !type,\n 'is-checked':\n type === 'radio' ? value === state : type === 'checkbox' ? checked : undefined,\n },\n className,\n );\n\n // Object with common props that will be passed to the `Card` components\n const commonProps = {\n className: commonClasses,\n id: componentId,\n isDisabled: isDisabled || contextIsDisabled,\n onClick,\n onKeyDown,\n ref,\n 'data-testid': testId,\n isSmall,\n };\n\n // Object with Anchor props that will be passed to the `a` element. These\n // won't be refurned if set to `isDisabled`\n const anchorProps =\n href && !isDisabled\n ? {\n download,\n href: href || undefined,\n hrefLang,\n rel,\n target,\n ref: anchorRef,\n id: anchorId,\n }\n : {};\n\n // Object of all Checked props that will be passed to the root `Card` component\n const checkedProps =\n (type === 'checkbox' || type === 'radio') && !href\n ? {\n ...commonProps,\n 'aria-checked':\n type === 'radio' ? value === state : type === 'checkbox' ? checked : undefined,\n 'aria-describedby': `${componentId}-title`,\n 'aria-disabled': isDisabled,\n 'data-value': value ?? undefined,\n role: type === 'checkbox' || type === 'radio' ? type : undefined,\n onClick: handleClick,\n onKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter' || event.key === ' ') {\n handleClick();\n }\n },\n ref,\n tabIndex: 0,\n }\n : {};\n\n const getTitle = () => {\n const titleContent =\n href && !type ? (\n <a className=\"np-Card-titleLink\" {...anchorProps}>\n {title}\n </a>\n ) : (\n title\n );\n\n const titleProps = {\n id: `${componentId}-title`,\n as: headingLevel,\n className: 'np-Card-title',\n };\n\n return useDisplayFont ? (\n <Display type={Typography.DISPLAY_SMALL} {...titleProps}>\n {titleContent}\n </Display>\n ) : (\n <Title type={Typography.TITLE_SUBSECTION} {...titleProps}>\n {titleContent}\n </Title>\n );\n };\n\n useEffect(() => {\n setChecked(defaultChecked ?? isChecked ?? false);\n }, [defaultChecked, isChecked]);\n\n return (\n <Card {...commonProps} {...checkedProps} {...props}>\n {(value === state || checked) && (\n <span className=\"np-Card-check\">\n <Check size={24} aria-hidden=\"true\" />\n </span>\n )}\n\n {getTitle()}\n\n <Body className=\"np-Card-description\">{description}</Body>\n\n {imageSource && (\n <div className={clsx('np-Card-image', { imageClass })}>\n <Image src={imageSource} alt={imageAlt || ''} loading=\"lazy\" />\n </div>\n )}\n\n <PromoCardIndicator label={indicatorLabel} icon={getIconType()} isSmall={isSmall} />\n </Card>\n );\n },\n) as PolymorphicPromoCard;\n\nexport default React.memo(PromoCard);\n"],"names":["PromoCard","forwardRef","className","description","defaultChecked","download","href","hrefLang","id","headingLevel","imageAlt","imageClass","imageSource","indicatorLabel","indicatorIcon","isChecked","isDisabled","onClick","onKeyDown","rel","tabIndex","target","testId","title","type","value","isSmall","useDisplayFont","anchorRef","anchorId","props","ref","state","onChange","contextIsDisabled","usePromoCardContext","checked","setChecked","useState","handleClick","fallbackId","useId","componentId","getIconType","undefined","commonClasses","clsx","commonProps","anchorProps","checkedProps","role","event","key","getTitle","titleContent","_jsx","children","titleProps","as","Display","Typography","DISPLAY_SMALL","Title","TITLE_SUBSECTION","useEffect","_jsxs","Card","Check","size","Body","Image","src","alt","loading","PromoCardIndicator","label","icon","React","memo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuMA,MAAMA,SAAS,gBAAsCC,UAAU,CAC7D,CACE;EACEC,SAAS;EACTC,WAAW;EACXC,cAAc;EACdC,QAAQ;EACRC,IAAI;EACJC,QAAQ;EACRC,EAAE;AACFC,EAAAA,YAAY,GAAG,IAAI;EACnBC,QAAQ;EACRC,UAAU;EACVC,WAAW;EACXC,cAAc;EACdC,aAAa;EACbC,SAAS;EACTC,UAAU;EACVC,OAAO;EACPC,SAAS;EACTC,GAAG;EACHC,QAAQ;EACRC,MAAM;EACNC,MAAM;EACNC,KAAK;EACLC,IAAI;EACJC,KAAK;EACLC,OAAO;AACPC,EAAAA,cAAc,GAAG,IAAI;EACrBC,SAAS;EACTC,QAAQ;EACR,GAAGC;AAAK,CACT,EACDC,GAAkB,KAChB;AACF;AACA;AACA;EACA,MAAM;IAAEC,KAAK;IAAEC,QAAQ;AAAEjB,IAAAA,UAAU,EAAEkB;GAAmB,GAAGC,mBAAmB,EAAE;AAChF,EAAA,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGC,QAAQ,CACpCd,IAAI,KAAK,UAAU,GAAIpB,cAAc,IAAIW,SAAS,IAAI,KAAK,GAAI,KAAK,CACrE;EAED,MAAMwB,WAAW,GAAGA,MAAK;IACvB,IAAIf,IAAI,KAAK,OAAO,EAAE;AACpBS,MAAAA,QAAQ,CAACR,KAAK,IAAI,EAAE,CAAC,CAAC;A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;QAAC4D,GAAG,EAAE9D,QAAQ,IAAI,EAAG;AAAC+D,QAAAA,OAAO,EAAC;OAAM;AAC9D,KAAK,CACN,eAEDlB,GAAA,CAACmB,kBAAkB,EAAA;AAACC,MAAAA,KAAK,EAAE9D,cAAe;MAAC+D,IAAI,EAAEjC,WAAW,EAAG;AAACjB,MAAAA,OAAO,EAAEA;AAAQ,KAAA,CACnF;AAAA,GAAM,CAAC;AAEX,CAAC,CACsB;AAEzB,kBAAA,aAAemD,cAAK,CAACC,IAAI,CAAC9E,SAAS,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PromoCardContext.js","sources":["../../src/promoCard/PromoCardContext.tsx"],"sourcesContent":["import React, { useContext, createContext } from 'react';\n\n/**\n * The type of the PromoCard context object.\n *\n * The context object contains the current state of the PromoCard group, whether\n * the group is disabled or not, and a function to call when the group value\n * changes. This value is used to provide context to child PromoCard components,\n * allowing them to interact with the group and update its state.\n */\ninterface PromoCardContextType {\n /**\n * The current value of the PromoCard group.\n *\n * @default ''\n */\n state: string;\n /**\n * Whether the PromoCard group is disabled or not.\n *\n * @default false\n */\n isDisabled: boolean;\n /**\n * A function to call when the PromoCard group value changes.\n *\n * @param {string} value - The new value of the PromoCard group.\n * @default () => {}\n */\n onChange: (value: string) => void;\n}\n\nconst defaultPromoCardContext: PromoCardContextType = {\n state: '',\n isDisabled: false,\n onChange: () => {},\n};\n\n/**\n * The PromoCard context object.\n */\nexport const PromoCardContext = createContext<PromoCardContextType>(defaultPromoCardContext);\n\n/**\n * A custom hook for accessing the PromoCard context object.\n *\n * The `usePromoCardContext` hook is used to access the PromoCard context object\n * from within a child PromoCard component. It throws an error if the context\n * object is not available, which can help with debugging and development.\n *\n * @returns {PromoCardContextType} - The PromoCard context object.\n */\nexport const usePromoCardContext = (): PromoCardContextType => {\n return useContext(PromoCardContext);\n};\n\nexport default PromoCardContext;\n"],"names":["defaultPromoCardContext","state","isDisabled","onChange","PromoCardContext","createContext","usePromoCardContext","useContext"],"mappings":";;;;;;AAgCA,MAAMA,uBAAuB,GAAyB;AACpDC,EAAAA,KAAK,EAAE,EAAE;AACTC,EAAAA,UAAU,EAAE,KAAK;EACjBC,QAAQ,EAAEA,MAAK;CAChB;AAED;;AAEG;MACUC,gBAAgB,gBAAGC,mBAAa,CAAuBL,uBAAuB;AAE3F;;;;;;;;AAQG;AACUM,MAAAA,mBAAmB,GAAGA,MAA2B;EAC5D,OAAOC,gBAAU,CAACH,gBAAgB,CAAC;AACrC;;;;;;"}
1
+ {"version":3,"file":"PromoCardContext.js","sources":["../../src/promoCard/PromoCardContext.tsx"],"sourcesContent":["import React, { useContext, createContext } from 'react';\n\n/**\n * The type of the PromoCard context object.\n *\n * The context object contains the current state of the PromoCard group, whether\n * the group is disabled or not, and a function to call when the group value\n * changes. This value is used to provide context to child PromoCard components,\n * allowing them to interact with the group and update its state.\n */\ninterface PromoCardContextType {\n /**\n * The current value of the PromoCard group.\n *\n * @default ''\n */\n state: string;\n /**\n * Whether the PromoCard group is disabled or not.\n *\n * @default false\n */\n isDisabled: boolean;\n /**\n * A function to call when the PromoCard group value changes.\n *\n * @param {string} value - The new value of the PromoCard group.\n * @default () => {}\n */\n onChange: (value: string) => void;\n}\n\nconst defaultPromoCardContext: PromoCardContextType = {\n state: '',\n isDisabled: false,\n onChange: () => {},\n};\n\n/**\n * The PromoCard context object.\n */\nexport const PromoCardContext = createContext<PromoCardContextType>(defaultPromoCardContext);\n\n/**\n * A custom hook for accessing the PromoCard context object.\n *\n * The `usePromoCardContext` hook is used to access the PromoCard context object\n * from within a child PromoCard component. It throws an error if the context\n * object is not available, which can help with debugging and development.\n *\n * @returns {PromoCardContextType} - The PromoCard context object.\n */\nexport const usePromoCardContext = (): PromoCardContextType => {\n return useContext(PromoCardContext);\n};\n\nexport default PromoCardContext;\n"],"names":["defaultPromoCardContext","state","isDisabled","onChange","PromoCardContext","createContext","usePromoCardContext","useContext"],"mappings":";;;;;;AAgCA,MAAMA,uBAAuB,GAAyB;AACpDC,EAAAA,KAAK,EAAE,EAAE;AACTC,EAAAA,UAAU,EAAE,KAAK;EACjBC,QAAQ,EAAEA,MAAK,CAAE;CAClB;AAED;;AAEG;MACUC,gBAAgB,gBAAGC,mBAAa,CAAuBL,uBAAuB;AAE3F;;;;;;;;AAQG;AACI,MAAMM,mBAAmB,GAAGA,MAA2B;EAC5D,OAAOC,gBAAU,CAACH,gBAAgB,CAAC;AACrC;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PromoCardContext.mjs","sources":["../../src/promoCard/PromoCardContext.tsx"],"sourcesContent":["import React, { useContext, createContext } from 'react';\n\n/**\n * The type of the PromoCard context object.\n *\n * The context object contains the current state of the PromoCard group, whether\n * the group is disabled or not, and a function to call when the group value\n * changes. This value is used to provide context to child PromoCard components,\n * allowing them to interact with the group and update its state.\n */\ninterface PromoCardContextType {\n /**\n * The current value of the PromoCard group.\n *\n * @default ''\n */\n state: string;\n /**\n * Whether the PromoCard group is disabled or not.\n *\n * @default false\n */\n isDisabled: boolean;\n /**\n * A function to call when the PromoCard group value changes.\n *\n * @param {string} value - The new value of the PromoCard group.\n * @default () => {}\n */\n onChange: (value: string) => void;\n}\n\nconst defaultPromoCardContext: PromoCardContextType = {\n state: '',\n isDisabled: false,\n onChange: () => {},\n};\n\n/**\n * The PromoCard context object.\n */\nexport const PromoCardContext = createContext<PromoCardContextType>(defaultPromoCardContext);\n\n/**\n * A custom hook for accessing the PromoCard context object.\n *\n * The `usePromoCardContext` hook is used to access the PromoCard context object\n * from within a child PromoCard component. It throws an error if the context\n * object is not available, which can help with debugging and development.\n *\n * @returns {PromoCardContextType} - The PromoCard context object.\n */\nexport const usePromoCardContext = (): PromoCardContextType => {\n return useContext(PromoCardContext);\n};\n\nexport default PromoCardContext;\n"],"names":["defaultPromoCardContext","state","isDisabled","onChange","PromoCardContext","createContext","usePromoCardContext","useContext"],"mappings":";;AAgCA,MAAMA,uBAAuB,GAAyB;AACpDC,EAAAA,KAAK,EAAE,EAAE;AACTC,EAAAA,UAAU,EAAE,KAAK;EACjBC,QAAQ,EAAEA,MAAK;CAChB;AAED;;AAEG;MACUC,gBAAgB,gBAAGC,aAAa,CAAuBL,uBAAuB;AAE3F;;;;;;;;AAQG;AACUM,MAAAA,mBAAmB,GAAGA,MAA2B;EAC5D,OAAOC,UAAU,CAACH,gBAAgB,CAAC;AACrC;;;;"}
1
+ {"version":3,"file":"PromoCardContext.mjs","sources":["../../src/promoCard/PromoCardContext.tsx"],"sourcesContent":["import React, { useContext, createContext } from 'react';\n\n/**\n * The type of the PromoCard context object.\n *\n * The context object contains the current state of the PromoCard group, whether\n * the group is disabled or not, and a function to call when the group value\n * changes. This value is used to provide context to child PromoCard components,\n * allowing them to interact with the group and update its state.\n */\ninterface PromoCardContextType {\n /**\n * The current value of the PromoCard group.\n *\n * @default ''\n */\n state: string;\n /**\n * Whether the PromoCard group is disabled or not.\n *\n * @default false\n */\n isDisabled: boolean;\n /**\n * A function to call when the PromoCard group value changes.\n *\n * @param {string} value - The new value of the PromoCard group.\n * @default () => {}\n */\n onChange: (value: string) => void;\n}\n\nconst defaultPromoCardContext: PromoCardContextType = {\n state: '',\n isDisabled: false,\n onChange: () => {},\n};\n\n/**\n * The PromoCard context object.\n */\nexport const PromoCardContext = createContext<PromoCardContextType>(defaultPromoCardContext);\n\n/**\n * A custom hook for accessing the PromoCard context object.\n *\n * The `usePromoCardContext` hook is used to access the PromoCard context object\n * from within a child PromoCard component. It throws an error if the context\n * object is not available, which can help with debugging and development.\n *\n * @returns {PromoCardContextType} - The PromoCard context object.\n */\nexport const usePromoCardContext = (): PromoCardContextType => {\n return useContext(PromoCardContext);\n};\n\nexport default PromoCardContext;\n"],"names":["defaultPromoCardContext","state","isDisabled","onChange","PromoCardContext","createContext","usePromoCardContext","useContext"],"mappings":";;AAgCA,MAAMA,uBAAuB,GAAyB;AACpDC,EAAAA,KAAK,EAAE,EAAE;AACTC,EAAAA,UAAU,EAAE,KAAK;EACjBC,QAAQ,EAAEA,MAAK,CAAE;CAClB;AAED;;AAEG;MACUC,gBAAgB,gBAAGC,aAAa,CAAuBL,uBAAuB;AAE3F;;;;;;;;AAQG;AACI,MAAMM,mBAAmB,GAAGA,MAA2B;EAC5D,OAAOC,UAAU,CAACH,gBAAgB,CAAC;AACrC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PromoCardGroup.js","sources":["../../src/promoCard/PromoCardGroup.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React, { FunctionComponent, ReactNode, useState, useEffect, useMemo } from 'react';\n\nimport { PromoCardProps } from './PromoCard';\nimport PromoCardContext from './PromoCardContext';\n\nexport type AriaRoleRadioGroup = 'radiogroup';\n\nexport interface PromoCardGroupProps {\n /**\n * Optional class name(s) to add to the group container.\n */\n className?: string;\n /**\n * The PromoCard components to display inside the group.\n */\n children: ReactNode;\n /**\n * The default checked for the group.\n */\n defaultChecked?: string;\n /**\n * Optional ID to add to the group container.\n */\n id?: string;\n /**\n * Whether the group is disabled or not.\n */\n isDisabled?: boolean;\n /**\n * Optional label to display above the group.\n */\n label?: string;\n /**\n * Optional function to call when the group value changes.\n */\n onChange?: (value: string) => void;\n /**\n * Optional ID to add to the group container for testing purposes.\n */\n testId?: string;\n}\n\n/**\n * PromoCardGroup component.\n *\n * A PromoCardGroup is a container for PromoCard components that allows the user to select one or more\n * cards from a group. It can be used to display a set of related options, and can be customized with\n * various props to suit different use cases.\n *\n * @param {ReactNode} children - The PromoCard components to display inside the group.\n * @param {string} className - Optional class name(s) to add to the group container.\n * @param {string} defaultChecked - The default value for the group.\n * @param {string} id - Optional ID to add to the group container.\n * @param {boolean} isDisabled=false - Whether the group is disabled or not.\n * @param {string} label - Optional label to display above the group.\n * @param {Function} onChange - Optional function to call when the group value changes.\n * @param {string} testId - Optional ID to add to the group container for testing purposes.\n * @returns {React.JSX.Element} - The PromoCardGroup component.\n */\nconst PromoCardGroup: FunctionComponent<PromoCardGroupProps> = ({\n children,\n className,\n defaultChecked = '',\n id,\n isDisabled = false,\n onChange = () => {},\n testId,\n}) => {\n const [state, setState] = useState<string>(defaultChecked);\n const [containerRole, setContainerRole] = useState<string | null>(null);\n\n /**\n * The context value for the PromoCardGroup.\n *\n * The context value is an object that contains the current state of the\n * group, whether the group is disabled or not, and a function to call when\n * the group value changes. This value is used to provide context to child\n * PromoCard components, allowing them to interact with the group and update\n * its state.\n */\n const contextValue = useMemo(() => {\n const handleOnChange = (value: string) => {\n setState(value);\n onChange(value);\n };\n\n return { state, isDisabled, onChange: handleOnChange };\n }, [state, isDisabled, onChange]);\n\n const commonClasses = clsx(\n {\n 'np-CardGroup': true,\n 'is-disabled': isDisabled,\n },\n className,\n );\n\n const commonProps = {\n className: commonClasses,\n id,\n 'data-testid': testId,\n role: containerRole as AriaRoleRadioGroup | undefined, // Add the role attribute here\n };\n\n useEffect(() => {\n setState(defaultChecked);\n\n // Collect an array of types from the children PromoCard components\n const types =\n React.Children.map(children, (child) => {\n if (React.isValidElement<PromoCardProps>(child) && child.props.type) {\n return child.props.type;\n }\n return null;\n })?.filter((type): type is 'radio' | 'checkbox' => type !== null && type !== undefined) ?? [];\n\n // Check if all types are the same\n const allTypesAreTheSame = types.every((type) => type === types[0]);\n\n // If all types are the same and the type is 'radio', set the container role\n setContainerRole(allTypesAreTheSame && types[0] === 'radio' ? 'radiogroup' : null);\n }, [defaultChecked, children]);\n\n return (\n <PromoCardContext.Provider value={contextValue}>\n <div {...commonProps}>{children}</div>\n </PromoCardContext.Provider>\n );\n};\n\nexport default React.memo(PromoCardGroup);\n"],"names":["PromoCardGroup","children","className","defaultChecked","id","isDisabled","onChange","testId","state","setState","useState","containerRole","setContainerRole","contextValue","useMemo","handleOnChange","value","commonClasses","clsx","commonProps","role","useEffect","types","React","Children","map","child","isValidElement","props","type","filter","undefined","allTypesAreTheSame","every","_jsx","PromoCardContext","Provider","memo"],"mappings":";;;;;;;;;;;;;AA4DA,MAAMA,cAAc,GAA2CA,CAAC;EAC9DC,QAAQ;EACR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AACb,KAAC,CAAC,EAAEC,MAAM,CAAED,IAAI,IAAmCA,IAAI,KAAK,IAAI,IAAIA,IAAI,KAAKE,SAAS,CAAC,IAAI,EAAE;AAE/F;AACA,IAAA,MAAMC,kBAAkB,GAAGV,KAAK,CAACW,KAAK,CAAEJ,IAAI,IAAKA,IAAI,KAAKP,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnE;AACAV,IAAAA,gBAAgB,CAACoB,kBAAkB,IAAIV,KAAK,CAAC,CAAC,CAAC,KAAK,OAAO,GAAG,YAAY,GAAG,IAAI,CAAC;AACpF,GAAC,EAAE,CAACnB,cAAc,EAAEF,QAAQ,CAAC,CAAC;AAE9B,EAAA,oBACEiC,cAAA,CAACC,iCAAgB,CAACC,QAAQ,EAAA;AAACpB,IAAAA,KAAK,EAAEH,YAAa;AAAAZ,IAAAA,QAAA,eAC7CiC,cAAA,CAAA,KAAA,EAAA;AAAA,MAAA,GAASf,WAAW;AAAAlB,MAAAA,QAAA,EAAGA;KAAc;AACvC,GAA2B,CAAC;AAEhC,CAAC;AAED,uBAAA,aAAesB,sBAAK,CAACc,IAAI,CAACrC,cAAc,CAAC;;;;"}
1
+ {"version":3,"file":"PromoCardGroup.js","sources":["../../src/promoCard/PromoCardGroup.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React, { FunctionComponent, ReactNode, useState, useEffect, useMemo } from 'react';\n\nimport { PromoCardProps } from './PromoCard';\nimport PromoCardContext from './PromoCardContext';\n\nexport type AriaRoleRadioGroup = 'radiogroup';\n\nexport interface PromoCardGroupProps {\n /**\n * Optional class name(s) to add to the group container.\n */\n className?: string;\n /**\n * The PromoCard components to display inside the group.\n */\n children: ReactNode;\n /**\n * The default checked for the group.\n */\n defaultChecked?: string;\n /**\n * Optional ID to add to the group container.\n */\n id?: string;\n /**\n * Whether the group is disabled or not.\n */\n isDisabled?: boolean;\n /**\n * Optional label to display above the group.\n */\n label?: string;\n /**\n * Optional function to call when the group value changes.\n */\n onChange?: (value: string) => void;\n /**\n * Optional ID to add to the group container for testing purposes.\n */\n testId?: string;\n}\n\n/**\n * PromoCardGroup component.\n *\n * A PromoCardGroup is a container for PromoCard components that allows the user to select one or more\n * cards from a group. It can be used to display a set of related options, and can be customized with\n * various props to suit different use cases.\n *\n * @param {ReactNode} children - The PromoCard components to display inside the group.\n * @param {string} className - Optional class name(s) to add to the group container.\n * @param {string} defaultChecked - The default value for the group.\n * @param {string} id - Optional ID to add to the group container.\n * @param {boolean} isDisabled=false - Whether the group is disabled or not.\n * @param {string} label - Optional label to display above the group.\n * @param {Function} onChange - Optional function to call when the group value changes.\n * @param {string} testId - Optional ID to add to the group container for testing purposes.\n * @returns {React.JSX.Element} - The PromoCardGroup component.\n */\nconst PromoCardGroup: FunctionComponent<PromoCardGroupProps> = ({\n children,\n className,\n defaultChecked = '',\n id,\n isDisabled = false,\n onChange = () => {},\n testId,\n}) => {\n const [state, setState] = useState<string>(defaultChecked);\n const [containerRole, setContainerRole] = useState<string | null>(null);\n\n /**\n * The context value for the PromoCardGroup.\n *\n * The context value is an object that contains the current state of the\n * group, whether the group is disabled or not, and a function to call when\n * the group value changes. This value is used to provide context to child\n * PromoCard components, allowing them to interact with the group and update\n * its state.\n */\n const contextValue = useMemo(() => {\n const handleOnChange = (value: string) => {\n setState(value);\n onChange(value);\n };\n\n return { state, isDisabled, onChange: handleOnChange };\n }, [state, isDisabled, onChange]);\n\n const commonClasses = clsx(\n {\n 'np-CardGroup': true,\n 'is-disabled': isDisabled,\n },\n className,\n );\n\n const commonProps = {\n className: commonClasses,\n id,\n 'data-testid': testId,\n role: containerRole as AriaRoleRadioGroup | undefined, // Add the role attribute here\n };\n\n useEffect(() => {\n setState(defaultChecked);\n\n // Collect an array of types from the children PromoCard components\n const types =\n React.Children.map(children, (child) => {\n if (React.isValidElement<PromoCardProps>(child) && child.props.type) {\n return child.props.type;\n }\n return null;\n })?.filter((type): type is 'radio' | 'checkbox' => type !== null && type !== undefined) ?? [];\n\n // Check if all types are the same\n const allTypesAreTheSame = types.every((type) => type === types[0]);\n\n // If all types are the same and the type is 'radio', set the container role\n setContainerRole(allTypesAreTheSame && types[0] === 'radio' ? 'radiogroup' : null);\n }, [defaultChecked, children]);\n\n return (\n <PromoCardContext.Provider value={contextValue}>\n <div {...commonProps}>{children}</div>\n </PromoCardContext.Provider>\n );\n};\n\nexport default React.memo(PromoCardGroup);\n"],"names":["PromoCardGroup","children","className","defaultChecked","id","isDisabled","onChange","testId","state","setState","useState","containerRole","setContainerRole","contextValue","useMemo","handleOnChange","value","commonClasses","clsx","commonProps","role","useEffect","types","React","Children","map","child","isValidElement","props","type","filter","undefined","allTypesAreTheSame","every","_jsx","PromoCardContext","Provider","memo"],"mappings":";;;;;;;;;;;;;AA4DA,MAAMA,cAAc,GAA2CA,CAAC;EAC9DC,QAAQ;EACRC,SAAS;AACTC,EAAAA,cAAc,GAAG,EAAE;EACnBC,EAAE;AACFC,EAAAA,UAAU,GAAG,KAAK;AAClBC,EAAAA,QAAQ,GAAGA,MAAK,CAAE,CAAC;AACnBC,EAAAA;AAAM,CACP,KAAI;EACH,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGC,cAAQ,CAASP,cAAc,CAAC;EAC1D,MAAM,CAACQ,aAAa,EAAEC,gBAAgB,CAAC,GAAGF,cAAQ,CAAgB,IAAI,CAAC;AAEvE;;;;;;;;AAQG;AACH,EAAA,MAAMG,YAAY,GAAGC,aAAO,CAAC,MAAK;IAChC,MAAMC,cAAc,GAAIC,KAAa,IAAI;MACvCP,QAAQ,CAACO,KAAK,CAAC;MACfV,QAAQ,CAACU,KAAK,CAAC;IACjB,CAAC;IAED,OAAO;MAAER,KAAK;MAAEH,UAAU;AAAEC,MAAAA,QAAQ,EAAES;KAAgB;EACxD,CAAC,EAAE,CAACP,KAAK,EAAEH,UAAU,EAAEC,QAAQ,CAAC,CAAC;EAEjC,MAAMW,aAAa,GAAGC,SAAI,CACxB;AACE,IAAA,cAAc,EAAE,IAAI;AACpB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ACc,IAAI,CAACrC,cAAc,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PromoCardGroup.mjs","sources":["../../src/promoCard/PromoCardGroup.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React, { FunctionComponent, ReactNode, useState, useEffect, useMemo } from 'react';\n\nimport { PromoCardProps } from './PromoCard';\nimport PromoCardContext from './PromoCardContext';\n\nexport type AriaRoleRadioGroup = 'radiogroup';\n\nexport interface PromoCardGroupProps {\n /**\n * Optional class name(s) to add to the group container.\n */\n className?: string;\n /**\n * The PromoCard components to display inside the group.\n */\n children: ReactNode;\n /**\n * The default checked for the group.\n */\n defaultChecked?: string;\n /**\n * Optional ID to add to the group container.\n */\n id?: string;\n /**\n * Whether the group is disabled or not.\n */\n isDisabled?: boolean;\n /**\n * Optional label to display above the group.\n */\n label?: string;\n /**\n * Optional function to call when the group value changes.\n */\n onChange?: (value: string) => void;\n /**\n * Optional ID to add to the group container for testing purposes.\n */\n testId?: string;\n}\n\n/**\n * PromoCardGroup component.\n *\n * A PromoCardGroup is a container for PromoCard components that allows the user to select one or more\n * cards from a group. It can be used to display a set of related options, and can be customized with\n * various props to suit different use cases.\n *\n * @param {ReactNode} children - The PromoCard components to display inside the group.\n * @param {string} className - Optional class name(s) to add to the group container.\n * @param {string} defaultChecked - The default value for the group.\n * @param {string} id - Optional ID to add to the group container.\n * @param {boolean} isDisabled=false - Whether the group is disabled or not.\n * @param {string} label - Optional label to display above the group.\n * @param {Function} onChange - Optional function to call when the group value changes.\n * @param {string} testId - Optional ID to add to the group container for testing purposes.\n * @returns {React.JSX.Element} - The PromoCardGroup component.\n */\nconst PromoCardGroup: FunctionComponent<PromoCardGroupProps> = ({\n children,\n className,\n defaultChecked = '',\n id,\n isDisabled = false,\n onChange = () => {},\n testId,\n}) => {\n const [state, setState] = useState<string>(defaultChecked);\n const [containerRole, setContainerRole] = useState<string | null>(null);\n\n /**\n * The context value for the PromoCardGroup.\n *\n * The context value is an object that contains the current state of the\n * group, whether the group is disabled or not, and a function to call when\n * the group value changes. This value is used to provide context to child\n * PromoCard components, allowing them to interact with the group and update\n * its state.\n */\n const contextValue = useMemo(() => {\n const handleOnChange = (value: string) => {\n setState(value);\n onChange(value);\n };\n\n return { state, isDisabled, onChange: handleOnChange };\n }, [state, isDisabled, onChange]);\n\n const commonClasses = clsx(\n {\n 'np-CardGroup': true,\n 'is-disabled': isDisabled,\n },\n className,\n );\n\n const commonProps = {\n className: commonClasses,\n id,\n 'data-testid': testId,\n role: containerRole as AriaRoleRadioGroup | undefined, // Add the role attribute here\n };\n\n useEffect(() => {\n setState(defaultChecked);\n\n // Collect an array of types from the children PromoCard components\n const types =\n React.Children.map(children, (child) => {\n if (React.isValidElement<PromoCardProps>(child) && child.props.type) {\n return child.props.type;\n }\n return null;\n })?.filter((type): type is 'radio' | 'checkbox' => type !== null && type !== undefined) ?? [];\n\n // Check if all types are the same\n const allTypesAreTheSame = types.every((type) => type === types[0]);\n\n // If all types are the same and the type is 'radio', set the container role\n setContainerRole(allTypesAreTheSame && types[0] === 'radio' ? 'radiogroup' : null);\n }, [defaultChecked, children]);\n\n return (\n <PromoCardContext.Provider value={contextValue}>\n <div {...commonProps}>{children}</div>\n </PromoCardContext.Provider>\n );\n};\n\nexport default React.memo(PromoCardGroup);\n"],"names":["PromoCardGroup","children","className","defaultChecked","id","isDisabled","onChange","testId","state","setState","useState","containerRole","setContainerRole","contextValue","useMemo","handleOnChange","value","commonClasses","clsx","commonProps","role","useEffect","types","React","Children","map","child","isValidElement","props","type","filter","undefined","allTypesAreTheSame","every","_jsx","PromoCardContext","Provider","memo"],"mappings":";;;;;AA4DA,MAAMA,cAAc,GAA2CA,CAAC;EAC9DC,QAAQ;EACRC,SAAS;AACTC,EAAAA,cAAc,GAAG,EAAE;EACnBC,EAAE;AACFC,EAAAA,UAAU,GAAG,KAAK;AAClBC,EAAAA,QAAQ,GAAGA,MAAO,EAAC;AACnBC,EAAAA;AACD,CAAA,KAAI;EACH,MAA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AAK,CAAEJ,IAAI,IAAKA,IAAI,KAAKP,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnE;AACAV,IAAAA,gBAAgB,CAACoB,kBAAkB,IAAIV,KAAK,CAAC,CAAC,CAAC,KAAK,OAAO,GAAG,YAAY,GAAG,IAAI,CAAC;AACpF,GAAC,EAAE,CAACnB,cAAc,EAAEF,QAAQ,CAAC,CAAC;AAE9B,EAAA,oBACEiC,GAAA,CAACC,gBAAgB,CAACC,QAAQ,EAAA;AAACpB,IAAAA,KAAK,EAAEH,YAAa;AAAAZ,IAAAA,QAAA,eAC7CiC,GAAA,CAAA,KAAA,EAAA;AAAA,MAAA,GAASf,WAAW;AAAAlB,MAAAA,QAAA,EAAGA;KAAc;AACvC,GAA2B,CAAC;AAEhC,CAAC;AAED,uBAAA,aAAesB,cAAK,CAACc,IAAI,CAACrC,cAAc,CAAC;;;;"}
1
+ {"version":3,"file":"PromoCardGroup.mjs","sources":["../../src/promoCard/PromoCardGroup.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React, { FunctionComponent, ReactNode, useState, useEffect, useMemo } from 'react';\n\nimport { PromoCardProps } from './PromoCard';\nimport PromoCardContext from './PromoCardContext';\n\nexport type AriaRoleRadioGroup = 'radiogroup';\n\nexport interface PromoCardGroupProps {\n /**\n * Optional class name(s) to add to the group container.\n */\n className?: string;\n /**\n * The PromoCard components to display inside the group.\n */\n children: ReactNode;\n /**\n * The default checked for the group.\n */\n defaultChecked?: string;\n /**\n * Optional ID to add to the group container.\n */\n id?: string;\n /**\n * Whether the group is disabled or not.\n */\n isDisabled?: boolean;\n /**\n * Optional label to display above the group.\n */\n label?: string;\n /**\n * Optional function to call when the group value changes.\n */\n onChange?: (value: string) => void;\n /**\n * Optional ID to add to the group container for testing purposes.\n */\n testId?: string;\n}\n\n/**\n * PromoCardGroup component.\n *\n * A PromoCardGroup is a container for PromoCard components that allows the user to select one or more\n * cards from a group. It can be used to display a set of related options, and can be customized with\n * various props to suit different use cases.\n *\n * @param {ReactNode} children - The PromoCard components to display inside the group.\n * @param {string} className - Optional class name(s) to add to the group container.\n * @param {string} defaultChecked - The default value for the group.\n * @param {string} id - Optional ID to add to the group container.\n * @param {boolean} isDisabled=false - Whether the group is disabled or not.\n * @param {string} label - Optional label to display above the group.\n * @param {Function} onChange - Optional function to call when the group value changes.\n * @param {string} testId - Optional ID to add to the group container for testing purposes.\n * @returns {React.JSX.Element} - The PromoCardGroup component.\n */\nconst PromoCardGroup: FunctionComponent<PromoCardGroupProps> = ({\n children,\n className,\n defaultChecked = '',\n id,\n isDisabled = false,\n onChange = () => {},\n testId,\n}) => {\n const [state, setState] = useState<string>(defaultChecked);\n const [containerRole, setContainerRole] = useState<string | null>(null);\n\n /**\n * The context value for the PromoCardGroup.\n *\n * The context value is an object that contains the current state of the\n * group, whether the group is disabled or not, and a function to call when\n * the group value changes. This value is used to provide context to child\n * PromoCard components, allowing them to interact with the group and update\n * its state.\n */\n const contextValue = useMemo(() => {\n const handleOnChange = (value: string) => {\n setState(value);\n onChange(value);\n };\n\n return { state, isDisabled, onChange: handleOnChange };\n }, [state, isDisabled, onChange]);\n\n const commonClasses = clsx(\n {\n 'np-CardGroup': true,\n 'is-disabled': isDisabled,\n },\n className,\n );\n\n const commonProps = {\n className: commonClasses,\n id,\n 'data-testid': testId,\n role: containerRole as AriaRoleRadioGroup | undefined, // Add the role attribute here\n };\n\n useEffect(() => {\n setState(defaultChecked);\n\n // Collect an array of types from the children PromoCard components\n const types =\n React.Children.map(children, (child) => {\n if (React.isValidElement<PromoCardProps>(child) && child.props.type) {\n return child.props.type;\n }\n return null;\n })?.filter((type): type is 'radio' | 'checkbox' => type !== null && type !== undefined) ?? [];\n\n // Check if all types are the same\n const allTypesAreTheSame = types.every((type) => type === types[0]);\n\n // If all types are the same and the type is 'radio', set the container role\n setContainerRole(allTypesAreTheSame && types[0] === 'radio' ? 'radiogroup' : null);\n }, [defaultChecked, children]);\n\n return (\n <PromoCardContext.Provider value={contextValue}>\n <div {...commonProps}>{children}</div>\n </PromoCardContext.Provider>\n );\n};\n\nexport default React.memo(PromoCardGroup);\n"],"names":["PromoCardGroup","children","className","defaultChecked","id","isDisabled","onChange","testId","state","setState","useState","containerRole","setContainerRole","contextValue","useMemo","handleOnChange","value","commonClasses","clsx","commonProps","role","useEffect","types","React","Children","map","child","isValidElement","props","type","filter","undefined","allTypesAreTheSame","every","_jsx","PromoCardContext","Provider","memo"],"mappings":";;;;;AA4DA,MAAMA,cAAc,GAA2CA,CAAC;EAC9DC,QAAQ;EACRC,SAAS;AACTC,EAAAA,cAAc,GAAG,EAAE;EACnBC,EAAE;AACFC,EAAAA,UAAU,GAAG,KAAK;AAClBC,EAAAA,QAAQ,GAAGA,MAAK,CAAE,CAAC;AACnBC,EAAAA;AAAM,CACP,KAAI;EACH,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGC,QAAQ,CAASP,cAAc,CAAC;EAC1D,MAAM,CAACQ,aAAa,EAAEC,gBAAgB,CAAC,GAAGF,QAAQ,CAAgB,IAAI,CAAC;AAEvE;;;;;;;;AAQG;AACH,EAAA,MAAMG,YAAY,GAAGC,OAAO,CAAC,MAAK;IAChC,MAAMC,cAAc,GAAIC,KAAa,IAAI;MACvCP,QAAQ,CAACO,KAAK,CAAC;MACfV,QAAQ,CAACU,KAAK,CAAC;IACjB,CAAC;IAED,OAAO;MAAER,KAAK;MAAEH,UAAU;AAAEC,MAAAA,QAAQ,EAAES;KAAgB;EACxD,CAAC,EAAE,CAACP,KAAK,EAAEH,UAAU,EAAEC,QAAQ,CAAC,CAAC;EAEjC,MAAMW,aAAa,GAAGC,IAAI,CACxB;AACE,IAAA,cAAc,EAAE,IAAI;AACpB,IAAA,aAAa,EAAEb;GAChB,EACDH,SAAS,CACV;AAED,EAAA,MAAMiB,WAAW,GAAG;AAClBjB,IAAAA,SAAS,EAAEe,aAAa;IACxBb,EAAE;AACF,IAAA,aAAa,EAAEG,MAAM;IACrBa,IAAI,EAAET,aAA+C;GACtD;AAEDU,EAAAA,SAAS,CAAC,MAAK;IACbZ,QAAQ,CAACN,cAAc,CAAC;AAExB;IACA,MAAMmB,KAAK,GACTC,cAAK,CAACC,QAAQ,CAACC,GAAG,CAACxB,QAAQ,EAAGyB,KAAK,IAAI;AACrC,MAAA,iBAAIH,cAAK,CAACI,cAAc,CAAiBD,KAAK,CAAC,IAAIA,KAAK,CAACE,KAAK,CAACC,IAAI,EAAE;AACnE,QAAA,OAAOH,KAAK,CAACE,KAAK,CAACC,IAAI;AACzB,MAAA;AACA,MAAA,OAAO,IAAI;AACb,IAAA,CAAC,CAAC,EAAEC,MAAM,CAAED,IAAI,IAAmCA,IAAI,KAAK,IAAI,IAAIA,IAAI,KAAKE,SAAS,CAAC,IAAI,EAAE;AAE/F;AACA,IAAA,MAAMC,kBAAkB,GAAGV,KAAK,CAACW,KAAK,CAAEJ,IAAI,IAAKA,IAAI,KAAKP,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnE;AACAV,IAAAA,gBAAgB,CAACoB,kBAAkB,IAAIV,KAAK,CAAC,CAAC,CAAC,KAAK,OAAO,GAAG,YAAY,GAAG,IAAI,CAAC;AACpF,EAAA,CAAC,EAAE,CAACnB,cAAc,EAAEF,QAAQ,CAAC,CAAC;AAE9B,EAAA,oBACEiC,GAAA,CAACC,gBAAgB,CAACC,QAAQ,EAAA;AAACpB,IAAAA,KAAK,EAAEH,YAAa;AAAAZ,IAAAA,QAAA,eAC7CiC,GAAA,CAAA,KAAA,EAAA;AAAA,MAAA,GAASf,WAAW;AAAAlB,MAAAA,QAAA,EAAGA;KAAc;AACvC,GAA2B,CAAC;AAEhC,CAAC;AAED,uBAAA,aAAesB,cAAK,CAACc,IAAI,CAACrC,cAAc,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PromoCardIndicator.js","sources":["../../src/promoCard/PromoCardIndicator.tsx"],"sourcesContent":["import { ArrowRight, Check, Download } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { ReactElement, ReactNode } from 'react';\n\nimport Body from '../body';\nimport { Typography } from '../common';\nimport AvatarView from '../avatarView';\n\nexport type PromoCardIndicatorProps = {\n /** Optional class name(s) to add to the indicator container. */\n className?: string;\n\n /** Optional label to display next to the indicator. */\n label?: string;\n\n /** Optional icon to display in the indicator. */\n icon?: 'check' | 'arrow' | 'download' | ReactElement;\n\n /** Optional prop to specify whether the indicator is sized small or not. */\n isSmall?: boolean;\n\n /** Optional ID to add to the indicator container for testing purposes. */\n testid?: string;\n\n /** Optional children to display inside the indicator. */\n children?: ReactNode;\n};\n\n/**\n * PromoCardIndicator component.\n *\n * A PromoCardIndicator is a small component that can be used to display\n * additional information or actions related to a PromoCard. It can be\n * customized with various props to suit different use cases.\n *\n * @param {string} className - Optional class name(s) to add to the indicator container.\n * @param {string} label - Optional label to display next to the indicator.\n * @param {string | ReactElement} icon - Optional icon to display in the indicator.\n * @param {string} testid - Optional ID to add to the indicator container for testing purposes.\n * @param {ReactNode} children - Optional children to display inside the indicator.\n * @returns {React.JSX.Element} - The PromoCardIndicator component.\n * @example\n * <PromoCardIndicator label=\"Download\" icon=\"download\" />\n */\nconst PromoCardIndicator: React.FC<PromoCardIndicatorProps> = ({\n className,\n children,\n label,\n icon,\n isSmall = false,\n testid,\n ...rest\n}) => {\n const isIconString = icon && typeof icon === 'string';\n\n const IconComponent =\n isIconString &&\n {\n check: Check,\n arrow: ArrowRight,\n download: Download,\n }[icon];\n\n return (\n <div className={clsx('np-Card-indicator', className)} data-testid={testid} {...rest}>\n {label && (\n <Body as=\"span\" type={Typography.BODY_LARGE_BOLD} className=\"np-Card-indicatorText\">\n {label}\n </Body>\n )}\n {icon && (\n <AvatarView\n interactive\n size={isSmall ? 40 : 56}\n style={{ backgroundColor: 'var(--Card-indicator-icon-background-color)' }}\n className=\"np-Card-indicatorIcon\"\n >\n {IconComponent ? <IconComponent size={24} aria-hidden=\"true\" /> : icon}\n </AvatarView>\n )}\n {children}\n </div>\n );\n};\n\nexport default PromoCardIndicator;\n"],"names":["PromoCardIndicator","className","children","label","icon","isSmall","testid","rest","isIconString","IconComponent","check","Check","arrow","ArrowRight","download","Download","_jsxs","clsx","_jsx","Body","as","type","Typography","BODY_LARGE_BOLD","AvatarView","interactive","size","style","backgroundColor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CMA,MAAAA,kBAAkB,GAAsCA,CAAC;EAC7DC,SAAS;EACTC,QAAQ;EACRC,KAAK;EACLC,IAAI;AACJC,EAAAA,OAAO,GAAG,KAAK;EACfC,MAAM;EACN,GAAGC;AACJ,CAAA,KAAI;AACH,EAAA,MAAMC,YAAY,GAAGJ,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ;EAErD,MAAMK,aAAa,GACjBD,YAAY,IACZ;AACEE,IAAAA,KAAK,EAAEC,WAAK;AACZC,IAAAA,KAAK,EAAEC,gBAAU;AACjBC,IAAAA,QAAQ,EAAEC;GACX,CAACX,IAAI,CAAC;AAET,EAAA,oBACEY,eAAA,CAAA,KAAA,EAAA;AAAKf,IAAAA,SAAS,EAAEgB,SAAI,CAAC,mBAAmB,EAAEhB,SAAS,CAAE;AAAC,IAAA,aAAA,EAAaK,MAAO;AAAA,IAAA,GAAKC,IAAI;AAAAL,IAAAA,QAAA,EAChFC,CAAAA,KAAK,iBACJe,cAAA,CAACC,YAAI,EAAA;AAACC,MAAAA,EAAE,EAAC,MAAM;MAACC,IAAI,EAAEC,qBAAU,CAACC,eAAgB;AAACtB,MAAAA,SAAS,EAAC,uBAAuB;AAAAC,MAAAA,QAAA,EAChFC;AAAK,KACF,CACP,EACAC,IAAI,iBACHc,cAAA,CAACM,kBAAU,EAAA;MACTC,WAAW,EAAA,IAAA;AACXC,MAAAA,IAAI,EAAErB,OAAO,GAAG,EAAE,GAAG,EAAG;AACxBsB,MAAAA,KAAK,EAAE;AAAEC,QAAAA,eAAe,EAAE;OAAgD;AAC1E3B,MAAAA,SAAS,EAAC,uBAAuB;AAAAC,MAAAA,QAAA,EAEhCO,aAAa,gBAAGS,cAAA,CAACT,aAAa,EAAA;AAACiB,QAAAA,IAAI,EAAE,EAAG;QAAC,aAAY,EAAA;AAAM,QAAG,GAAGtB;KACxD,CACb,EACAF,QAAQ;AAAA,GACN,CAAC;AAEV;;;;"}
1
+ {"version":3,"file":"PromoCardIndicator.js","sources":["../../src/promoCard/PromoCardIndicator.tsx"],"sourcesContent":["import { ArrowRight, Check, Download } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { ReactElement, ReactNode } from 'react';\n\nimport Body from '../body';\nimport { Typography } from '../common';\nimport AvatarView from '../avatarView';\n\nexport type PromoCardIndicatorProps = {\n /** Optional class name(s) to add to the indicator container. */\n className?: string;\n\n /** Optional label to display next to the indicator. */\n label?: string;\n\n /** Optional icon to display in the indicator. */\n icon?: 'check' | 'arrow' | 'download' | ReactElement;\n\n /** Optional prop to specify whether the indicator is sized small or not. */\n isSmall?: boolean;\n\n /** Optional ID to add to the indicator container for testing purposes. */\n testid?: string;\n\n /** Optional children to display inside the indicator. */\n children?: ReactNode;\n};\n\n/**\n * PromoCardIndicator component.\n *\n * A PromoCardIndicator is a small component that can be used to display\n * additional information or actions related to a PromoCard. It can be\n * customized with various props to suit different use cases.\n *\n * @param {string} className - Optional class name(s) to add to the indicator container.\n * @param {string} label - Optional label to display next to the indicator.\n * @param {string | ReactElement} icon - Optional icon to display in the indicator.\n * @param {string} testid - Optional ID to add to the indicator container for testing purposes.\n * @param {ReactNode} children - Optional children to display inside the indicator.\n * @returns {React.JSX.Element} - The PromoCardIndicator component.\n * @example\n * <PromoCardIndicator label=\"Download\" icon=\"download\" />\n */\nconst PromoCardIndicator: React.FC<PromoCardIndicatorProps> = ({\n className,\n children,\n label,\n icon,\n isSmall = false,\n testid,\n ...rest\n}) => {\n const isIconString = icon && typeof icon === 'string';\n\n const IconComponent =\n isIconString &&\n {\n check: Check,\n arrow: ArrowRight,\n download: Download,\n }[icon];\n\n return (\n <div className={clsx('np-Card-indicator', className)} data-testid={testid} {...rest}>\n {label && (\n <Body as=\"span\" type={Typography.BODY_LARGE_BOLD} className=\"np-Card-indicatorText\">\n {label}\n </Body>\n )}\n {icon && (\n <AvatarView\n interactive\n size={isSmall ? 40 : 56}\n style={{ backgroundColor: 'var(--Card-indicator-icon-background-color)' }}\n className=\"np-Card-indicatorIcon\"\n >\n {IconComponent ? <IconComponent size={24} aria-hidden=\"true\" /> : icon}\n </AvatarView>\n )}\n {children}\n </div>\n );\n};\n\nexport default PromoCardIndicator;\n"],"names":["PromoCardIndicator","className","children","label","icon","isSmall","testid","rest","isIconString","IconComponent","check","Check","arrow","ArrowRight","download","Download","_jsxs","clsx","_jsx","Body","as","type","Typography","BODY_LARGE_BOLD","AvatarView","interactive","size","style","backgroundColor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAMA,kBAAkB,GAAsCA,CAAC;EAC7DC,SAAS;EACTC,QAAQ;EACRC,KAAK;EACLC,IAAI;AACJC,EAAAA,OAAO,GAAG,KAAK;EACfC,MAAM;EACN,GAAGC;AAAI,CACR,KAAI;AACH,EAAA,MAAMC,YAAY,GAAGJ,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ;EAErD,MAAMK,aAAa,GACjBD,YAAY,IACZ;AACEE,IAAAA,KAAK,EAAEC,WAAK;AACZC,IAAAA,KAAK,EAAEC,gBAAU;AACjBC,IAAAA,QAAQ,EAAEC;GACX,CAACX,IAAI,CAAC;AAET,EAAA,oBACEY,eAAA,CAAA,KAAA,EAAA;AAAKf,IAAAA,SAAS,EAAEgB,SAAI,CAAC,mBAAmB,EAAEhB,SAAS,CAAE;AAAC,IAAA,aAAA,EAAaK,MAAO;AAAA,IAAA,GAAKC,IAAI;AAAAL,IAAAA,QAAA,EAAA,CAChFC,KAAK,iBACJe,cAAA,CAACC,YAAI,EAAA;AAACC,MAAAA,EAAE,EAAC,MAAM;MAACC,IAAI,EAAEC,qBAAU,CAACC,eAAgB;AAACtB,MAAAA,SAAS,EAAC,uBAAuB;AAAAC,MAAAA,QAAA,EAChFC;AAAK,KACF,CACP,EACAC,IAAI,iBACHc,cAAA,CAACM,kBAAU,EAAA;MACTC,WAAW,EAAA,IAAA;AACXC,MAAAA,IAAI,EAAErB,OAAO,GAAG,EAAE,GAAG,EAAG;AACxBsB,MAAAA,KAAK,EAAE;AAAEC,QAAAA,eAAe,EAAE;OAAgD;AAC1E3B,MAAAA,SAAS,EAAC,uBAAuB;AAAAC,MAAAA,QAAA,EAEhCO,aAAa,gBAAGS,cAAA,CAACT,aAAa,EAAA;AAACiB,QAAAA,IAAI,EAAE,EAAG;QAAC,aAAA,EAAY;AAAM,QAAG,GAAGtB;KACxD,CACb,EACAF,QAAQ;AAAA,GACN,CAAC;AAEV;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PromoCardIndicator.mjs","sources":["../../src/promoCard/PromoCardIndicator.tsx"],"sourcesContent":["import { ArrowRight, Check, Download } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { ReactElement, ReactNode } from 'react';\n\nimport Body from '../body';\nimport { Typography } from '../common';\nimport AvatarView from '../avatarView';\n\nexport type PromoCardIndicatorProps = {\n /** Optional class name(s) to add to the indicator container. */\n className?: string;\n\n /** Optional label to display next to the indicator. */\n label?: string;\n\n /** Optional icon to display in the indicator. */\n icon?: 'check' | 'arrow' | 'download' | ReactElement;\n\n /** Optional prop to specify whether the indicator is sized small or not. */\n isSmall?: boolean;\n\n /** Optional ID to add to the indicator container for testing purposes. */\n testid?: string;\n\n /** Optional children to display inside the indicator. */\n children?: ReactNode;\n};\n\n/**\n * PromoCardIndicator component.\n *\n * A PromoCardIndicator is a small component that can be used to display\n * additional information or actions related to a PromoCard. It can be\n * customized with various props to suit different use cases.\n *\n * @param {string} className - Optional class name(s) to add to the indicator container.\n * @param {string} label - Optional label to display next to the indicator.\n * @param {string | ReactElement} icon - Optional icon to display in the indicator.\n * @param {string} testid - Optional ID to add to the indicator container for testing purposes.\n * @param {ReactNode} children - Optional children to display inside the indicator.\n * @returns {React.JSX.Element} - The PromoCardIndicator component.\n * @example\n * <PromoCardIndicator label=\"Download\" icon=\"download\" />\n */\nconst PromoCardIndicator: React.FC<PromoCardIndicatorProps> = ({\n className,\n children,\n label,\n icon,\n isSmall = false,\n testid,\n ...rest\n}) => {\n const isIconString = icon && typeof icon === 'string';\n\n const IconComponent =\n isIconString &&\n {\n check: Check,\n arrow: ArrowRight,\n download: Download,\n }[icon];\n\n return (\n <div className={clsx('np-Card-indicator', className)} data-testid={testid} {...rest}>\n {label && (\n <Body as=\"span\" type={Typography.BODY_LARGE_BOLD} className=\"np-Card-indicatorText\">\n {label}\n </Body>\n )}\n {icon && (\n <AvatarView\n interactive\n size={isSmall ? 40 : 56}\n style={{ backgroundColor: 'var(--Card-indicator-icon-background-color)' }}\n className=\"np-Card-indicatorIcon\"\n >\n {IconComponent ? <IconComponent size={24} aria-hidden=\"true\" /> : icon}\n </AvatarView>\n )}\n {children}\n </div>\n );\n};\n\nexport default PromoCardIndicator;\n"],"names":["PromoCardIndicator","className","children","label","icon","isSmall","testid","rest","isIconString","IconComponent","check","Check","arrow","ArrowRight","download","Download","_jsxs","clsx","_jsx","Body","as","type","Typography","BODY_LARGE_BOLD","AvatarView","interactive","size","style","backgroundColor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CMA,MAAAA,kBAAkB,GAAsCA,CAAC;EAC7DC,SAAS;EACTC,QAAQ;EACRC,KAAK;EACLC,IAAI;AACJC,EAAAA,OAAO,GAAG,KAAK;EACfC,MAAM;EACN,GAAGC;AACJ,CAAA,KAAI;AACH,EAAA,MAAMC,YAAY,GAAGJ,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ;EAErD,MAAMK,aAAa,GACjBD,YAAY,IACZ;AACEE,IAAAA,KAAK,EAAEC,KAAK;AACZC,IAAAA,KAAK,EAAEC,UAAU;AACjBC,IAAAA,QAAQ,EAAEC;GACX,CAACX,IAAI,CAAC;AAET,EAAA,oBACEY,IAAA,CAAA,KAAA,EAAA;AAAKf,IAAAA,SAAS,EAAEgB,IAAI,CAAC,mBAAmB,EAAEhB,SAAS,CAAE;AAAC,IAAA,aAAA,EAAaK,MAAO;AAAA,IAAA,GAAKC,IAAI;AAAAL,IAAAA,QAAA,EAChFC,CAAAA,KAAK,iBACJe,GAAA,CAACC,IAAI,EAAA;AAACC,MAAAA,EAAE,EAAC,MAAM;MAACC,IAAI,EAAEC,UAAU,CAACC,eAAgB;AAACtB,MAAAA,SAAS,EAAC,uBAAuB;AAAAC,MAAAA,QAAA,EAChFC;AAAK,KACF,CACP,EACAC,IAAI,iBACHc,GAAA,CAACM,UAAU,EAAA;MACTC,WAAW,EAAA,IAAA;AACXC,MAAAA,IAAI,EAAErB,OAAO,GAAG,EAAE,GAAG,EAAG;AACxBsB,MAAAA,KAAK,EAAE;AAAEC,QAAAA,eAAe,EAAE;OAAgD;AAC1E3B,MAAAA,SAAS,EAAC,uBAAuB;AAAAC,MAAAA,QAAA,EAEhCO,aAAa,gBAAGS,GAAA,CAACT,aAAa,EAAA;AAACiB,QAAAA,IAAI,EAAE,EAAG;QAAC,aAAY,EAAA;AAAM,QAAG,GAAGtB;KACxD,CACb,EACAF,QAAQ;AAAA,GACN,CAAC;AAEV;;;;"}
1
+ {"version":3,"file":"PromoCardIndicator.mjs","sources":["../../src/promoCard/PromoCardIndicator.tsx"],"sourcesContent":["import { ArrowRight, Check, Download } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { ReactElement, ReactNode } from 'react';\n\nimport Body from '../body';\nimport { Typography } from '../common';\nimport AvatarView from '../avatarView';\n\nexport type PromoCardIndicatorProps = {\n /** Optional class name(s) to add to the indicator container. */\n className?: string;\n\n /** Optional label to display next to the indicator. */\n label?: string;\n\n /** Optional icon to display in the indicator. */\n icon?: 'check' | 'arrow' | 'download' | ReactElement;\n\n /** Optional prop to specify whether the indicator is sized small or not. */\n isSmall?: boolean;\n\n /** Optional ID to add to the indicator container for testing purposes. */\n testid?: string;\n\n /** Optional children to display inside the indicator. */\n children?: ReactNode;\n};\n\n/**\n * PromoCardIndicator component.\n *\n * A PromoCardIndicator is a small component that can be used to display\n * additional information or actions related to a PromoCard. It can be\n * customized with various props to suit different use cases.\n *\n * @param {string} className - Optional class name(s) to add to the indicator container.\n * @param {string} label - Optional label to display next to the indicator.\n * @param {string | ReactElement} icon - Optional icon to display in the indicator.\n * @param {string} testid - Optional ID to add to the indicator container for testing purposes.\n * @param {ReactNode} children - Optional children to display inside the indicator.\n * @returns {React.JSX.Element} - The PromoCardIndicator component.\n * @example\n * <PromoCardIndicator label=\"Download\" icon=\"download\" />\n */\nconst PromoCardIndicator: React.FC<PromoCardIndicatorProps> = ({\n className,\n children,\n label,\n icon,\n isSmall = false,\n testid,\n ...rest\n}) => {\n const isIconString = icon && typeof icon === 'string';\n\n const IconComponent =\n isIconString &&\n {\n check: Check,\n arrow: ArrowRight,\n download: Download,\n }[icon];\n\n return (\n <div className={clsx('np-Card-indicator', className)} data-testid={testid} {...rest}>\n {label && (\n <Body as=\"span\" type={Typography.BODY_LARGE_BOLD} className=\"np-Card-indicatorText\">\n {label}\n </Body>\n )}\n {icon && (\n <AvatarView\n interactive\n size={isSmall ? 40 : 56}\n style={{ backgroundColor: 'var(--Card-indicator-icon-background-color)' }}\n className=\"np-Card-indicatorIcon\"\n >\n {IconComponent ? <IconComponent size={24} aria-hidden=\"true\" /> : icon}\n </AvatarView>\n )}\n {children}\n </div>\n );\n};\n\nexport default PromoCardIndicator;\n"],"names":["PromoCardIndicator","className","children","label","icon","isSmall","testid","rest","isIconString","IconComponent","check","Check","arrow","ArrowRight","download","Download","_jsxs","clsx","_jsx","Body","as","type","Typography","BODY_LARGE_BOLD","AvatarView","interactive","size","style","backgroundColor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAMA,kBAAkB,GAAsCA,CAAC;EAC7DC,SAAS;EACTC,QAAQ;EACRC,KAAK;EACLC,IAAI;AACJC,EAAAA,OAAO,GAAG,KAAK;EACfC,MAAM;EACN,GAAGC;AAAI,CACR,KAAI;AACH,EAAA,MAAMC,YAAY,GAAGJ,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ;EAErD,MAAMK,aAAa,GACjBD,YAAY,IACZ;AACEE,IAAAA,KAAK,EAAEC,KAAK;AACZC,IAAAA,KAAK,EAAEC,UAAU;AACjBC,IAAAA,QAAQ,EAAEC;GACX,CAACX,IAAI,CAAC;AAET,EAAA,oBACEY,IAAA,CAAA,KAAA,EAAA;AAAKf,IAAAA,SAAS,EAAEgB,IAAI,CAAC,mBAAmB,EAAEhB,SAAS,CAAE;AAAC,IAAA,aAAA,EAAaK,MAAO;AAAA,IAAA,GAAKC,IAAI;AAAAL,IAAAA,QAAA,EAAA,CAChFC,KAAK,iBACJe,GAAA,CAACC,IAAI,EAAA;AAACC,MAAAA,EAAE,EAAC,MAAM;MAACC,IAAI,EAAEC,UAAU,CAACC,eAAgB;AAACtB,MAAAA,SAAS,EAAC,uBAAuB;AAAAC,MAAAA,QAAA,EAChFC;AAAK,KACF,CACP,EACAC,IAAI,iBACHc,GAAA,CAACM,UAAU,EAAA;MACTC,WAAW,EAAA,IAAA;AACXC,MAAAA,IAAI,EAAErB,OAAO,GAAG,EAAE,GAAG,EAAG;AACxBsB,MAAAA,KAAK,EAAE;AAAEC,QAAAA,eAAe,EAAE;OAAgD;AAC1E3B,MAAAA,SAAS,EAAC,uBAAuB;AAAAC,MAAAA,QAAA,EAEhCO,aAAa,gBAAGS,GAAA,CAACT,aAAa,EAAA;AAACiB,QAAAA,IAAI,EAAE,EAAG;QAAC,aAAA,EAAY;AAAM,QAAG,GAAGtB;KACxD,CACb,EACAF,QAAQ;AAAA,GACN,CAAC;AAEV;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Provider.js","sources":["../../src/provider/Provider.tsx"],"sourcesContent":["import { IntlProvider, ResolvedIntlConfig } from 'react-intl';\n\nimport { adjustLocale, DEFAULT_LOCALE, getDirectionFromLocale } from '../common';\nimport en from '../i18n/en.json';\n\nimport { DirectionProvider } from './direction';\nimport { LanguageProvider } from './language';\n\nexport interface ProviderProps {\n i18n: Pick<ResolvedIntlConfig, 'locale' | 'messages'> &\n Partial<Pick<ResolvedIntlConfig, 'defaultRichTextElements'>>;\n children?: React.ReactNode;\n}\n\nexport default function Provider({ i18n, children }: ProviderProps) {\n const { locale, messages, defaultRichTextElements } = i18n;\n const adjustedLocale = adjustLocale(locale);\n let intlConfig;\n\n if (adjustedLocale === null) {\n // eslint-disable-next-line no-console\n console.warn(\n `Unsupported locale value was provided: '${locale}', defaulting to '${DEFAULT_LOCALE}'`,\n );\n\n intlConfig = { locale: DEFAULT_LOCALE, messages: { ...en, ...messages } };\n } else {\n intlConfig = { locale: adjustedLocale, messages };\n }\n\n return (\n <DirectionProvider direction={getDirectionFromLocale(locale)}>\n <LanguageProvider locale={locale}>\n <IntlProvider\n defaultLocale={DEFAULT_LOCALE}\n locale={intlConfig.locale}\n messages={intlConfig.messages}\n defaultRichTextElements={defaultRichTextElements}\n >\n {children}\n </IntlProvider>\n </LanguageProvider>\n </DirectionProvider>\n );\n}\n"],"names":["Provider","i18n","children","locale","messages","defaultRichTextElements","adjustedLocale","adjustLocale","intlConfig","console","warn","DEFAULT_LOCALE","en","_jsx","DirectionProvider","direction","getDirectionFromLocale","LanguageProvider","IntlProvider","defaultLocale"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcwB,SAAAA,QAAQA,CAAC;EAAEC,IAAI;AAAEC,EAAAA;AAAyB,CAAA,EAAA;EAChE,MAAM;IAAEC,MAAM;IAAEC,QAAQ;AAAEC,IAAAA;AAAuB,GAAE,GAAGJ,IAAI;AAC1D,EAAA,MAAMK,cAAc,GAAGC,kBAAY,CAACJ,MAAM,CAAC;AAC3C,EAAA,IAAIK,UAAU;EAEd,IAAIF,cAAc,KAAK,IAAI,EAAE;AAC3B;IACAG,OAAO,CAACC,IAAI,CACV,CAAA,wCAAA,EAA2CP,MAAM,CAAqBQ,kBAAAA,EAAAA,oBAAc,GAAG,CACxF;AAEDH,IAAAA,UAAU,GAAG;AAAEL,MAAAA,MAAM,EAAEQ,oBAAc;AAAEP,MAAAA,QAAQ,EAAE;AAAE,QAAA,GAAGQ,UAAE;QAAE,GAAGR;AAAQ;KAAI;AAC3E,GAAC,MAAM;AACLI,IAAAA,UAAU,GAAG;AAAEL,MAAAA,MAAM,EAAEG,cAAc;AAAEF,MAAAA;KAAU;AACnD;EAEA,oBACES,cAAA,CAACC,mCAAiB,EAAA;AAACC,IAAAA,SAAS,EAAEC,4BAAsB,CAACb,MAAM,CAAE;IAAAD,QAAA,eAC3DW,cAAA,CAACI,iCAAgB,EAAA;AAACd,MAAAA,MAAM,EAAEA,MAAO;MAAAD,QAAA,eAC/BW,cAAA,CAACK,sBAAY,EAAA;AACXC,QAAAA,aAAa,EAAER,oBAAe;QAC9BR,MAAM,EAAEK,UAAU,CAACL,MAAO;QAC1BC,QAAQ,EAAEI,UAAU,CAACJ,QAAS;AAC9BC,QAAAA,uBAAuB,EAAEA,uBAAwB;AAAAH,QAAAA,QAAA,EAEhDA;OACW;KACE;AACpB,GAAmB,CAAC;AAExB;;;;"}
1
+ {"version":3,"file":"Provider.js","sources":["../../src/provider/Provider.tsx"],"sourcesContent":["import { IntlProvider, ResolvedIntlConfig } from 'react-intl';\n\nimport { adjustLocale, DEFAULT_LOCALE, getDirectionFromLocale } from '../common';\nimport en from '../i18n/en.json';\n\nimport { DirectionProvider } from './direction';\nimport { LanguageProvider } from './language';\n\nexport interface ProviderProps {\n i18n: Pick<ResolvedIntlConfig, 'locale' | 'messages'> &\n Partial<Pick<ResolvedIntlConfig, 'defaultRichTextElements'>>;\n children?: React.ReactNode;\n}\n\nexport default function Provider({ i18n, children }: ProviderProps) {\n const { locale, messages, defaultRichTextElements } = i18n;\n const adjustedLocale = adjustLocale(locale);\n let intlConfig;\n\n if (adjustedLocale === null) {\n // eslint-disable-next-line no-console\n console.warn(\n `Unsupported locale value was provided: '${locale}', defaulting to '${DEFAULT_LOCALE}'`,\n );\n\n intlConfig = { locale: DEFAULT_LOCALE, messages: { ...en, ...messages } };\n } else {\n intlConfig = { locale: adjustedLocale, messages };\n }\n\n return (\n <DirectionProvider direction={getDirectionFromLocale(locale)}>\n <LanguageProvider locale={locale}>\n <IntlProvider\n defaultLocale={DEFAULT_LOCALE}\n locale={intlConfig.locale}\n messages={intlConfig.messages}\n defaultRichTextElements={defaultRichTextElements}\n >\n {children}\n </IntlProvider>\n </LanguageProvider>\n </DirectionProvider>\n );\n}\n"],"names":["Provider","i18n","children","locale","messages","defaultRichTextElements","adjustedLocale","adjustLocale","intlConfig","console","warn","DEFAULT_LOCALE","en","_jsx","DirectionProvider","direction","getDirectionFromLocale","LanguageProvider","IntlProvider","defaultLocale"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcc,SAAUA,QAAQA,CAAC;EAAEC,IAAI;AAAEC,EAAAA;AAAQ,CAAiB,EAAA;EAChE,MAAM;IAAEC,MAAM;IAAEC,QAAQ;AAAEC,IAAAA;AAAuB,GAAE,GAAGJ,IAAI;AAC1D,EAAA,MAAMK,cAAc,GAAGC,kBAAY,CAACJ,MAAM,CAAC;AAC3C,EAAA,IAAIK,UAAU;EAEd,IAAIF,cAAc,KAAK,IAAI,EAAE;AAC3B;IACAG,OAAO,CAACC,IAAI,CACV,CAAA,wCAAA,EAA2CP,MAAM,CAAA,kBAAA,EAAqBQ,oBAAc,GAAG,CACxF;AAEDH,IAAAA,UAAU,GAAG;AAAEL,MAAAA,MAAM,EAAEQ,oBAAc;AAAEP,MAAAA,QAAQ,EAAE;AAAE,QAAA,GAAGQ,UAAE;QAAE,GAAGR;AAAQ;KAAI;AAC3E,EAAA,CAAC,MAAM;AACLI,IAAAA,UAAU,GAAG;AAAEL,MAAAA,MAAM,EAAEG,cAAc;AAAEF,MAAAA;KAAU;AACnD,EAAA;EAEA,oBACES,cAAA,CAACC,mCAAiB,EAAA;AAACC,IAAAA,SAAS,EAAEC,4BAAsB,CAACb,MAAM,CAAE;IAAAD,QAAA,eAC3DW,cAAA,CAACI,iCAAgB,EAAA;AAACd,MAAAA,MAAM,EAAEA,MAAO;MAAAD,QAAA,eAC/BW,cAAA,CAACK,sBAAY,EAAA;AACXC,QAAAA,aAAa,EAAER,oBAAe;QAC9BR,MAAM,EAAEK,UAAU,CAACL,MAAO;QAC1BC,QAAQ,EAAEI,UAAU,CAACJ,QAAS;AAC9BC,QAAAA,uBAAuB,EAAEA,uBAAwB;AAAAH,QAAAA,QAAA,EAEhDA;OACW;KACE;AACpB,GAAmB,CAAC;AAExB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Provider.mjs","sources":["../../src/provider/Provider.tsx"],"sourcesContent":["import { IntlProvider, ResolvedIntlConfig } from 'react-intl';\n\nimport { adjustLocale, DEFAULT_LOCALE, getDirectionFromLocale } from '../common';\nimport en from '../i18n/en.json';\n\nimport { DirectionProvider } from './direction';\nimport { LanguageProvider } from './language';\n\nexport interface ProviderProps {\n i18n: Pick<ResolvedIntlConfig, 'locale' | 'messages'> &\n Partial<Pick<ResolvedIntlConfig, 'defaultRichTextElements'>>;\n children?: React.ReactNode;\n}\n\nexport default function Provider({ i18n, children }: ProviderProps) {\n const { locale, messages, defaultRichTextElements } = i18n;\n const adjustedLocale = adjustLocale(locale);\n let intlConfig;\n\n if (adjustedLocale === null) {\n // eslint-disable-next-line no-console\n console.warn(\n `Unsupported locale value was provided: '${locale}', defaulting to '${DEFAULT_LOCALE}'`,\n );\n\n intlConfig = { locale: DEFAULT_LOCALE, messages: { ...en, ...messages } };\n } else {\n intlConfig = { locale: adjustedLocale, messages };\n }\n\n return (\n <DirectionProvider direction={getDirectionFromLocale(locale)}>\n <LanguageProvider locale={locale}>\n <IntlProvider\n defaultLocale={DEFAULT_LOCALE}\n locale={intlConfig.locale}\n messages={intlConfig.messages}\n defaultRichTextElements={defaultRichTextElements}\n >\n {children}\n </IntlProvider>\n </LanguageProvider>\n </DirectionProvider>\n );\n}\n"],"names":["Provider","i18n","children","locale","messages","defaultRichTextElements","adjustedLocale","adjustLocale","intlConfig","console","warn","DEFAULT_LOCALE","en","_jsx","DirectionProvider","direction","getDirectionFromLocale","LanguageProvider","IntlProvider","defaultLocale"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcwB,SAAAA,QAAQA,CAAC;EAAEC,IAAI;AAAEC,EAAAA;AAAyB,CAAA,EAAA;EAChE,MAAM;IAAEC,MAAM;IAAEC,QAAQ;AAAEC,IAAAA;AAAuB,GAAE,GAAGJ,IAAI;AAC1D,EAAA,MAAMK,cAAc,GAAGC,YAAY,CAACJ,MAAM,CAAC;AAC3C,EAAA,IAAIK,UAAU;EAEd,IAAIF,cAAc,KAAK,IAAI,EAAE;AAC3B;IACAG,OAAO,CAACC,IAAI,CACV,CAAA,wCAAA,EAA2CP,MAAM,CAAqBQ,kBAAAA,EAAAA,cAAc,GAAG,CACxF;AAEDH,IAAAA,UAAU,GAAG;AAAEL,MAAAA,MAAM,EAAEQ,cAAc;AAAEP,MAAAA,QAAQ,EAAE;AAAE,QAAA,GAAGQ,EAAE;QAAE,GAAGR;AAAQ;KAAI;AAC3E,GAAC,MAAM;AACLI,IAAAA,UAAU,GAAG;AAAEL,MAAAA,MAAM,EAAEG,cAAc;AAAEF,MAAAA;KAAU;AACnD;EAEA,oBACES,GAAA,CAACC,iBAAiB,EAAA;AAACC,IAAAA,SAAS,EAAEC,sBAAsB,CAACb,MAAM,CAAE;IAAAD,QAAA,eAC3DW,GAAA,CAACI,gBAAgB,EAAA;AAACd,MAAAA,MAAM,EAAEA,MAAO;MAAAD,QAAA,eAC/BW,GAAA,CAACK,YAAY,EAAA;AACXC,QAAAA,aAAa,EAAER,cAAe;QAC9BR,MAAM,EAAEK,UAAU,CAACL,MAAO;QAC1BC,QAAQ,EAAEI,UAAU,CAACJ,QAAS;AAC9BC,QAAAA,uBAAuB,EAAEA,uBAAwB;AAAAH,QAAAA,QAAA,EAEhDA;OACW;KACE;AACpB,GAAmB,CAAC;AAExB;;;;"}
1
+ {"version":3,"file":"Provider.mjs","sources":["../../src/provider/Provider.tsx"],"sourcesContent":["import { IntlProvider, ResolvedIntlConfig } from 'react-intl';\n\nimport { adjustLocale, DEFAULT_LOCALE, getDirectionFromLocale } from '../common';\nimport en from '../i18n/en.json';\n\nimport { DirectionProvider } from './direction';\nimport { LanguageProvider } from './language';\n\nexport interface ProviderProps {\n i18n: Pick<ResolvedIntlConfig, 'locale' | 'messages'> &\n Partial<Pick<ResolvedIntlConfig, 'defaultRichTextElements'>>;\n children?: React.ReactNode;\n}\n\nexport default function Provider({ i18n, children }: ProviderProps) {\n const { locale, messages, defaultRichTextElements } = i18n;\n const adjustedLocale = adjustLocale(locale);\n let intlConfig;\n\n if (adjustedLocale === null) {\n // eslint-disable-next-line no-console\n console.warn(\n `Unsupported locale value was provided: '${locale}', defaulting to '${DEFAULT_LOCALE}'`,\n );\n\n intlConfig = { locale: DEFAULT_LOCALE, messages: { ...en, ...messages } };\n } else {\n intlConfig = { locale: adjustedLocale, messages };\n }\n\n return (\n <DirectionProvider direction={getDirectionFromLocale(locale)}>\n <LanguageProvider locale={locale}>\n <IntlProvider\n defaultLocale={DEFAULT_LOCALE}\n locale={intlConfig.locale}\n messages={intlConfig.messages}\n defaultRichTextElements={defaultRichTextElements}\n >\n {children}\n </IntlProvider>\n </LanguageProvider>\n </DirectionProvider>\n );\n}\n"],"names":["Provider","i18n","children","locale","messages","defaultRichTextElements","adjustedLocale","adjustLocale","intlConfig","console","warn","DEFAULT_LOCALE","en","_jsx","DirectionProvider","direction","getDirectionFromLocale","LanguageProvider","IntlProvider","defaultLocale"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcc,SAAUA,QAAQA,CAAC;EAAEC,IAAI;AAAEC,EAAAA;AAAQ,CAAiB,EAAA;EAChE,MAAM;IAAEC,MAAM;IAAEC,QAAQ;AAAEC,IAAAA;AAAuB,GAAE,GAAGJ,IAAI;AAC1D,EAAA,MAAMK,cAAc,GAAGC,YAAY,CAACJ,MAAM,CAAC;AAC3C,EAAA,IAAIK,UAAU;EAEd,IAAIF,cAAc,KAAK,IAAI,EAAE;AAC3B;IACAG,OAAO,CAACC,IAAI,CACV,CAAA,wCAAA,EAA2CP,MAAM,CAAA,kBAAA,EAAqBQ,cAAc,GAAG,CACxF;AAEDH,IAAAA,UAAU,GAAG;AAAEL,MAAAA,MAAM,EAAEQ,cAAc;AAAEP,MAAAA,QAAQ,EAAE;AAAE,QAAA,GAAGQ,EAAE;QAAE,GAAGR;AAAQ;KAAI;AAC3E,EAAA,CAAC,MAAM;AACLI,IAAAA,UAAU,GAAG;AAAEL,MAAAA,MAAM,EAAEG,cAAc;AAAEF,MAAAA;KAAU;AACnD,EAAA;EAEA,oBACES,GAAA,CAACC,iBAAiB,EAAA;AAACC,IAAAA,SAAS,EAAEC,sBAAsB,CAACb,MAAM,CAAE;IAAAD,QAAA,eAC3DW,GAAA,CAACI,gBAAgB,EAAA;AAACd,MAAAA,MAAM,EAAEA,MAAO;MAAAD,QAAA,eAC/BW,GAAA,CAACK,YAAY,EAAA;AACXC,QAAAA,aAAa,EAAER,cAAe;QAC9BR,MAAM,EAAEK,UAAU,CAACL,MAAO;QAC1BC,QAAQ,EAAEI,UAAU,CAACJ,QAAS;AAC9BC,QAAAA,uBAAuB,EAAEA,uBAAwB;AAAAH,QAAAA,QAAA,EAEhDA;OACW;KACE;AACpB,GAAmB,CAAC;AAExB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DirectionProvider.js","sources":["../../../src/provider/direction/DirectionProvider.tsx"],"sourcesContent":["import { createContext, PropsWithChildren } from 'react';\n\nimport { LayoutDirection, Direction } from '../../common/direction';\n\nexport const DirectionContext = createContext<LayoutDirection>(Direction.LTR);\n\nexport type DirectionProviderProps = PropsWithChildren<{ direction: LayoutDirection }>;\n\nexport const DirectionProvider = ({ direction, children }: DirectionProviderProps) => {\n return <DirectionContext.Provider value={direction}>{children}</DirectionContext.Provider>;\n};\n"],"names":["DirectionContext","createContext","Direction","LTR","DirectionProvider","direction","children","_jsx","Provider","value"],"mappings":";;;;;;AAIO,MAAMA,gBAAgB,gBAAGC,mBAAa,CAAkBC,mBAAS,CAACC,GAAG;AAIrE,MAAMC,iBAAiB,GAAGA,CAAC;EAAEC,SAAS;AAAEC,EAAAA;AAAkC,CAAA,KAAI;AACnF,EAAA,oBAAOC,cAAA,CAACP,gBAAgB,CAACQ,QAAQ,EAAA;AAACC,IAAAA,KAAK,EAAEJ,SAAU;AAAAC,IAAAA,QAAA,EAAEA;AAAQ,GAA4B,CAAC;AAC5F;;;;;"}
1
+ {"version":3,"file":"DirectionProvider.js","sources":["../../../src/provider/direction/DirectionProvider.tsx"],"sourcesContent":["import { createContext, PropsWithChildren } from 'react';\n\nimport { LayoutDirection, Direction } from '../../common/direction';\n\nexport const DirectionContext = createContext<LayoutDirection>(Direction.LTR);\n\nexport type DirectionProviderProps = PropsWithChildren<{ direction: LayoutDirection }>;\n\nexport const DirectionProvider = ({ direction, children }: DirectionProviderProps) => {\n return <DirectionContext.Provider value={direction}>{children}</DirectionContext.Provider>;\n};\n"],"names":["DirectionContext","createContext","Direction","LTR","DirectionProvider","direction","children","_jsx","Provider","value"],"mappings":";;;;;;AAIO,MAAMA,gBAAgB,gBAAGC,mBAAa,CAAkBC,mBAAS,CAACC,GAAG;AAIrE,MAAMC,iBAAiB,GAAGA,CAAC;EAAEC,SAAS;AAAEC,EAAAA;AAAQ,CAA0B,KAAI;AACnF,EAAA,oBAAOC,cAAA,CAACP,gBAAgB,CAACQ,QAAQ,EAAA;AAACC,IAAAA,KAAK,EAAEJ,SAAU;AAAAC,IAAAA,QAAA,EAAEA;AAAQ,GAA4B,CAAC;AAC5F;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DirectionProvider.mjs","sources":["../../../src/provider/direction/DirectionProvider.tsx"],"sourcesContent":["import { createContext, PropsWithChildren } from 'react';\n\nimport { LayoutDirection, Direction } from '../../common/direction';\n\nexport const DirectionContext = createContext<LayoutDirection>(Direction.LTR);\n\nexport type DirectionProviderProps = PropsWithChildren<{ direction: LayoutDirection }>;\n\nexport const DirectionProvider = ({ direction, children }: DirectionProviderProps) => {\n return <DirectionContext.Provider value={direction}>{children}</DirectionContext.Provider>;\n};\n"],"names":["DirectionContext","createContext","Direction","LTR","DirectionProvider","direction","children","_jsx","Provider","value"],"mappings":";;;;AAIO,MAAMA,gBAAgB,gBAAGC,aAAa,CAAkBC,SAAS,CAACC,GAAG;AAIrE,MAAMC,iBAAiB,GAAGA,CAAC;EAAEC,SAAS;AAAEC,EAAAA;AAAkC,CAAA,KAAI;AACnF,EAAA,oBAAOC,GAAA,CAACP,gBAAgB,CAACQ,QAAQ,EAAA;AAACC,IAAAA,KAAK,EAAEJ,SAAU;AAAAC,IAAAA,QAAA,EAAEA;AAAQ,GAA4B,CAAC;AAC5F;;;;"}
1
+ {"version":3,"file":"DirectionProvider.mjs","sources":["../../../src/provider/direction/DirectionProvider.tsx"],"sourcesContent":["import { createContext, PropsWithChildren } from 'react';\n\nimport { LayoutDirection, Direction } from '../../common/direction';\n\nexport const DirectionContext = createContext<LayoutDirection>(Direction.LTR);\n\nexport type DirectionProviderProps = PropsWithChildren<{ direction: LayoutDirection }>;\n\nexport const DirectionProvider = ({ direction, children }: DirectionProviderProps) => {\n return <DirectionContext.Provider value={direction}>{children}</DirectionContext.Provider>;\n};\n"],"names":["DirectionContext","createContext","Direction","LTR","DirectionProvider","direction","children","_jsx","Provider","value"],"mappings":";;;;AAIO,MAAMA,gBAAgB,gBAAGC,aAAa,CAAkBC,SAAS,CAACC,GAAG;AAIrE,MAAMC,iBAAiB,GAAGA,CAAC;EAAEC,SAAS;AAAEC,EAAAA;AAAQ,CAA0B,KAAI;AACnF,EAAA,oBAAOC,GAAA,CAACP,gBAAgB,CAACQ,QAAQ,EAAA;AAACC,IAAAA,KAAK,EAAEJ,SAAU;AAAAC,IAAAA,QAAA,EAAEA;AAAQ,GAA4B,CAAC;AAC5F;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"LanguageProvider.js","sources":["../../../src/provider/language/LanguageProvider.tsx"],"sourcesContent":["import { createContext, PropsWithChildren } from 'react';\n\nimport { DEFAULT_LOCALE } from '../../common/locale';\n\nexport const LanguageContext = createContext<string>(DEFAULT_LOCALE);\n\nexport type LanguageProviderProps = PropsWithChildren<{ locale: string }>;\n\nexport const LanguageProvider = ({ locale, children }: LanguageProviderProps) => {\n return <LanguageContext.Provider value={locale}>{children}</LanguageContext.Provider>;\n};\n"],"names":["LanguageContext","createContext","DEFAULT_LOCALE","LanguageProvider","locale","children","_jsx","Provider","value"],"mappings":";;;;;;MAIaA,eAAe,gBAAGC,mBAAa,CAASC,oBAAc;AAI5D,MAAMC,gBAAgB,GAAGA,CAAC;EAAEC,MAAM;AAAEC,EAAAA;AAAiC,CAAA,KAAI;AAC9E,EAAA,oBAAOC,cAAA,CAACN,eAAe,CAACO,QAAQ,EAAA;AAACC,IAAAA,KAAK,EAAEJ,MAAO;AAAAC,IAAAA,QAAA,EAAEA;AAAQ,GAA2B,CAAC;AACvF;;;;;"}
1
+ {"version":3,"file":"LanguageProvider.js","sources":["../../../src/provider/language/LanguageProvider.tsx"],"sourcesContent":["import { createContext, PropsWithChildren } from 'react';\n\nimport { DEFAULT_LOCALE } from '../../common/locale';\n\nexport const LanguageContext = createContext<string>(DEFAULT_LOCALE);\n\nexport type LanguageProviderProps = PropsWithChildren<{ locale: string }>;\n\nexport const LanguageProvider = ({ locale, children }: LanguageProviderProps) => {\n return <LanguageContext.Provider value={locale}>{children}</LanguageContext.Provider>;\n};\n"],"names":["LanguageContext","createContext","DEFAULT_LOCALE","LanguageProvider","locale","children","_jsx","Provider","value"],"mappings":";;;;;;MAIaA,eAAe,gBAAGC,mBAAa,CAASC,oBAAc;AAI5D,MAAMC,gBAAgB,GAAGA,CAAC;EAAEC,MAAM;AAAEC,EAAAA;AAAQ,CAAyB,KAAI;AAC9E,EAAA,oBAAOC,cAAA,CAACN,eAAe,CAACO,QAAQ,EAAA;AAACC,IAAAA,KAAK,EAAEJ,MAAO;AAAAC,IAAAA,QAAA,EAAEA;AAAQ,GAA2B,CAAC;AACvF;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"LanguageProvider.mjs","sources":["../../../src/provider/language/LanguageProvider.tsx"],"sourcesContent":["import { createContext, PropsWithChildren } from 'react';\n\nimport { DEFAULT_LOCALE } from '../../common/locale';\n\nexport const LanguageContext = createContext<string>(DEFAULT_LOCALE);\n\nexport type LanguageProviderProps = PropsWithChildren<{ locale: string }>;\n\nexport const LanguageProvider = ({ locale, children }: LanguageProviderProps) => {\n return <LanguageContext.Provider value={locale}>{children}</LanguageContext.Provider>;\n};\n"],"names":["LanguageContext","createContext","DEFAULT_LOCALE","LanguageProvider","locale","children","_jsx","Provider","value"],"mappings":";;;;MAIaA,eAAe,gBAAGC,aAAa,CAASC,cAAc;AAI5D,MAAMC,gBAAgB,GAAGA,CAAC;EAAEC,MAAM;AAAEC,EAAAA;AAAiC,CAAA,KAAI;AAC9E,EAAA,oBAAOC,GAAA,CAACN,eAAe,CAACO,QAAQ,EAAA;AAACC,IAAAA,KAAK,EAAEJ,MAAO;AAAAC,IAAAA,QAAA,EAAEA;AAAQ,GAA2B,CAAC;AACvF;;;;"}
1
+ {"version":3,"file":"LanguageProvider.mjs","sources":["../../../src/provider/language/LanguageProvider.tsx"],"sourcesContent":["import { createContext, PropsWithChildren } from 'react';\n\nimport { DEFAULT_LOCALE } from '../../common/locale';\n\nexport const LanguageContext = createContext<string>(DEFAULT_LOCALE);\n\nexport type LanguageProviderProps = PropsWithChildren<{ locale: string }>;\n\nexport const LanguageProvider = ({ locale, children }: LanguageProviderProps) => {\n return <LanguageContext.Provider value={locale}>{children}</LanguageContext.Provider>;\n};\n"],"names":["LanguageContext","createContext","DEFAULT_LOCALE","LanguageProvider","locale","children","_jsx","Provider","value"],"mappings":";;;;MAIaA,eAAe,gBAAGC,aAAa,CAASC,cAAc;AAI5D,MAAMC,gBAAgB,GAAGA,CAAC;EAAEC,MAAM;AAAEC,EAAAA;AAAQ,CAAyB,KAAI;AAC9E,EAAA,oBAAOC,GAAA,CAACN,eAAe,CAACO,QAAQ,EAAA;AAACC,IAAAA,KAAK,EAAEJ,MAAO;AAAAC,IAAAA,QAAA,EAAEA;AAAQ,GAA2B,CAAC;AACvF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"OverlayIdProvider.js","sources":["../../../src/provider/overlay/OverlayIdProvider.tsx"],"sourcesContent":["import { createContext, useId } from 'react';\n\nexport const OverlayIdContext = createContext<string | undefined>(undefined);\n\nexport type OverlayIdProviderProps = {\n open: boolean;\n children?: React.ReactNode;\n};\n\nexport const OverlayIdProvider = ({ open, children }: OverlayIdProviderProps) => {\n const id = useId();\n return (\n <OverlayIdContext.Provider value={open ? id : undefined}>{children}</OverlayIdContext.Provider>\n );\n};\n"],"names":["OverlayIdContext","createContext","undefined","OverlayIdProvider","open","children","id","useId","_jsx","Provider","value"],"mappings":";;;;;MAEaA,gBAAgB,gBAAGC,mBAAa,CAAqBC,SAAS;AAOpE,MAAMC,iBAAiB,GAAGA,CAAC;EAAEC,IAAI;AAAEC,EAAAA;AAAkC,CAAA,KAAI;AAC9E,EAAA,MAAMC,EAAE,GAAGC,WAAK,EAAE;AAClB,EAAA,oBACEC,cAAA,CAACR,gBAAgB,CAACS,QAAQ,EAAA;AAACC,IAAAA,KAAK,EAAEN,IAAI,GAAGE,EAAE,GAAGJ,SAAU;AAAAG,IAAAA,QAAA,EAAEA;AAAQ,GAA4B,CAAC;AAEnG;;;;;"}
1
+ {"version":3,"file":"OverlayIdProvider.js","sources":["../../../src/provider/overlay/OverlayIdProvider.tsx"],"sourcesContent":["import { createContext, useId } from 'react';\n\nexport const OverlayIdContext = createContext<string | undefined>(undefined);\n\nexport type OverlayIdProviderProps = {\n open: boolean;\n children?: React.ReactNode;\n};\n\nexport const OverlayIdProvider = ({ open, children }: OverlayIdProviderProps) => {\n const id = useId();\n return (\n <OverlayIdContext.Provider value={open ? id : undefined}>{children}</OverlayIdContext.Provider>\n );\n};\n"],"names":["OverlayIdContext","createContext","undefined","OverlayIdProvider","open","children","id","useId","_jsx","Provider","value"],"mappings":";;;;;MAEaA,gBAAgB,gBAAGC,mBAAa,CAAqBC,SAAS;AAOpE,MAAMC,iBAAiB,GAAGA,CAAC;EAAEC,IAAI;AAAEC,EAAAA;AAAQ,CAA0B,KAAI;AAC9E,EAAA,MAAMC,EAAE,GAAGC,WAAK,EAAE;AAClB,EAAA,oBACEC,cAAA,CAACR,gBAAgB,CAACS,QAAQ,EAAA;AAACC,IAAAA,KAAK,EAAEN,IAAI,GAAGE,EAAE,GAAGJ,SAAU;AAAAG,IAAAA,QAAA,EAAEA;AAAQ,GAA4B,CAAC;AAEnG;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"OverlayIdProvider.mjs","sources":["../../../src/provider/overlay/OverlayIdProvider.tsx"],"sourcesContent":["import { createContext, useId } from 'react';\n\nexport const OverlayIdContext = createContext<string | undefined>(undefined);\n\nexport type OverlayIdProviderProps = {\n open: boolean;\n children?: React.ReactNode;\n};\n\nexport const OverlayIdProvider = ({ open, children }: OverlayIdProviderProps) => {\n const id = useId();\n return (\n <OverlayIdContext.Provider value={open ? id : undefined}>{children}</OverlayIdContext.Provider>\n );\n};\n"],"names":["OverlayIdContext","createContext","undefined","OverlayIdProvider","open","children","id","useId","_jsx","Provider","value"],"mappings":";;;MAEaA,gBAAgB,gBAAGC,aAAa,CAAqBC,SAAS;AAOpE,MAAMC,iBAAiB,GAAGA,CAAC;EAAEC,IAAI;AAAEC,EAAAA;AAAkC,CAAA,KAAI;AAC9E,EAAA,MAAMC,EAAE,GAAGC,KAAK,EAAE;AAClB,EAAA,oBACEC,GAAA,CAACR,gBAAgB,CAACS,QAAQ,EAAA;AAACC,IAAAA,KAAK,EAAEN,IAAI,GAAGE,EAAE,GAAGJ,SAAU;AAAAG,IAAAA,QAAA,EAAEA;AAAQ,GAA4B,CAAC;AAEnG;;;;"}
1
+ {"version":3,"file":"OverlayIdProvider.mjs","sources":["../../../src/provider/overlay/OverlayIdProvider.tsx"],"sourcesContent":["import { createContext, useId } from 'react';\n\nexport const OverlayIdContext = createContext<string | undefined>(undefined);\n\nexport type OverlayIdProviderProps = {\n open: boolean;\n children?: React.ReactNode;\n};\n\nexport const OverlayIdProvider = ({ open, children }: OverlayIdProviderProps) => {\n const id = useId();\n return (\n <OverlayIdContext.Provider value={open ? id : undefined}>{children}</OverlayIdContext.Provider>\n );\n};\n"],"names":["OverlayIdContext","createContext","undefined","OverlayIdProvider","open","children","id","useId","_jsx","Provider","value"],"mappings":";;;MAEaA,gBAAgB,gBAAGC,aAAa,CAAqBC,SAAS;AAOpE,MAAMC,iBAAiB,GAAGA,CAAC;EAAEC,IAAI;AAAEC,EAAAA;AAAQ,CAA0B,KAAI;AAC9E,EAAA,MAAMC,EAAE,GAAGC,KAAK,EAAE;AAClB,EAAA,oBACEC,GAAA,CAACR,gBAAgB,CAACS,QAAQ,EAAA;AAACC,IAAAA,KAAK,EAAEN,IAAI,GAAGE,EAAE,GAAGJ,SAAU;AAAAG,IAAAA,QAAA,EAAEA;AAAQ,GAA4B,CAAC;AAEnG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.js","sources":["../../src/radio/Radio.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport Body from '../body/Body';\nimport { Typography } from '../common';\nimport RadioButton from '../common/RadioButton';\nimport { RadioButtonProps } from '../common/RadioButton/RadioButton';\n\nexport interface RadioProps<T extends string | number = string> extends RadioButtonProps<T> {\n avatar?: React.ReactNode;\n label: string;\n secondary?: string;\n className?: string;\n}\n\nexport default function Radio<T extends string | number = ''>({\n label,\n id,\n disabled,\n className,\n avatar,\n secondary,\n ...otherProps\n}: RadioProps<T>) {\n return (\n <div\n className={clsx(\n 'radio np-radio',\n {\n 'radio-lg': secondary,\n 'radio-disabled': disabled,\n },\n className,\n )}\n >\n <label className={clsx({ disabled })} htmlFor={id}>\n <span className=\"m-r-2 np-radio-button\">\n <RadioButton id={id} disabled={disabled} {...otherProps} />\n </span>\n <Body\n as=\"span\"\n type={secondary ? Typography.BODY_LARGE_BOLD : Typography.BODY_LARGE}\n className=\"np-radio__text\"\n >\n {label}\n {secondary && <Body as=\"span\">{secondary}</Body>}\n </Body>\n {avatar && <span className=\"np-radio__avatar m-l-auto\">{avatar}</span>}\n </label>\n </div>\n );\n}\n"],"names":["Radio","label","id","disabled","className","avatar","secondary","otherProps","_jsx","clsx","children","_jsxs","htmlFor","RadioButton","Body","as","type","Typography","BODY_LARGE_BOLD","BODY_LARGE"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcwB,SAAAA,KAAKA,CAAiC;EAC5DC,KAAK;EACLC,EAAE;EACFC,QAAQ;EACRC,SAAS;EACTC,MAAM;EACNC,SAAS;EACT,GAAGC;AACW,CAAA,EAAA;AACd,EAAA,oBACEC,cAAA,CAAA,KAAA,EAAA;AACEJ,IAAAA,SAAS,EAAEK,SAAI,CACb,gBAAgB,EAChB;AACE,MAAA,UAAU,EAAEH,SAAS;AACrB,MAAA,gBAAgB,EAAEH;KACnB,EACDC,SAAS,CACT;AAAAM,IAAAA,QAAA,eAEFC,eAAA,CAAA,OAAA,EAAA;MAAOP,SAAS,EAAEK,SAAI,CAAC;AAAEN,QAAAA;AAAU,OAAA,CAAE;AAACS,MAAAA,OAAO,EAAEV,EAAG;AAAAQ,MAAAA,QAAA,gBAChDF,cAAA,CAAA,MAAA,EAAA;AAAMJ,QAAAA,SAAS,EAAC,uBAAuB;QAAAM,QAAA,eACrCF,cAAA,CAACK,mBAAW,EAAA;AAACX,UAAAA,EAAE,EAAEA,EAAG;AAACC,UAAAA,QAAQ,EAAEA,QAAS;UAAA,GAAKI;SAC/C;AAAA,OAAM,CACN,eAAAI,eAAA,CAACG,YAAI,EAAA;AACHC,QAAAA,EAAE,EAAC,MAAM;QACTC,IAAI,EAAEV,SAAS,GAAGW,qBAAU,CAACC,eAAe,GAAGD,qBAAU,CAACE,UAAW;AACrEf,QAAAA,SAAS,EAAC,gBAAgB;AAAAM,QAAAA,QAAA,GAEzBT,KAAK,EACLK,SAAS,iBAAIE,cAAA,CAACM,YAAI,EAAA;AAACC,UAAAA,EAAE,EAAC,MAAM;AAAAL,UAAAA,QAAA,EAAEJ;AAAS,SAAO,CAAC;AAAA,OAC5C,CACN,EAACD,MAAM,iBAAIG,cAAA,CAAA,MAAA,EAAA;AAAMJ,QAAAA,SAAS,EAAC,2BAA2B;AAAAM,QAAAA,QAAA,EAAEL;AAAM,OAAO,CAAC;KACjE;AACT,GAAK,CAAC;AAEV;;;;"}
1
+ {"version":3,"file":"Radio.js","sources":["../../src/radio/Radio.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport Body from '../body/Body';\nimport { Typography } from '../common';\nimport RadioButton from '../common/RadioButton';\nimport { RadioButtonProps } from '../common/RadioButton/RadioButton';\n\nexport interface RadioProps<T extends string | number = string> extends RadioButtonProps<T> {\n avatar?: React.ReactNode;\n label: string;\n secondary?: string;\n className?: string;\n}\n\nexport default function Radio<T extends string | number = ''>({\n label,\n id,\n disabled,\n className,\n avatar,\n secondary,\n ...otherProps\n}: RadioProps<T>) {\n return (\n <div\n className={clsx(\n 'radio np-radio',\n {\n 'radio-lg': secondary,\n 'radio-disabled': disabled,\n },\n className,\n )}\n >\n <label className={clsx({ disabled })} htmlFor={id}>\n <span className=\"m-r-2 np-radio-button\">\n <RadioButton id={id} disabled={disabled} {...otherProps} />\n </span>\n <Body\n as=\"span\"\n type={secondary ? Typography.BODY_LARGE_BOLD : Typography.BODY_LARGE}\n className=\"np-radio__text\"\n >\n {label}\n {secondary && <Body as=\"span\">{secondary}</Body>}\n </Body>\n {avatar && <span className=\"np-radio__avatar m-l-auto\">{avatar}</span>}\n </label>\n </div>\n );\n}\n"],"names":["Radio","label","id","disabled","className","avatar","secondary","otherProps","_jsx","clsx","children","_jsxs","htmlFor","RadioButton","Body","as","type","Typography","BODY_LARGE_BOLD","BODY_LARGE"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcc,SAAUA,KAAKA,CAAiC;EAC5DC,KAAK;EACLC,EAAE;EACFC,QAAQ;EACRC,SAAS;EACTC,MAAM;EACNC,SAAS;EACT,GAAGC;AAAU,CACC,EAAA;AACd,EAAA,oBACEC,cAAA,CAAA,KAAA,EAAA;AACEJ,IAAAA,SAAS,EAAEK,SAAI,CACb,gBAAgB,EAChB;AACE,MAAA,UAAU,EAAEH,SAAS;AACrB,MAAA,gBAAgB,EAAEH;KACnB,EACDC,SAAS,CACT;AAAAM,IAAAA,QAAA,eAEFC,eAAA,CAAA,OAAA,EAAA;MAAOP,SAAS,EAAEK,SAAI,CAAC;AAAEN,QAAAA;AAAQ,OAAE,CAAE;AAACS,MAAAA,OAAO,EAAEV,EAAG;AAAAQ,MAAAA,QAAA,gBAChDF,cAAA,CAAA,MAAA,EAAA;AAAMJ,QAAAA,SAAS,EAAC,uBAAuB;QAAAM,QAAA,eACrCF,cAAA,CAACK,mBAAW,EAAA;AAACX,UAAAA,EAAE,EAAEA,EAAG;AAACC,UAAAA,QAAQ,EAAEA,QAAS;UAAA,GAAKI;SAAW;AAC1D,OAAM,CACN,eAAAI,eAAA,CAACG,YAAI,EAAA;AACHC,QAAAA,EAAE,EAAC,MAAM;QACTC,IAAI,EAAEV,SAAS,GAAGW,qBAAU,CAACC,eAAe,GAAGD,qBAAU,CAACE,UAAW;AACrEf,QAAAA,SAAS,EAAC,gBAAgB;AAAAM,QAAAA,QAAA,GAEzBT,KAAK,EACLK,SAAS,iBAAIE,cAAA,CAACM,YAAI,EAAA;AAACC,UAAAA,EAAE,EAAC,MAAM;AAAAL,UAAAA,QAAA,EAAEJ;AAAS,SAAO,CAAC;AAAA,OAC5C,CACN,EAACD,MAAM,iBAAIG,cAAA,CAAA,MAAA,EAAA;AAAMJ,QAAAA,SAAS,EAAC,2BAA2B;AAAAM,QAAAA,QAAA,EAAEL;AAAM,OAAO,CAAC;KACjE;AACT,GAAK,CAAC;AAEV;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.mjs","sources":["../../src/radio/Radio.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport Body from '../body/Body';\nimport { Typography } from '../common';\nimport RadioButton from '../common/RadioButton';\nimport { RadioButtonProps } from '../common/RadioButton/RadioButton';\n\nexport interface RadioProps<T extends string | number = string> extends RadioButtonProps<T> {\n avatar?: React.ReactNode;\n label: string;\n secondary?: string;\n className?: string;\n}\n\nexport default function Radio<T extends string | number = ''>({\n label,\n id,\n disabled,\n className,\n avatar,\n secondary,\n ...otherProps\n}: RadioProps<T>) {\n return (\n <div\n className={clsx(\n 'radio np-radio',\n {\n 'radio-lg': secondary,\n 'radio-disabled': disabled,\n },\n className,\n )}\n >\n <label className={clsx({ disabled })} htmlFor={id}>\n <span className=\"m-r-2 np-radio-button\">\n <RadioButton id={id} disabled={disabled} {...otherProps} />\n </span>\n <Body\n as=\"span\"\n type={secondary ? Typography.BODY_LARGE_BOLD : Typography.BODY_LARGE}\n className=\"np-radio__text\"\n >\n {label}\n {secondary && <Body as=\"span\">{secondary}</Body>}\n </Body>\n {avatar && <span className=\"np-radio__avatar m-l-auto\">{avatar}</span>}\n </label>\n </div>\n );\n}\n"],"names":["Radio","label","id","disabled","className","avatar","secondary","otherProps","_jsx","clsx","children","_jsxs","htmlFor","RadioButton","Body","as","type","Typography","BODY_LARGE_BOLD","BODY_LARGE"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcwB,SAAAA,KAAKA,CAAiC;EAC5DC,KAAK;EACLC,EAAE;EACFC,QAAQ;EACRC,SAAS;EACTC,MAAM;EACNC,SAAS;EACT,GAAGC;AACW,CAAA,EAAA;AACd,EAAA,oBACEC,GAAA,CAAA,KAAA,EAAA;AACEJ,IAAAA,SAAS,EAAEK,IAAI,CACb,gBAAgB,EAChB;AACE,MAAA,UAAU,EAAEH,SAAS;AACrB,MAAA,gBAAgB,EAAEH;KACnB,EACDC,SAAS,CACT;AAAAM,IAAAA,QAAA,eAEFC,IAAA,CAAA,OAAA,EAAA;MAAOP,SAAS,EAAEK,IAAI,CAAC;AAAEN,QAAAA;AAAU,OAAA,CAAE;AAACS,MAAAA,OAAO,EAAEV,EAAG;AAAAQ,MAAAA,QAAA,gBAChDF,GAAA,CAAA,MAAA,EAAA;AAAMJ,QAAAA,SAAS,EAAC,uBAAuB;QAAAM,QAAA,eACrCF,GAAA,CAACK,WAAW,EAAA;AAACX,UAAAA,EAAE,EAAEA,EAAG;AAACC,UAAAA,QAAQ,EAAEA,QAAS;UAAA,GAAKI;SAC/C;AAAA,OAAM,CACN,eAAAI,IAAA,CAACG,IAAI,EAAA;AACHC,QAAAA,EAAE,EAAC,MAAM;QACTC,IAAI,EAAEV,SAAS,GAAGW,UAAU,CAACC,eAAe,GAAGD,UAAU,CAACE,UAAW;AACrEf,QAAAA,SAAS,EAAC,gBAAgB;AAAAM,QAAAA,QAAA,GAEzBT,KAAK,EACLK,SAAS,iBAAIE,GAAA,CAACM,IAAI,EAAA;AAACC,UAAAA,EAAE,EAAC,MAAM;AAAAL,UAAAA,QAAA,EAAEJ;AAAS,SAAO,CAAC;AAAA,OAC5C,CACN,EAACD,MAAM,iBAAIG,GAAA,CAAA,MAAA,EAAA;AAAMJ,QAAAA,SAAS,EAAC,2BAA2B;AAAAM,QAAAA,QAAA,EAAEL;AAAM,OAAO,CAAC;KACjE;AACT,GAAK,CAAC;AAEV;;;;"}
1
+ {"version":3,"file":"Radio.mjs","sources":["../../src/radio/Radio.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport Body from '../body/Body';\nimport { Typography } from '../common';\nimport RadioButton from '../common/RadioButton';\nimport { RadioButtonProps } from '../common/RadioButton/RadioButton';\n\nexport interface RadioProps<T extends string | number = string> extends RadioButtonProps<T> {\n avatar?: React.ReactNode;\n label: string;\n secondary?: string;\n className?: string;\n}\n\nexport default function Radio<T extends string | number = ''>({\n label,\n id,\n disabled,\n className,\n avatar,\n secondary,\n ...otherProps\n}: RadioProps<T>) {\n return (\n <div\n className={clsx(\n 'radio np-radio',\n {\n 'radio-lg': secondary,\n 'radio-disabled': disabled,\n },\n className,\n )}\n >\n <label className={clsx({ disabled })} htmlFor={id}>\n <span className=\"m-r-2 np-radio-button\">\n <RadioButton id={id} disabled={disabled} {...otherProps} />\n </span>\n <Body\n as=\"span\"\n type={secondary ? Typography.BODY_LARGE_BOLD : Typography.BODY_LARGE}\n className=\"np-radio__text\"\n >\n {label}\n {secondary && <Body as=\"span\">{secondary}</Body>}\n </Body>\n {avatar && <span className=\"np-radio__avatar m-l-auto\">{avatar}</span>}\n </label>\n </div>\n );\n}\n"],"names":["Radio","label","id","disabled","className","avatar","secondary","otherProps","_jsx","clsx","children","_jsxs","htmlFor","RadioButton","Body","as","type","Typography","BODY_LARGE_BOLD","BODY_LARGE"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcc,SAAUA,KAAKA,CAAiC;EAC5DC,KAAK;EACLC,EAAE;EACFC,QAAQ;EACRC,SAAS;EACTC,MAAM;EACNC,SAAS;EACT,GAAGC;AAAU,CACC,EAAA;AACd,EAAA,oBACEC,GAAA,CAAA,KAAA,EAAA;AACEJ,IAAAA,SAAS,EAAEK,IAAI,CACb,gBAAgB,EAChB;AACE,MAAA,UAAU,EAAEH,SAAS;AACrB,MAAA,gBAAgB,EAAEH;KACnB,EACDC,SAAS,CACT;AAAAM,IAAAA,QAAA,eAEFC,IAAA,CAAA,OAAA,EAAA;MAAOP,SAAS,EAAEK,IAAI,CAAC;AAAEN,QAAAA;AAAQ,OAAE,CAAE;AAACS,MAAAA,OAAO,EAAEV,EAAG;AAAAQ,MAAAA,QAAA,gBAChDF,GAAA,CAAA,MAAA,EAAA;AAAMJ,QAAAA,SAAS,EAAC,uBAAuB;QAAAM,QAAA,eACrCF,GAAA,CAACK,WAAW,EAAA;AAACX,UAAAA,EAAE,EAAEA,EAAG;AAACC,UAAAA,QAAQ,EAAEA,QAAS;UAAA,GAAKI;SAAW;AAC1D,OAAM,CACN,eAAAI,IAAA,CAACG,IAAI,EAAA;AACHC,QAAAA,EAAE,EAAC,MAAM;QACTC,IAAI,EAAEV,SAAS,GAAGW,UAAU,CAACC,eAAe,GAAGD,UAAU,CAACE,UAAW;AACrEf,QAAAA,SAAS,EAAC,gBAAgB;AAAAM,QAAAA,QAAA,GAEzBT,KAAK,EACLK,SAAS,iBAAIE,GAAA,CAACM,IAAI,EAAA;AAACC,UAAAA,EAAE,EAAC,MAAM;AAAAL,UAAAA,QAAA,EAAEJ;AAAS,SAAO,CAAC;AAAA,OAC5C,CACN,EAACD,MAAM,iBAAIG,GAAA,CAAA,MAAA,EAAA;AAAMJ,QAAAA,SAAS,EAAC,2BAA2B;AAAAM,QAAAA,QAAA,EAAEL;AAAM,OAAO,CAAC;KACjE;AACT,GAAK,CAAC;AAEV;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.js","sources":["../../src/radioGroup/RadioGroup.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport Radio from '../radio';\nimport { RadioProps } from '../radio/Radio';\nimport { useInputAttributes, WithInputAttributesProps } from '../inputs/contexts';\n\nexport type RadioGroupRadio<T extends string | number = string> = Omit<\n RadioProps<T>,\n 'name' | 'checked' | 'onChange' | 'className'\n>;\n\nexport interface RadioGroupProps<T extends string | number = string> {\n name: string;\n radios: readonly RadioGroupRadio<T>[];\n selectedValue?: T; // TODO: `NoInfer<T>` from TypeScript 5.4\n onChange: NonNullable<RadioProps<T>['onChange']>;\n UNSAFE_inputAttributes?: WithInputAttributesProps['inputAttributes'];\n}\n\nexport default function RadioGroup<T extends string | number = never>({\n name,\n radios,\n selectedValue: controlledValue,\n onChange,\n UNSAFE_inputAttributes,\n}: RadioGroupProps<T>) {\n const inputAttributes = useInputAttributes({ nonLabelable: true });\n\n const [uncontrolledValue, setUncontrolledValue] = useState(controlledValue);\n\n return radios.length > 0 ? (\n <div role=\"radiogroup\" {...inputAttributes} {...UNSAFE_inputAttributes}>\n {radios.map(({ value = '' as T, ...restProps }, index) => (\n <Radio\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n {...restProps}\n name={name}\n value={value}\n checked={value === uncontrolledValue}\n onChange={(nextValue) => {\n setUncontrolledValue(nextValue);\n onChange(nextValue);\n }}\n />\n ))}\n </div>\n ) : null;\n}\n"],"names":["RadioGroup","name","radios","selectedValue","controlledValue","onChange","UNSAFE_inputAttributes","inputAttributes","useInputAttributes","nonLabelable","uncontrolledValue","setUncontrolledValue","useState","length","_jsx","role","children","map","value","restProps","index","Radio","checked","nextValue"],"mappings":";;;;;;;;;AAmBc,SAAUA,UAAUA,CAAoC;EACpEC,IAAI;EACJC,MAAM;AACNC,EAAAA,aAAa,EAAEC,eAAe;EAC9BC,QAAQ;AACRC,EAAAA;AACmB,CAAA,EAAA;EACnB,MAAMC,eAAe,GAAGC,2BAAkB,CAAC;AAAEC,IAAAA,YAAY,EAAE;AAAM,GAAA,CAAC;EAElE,MAAM,CAACC,iBAAiB,EAAEC,oBAAoB,CAAC,GAAGC,cAAQ,CAACR,eAAe,CAAC;AAE3E,EAAA,OAAOF,MAAM,CAACW,MAAM,GAAG,CAAC,gBACtBC,cAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,IAAI,EAAC,YAAY;AAAA,IAAA,GAAKR,eAAe;AAAA,IAAA,GAAMD,sBAAsB;AAAAU,IAAAA,QAAA,EACnEd,MAAM,CAACe,GAAG,CAAC,CAAC;AAAEC,MAAAA,KAAK,GAAG,EAAO;MAAE,GAAGC;AAAS,KAAE,EAAEC,KAAK,kBACnDN,cAAA,CAACO;AACC;AAAA,MAAA;AAAA,MAAA,GAEIF,SAAS;AACblB,MAAAA,IAAI,EAAEA,IAAK;AACXiB,MAAAA,KAAK,EAAEA,KAAM;MACbI,OAAO,EAAEJ,KAAK,KAAKR,iBAAkB;MACrCL,QAAQ,EAAGkB,SAAS,IAAI;QACtBZ,oBAAoB,CAACY,SAAS,CAAC;QAC/BlB,QAAQ,CAACkB,SAAS,CAAC;AACrB;AAAE,KAAA,EARGH,KAQH,CAEL;GACE,CAAC,GACJ,IAAI;AACV;;;;"}
1
+ {"version":3,"file":"RadioGroup.js","sources":["../../src/radioGroup/RadioGroup.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport Radio from '../radio';\nimport { RadioProps } from '../radio/Radio';\nimport { useInputAttributes, WithInputAttributesProps } from '../inputs/contexts';\n\nexport type RadioGroupRadio<T extends string | number = string> = Omit<\n RadioProps<T>,\n 'name' | 'checked' | 'onChange' | 'className'\n>;\n\nexport interface RadioGroupProps<T extends string | number = string> {\n name: string;\n radios: readonly RadioGroupRadio<T>[];\n selectedValue?: T; // TODO: `NoInfer<T>` from TypeScript 5.4\n onChange: NonNullable<RadioProps<T>['onChange']>;\n UNSAFE_inputAttributes?: WithInputAttributesProps['inputAttributes'];\n}\n\nexport default function RadioGroup<T extends string | number = never>({\n name,\n radios,\n selectedValue: controlledValue,\n onChange,\n UNSAFE_inputAttributes,\n}: RadioGroupProps<T>) {\n const inputAttributes = useInputAttributes({ nonLabelable: true });\n\n const [uncontrolledValue, setUncontrolledValue] = useState(controlledValue);\n\n return radios.length > 0 ? (\n <div role=\"radiogroup\" {...inputAttributes} {...UNSAFE_inputAttributes}>\n {radios.map(({ value = '' as T, ...restProps }, index) => (\n <Radio\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n {...restProps}\n name={name}\n value={value}\n checked={value === uncontrolledValue}\n onChange={(nextValue) => {\n setUncontrolledValue(nextValue);\n onChange(nextValue);\n }}\n />\n ))}\n </div>\n ) : null;\n}\n"],"names":["RadioGroup","name","radios","selectedValue","controlledValue","onChange","UNSAFE_inputAttributes","inputAttributes","useInputAttributes","nonLabelable","uncontrolledValue","setUncontrolledValue","useState","length","_jsx","role","children","map","value","restProps","index","Radio","checked","nextValue"],"mappings":";;;;;;;;;AAmBc,SAAUA,UAAUA,CAAoC;EACpEC,IAAI;EACJC,MAAM;AACNC,EAAAA,aAAa,EAAEC,eAAe;EAC9BC,QAAQ;AACRC,EAAAA;AAAsB,CACH,EAAA;EACnB,MAAMC,eAAe,GAAGC,2BAAkB,CAAC;AAAEC,IAAAA,YAAY,EAAE;AAAI,GAAE,CAAC;EAElE,MAAM,CAACC,iBAAiB,EAAEC,oBAAoB,CAAC,GAAGC,cAAQ,CAACR,eAAe,CAAC;AAE3E,EAAA,OAAOF,MAAM,CAACW,MAAM,GAAG,CAAC,gBACtBC,cAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,IAAI,EAAC,YAAY;AAAA,IAAA,GAAKR,eAAe;AAAA,IAAA,GAAMD,sBAAsB;AAAAU,IAAAA,QAAA,EACnEd,MAAM,CAACe,GAAG,CAAC,CAAC;AAAEC,MAAAA,KAAK,GAAG,EAAO;MAAE,GAAGC;AAAS,KAAE,EAAEC,KAAK,kBACnDN,cAAA,CAACO;AACC;AAAA,MAAA;AAAA,MAAA,GAEIF,SAAS;AACblB,MAAAA,IAAI,EAAEA,IAAK;AACXiB,MAAAA,KAAK,EAAEA,KAAM;MACbI,OAAO,EAAEJ,KAAK,KAAKR,iBAAkB;MACrCL,QAAQ,EAAGkB,SAAS,IAAI;QACtBZ,oBAAoB,CAACY,SAAS,CAAC;QAC/BlB,QAAQ,CAACkB,SAAS,CAAC;AACrB,MAAA;AAAE,KAAA,EARGH,KAQH,CAEL;GACE,CAAC,GACJ,IAAI;AACV;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.mjs","sources":["../../src/radioGroup/RadioGroup.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport Radio from '../radio';\nimport { RadioProps } from '../radio/Radio';\nimport { useInputAttributes, WithInputAttributesProps } from '../inputs/contexts';\n\nexport type RadioGroupRadio<T extends string | number = string> = Omit<\n RadioProps<T>,\n 'name' | 'checked' | 'onChange' | 'className'\n>;\n\nexport interface RadioGroupProps<T extends string | number = string> {\n name: string;\n radios: readonly RadioGroupRadio<T>[];\n selectedValue?: T; // TODO: `NoInfer<T>` from TypeScript 5.4\n onChange: NonNullable<RadioProps<T>['onChange']>;\n UNSAFE_inputAttributes?: WithInputAttributesProps['inputAttributes'];\n}\n\nexport default function RadioGroup<T extends string | number = never>({\n name,\n radios,\n selectedValue: controlledValue,\n onChange,\n UNSAFE_inputAttributes,\n}: RadioGroupProps<T>) {\n const inputAttributes = useInputAttributes({ nonLabelable: true });\n\n const [uncontrolledValue, setUncontrolledValue] = useState(controlledValue);\n\n return radios.length > 0 ? (\n <div role=\"radiogroup\" {...inputAttributes} {...UNSAFE_inputAttributes}>\n {radios.map(({ value = '' as T, ...restProps }, index) => (\n <Radio\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n {...restProps}\n name={name}\n value={value}\n checked={value === uncontrolledValue}\n onChange={(nextValue) => {\n setUncontrolledValue(nextValue);\n onChange(nextValue);\n }}\n />\n ))}\n </div>\n ) : null;\n}\n"],"names":["RadioGroup","name","radios","selectedValue","controlledValue","onChange","UNSAFE_inputAttributes","inputAttributes","useInputAttributes","nonLabelable","uncontrolledValue","setUncontrolledValue","useState","length","_jsx","role","children","map","value","restProps","index","Radio","checked","nextValue"],"mappings":";;;;;AAmBc,SAAUA,UAAUA,CAAoC;EACpEC,IAAI;EACJC,MAAM;AACNC,EAAAA,aAAa,EAAEC,eAAe;EAC9BC,QAAQ;AACRC,EAAAA;AACmB,CAAA,EAAA;EACnB,MAAMC,eAAe,GAAGC,kBAAkB,CAAC;AAAEC,IAAAA,YAAY,EAAE;AAAM,GAAA,CAAC;EAElE,MAAM,CAACC,iBAAiB,EAAEC,oBAAoB,CAAC,GAAGC,QAAQ,CAACR,eAAe,CAAC;AAE3E,EAAA,OAAOF,MAAM,CAACW,MAAM,GAAG,CAAC,gBACtBC,GAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,IAAI,EAAC,YAAY;AAAA,IAAA,GAAKR,eAAe;AAAA,IAAA,GAAMD,sBAAsB;AAAAU,IAAAA,QAAA,EACnEd,MAAM,CAACe,GAAG,CAAC,CAAC;AAAEC,MAAAA,KAAK,GAAG,EAAO;MAAE,GAAGC;AAAS,KAAE,EAAEC,KAAK,kBACnDN,GAAA,CAACO;AACC;AAAA,MAAA;AAAA,MAAA,GAEIF,SAAS;AACblB,MAAAA,IAAI,EAAEA,IAAK;AACXiB,MAAAA,KAAK,EAAEA,KAAM;MACbI,OAAO,EAAEJ,KAAK,KAAKR,iBAAkB;MACrCL,QAAQ,EAAGkB,SAAS,IAAI;QACtBZ,oBAAoB,CAACY,SAAS,CAAC;QAC/BlB,QAAQ,CAACkB,SAAS,CAAC;AACrB;AAAE,KAAA,EARGH,KAQH,CAEL;GACE,CAAC,GACJ,IAAI;AACV;;;;"}
1
+ {"version":3,"file":"RadioGroup.mjs","sources":["../../src/radioGroup/RadioGroup.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport Radio from '../radio';\nimport { RadioProps } from '../radio/Radio';\nimport { useInputAttributes, WithInputAttributesProps } from '../inputs/contexts';\n\nexport type RadioGroupRadio<T extends string | number = string> = Omit<\n RadioProps<T>,\n 'name' | 'checked' | 'onChange' | 'className'\n>;\n\nexport interface RadioGroupProps<T extends string | number = string> {\n name: string;\n radios: readonly RadioGroupRadio<T>[];\n selectedValue?: T; // TODO: `NoInfer<T>` from TypeScript 5.4\n onChange: NonNullable<RadioProps<T>['onChange']>;\n UNSAFE_inputAttributes?: WithInputAttributesProps['inputAttributes'];\n}\n\nexport default function RadioGroup<T extends string | number = never>({\n name,\n radios,\n selectedValue: controlledValue,\n onChange,\n UNSAFE_inputAttributes,\n}: RadioGroupProps<T>) {\n const inputAttributes = useInputAttributes({ nonLabelable: true });\n\n const [uncontrolledValue, setUncontrolledValue] = useState(controlledValue);\n\n return radios.length > 0 ? (\n <div role=\"radiogroup\" {...inputAttributes} {...UNSAFE_inputAttributes}>\n {radios.map(({ value = '' as T, ...restProps }, index) => (\n <Radio\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n {...restProps}\n name={name}\n value={value}\n checked={value === uncontrolledValue}\n onChange={(nextValue) => {\n setUncontrolledValue(nextValue);\n onChange(nextValue);\n }}\n />\n ))}\n </div>\n ) : null;\n}\n"],"names":["RadioGroup","name","radios","selectedValue","controlledValue","onChange","UNSAFE_inputAttributes","inputAttributes","useInputAttributes","nonLabelable","uncontrolledValue","setUncontrolledValue","useState","length","_jsx","role","children","map","value","restProps","index","Radio","checked","nextValue"],"mappings":";;;;;AAmBc,SAAUA,UAAUA,CAAoC;EACpEC,IAAI;EACJC,MAAM;AACNC,EAAAA,aAAa,EAAEC,eAAe;EAC9BC,QAAQ;AACRC,EAAAA;AAAsB,CACH,EAAA;EACnB,MAAMC,eAAe,GAAGC,kBAAkB,CAAC;AAAEC,IAAAA,YAAY,EAAE;AAAI,GAAE,CAAC;EAElE,MAAM,CAACC,iBAAiB,EAAEC,oBAAoB,CAAC,GAAGC,QAAQ,CAACR,eAAe,CAAC;AAE3E,EAAA,OAAOF,MAAM,CAACW,MAAM,GAAG,CAAC,gBACtBC,GAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,IAAI,EAAC,YAAY;AAAA,IAAA,GAAKR,eAAe;AAAA,IAAA,GAAMD,sBAAsB;AAAAU,IAAAA,QAAA,EACnEd,MAAM,CAACe,GAAG,CAAC,CAAC;AAAEC,MAAAA,KAAK,GAAG,EAAO;MAAE,GAAGC;AAAS,KAAE,EAAEC,KAAK,kBACnDN,GAAA,CAACO;AACC;AAAA,MAAA;AAAA,MAAA,GAEIF,SAAS;AACblB,MAAAA,IAAI,EAAEA,IAAK;AACXiB,MAAAA,KAAK,EAAEA,KAAM;MACbI,OAAO,EAAEJ,KAAK,KAAKR,iBAAkB;MACrCL,QAAQ,EAAGkB,SAAS,IAAI;QACtBZ,oBAAoB,CAACY,SAAS,CAAC;QAC/BlB,QAAQ,CAACkB,SAAS,CAAC;AACrB,MAAA;AAAE,KAAA,EARGH,KAQH,CAEL;GACE,CAAC,GACJ,IAAI;AACV;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"RadioOption.js","sources":["../../src/radioOption/RadioOption.tsx"],"sourcesContent":["import Option from '../common/Option';\nimport RadioButton from '../common/RadioButton';\nimport { RadioButtonProps } from '../common/RadioButton/RadioButton';\n\nexport interface RadioOptionProps<T extends string | number = string>\n extends Required<Pick<RadioButtonProps<T>, 'id' | 'name' | 'onChange'>>,\n Omit<RadioButtonProps<T>, 'readOnly' | 'id' | 'name' | 'onChange'> {\n 'aria-label'?: string;\n media?: React.ReactNode;\n title: React.ReactNode;\n content?: React.ReactNode;\n complex?: boolean;\n showMediaCircle?: boolean;\n showMediaAtAllSizes?: boolean;\n isContainerAligned?: boolean;\n}\n\nfunction RadioOption<T extends string | number = ''>({\n 'aria-label': ariaLabel,\n media,\n title,\n content,\n id,\n name,\n checked,\n onChange,\n complex,\n disabled,\n value = '' as T,\n showMediaCircle,\n showMediaAtAllSizes,\n isContainerAligned,\n}: RadioOptionProps<T>) {\n return (\n <Option\n aria-label={ariaLabel}\n media={media}\n title={title}\n content={content}\n name={name}\n complex={complex}\n disabled={disabled}\n showMediaCircle={showMediaCircle}\n showMediaAtAllSizes={showMediaAtAllSizes}\n isContainerAligned={isContainerAligned}\n button={\n <RadioButton\n id={id}\n name={name}\n checked={checked}\n disabled={disabled}\n value={value}\n onChange={onChange}\n />\n }\n />\n );\n}\n\nexport default RadioOption;\n"],"names":["RadioOption","ariaLabel","media","title","content","id","name","checked","onChange","complex","disabled","value","showMediaCircle","showMediaAtAllSizes","isContainerAligned","_jsx","Option","button","RadioButton"],"mappings":";;;;;;;;AAiBA,SAASA,WAAWA,CAAiC;AACnD,EAAA,YAAY,EAAEC,SAAS;EACvBC,KAAK;EACLC,KAAK;EACLC,OAAO;EACPC,EAAE;EACFC,IAAI;EACJC,OAAO;EACPC,QAAQ;EACRC,OAAO;EACPC,QAAQ;AACRC,EAAAA,KAAK,GAAG,EAAO;EACfC,eAAe;EACfC,mBAAmB;AACnBC,EAAAA;AACoB,CAAA,EAAA;EACpB,oBACEC,cAAA,CAACC,cAAM,EAAA;AACL,IAAA,YAAA,EAAYf,SAAU;AACtBC,IAAAA,KAAK,EAAEA,KAAM;AACbC,IAAAA,KAAK,EAAEA,KAAM;AACbC,IAAAA,OAAO,EAAEA,OAAQ;AACjBE,IAAAA,IAAI,EAAEA,IAAK;AACXG,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,QAAQ,EAAEA,QAAS;AACnBE,IAAAA,eAAe,EAAEA,eAAgB;AACjCC,IAAAA,mBAAmB,EAAEA,mBAAoB;AACzCC,IAAAA,kBAAkB,EAAEA,kBAAmB;IACvCG,MAAM,eACJF,cAAA,CAACG,mBAAW,EAAA;AACVb,MAAAA,EAAE,EAAEA,EAAG;AACPC,MAAAA,IAAI,EAAEA,IAAK;AACXC,MAAAA,OAAO,EAAEA,OAAQ;AACjBG,MAAAA,QAAQ,EAAEA,QAAS;AACnBC,MAAAA,KAAK,EAAEA,KAAM;AACbH,MAAAA,QAAQ,EAAEA;KAEd;AAAC,GACD,CAAA;AAEN;;;;"}
1
+ {"version":3,"file":"RadioOption.js","sources":["../../src/radioOption/RadioOption.tsx"],"sourcesContent":["import Option from '../common/Option';\nimport RadioButton from '../common/RadioButton';\nimport { RadioButtonProps } from '../common/RadioButton/RadioButton';\n\nexport interface RadioOptionProps<T extends string | number = string>\n extends Required<Pick<RadioButtonProps<T>, 'id' | 'name' | 'onChange'>>,\n Omit<RadioButtonProps<T>, 'readOnly' | 'id' | 'name' | 'onChange'> {\n 'aria-label'?: string;\n media?: React.ReactNode;\n title: React.ReactNode;\n content?: React.ReactNode;\n complex?: boolean;\n showMediaCircle?: boolean;\n showMediaAtAllSizes?: boolean;\n isContainerAligned?: boolean;\n}\n\nfunction RadioOption<T extends string | number = ''>({\n 'aria-label': ariaLabel,\n media,\n title,\n content,\n id,\n name,\n checked,\n onChange,\n complex,\n disabled,\n value = '' as T,\n showMediaCircle,\n showMediaAtAllSizes,\n isContainerAligned,\n}: RadioOptionProps<T>) {\n return (\n <Option\n aria-label={ariaLabel}\n media={media}\n title={title}\n content={content}\n name={name}\n complex={complex}\n disabled={disabled}\n showMediaCircle={showMediaCircle}\n showMediaAtAllSizes={showMediaAtAllSizes}\n isContainerAligned={isContainerAligned}\n button={\n <RadioButton\n id={id}\n name={name}\n checked={checked}\n disabled={disabled}\n value={value}\n onChange={onChange}\n />\n }\n />\n );\n}\n\nexport default RadioOption;\n"],"names":["RadioOption","ariaLabel","media","title","content","id","name","checked","onChange","complex","disabled","value","showMediaCircle","showMediaAtAllSizes","isContainerAligned","_jsx","Option","button","RadioButton"],"mappings":";;;;;;;;AAiBA,SAASA,WAAWA,CAAiC;AACnD,EAAA,YAAY,EAAEC,SAAS;EACvBC,KAAK;EACLC,KAAK;EACLC,OAAO;EACPC,EAAE;EACFC,IAAI;EACJC,OAAO;EACPC,QAAQ;EACRC,OAAO;EACPC,QAAQ;AACRC,EAAAA,KAAK,GAAG,EAAO;EACfC,eAAe;EACfC,mBAAmB;AACnBC,EAAAA;AAAkB,CACE,EAAA;EACpB,oBACEC,cAAA,CAACC,cAAM,EAAA;AACL,IAAA,YAAA,EAAYf,SAAU;AACtBC,IAAAA,KAAK,EAAEA,KAAM;AACbC,IAAAA,KAAK,EAAEA,KAAM;AACbC,IAAAA,OAAO,EAAEA,OAAQ;AACjBE,IAAAA,IAAI,EAAEA,IAAK;AACXG,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,QAAQ,EAAEA,QAAS;AACnBE,IAAAA,eAAe,EAAEA,eAAgB;AACjCC,IAAAA,mBAAmB,EAAEA,mBAAoB;AACzCC,IAAAA,kBAAkB,EAAEA,kBAAmB;IACvCG,MAAM,eACJF,cAAA,CAACG,mBAAW,EAAA;AACVb,MAAAA,EAAE,EAAEA,EAAG;AACPC,MAAAA,IAAI,EAAEA,IAAK;AACXC,MAAAA,OAAO,EAAEA,OAAQ;AACjBG,MAAAA,QAAQ,EAAEA,QAAS;AACnBC,MAAAA,KAAK,EAAEA,KAAM;AACbH,MAAAA,QAAQ,EAAEA;KAAS;AAEtB,GAAA,CACD;AAEN;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"RadioOption.mjs","sources":["../../src/radioOption/RadioOption.tsx"],"sourcesContent":["import Option from '../common/Option';\nimport RadioButton from '../common/RadioButton';\nimport { RadioButtonProps } from '../common/RadioButton/RadioButton';\n\nexport interface RadioOptionProps<T extends string | number = string>\n extends Required<Pick<RadioButtonProps<T>, 'id' | 'name' | 'onChange'>>,\n Omit<RadioButtonProps<T>, 'readOnly' | 'id' | 'name' | 'onChange'> {\n 'aria-label'?: string;\n media?: React.ReactNode;\n title: React.ReactNode;\n content?: React.ReactNode;\n complex?: boolean;\n showMediaCircle?: boolean;\n showMediaAtAllSizes?: boolean;\n isContainerAligned?: boolean;\n}\n\nfunction RadioOption<T extends string | number = ''>({\n 'aria-label': ariaLabel,\n media,\n title,\n content,\n id,\n name,\n checked,\n onChange,\n complex,\n disabled,\n value = '' as T,\n showMediaCircle,\n showMediaAtAllSizes,\n isContainerAligned,\n}: RadioOptionProps<T>) {\n return (\n <Option\n aria-label={ariaLabel}\n media={media}\n title={title}\n content={content}\n name={name}\n complex={complex}\n disabled={disabled}\n showMediaCircle={showMediaCircle}\n showMediaAtAllSizes={showMediaAtAllSizes}\n isContainerAligned={isContainerAligned}\n button={\n <RadioButton\n id={id}\n name={name}\n checked={checked}\n disabled={disabled}\n value={value}\n onChange={onChange}\n />\n }\n />\n );\n}\n\nexport default RadioOption;\n"],"names":["RadioOption","ariaLabel","media","title","content","id","name","checked","onChange","complex","disabled","value","showMediaCircle","showMediaAtAllSizes","isContainerAligned","_jsx","Option","button","RadioButton"],"mappings":";;;;AAiBA,SAASA,WAAWA,CAAiC;AACnD,EAAA,YAAY,EAAEC,SAAS;EACvBC,KAAK;EACLC,KAAK;EACLC,OAAO;EACPC,EAAE;EACFC,IAAI;EACJC,OAAO;EACPC,QAAQ;EACRC,OAAO;EACPC,QAAQ;AACRC,EAAAA,KAAK,GAAG,EAAO;EACfC,eAAe;EACfC,mBAAmB;AACnBC,EAAAA;AACoB,CAAA,EAAA;EACpB,oBACEC,GAAA,CAACC,MAAM,EAAA;AACL,IAAA,YAAA,EAAYf,SAAU;AACtBC,IAAAA,KAAK,EAAEA,KAAM;AACbC,IAAAA,KAAK,EAAEA,KAAM;AACbC,IAAAA,OAAO,EAAEA,OAAQ;AACjBE,IAAAA,IAAI,EAAEA,IAAK;AACXG,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,QAAQ,EAAEA,QAAS;AACnBE,IAAAA,eAAe,EAAEA,eAAgB;AACjCC,IAAAA,mBAAmB,EAAEA,mBAAoB;AACzCC,IAAAA,kBAAkB,EAAEA,kBAAmB;IACvCG,MAAM,eACJF,GAAA,CAACG,WAAW,EAAA;AACVb,MAAAA,EAAE,EAAEA,EAAG;AACPC,MAAAA,IAAI,EAAEA,IAAK;AACXC,MAAAA,OAAO,EAAEA,OAAQ;AACjBG,MAAAA,QAAQ,EAAEA,QAAS;AACnBC,MAAAA,KAAK,EAAEA,KAAM;AACbH,MAAAA,QAAQ,EAAEA;KAEd;AAAC,GACD,CAAA;AAEN;;;;"}
1
+ {"version":3,"file":"RadioOption.mjs","sources":["../../src/radioOption/RadioOption.tsx"],"sourcesContent":["import Option from '../common/Option';\nimport RadioButton from '../common/RadioButton';\nimport { RadioButtonProps } from '../common/RadioButton/RadioButton';\n\nexport interface RadioOptionProps<T extends string | number = string>\n extends Required<Pick<RadioButtonProps<T>, 'id' | 'name' | 'onChange'>>,\n Omit<RadioButtonProps<T>, 'readOnly' | 'id' | 'name' | 'onChange'> {\n 'aria-label'?: string;\n media?: React.ReactNode;\n title: React.ReactNode;\n content?: React.ReactNode;\n complex?: boolean;\n showMediaCircle?: boolean;\n showMediaAtAllSizes?: boolean;\n isContainerAligned?: boolean;\n}\n\nfunction RadioOption<T extends string | number = ''>({\n 'aria-label': ariaLabel,\n media,\n title,\n content,\n id,\n name,\n checked,\n onChange,\n complex,\n disabled,\n value = '' as T,\n showMediaCircle,\n showMediaAtAllSizes,\n isContainerAligned,\n}: RadioOptionProps<T>) {\n return (\n <Option\n aria-label={ariaLabel}\n media={media}\n title={title}\n content={content}\n name={name}\n complex={complex}\n disabled={disabled}\n showMediaCircle={showMediaCircle}\n showMediaAtAllSizes={showMediaAtAllSizes}\n isContainerAligned={isContainerAligned}\n button={\n <RadioButton\n id={id}\n name={name}\n checked={checked}\n disabled={disabled}\n value={value}\n onChange={onChange}\n />\n }\n />\n );\n}\n\nexport default RadioOption;\n"],"names":["RadioOption","ariaLabel","media","title","content","id","name","checked","onChange","complex","disabled","value","showMediaCircle","showMediaAtAllSizes","isContainerAligned","_jsx","Option","button","RadioButton"],"mappings":";;;;AAiBA,SAASA,WAAWA,CAAiC;AACnD,EAAA,YAAY,EAAEC,SAAS;EACvBC,KAAK;EACLC,KAAK;EACLC,OAAO;EACPC,EAAE;EACFC,IAAI;EACJC,OAAO;EACPC,QAAQ;EACRC,OAAO;EACPC,QAAQ;AACRC,EAAAA,KAAK,GAAG,EAAO;EACfC,eAAe;EACfC,mBAAmB;AACnBC,EAAAA;AAAkB,CACE,EAAA;EACpB,oBACEC,GAAA,CAACC,MAAM,EAAA;AACL,IAAA,YAAA,EAAYf,SAAU;AACtBC,IAAAA,KAAK,EAAEA,KAAM;AACbC,IAAAA,KAAK,EAAEA,KAAM;AACbC,IAAAA,OAAO,EAAEA,OAAQ;AACjBE,IAAAA,IAAI,EAAEA,IAAK;AACXG,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,QAAQ,EAAEA,QAAS;AACnBE,IAAAA,eAAe,EAAEA,eAAgB;AACjCC,IAAAA,mBAAmB,EAAEA,mBAAoB;AACzCC,IAAAA,kBAAkB,EAAEA,kBAAmB;IACvCG,MAAM,eACJF,GAAA,CAACG,WAAW,EAAA;AACVb,MAAAA,EAAE,EAAEA,EAAG;AACPC,MAAAA,IAAI,EAAEA,IAAK;AACXC,MAAAA,OAAO,EAAEA,OAAQ;AACjBG,MAAAA,QAAQ,EAAEA,QAAS;AACnBC,MAAAA,KAAK,EAAEA,KAAM;AACbH,MAAAA,QAAQ,EAAEA;KAAS;AAEtB,GAAA,CACD;AAEN;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Section.js","sources":["../../src/section/Section.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { HTMLAttributes, PropsWithChildren } from 'react';\n\nimport { CommonProps } from '../common';\n\ntype SectionProps = PropsWithChildren<\n CommonProps & {\n as?: 'div' | 'fieldset' | 'section';\n withHorizontalPadding?: boolean;\n }\n> &\n Pick<HTMLAttributes<HTMLDivElement>, 'role' | 'aria-labelledby'>;\n\n/**\n *\n * Neptune Web: https://transferwise.github.io/neptune-web/components/content/Section\n *\n */\nconst Section = ({\n as: Element = 'div',\n children,\n className,\n withHorizontalPadding = false,\n role = undefined,\n ...restProps\n}: SectionProps) => {\n return (\n <Element\n className={clsx('np-section', className, {\n 'np-section--with-horizontal-padding': withHorizontalPadding,\n })}\n role={role}\n {...restProps}\n >\n {children}\n </Element>\n );\n};\n\nexport default Section;\n"],"names":["Section","as","Element","children","className","withHorizontalPadding","role","undefined","restProps","_jsx","clsx"],"mappings":";;;;;;;AAkBMA,MAAAA,OAAO,GAAGA,CAAC;EACfC,EAAE,EAAEC,OAAO,GAAG,KAAK;EACnBC,QAAQ;EACRC,SAAS;AACTC,EAAAA,qBAAqB,GAAG,KAAK;AAC7BC,EAAAA,IAAI,GAAGC,SAAS;EAChB,GAAGC;AACU,CAAA,KAAI;EACjB,oBACEC,cAAA,CAACP,OAAO,EAAA;AACNE,IAAAA,SAAS,EAAEM,SAAI,CAAC,YAAY,EAAEN,SAAS,EAAE;AACvC,MAAA,qCAAqC,EAAEC;KACxC,CAAE;AACHC,IAAAA,IAAI,EAAEA,IAAK;AAAA,IAAA,GACPE,SAAS;AAAAL,IAAAA,QAAA,EAEZA;AAAQ,GACF,CAAC;AAEd;;;;"}
1
+ {"version":3,"file":"Section.js","sources":["../../src/section/Section.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { HTMLAttributes, PropsWithChildren } from 'react';\n\nimport { CommonProps } from '../common';\n\ntype SectionProps = PropsWithChildren<\n CommonProps & {\n as?: 'div' | 'fieldset' | 'section';\n withHorizontalPadding?: boolean;\n }\n> &\n Pick<HTMLAttributes<HTMLDivElement>, 'role' | 'aria-labelledby'>;\n\n/**\n *\n * Neptune Web: https://transferwise.github.io/neptune-web/components/content/Section\n *\n */\nconst Section = ({\n as: Element = 'div',\n children,\n className,\n withHorizontalPadding = false,\n role = undefined,\n ...restProps\n}: SectionProps) => {\n return (\n <Element\n className={clsx('np-section', className, {\n 'np-section--with-horizontal-padding': withHorizontalPadding,\n })}\n role={role}\n {...restProps}\n >\n {children}\n </Element>\n );\n};\n\nexport default Section;\n"],"names":["Section","as","Element","children","className","withHorizontalPadding","role","undefined","restProps","_jsx","clsx"],"mappings":";;;;;;;AAkBA,MAAMA,OAAO,GAAGA,CAAC;EACfC,EAAE,EAAEC,OAAO,GAAG,KAAK;EACnBC,QAAQ;EACRC,SAAS;AACTC,EAAAA,qBAAqB,GAAG,KAAK;AAC7BC,EAAAA,IAAI,GAAGC,SAAS;EAChB,GAAGC;AAAS,CACC,KAAI;EACjB,oBACEC,cAAA,CAACP,OAAO,EAAA;AACNE,IAAAA,SAAS,EAAEM,SAAI,CAAC,YAAY,EAAEN,SAAS,EAAE;AACvC,MAAA,qCAAqC,EAAEC;KACxC,CAAE;AACHC,IAAAA,IAAI,EAAEA,IAAK;AAAA,IAAA,GACPE,SAAS;AAAAL,IAAAA,QAAA,EAEZA;AAAQ,GACF,CAAC;AAEd;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Section.mjs","sources":["../../src/section/Section.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { HTMLAttributes, PropsWithChildren } from 'react';\n\nimport { CommonProps } from '../common';\n\ntype SectionProps = PropsWithChildren<\n CommonProps & {\n as?: 'div' | 'fieldset' | 'section';\n withHorizontalPadding?: boolean;\n }\n> &\n Pick<HTMLAttributes<HTMLDivElement>, 'role' | 'aria-labelledby'>;\n\n/**\n *\n * Neptune Web: https://transferwise.github.io/neptune-web/components/content/Section\n *\n */\nconst Section = ({\n as: Element = 'div',\n children,\n className,\n withHorizontalPadding = false,\n role = undefined,\n ...restProps\n}: SectionProps) => {\n return (\n <Element\n className={clsx('np-section', className, {\n 'np-section--with-horizontal-padding': withHorizontalPadding,\n })}\n role={role}\n {...restProps}\n >\n {children}\n </Element>\n );\n};\n\nexport default Section;\n"],"names":["Section","as","Element","children","className","withHorizontalPadding","role","undefined","restProps","_jsx","clsx"],"mappings":";;;AAkBMA,MAAAA,OAAO,GAAGA,CAAC;EACfC,EAAE,EAAEC,OAAO,GAAG,KAAK;EACnBC,QAAQ;EACRC,SAAS;AACTC,EAAAA,qBAAqB,GAAG,KAAK;AAC7BC,EAAAA,IAAI,GAAGC,SAAS;EAChB,GAAGC;AACU,CAAA,KAAI;EACjB,oBACEC,GAAA,CAACP,OAAO,EAAA;AACNE,IAAAA,SAAS,EAAEM,IAAI,CAAC,YAAY,EAAEN,SAAS,EAAE;AACvC,MAAA,qCAAqC,EAAEC;KACxC,CAAE;AACHC,IAAAA,IAAI,EAAEA,IAAK;AAAA,IAAA,GACPE,SAAS;AAAAL,IAAAA,QAAA,EAEZA;AAAQ,GACF,CAAC;AAEd;;;;"}
1
+ {"version":3,"file":"Section.mjs","sources":["../../src/section/Section.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { HTMLAttributes, PropsWithChildren } from 'react';\n\nimport { CommonProps } from '../common';\n\ntype SectionProps = PropsWithChildren<\n CommonProps & {\n as?: 'div' | 'fieldset' | 'section';\n withHorizontalPadding?: boolean;\n }\n> &\n Pick<HTMLAttributes<HTMLDivElement>, 'role' | 'aria-labelledby'>;\n\n/**\n *\n * Neptune Web: https://transferwise.github.io/neptune-web/components/content/Section\n *\n */\nconst Section = ({\n as: Element = 'div',\n children,\n className,\n withHorizontalPadding = false,\n role = undefined,\n ...restProps\n}: SectionProps) => {\n return (\n <Element\n className={clsx('np-section', className, {\n 'np-section--with-horizontal-padding': withHorizontalPadding,\n })}\n role={role}\n {...restProps}\n >\n {children}\n </Element>\n );\n};\n\nexport default Section;\n"],"names":["Section","as","Element","children","className","withHorizontalPadding","role","undefined","restProps","_jsx","clsx"],"mappings":";;;AAkBA,MAAMA,OAAO,GAAGA,CAAC;EACfC,EAAE,EAAEC,OAAO,GAAG,KAAK;EACnBC,QAAQ;EACRC,SAAS;AACTC,EAAAA,qBAAqB,GAAG,KAAK;AAC7BC,EAAAA,IAAI,GAAGC,SAAS;EAChB,GAAGC;AAAS,CACC,KAAI;EACjB,oBACEC,GAAA,CAACP,OAAO,EAAA;AACNE,IAAAA,SAAS,EAAEM,IAAI,CAAC,YAAY,EAAEN,SAAS,EAAE;AACvC,MAAA,qCAAqC,EAAEC;KACxC,CAAE;AACHC,IAAAA,IAAI,EAAEA,IAAK;AAAA,IAAA,GACPE,SAAS;AAAAL,IAAAA,QAAA,EAEZA;AAAQ,GACF,CAAC;AAEd;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControl.js","sources":["../../src/segmentedControl/SegmentedControl.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { createRef, useEffect, useRef, useState } from 'react';\n\nimport Body from '../body';\nimport { Typography } from '../common';\n\ntype SegmentBase = { id: string; label: string; value: string };\n\ntype Segment = SegmentBase & { controls?: never };\ntype SegmentWithControls = SegmentBase & { controls: string };\n\nexport type Segments = readonly Segment[] | readonly SegmentWithControls[];\n\ntype SegmentedControlPropsBase = {\n name: string;\n value: string;\n mode: 'input' | 'view';\n onChange: (value: string) => void;\n};\n\ntype SegmentedControlViewProps = {\n mode: 'view';\n segments: readonly SegmentWithControls[];\n};\n\ntype SegmentedControlInputProps = {\n mode: 'input';\n segments: readonly Segment[];\n};\n\nexport type SegmentedControlProps = SegmentedControlPropsBase &\n (SegmentedControlViewProps | SegmentedControlInputProps);\n\nconst SegmentedControl = ({\n name,\n value,\n mode = 'input',\n segments,\n onChange,\n}: SegmentedControlProps) => {\n const [animate, setAnimate] = useState(false);\n\n const segmentsRef = useRef<HTMLDivElement>(null);\n\n if (segments.length > 3) {\n throw new Error(\n 'SegmentedControl only supports up to 3 segments. Please refer to: https://wise.design/components/segmented-control',\n );\n }\n\n const segmentsWithRefs = segments.map((segment) => ({\n ...segment,\n ref: createRef<HTMLLabelElement | HTMLButtonElement>(),\n }));\n\n const updateSegmentPosition = () => {\n const selectedSegmentRef = segmentsWithRefs.find((segment) => segment.value === value)?.ref;\n\n // We grab the active segments style object from the ref\n // and set the css variables to the selected segments width and x position.\n // This is so we can animate the highlight to the selected segment\n if (selectedSegmentRef?.current && segmentsRef.current) {\n const { style } = segmentsRef.current;\n style.setProperty('--segment-highlight-width', `${selectedSegmentRef.current.offsetWidth}px`);\n style.setProperty('--segment-highlight-x', `${selectedSegmentRef.current.offsetLeft}px`);\n }\n };\n\n useEffect(() => {\n setAnimate(true);\n updateSegmentPosition();\n\n const handleWindowSizeChange = () => {\n setAnimate(false);\n updateSegmentPosition();\n };\n\n window.addEventListener('resize', handleWindowSizeChange);\n return () => {\n window.removeEventListener('resize', handleWindowSizeChange);\n };\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [segmentsWithRefs, value]);\n\n return (\n <div\n ref={segmentsRef}\n data-testid=\"segmented-control\"\n className={clsx('segmented-control', {\n 'segmented-control--input': mode === 'input',\n })}\n >\n <div\n className={clsx('segmented-control__segments', {\n 'segmented-control__segments--no-animate': !animate,\n })}\n role={mode !== 'input' ? 'tablist' : undefined}\n >\n {segmentsWithRefs.map((segment) => {\n const onSelect = () => {\n setAnimate(true);\n onChange(segment.value);\n };\n return mode === 'input' ? (\n <label\n ref={segment.ref as React.MutableRefObject<HTMLLabelElement | null>}\n key={segment.id}\n htmlFor={segment.id}\n className={clsx('segmented-control__segment', {\n 'segmented-control__selected-segment': value === segment.value,\n })}\n >\n <input\n type=\"radio\"\n className=\"segmented-control__radio-input\"\n id={segment.id}\n name={name}\n value={segment.value}\n checked={value === segment.value}\n onChange={onSelect}\n />\n <Body\n className=\"segmented-control__text\"\n as=\"span\"\n type={\n value === segment.value ? Typography.BODY_DEFAULT_BOLD : Typography.BODY_DEFAULT\n }\n >\n {segment.label}\n </Body>\n </label>\n ) : (\n <button\n ref={segment.ref as React.MutableRefObject<HTMLButtonElement | null>}\n key={segment.id}\n type=\"button\"\n role=\"tab\"\n id={segment.id}\n aria-controls={segment.controls}\n aria-selected={value === segment.value}\n className={clsx('segmented-control__segment', 'segmented-control__button', {\n 'segmented-control__selected-segment': value === segment.value,\n })}\n onClick={onSelect}\n >\n <Body\n as=\"span\"\n className=\"segmented-control__text\"\n type={\n value === segment.value ? Typography.BODY_DEFAULT_BOLD : Typography.BODY_DEFAULT\n }\n >\n {segment.label}\n </Body>\n </button>\n );\n })}\n </div>\n </div>\n );\n};\n\nexport default SegmentedControl;\n"],"names":["SegmentedControl","name","value","mode","segments","onChange","animate","setAnimate","useState","segmentsRef","useRef","length","Error","segmentsWithRefs","map","segment","ref","createRef","updateSegmentPosition","selectedSegmentRef","find","current","style","setProperty","offsetWidth","offsetLeft","useEffect","handleWindowSizeChange","window","addEventListener","removeEventListener","_jsx","className","clsx","children","role","undefined","onSelect","_jsxs","htmlFor","id","type","checked","Body","as","Typography","BODY_DEFAULT_BOLD","BODY_DEFAULT","label","controls","onClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCMA,MAAAA,gBAAgB,GAAGA,CAAC;EACxBC,IAAI;EACJC,KAAK;AACLC,EAAAA,IAAI,GAAG,OAAO;EACdC,QAAQ;AACRC,EAAAA;AAAQ,CACc,KAAI;EAC1B,MAA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O,CAACyB,EAoBP,CACT;OACF;KACE;AACP,GAAK,CAAC;AAEV;;;;"}
1
+ {"version":3,"file":"SegmentedControl.js","sources":["../../src/segmentedControl/SegmentedControl.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { createRef, useEffect, useRef, useState } from 'react';\n\nimport Body from '../body';\nimport { Typography } from '../common';\n\ntype SegmentBase = { id: string; label: string; value: string };\n\ntype Segment = SegmentBase & { controls?: never };\ntype SegmentWithControls = SegmentBase & { controls: string };\n\nexport type Segments = readonly Segment[] | readonly SegmentWithControls[];\n\ntype SegmentedControlPropsBase = {\n name: string;\n value: string;\n mode: 'input' | 'view';\n onChange: (value: string) => void;\n};\n\ntype SegmentedControlViewProps = {\n mode: 'view';\n segments: readonly SegmentWithControls[];\n};\n\ntype SegmentedControlInputProps = {\n mode: 'input';\n segments: readonly Segment[];\n};\n\nexport type SegmentedControlProps = SegmentedControlPropsBase &\n (SegmentedControlViewProps | SegmentedControlInputProps);\n\nconst SegmentedControl = ({\n name,\n value,\n mode = 'input',\n segments,\n onChange,\n}: SegmentedControlProps) => {\n const [animate, setAnimate] = useState(false);\n\n const segmentsRef = useRef<HTMLDivElement>(null);\n\n if (segments.length > 3) {\n throw new Error(\n 'SegmentedControl only supports up to 3 segments. Please refer to: https://wise.design/components/segmented-control',\n );\n }\n\n const segmentsWithRefs = segments.map((segment) => ({\n ...segment,\n ref: createRef<HTMLLabelElement | HTMLButtonElement>(),\n }));\n\n const updateSegmentPosition = () => {\n const selectedSegmentRef = segmentsWithRefs.find((segment) => segment.value === value)?.ref;\n\n // We grab the active segments style object from the ref\n // and set the css variables to the selected segments width and x position.\n // This is so we can animate the highlight to the selected segment\n if (selectedSegmentRef?.current && segmentsRef.current) {\n const { style } = segmentsRef.current;\n style.setProperty('--segment-highlight-width', `${selectedSegmentRef.current.offsetWidth}px`);\n style.setProperty('--segment-highlight-x', `${selectedSegmentRef.current.offsetLeft}px`);\n }\n };\n\n useEffect(() => {\n setAnimate(true);\n updateSegmentPosition();\n\n const handleWindowSizeChange = () => {\n setAnimate(false);\n updateSegmentPosition();\n };\n\n window.addEventListener('resize', handleWindowSizeChange);\n return () => {\n window.removeEventListener('resize', handleWindowSizeChange);\n };\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [segmentsWithRefs, value]);\n\n return (\n <div\n ref={segmentsRef}\n data-testid=\"segmented-control\"\n className={clsx('segmented-control', {\n 'segmented-control--input': mode === 'input',\n })}\n >\n <div\n className={clsx('segmented-control__segments', {\n 'segmented-control__segments--no-animate': !animate,\n })}\n role={mode !== 'input' ? 'tablist' : undefined}\n >\n {segmentsWithRefs.map((segment) => {\n const onSelect = () => {\n setAnimate(true);\n onChange(segment.value);\n };\n return mode === 'input' ? (\n <label\n ref={segment.ref as React.MutableRefObject<HTMLLabelElement | null>}\n key={segment.id}\n htmlFor={segment.id}\n className={clsx('segmented-control__segment', {\n 'segmented-control__selected-segment': value === segment.value,\n })}\n >\n <input\n type=\"radio\"\n className=\"segmented-control__radio-input\"\n id={segment.id}\n name={name}\n value={segment.value}\n checked={value === segment.value}\n onChange={onSelect}\n />\n <Body\n className=\"segmented-control__text\"\n as=\"span\"\n type={\n value === segment.value ? Typography.BODY_DEFAULT_BOLD : Typography.BODY_DEFAULT\n }\n >\n {segment.label}\n </Body>\n </label>\n ) : (\n <button\n ref={segment.ref as React.MutableRefObject<HTMLButtonElement | null>}\n key={segment.id}\n type=\"button\"\n role=\"tab\"\n id={segment.id}\n aria-controls={segment.controls}\n aria-selected={value === segment.value}\n className={clsx('segmented-control__segment', 'segmented-control__button', {\n 'segmented-control__selected-segment': value === segment.value,\n })}\n onClick={onSelect}\n >\n <Body\n as=\"span\"\n className=\"segmented-control__text\"\n type={\n value === segment.value ? Typography.BODY_DEFAULT_BOLD : Typography.BODY_DEFAULT\n }\n >\n {segment.label}\n </Body>\n </button>\n );\n })}\n </div>\n </div>\n );\n};\n\nexport default SegmentedControl;\n"],"names":["SegmentedControl","name","value","mode","segments","onChange","animate","setAnimate","useState","segmentsRef","useRef","length","Error","segmentsWithRefs","map","segment","ref","createRef","updateSegmentPosition","selectedSegmentRef","find","current","style","setProperty","offsetWidth","offsetLeft","useEffect","handleWindowSizeChange","window","addEventListener","removeEventListener","_jsx","className","clsx","children","role","undefined","onSelect","_jsxs","htmlFor","id","type","checked","Body","as","Typography","BODY_DEFAULT_BOLD","BODY_DEFAULT","label","controls","onClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,MAAMA,gBAAgB,GAAGA,CAAC;EACxBC,IAAI;EACJC,KAAK;AACLC,EAAAA,IAAI,GAAG,OAAO;EACdC,QAAQ;AACRC,EAAAA;AAAQ,CACc,KAAI;EAC1B,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGC,cAAQ,CAAC,KAAK,CAAC;AAE7C,EAAA,MAAMC,WAAW,GAAGC,YAAM,CAAiB,IAAI,CAAC;AAEhD,EAAA,IAAIN,QAAQ,CAACO,MAAM,GAAG,CAAC,EAAE;AACvB,IAAA,MAAM,IAAIC,KAAK,CACb,oHAAoH,CACrH;AACH,EAAA;AAEA,EAAA,MAAMC,gBAAgB,GAAGT,QAAQ,CAACU,GAAG,CAAEC,OAAO,KAAM;AAClD,IAAA,GAAGA,OAAO;IACVC,GAAG,eAAEC,eAAS;AACf,GAAA,CAAC,CAAC;EAEH,MAAMC,qBAAqB,GAAGA,MAAK;AACjC,IAAA,MAAMC,kBAAkB,GAAGN,gBAAgB,CAACO,IAAI,CAAEL,OAAO,IAAKA,OAAO,CAACb,KAAK,KAAKA,KAAK,CAAC,EAAEc,GAAG;AAE3F;AACA;AACA;AACA,IAAA,IAAIG,kBAAkB,EAAEE,OAAO,IAAIZ,WAAW,CAACY,OAAO,EAAE;MACtD,MAAM;AAAEC,QAAAA;OAAO,GAAGb,WAAW,CAACY,OAAO;AACrCC,MAAAA,KAAK,CAACC,WAAW,CAAC,2BAA2B,EAAE,CAAA,EAAGJ,kBAAkB,CAACE,O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