@transferwise/components 46.125.0 → 46.126.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 (141) hide show
  1. package/build/avatarView/AvatarView.js.map +1 -1
  2. package/build/avatarView/AvatarView.mjs.map +1 -1
  3. package/build/common/locale/index.js +13 -0
  4. package/build/common/locale/index.js.map +1 -1
  5. package/build/common/locale/index.mjs +13 -1
  6. package/build/common/locale/index.mjs.map +1 -1
  7. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js +31 -1
  8. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js.map +1 -1
  9. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs +32 -2
  10. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs.map +1 -1
  11. package/build/field/Field.js +1 -0
  12. package/build/field/Field.js.map +1 -1
  13. package/build/field/Field.mjs +1 -0
  14. package/build/field/Field.mjs.map +1 -1
  15. package/build/index.js +3 -0
  16. package/build/index.js.map +1 -1
  17. package/build/index.mjs +2 -1
  18. package/build/index.mjs.map +1 -1
  19. package/build/inputs/Input.js.map +1 -1
  20. package/build/inputs/Input.mjs.map +1 -1
  21. package/build/inputs/SearchInput.js.map +1 -1
  22. package/build/inputs/SearchInput.mjs.map +1 -1
  23. package/build/inputs/SelectInput.js.map +1 -1
  24. package/build/inputs/SelectInput.mjs.map +1 -1
  25. package/build/inputs/TextArea.js.map +1 -1
  26. package/build/inputs/TextArea.mjs.map +1 -1
  27. package/build/listItem/ListItem.js +2 -2
  28. package/build/listItem/ListItem.js.map +1 -1
  29. package/build/listItem/ListItem.mjs +2 -2
  30. package/build/listItem/ListItem.mjs.map +1 -1
  31. package/build/listItem/Prompt/ListItemPrompt.js +1 -0
  32. package/build/listItem/Prompt/ListItemPrompt.js.map +1 -1
  33. package/build/listItem/Prompt/ListItemPrompt.mjs +1 -0
  34. package/build/listItem/Prompt/ListItemPrompt.mjs.map +1 -1
  35. package/build/main.css +31 -0
  36. package/build/moneyInput/MoneyInput.js +6 -1
  37. package/build/moneyInput/MoneyInput.js.map +1 -1
  38. package/build/moneyInput/MoneyInput.mjs +6 -1
  39. package/build/moneyInput/MoneyInput.mjs.map +1 -1
  40. package/build/prompt/ActionPrompt/ActionPrompt.js +27 -4
  41. package/build/prompt/ActionPrompt/ActionPrompt.js.map +1 -1
  42. package/build/prompt/ActionPrompt/ActionPrompt.mjs +27 -4
  43. package/build/prompt/ActionPrompt/ActionPrompt.mjs.map +1 -1
  44. package/build/prompt/InfoPrompt/InfoPrompt.js +113 -0
  45. package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -0
  46. package/build/prompt/InfoPrompt/InfoPrompt.mjs +111 -0
  47. package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -0
  48. package/build/prompt/PrimitivePrompt/PrimitivePrompt.js.map +1 -1
  49. package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs.map +1 -1
  50. package/build/radioOption/RadioOption.js.map +1 -1
  51. package/build/radioOption/RadioOption.mjs.map +1 -1
  52. package/build/slidingPanel/SlidingPanel.js.map +1 -1
  53. package/build/slidingPanel/SlidingPanel.mjs.map +1 -1
  54. package/build/statusIcon/StatusIcon.js +2 -0
  55. package/build/statusIcon/StatusIcon.js.map +1 -1
  56. package/build/statusIcon/StatusIcon.mjs +2 -0
  57. package/build/statusIcon/StatusIcon.mjs.map +1 -1
  58. package/build/styles/main.css +31 -0
  59. package/build/styles/prompt/InfoPrompt/InfoPrompt.css +31 -0
  60. package/build/table/TableCell.js.map +1 -1
  61. package/build/table/TableCell.mjs.map +1 -1
  62. package/build/typeahead/Typeahead.js +1 -0
  63. package/build/typeahead/Typeahead.js.map +1 -1
  64. package/build/typeahead/Typeahead.mjs +1 -0
  65. package/build/typeahead/Typeahead.mjs.map +1 -1
  66. package/build/types/avatarView/AvatarView.d.ts +1 -1
  67. package/build/types/avatarView/AvatarView.d.ts.map +1 -1
  68. package/build/types/common/locale/index.d.ts +8 -0
  69. package/build/types/common/locale/index.d.ts.map +1 -1
  70. package/build/types/expressiveMoneyInput/currencySelector/CurrencySelector.d.ts.map +1 -1
  71. package/build/types/index.d.ts +3 -2
  72. package/build/types/index.d.ts.map +1 -1
  73. package/build/types/inputs/Input.d.ts.map +1 -1
  74. package/build/types/inputs/SearchInput.d.ts.map +1 -1
  75. package/build/types/inputs/SelectInput.d.ts +1 -1
  76. package/build/types/inputs/SelectInput.d.ts.map +1 -1
  77. package/build/types/inputs/TextArea.d.ts.map +1 -1
  78. package/build/types/moneyInput/MoneyInput.d.ts.map +1 -1
  79. package/build/types/primitives/PrimitiveAnchor/PrimitiveAnchor.types.d.ts.map +1 -1
  80. package/build/types/primitives/PrimitiveButton/PrimitiveButton.types.d.ts.map +1 -1
  81. package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts +4 -2
  82. package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts.map +1 -1
  83. package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts +56 -0
  84. package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts.map +1 -0
  85. package/build/types/prompt/InfoPrompt/index.d.ts +3 -0
  86. package/build/types/prompt/InfoPrompt/index.d.ts.map +1 -0
  87. package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts +5 -5
  88. package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts.map +1 -1
  89. package/build/types/prompt/index.d.ts +2 -0
  90. package/build/types/prompt/index.d.ts.map +1 -1
  91. package/build/types/radioOption/RadioOption.d.ts.map +1 -1
  92. package/build/types/slidingPanel/SlidingPanel.d.ts.map +1 -1
  93. package/build/types/statusIcon/StatusIcon.d.ts +2 -1
  94. package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
  95. package/build/types/table/TableCell.d.ts.map +1 -1
  96. package/build/types/withDisplayFormat/WithDisplayFormat.d.ts.map +1 -1
  97. package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
  98. package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
  99. package/package.json +2 -2
  100. package/src/avatarLayout/AvatarLayout.story.tsx +3 -3
  101. package/src/avatarView/AvatarView.story.tsx +29 -24
  102. package/src/avatarView/AvatarView.tsx +1 -1
  103. package/src/common/bottomSheet/BottomSheet.test.story.tsx +98 -0
  104. package/src/common/locale/index.test.ts +36 -1
  105. package/src/common/locale/index.ts +13 -0
  106. package/src/expressiveMoneyInput/currencySelector/CurrencySelector.tsx +5 -1
  107. package/src/index.ts +3 -1
  108. package/src/inputs/Input.tsx +8 -9
  109. package/src/inputs/SearchInput.tsx +8 -9
  110. package/src/inputs/SelectInput.test.story.tsx +86 -0
  111. package/src/inputs/SelectInput.tsx +1 -1
  112. package/src/inputs/TextArea.tsx +6 -7
  113. package/src/listItem/ListItem.tsx +2 -2
  114. package/src/main.css +31 -0
  115. package/src/main.less +2 -1
  116. package/src/moneyInput/MoneyInput.test.story.tsx +104 -0
  117. package/src/moneyInput/MoneyInput.tsx +20 -2
  118. package/src/primitives/PrimitiveAnchor/PrimitiveAnchor.types.ts +1 -3
  119. package/src/primitives/PrimitiveButton/PrimitiveButton.types.ts +1 -3
  120. package/src/prompt/ActionPrompt/ActionPrompt.accessibility.docs.mdx +65 -0
  121. package/src/prompt/ActionPrompt/ActionPrompt.less +1 -1
  122. package/src/prompt/ActionPrompt/ActionPrompt.story.tsx +4 -1
  123. package/src/prompt/ActionPrompt/ActionPrompt.test.story.tsx +147 -0
  124. package/src/prompt/ActionPrompt/ActionPrompt.test.tsx +2 -7
  125. package/src/prompt/ActionPrompt/ActionPrompt.tsx +48 -7
  126. package/src/prompt/InfoPrompt/InfoPrompt.css +31 -0
  127. package/src/prompt/InfoPrompt/InfoPrompt.less +37 -0
  128. package/src/prompt/InfoPrompt/InfoPrompt.story.tsx +312 -0
  129. package/src/prompt/InfoPrompt/InfoPrompt.test.story.tsx +246 -0
  130. package/src/prompt/InfoPrompt/InfoPrompt.test.tsx +224 -0
  131. package/src/prompt/InfoPrompt/InfoPrompt.tsx +148 -0
  132. package/src/prompt/InfoPrompt/index.ts +2 -0
  133. package/src/prompt/PrimitivePrompt/PrimitivePrompt.less +1 -1
  134. package/src/prompt/PrimitivePrompt/PrimitivePrompt.tsx +5 -5
  135. package/src/prompt/index.ts +5 -0
  136. package/src/radioOption/RadioOption.tsx +2 -1
  137. package/src/slidingPanel/SlidingPanel.tsx +4 -2
  138. package/src/ssr.test.tsx +2 -0
  139. package/src/statusIcon/StatusIcon.tsx +8 -1
  140. package/src/table/TableCell.tsx +1 -3
  141. package/src/withDisplayFormat/WithDisplayFormat.tsx +13 -14
package/src/ssr.test.tsx CHANGED
@@ -73,6 +73,7 @@ const excluded = new Set<ExposedLibraryKeysType | string>([
73
73
  'getLangFromLocale',
74
74
  'getCountryFromLocale',
75
75
  'getDirectionFromLocale',
76
+ 'getLocaleCurrencyName',
76
77
  'isServerSide',
77
78
  'isBrowser',
78
79
 
@@ -91,6 +92,7 @@ describe('Server side rendering', () => {
91
92
 
92
93
  // stick all possible properties we might need to render all components in here
93
94
  const allProps: Record<string, unknown> = {
95
+ actionPrimary: { label: 'Action', onClick: jest.fn(), href: '#' },
94
96
  currencies: [],
95
97
  currencySelector: { options: [] },
96
98
  steps: [],
@@ -18,6 +18,7 @@ type LegacySizes = SizeSmall | SizeMedium | SizeLarge;
18
18
  export type StatusIconSentiment = Sentiment | Status.PENDING;
19
19
 
20
20
  export type StatusIconProps = {
21
+ id?: string;
21
22
  sentiment?: `${StatusIconSentiment}`;
22
23
  size?: LegacySizes | 16 | 24 | 32 | 40 | 48 | 56 | 72;
23
24
  /**
@@ -34,7 +35,12 @@ const mapLegacySize = {
34
35
  [String(Size.LARGE)]: 48,
35
36
  } satisfies Record<string, CircleProps['size']>;
36
37
 
37
- const StatusIcon = ({ sentiment = 'neutral', size: sizeProp = 40, iconLabel }: StatusIconProps) => {
38
+ const StatusIcon = ({
39
+ id,
40
+ sentiment = 'neutral',
41
+ size: sizeProp = 40,
42
+ iconLabel,
43
+ }: StatusIconProps) => {
38
44
  const intl = useIntl();
39
45
 
40
46
  const iconMetaBySentiment: Record<
@@ -100,6 +106,7 @@ const StatusIcon = ({ sentiment = 'neutral', size: sizeProp = 40, iconLabel }: S
100
106
  size={isTinyViewport && size < 40 ? 32 : size}
101
107
  data-testid="status-icon"
102
108
  className={clsx('status-circle', sentiment)}
109
+ id={id}
103
110
  >
104
111
  <Icon
105
112
  className={clsx('status-icon', iconColor)}
@@ -27,9 +27,7 @@ export interface TableCellMedia extends TableCellTypeProp, TableCellTextProps {
27
27
  }
28
28
 
29
29
  export interface TableCellLeading
30
- extends TableCellTypeProp,
31
- TableCellTextProps,
32
- TableCellStatusProp {
30
+ extends TableCellTypeProp, TableCellTextProps, TableCellStatusProp {
33
31
  avatar?: Pick<AvatarViewProps, 'badge' | 'imgSrc' | 'profileName' | 'profileType'> & {
34
32
  asset?: AvatarViewProps['children'];
35
33
  /** @deprecated Use `"imgSrc" instead. */
@@ -36,20 +36,19 @@ interface WithDisplayFormatState {
36
36
  selectionEnd: number;
37
37
  }
38
38
 
39
- export interface WithDisplayFormatProps<T extends TextElementProps = TextElementProps>
40
- extends Pick<
41
- TextElementProps,
42
- | 'className'
43
- | 'disabled'
44
- | 'id'
45
- | 'maxLength'
46
- | 'minLength'
47
- | 'name'
48
- | 'placeholder'
49
- | 'readOnly'
50
- | 'required'
51
- | 'inputMode'
52
- > {
39
+ export interface WithDisplayFormatProps<T extends TextElementProps = TextElementProps> extends Pick<
40
+ TextElementProps,
41
+ | 'className'
42
+ | 'disabled'
43
+ | 'id'
44
+ | 'maxLength'
45
+ | 'minLength'
46
+ | 'name'
47
+ | 'placeholder'
48
+ | 'readOnly'
49
+ | 'required'
50
+ | 'inputMode'
51
+ > {
53
52
  value?: string;
54
53
  displayPattern: string;
55
54
  /**