@transferwise/components 46.101.0 → 46.103.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 (171) hide show
  1. package/build/button/Button.js +1 -0
  2. package/build/button/Button.js.map +1 -1
  3. package/build/button/Button.mjs +1 -0
  4. package/build/button/Button.mjs.map +1 -1
  5. package/build/common/RadioButton/RadioButton.js +5 -2
  6. package/build/common/RadioButton/RadioButton.js.map +1 -1
  7. package/build/common/RadioButton/RadioButton.mjs +5 -2
  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 +2 -3
  14. package/build/flowNavigation/animatedLabel/AnimatedLabel.js.map +1 -1
  15. package/build/flowNavigation/animatedLabel/AnimatedLabel.mjs +1 -2
  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 -2
  82. package/build/index.mjs +1 -1
  83. package/build/list/List.js +21 -0
  84. package/build/list/List.js.map +1 -0
  85. package/build/list/List.mjs +17 -0
  86. package/build/list/List.mjs.map +1 -0
  87. package/build/main.css +4 -2
  88. package/build/styles/avatarView/AvatarView.css +3 -1
  89. package/build/styles/button/Button.css +1 -1
  90. package/build/styles/main.css +4 -2
  91. package/build/switch/Switch.js +3 -1
  92. package/build/switch/Switch.js.map +1 -1
  93. package/build/switch/Switch.mjs +3 -1
  94. package/build/switch/Switch.mjs.map +1 -1
  95. package/build/test-utils/assets/placeholder-landscape.svg +1 -0
  96. package/build/test-utils/assets/placeholder-portrait.svg +1 -0
  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 +3 -1
  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 +3 -0
  108. package/build/types/image/Image.d.ts.map +1 -1
  109. package/build/types/image/index.d.ts +1 -0
  110. package/build/types/image/index.d.ts.map +1 -1
  111. package/build/types/index.d.ts +4 -2
  112. package/build/types/index.d.ts.map +1 -1
  113. package/build/types/legacylistItem/index.d.ts +0 -2
  114. package/build/types/legacylistItem/index.d.ts.map +1 -1
  115. package/build/types/list/List.d.ts +11 -0
  116. package/build/types/list/List.d.ts.map +1 -0
  117. package/build/types/list/index.d.ts +3 -0
  118. package/build/types/list/index.d.ts.map +1 -0
  119. package/build/types/switch/Switch.d.ts +3 -1
  120. package/build/types/switch/Switch.d.ts.map +1 -1
  121. package/package.json +1 -1
  122. package/src/avatarView/AvatarView.css +3 -1
  123. package/src/avatarView/AvatarView.less +2 -1
  124. package/src/button/Button.css +1 -1
  125. package/src/button/Button.less +1 -1
  126. package/src/button/Button.spec.tsx +18 -0
  127. package/src/button/Button.story.tsx +9 -4
  128. package/src/button/Button.tsx +5 -1
  129. package/src/button/Button.types.ts +1 -1
  130. package/src/button/index.ts +1 -1
  131. package/src/checkboxButton/CheckboxButton.story.tsx +27 -8
  132. package/src/common/RadioButton/RadioButton.tsx +6 -1
  133. package/src/common/initials.spec.tsx +13 -0
  134. package/src/common/initials.ts +5 -0
  135. package/src/flowNavigation/animatedLabel/AnimatedLabel.tsx +1 -1
  136. package/src/i18n/de.json +2 -0
  137. package/src/i18n/fr.json +2 -0
  138. package/src/i18n/hu.json +2 -0
  139. package/src/i18n/it.json +2 -0
  140. package/src/i18n/ja.json +2 -0
  141. package/src/i18n/pl.json +2 -0
  142. package/src/i18n/pt.json +2 -0
  143. package/src/i18n/ro.json +2 -0
  144. package/src/i18n/ru.json +2 -0
  145. package/src/i18n/tr.json +2 -0
  146. package/src/i18n/zh-CN.json +2 -0
  147. package/src/i18n/zh-HK.json +2 -0
  148. package/src/iconButton/IconButton.story.tsx +1 -1
  149. package/src/iconButton/IconButton.tsx +1 -1
  150. package/src/image/Image.tsx +3 -0
  151. package/src/image/index.ts +1 -0
  152. package/src/index.ts +4 -2
  153. package/src/legacylistItem/LegacyListItem.story.tsx +2 -2
  154. package/src/legacylistItem/LegacyListItem.tests.story.tsx +2 -1
  155. package/src/legacylistItem/index.ts +0 -2
  156. package/src/list/List.spec.tsx +52 -0
  157. package/src/list/List.story.tsx +20 -0
  158. package/src/list/List.tsx +15 -0
  159. package/src/list/index.ts +2 -0
  160. package/src/main.css +4 -2
  161. package/src/switch/Switch.tsx +6 -2
  162. package/src/test-utils/assets/placeholder-landscape.svg +1 -0
  163. package/src/test-utils/assets/placeholder-portrait.svg +1 -0
  164. package/build/legacylistItem/List.js +0 -17
  165. package/build/legacylistItem/List.js.map +0 -1
  166. package/build/legacylistItem/List.mjs +0 -15
  167. package/build/legacylistItem/List.mjs.map +0 -1
  168. package/build/types/legacylistItem/List.d.ts +0 -6
  169. package/build/types/legacylistItem/List.d.ts.map +0 -1
  170. package/src/legacylistItem/List.tsx +0 -10
  171. package/src/test-utils/Parameters.d.ts +0 -77
package/src/main.css CHANGED
@@ -454,7 +454,8 @@
454
454
  right: 0;
455
455
  }
456
456
  .np-avatar-view .np-avatar-view-content {
457
- color: var(--color-interactive-primary);
457
+ color: #37517e;
458
+ color: var(--color-content-primary);
458
459
  }
459
460
  .np-avatar-view-interactive {
460
461
  cursor: pointer;
@@ -462,6 +463,7 @@
462
463
  .np-avatar-view-interactive .np-circle {
463
464
  background-color: rgba(134,167,189,0.10196);
464
465
  background-color: var(--color-background-neutral);
466
+ color: var(--color-interactive-primary);
465
467
  }
466
468
  .np-avatar-view-non-interactive .np-circle {
467
469
  background-color: transparent;
@@ -739,7 +741,7 @@
739
741
  justify-content: center;
740
742
  vertical-align: middle;
741
743
  text-align: center;
742
- white-space: nowrap;
744
+ white-space: normal;
743
745
  word-wrap: break-word;
744
746
  -webkit-appearance: none;
745
747
  -moz-appearance: none;
@@ -12,13 +12,15 @@ export type SwitchProps = CommonProps & {
12
12
  'aria-label'?: string;
13
13
  /** A reference to a label that describes the purpose of the switch. Ignored if aria-label is provided */
14
14
  'aria-labelledby'?: string;
15
+ /** Identifies the element(s) that describes the element on which the attribute is set */
16
+ 'aria-describedby'?: string;
15
17
  /** Whether the switch is checked or not */
16
18
  checked?: boolean;
17
19
  disabled?: boolean;
18
20
  /** ID to apply to the switch container */
19
21
  id?: string;
20
22
  /** Function called when the switch is toggled */
21
- onClick: (event?: MouseEvent<HTMLSpanElement>) => void;
23
+ onClick: (event?: MouseEvent<HTMLButtonElement>) => void;
22
24
  };
23
25
 
24
26
  const Switch = (props: SwitchProps) => {
@@ -30,6 +32,7 @@ const Switch = (props: SwitchProps) => {
30
32
  id = inputAttributes.id,
31
33
  'aria-label': ariaLabel,
32
34
  'aria-labelledby': ariaLabelledbyProp,
35
+ 'aria-describedby': ariaDescribedbyProp,
33
36
  onClick,
34
37
  disabled,
35
38
  } = props;
@@ -52,9 +55,10 @@ const Switch = (props: SwitchProps) => {
52
55
  role="switch"
53
56
  {...inputAttributes}
54
57
  id={id}
55
- aria-checked={checked}
58
+ aria-checked={Boolean(checked)}
56
59
  aria-label={ariaLabel}
57
60
  aria-labelledby={ariaLabelledby}
61
+ aria-describedby={ariaDescribedbyProp}
58
62
  disabled={disabled}
59
63
  onClick={!disabled ? onClick : undefined}
60
64
  >
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 400 288"><rect width="394" height="282" x="3" y="3" fill="#9FE870" stroke="#163300" stroke-width="6" rx="29"/><path fill="#163300" stroke="#163300" stroke-width="2" d="m271 74-50 138h-26l41-115v-1h-57l1 2 12 20-18 21-2 2h31l-7 20h-67l38-45 1-2h-2l-22-40h127Z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 288 400"><rect width="282" height="394" x="3" y="3" fill="#9FE870" stroke="#163300" stroke-width="6" rx="29"/><path fill="#163300" stroke="#163300" stroke-width="2" d="m216 131-49 137h-27l41-114 1-2h-57l1 2 12 20-19 21-1 2h31l-7 20H74l38-45 2-1h-2l-23-40h127Z"/></svg>
@@ -1,17 +0,0 @@
1
- 'use strict';
2
-
3
- var clsx = require('clsx');
4
- var jsxRuntime = require('react/jsx-runtime');
5
-
6
- function List({
7
- className,
8
- children
9
- }) {
10
- return /*#__PURE__*/jsxRuntime.jsx("ul", {
11
- className: clsx.clsx(className, 'list-unstyled'),
12
- children: children
13
- });
14
- }
15
-
16
- exports.List = List;
17
- //# sourceMappingURL=List.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"List.js","sources":["../../src/legacylistItem/List.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nexport interface ListProps {\n className?: string;\n children?: React.ReactNode;\n}\n\nexport function List({ className, children }: ListProps) {\n return <ul className={clsx(className, 'list-unstyled')}>{children}</ul>;\n}\n"],"names":["List","className","children","_jsx","clsx"],"mappings":";;;;;SAOgBA,IAAIA,CAAC;EAAEC,SAAS;AAAEC,EAAAA;AAAQ,CAAa,EAAA;AACrD,EAAA,oBAAOC,cAAA,CAAA,IAAA,EAAA;AAAIF,IAAAA,SAAS,EAAEG,SAAI,CAACH,SAAS,EAAE,eAAe,CAAE;AAAAC,IAAAA,QAAA,EAAEA;AAAQ,GAAK,CAAC;AACzE;;;;"}
@@ -1,15 +0,0 @@
1
- import { clsx } from 'clsx';
2
- import { jsx } from 'react/jsx-runtime';
3
-
4
- function List({
5
- className,
6
- children
7
- }) {
8
- return /*#__PURE__*/jsx("ul", {
9
- className: clsx(className, 'list-unstyled'),
10
- children: children
11
- });
12
- }
13
-
14
- export { List };
15
- //# sourceMappingURL=List.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"List.mjs","sources":["../../src/legacylistItem/List.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nexport interface ListProps {\n className?: string;\n children?: React.ReactNode;\n}\n\nexport function List({ className, children }: ListProps) {\n return <ul className={clsx(className, 'list-unstyled')}>{children}</ul>;\n}\n"],"names":["List","className","children","_jsx","clsx"],"mappings":";;;SAOgBA,IAAIA,CAAC;EAAEC,SAAS;AAAEC,EAAAA;AAAQ,CAAa,EAAA;AACrD,EAAA,oBAAOC,GAAA,CAAA,IAAA,EAAA;AAAIF,IAAAA,SAAS,EAAEG,IAAI,CAACH,SAAS,EAAE,eAAe,CAAE;AAAAC,IAAAA,QAAA,EAAEA;AAAQ,GAAK,CAAC;AACzE;;;;"}
@@ -1,6 +0,0 @@
1
- export interface ListProps {
2
- className?: string;
3
- children?: React.ReactNode;
4
- }
5
- export declare function List({ className, children }: ListProps): import("react").JSX.Element;
6
- //# sourceMappingURL=List.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../src/legacylistItem/List.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,SAAS;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,wBAAgB,IAAI,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,SAAS,+BAEtD"}
@@ -1,10 +0,0 @@
1
- import { clsx } from 'clsx';
2
-
3
- export interface ListProps {
4
- className?: string;
5
- children?: React.ReactNode;
6
- }
7
-
8
- export function List({ className, children }: ListProps) {
9
- return <ul className={clsx(className, 'list-unstyled')}>{children}</ul>;
10
- }
@@ -1,77 +0,0 @@
1
- declare module '@storybook/react' {
2
- interface Parameters {
3
- /** Prefer using `storyConfig` for configuring variants */
4
- variants?: (
5
- | 'default'
6
- | 'light'
7
- | 'dark'
8
- | 'bright-green'
9
- | 'forest-green'
10
- | 'rtl'
11
- | (string & Record<string, unknown>)
12
- )[];
13
- /** Used by Chromatic */
14
- chromatic?: ChromaticParameters;
15
- viewport?: {
16
- viewports?: Record<string, unknown>;
17
- defaultViewport?: string;
18
- };
19
- }
20
- }
21
-
22
- /**
23
- * Derived from Chromatic's config type definitions
24
- *
25
- * @see https://github.com/chromaui/chromatic-cli/blob/main/storybook-addon.d.ts
26
- */
27
- export interface ChromaticParameters {
28
- /**
29
- * Prefer using `storyConfig` for configuring viewports if possible.
30
- *
31
- * To set a viewport, specify one or more screen widths to the
32
- * `chromatic.viewports` parameter. When left unspecified, Chromatic
33
- * uses a default value of `[1200]`. Use `[414]` for 'Large mobile'
34
- * viewport width.
35
- *
36
- * @default [1200]
37
- */
38
- viewports?: [414] | [414, 1200];
39
-
40
- /**
41
- * You can omit stories entirely from Chromatic testing using the disable story parameter.
42
- */
43
- disable?: boolean;
44
-
45
- /**
46
- * Chromatic will pause CSS animations and reset them to their beginning state.
47
- *
48
- * Some animations are used to "animate in" visible elements. To specify that Chromatic should pause the
49
- * animation at the end, use the `pauseAnimationAtEnd` story parameter.
50
- */
51
- pauseAnimationAtEnd?: boolean;
52
-
53
- /**
54
- * Use story-level delay to ensure a minimum amount of time (in milliseconds) has passed before Chromatic takes a
55
- * screenshot.
56
- */
57
- delay?: number;
58
-
59
- /**
60
- * The diffThreshold parameter allows you to fine tune the threshold for visual change between snapshots before
61
- * they’re flagged by Chromatic. Sometimes you need assurance to the sub-pixel and other times you want to skip
62
- * visual noise generated by non-deterministic rendering such as anti-aliasing.
63
- *
64
- * 0 is the most accurate. 1 is the least accurate.
65
- *
66
- * @default 0.063
67
- */
68
- diffThreshold?: number;
69
-
70
- /**
71
- * Modes for Chromatic testing.
72
- *
73
- * Specify the mode in which Chromatic should run tests. For example, 'light' for light mode,
74
- * 'dark' for dark mode, or `rtl` for right to left content.
75
- */
76
- modes?: object;
77
- }