@transferwise/components 46.113.1 → 46.114.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 (113) hide show
  1. package/build/i18n/cs.json +2 -0
  2. package/build/i18n/cs.json.js +2 -0
  3. package/build/i18n/cs.json.js.map +1 -1
  4. package/build/i18n/cs.json.mjs +2 -0
  5. package/build/i18n/cs.json.mjs.map +1 -1
  6. package/build/i18n/de.json +2 -0
  7. package/build/i18n/de.json.js +2 -0
  8. package/build/i18n/de.json.js.map +1 -1
  9. package/build/i18n/de.json.mjs +2 -0
  10. package/build/i18n/de.json.mjs.map +1 -1
  11. package/build/i18n/es.json +2 -0
  12. package/build/i18n/es.json.js +2 -0
  13. package/build/i18n/es.json.js.map +1 -1
  14. package/build/i18n/es.json.mjs +2 -0
  15. package/build/i18n/es.json.mjs.map +1 -1
  16. package/build/i18n/fr.json +2 -0
  17. package/build/i18n/fr.json.js +2 -0
  18. package/build/i18n/fr.json.js.map +1 -1
  19. package/build/i18n/fr.json.mjs +2 -0
  20. package/build/i18n/fr.json.mjs.map +1 -1
  21. package/build/i18n/hu.json +2 -0
  22. package/build/i18n/hu.json.js +2 -0
  23. package/build/i18n/hu.json.js.map +1 -1
  24. package/build/i18n/hu.json.mjs +2 -0
  25. package/build/i18n/hu.json.mjs.map +1 -1
  26. package/build/i18n/id.json +2 -0
  27. package/build/i18n/id.json.js +2 -0
  28. package/build/i18n/id.json.js.map +1 -1
  29. package/build/i18n/id.json.mjs +2 -0
  30. package/build/i18n/id.json.mjs.map +1 -1
  31. package/build/i18n/it.json +2 -0
  32. package/build/i18n/it.json.js +2 -0
  33. package/build/i18n/it.json.js.map +1 -1
  34. package/build/i18n/it.json.mjs +2 -0
  35. package/build/i18n/it.json.mjs.map +1 -1
  36. package/build/i18n/ja.json +2 -0
  37. package/build/i18n/ja.json.js +2 -0
  38. package/build/i18n/ja.json.js.map +1 -1
  39. package/build/i18n/ja.json.mjs +2 -0
  40. package/build/i18n/ja.json.mjs.map +1 -1
  41. package/build/i18n/nl.json +2 -0
  42. package/build/i18n/nl.json.js +2 -0
  43. package/build/i18n/nl.json.js.map +1 -1
  44. package/build/i18n/nl.json.mjs +2 -0
  45. package/build/i18n/nl.json.mjs.map +1 -1
  46. package/build/i18n/pl.json +2 -0
  47. package/build/i18n/pl.json.js +2 -0
  48. package/build/i18n/pl.json.js.map +1 -1
  49. package/build/i18n/pl.json.mjs +2 -0
  50. package/build/i18n/pl.json.mjs.map +1 -1
  51. package/build/i18n/pt.json +2 -0
  52. package/build/i18n/pt.json.js +2 -0
  53. package/build/i18n/pt.json.js.map +1 -1
  54. package/build/i18n/pt.json.mjs +2 -0
  55. package/build/i18n/pt.json.mjs.map +1 -1
  56. package/build/i18n/ro.json +2 -0
  57. package/build/i18n/ro.json.js +2 -0
  58. package/build/i18n/ro.json.js.map +1 -1
  59. package/build/i18n/ro.json.mjs +2 -0
  60. package/build/i18n/ro.json.mjs.map +1 -1
  61. package/build/i18n/ru.json +2 -0
  62. package/build/i18n/ru.json.js +2 -0
  63. package/build/i18n/ru.json.js.map +1 -1
  64. package/build/i18n/ru.json.mjs +2 -0
  65. package/build/i18n/ru.json.mjs.map +1 -1
  66. package/build/i18n/th.json +2 -0
  67. package/build/i18n/th.json.js +2 -0
  68. package/build/i18n/th.json.js.map +1 -1
  69. package/build/i18n/th.json.mjs +2 -0
  70. package/build/i18n/th.json.mjs.map +1 -1
  71. package/build/i18n/tr.json +2 -0
  72. package/build/i18n/tr.json.js +2 -0
  73. package/build/i18n/tr.json.js.map +1 -1
  74. package/build/i18n/tr.json.mjs +2 -0
  75. package/build/i18n/tr.json.mjs.map +1 -1
  76. package/build/i18n/zh-CN.json +2 -0
  77. package/build/i18n/zh-CN.json.js +2 -0
  78. package/build/i18n/zh-CN.json.js.map +1 -1
  79. package/build/i18n/zh-CN.json.mjs +2 -0
  80. package/build/i18n/zh-CN.json.mjs.map +1 -1
  81. package/build/i18n/zh-HK.json +2 -0
  82. package/build/i18n/zh-HK.json.js +2 -0
  83. package/build/i18n/zh-HK.json.js.map +1 -1
  84. package/build/i18n/zh-HK.json.mjs +2 -0
  85. package/build/i18n/zh-HK.json.mjs.map +1 -1
  86. package/build/table/TableCell.js +5 -4
  87. package/build/table/TableCell.js.map +1 -1
  88. package/build/table/TableCell.mjs +5 -4
  89. package/build/table/TableCell.mjs.map +1 -1
  90. package/build/types/table/TableCell.d.ts +6 -3
  91. package/build/types/table/TableCell.d.ts.map +1 -1
  92. package/package.json +4 -4
  93. package/src/i18n/cs.json +2 -0
  94. package/src/i18n/de.json +2 -0
  95. package/src/i18n/es.json +2 -0
  96. package/src/i18n/fr.json +2 -0
  97. package/src/i18n/hu.json +2 -0
  98. package/src/i18n/id.json +2 -0
  99. package/src/i18n/it.json +2 -0
  100. package/src/i18n/ja.json +2 -0
  101. package/src/i18n/nl.json +2 -0
  102. package/src/i18n/pl.json +2 -0
  103. package/src/i18n/pt.json +2 -0
  104. package/src/i18n/ro.json +2 -0
  105. package/src/i18n/ru.json +2 -0
  106. package/src/i18n/th.json +2 -0
  107. package/src/i18n/tr.json +2 -0
  108. package/src/i18n/zh-CN.json +2 -0
  109. package/src/i18n/zh-HK.json +2 -0
  110. package/src/table/Table.spec.tsx +0 -1
  111. package/src/table/Table.story.tsx +12 -1
  112. package/src/table/TableCell.spec.tsx +2 -2
  113. package/src/table/TableCell.tsx +11 -7
@@ -5,7 +5,7 @@ import React, { ImgHTMLAttributes } from 'react';
5
5
  import { clsx } from 'clsx';
6
6
  import Body from '../body';
7
7
  import Money, { MoneyProps } from '../money';
8
- import AvatarView from '../avatarView';
8
+ import AvatarView, { AvatarViewProps } from '../avatarView';
9
9
 
10
10
  interface TableCellTypeProp {
11
11
  type: 'leading' | 'text' | 'currency' | 'status' | 'media';
@@ -30,9 +30,10 @@ export interface TableCellLeading
30
30
  extends TableCellTypeProp,
31
31
  TableCellTextProps,
32
32
  TableCellStatusProp {
33
- avatar?: {
34
- src?: string;
35
- profileName?: string | null;
33
+ avatar?: Pick<AvatarViewProps, 'badge' | 'imgSrc' | 'profileName' | 'profileType'> & {
34
+ asset?: AvatarViewProps['children'];
35
+ /** @deprecated Use `"imgSrc" instead. */
36
+ src?: AvatarViewProps['imgSrc'];
36
37
  };
37
38
  }
38
39
 
@@ -43,6 +44,7 @@ export interface TableCellText extends TableCellTypeProp, TableCellStatusProp {
43
44
  export interface TableCellCurrency extends TableCellTypeProp, TableCellStatusProp {
44
45
  primaryCurrency?: MoneyProps;
45
46
  secondaryCurrency?: MoneyProps;
47
+ flag?: boolean;
46
48
  }
47
49
 
48
50
  export interface TableCellStatus extends TableCellTypeProp, TableCellTextProps {
@@ -65,13 +67,15 @@ const TableCell = ({ cell, alignment = 'left', className, colSpan, children }: T
65
67
  const getContentMedia = () => {
66
68
  let mediaContent = null;
67
69
 
68
- if (cell?.type === 'leading' && (cell?.avatar?.src || cell?.avatar?.profileName)) {
70
+ if (cell?.type === 'leading' && cell?.avatar) {
69
71
  mediaContent = (
70
- <AvatarView profileName={cell?.avatar?.profileName} size={40} imgSrc={cell?.avatar?.src} />
72
+ <AvatarView size={40} {...cell.avatar} imgSrc={cell.avatar.imgSrc ?? cell.avatar.src}>
73
+ {cell.avatar.asset}
74
+ </AvatarView>
71
75
  );
72
76
  }
73
77
 
74
- if (cell?.type === 'currency' && cell?.primaryCurrency?.currency) {
78
+ if (cell?.type === 'currency' && cell?.primaryCurrency?.currency && cell?.flag !== false) {
75
79
  mediaContent = (
76
80
  <Flag code={cell?.primaryCurrency?.currency?.toLowerCase()} intrinsicSize={24} />
77
81
  );