@transferwise/components 46.165.5 → 46.167.0

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 (454) hide show
  1. package/build/Body/Body.js +2 -2
  2. package/build/Body/Body.js.map +1 -1
  3. package/build/Body/Body.mjs +2 -2
  4. package/build/Body/Body.mjs.map +1 -1
  5. package/build/Calendar/DayCalendar/Table/DayCalendarTable.js +1 -1
  6. package/build/Calendar/DayCalendar/Table/DayCalendarTable.js.map +1 -1
  7. package/build/Calendar/DayCalendar/Table/DayCalendarTable.mjs +1 -1
  8. package/build/Calendar/DayCalendar/Table/DayCalendarTable.mjs.map +1 -1
  9. package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.js +1 -1
  10. package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.js.map +1 -1
  11. package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.mjs +1 -1
  12. package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.mjs.map +1 -1
  13. package/build/Calendar/TableLink/TableLink.js +1 -1
  14. package/build/Calendar/TableLink/TableLink.js.map +1 -1
  15. package/build/Calendar/TableLink/TableLink.mjs +1 -1
  16. package/build/Calendar/TableLink/TableLink.mjs.map +1 -1
  17. package/build/CardContainer/CardContainer.js +34 -0
  18. package/build/CardContainer/CardContainer.js.map +1 -0
  19. package/build/CardContainer/CardContainer.mjs +30 -0
  20. package/build/CardContainer/CardContainer.mjs.map +1 -0
  21. package/build/CardWidget/CardWidget.js +98 -0
  22. package/build/CardWidget/CardWidget.js.map +1 -0
  23. package/build/CardWidget/CardWidget.mjs +94 -0
  24. package/build/CardWidget/CardWidget.mjs.map +1 -0
  25. package/build/CardWidget/CardWidgetAction.js +73 -0
  26. package/build/CardWidget/CardWidgetAction.js.map +1 -0
  27. package/build/CardWidget/CardWidgetAction.mjs +68 -0
  28. package/build/CardWidget/CardWidgetAction.mjs.map +1 -0
  29. package/build/Display/Display.js +3 -1
  30. package/build/Display/Display.js.map +1 -1
  31. package/build/Display/Display.mjs +3 -1
  32. package/build/Display/Display.mjs.map +1 -1
  33. package/build/ExpressiveMoneyInput/AmountInput/AmountInput.js +1 -1
  34. package/build/ExpressiveMoneyInput/AmountInput/AmountInput.js.map +1 -1
  35. package/build/ExpressiveMoneyInput/AmountInput/AmountInput.mjs +1 -1
  36. package/build/ExpressiveMoneyInput/AmountInput/AmountInput.mjs.map +1 -1
  37. package/build/FlowNavigation/AnimatedLabel/AnimatedLabel.js +1 -1
  38. package/build/FlowNavigation/AnimatedLabel/AnimatedLabel.js.map +1 -1
  39. package/build/FlowNavigation/AnimatedLabel/AnimatedLabel.mjs +1 -1
  40. package/build/FlowNavigation/AnimatedLabel/AnimatedLabel.mjs.map +1 -1
  41. package/build/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.js +2 -2
  42. package/build/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.js.map +1 -1
  43. package/build/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.mjs +2 -2
  44. package/build/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.mjs.map +1 -1
  45. package/build/Inputs/SelectInput/Option/SelectInputOption.js +1 -1
  46. package/build/Inputs/SelectInput/Option/SelectInputOption.js.map +1 -1
  47. package/build/Inputs/SelectInput/Option/SelectInputOption.mjs +1 -1
  48. package/build/Inputs/SelectInput/Option/SelectInputOption.mjs.map +1 -1
  49. package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.js +3 -3
  50. package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.js.map +1 -1
  51. package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.mjs +3 -3
  52. package/build/Inputs/SelectInput/OptionContent/SelectInputOptionContent.mjs.map +1 -1
  53. package/build/Inputs/SelectInput/Popover/SelectInputPopover.js +2 -2
  54. package/build/Inputs/SelectInput/Popover/SelectInputPopover.js.map +1 -1
  55. package/build/Inputs/SelectInput/Popover/SelectInputPopover.mjs +2 -2
  56. package/build/Inputs/SelectInput/Popover/SelectInputPopover.mjs.map +1 -1
  57. package/build/Label/Label.js +1 -1
  58. package/build/Label/Label.js.map +1 -1
  59. package/build/Label/Label.mjs +1 -1
  60. package/build/Label/Label.mjs.map +1 -1
  61. package/build/ListItem/ListItem.js +2 -0
  62. package/build/ListItem/ListItem.js.map +1 -1
  63. package/build/ListItem/ListItem.mjs +2 -0
  64. package/build/ListItem/ListItem.mjs.map +1 -1
  65. package/build/Stepper/Stepper.js +3 -2
  66. package/build/Stepper/Stepper.js.map +1 -1
  67. package/build/Stepper/Stepper.mjs +3 -2
  68. package/build/Stepper/Stepper.mjs.map +1 -1
  69. package/build/Table/Header/TableHeader.js +1 -1
  70. package/build/Table/Header/TableHeader.js.map +1 -1
  71. package/build/Table/Header/TableHeader.mjs +1 -1
  72. package/build/Table/Header/TableHeader.mjs.map +1 -1
  73. package/build/Tabs/Tab/Tab.js +1 -1
  74. package/build/Tabs/Tab/Tab.js.map +1 -1
  75. package/build/Tabs/Tab/Tab.mjs +1 -1
  76. package/build/Tabs/Tab/Tab.mjs.map +1 -1
  77. package/build/Tag/Tag.js +1 -1
  78. package/build/Tag/Tag.js.map +1 -1
  79. package/build/Tag/Tag.mjs +1 -1
  80. package/build/Tag/Tag.mjs.map +1 -1
  81. package/build/Title/Title.js +2 -2
  82. package/build/Title/Title.js.map +1 -1
  83. package/build/Title/Title.mjs +2 -2
  84. package/build/Title/Title.mjs.map +1 -1
  85. package/build/Typeahead/TypeaheadOption/TypeaheadOption.js +2 -2
  86. package/build/Typeahead/TypeaheadOption/TypeaheadOption.js.map +1 -1
  87. package/build/Typeahead/TypeaheadOption/TypeaheadOption.mjs +2 -2
  88. package/build/Typeahead/TypeaheadOption/TypeaheadOption.mjs.map +1 -1
  89. package/build/Upload/Steps/UploadImageStep/UploadImageStep.js +2 -2
  90. package/build/Upload/Steps/UploadImageStep/UploadImageStep.js.map +1 -1
  91. package/build/Upload/Steps/UploadImageStep/UploadImageStep.mjs +2 -2
  92. package/build/Upload/Steps/UploadImageStep/UploadImageStep.mjs.map +1 -1
  93. package/build/_deprecated/ActionButton/ActionButton.js +1 -1
  94. package/build/_deprecated/ActionButton/ActionButton.js.map +1 -1
  95. package/build/_deprecated/ActionButton/ActionButton.mjs +1 -1
  96. package/build/_deprecated/ActionButton/ActionButton.mjs.map +1 -1
  97. package/build/_deprecated/Avatar/Avatar.js +1 -1
  98. package/build/_deprecated/Avatar/Avatar.js.map +1 -1
  99. package/build/_deprecated/Avatar/Avatar.mjs +1 -1
  100. package/build/_deprecated/Avatar/Avatar.mjs.map +1 -1
  101. package/build/_deprecated/Select/Select.js +2 -2
  102. package/build/_deprecated/Select/Select.js.map +1 -1
  103. package/build/_deprecated/Select/Select.mjs +2 -2
  104. package/build/_deprecated/Select/Select.mjs.map +1 -1
  105. package/build/common/PropsValues/typography.js +6 -0
  106. package/build/common/PropsValues/typography.js.map +1 -1
  107. package/build/common/PropsValues/typography.mjs +6 -0
  108. package/build/common/PropsValues/typography.mjs.map +1 -1
  109. package/build/index.js +4 -0
  110. package/build/index.js.map +1 -1
  111. package/build/index.mjs +2 -0
  112. package/build/index.mjs.map +1 -1
  113. package/build/main.css +9245 -1899
  114. package/build/styles/Accordion/Accordion.css +7 -6
  115. package/build/styles/Body/Body.css +2 -1
  116. package/build/styles/Calendar/Calendar.css +5 -4
  117. package/build/styles/Calendar/TableLink/TableLink.css +5 -4
  118. package/build/styles/CardContainer/CardContainer.css +108 -0
  119. package/build/styles/CardWidget/CardWidget.css +78 -0
  120. package/build/styles/Chips/Chip/Chip.css +5 -3
  121. package/build/styles/Decision/Decision.css +4 -3
  122. package/build/styles/Emphasis/Emphasis.css +1 -1
  123. package/build/styles/ExpressiveMoneyInput/AmountInput/AmountInput.css +2 -1
  124. package/build/styles/ExpressiveMoneyInput/ExpressiveMoneyInput.css +2 -1
  125. package/build/styles/Inputs/Input/Input.css +98 -24
  126. package/build/styles/Inputs/TextArea/TextArea.css +98 -24
  127. package/build/styles/Label/Label.css +3 -0
  128. package/build/styles/ListItem/ListItem.css +8 -0
  129. package/build/styles/Markup/Markup.css +2 -2
  130. package/build/styles/MoneyInput/MoneyInput.css +9 -6
  131. package/build/styles/Nudge/Nudge.css +3 -3
  132. package/build/styles/Popover/Popover.css +30 -7
  133. package/build/styles/ProgressBar/ProgressBar.css +3 -2
  134. package/build/styles/Prompt/PrimitivePrompt/PrimitivePrompt.css +2 -1
  135. package/build/styles/Snackbar/Snackbar.css +1 -1
  136. package/build/styles/Table/Table.css +18 -8
  137. package/build/styles/Tabs/Tabs.css +3 -3
  138. package/build/styles/Tag/Tag.css +1 -1
  139. package/build/styles/Tile/Tile.css +4 -3
  140. package/build/styles/Typeahead/Typeahead.css +4 -2
  141. package/build/styles/UploadInput/UploadInput.css +1 -1
  142. package/build/styles/_deprecated/ActionButton/ActionButton.css +3 -4
  143. package/build/styles/_deprecated/Avatar/Avatar.css +2 -2
  144. package/build/styles/_deprecated/CriticalBanner/CriticalCommsBanner.css +2 -1
  145. package/build/styles/_deprecated/Select/Select.css +49 -14
  146. package/build/styles/_deprecated/Summary/Summary.css +2 -2
  147. package/build/styles/common/Circle/Circle.css +1 -1
  148. package/build/styles/common/Option/Option.css +4 -4
  149. package/build/styles/css/accordion.css +53 -11
  150. package/build/styles/css/badge.css +2 -2
  151. package/build/styles/css/button-groups.css +29 -6
  152. package/build/styles/css/buttons.css +35 -11
  153. package/build/styles/css/decision.css +53 -11
  154. package/build/styles/css/dropdowns.css +65 -18
  155. package/build/styles/css/droppable.css +28 -6
  156. package/build/styles/css/footer.css +41 -10
  157. package/build/styles/css/input-groups.css +249 -117
  158. package/build/styles/css/list-group.css +28 -8
  159. package/build/styles/css/modals.css +1 -1
  160. package/build/styles/css/navbar.css +92 -45
  161. package/build/styles/css/navs.css +8 -8
  162. package/build/styles/css/neptune-addons.css +15 -0
  163. package/build/styles/css/neptune-core.css +6230 -525
  164. package/build/styles/css/neptune.css +8790 -1768
  165. package/build/styles/css/panels.css +2 -2
  166. package/build/styles/css/popovers.css +64 -20
  167. package/build/styles/css/progress-bars.css +2 -2
  168. package/build/styles/css/sequences.css +14 -9
  169. package/build/styles/css/table.css +7 -7
  170. package/build/styles/css/tooltip.css +28 -6
  171. package/build/styles/less/legacy-variables.less +3 -3
  172. package/build/styles/less/neptune-tokens.less +0 -48
  173. package/build/styles/main.css +9245 -1899
  174. package/build/styles/props/neptune-tokens.css +805 -3
  175. package/build/styles/styles/less/accordion.css +53 -11
  176. package/build/styles/styles/less/badge.css +2 -2
  177. package/build/styles/styles/less/button-groups.css +29 -6
  178. package/build/styles/styles/less/buttons.css +35 -11
  179. package/build/styles/styles/less/decision.css +53 -11
  180. package/build/styles/styles/less/dropdowns.css +65 -18
  181. package/build/styles/styles/less/droppable.css +28 -6
  182. package/build/styles/styles/less/footer.css +41 -10
  183. package/build/styles/styles/less/forms/bootstrap-forms.css +153 -100
  184. package/build/styles/styles/less/forms/checkbox-radio.css +3 -3
  185. package/build/styles/styles/less/input-groups.css +249 -117
  186. package/build/styles/styles/less/list-group.css +28 -8
  187. package/build/styles/styles/less/modals.css +1 -1
  188. package/build/styles/styles/less/navbar.css +92 -45
  189. package/build/styles/styles/less/navs.css +8 -8
  190. package/build/styles/styles/less/neptune-addons.css +15 -0
  191. package/build/styles/styles/less/neptune-core.css +6230 -525
  192. package/build/styles/styles/less/neptune.css +8790 -1768
  193. package/build/styles/styles/less/panels.css +2 -2
  194. package/build/styles/styles/less/popovers.css +64 -20
  195. package/build/styles/styles/less/progress-bars.css +2 -2
  196. package/build/styles/styles/less/sequences.css +14 -9
  197. package/build/styles/styles/less/table.css +7 -7
  198. package/build/styles/styles/less/tooltip.css +28 -6
  199. package/build/types/Body/Body.d.ts +2 -2
  200. package/build/types/Body/Body.d.ts.map +1 -1
  201. package/build/types/CardContainer/CardContainer.d.ts +8 -0
  202. package/build/types/CardContainer/CardContainer.d.ts.map +1 -0
  203. package/build/types/CardContainer/CardContainer.types.d.ts +55 -0
  204. package/build/types/CardContainer/CardContainer.types.d.ts.map +1 -0
  205. package/build/types/CardContainer/_stories/helpers.d.ts +3 -0
  206. package/build/types/CardContainer/_stories/helpers.d.ts.map +1 -0
  207. package/build/types/CardContainer/index.d.ts +3 -0
  208. package/build/types/CardContainer/index.d.ts.map +1 -0
  209. package/build/types/CardWidget/CardWidget.d.ts +10 -0
  210. package/build/types/CardWidget/CardWidget.d.ts.map +1 -0
  211. package/build/types/CardWidget/CardWidget.types.d.ts +55 -0
  212. package/build/types/CardWidget/CardWidget.types.d.ts.map +1 -0
  213. package/build/types/CardWidget/CardWidgetAction.d.ts +54 -0
  214. package/build/types/CardWidget/CardWidgetAction.d.ts.map +1 -0
  215. package/build/types/CardWidget/index.d.ts +4 -0
  216. package/build/types/CardWidget/index.d.ts.map +1 -0
  217. package/build/types/Display/Display.d.ts.map +1 -1
  218. package/build/types/ExpressiveMoneyInput/AmountInput/AmountInput.d.ts.map +1 -1
  219. package/build/types/IconButton/IconButton.d.ts +1 -1
  220. package/build/types/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.d.ts.map +1 -1
  221. package/build/types/Inputs/SelectInput/Popover/SelectInputPopover.d.ts.map +1 -1
  222. package/build/types/ListItem/ListItem.d.ts +1 -1
  223. package/build/types/ListItem/ListItem.d.ts.map +1 -1
  224. package/build/types/MoneyInput/MoneyInput.d.ts +1 -1
  225. package/build/types/MoneyInput/MoneyInput.d.ts.map +1 -1
  226. package/build/types/Stepper/Stepper.d.ts.map +1 -1
  227. package/build/types/Tabs/Tab/Tab.d.ts.map +1 -1
  228. package/build/types/Title/Title.d.ts +2 -2
  229. package/build/types/Upload/Steps/UploadImageStep/UploadImageStep.d.ts +1 -1
  230. package/build/types/Upload/Steps/UploadImageStep/UploadImageStep.d.ts.map +1 -1
  231. package/build/types/UploadInput/UploadItem/UploadItemLink.d.ts +1 -1
  232. package/build/types/_deprecated/Select/Select.d.ts.map +1 -1
  233. package/build/types/common/PropsValues/typography.d.ts +13 -1
  234. package/build/types/common/PropsValues/typography.d.ts.map +1 -1
  235. package/build/types/index.d.ts +4 -0
  236. package/build/types/index.d.ts.map +1 -1
  237. package/package.json +4 -4
  238. package/src/Accordion/Accordion.css +7 -6
  239. package/src/Accordion/Accordion.less +7 -6
  240. package/src/Body/Body.css +2 -1
  241. package/src/Body/Body.less +2 -1
  242. package/src/Body/Body.test.tsx +13 -4
  243. package/src/Body/Body.tsx +4 -3
  244. package/src/Body/_stories/Body.test.story.tsx +42 -0
  245. package/src/Calendar/Calendar.css +5 -4
  246. package/src/Calendar/DayCalendar/Table/DayCalendarTable.tsx +2 -2
  247. package/src/Calendar/MonthCalendar/Table/MonthCalendarTable.tsx +1 -1
  248. package/src/Calendar/TableLink/TableLink.css +5 -4
  249. package/src/Calendar/TableLink/TableLink.less +5 -4
  250. package/src/Calendar/TableLink/TableLink.tsx +1 -1
  251. package/src/Calendar/_stories/Calendar.test.story.tsx +33 -0
  252. package/src/CardContainer/CardContainer.css +108 -0
  253. package/src/CardContainer/CardContainer.less +171 -0
  254. package/src/CardContainer/CardContainer.test.tsx +150 -0
  255. package/src/CardContainer/CardContainer.tsx +51 -0
  256. package/src/CardContainer/CardContainer.types.ts +62 -0
  257. package/src/CardContainer/_stories/CardContainer.story.tsx +167 -0
  258. package/src/CardContainer/_stories/CardContainer.test.story.tsx +103 -0
  259. package/src/CardContainer/_stories/helpers.tsx +50 -0
  260. package/src/CardContainer/index.ts +6 -0
  261. package/src/CardWidget/CardWidget.css +78 -0
  262. package/src/CardWidget/CardWidget.less +107 -0
  263. package/src/CardWidget/CardWidget.test.tsx +221 -0
  264. package/src/CardWidget/CardWidget.tsx +78 -0
  265. package/src/CardWidget/CardWidget.types.ts +63 -0
  266. package/src/CardWidget/CardWidgetAction.tsx +128 -0
  267. package/src/CardWidget/_stories/CardWidget.story.tsx +238 -0
  268. package/src/CardWidget/_stories/CardWidget.test.story.tsx +350 -0
  269. package/src/CardWidget/index.ts +3 -0
  270. package/src/Chips/Chip/Chip.css +5 -3
  271. package/src/Chips/Chip/Chip.less +3 -2
  272. package/src/CircularButton/_stories/CircularButton.story.tsx +6 -16
  273. package/src/DateInput/_stories/DateInput.rtl.test.story.tsx +45 -0
  274. package/src/Decision/Decision.css +4 -3
  275. package/src/Decision/Decision.less +4 -3
  276. package/src/DefinitionList/_stories/DefinitionList.story.tsx +1 -1
  277. package/src/Display/Display.test.tsx +43 -0
  278. package/src/Display/Display.tsx +11 -1
  279. package/src/Display/_stories/Display.story.tsx +36 -21
  280. package/src/Display/_stories/Display.test.story.tsx +108 -0
  281. package/src/Emphasis/Emphasis.css +1 -1
  282. package/src/Emphasis/Emphasis.less +1 -1
  283. package/src/ExpressiveMoneyInput/AmountInput/AmountInput.css +2 -1
  284. package/src/ExpressiveMoneyInput/AmountInput/AmountInput.less +2 -1
  285. package/src/ExpressiveMoneyInput/AmountInput/AmountInput.tsx +1 -4
  286. package/src/ExpressiveMoneyInput/ExpressiveMoneyInput.css +2 -1
  287. package/src/FlowNavigation/AnimatedLabel/AnimatedLabel.tsx +1 -1
  288. package/src/Inputs/Input/Input.css +98 -24
  289. package/src/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.tsx +4 -2
  290. package/src/Inputs/SelectInput/Option/SelectInputOption.tsx +1 -1
  291. package/src/Inputs/SelectInput/OptionContent/SelectInputOptionContent.tsx +3 -3
  292. package/src/Inputs/SelectInput/Popover/SelectInputPopover.tsx +6 -2
  293. package/src/Inputs/SelectInput/_stories/SelectInput.story.tsx +1 -1
  294. package/src/Inputs/TextArea/TextArea.css +98 -24
  295. package/src/Inputs/_common.less +16 -10
  296. package/src/Label/Label.css +3 -0
  297. package/src/Label/Label.less +8 -0
  298. package/src/Label/Label.tsx +1 -1
  299. package/src/ListItem/ListItem.css +8 -0
  300. package/src/ListItem/ListItem.less +8 -0
  301. package/src/ListItem/ListItem.test.tsx +20 -0
  302. package/src/ListItem/ListItem.tsx +3 -1
  303. package/src/ListItem/_stories/ListItem.layout.test.story.tsx +1 -1
  304. package/src/ListItem/_stories/ListItem.story.tsx +1 -1
  305. package/src/Markup/Markup.css +2 -2
  306. package/src/Markup/Markup.less +2 -2
  307. package/src/MoneyInput/MoneyInput.css +9 -6
  308. package/src/MoneyInput/MoneyInput.less +10 -7
  309. package/src/Nudge/Nudge.css +3 -3
  310. package/src/Nudge/Nudge.less +3 -3
  311. package/src/PocketSurface/_stories/PocketSurface.story.tsx +2 -2
  312. package/src/Popover/Popover.css +30 -7
  313. package/src/Popover/Popover.less +2 -2
  314. package/src/ProgressBar/ProgressBar.css +3 -2
  315. package/src/ProgressBar/ProgressBar.less +12 -11
  316. package/src/Prompt/CriticalBanner/_stories/CriticalBanner.docs.mdx +122 -0
  317. package/src/Prompt/CriticalBanner/_stories/CriticalBanner.story.tsx +0 -2
  318. package/src/Prompt/PrimitivePrompt/PrimitivePrompt.css +2 -1
  319. package/src/Prompt/PrimitivePrompt/PrimitivePrompt.less +2 -1
  320. package/src/SentimentSurface/_stories/SentimentSurface.story.tsx +1 -1
  321. package/src/Snackbar/Snackbar.css +1 -1
  322. package/src/Snackbar/Snackbar.less +1 -1
  323. package/src/Stepper/Stepper.tsx +4 -2
  324. package/src/Table/Header/TableHeader.tsx +1 -1
  325. package/src/Table/StatusText/TableStatusText.test.tsx +20 -5
  326. package/src/Table/Table.css +18 -8
  327. package/src/Table/Table.less +20 -9
  328. package/src/Tabs/Tab/Tab.tsx +11 -5
  329. package/src/Tabs/Tabs.css +3 -3
  330. package/src/Tabs/Tabs.less +3 -3
  331. package/src/Tag/Tag.css +1 -1
  332. package/src/Tag/Tag.less +1 -1
  333. package/src/Tag/Tag.tsx +1 -1
  334. package/src/Tag/_stories/Tag.story.tsx +1 -1
  335. package/src/Tile/Tile.css +4 -3
  336. package/src/Tile/Tile.less +4 -3
  337. package/src/Title/Title.test.tsx +22 -3
  338. package/src/Title/Title.tsx +2 -2
  339. package/src/Typeahead/Typeahead.css +4 -2
  340. package/src/Typeahead/Typeahead.less +2 -1
  341. package/src/Typeahead/TypeaheadOption/TypeaheadOption.tsx +2 -2
  342. package/src/Upload/Steps/UploadImageStep/UploadImageStep.tsx +4 -2
  343. package/src/UploadInput/UploadInput.css +1 -1
  344. package/src/UploadInput/UploadInput.less +7 -4
  345. package/src/_deprecated/ActionButton/ActionButton.css +3 -4
  346. package/src/_deprecated/ActionButton/ActionButton.less +4 -5
  347. package/src/_deprecated/ActionButton/ActionButton.tsx +1 -1
  348. package/src/_deprecated/Avatar/Avatar.css +2 -2
  349. package/src/_deprecated/Avatar/Avatar.less +2 -2
  350. package/src/_deprecated/Avatar/Avatar.tsx +1 -1
  351. package/src/_deprecated/CriticalBanner/CriticalCommsBanner.css +2 -1
  352. package/src/_deprecated/CriticalBanner/CriticalCommsBanner.less +2 -1
  353. package/src/_deprecated/NavigationOption/_stories/NavigationOption.story.tsx +6 -6
  354. package/src/_deprecated/Select/Select.css +49 -14
  355. package/src/_deprecated/Select/Select.less +14 -10
  356. package/src/_deprecated/Select/Select.test.tsx +16 -0
  357. package/src/_deprecated/Select/Select.tsx +6 -1
  358. package/src/_deprecated/Summary/Summary.css +2 -2
  359. package/src/_deprecated/Summary/Summary.less +2 -2
  360. package/src/common/Circle/Circle.css +1 -1
  361. package/src/common/Circle/Circle.less +1 -1
  362. package/src/common/Option/Option.css +4 -4
  363. package/src/common/Option/Option.less +4 -4
  364. package/src/common/PropsValues/typography.ts +20 -1
  365. package/src/index.ts +13 -0
  366. package/src/main.css +9245 -1899
  367. package/src/main.less +5 -2
  368. package/src/styles/less/accordion.css +53 -11
  369. package/src/styles/less/addons/_background-utilities.less +5 -0
  370. package/src/styles/less/badge.css +2 -2
  371. package/src/styles/less/badge.less +2 -2
  372. package/src/styles/less/button-groups.css +29 -6
  373. package/src/styles/less/button-groups.less +3 -2
  374. package/src/styles/less/buttons.css +35 -11
  375. package/src/styles/less/buttons.less +7 -7
  376. package/src/styles/less/core/_fonts.less +7 -75
  377. package/src/styles/less/core/_scaffolding.less +4 -4
  378. package/src/styles/less/core/_typography-utilities.less +3 -3
  379. package/src/styles/less/core/_typography.less +91 -236
  380. package/src/styles/less/core/fonts/_fonts-ar.less +86 -0
  381. package/src/styles/less/core/fonts/_fonts-base.less +99 -0
  382. package/src/styles/less/core/fonts/_fonts-he.less +8 -0
  383. package/src/styles/less/core/fonts/_fonts-ja.less +4247 -0
  384. package/src/styles/less/core/fonts/_fonts-ko.less +1079 -0
  385. package/src/styles/less/core/fonts/_fonts-th.less +8 -0
  386. package/src/styles/less/core/fonts/_fonts-zh.less +872 -0
  387. package/src/styles/less/decision.css +53 -11
  388. package/src/styles/less/decision.less +2 -2
  389. package/src/styles/less/dropdowns.css +65 -18
  390. package/src/styles/less/dropdowns.less +8 -7
  391. package/src/styles/less/droppable.css +28 -6
  392. package/src/styles/less/droppable.less +4 -4
  393. package/src/styles/less/footer.css +41 -10
  394. package/src/styles/less/footer.less +4 -3
  395. package/src/styles/less/forms/bootstrap-forms.css +153 -100
  396. package/src/styles/less/forms/bootstrap-forms.less +85 -72
  397. package/src/styles/less/forms/checkbox-radio.css +3 -3
  398. package/src/styles/less/forms/checkbox-radio.less +3 -3
  399. package/src/styles/less/input-groups.css +249 -117
  400. package/src/styles/less/input-groups.less +23 -9
  401. package/src/styles/less/list-group.css +28 -8
  402. package/src/styles/less/list-group.less +8 -5
  403. package/src/styles/less/mixins/_reset-text.less +1 -1
  404. package/src/styles/less/mixins/_text-emphasis.less +7 -1
  405. package/src/styles/less/modals.css +1 -1
  406. package/src/styles/less/modals.less +1 -1
  407. package/src/styles/less/navbar.css +92 -45
  408. package/src/styles/less/navbar.less +19 -19
  409. package/src/styles/less/navs.css +8 -8
  410. package/src/styles/less/navs.less +8 -8
  411. package/src/styles/less/neptune-addons.css +15 -0
  412. package/src/styles/less/neptune-core.css +6230 -525
  413. package/src/styles/less/neptune.bundle.less +4 -0
  414. package/src/styles/less/neptune.css +8790 -1768
  415. package/src/styles/less/panels.css +2 -2
  416. package/src/styles/less/panels.less +2 -2
  417. package/src/styles/less/popovers.css +64 -20
  418. package/src/styles/less/popovers.less +7 -7
  419. package/src/styles/less/progress-bars.css +2 -2
  420. package/src/styles/less/progress-bars.less +2 -2
  421. package/src/styles/less/sequences.css +14 -9
  422. package/src/styles/less/sequences.less +15 -10
  423. package/src/styles/less/table.css +7 -7
  424. package/src/styles/less/table.less +7 -7
  425. package/src/styles/less/tooltip.css +28 -6
  426. package/src/styles/less/tooltip.less +1 -1
  427. package/src/styles/variables/legacy-variables.less +3 -3
  428. package/build/styles/fonts/inter-cyrillic-ext-variable-wghtOnly-normal.woff2 +0 -0
  429. package/build/styles/fonts/inter-cyrillic-variable-wghtOnly-normal.woff2 +0 -0
  430. package/build/styles/fonts/inter-greek-ext-variable-wghtOnly-normal.woff2 +0 -0
  431. package/build/styles/fonts/inter-greek-variable-wghtOnly-normal.woff2 +0 -0
  432. package/build/styles/fonts/inter-latin-ext-variable-wghtOnly-normal.woff2 +0 -0
  433. package/build/styles/fonts/inter-latin-variable-wghtOnly-normal.woff2 +0 -0
  434. package/build/styles/fonts/inter-vietnamese-variable-wghtOnly-normal.woff2 +0 -0
  435. package/build/styles/fonts/rubik/rubik-body-cyrillic-330-normal.woff2 +0 -0
  436. package/build/styles/fonts/rubik/rubik-body-cyrillic-600-normal.woff2 +0 -0
  437. package/build/styles/fonts/rubik/rubik-body-cyrillic-ext-330-normal.woff2 +0 -0
  438. package/build/styles/fonts/rubik/rubik-body-cyrillic-ext-600-normal.woff2 +0 -0
  439. package/build/styles/fonts/rubik/rubik-cyrillic-900-normal.woff2 +0 -0
  440. package/build/styles/fonts/rubik/rubik-cyrillic-ext-900-normal.woff2 +0 -0
  441. package/src/FlowNavigation/_stories/FlowNavigation.CriticalBanner.docs.mdx +0 -66
  442. package/src/styles/fonts/inter-cyrillic-ext-variable-wghtOnly-normal.woff2 +0 -0
  443. package/src/styles/fonts/inter-cyrillic-variable-wghtOnly-normal.woff2 +0 -0
  444. package/src/styles/fonts/inter-greek-ext-variable-wghtOnly-normal.woff2 +0 -0
  445. package/src/styles/fonts/inter-greek-variable-wghtOnly-normal.woff2 +0 -0
  446. package/src/styles/fonts/inter-latin-ext-variable-wghtOnly-normal.woff2 +0 -0
  447. package/src/styles/fonts/inter-latin-variable-wghtOnly-normal.woff2 +0 -0
  448. package/src/styles/fonts/inter-vietnamese-variable-wghtOnly-normal.woff2 +0 -0
  449. package/src/styles/fonts/rubik/rubik-body-cyrillic-330-normal.woff2 +0 -0
  450. package/src/styles/fonts/rubik/rubik-body-cyrillic-600-normal.woff2 +0 -0
  451. package/src/styles/fonts/rubik/rubik-body-cyrillic-ext-330-normal.woff2 +0 -0
  452. package/src/styles/fonts/rubik/rubik-body-cyrillic-ext-600-normal.woff2 +0 -0
  453. package/src/styles/fonts/rubik/rubik-cyrillic-900-normal.woff2 +0 -0
  454. package/src/styles/fonts/rubik/rubik-cyrillic-ext-900-normal.woff2 +0 -0
@@ -0,0 +1,98 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var icons = require('@transferwise/icons');
6
+ var clsx = require('clsx');
7
+ var React = require('react');
8
+ var CardContainer = require('../CardContainer/CardContainer.js');
9
+ require('../common/theme.js');
10
+ require('../common/direction.js');
11
+ require('@transferwise/neptune-tokens');
12
+ require('../common/PropsValues/control.js');
13
+ require('../common/PropsValues/size.js');
14
+ var typography = require('../common/PropsValues/typography.js');
15
+ require('../common/PropsValues/width.js');
16
+ require('../common/PropsValues/type.js');
17
+ require('../common/PropsValues/dateMode.js');
18
+ require('../common/PropsValues/monthFormat.js');
19
+ require('../common/PropsValues/position.js');
20
+ require('../common/PropsValues/layouts.js');
21
+ require('../common/PropsValues/status.js');
22
+ require('../common/PropsValues/sentiment.js');
23
+ require('../common/PropsValues/profileType.js');
24
+ require('../common/PropsValues/variant.js');
25
+ require('../common/PropsValues/scroll.js');
26
+ require('../common/PropsValues/markdownNodeType.js');
27
+ require('../common/fileType.js');
28
+ require('@transferwise/formatting');
29
+ require('react-intl');
30
+ require('../common/CloseButton/CloseButton.messages.js');
31
+ var jsxRuntime = require('react/jsx-runtime');
32
+ var Link = require('../Link/Link.js');
33
+ var Title = require('../Title/Title.js');
34
+ var CardWidgetAction = require('./CardWidgetAction.js');
35
+
36
+ const renderAction = (action, slot) => CardWidgetAction.isCardWidgetActionButton(action) ? /*#__PURE__*/jsxRuntime.jsx(CardWidgetAction.default, {
37
+ action: action,
38
+ slot: slot
39
+ }) : action;
40
+ const CardWidgetHeaderComponent = ({
41
+ title,
42
+ as = 'h3',
43
+ titleAction,
44
+ action,
45
+ actionSecondary
46
+ }) => /*#__PURE__*/jsxRuntime.jsxs("div", {
47
+ className: "wds-card-widget__header",
48
+ children: [/*#__PURE__*/jsxRuntime.jsx(Title.default, {
49
+ as: as,
50
+ type: typography.Typography.TITLE_GROUP,
51
+ className: "wds-card-widget__title",
52
+ children: titleAction ? /*#__PURE__*/jsxRuntime.jsxs(Link.default, {
53
+ href: titleAction.href,
54
+ target: titleAction.target,
55
+ className: "wds-card-widget__title-link",
56
+ onClick: titleAction.onClick,
57
+ children: [title, /*#__PURE__*/jsxRuntime.jsxs("span", {
58
+ className: "wds-card-widget__title-chevron",
59
+ "aria-hidden": true,
60
+ children: ['\u2060', /*#__PURE__*/jsxRuntime.jsx(icons.ChevronEnd, {
61
+ size: 16
62
+ })]
63
+ })]
64
+ }) : title
65
+ }), (action || actionSecondary) && /*#__PURE__*/jsxRuntime.jsxs("div", {
66
+ className: "wds-card-widget__actions",
67
+ children: [actionSecondary && renderAction(actionSecondary, 'actionSecondary'), action && renderAction(action, 'action')]
68
+ })]
69
+ });
70
+ /**
71
+ * A `CardContainer` with an optional header — a title, a title link and up to two actions — above
72
+ * its content. The card shows as hovered or pressed while the title link is, and as hovered while
73
+ * the link has keyboard focus. Hovering or pressing the rest of the card, or its actions, leaves it
74
+ * at rest.
75
+ */
76
+ const CardWidget = /*#__PURE__*/React.forwardRef(({
77
+ header,
78
+ children,
79
+ className,
80
+ ...props
81
+ }, ref) => /*#__PURE__*/jsxRuntime.jsxs(CardContainer.default, {
82
+ ref: ref,
83
+ className: clsx.clsx('wds-card-widget', header && 'wds-card-widget--with-header', className),
84
+ ...props,
85
+ // The widget's states follow its title link alone, so the card's own are left off.
86
+ interactive: false,
87
+ padding: "md",
88
+ children: [header && /*#__PURE__*/jsxRuntime.jsx(CardWidgetHeaderComponent, {
89
+ ...header
90
+ }), children != null && /*#__PURE__*/jsxRuntime.jsx("div", {
91
+ className: "wds-card-widget__content",
92
+ children: children
93
+ })]
94
+ }));
95
+ CardWidget.displayName = 'CardWidget';
96
+
97
+ exports.default = CardWidget;
98
+ //# sourceMappingURL=CardWidget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardWidget.js","sources":["../../src/CardWidget/CardWidget.tsx"],"sourcesContent":["import { ChevronEnd } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { forwardRef } from 'react';\n\nimport CardContainer from '../CardContainer';\nimport { Typography } from '../common';\nimport Link from '../Link';\nimport Title from '../Title';\nimport type { CardWidgetHeader, CardWidgetProps } from './CardWidget.types';\nimport CardWidgetAction, {\n isCardWidgetActionButton,\n type CardWidgetActionSlot,\n} from './CardWidgetAction';\n\nconst renderAction = (action: CardWidgetHeader['action'], slot: CardWidgetActionSlot) =>\n isCardWidgetActionButton(action) ? <CardWidgetAction action={action} slot={slot} /> : action;\n\nconst CardWidgetHeaderComponent = ({\n title,\n as = 'h3',\n titleAction,\n action,\n actionSecondary,\n}: CardWidgetHeader) => (\n <div className=\"wds-card-widget__header\">\n <Title as={as} type={Typography.TITLE_GROUP} className=\"wds-card-widget__title\">\n {titleAction ? (\n <Link\n href={titleAction.href}\n target={titleAction.target}\n className=\"wds-card-widget__title-link\"\n onClick={titleAction.onClick}\n >\n {title}\n {/* The word joiner keeps the chevron on the title's last line instead of wrapping alone. */}\n <span className=\"wds-card-widget__title-chevron\" aria-hidden>\n {'\\u2060'}\n <ChevronEnd size={16} />\n </span>\n </Link>\n ) : (\n title\n )}\n </Title>\n {(action || actionSecondary) && (\n <div className=\"wds-card-widget__actions\">\n {actionSecondary && renderAction(actionSecondary, 'actionSecondary')}\n {action && renderAction(action, 'action')}\n </div>\n )}\n </div>\n);\n\n/**\n * A `CardContainer` with an optional header — a title, a title link and up to two actions — above\n * its content. The card shows as hovered or pressed while the title link is, and as hovered while\n * the link has keyboard focus. Hovering or pressing the rest of the card, or its actions, leaves it\n * at rest.\n */\nconst CardWidget = forwardRef<HTMLElement, CardWidgetProps>(\n ({ header, children, className, ...props }, ref) => (\n <CardContainer\n ref={ref}\n className={clsx('wds-card-widget', header && 'wds-card-widget--with-header', className)}\n {...props}\n // The widget's states follow its title link alone, so the card's own are left off.\n interactive={false}\n padding=\"md\"\n >\n {header && <CardWidgetHeaderComponent {...header} />}\n {children != null && <div className=\"wds-card-widget__content\">{children}</div>}\n </CardContainer>\n ),\n);\n\nCardWidget.displayName = 'CardWidget';\n\nexport default CardWidget;\n"],"names":["renderAction","action","slot","isCardWidgetActionButton","_jsx","CardWidgetAction","CardWidgetHeaderComponent","title","as","titleAction","actionSecondary","_jsxs","className","children","Title","type","Typography","TITLE_GROUP","Link","href","target","onClick","ChevronEnd","size","CardWidget","forwardRef","header","props","ref","CardContainer","clsx","interactive","padding","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAMA,YAAY,GAAGA,CAACC,MAAkC,EAAEC,IAA0B,KAClFC,yCAAwB,CAACF,MAAM,CAAC,gBAAGG,cAAA,CAACC,wBAAgB,EAAA;AAACJ,EAAAA,MAAM,EAAEA,MAAO;AAACC,EAAAA,IAAI,EAAEA;AAAK,CAAA,CAAG,GAAGD,MAAM;AAE9F,MAAMK,yBAAyB,GAAGA,CAAC;EACjCC,KAAK;AACLC,EAAAA,EAAE,GAAG,IAAI;EACTC,WAAW;EACXR,MAAM;AACNS,EAAAA;AAAe,CACE,kBACjBC,eAAA,CAAA,KAAA,EAAA;AAAKC,EAAAA,SAAS,EAAC,yBAAyB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,CAAE;AAAA,EAAA,GACpFe,KAAK;AACT;AACAI,EAAAA,WAAW,EAAE,KAAM;AACnBC,EAAAA,OAAO,EAAC,IAAI;AAAAnB,EAAAA,QAAA,EAAA,CAEXa,MAAM,iBAAItB,cAAA,CAACE,yBAAyB,EAAA;IAAA,GAAKoB;AAAM,GAAC,CAAG,EACnDb,QAAQ,IAAI,IAAI,iBAAIT,cAAA,CAAA,KAAA,EAAA;AAAKQ,IAAAA,SAAS,EAAC,0BAA0B;AAAAC,IAAAA,QAAA,EAAEA;AAAQ,GAAM,CAAC;AAAA,CAClE,CAChB;AAGHW,UAAU,CAACS,WAAW,GAAG,YAAY;;"}
@@ -0,0 +1,94 @@
1
+ import { ChevronEnd } from '@transferwise/icons';
2
+ import { clsx } from 'clsx';
3
+ import { forwardRef } from 'react';
4
+ import CardContainer from '../CardContainer/CardContainer.mjs';
5
+ import '../common/theme.mjs';
6
+ import '../common/direction.mjs';
7
+ import '@transferwise/neptune-tokens';
8
+ import '../common/PropsValues/control.mjs';
9
+ import '../common/PropsValues/size.mjs';
10
+ import { Typography } from '../common/PropsValues/typography.mjs';
11
+ import '../common/PropsValues/width.mjs';
12
+ import '../common/PropsValues/type.mjs';
13
+ import '../common/PropsValues/dateMode.mjs';
14
+ import '../common/PropsValues/monthFormat.mjs';
15
+ import '../common/PropsValues/position.mjs';
16
+ import '../common/PropsValues/layouts.mjs';
17
+ import '../common/PropsValues/status.mjs';
18
+ import '../common/PropsValues/sentiment.mjs';
19
+ import '../common/PropsValues/profileType.mjs';
20
+ import '../common/PropsValues/variant.mjs';
21
+ import '../common/PropsValues/scroll.mjs';
22
+ import '../common/PropsValues/markdownNodeType.mjs';
23
+ import '../common/fileType.mjs';
24
+ import '@transferwise/formatting';
25
+ import 'react-intl';
26
+ import '../common/CloseButton/CloseButton.messages.mjs';
27
+ import { jsxs, jsx } from 'react/jsx-runtime';
28
+ import Link from '../Link/Link.mjs';
29
+ import Title from '../Title/Title.mjs';
30
+ import CardWidgetAction, { isCardWidgetActionButton } from './CardWidgetAction.mjs';
31
+
32
+ const renderAction = (action, slot) => isCardWidgetActionButton(action) ? /*#__PURE__*/jsx(CardWidgetAction, {
33
+ action: action,
34
+ slot: slot
35
+ }) : action;
36
+ const CardWidgetHeaderComponent = ({
37
+ title,
38
+ as = 'h3',
39
+ titleAction,
40
+ action,
41
+ actionSecondary
42
+ }) => /*#__PURE__*/jsxs("div", {
43
+ className: "wds-card-widget__header",
44
+ children: [/*#__PURE__*/jsx(Title, {
45
+ as: as,
46
+ type: Typography.TITLE_GROUP,
47
+ className: "wds-card-widget__title",
48
+ children: titleAction ? /*#__PURE__*/jsxs(Link, {
49
+ href: titleAction.href,
50
+ target: titleAction.target,
51
+ className: "wds-card-widget__title-link",
52
+ onClick: titleAction.onClick,
53
+ children: [title, /*#__PURE__*/jsxs("span", {
54
+ className: "wds-card-widget__title-chevron",
55
+ "aria-hidden": true,
56
+ children: ['\u2060', /*#__PURE__*/jsx(ChevronEnd, {
57
+ size: 16
58
+ })]
59
+ })]
60
+ }) : title
61
+ }), (action || actionSecondary) && /*#__PURE__*/jsxs("div", {
62
+ className: "wds-card-widget__actions",
63
+ children: [actionSecondary && renderAction(actionSecondary, 'actionSecondary'), action && renderAction(action, 'action')]
64
+ })]
65
+ });
66
+ /**
67
+ * A `CardContainer` with an optional header — a title, a title link and up to two actions — above
68
+ * its content. The card shows as hovered or pressed while the title link is, and as hovered while
69
+ * the link has keyboard focus. Hovering or pressing the rest of the card, or its actions, leaves it
70
+ * at rest.
71
+ */
72
+ const CardWidget = /*#__PURE__*/forwardRef(({
73
+ header,
74
+ children,
75
+ className,
76
+ ...props
77
+ }, ref) => /*#__PURE__*/jsxs(CardContainer, {
78
+ ref: ref,
79
+ className: clsx('wds-card-widget', header && 'wds-card-widget--with-header', className),
80
+ ...props,
81
+ // The widget's states follow its title link alone, so the card's own are left off.
82
+ interactive: false,
83
+ padding: "md",
84
+ children: [header && /*#__PURE__*/jsx(CardWidgetHeaderComponent, {
85
+ ...header
86
+ }), children != null && /*#__PURE__*/jsx("div", {
87
+ className: "wds-card-widget__content",
88
+ children: children
89
+ })]
90
+ }));
91
+ CardWidget.displayName = 'CardWidget';
92
+
93
+ export { CardWidget as default };
94
+ //# sourceMappingURL=CardWidget.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardWidget.mjs","sources":["../../src/CardWidget/CardWidget.tsx"],"sourcesContent":["import { ChevronEnd } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { forwardRef } from 'react';\n\nimport CardContainer from '../CardContainer';\nimport { Typography } from '../common';\nimport Link from '../Link';\nimport Title from '../Title';\nimport type { CardWidgetHeader, CardWidgetProps } from './CardWidget.types';\nimport CardWidgetAction, {\n isCardWidgetActionButton,\n type CardWidgetActionSlot,\n} from './CardWidgetAction';\n\nconst renderAction = (action: CardWidgetHeader['action'], slot: CardWidgetActionSlot) =>\n isCardWidgetActionButton(action) ? <CardWidgetAction action={action} slot={slot} /> : action;\n\nconst CardWidgetHeaderComponent = ({\n title,\n as = 'h3',\n titleAction,\n action,\n actionSecondary,\n}: CardWidgetHeader) => (\n <div className=\"wds-card-widget__header\">\n <Title as={as} type={Typography.TITLE_GROUP} className=\"wds-card-widget__title\">\n {titleAction ? (\n <Link\n href={titleAction.href}\n target={titleAction.target}\n className=\"wds-card-widget__title-link\"\n onClick={titleAction.onClick}\n >\n {title}\n {/* The word joiner keeps the chevron on the title's last line instead of wrapping alone. */}\n <span className=\"wds-card-widget__title-chevron\" aria-hidden>\n {'\\u2060'}\n <ChevronEnd size={16} />\n </span>\n </Link>\n ) : (\n title\n )}\n </Title>\n {(action || actionSecondary) && (\n <div className=\"wds-card-widget__actions\">\n {actionSecondary && renderAction(actionSecondary, 'actionSecondary')}\n {action && renderAction(action, 'action')}\n </div>\n )}\n </div>\n);\n\n/**\n * A `CardContainer` with an optional header — a title, a title link and up to two actions — above\n * its content. The card shows as hovered or pressed while the title link is, and as hovered while\n * the link has keyboard focus. Hovering or pressing the rest of the card, or its actions, leaves it\n * at rest.\n */\nconst CardWidget = forwardRef<HTMLElement, CardWidgetProps>(\n ({ header, children, className, ...props }, ref) => (\n <CardContainer\n ref={ref}\n className={clsx('wds-card-widget', header && 'wds-card-widget--with-header', className)}\n {...props}\n // The widget's states follow its title link alone, so the card's own are left off.\n interactive={false}\n padding=\"md\"\n >\n {header && <CardWidgetHeaderComponent {...header} />}\n {children != null && <div className=\"wds-card-widget__content\">{children}</div>}\n </CardContainer>\n ),\n);\n\nCardWidget.displayName = 'CardWidget';\n\nexport default CardWidget;\n"],"names":["renderAction","action","slot","isCardWidgetActionButton","_jsx","CardWidgetAction","CardWidgetHeaderComponent","title","as","titleAction","actionSecondary","_jsxs","className","children","Title","type","Typography","TITLE_GROUP","Link","href","target","onClick","ChevronEnd","size","CardWidget","forwardRef","header","props","ref","CardContainer","clsx","interactive","padding","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAMA,YAAY,GAAGA,CAACC,MAAkC,EAAEC,IAA0B,KAClFC,wBAAwB,CAACF,MAAM,CAAC,gBAAGG,GAAA,CAACC,gBAAgB,EAAA;AAACJ,EAAAA,MAAM,EAAEA,MAAO;AAACC,EAAAA,IAAI,EAAEA;AAAK,CAAA,CAAG,GAAGD,MAAM;AAE9F,MAAMK,yBAAyB,GAAGA,CAAC;EACjCC,KAAK;AACLC,EAAAA,EAAE,GAAG,IAAI;EACTC,WAAW;EACXR,MAAM;AACNS,EAAAA;AAAe,CACE,kBACjBC,IAAA,CAAA,KAAA,EAAA;AAAKC,EAAAA,SAAS,EAAC,yBAAyB;EAAAC,QAAA,EAAA,cACtCT,GAAA,CAACU,KAAK,EAAA;AAACN,IAAAA,EAAE,EAAEA,EAAG;IAACO,IAAI,EAAEC,UAAU,CAACC,WAAY;AAACL,IAAAA,SAAS,EAAC,wBAAwB;AAAAC,IAAAA,QAAA,EAC5EJ,WAAW,gBACVE,IAAA,CAACO,IAAI,EAAA;MACH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AAI,iBAAIT,GAAA,CAAA,KAAA,EAAA;AAAKQ,IAAAA,SAAS,EAAC,0BAA0B;AAAAC,IAAAA,QAAA,EAAEA;AAAQ,GAAM,CAAC;AAAA,CAClE,CAChB;AAGHW,UAAU,CAACS,WAAW,GAAG,YAAY;;"}
@@ -0,0 +1,73 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var Button_resolver = require('../Button/Button.resolver.js');
7
+ var IconButton = require('../IconButton/IconButton.js');
8
+ var jsxRuntime = require('react/jsx-runtime');
9
+
10
+ const BUTTON_PRIORITY = {
11
+ action: 'secondary',
12
+ actionSecondary: 'secondary-neutral'
13
+ };
14
+ const ICON_BUTTON_PRIORITY = {
15
+ action: 'secondary',
16
+ actionSecondary: 'tertiary'
17
+ };
18
+ /**
19
+ * Tells a `CardWidgetActionButton` object apart from any other node passed to an action slot.
20
+ * Every button action has a `label` or an `icon`, which no React element, portal or array does.
21
+ */
22
+ const isCardWidgetActionButton = value => typeof value === 'object' && value !== null && ! /*#__PURE__*/React.isValidElement(value) && !Array.isArray(value) && ('label' in value || 'icon' in value);
23
+ /** Renders a `CardWidgetActionButton` at the emphasis of the slot it was passed to. */
24
+ const CardWidgetAction = function CardWidgetAction({
25
+ action: {
26
+ label,
27
+ icon,
28
+ 'aria-label': ariaLabel,
29
+ 'data-testid': dataTestId,
30
+ href,
31
+ target,
32
+ onClick,
33
+ disabled
34
+ },
35
+ slot
36
+ }) {
37
+ if (label === undefined) {
38
+ return /*#__PURE__*/jsxRuntime.jsx(IconButton.default, {
39
+ size: 32,
40
+ priority: ICON_BUTTON_PRIORITY[slot],
41
+ "aria-label": ariaLabel,
42
+ href: href,
43
+ target: target,
44
+ disabled: disabled,
45
+ "data-testid": dataTestId,
46
+ onClick: onClick,
47
+ children: icon
48
+ });
49
+ }
50
+ return /*#__PURE__*/jsxRuntime.jsx(Button_resolver.default, {
51
+ v2: true,
52
+ size: "sm",
53
+ priority: BUTTON_PRIORITY[slot],
54
+ "aria-label": ariaLabel,
55
+ href: href,
56
+ target: target,
57
+ disabled: disabled,
58
+ addonEnd: icon ? {
59
+ type: 'icon',
60
+ value: icon
61
+ } : undefined
62
+ // The v2 resolver drops `Button`'s own `button` default, so an action would submit a form.
63
+ ,
64
+ type: "button",
65
+ "data-testid": dataTestId,
66
+ onClick: onClick,
67
+ children: label
68
+ });
69
+ };
70
+
71
+ exports.default = CardWidgetAction;
72
+ exports.isCardWidgetActionButton = isCardWidgetActionButton;
73
+ //# sourceMappingURL=CardWidgetAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardWidgetAction.js","sources":["../../src/CardWidget/CardWidgetAction.tsx"],"sourcesContent":["import { isValidElement, type MouseEventHandler, type ReactNode } from 'react';\n\nimport Button from '../Button';\nimport type { ButtonPriority, ButtonProps } from '../Button/Button.types';\nimport IconButton, { type IconButtonProps } from '../IconButton';\n\n/** The action slot a `CardWidgetActionButton` was passed to, which is what determines its emphasis. */\nexport type CardWidgetActionSlot = 'action' | 'actionSecondary';\n\ntype CardWidgetActionButtonBase = Pick<ButtonProps, 'href' | 'target' | 'disabled'> & {\n /**\n * `HTMLElement` rather than a narrower target, because an action is a `button` or an `a`\n * depending on whether `href` is set.\n * @default undefined\n */\n onClick?: MouseEventHandler<HTMLElement>;\n\n /**\n * Rendered after `label`, or as the only content of an unlabelled action.\n * Size it yourself — 16px is expected in both cases.\n * @default undefined\n */\n icon?: ReactNode;\n 'data-testid'?: string;\n};\n\n/** An action with a visible label, rendered as a small button. */\ntype CardWidgetLabelledActionButton = CardWidgetActionButtonBase & {\n /** Non-rendering values are excluded, so an unlabelled action has to meet the icon-only rules. */\n label: Exclude<ButtonProps['children'], null | undefined | boolean>;\n /** @default undefined */\n 'aria-label'?: string;\n};\n\n/**\n * An action with no visible label, rendered as a 32px icon button. The icon is\n * the only thing on screen and `aria-label` is the only accessible name, so\n * both are required.\n */\ntype CardWidgetIconActionButton = CardWidgetActionButtonBase & {\n label?: never;\n icon: ReactNode;\n 'aria-label': string;\n};\n\n/**\n * An action the `CardWidget` header renders as a button. With a `label` it is a small `Button`; without\n * one, a 32px `IconButton`, which requires both an `icon` and an `aria-label`. Emphasis is not\n * part of the object — it comes from the slot the action is passed to.\n */\nexport type CardWidgetActionButton = CardWidgetLabelledActionButton | CardWidgetIconActionButton;\n\nconst BUTTON_PRIORITY = {\n action: 'secondary',\n actionSecondary: 'secondary-neutral',\n} as const satisfies Record<CardWidgetActionSlot, ButtonPriority>;\n\nconst ICON_BUTTON_PRIORITY = {\n action: 'secondary',\n actionSecondary: 'tertiary',\n} as const satisfies Record<CardWidgetActionSlot, IconButtonProps['priority']>;\n\n/**\n * Tells a `CardWidgetActionButton` object apart from any other node passed to an action slot.\n * Every button action has a `label` or an `icon`, which no React element, portal or array does.\n */\nexport const isCardWidgetActionButton = (value: unknown): value is CardWidgetActionButton =>\n typeof value === 'object' &&\n value !== null &&\n !isValidElement(value) &&\n !Array.isArray(value) &&\n ('label' in value || 'icon' in value);\n\n/** Renders a `CardWidgetActionButton` at the emphasis of the slot it was passed to. */\nconst CardWidgetAction = function CardWidgetAction({\n action: {\n label,\n icon,\n 'aria-label': ariaLabel,\n 'data-testid': dataTestId,\n href,\n target,\n onClick,\n disabled,\n },\n slot,\n}: {\n action: CardWidgetActionButton;\n slot: CardWidgetActionSlot;\n}) {\n if (label === undefined) {\n return (\n <IconButton\n size={32}\n priority={ICON_BUTTON_PRIORITY[slot]}\n aria-label={ariaLabel}\n href={href}\n target={target}\n disabled={disabled}\n data-testid={dataTestId}\n onClick={onClick}\n >\n {icon}\n </IconButton>\n );\n }\n\n return (\n <Button\n v2\n size=\"sm\"\n priority={BUTTON_PRIORITY[slot]}\n aria-label={ariaLabel}\n href={href}\n target={target}\n disabled={disabled}\n addonEnd={icon ? { type: 'icon', value: icon } : undefined}\n // The v2 resolver drops `Button`'s own `button` default, so an action would submit a form.\n type=\"button\"\n data-testid={dataTestId}\n onClick={onClick}\n >\n {label}\n </Button>\n );\n};\n\nexport default CardWidgetAction;\n"],"names":["BUTTON_PRIORITY","action","actionSecondary","ICON_BUTTON_PRIORITY","isCardWidgetActionButton","value","isValidElement","Array","isArray","CardWidgetAction","label","icon","ariaLabel","dataTestId","href","target","onClick","disabled","slot","undefined","_jsx","IconButton","size","priority","children","Button","v2","addonEnd","type"],"mappings":";;;;;;;;;AAoDA,MAAMA,eAAe,GAAG;AACtBC,EAAAA,MAAM,EAAE,WAAW;AACnBC,EAAAA,eAAe,EAAE;CAC8C;AAEjE,MAAMC,oBAAoB,GAAG;AAC3BF,EAAAA,MAAM,EAAE,WAAW;AACnBC,EAAAA,eAAe,EAAE;CAC2D;AAE9E;;;AAGG;AACI,MAAME,wBAAwB,GAAIC,KAAc,IACrD,OAAOA,KAAK,KAAK,QAAQ,IACzBA,KAAK,KAAK,IAAI,IACd,eAACC,oBAAc,CAACD,KAAK,CAAC,IACtB,CAACE,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,KACpB,OAAO,IAAIA,KAAK,IAAI,MAAM,IAAIA,KAAK;AAEtC;AACA,MAAMI,gBAAgB,GAAG,SAASA,gBAAgBA,CAAC;AACjDR,EAAAA,MAAM,EAAE;IACNS,KAAK;IACLC,IAAI;AACJ,IAAA,YAAY,EAAEC,SAAS;AACvB,IAAA,aAAa,EAAEC,UAAU;IACzBC,IAAI;IACJC,MAAM;IACNC,OAAO;AACPC,IAAAA;GACD;AACDC,EAAAA;AAAI,CAIL,EAAA;EACC,IAAIR,KAAK,KAAKS,SAAS,EAAE;IACvB,oBACEC,cAAA,CAACC,kBAAU,EAAA;AACTC,MAAAA,IAAI,EAAE,EAAG;AACTC,MAAAA,QAAQ,EAAEpB,oBAAoB,CAACe,IAAI,CAAE;AACrC,MAAA,YAAA,EAAYN,SAAU;AACtBE,MAAAA,IAAI,EAAEA,IAAK;AACXC,MAAAA,MAAM,EAAEA,MAAO;AACfE,MAAAA,QAAQ,EAAEA,QAAS;AACnB,MAAA,aAAA,EAAaJ,UAAW;AACxBG,MAAAA,OAAO,EAAEA,OAAQ;AAAAQ,MAAAA,QAAA,EAEhBb;AAAI,KACK,CAAC;AAEjB,EAAA;EAEA,oBACES,cAAA,CAACK,uBAAM,EAAA;IACLC,EAAE,EAAA,IAAA;AACFJ,IAAAA,IAAI,EAAC,IAAI;AACTC,IAAAA,QAAQ,EAAEvB,eAAe,CAACkB,IAAI,CAAE;AAChC,IAAA,YAAA,EAAYN,SAAU;AACtBE,IAAAA,IAAI,EAAEA,IAAK;AACXC,IAAAA,MAAM,EAAEA,MAAO;AACfE,IAAAA,QAAQ,EAAEA,QAAS;IACnBU,QAAQ,EAAEhB,IAAI,GAAG;AAAEiB,MAAAA,IAAI,EAAE,MAAM;AAAEvB,MAAAA,KAAK,EAAEM;AAAI,KAAE,GAAGQ;AACjD;AAAA;AACAS,IAAAA,IAAI,EAAC,QAAQ;AACb,IAAA,aAAA,EAAaf,UAAW;AACxBG,IAAAA,OAAO,EAAEA,OAAQ;AAAAQ,IAAAA,QAAA,EAEhBd;AAAK,GACA,CAAC;AAEb;;;"}
@@ -0,0 +1,68 @@
1
+ import { isValidElement } from 'react';
2
+ import Button from '../Button/Button.resolver.mjs';
3
+ import IconButton from '../IconButton/IconButton.mjs';
4
+ import { jsx } from 'react/jsx-runtime';
5
+
6
+ const BUTTON_PRIORITY = {
7
+ action: 'secondary',
8
+ actionSecondary: 'secondary-neutral'
9
+ };
10
+ const ICON_BUTTON_PRIORITY = {
11
+ action: 'secondary',
12
+ actionSecondary: 'tertiary'
13
+ };
14
+ /**
15
+ * Tells a `CardWidgetActionButton` object apart from any other node passed to an action slot.
16
+ * Every button action has a `label` or an `icon`, which no React element, portal or array does.
17
+ */
18
+ const isCardWidgetActionButton = value => typeof value === 'object' && value !== null && ! /*#__PURE__*/isValidElement(value) && !Array.isArray(value) && ('label' in value || 'icon' in value);
19
+ /** Renders a `CardWidgetActionButton` at the emphasis of the slot it was passed to. */
20
+ const CardWidgetAction = function CardWidgetAction({
21
+ action: {
22
+ label,
23
+ icon,
24
+ 'aria-label': ariaLabel,
25
+ 'data-testid': dataTestId,
26
+ href,
27
+ target,
28
+ onClick,
29
+ disabled
30
+ },
31
+ slot
32
+ }) {
33
+ if (label === undefined) {
34
+ return /*#__PURE__*/jsx(IconButton, {
35
+ size: 32,
36
+ priority: ICON_BUTTON_PRIORITY[slot],
37
+ "aria-label": ariaLabel,
38
+ href: href,
39
+ target: target,
40
+ disabled: disabled,
41
+ "data-testid": dataTestId,
42
+ onClick: onClick,
43
+ children: icon
44
+ });
45
+ }
46
+ return /*#__PURE__*/jsx(Button, {
47
+ v2: true,
48
+ size: "sm",
49
+ priority: BUTTON_PRIORITY[slot],
50
+ "aria-label": ariaLabel,
51
+ href: href,
52
+ target: target,
53
+ disabled: disabled,
54
+ addonEnd: icon ? {
55
+ type: 'icon',
56
+ value: icon
57
+ } : undefined
58
+ // The v2 resolver drops `Button`'s own `button` default, so an action would submit a form.
59
+ ,
60
+ type: "button",
61
+ "data-testid": dataTestId,
62
+ onClick: onClick,
63
+ children: label
64
+ });
65
+ };
66
+
67
+ export { CardWidgetAction as default, isCardWidgetActionButton };
68
+ //# sourceMappingURL=CardWidgetAction.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardWidgetAction.mjs","sources":["../../src/CardWidget/CardWidgetAction.tsx"],"sourcesContent":["import { isValidElement, type MouseEventHandler, type ReactNode } from 'react';\n\nimport Button from '../Button';\nimport type { ButtonPriority, ButtonProps } from '../Button/Button.types';\nimport IconButton, { type IconButtonProps } from '../IconButton';\n\n/** The action slot a `CardWidgetActionButton` was passed to, which is what determines its emphasis. */\nexport type CardWidgetActionSlot = 'action' | 'actionSecondary';\n\ntype CardWidgetActionButtonBase = Pick<ButtonProps, 'href' | 'target' | 'disabled'> & {\n /**\n * `HTMLElement` rather than a narrower target, because an action is a `button` or an `a`\n * depending on whether `href` is set.\n * @default undefined\n */\n onClick?: MouseEventHandler<HTMLElement>;\n\n /**\n * Rendered after `label`, or as the only content of an unlabelled action.\n * Size it yourself — 16px is expected in both cases.\n * @default undefined\n */\n icon?: ReactNode;\n 'data-testid'?: string;\n};\n\n/** An action with a visible label, rendered as a small button. */\ntype CardWidgetLabelledActionButton = CardWidgetActionButtonBase & {\n /** Non-rendering values are excluded, so an unlabelled action has to meet the icon-only rules. */\n label: Exclude<ButtonProps['children'], null | undefined | boolean>;\n /** @default undefined */\n 'aria-label'?: string;\n};\n\n/**\n * An action with no visible label, rendered as a 32px icon button. The icon is\n * the only thing on screen and `aria-label` is the only accessible name, so\n * both are required.\n */\ntype CardWidgetIconActionButton = CardWidgetActionButtonBase & {\n label?: never;\n icon: ReactNode;\n 'aria-label': string;\n};\n\n/**\n * An action the `CardWidget` header renders as a button. With a `label` it is a small `Button`; without\n * one, a 32px `IconButton`, which requires both an `icon` and an `aria-label`. Emphasis is not\n * part of the object — it comes from the slot the action is passed to.\n */\nexport type CardWidgetActionButton = CardWidgetLabelledActionButton | CardWidgetIconActionButton;\n\nconst BUTTON_PRIORITY = {\n action: 'secondary',\n actionSecondary: 'secondary-neutral',\n} as const satisfies Record<CardWidgetActionSlot, ButtonPriority>;\n\nconst ICON_BUTTON_PRIORITY = {\n action: 'secondary',\n actionSecondary: 'tertiary',\n} as const satisfies Record<CardWidgetActionSlot, IconButtonProps['priority']>;\n\n/**\n * Tells a `CardWidgetActionButton` object apart from any other node passed to an action slot.\n * Every button action has a `label` or an `icon`, which no React element, portal or array does.\n */\nexport const isCardWidgetActionButton = (value: unknown): value is CardWidgetActionButton =>\n typeof value === 'object' &&\n value !== null &&\n !isValidElement(value) &&\n !Array.isArray(value) &&\n ('label' in value || 'icon' in value);\n\n/** Renders a `CardWidgetActionButton` at the emphasis of the slot it was passed to. */\nconst CardWidgetAction = function CardWidgetAction({\n action: {\n label,\n icon,\n 'aria-label': ariaLabel,\n 'data-testid': dataTestId,\n href,\n target,\n onClick,\n disabled,\n },\n slot,\n}: {\n action: CardWidgetActionButton;\n slot: CardWidgetActionSlot;\n}) {\n if (label === undefined) {\n return (\n <IconButton\n size={32}\n priority={ICON_BUTTON_PRIORITY[slot]}\n aria-label={ariaLabel}\n href={href}\n target={target}\n disabled={disabled}\n data-testid={dataTestId}\n onClick={onClick}\n >\n {icon}\n </IconButton>\n );\n }\n\n return (\n <Button\n v2\n size=\"sm\"\n priority={BUTTON_PRIORITY[slot]}\n aria-label={ariaLabel}\n href={href}\n target={target}\n disabled={disabled}\n addonEnd={icon ? { type: 'icon', value: icon } : undefined}\n // The v2 resolver drops `Button`'s own `button` default, so an action would submit a form.\n type=\"button\"\n data-testid={dataTestId}\n onClick={onClick}\n >\n {label}\n </Button>\n );\n};\n\nexport default CardWidgetAction;\n"],"names":["BUTTON_PRIORITY","action","actionSecondary","ICON_BUTTON_PRIORITY","isCardWidgetActionButton","value","isValidElement","Array","isArray","CardWidgetAction","label","icon","ariaLabel","dataTestId","href","target","onClick","disabled","slot","undefined","_jsx","IconButton","size","priority","children","Button","v2","addonEnd","type"],"mappings":";;;;;AAoDA,MAAMA,eAAe,GAAG;AACtBC,EAAAA,MAAM,EAAE,WAAW;AACnBC,EAAAA,eAAe,EAAE;CAC8C;AAEjE,MAAMC,oBAAoB,GAAG;AAC3BF,EAAAA,MAAM,EAAE,WAAW;AACnBC,EAAAA,eAAe,EAAE;CAC2D;AAE9E;;;AAGG;AACI,MAAME,wBAAwB,GAAIC,KAAc,IACrD,OAAOA,KAAK,KAAK,QAAQ,IACzBA,KAAK,KAAK,IAAI,IACd,eAACC,cAAc,CAACD,KAAK,CAAC,IACtB,CAACE,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,KACpB,OAAO,IAAIA,KAAK,IAAI,MAAM,IAAIA,KAAK;AAEtC;AACA,MAAMI,gBAAgB,GAAG,SAASA,gBAAgBA,CAAC;AACjDR,EAAAA,MAAM,EAAE;IACNS,KAAK;IACLC,IAAI;AACJ,IAAA,YAAY,EAAEC,SAAS;AACvB,IAAA,aAAa,EAAEC,UAAU;IACzBC,IAAI;IACJC,MAAM;IACNC,OAAO;AACPC,IAAAA;GACD;AACDC,EAAAA;AAAI,CAIL,EAAA;EACC,IAAIR,KAAK,KAAKS,SAAS,EAAE;IACvB,oBACEC,GAAA,CAACC,UAAU,EAAA;AACTC,MAAAA,IAAI,EAAE,EAAG;AACTC,MAAAA,QAAQ,EAAEpB,oBAAoB,CAACe,IAAI,CAAE;AACrC,MAAA,YAAA,EAAYN,SAAU;AACtBE,MAAAA,IAAI,EAAEA,IAAK;AACXC,MAAAA,MAAM,EAAEA,MAAO;AACfE,MAAAA,QAAQ,EAAEA,QAAS;AACnB,MAAA,aAAA,EAAaJ,UAAW;AACxBG,MAAAA,OAAO,EAAEA,OAAQ;AAAAQ,MAAAA,QAAA,EAEhBb;AAAI,KACK,CAAC;AAEjB,EAAA;EAEA,oBACES,GAAA,CAACK,MAAM,EAAA;IACLC,EAAE,EAAA,IAAA;AACFJ,IAAAA,IAAI,EAAC,IAAI;AACTC,IAAAA,QAAQ,EAAEvB,eAAe,CAACkB,IAAI,CAAE;AAChC,IAAA,YAAA,EAAYN,SAAU;AACtBE,IAAAA,IAAI,EAAEA,IAAK;AACXC,IAAAA,MAAM,EAAEA,MAAO;AACfE,IAAAA,QAAQ,EAAEA,QAAS;IACnBU,QAAQ,EAAEhB,IAAI,GAAG;AAAEiB,MAAAA,IAAI,EAAE,MAAM;AAAEvB,MAAAA,KAAK,EAAEM;AAAI,KAAE,GAAGQ;AACjD;AAAA;AACAS,IAAAA,IAAI,EAAC,QAAQ;AACb,IAAA,aAAA,EAAaf,UAAW;AACxBG,IAAAA,OAAO,EAAEA,OAAQ;AAAAQ,IAAAA,QAAA,EAEhBd;AAAK,GACA,CAAC;AAEb;;"}
@@ -38,7 +38,9 @@ function Display({
38
38
  }) {
39
39
  return /*#__PURE__*/jsxRuntime.jsx(Heading, {
40
40
  id: id,
41
- className: clsx.clsx('np-display', `np-text-${type}`, 'text-primary', className),
41
+ className: clsx.clsx('np-display', `np-text-${type}`,
42
+ // display-extra-large has no locale-aware equivalent
43
+ type !== typography.Typography.DISPLAY_EXTRA_LARGE && `wds-text-${type}`, 'text-primary', className),
42
44
  children: children
43
45
  });
44
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Display.js","sources":["../../src/Display/Display.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { PropsWithChildren } from 'react';\n\nimport { DisplayTypes, Typography } from '../common';\n\nexport type DisplayProps = PropsWithChildren<{\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n id?: string;\n type?: DisplayTypes;\n className?: string;\n}>;\n\nfunction Display({\n as: Heading = 'h1',\n type = Typography.DISPLAY_LARGE,\n children,\n className,\n id,\n}: DisplayProps) {\n return (\n <Heading id={id} className={clsx('np-display', `np-text-${type}`, 'text-primary', className)}>\n {children}\n </Heading>\n );\n}\n\nexport default Display;\n"],"names":["Display","as","Heading","type","Typography","DISPLAY_LARGE","children","className","id","_jsx","clsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,SAASA,OAAOA,CAAC;EACfC,EAAE,EAAEC,OAAO,GAAG,IAAI;EAClBC,IAAI,GAAGC,qBAAU,CAACC,aAAa;EAC/BC,QAAQ;EACRC,SAAS;AACTC,EAAAA;AAAE,CACW,EAAA;EACb,oBACEC,cAAA,CAACP,OAAO,EAAA;AAACM,IAAAA,EAAE,EAAEA,EAAG;AAACD,IAAAA,SAAS,EAAEG,SAAI,CAAC,YAAY,EAAE,CAAA,QAAA,EAAWP,IAAI,CAAA,CAAE,EAAE,cAAc,EAAEI,SAAS,CAAE;AAAAD,IAAAA,QAAA,EAC1FA;AAAQ,GACF,CAAC;AAEd;;"}
1
+ {"version":3,"file":"Display.js","sources":["../../src/Display/Display.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { PropsWithChildren } from 'react';\n\nimport { DisplayTypes, Typography } from '../common';\n\nexport type DisplayProps = PropsWithChildren<{\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n id?: string;\n type?: DisplayTypes;\n className?: string;\n}>;\n\nfunction Display({\n as: Heading = 'h1',\n type = Typography.DISPLAY_LARGE,\n children,\n className,\n id,\n}: DisplayProps) {\n return (\n <Heading\n id={id}\n className={clsx(\n 'np-display',\n `np-text-${type}`,\n // display-extra-large has no locale-aware equivalent\n type !== Typography.DISPLAY_EXTRA_LARGE && `wds-text-${type}`,\n 'text-primary',\n className,\n )}\n >\n {children}\n </Heading>\n );\n}\n\nexport default Display;\n"],"names":["Display","as","Heading","type","Typography","DISPLAY_LARGE","children","className","id","_jsx","clsx","DISPLAY_EXTRA_LARGE"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,SAASA,OAAOA,CAAC;EACfC,EAAE,EAAEC,OAAO,GAAG,IAAI;EAClBC,IAAI,GAAGC,qBAAU,CAACC,aAAa;EAC/BC,QAAQ;EACRC,SAAS;AACTC,EAAAA;AAAE,CACW,EAAA;EACb,oBACEC,cAAA,CAACP,OAAO,EAAA;AACNM,IAAAA,EAAE,EAAEA,EAAG;AACPD,IAAAA,SAAS,EAAEG,SAAI,CACb,YAAY,EACZ,CAAA,QAAA,EAAWP,IAAI,CAAA,CAAE;AACjB;AACAA,IAAAA,IAAI,KAAKC,qBAAU,CAACO,mBAAmB,IAAI,CAAA,SAAA,EAAYR,IAAI,CAAA,CAAE,EAC7D,cAAc,EACdI,SAAS,CACT;AAAAD,IAAAA,QAAA,EAEDA;AAAQ,GACF,CAAC;AAEd;;"}
@@ -34,7 +34,9 @@ function Display({
34
34
  }) {
35
35
  return /*#__PURE__*/jsx(Heading, {
36
36
  id: id,
37
- className: clsx('np-display', `np-text-${type}`, 'text-primary', className),
37
+ className: clsx('np-display', `np-text-${type}`,
38
+ // display-extra-large has no locale-aware equivalent
39
+ type !== Typography.DISPLAY_EXTRA_LARGE && `wds-text-${type}`, 'text-primary', className),
38
40
  children: children
39
41
  });
40
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Display.mjs","sources":["../../src/Display/Display.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { PropsWithChildren } from 'react';\n\nimport { DisplayTypes, Typography } from '../common';\n\nexport type DisplayProps = PropsWithChildren<{\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n id?: string;\n type?: DisplayTypes;\n className?: string;\n}>;\n\nfunction Display({\n as: Heading = 'h1',\n type = Typography.DISPLAY_LARGE,\n children,\n className,\n id,\n}: DisplayProps) {\n return (\n <Heading id={id} className={clsx('np-display', `np-text-${type}`, 'text-primary', className)}>\n {children}\n </Heading>\n );\n}\n\nexport default Display;\n"],"names":["Display","as","Heading","type","Typography","DISPLAY_LARGE","children","className","id","_jsx","clsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,SAASA,OAAOA,CAAC;EACfC,EAAE,EAAEC,OAAO,GAAG,IAAI;EAClBC,IAAI,GAAGC,UAAU,CAACC,aAAa;EAC/BC,QAAQ;EACRC,SAAS;AACTC,EAAAA;AAAE,CACW,EAAA;EACb,oBACEC,GAAA,CAACP,OAAO,EAAA;AAACM,IAAAA,EAAE,EAAEA,EAAG;AAACD,IAAAA,SAAS,EAAEG,IAAI,CAAC,YAAY,EAAE,CAAA,QAAA,EAAWP,IAAI,CAAA,CAAE,EAAE,cAAc,EAAEI,SAAS,CAAE;AAAAD,IAAAA,QAAA,EAC1FA;AAAQ,GACF,CAAC;AAEd;;"}
1
+ {"version":3,"file":"Display.mjs","sources":["../../src/Display/Display.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { PropsWithChildren } from 'react';\n\nimport { DisplayTypes, Typography } from '../common';\n\nexport type DisplayProps = PropsWithChildren<{\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n id?: string;\n type?: DisplayTypes;\n className?: string;\n}>;\n\nfunction Display({\n as: Heading = 'h1',\n type = Typography.DISPLAY_LARGE,\n children,\n className,\n id,\n}: DisplayProps) {\n return (\n <Heading\n id={id}\n className={clsx(\n 'np-display',\n `np-text-${type}`,\n // display-extra-large has no locale-aware equivalent\n type !== Typography.DISPLAY_EXTRA_LARGE && `wds-text-${type}`,\n 'text-primary',\n className,\n )}\n >\n {children}\n </Heading>\n );\n}\n\nexport default Display;\n"],"names":["Display","as","Heading","type","Typography","DISPLAY_LARGE","children","className","id","_jsx","clsx","DISPLAY_EXTRA_LARGE"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,SAASA,OAAOA,CAAC;EACfC,EAAE,EAAEC,OAAO,GAAG,IAAI;EAClBC,IAAI,GAAGC,UAAU,CAACC,aAAa;EAC/BC,QAAQ;EACRC,SAAS;AACTC,EAAAA;AAAE,CACW,EAAA;EACb,oBACEC,GAAA,CAACP,OAAO,EAAA;AACNM,IAAAA,EAAE,EAAEA,EAAG;AACPD,IAAAA,SAAS,EAAEG,IAAI,CACb,YAAY,EACZ,CAAA,QAAA,EAAWP,IAAI,CAAA,CAAE;AACjB;AACAA,IAAAA,IAAI,KAAKC,UAAU,CAACO,mBAAmB,IAAI,CAAA,SAAA,EAAYR,IAAI,CAAA,CAAE,EAC7D,cAAc,EACdI,SAAS,CACT;AAAAD,IAAAA,QAAA,EAEDA;AAAQ,GACF,CAAC;AAEd;;"}
@@ -232,7 +232,7 @@ const AmountInput = ({
232
232
  className: "wds-amount-input-container",
233
233
  dir: "ltr",
234
234
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
235
- className: clsx.clsx('wds-amount-input-input-container', 'np-text-display-large--forced'),
235
+ className: clsx.clsx('wds-amount-input-input-container'),
236
236
  style: style,
237
237
  children: [/*#__PURE__*/jsxRuntime.jsx("input", {
238
238
  ref: ref,
@@ -1 +1 @@
1
- {"version":3,"file":"AmountInput.js","sources":["../../../src/ExpressiveMoneyInput/AmountInput/AmountInput.tsx"],"sourcesContent":["import { formatAmount } from '@transferwise/formatting';\nimport { clsx } from 'clsx';\nimport { AnimatePresence } from 'motion/react';\nimport { type ChangeEvent, type KeyboardEvent, useEffect, useMemo, useRef, useState } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport type { ExpressiveMoneyInputProps } from '../ExpressiveMoneyInput';\nimport { AnimatedNumber } from '../AnimatedNumber/AnimatedNumber';\nimport { useFocus } from '../hooks/useFocus';\nimport { useInputStyle } from '../hooks/useInputStyle';\nimport {\n getDecimalCount,\n getDecimalSeparator,\n getEnteredDecimalsCount,\n getFormattedString,\n getGroupSeparator,\n getUnformattedNumber,\n isAllowedInputKey,\n isInputPossiblyOverflowing,\n} from './utils';\n\ntype AmountInputProps = {\n id: string;\n describedById?: string;\n amount?: number | null;\n currency: string;\n autoFocus?: boolean;\n onChange: (amount: number | null) => void;\n onFocusChange?: (focused: boolean) => void;\n} & Pick<ExpressiveMoneyInputProps, 'loading'>;\n\nexport const AmountInput = ({\n id,\n describedById,\n amount,\n currency,\n autoFocus,\n onChange,\n onFocusChange,\n loading,\n}: AmountInputProps) => {\n const intl = useIntl();\n const { focus, setFocus, visualFocus, setVisualFocus } = useFocus();\n\n const [value, setValue] = useState<string>(() =>\n amount\n ? getFormattedString({\n value: amount,\n currency,\n locale: intl.locale,\n })\n : '',\n );\n const prevAmountRef = useRef<string | number | null | undefined>(amount);\n const numericValue = useMemo(() => {\n return getUnformattedNumber({\n value,\n currency,\n locale: intl.locale,\n });\n }, [value, currency, intl.locale]);\n\n const valueWithFullDecimals = useMemo(() => {\n return getFormattedString({\n value: numericValue ?? 0,\n currency,\n locale: intl.locale,\n alwaysShowDecimals: true,\n });\n }, [numericValue, currency, intl.locale]);\n\n const ref = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (autoFocus) {\n ref.current?.focus();\n }\n }, []);\n\n const placeholder = getPlaceholder(currency, intl.locale);\n const groupSeparator = getGroupSeparator(currency, intl.locale);\n const decimalSeparator = getDecimalSeparator(currency, intl.locale);\n const maxDecimalCount = getDecimalCount(currency, intl.locale);\n\n const decimalPart = getDecimalPart(value, decimalSeparator);\n const decimalMode = decimalSeparator && value.includes(decimalSeparator);\n\n useEffect(() => {\n if (prevAmountRef.current !== amount) {\n prevAmountRef.current = amount;\n\n // Only update the displayed value if not focused (preserve user input when focused)\n if (!focus) {\n // eslint-disable-next-line react-hooks/set-state-in-effect -- Syncing external prop to internal state when unfocused\n setValue(\n amount\n ? getFormattedString({\n value: amount,\n currency,\n locale: intl.locale,\n })\n : '',\n );\n }\n }\n }, [amount, focus, currency, intl.locale]);\n\n useEffect(() => {\n onFocusChange?.(visualFocus);\n }, [onFocusChange, visualFocus]);\n\n const shouldReformatAfterUserInput = (newValue: string) => {\n // don't reformat if formatting would wipe out user's input\n if (reformatValue(newValue) === '') {\n return false;\n }\n\n const endsWithDecimalSeparator = decimalSeparator && newValue.endsWith(decimalSeparator);\n const endsWithGroupSeparator = groupSeparator && newValue.endsWith(groupSeparator);\n\n // if the user has entered a seperator to the end, formatting would delete it\n if (endsWithDecimalSeparator || endsWithGroupSeparator) {\n return false;\n }\n\n const containsDecimalSeparator = decimalSeparator && newValue.includes(decimalSeparator);\n\n if (containsDecimalSeparator) {\n const enteredDecimalsCount = getEnteredDecimalsCount(newValue, decimalSeparator);\n // don't reformat until user has entered all the allowed decimals\n // for example, we don't want 1.1 to be reformatted to 1.10 immediately\n if (enteredDecimalsCount < maxDecimalCount) {\n return false;\n }\n }\n\n return true;\n };\n\n const reformatValue = (newValue: string) => {\n const unformattedValue = getUnformattedNumber({\n value: newValue,\n currency,\n locale: intl.locale,\n });\n const formattedValue = unformattedValue\n ? getFormattedString({\n value: unformattedValue,\n currency,\n locale: intl.locale,\n })\n : '';\n return formattedValue;\n };\n\n const handleChange = (newValue: string) => {\n const oldCursorPosition = ref.current?.selectionStart ?? 0;\n\n const newFormattedString = shouldReformatAfterUserInput(newValue)\n ? reformatValue(newValue)\n : newValue;\n setValue(newFormattedString);\n\n const newNumber = getUnformattedNumber({\n value: newFormattedString,\n currency,\n locale: intl.locale,\n });\n\n if (newNumber !== numericValue) {\n if (numericValue || newNumber) {\n onChange(newNumber);\n }\n }\n\n const newCursorPosition = oldCursorPosition + (newFormattedString.length - newValue.length);\n requestAnimationFrame(() => {\n ref?.current?.setSelectionRange(newCursorPosition, newCursorPosition);\n });\n };\n\n const handlePaste = (e: React.ClipboardEvent<HTMLInputElement>) => {\n e.preventDefault();\n\n const clipboardData = e.clipboardData?.getData('text/plain');\n if (!clipboardData) {\n return;\n }\n\n // need to sanitise the pasted value otherwise other validation logic will ignore the input entirely\n const sanitisedValue = reformatValue(clipboardData);\n\n handleChange(sanitisedValue);\n };\n\n const handleBlur = () => {\n setFocus(false);\n setValue(reformatValue(value));\n };\n\n const handleBackspace = (e: KeyboardEvent<HTMLInputElement>) => {\n const input = e.target as HTMLInputElement;\n // using the updated selection range after the backspace key has been processed, instead of the current selection range in state\n const { value: currentValue, selectionStart, selectionEnd } = input;\n\n if (selectionStart === selectionEnd && selectionStart && selectionStart > 0) {\n const charBeforeCursor = currentValue[selectionStart - 1];\n\n // if the user deletes a thousands separator, remove the digit before it as well\n if (charBeforeCursor === groupSeparator) {\n e.preventDefault();\n const beforeCursor = currentValue.slice(0, selectionStart - 2);\n const afterCursor = currentValue.slice(selectionStart);\n const newValue = `${beforeCursor}${afterCursor}`;\n input.setSelectionRange(beforeCursor.length, beforeCursor.length);\n handleChange(newValue);\n }\n }\n };\n\n const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n setFocus(true);\n if (!isAllowedInputKey(e)) {\n e.preventDefault();\n }\n\n if (e.key === 'Backspace') {\n handleBackspace(e);\n }\n };\n\n const isAllowedInput = (e: ChangeEvent<HTMLInputElement>) => {\n const hasMultipleDecimalSeparators =\n decimalSeparator && e.target.value.split(decimalSeparator).length > 2;\n if (hasMultipleDecimalSeparators) {\n return false;\n }\n\n const newNumericValue = getUnformattedNumber({\n value: e.target.value,\n currency,\n locale: intl.locale,\n });\n const maxLength = Number.MAX_SAFE_INTEGER.toString().length;\n if (String(newNumericValue).length > maxLength) {\n return false;\n }\n\n return true;\n };\n\n const addonContent = useMemo((): string | null | undefined => {\n // because we're using a separate \"addon\" element for the placeholder decimals, there is a possibility that the input itself will become scrollable\n // and the decimals will appear on top of the input. Safest thing to do is to just hide the addon if there is not enough room\n // eslint-disable-next-line react-hooks/refs -- Reading layout dimensions for overflow detection\n if (isInputPossiblyOverflowing({ ref, value })) {\n return null;\n }\n if (!decimalSeparator || !value) {\n return null;\n }\n\n // if the user has typed a decimal separator, show the full decimal part as a placeholder\n // this returns a string even if there is no content, typing should replace the placeholder immediately without animation\n // otherwise there is an ugly animation when going from 1.23 to 1.2 due to AnimatePresence\n if (focus && decimalMode) {\n // reuse getDecimalPart\n const fullDecimalPart = getDecimalPart(valueWithFullDecimals, decimalSeparator);\n // show only the characters that are not already displayed by the input\n return fullDecimalPart?.slice(decimalPart?.length);\n }\n\n // in unfocused state, always show the full decimal part unless the user has already entered decimals\n if (!focus && !decimalMode) {\n const [_, decimalPlaceholder] = placeholder.split(decimalSeparator);\n return decimalSeparator + decimalPlaceholder;\n }\n\n return null;\n }, [\n decimalMode,\n decimalPart?.length,\n decimalSeparator,\n focus,\n placeholder,\n value,\n valueWithFullDecimals,\n ]);\n\n const style = useInputStyle({\n // whenever decimals are shown, we need to account for the full decimal part for the font size calculation\n value: addonContent ? valueWithFullDecimals : value,\n focus: visualFocus,\n inputElement: ref,\n loading,\n });\n\n return (\n <div className=\"wds-amount-input-container\" dir=\"ltr\">\n <div\n className={clsx('wds-amount-input-input-container', 'np-text-display-large--forced')}\n style={style}\n >\n <input\n ref={ref}\n dir=\"auto\"\n className=\"wds-amount-input-input\"\n id={id}\n autoComplete=\"off\"\n inputMode=\"decimal\"\n value={value}\n type=\"text\"\n placeholder={placeholder}\n aria-describedby={describedById}\n /* without this, the input tries to keep an aspect ratio and doesn't respect CSS width rules */\n size={1}\n onChange={(e) => {\n if (isAllowedInput(e)) {\n handleChange(e.target.value);\n }\n }}\n onBlurCapture={() => handleBlur()}\n onPaste={(e) => handlePaste(e)}\n onFocus={() => {\n setFocus(true);\n }}\n onBlur={() => {\n setTimeout(() => setVisualFocus(false), 30);\n }}\n onKeyDown={(e) => handleKeyDown(e)}\n />\n <AnimatePresence initial={false}>\n {addonContent !== null && (\n <AnimatedNumber\n className={clsx(\n 'wds-amount-input-placeholder',\n visualFocus && 'wds-amount-input-placeholder-focus',\n )}\n onClick={() => ref.current?.focus()}\n >\n {addonContent}\n </AnimatedNumber>\n )}\n </AnimatePresence>\n </div>\n </div>\n );\n};\n\nconst getPlaceholder = (currency: string, locale: string) => {\n return formatAmount(0, currency, locale, { alwaysShowDecimals: true });\n};\n\nconst getDecimalPart = (value: string, decimalSeparator: string | null) => {\n if (!value || !decimalSeparator) {\n return undefined;\n }\n\n const [_, decimalPart] = value.split(decimalSeparator);\n return decimalPart ?? undefined;\n};\n"],"names":["AmountInput","id","describedById","amount","currency","autoFocus","onChange","onFocusChange","loading","intl","useIntl","focus","setFocus","visualFocus","setVisualFocus","useFocus","value","setValue","useState","getFormattedString","locale","prevAmountRef","useRef","numericValue","useMemo","getUnformattedNumber","valueWithFullDecimals","alwaysShowDecimals","ref","useEffect","current","placeholder","getPlaceholder","groupSeparator","getGroupSeparator","decimalSeparator","getDecimalSeparator","maxDecimalCount","getDecimalCount","decimalPart","getDecimalPart","decimalMode","includes","shouldReformatAfterUserInput","newValue","reformatValue","endsWithDecimalSeparator","endsWith","endsWithGroupSeparator","containsDecimalSeparator","enteredDecimalsCount","getEnteredDecimalsCount","unformattedValue","formattedValue","handleChange","oldCursorPosition","selectionStart","newFormattedString","newNumber","newCursorPosition","length","requestAnimationFrame","setSelectionRange","handlePaste","e","preventDefault","clipboardData","getData","sanitisedValue","handleBlur","handleBackspace","input","target","currentValue","selectionEnd","charBeforeCursor","beforeCursor","slice","afterCursor","handleKeyDown","isAllowedInputKey","key","isAllowedInput","hasMultipleDecimalSeparators","split","newNumericValue","maxLength","Number","MAX_SAFE_INTEGER","toString","String","addonContent","isInputPossiblyOverflowing","fullDecimalPart","_","decimalPlaceholder","style","useInputStyle","inputElement","_jsx","className","dir","children","_jsxs","clsx","autoComplete","inputMode","type","size","onBlurCapture","onPaste","onFocus","onBlur","setTimeout","onKeyDown","AnimatePresence","initial","AnimatedNumber","onClick","formatAmount","undefined"],"mappings":";;;;;;;;;;;;;AA+BO,MAAMA,WAAW,GAAGA,CAAC;EAC1BC,EAAE;EACFC,aAAa;EACbC,MAAM;EACNC,QAAQ;EACRC,SAAS;EACTC,QAAQ;EACRC,aAAa;AACbC,EAAAA;AAAO,CACU,KAAI;AACrB,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE;EACtB,MAAM;IAAEC,KAAK;IAAEC,QAAQ;IAAEC,WAAW;AAAEC,IAAAA;GAAgB,GAAGC,iBAAQ,EAAE;AAEnE,EAAA,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGC,cAAQ,CAAS,MACzCf,MAAM,GACFgB,wBAAkB,CAAC;AACjBH,IAAAA,KAAK,EAAEb,MAAM;IACbC,QAAQ;IACRgB,MAAM,EAAEX,IAAI,CAACW;GACd,CAAC,GACF,EAAE,CACP;AACD,EAAA,MAAMC,aAAa,GAAGC,YAAM,CAAqCnB,MAAM,CAAC;AACxE,EAAA,MAAMoB,YAAY,GAAGC,aAAO,CAAC,MAAK;AAChC,IAAA,OAAOC,0BAAoB,CAAC;MAC1BT,KAAK;MACLZ,QAAQ;MACRgB,MAAM,EAAEX,IAAI,CAACW;AACd,KAAA,CAAC;EACJ,CAAC,EAAE,CAACJ,KAAK,EAAEZ,QAAQ,EAAEK,IAAI,CAACW,MAAM,CAAC,CAAC;AAElC,EAAA,MAAMM,qBAAqB,GAAGF,aAAO,CAAC,MAAK;AACzC,IAAA,OAAOL,wBAAkB,CAAC;MACxBH,KAAK,EAAEO,YAAY,IAAI,CAAC;MACxBnB,QAAQ;MACRgB,MAAM,EAAEX,IAAI,CAACW,MAAM;AACnBO,MAAAA,kBAAkB,EAAE;AACrB,KAAA,CAAC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,WAAW,CAAC,GAAGvB,KAAK,CAACoE,KAAK,CAACjD,gBAAgB,CAAC;EACtD,OAAOI,WAAW,IAAIiF,SAAS;AACjC,CAAC;;"}
1
+ {"version":3,"file":"AmountInput.js","sources":["../../../src/ExpressiveMoneyInput/AmountInput/AmountInput.tsx"],"sourcesContent":["import { formatAmount } from '@transferwise/formatting';\nimport { clsx } from 'clsx';\nimport { AnimatePresence } from 'motion/react';\nimport { type ChangeEvent, type KeyboardEvent, useEffect, useMemo, useRef, useState } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport type { ExpressiveMoneyInputProps } from '../ExpressiveMoneyInput';\nimport { AnimatedNumber } from '../AnimatedNumber/AnimatedNumber';\nimport { useFocus } from '../hooks/useFocus';\nimport { useInputStyle } from '../hooks/useInputStyle';\nimport {\n getDecimalCount,\n getDecimalSeparator,\n getEnteredDecimalsCount,\n getFormattedString,\n getGroupSeparator,\n getUnformattedNumber,\n isAllowedInputKey,\n isInputPossiblyOverflowing,\n} from './utils';\n\ntype AmountInputProps = {\n id: string;\n describedById?: string;\n amount?: number | null;\n currency: string;\n autoFocus?: boolean;\n onChange: (amount: number | null) => void;\n onFocusChange?: (focused: boolean) => void;\n} & Pick<ExpressiveMoneyInputProps, 'loading'>;\n\nexport const AmountInput = ({\n id,\n describedById,\n amount,\n currency,\n autoFocus,\n onChange,\n onFocusChange,\n loading,\n}: AmountInputProps) => {\n const intl = useIntl();\n const { focus, setFocus, visualFocus, setVisualFocus } = useFocus();\n\n const [value, setValue] = useState<string>(() =>\n amount\n ? getFormattedString({\n value: amount,\n currency,\n locale: intl.locale,\n })\n : '',\n );\n const prevAmountRef = useRef<string | number | null | undefined>(amount);\n const numericValue = useMemo(() => {\n return getUnformattedNumber({\n value,\n currency,\n locale: intl.locale,\n });\n }, [value, currency, intl.locale]);\n\n const valueWithFullDecimals = useMemo(() => {\n return getFormattedString({\n value: numericValue ?? 0,\n currency,\n locale: intl.locale,\n alwaysShowDecimals: true,\n });\n }, [numericValue, currency, intl.locale]);\n\n const ref = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (autoFocus) {\n ref.current?.focus();\n }\n }, []);\n\n const placeholder = getPlaceholder(currency, intl.locale);\n const groupSeparator = getGroupSeparator(currency, intl.locale);\n const decimalSeparator = getDecimalSeparator(currency, intl.locale);\n const maxDecimalCount = getDecimalCount(currency, intl.locale);\n\n const decimalPart = getDecimalPart(value, decimalSeparator);\n const decimalMode = decimalSeparator && value.includes(decimalSeparator);\n\n useEffect(() => {\n if (prevAmountRef.current !== amount) {\n prevAmountRef.current = amount;\n\n // Only update the displayed value if not focused (preserve user input when focused)\n if (!focus) {\n // eslint-disable-next-line react-hooks/set-state-in-effect -- Syncing external prop to internal state when unfocused\n setValue(\n amount\n ? getFormattedString({\n value: amount,\n currency,\n locale: intl.locale,\n })\n : '',\n );\n }\n }\n }, [amount, focus, currency, intl.locale]);\n\n useEffect(() => {\n onFocusChange?.(visualFocus);\n }, [onFocusChange, visualFocus]);\n\n const shouldReformatAfterUserInput = (newValue: string) => {\n // don't reformat if formatting would wipe out user's input\n if (reformatValue(newValue) === '') {\n return false;\n }\n\n const endsWithDecimalSeparator = decimalSeparator && newValue.endsWith(decimalSeparator);\n const endsWithGroupSeparator = groupSeparator && newValue.endsWith(groupSeparator);\n\n // if the user has entered a seperator to the end, formatting would delete it\n if (endsWithDecimalSeparator || endsWithGroupSeparator) {\n return false;\n }\n\n const containsDecimalSeparator = decimalSeparator && newValue.includes(decimalSeparator);\n\n if (containsDecimalSeparator) {\n const enteredDecimalsCount = getEnteredDecimalsCount(newValue, decimalSeparator);\n // don't reformat until user has entered all the allowed decimals\n // for example, we don't want 1.1 to be reformatted to 1.10 immediately\n if (enteredDecimalsCount < maxDecimalCount) {\n return false;\n }\n }\n\n return true;\n };\n\n const reformatValue = (newValue: string) => {\n const unformattedValue = getUnformattedNumber({\n value: newValue,\n currency,\n locale: intl.locale,\n });\n const formattedValue = unformattedValue\n ? getFormattedString({\n value: unformattedValue,\n currency,\n locale: intl.locale,\n })\n : '';\n return formattedValue;\n };\n\n const handleChange = (newValue: string) => {\n const oldCursorPosition = ref.current?.selectionStart ?? 0;\n\n const newFormattedString = shouldReformatAfterUserInput(newValue)\n ? reformatValue(newValue)\n : newValue;\n setValue(newFormattedString);\n\n const newNumber = getUnformattedNumber({\n value: newFormattedString,\n currency,\n locale: intl.locale,\n });\n\n if (newNumber !== numericValue) {\n if (numericValue || newNumber) {\n onChange(newNumber);\n }\n }\n\n const newCursorPosition = oldCursorPosition + (newFormattedString.length - newValue.length);\n requestAnimationFrame(() => {\n ref?.current?.setSelectionRange(newCursorPosition, newCursorPosition);\n });\n };\n\n const handlePaste = (e: React.ClipboardEvent<HTMLInputElement>) => {\n e.preventDefault();\n\n const clipboardData = e.clipboardData?.getData('text/plain');\n if (!clipboardData) {\n return;\n }\n\n // need to sanitise the pasted value otherwise other validation logic will ignore the input entirely\n const sanitisedValue = reformatValue(clipboardData);\n\n handleChange(sanitisedValue);\n };\n\n const handleBlur = () => {\n setFocus(false);\n setValue(reformatValue(value));\n };\n\n const handleBackspace = (e: KeyboardEvent<HTMLInputElement>) => {\n const input = e.target as HTMLInputElement;\n // using the updated selection range after the backspace key has been processed, instead of the current selection range in state\n const { value: currentValue, selectionStart, selectionEnd } = input;\n\n if (selectionStart === selectionEnd && selectionStart && selectionStart > 0) {\n const charBeforeCursor = currentValue[selectionStart - 1];\n\n // if the user deletes a thousands separator, remove the digit before it as well\n if (charBeforeCursor === groupSeparator) {\n e.preventDefault();\n const beforeCursor = currentValue.slice(0, selectionStart - 2);\n const afterCursor = currentValue.slice(selectionStart);\n const newValue = `${beforeCursor}${afterCursor}`;\n input.setSelectionRange(beforeCursor.length, beforeCursor.length);\n handleChange(newValue);\n }\n }\n };\n\n const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n setFocus(true);\n if (!isAllowedInputKey(e)) {\n e.preventDefault();\n }\n\n if (e.key === 'Backspace') {\n handleBackspace(e);\n }\n };\n\n const isAllowedInput = (e: ChangeEvent<HTMLInputElement>) => {\n const hasMultipleDecimalSeparators =\n decimalSeparator && e.target.value.split(decimalSeparator).length > 2;\n if (hasMultipleDecimalSeparators) {\n return false;\n }\n\n const newNumericValue = getUnformattedNumber({\n value: e.target.value,\n currency,\n locale: intl.locale,\n });\n const maxLength = Number.MAX_SAFE_INTEGER.toString().length;\n if (String(newNumericValue).length > maxLength) {\n return false;\n }\n\n return true;\n };\n\n const addonContent = useMemo((): string | null | undefined => {\n // because we're using a separate \"addon\" element for the placeholder decimals, there is a possibility that the input itself will become scrollable\n // and the decimals will appear on top of the input. Safest thing to do is to just hide the addon if there is not enough room\n // eslint-disable-next-line react-hooks/refs -- Reading layout dimensions for overflow detection\n if (isInputPossiblyOverflowing({ ref, value })) {\n return null;\n }\n if (!decimalSeparator || !value) {\n return null;\n }\n\n // if the user has typed a decimal separator, show the full decimal part as a placeholder\n // this returns a string even if there is no content, typing should replace the placeholder immediately without animation\n // otherwise there is an ugly animation when going from 1.23 to 1.2 due to AnimatePresence\n if (focus && decimalMode) {\n // reuse getDecimalPart\n const fullDecimalPart = getDecimalPart(valueWithFullDecimals, decimalSeparator);\n // show only the characters that are not already displayed by the input\n return fullDecimalPart?.slice(decimalPart?.length);\n }\n\n // in unfocused state, always show the full decimal part unless the user has already entered decimals\n if (!focus && !decimalMode) {\n const [_, decimalPlaceholder] = placeholder.split(decimalSeparator);\n return decimalSeparator + decimalPlaceholder;\n }\n\n return null;\n }, [\n decimalMode,\n decimalPart?.length,\n decimalSeparator,\n focus,\n placeholder,\n value,\n valueWithFullDecimals,\n ]);\n\n const style = useInputStyle({\n // whenever decimals are shown, we need to account for the full decimal part for the font size calculation\n value: addonContent ? valueWithFullDecimals : value,\n focus: visualFocus,\n inputElement: ref,\n loading,\n });\n\n return (\n <div className=\"wds-amount-input-container\" dir=\"ltr\">\n <div className={clsx('wds-amount-input-input-container')} style={style}>\n <input\n ref={ref}\n dir=\"auto\"\n className=\"wds-amount-input-input\"\n id={id}\n autoComplete=\"off\"\n inputMode=\"decimal\"\n value={value}\n type=\"text\"\n placeholder={placeholder}\n aria-describedby={describedById}\n /* without this, the input tries to keep an aspect ratio and doesn't respect CSS width rules */\n size={1}\n onChange={(e) => {\n if (isAllowedInput(e)) {\n handleChange(e.target.value);\n }\n }}\n onBlurCapture={() => handleBlur()}\n onPaste={(e) => handlePaste(e)}\n onFocus={() => {\n setFocus(true);\n }}\n onBlur={() => {\n setTimeout(() => setVisualFocus(false), 30);\n }}\n onKeyDown={(e) => handleKeyDown(e)}\n />\n <AnimatePresence initial={false}>\n {addonContent !== null && (\n <AnimatedNumber\n className={clsx(\n 'wds-amount-input-placeholder',\n visualFocus && 'wds-amount-input-placeholder-focus',\n )}\n onClick={() => ref.current?.focus()}\n >\n {addonContent}\n </AnimatedNumber>\n )}\n </AnimatePresence>\n </div>\n </div>\n );\n};\n\nconst getPlaceholder = (currency: string, locale: string) => {\n return formatAmount(0, currency, locale, { alwaysShowDecimals: true });\n};\n\nconst getDecimalPart = (value: string, decimalSeparator: string | null) => {\n if (!value || !decimalSeparator) {\n return undefined;\n }\n\n const [_, decimalPart] = value.split(decimalSeparator);\n return decimalPart ?? undefined;\n};\n"],"names":["AmountInput","id","describedById","amount","currency","autoFocus","onChange","onFocusChange","loading","intl","useIntl","focus","setFocus","visualFocus","setVisualFocus","useFocus","value","setValue","useState","getFormattedString","locale","prevAmountRef","useRef","numericValue","useMemo","getUnformattedNumber","valueWithFullDecimals","alwaysShowDecimals","ref","useEffect","current","placeholder","getPlaceholder","groupSeparator","getGroupSeparator","decimalSeparator","getDecimalSeparator","maxDecimalCount","getDecimalCount","decimalPart","getDecimalPart","decimalMode","includes","shouldReformatAfterUserInput","newValue","reformatValue","endsWithDecimalSeparator","endsWith","endsWithGroupSeparator","containsDecimalSeparator","enteredDecimalsCount","getEnteredDecimalsCount","unformattedValue","formattedValue","handleChange","oldCursorPosition","selectionStart","newFormattedString","newNumber","newCursorPosition","length","requestAnimationFrame","setSelectionRange","handlePaste","e","preventDefault","clipboardData","getData","sanitisedValue","handleBlur","handleBackspace","input","target","currentValue","selectionEnd","charBeforeCursor","beforeCursor","slice","afterCursor","handleKeyDown","isAllowedInputKey","key","isAllowedInput","hasMultipleDecimalSeparators","split","newNumericValue","maxLength","Number","MAX_SAFE_INTEGER","toString","String","addonContent","isInputPossiblyOverflowing","fullDecimalPart","_","decimalPlaceholder","style","useInputStyle","inputElement","_jsx","className","dir","children","_jsxs","clsx","autoComplete","inputMode","type","size","onBlurCapture","onPaste","onFocus","onBlur","setTimeout","onKeyDown","AnimatePresence","initial","AnimatedNumber","onClick","formatAmount","undefined"],"mappings":";;;;;;;;;;;;;AA+BO,MAAMA,WAAW,GAAGA,CAAC;EAC1BC,EAAE;EACFC,aAAa;EACbC,MAAM;EACNC,QAAQ;EACRC,SAAS;EACTC,QAAQ;EACRC,aAAa;AACbC,EAAAA;AAAO,CACU,KAAI;AACrB,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE;EACtB,MAAM;IAAEC,KAAK;IAAEC,QAAQ;IAAEC,WAAW;AAAEC,IAAAA;GAAgB,GAAGC,iBAAQ,EAAE;AAEnE,EAAA,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGC,cAAQ,CAAS,MACzCf,MAAM,GACFgB,wBAAkB,CAAC;AACjBH,IAAAA,KAAK,EAAEb,MAAM;IACbC,QAAQ;IACRgB,MAAM,EAAEX,IAAI,CAACW;GACd,CAAC,GACF,EAAE,CACP;AACD,EAAA,MAAMC,aAAa,GAAGC,YAAM,CAAqCnB,MAAM,CAAC;AACxE,EAAA,MAAMoB,YAAY,GAAGC,aAAO,CAAC,MAAK;AAChC,IAAA,OAAOC,0BAAoB,CAAC;MAC1BT,KAAK;MACLZ,QAAQ;MACRgB,MAAM,EAAEX,IAAI,CAACW;AACd,KAAA,CAAC;EACJ,CAAC,EAAE,CAACJ,KAAK,EAAEZ,QAAQ,EAAEK,IAAI,CAACW,MAAM,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AAI,GAAE,CAAC;AACxE,CAAC;AAED,MAAMa,cAAc,GAAGA,CAACxB,KAAa,EAAEmB,gBAA+B,KAAI;AACxE,EAAA,IAAI,CAACnB,KAAK,IAAI,CAACmB,gBAAgB,EAAE;AAC/B,IAAA,OAAOqF,SAAS;AAClB,EAAA;EAEA,MAAM,CAAC1B,CAAC,EAAEvD,WAAW,CAAC,GAAGvB,KAAK,CAACoE,KAAK,CAACjD,gBAAgB,CAAC;EACtD,OAAOI,WAAW,IAAIiF,SAAS;AACjC,CAAC;;"}
@@ -230,7 +230,7 @@ const AmountInput = ({
230
230
  className: "wds-amount-input-container",
231
231
  dir: "ltr",
232
232
  children: /*#__PURE__*/jsxs("div", {
233
- className: clsx('wds-amount-input-input-container', 'np-text-display-large--forced'),
233
+ className: clsx('wds-amount-input-input-container'),
234
234
  style: style,
235
235
  children: [/*#__PURE__*/jsx("input", {
236
236
  ref: ref,