@transferwise/components 0.0.0-experimental-e068634 → 0.0.0-experimental-0e166d9

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 (358) hide show
  1. package/build/button/Button.js +0 -1
  2. package/build/button/Button.js.map +1 -1
  3. package/build/button/Button.mjs +0 -1
  4. package/build/button/Button.mjs.map +1 -1
  5. package/build/common/RadioButton/RadioButton.js +2 -5
  6. package/build/common/RadioButton/RadioButton.js.map +1 -1
  7. package/build/common/RadioButton/RadioButton.mjs +2 -5
  8. package/build/common/RadioButton/RadioButton.mjs.map +1 -1
  9. package/build/common/initials.js +4 -1
  10. package/build/common/initials.js.map +1 -1
  11. package/build/common/initials.mjs +4 -1
  12. package/build/common/initials.mjs.map +1 -1
  13. package/build/flowNavigation/animatedLabel/AnimatedLabel.js +3 -2
  14. package/build/flowNavigation/animatedLabel/AnimatedLabel.js.map +1 -1
  15. package/build/flowNavigation/animatedLabel/AnimatedLabel.mjs +2 -1
  16. package/build/flowNavigation/animatedLabel/AnimatedLabel.mjs.map +1 -1
  17. package/build/i18n/de.json +2 -0
  18. package/build/i18n/de.json.js +2 -0
  19. package/build/i18n/de.json.js.map +1 -1
  20. package/build/i18n/de.json.mjs +2 -0
  21. package/build/i18n/de.json.mjs.map +1 -1
  22. package/build/i18n/fr.json +2 -0
  23. package/build/i18n/fr.json.js +2 -0
  24. package/build/i18n/fr.json.js.map +1 -1
  25. package/build/i18n/fr.json.mjs +2 -0
  26. package/build/i18n/fr.json.mjs.map +1 -1
  27. package/build/i18n/hu.json +2 -0
  28. package/build/i18n/hu.json.js +2 -0
  29. package/build/i18n/hu.json.js.map +1 -1
  30. package/build/i18n/hu.json.mjs +2 -0
  31. package/build/i18n/hu.json.mjs.map +1 -1
  32. package/build/i18n/it.json +2 -0
  33. package/build/i18n/it.json.js +2 -0
  34. package/build/i18n/it.json.js.map +1 -1
  35. package/build/i18n/it.json.mjs +2 -0
  36. package/build/i18n/it.json.mjs.map +1 -1
  37. package/build/i18n/ja.json +2 -0
  38. package/build/i18n/ja.json.js +2 -0
  39. package/build/i18n/ja.json.js.map +1 -1
  40. package/build/i18n/ja.json.mjs +2 -0
  41. package/build/i18n/ja.json.mjs.map +1 -1
  42. package/build/i18n/pl.json +2 -0
  43. package/build/i18n/pl.json.js +2 -0
  44. package/build/i18n/pl.json.js.map +1 -1
  45. package/build/i18n/pl.json.mjs +2 -0
  46. package/build/i18n/pl.json.mjs.map +1 -1
  47. package/build/i18n/pt.json +2 -0
  48. package/build/i18n/pt.json.js +2 -0
  49. package/build/i18n/pt.json.js.map +1 -1
  50. package/build/i18n/pt.json.mjs +2 -0
  51. package/build/i18n/pt.json.mjs.map +1 -1
  52. package/build/i18n/ro.json +2 -0
  53. package/build/i18n/ro.json.js +2 -0
  54. package/build/i18n/ro.json.js.map +1 -1
  55. package/build/i18n/ro.json.mjs +2 -0
  56. package/build/i18n/ro.json.mjs.map +1 -1
  57. package/build/i18n/ru.json +2 -0
  58. package/build/i18n/ru.json.js +2 -0
  59. package/build/i18n/ru.json.js.map +1 -1
  60. package/build/i18n/ru.json.mjs +2 -0
  61. package/build/i18n/ru.json.mjs.map +1 -1
  62. package/build/i18n/tr.json +2 -0
  63. package/build/i18n/tr.json.js +2 -0
  64. package/build/i18n/tr.json.js.map +1 -1
  65. package/build/i18n/tr.json.mjs +2 -0
  66. package/build/i18n/tr.json.mjs.map +1 -1
  67. package/build/i18n/zh-CN.json +2 -0
  68. package/build/i18n/zh-CN.json.js +2 -0
  69. package/build/i18n/zh-CN.json.js.map +1 -1
  70. package/build/i18n/zh-CN.json.mjs +2 -0
  71. package/build/i18n/zh-CN.json.mjs.map +1 -1
  72. package/build/i18n/zh-HK.json +2 -0
  73. package/build/i18n/zh-HK.json.js +2 -0
  74. package/build/i18n/zh-HK.json.js.map +1 -1
  75. package/build/i18n/zh-HK.json.mjs +2 -0
  76. package/build/i18n/zh-HK.json.mjs.map +1 -1
  77. package/build/iconButton/IconButton.js.map +1 -1
  78. package/build/iconButton/IconButton.mjs.map +1 -1
  79. package/build/image/Image.js.map +1 -1
  80. package/build/image/Image.mjs.map +1 -1
  81. package/build/index.js +2 -4
  82. package/build/index.js.map +1 -1
  83. package/build/index.mjs +1 -2
  84. package/build/index.mjs.map +1 -1
  85. package/build/legacylistItem/List.js +17 -0
  86. package/build/legacylistItem/List.js.map +1 -0
  87. package/build/legacylistItem/List.mjs +15 -0
  88. package/build/legacylistItem/List.mjs.map +1 -0
  89. package/build/main.css +2 -774
  90. package/build/styles/avatarView/AvatarView.css +1 -3
  91. package/build/styles/button/Button.css +1 -1
  92. package/build/styles/main.css +2 -774
  93. package/build/switch/Switch.js +1 -3
  94. package/build/switch/Switch.js.map +1 -1
  95. package/build/switch/Switch.mjs +1 -3
  96. package/build/switch/Switch.mjs.map +1 -1
  97. package/build/types/button/Button.d.ts.map +1 -1
  98. package/build/types/button/Button.types.d.ts +1 -1
  99. package/build/types/button/Button.types.d.ts.map +1 -1
  100. package/build/types/button/index.d.ts +1 -1
  101. package/build/types/button/index.d.ts.map +1 -1
  102. package/build/types/common/RadioButton/RadioButton.d.ts +1 -3
  103. package/build/types/common/RadioButton/RadioButton.d.ts.map +1 -1
  104. package/build/types/common/initials.d.ts.map +1 -1
  105. package/build/types/iconButton/IconButton.d.ts +2 -2
  106. package/build/types/iconButton/IconButton.d.ts.map +1 -1
  107. package/build/types/image/Image.d.ts +0 -3
  108. package/build/types/image/Image.d.ts.map +1 -1
  109. package/build/types/image/index.d.ts +0 -1
  110. package/build/types/image/index.d.ts.map +1 -1
  111. package/build/types/index.d.ts +2 -6
  112. package/build/types/index.d.ts.map +1 -1
  113. package/build/types/legacylistItem/List.d.ts +6 -0
  114. package/build/types/legacylistItem/List.d.ts.map +1 -0
  115. package/build/types/legacylistItem/index.d.ts +2 -0
  116. package/build/types/legacylistItem/index.d.ts.map +1 -1
  117. package/build/types/switch/Switch.d.ts +1 -3
  118. package/build/types/switch/Switch.d.ts.map +1 -1
  119. package/package.json +1 -1
  120. package/src/avatarView/AvatarView.css +1 -3
  121. package/src/avatarView/AvatarView.less +1 -2
  122. package/src/button/Button.css +1 -1
  123. package/src/button/Button.less +1 -1
  124. package/src/button/Button.spec.tsx +0 -18
  125. package/src/button/Button.story.tsx +9 -4
  126. package/src/button/Button.tsx +1 -5
  127. package/src/button/Button.types.ts +1 -1
  128. package/src/button/index.ts +1 -1
  129. package/src/checkboxButton/CheckboxButton.story.tsx +4 -4
  130. package/src/common/RadioButton/RadioButton.tsx +1 -6
  131. package/src/common/initials.spec.tsx +13 -0
  132. package/src/common/initials.ts +5 -0
  133. package/src/flowNavigation/animatedLabel/AnimatedLabel.tsx +1 -1
  134. package/src/i18n/de.json +2 -0
  135. package/src/i18n/fr.json +2 -0
  136. package/src/i18n/hu.json +2 -0
  137. package/src/i18n/it.json +2 -0
  138. package/src/i18n/ja.json +2 -0
  139. package/src/i18n/pl.json +2 -0
  140. package/src/i18n/pt.json +2 -0
  141. package/src/i18n/ro.json +2 -0
  142. package/src/i18n/ru.json +2 -0
  143. package/src/i18n/tr.json +2 -0
  144. package/src/i18n/zh-CN.json +2 -0
  145. package/src/i18n/zh-HK.json +2 -0
  146. package/src/iconButton/IconButton.story.tsx +1 -1
  147. package/src/iconButton/IconButton.tsx +1 -1
  148. package/src/image/Image.tsx +0 -3
  149. package/src/image/index.ts +0 -1
  150. package/src/index.ts +2 -6
  151. package/src/legacylistItem/LegacyListItem.story.tsx +2 -2
  152. package/src/legacylistItem/LegacyListItem.tests.story.tsx +1 -2
  153. package/src/legacylistItem/List.tsx +10 -0
  154. package/src/legacylistItem/index.ts +2 -0
  155. package/src/main.css +2 -774
  156. package/src/main.less +0 -1
  157. package/src/switch/Switch.tsx +2 -6
  158. package/src/test-utils/Parameters.d.ts +77 -0
  159. package/build/list/List.js +0 -21
  160. package/build/list/List.js.map +0 -1
  161. package/build/list/List.mjs +0 -17
  162. package/build/list/List.mjs.map +0 -1
  163. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js +0 -56
  164. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js.map +0 -1
  165. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs +0 -54
  166. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs.map +0 -1
  167. package/build/listItem/AvatarLayout/ListItemAvatarLayout.js +0 -23
  168. package/build/listItem/AvatarLayout/ListItemAvatarLayout.js.map +0 -1
  169. package/build/listItem/AvatarLayout/ListItemAvatarLayout.mjs +0 -21
  170. package/build/listItem/AvatarLayout/ListItemAvatarLayout.mjs.map +0 -1
  171. package/build/listItem/AvatarView/ListItemAvatarView.js +0 -23
  172. package/build/listItem/AvatarView/ListItemAvatarView.js.map +0 -1
  173. package/build/listItem/AvatarView/ListItemAvatarView.mjs +0 -21
  174. package/build/listItem/AvatarView/ListItemAvatarView.mjs.map +0 -1
  175. package/build/listItem/Button/ListItemButton.js +0 -43
  176. package/build/listItem/Button/ListItemButton.js.map +0 -1
  177. package/build/listItem/Button/ListItemButton.mjs +0 -41
  178. package/build/listItem/Button/ListItemButton.mjs.map +0 -1
  179. package/build/listItem/Checkbox/ListItemCheckbox.js +0 -30
  180. package/build/listItem/Checkbox/ListItemCheckbox.js.map +0 -1
  181. package/build/listItem/Checkbox/ListItemCheckbox.mjs +0 -28
  182. package/build/listItem/Checkbox/ListItemCheckbox.mjs.map +0 -1
  183. package/build/listItem/IconButton/ListItemIconButton.js +0 -56
  184. package/build/listItem/IconButton/ListItemIconButton.js.map +0 -1
  185. package/build/listItem/IconButton/ListItemIconButton.mjs +0 -54
  186. package/build/listItem/IconButton/ListItemIconButton.mjs.map +0 -1
  187. package/build/listItem/Image/ListItemImage.js +0 -31
  188. package/build/listItem/Image/ListItemImage.js.map +0 -1
  189. package/build/listItem/Image/ListItemImage.mjs +0 -29
  190. package/build/listItem/Image/ListItemImage.mjs.map +0 -1
  191. package/build/listItem/ListItem.js +0 -312
  192. package/build/listItem/ListItem.js.map +0 -1
  193. package/build/listItem/ListItem.mjs +0 -307
  194. package/build/listItem/ListItem.mjs.map +0 -1
  195. package/build/listItem/ListItemContext.js +0 -8
  196. package/build/listItem/ListItemContext.js.map +0 -1
  197. package/build/listItem/ListItemContext.mjs +0 -6
  198. package/build/listItem/ListItemContext.mjs.map +0 -1
  199. package/build/listItem/Navigation/ListItemNavigation.js +0 -45
  200. package/build/listItem/Navigation/ListItemNavigation.js.map +0 -1
  201. package/build/listItem/Navigation/ListItemNavigation.mjs +0 -43
  202. package/build/listItem/Navigation/ListItemNavigation.mjs.map +0 -1
  203. package/build/listItem/Prompt/ListItemPrompt.js +0 -59
  204. package/build/listItem/Prompt/ListItemPrompt.js.map +0 -1
  205. package/build/listItem/Prompt/ListItemPrompt.mjs +0 -54
  206. package/build/listItem/Prompt/ListItemPrompt.mjs.map +0 -1
  207. package/build/listItem/Radio/ListItemRadio.js +0 -30
  208. package/build/listItem/Radio/ListItemRadio.js.map +0 -1
  209. package/build/listItem/Radio/ListItemRadio.mjs +0 -28
  210. package/build/listItem/Radio/ListItemRadio.mjs.map +0 -1
  211. package/build/listItem/Switch/ListItemSwitch.js +0 -30
  212. package/build/listItem/Switch/ListItemSwitch.js.map +0 -1
  213. package/build/listItem/Switch/ListItemSwitch.mjs +0 -28
  214. package/build/listItem/Switch/ListItemSwitch.mjs.map +0 -1
  215. package/build/listItem/useListItemControl.js +0 -22
  216. package/build/listItem/useListItemControl.js.map +0 -1
  217. package/build/listItem/useListItemControl.mjs +0 -20
  218. package/build/listItem/useListItemControl.mjs.map +0 -1
  219. package/build/listItem/useListItemMedia.js +0 -21
  220. package/build/listItem/useListItemMedia.js.map +0 -1
  221. package/build/listItem/useListItemMedia.mjs +0 -19
  222. package/build/listItem/useListItemMedia.mjs.map +0 -1
  223. package/build/styles/listItem/ListItem.css +0 -770
  224. package/build/styles/listItem/ListItem.grid.css +0 -370
  225. package/build/test-utils/assets/placeholder-landscape.svg +0 -1
  226. package/build/test-utils/assets/placeholder-portrait.svg +0 -1
  227. package/build/types/list/List.d.ts +0 -10
  228. package/build/types/list/List.d.ts.map +0 -1
  229. package/build/types/list/index.d.ts +0 -3
  230. package/build/types/list/index.d.ts.map +0 -1
  231. package/build/types/listItem/AdditionalInfo/ListItemAdditionalInfo.d.ts +0 -15
  232. package/build/types/listItem/AdditionalInfo/ListItemAdditionalInfo.d.ts.map +0 -1
  233. package/build/types/listItem/AdditionalInfo/index.d.ts +0 -3
  234. package/build/types/listItem/AdditionalInfo/index.d.ts.map +0 -1
  235. package/build/types/listItem/AvatarLayout/ListItemAvatarLayout.d.ts +0 -18
  236. package/build/types/listItem/AvatarLayout/ListItemAvatarLayout.d.ts.map +0 -1
  237. package/build/types/listItem/AvatarLayout/index.d.ts +0 -3
  238. package/build/types/listItem/AvatarLayout/index.d.ts.map +0 -1
  239. package/build/types/listItem/AvatarView/ListItemAvatarView.d.ts +0 -16
  240. package/build/types/listItem/AvatarView/ListItemAvatarView.d.ts.map +0 -1
  241. package/build/types/listItem/AvatarView/index.d.ts +0 -3
  242. package/build/types/listItem/AvatarView/index.d.ts.map +0 -1
  243. package/build/types/listItem/Button/ListItemButton.d.ts +0 -20
  244. package/build/types/listItem/Button/ListItemButton.d.ts.map +0 -1
  245. package/build/types/listItem/Button/index.d.ts +0 -3
  246. package/build/types/listItem/Button/index.d.ts.map +0 -1
  247. package/build/types/listItem/Checkbox/ListItemCheckbox.d.ts +0 -14
  248. package/build/types/listItem/Checkbox/ListItemCheckbox.d.ts.map +0 -1
  249. package/build/types/listItem/Checkbox/index.d.ts +0 -3
  250. package/build/types/listItem/Checkbox/index.d.ts.map +0 -1
  251. package/build/types/listItem/IconButton/ListItemIconButton.d.ts +0 -18
  252. package/build/types/listItem/IconButton/ListItemIconButton.d.ts.map +0 -1
  253. package/build/types/listItem/IconButton/index.d.ts +0 -3
  254. package/build/types/listItem/IconButton/index.d.ts.map +0 -1
  255. package/build/types/listItem/Image/ListItemImage.d.ts +0 -25
  256. package/build/types/listItem/Image/ListItemImage.d.ts.map +0 -1
  257. package/build/types/listItem/Image/index.d.ts +0 -3
  258. package/build/types/listItem/Image/index.d.ts.map +0 -1
  259. package/build/types/listItem/ListItem.d.ts +0 -113
  260. package/build/types/listItem/ListItem.d.ts.map +0 -1
  261. package/build/types/listItem/ListItemContext.d.ts +0 -22
  262. package/build/types/listItem/ListItemContext.d.ts.map +0 -1
  263. package/build/types/listItem/Navigation/ListItemNavigation.d.ts +0 -15
  264. package/build/types/listItem/Navigation/ListItemNavigation.d.ts.map +0 -1
  265. package/build/types/listItem/Navigation/index.d.ts +0 -3
  266. package/build/types/listItem/Navigation/index.d.ts.map +0 -1
  267. package/build/types/listItem/Prompt/ListItemPrompt.d.ts +0 -16
  268. package/build/types/listItem/Prompt/ListItemPrompt.d.ts.map +0 -1
  269. package/build/types/listItem/Prompt/index.d.ts +0 -3
  270. package/build/types/listItem/Prompt/index.d.ts.map +0 -1
  271. package/build/types/listItem/Radio/ListItemRadio.d.ts +0 -14
  272. package/build/types/listItem/Radio/ListItemRadio.d.ts.map +0 -1
  273. package/build/types/listItem/Radio/index.d.ts +0 -3
  274. package/build/types/listItem/Radio/index.d.ts.map +0 -1
  275. package/build/types/listItem/Switch/ListItemSwitch.d.ts +0 -14
  276. package/build/types/listItem/Switch/ListItemSwitch.d.ts.map +0 -1
  277. package/build/types/listItem/Switch/index.d.ts +0 -3
  278. package/build/types/listItem/Switch/index.d.ts.map +0 -1
  279. package/build/types/listItem/_stories/helpers.d.ts +0 -27
  280. package/build/types/listItem/_stories/helpers.d.ts.map +0 -1
  281. package/build/types/listItem/_stories/subcomponents.d.ts +0 -18
  282. package/build/types/listItem/_stories/subcomponents.d.ts.map +0 -1
  283. package/build/types/listItem/index.d.ts +0 -14
  284. package/build/types/listItem/index.d.ts.map +0 -1
  285. package/build/types/listItem/test-utils.d.ts +0 -7
  286. package/build/types/listItem/test-utils.d.ts.map +0 -1
  287. package/build/types/listItem/useListItemControl.d.ts +0 -5
  288. package/build/types/listItem/useListItemControl.d.ts.map +0 -1
  289. package/build/types/listItem/useListItemMedia.d.ts +0 -6
  290. package/build/types/listItem/useListItemMedia.d.ts.map +0 -1
  291. package/src/list/List.spec.tsx +0 -52
  292. package/src/list/List.story.tsx +0 -30
  293. package/src/list/List.tsx +0 -14
  294. package/src/list/index.ts +0 -2
  295. package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.spec.tsx +0 -56
  296. package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.story.tsx +0 -198
  297. package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.tsx +0 -36
  298. package/src/listItem/AdditionalInfo/index.ts +0 -2
  299. package/src/listItem/AvatarLayout/ListItemAvatarLayout.spec.tsx +0 -59
  300. package/src/listItem/AvatarLayout/ListItemAvatarLayout.story.tsx +0 -124
  301. package/src/listItem/AvatarLayout/ListItemAvatarLayout.tsx +0 -27
  302. package/src/listItem/AvatarLayout/index.ts +0 -2
  303. package/src/listItem/AvatarView/ListItemAvatarView.spec.tsx +0 -75
  304. package/src/listItem/AvatarView/ListItemAvatarView.story.tsx +0 -339
  305. package/src/listItem/AvatarView/ListItemAvatarView.tsx +0 -27
  306. package/src/listItem/AvatarView/index.ts +0 -2
  307. package/src/listItem/Button/ListItemButton.spec.tsx +0 -68
  308. package/src/listItem/Button/ListItemButton.story.tsx +0 -473
  309. package/src/listItem/Button/ListItemButton.tsx +0 -56
  310. package/src/listItem/Button/index.ts +0 -2
  311. package/src/listItem/Checkbox/ListItemCheckbox.spec.tsx +0 -82
  312. package/src/listItem/Checkbox/ListItemCheckbox.story.tsx +0 -128
  313. package/src/listItem/Checkbox/ListItemCheckbox.tsx +0 -33
  314. package/src/listItem/Checkbox/index.ts +0 -2
  315. package/src/listItem/IconButton/ListItemIconButton.spec.tsx +0 -119
  316. package/src/listItem/IconButton/ListItemIconButton.story.tsx +0 -284
  317. package/src/listItem/IconButton/ListItemIconButton.tsx +0 -73
  318. package/src/listItem/IconButton/index.ts +0 -2
  319. package/src/listItem/Image/ListItemImage.spec.tsx +0 -30
  320. package/src/listItem/Image/ListItemImage.story.tsx +0 -80
  321. package/src/listItem/Image/ListItemImage.tsx +0 -46
  322. package/src/listItem/Image/index.ts +0 -2
  323. package/src/listItem/ListItem.css +0 -770
  324. package/src/listItem/ListItem.grid.css +0 -370
  325. package/src/listItem/ListItem.grid.less +0 -622
  326. package/src/listItem/ListItem.less +0 -421
  327. package/src/listItem/ListItem.spec.tsx +0 -1521
  328. package/src/listItem/ListItem.tsx +0 -447
  329. package/src/listItem/ListItemContext.tsx +0 -27
  330. package/src/listItem/Navigation/ListItemNavigation.spec.tsx +0 -59
  331. package/src/listItem/Navigation/ListItemNavigation.story.tsx +0 -112
  332. package/src/listItem/Navigation/ListItemNavigation.tsx +0 -40
  333. package/src/listItem/Navigation/index.ts +0 -2
  334. package/src/listItem/Prompt/ListItemPrompt.spec.tsx +0 -36
  335. package/src/listItem/Prompt/ListItemPrompt.story.tsx +0 -204
  336. package/src/listItem/Prompt/ListItemPrompt.tsx +0 -32
  337. package/src/listItem/Prompt/index.ts +0 -2
  338. package/src/listItem/Radio/ListItemRadio.spec.tsx +0 -66
  339. package/src/listItem/Radio/ListItemRadio.story.tsx +0 -111
  340. package/src/listItem/Radio/ListItemRadio.tsx +0 -33
  341. package/src/listItem/Radio/index.ts +0 -2
  342. package/src/listItem/Switch/ListItemSwitch.spec.tsx +0 -47
  343. package/src/listItem/Switch/ListItemSwitch.story.tsx +0 -79
  344. package/src/listItem/Switch/ListItemSwitch.tsx +0 -33
  345. package/src/listItem/Switch/index.ts +0 -2
  346. package/src/listItem/_stories/ListItem.focus.test.story.tsx +0 -265
  347. package/src/listItem/_stories/ListItem.layout.test.story.tsx +0 -354
  348. package/src/listItem/_stories/ListItem.scenarios.story.tsx +0 -228
  349. package/src/listItem/_stories/ListItem.story.tsx +0 -775
  350. package/src/listItem/_stories/ListItem.variants.test.story.tsx +0 -271
  351. package/src/listItem/_stories/helpers.tsx +0 -53
  352. package/src/listItem/_stories/subcomponents.tsx +0 -139
  353. package/src/listItem/index.ts +0 -14
  354. package/src/listItem/test-utils.tsx +0 -33
  355. package/src/listItem/useListItemControl.tsx +0 -18
  356. package/src/listItem/useListItemMedia.tsx +0 -13
  357. package/src/test-utils/assets/placeholder-landscape.svg +0 -1
  358. package/src/test-utils/assets/placeholder-portrait.svg +0 -1
@@ -1,339 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react-webpack5';
2
- import { Leaf, Taxi } from '@transferwise/icons';
3
- import { lorem10 } from '../../test-utils';
4
- import { ProfileType } from '../../common';
5
- import List from '../../list';
6
- import { ListItem } from '../ListItem';
7
- import {
8
- SB_LIST_ITEM_ADDITIONAL_INFO as INFO,
9
- SB_LIST_ITEM_CONTROLS as CONTROLS,
10
- } from '../_stories/subcomponents';
11
- import { disableControls } from '../_stories/helpers';
12
- import { ListItemAvatarViewProps } from './ListItemAvatarView';
13
-
14
- const hideControls = disableControls(['badge', 'children']);
15
-
16
- const SIZES = [32, 40, 48, 56, 72] as const;
17
- const BADGES = {
18
- 'Country flag badge': { flagCode: 'GBP' },
19
- 'StatusIcon badge': { status: 'warning' },
20
- 'Icon badge': { icon: <Taxi /> },
21
- 'Default action badge': {
22
- type: 'action',
23
- },
24
- 'Default reference badge': {
25
- type: 'reference',
26
- },
27
- 'Action badge with custom icon': {
28
- type: 'action',
29
- icon: <Taxi />,
30
- },
31
- 'Reference badge with custom icon': {
32
- type: 'reference',
33
- icon: <Taxi />,
34
- },
35
- 'Custom badge': {
36
- asset: (
37
- <div
38
- className="d-flex align-items-center justify-content-center"
39
- style={{
40
- backgroundColor: 'var(--color-bright-pink)',
41
- color: 'var(--color-interactive-primary)',
42
- width: '100%',
43
- height: '100%',
44
- }}
45
- >
46
- <Leaf />
47
- </div>
48
- ),
49
- },
50
- } as const;
51
-
52
- export default {
53
- component: ListItem.AvatarView,
54
- title: 'Content/ListItem/ListItem.AvatarView',
55
- parameters: {
56
- docs: {
57
- toc: true,
58
- },
59
- },
60
- args: {
61
- size: 48,
62
- selected: false,
63
- badge: { type: 'action' },
64
- notification: false,
65
- profileName: undefined,
66
- profileType: undefined,
67
- imgSrc: undefined,
68
- },
69
- argTypes: {
70
- size: {
71
- control: 'select',
72
- options: SIZES,
73
- description: 'Size of the avatar',
74
- },
75
- profileName: {
76
- control: 'text',
77
- description: 'Name used to generate initials when no image or icon is provided',
78
- },
79
- imgSrc: {
80
- control: 'text',
81
- description: 'URL of the profile image',
82
- },
83
- profileType: {
84
- control: 'select',
85
- options: [ProfileType.PERSONAL, ProfileType.BUSINESS],
86
- description: 'Type of profile for default icons',
87
- table: {
88
- type: { summary: 'ProfileType' },
89
- },
90
- },
91
- notification: {
92
- control: 'boolean',
93
- description: 'Shows notification dot',
94
- },
95
- selected: {
96
- control: 'boolean',
97
- description: 'Toggles selected state',
98
- },
99
- badge: {
100
- description: 'Badge configuration object',
101
- table: {
102
- type: { summary: 'AvatarViewBadgeProps' },
103
- },
104
- },
105
- children: {
106
- table: {
107
- type: { summary: 'ReactNode' },
108
- },
109
- },
110
- style: {
111
- table: {
112
- disable: true,
113
- },
114
- },
115
- },
116
- } satisfies Meta<ListItemAvatarViewProps>;
117
-
118
- type Story = StoryObj<ListItemAvatarViewProps>;
119
-
120
- export const Playground: Story = {
121
- tags: ['!autodocs'],
122
- render: (args: ListItemAvatarViewProps) => {
123
- return (
124
- <List>
125
- <ListItem
126
- title="John Smith"
127
- subtitle="Personal account"
128
- media={<ListItem.AvatarView {...args} />}
129
- control={CONTROLS.iconButton}
130
- additionalInfo={INFO.nonInteractive}
131
- />
132
- </List>
133
- );
134
- },
135
- };
136
-
137
- /**
138
- * AvatarView can display different types of content including icons, profile images, and initials. <br />
139
- * Refer to the [design documentation](https://wise.design/components/avatar#:~:text=56%2C%20%E2%80%A8and%2072.-,Media,-There%20are%204) for details.
140
- */
141
- export const ContentTypes: Story = {
142
- args: {
143
- badge: undefined,
144
- },
145
- argTypes: hideControls(['profileName', 'imgSrc', 'profileType']),
146
- parameters: {
147
- docs: {
148
- canvas: {
149
- sourceState: 'hidden',
150
- },
151
- },
152
- },
153
- render: (args) => {
154
- return (
155
- <List>
156
- <ListItem
157
- title="With icon"
158
- subtitle="Default icon content"
159
- media={
160
- <ListItem.AvatarView {...args}>
161
- <Taxi />
162
- </ListItem.AvatarView>
163
- }
164
- control={CONTROLS.iconButton}
165
- />
166
-
167
- <ListItem
168
- title="With profile image"
169
- subtitle="User profile picture."
170
- media={
171
- <ListItem.AvatarView
172
- {...args}
173
- imgSrc="../avatar-square-dude.webp"
174
- profileName="John Smith"
175
- />
176
- }
177
- control={CONTROLS.iconButton}
178
- />
179
-
180
- <ListItem
181
- title="With initials"
182
- subtitle="Fallback for when no profile image is available."
183
- media={<ListItem.AvatarView {...args} profileName="Sarah Johnson" />}
184
- control={CONTROLS.iconButton}
185
- />
186
-
187
- <ListItem
188
- title="Business profile"
189
- subtitle="Fallback for when no logo is available"
190
- media={<ListItem.AvatarView {...args} profileType={ProfileType.BUSINESS} />}
191
- control={CONTROLS.iconButton}
192
- />
193
-
194
- <ListItem
195
- title="Personal profile"
196
- subtitle="Fallback for when no personal data is available or when image fails to load."
197
- media={
198
- <ListItem.AvatarView
199
- {...args}
200
- profileType={ProfileType.PERSONAL}
201
- profileName="Alex Chen"
202
- />
203
- }
204
- control={CONTROLS.iconButton}
205
- />
206
- </List>
207
- );
208
- },
209
- };
210
-
211
- /**
212
- * AvatarView supports 5 sizes to fit different list item contexts: `32`, `40`, `48`, `56`, `72`. If decorated with a Badge, those will be sized accordingly as well. <br />
213
- * Please refer to the [design documentation](https://wise.design/components/list-item#avatar:~:text=of%20the%20avatar.-,Avatar%20sizes,-List%20item%20supports) for details on when to use which one.
214
- */
215
- export const Sizes: Story = {
216
- parameters: {
217
- docs: {
218
- canvas: {
219
- sourceState: 'hidden',
220
- },
221
- },
222
- },
223
- argTypes: hideControls(['profileName', 'imgSrc', 'profileType', 'size']),
224
- render: (args) => {
225
- return (
226
- <List>
227
- {SIZES.map((size) => (
228
- <ListItem
229
- key={size}
230
- title={`Size ${size}`}
231
- subtitle={lorem10}
232
- media={
233
- <ListItem.AvatarView {...args} size={size}>
234
- <Taxi />
235
- </ListItem.AvatarView>
236
- }
237
- control={CONTROLS.iconButton}
238
- />
239
- ))}
240
- </List>
241
- );
242
- },
243
- };
244
-
245
- /**
246
- * Similarly, AvatarView also support a notification dot, which also adjusts to the Avatar's size. <br />
247
- * **NB:** You cannot use notification and badge at the same time – badge will always take precedence over notification.
248
- */
249
- export const Notification: Story = {
250
- parameters: {
251
- docs: {
252
- canvas: {
253
- sourceState: 'hidden',
254
- },
255
- },
256
- },
257
- args: {
258
- badge: undefined,
259
- },
260
- argTypes: hideControls([
261
- 'profileName',
262
- 'imgSrc',
263
- 'profileType',
264
- 'size',
265
- 'notification',
266
- 'selected',
267
- ]),
268
- render: (args) => {
269
- return (
270
- <List>
271
- {SIZES.map((size) => (
272
- <ListItem
273
- key={size}
274
- title={`Size ${size}`}
275
- subtitle={lorem10}
276
- media={
277
- <ListItem.AvatarView {...args} size={size} notification>
278
- <Taxi />
279
- </ListItem.AvatarView>
280
- }
281
- control={CONTROLS.iconButton}
282
- />
283
- ))}
284
- </List>
285
- );
286
- },
287
- };
288
-
289
- /**
290
- * AvatarView supports different type of badges for additional context and information. <br />
291
- * Refer to the [design documentation](https://wise.design/components/avatar#:~:text=support%20the%20information.-,With%20badge,-Badges%20contain%20additional) for details.
292
- */
293
- export const Badges: Story = {
294
- args: {
295
- imgSrc: '../avatar-square-dude.webp',
296
- },
297
- argTypes: hideControls(['profileName', 'imgSrc', 'profileType', 'notification', 'selected']),
298
- parameters: {
299
- docs: {
300
- canvas: {
301
- sourceState: 'hidden',
302
- },
303
- },
304
- },
305
- render: (args) => {
306
- return (
307
- <List>
308
- {Object.entries(BADGES).map(([title, badge]) => (
309
- <ListItem
310
- key={title}
311
- title={title}
312
- subtitle={lorem10}
313
- media={<ListItem.AvatarView {...args} badge={badge} />}
314
- control={CONTROLS.iconButton}
315
- />
316
- ))}
317
- </List>
318
- );
319
- },
320
- };
321
-
322
- /**
323
- * AvatarView supports selected state for interactive contexts.
324
- */
325
- export const Selected: Story = {
326
- argTypes: hideControls(['profileName', 'imgSrc', 'profileType', 'notification', 'selected']),
327
- render: (args) => {
328
- return (
329
- <List>
330
- <ListItem
331
- title="Selected state"
332
- subtitle="Currently selected item"
333
- media={<ListItem.AvatarView profileName="Alex Chen" selected />}
334
- control={CONTROLS.iconButton}
335
- />
336
- </List>
337
- );
338
- },
339
- };
@@ -1,27 +0,0 @@
1
- import { clsx } from 'clsx';
2
- import AvatarViewComp, { AvatarViewProps } from '../../avatarView';
3
- import { useListItemMedia } from '../useListItemMedia';
4
-
5
- export type ListItemAvatarViewProps = Omit<AvatarViewProps, 'size' | 'interactive'> & {
6
- size?: 32 | 40 | 48 | 56 | 72;
7
- };
8
-
9
- /**
10
- * This component renders a single avatar. It's a thin wrapper around the
11
- * [AvatarView component](https://storybook.wise.design/?path=/docs/content-avatarview--docs), but offers only
12
- * a subset of its sizes, in line with the ListItem's constraints. <br />
13
- * <br />
14
- * Please refer to the [Design documentation](https://wise.design/components/list-item#avatar) for details.
15
- */
16
- export const AvatarView = ({ className, size = 48, ...props }: ListItemAvatarViewProps) => {
17
- useListItemMedia(size);
18
-
19
- return (
20
- <AvatarViewComp
21
- {...props}
22
- size={size}
23
- className={clsx('wds-list-item-media-avatar-view', className)}
24
- />
25
- );
26
- };
27
- AvatarView.displayName = 'ListItem.AvatarView';
@@ -1,2 +0,0 @@
1
- export type { ListItemAvatarViewProps } from './ListItemAvatarView';
2
- export { AvatarView } from './ListItemAvatarView';
@@ -1,68 +0,0 @@
1
- import { screen, mockMatchMedia } from '../../test-utils';
2
- import { Button as ItemButton } from './ListItemButton';
3
- import { ButtonPriority } from '../../button/Button.types';
4
- import { renderWithListItemContext, clearListItemMocks, mockSetControlType } from '../test-utils';
5
-
6
- mockMatchMedia();
7
-
8
- describe('ItemButton', () => {
9
- beforeEach(() => {
10
- clearListItemMocks();
11
- });
12
-
13
- it('always sets v2 to true', () => {
14
- renderWithListItemContext(<ItemButton priority="primary">Test Button</ItemButton>);
15
- const button = screen.getByRole('button');
16
- expect(button).toBeInTheDocument();
17
- expect(mockSetControlType).toHaveBeenCalledWith('button');
18
- });
19
-
20
- it('always sets size to "sm"', () => {
21
- renderWithListItemContext(<ItemButton priority="primary">Test Button</ItemButton>);
22
- const button = screen.getByRole('button');
23
- expect(button).toHaveClass('wds-Button--small');
24
- });
25
-
26
- it('supports all priorities', () => {
27
- const priorities: ButtonPriority[] = ['primary', 'secondary', 'tertiary'];
28
- priorities.forEach((priority) => {
29
- renderWithListItemContext(<ItemButton priority={priority}>Test {priority}</ItemButton>);
30
- const button = screen.getByRole('button', { name: `Test ${priority}` });
31
- expect(button).toBeInTheDocument();
32
- });
33
- });
34
-
35
- it('renders as a button by default', () => {
36
- renderWithListItemContext(<ItemButton>Click me</ItemButton>);
37
- const button = screen.getByRole('button');
38
- expect(button).toBeInTheDocument();
39
- expect(button.tagName).toBe('BUTTON');
40
- });
41
-
42
- it('renders as an anchor when href is provided', () => {
43
- renderWithListItemContext(<ItemButton href="https://example.com">Go to Example</ItemButton>);
44
- const link = screen.getByRole('link', { name: 'Go to Example' });
45
- expect(link).toBeInTheDocument();
46
- expect(link.tagName).toBe('A');
47
- expect(link).toHaveAttribute('href', 'https://example.com');
48
- });
49
-
50
- it('spreads additional props to the button', () => {
51
- renderWithListItemContext(<ItemButton aria-label="Custom Button">Custom</ItemButton>);
52
- const button = screen.getByRole('button', { name: 'Custom Button' });
53
- expect(button).toBeInTheDocument();
54
- expect(button).toHaveAttribute('aria-label', 'Custom Button');
55
- });
56
-
57
- it('spreads additional props to the anchor', () => {
58
- renderWithListItemContext(
59
- <ItemButton href="https://example.com" target="_blank" aria-label="Custom Link">
60
- Custom Link
61
- </ItemButton>,
62
- );
63
- const link = screen.getByRole('link', { name: 'Custom Link' });
64
- expect(link).toBeInTheDocument();
65
- expect(link).toHaveAttribute('href', 'https://example.com');
66
- expect(link).toHaveAttribute('target', '_blank');
67
- });
68
- });