@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.
- package/build/button/Button.js +1 -0
- package/build/button/Button.js.map +1 -1
- package/build/button/Button.mjs +1 -0
- package/build/button/Button.mjs.map +1 -1
- package/build/common/RadioButton/RadioButton.js +5 -2
- package/build/common/RadioButton/RadioButton.js.map +1 -1
- package/build/common/RadioButton/RadioButton.mjs +5 -2
- package/build/common/RadioButton/RadioButton.mjs.map +1 -1
- package/build/common/initials.js +4 -1
- package/build/common/initials.js.map +1 -1
- package/build/common/initials.mjs +4 -1
- package/build/common/initials.mjs.map +1 -1
- package/build/flowNavigation/animatedLabel/AnimatedLabel.js +2 -3
- package/build/flowNavigation/animatedLabel/AnimatedLabel.js.map +1 -1
- package/build/flowNavigation/animatedLabel/AnimatedLabel.mjs +1 -2
- package/build/flowNavigation/animatedLabel/AnimatedLabel.mjs.map +1 -1
- package/build/i18n/de.json +2 -0
- package/build/i18n/de.json.js +2 -0
- package/build/i18n/de.json.js.map +1 -1
- package/build/i18n/de.json.mjs +2 -0
- package/build/i18n/de.json.mjs.map +1 -1
- package/build/i18n/fr.json +2 -0
- package/build/i18n/fr.json.js +2 -0
- package/build/i18n/fr.json.js.map +1 -1
- package/build/i18n/fr.json.mjs +2 -0
- package/build/i18n/fr.json.mjs.map +1 -1
- package/build/i18n/hu.json +2 -0
- package/build/i18n/hu.json.js +2 -0
- package/build/i18n/hu.json.js.map +1 -1
- package/build/i18n/hu.json.mjs +2 -0
- package/build/i18n/hu.json.mjs.map +1 -1
- package/build/i18n/it.json +2 -0
- package/build/i18n/it.json.js +2 -0
- package/build/i18n/it.json.js.map +1 -1
- package/build/i18n/it.json.mjs +2 -0
- package/build/i18n/it.json.mjs.map +1 -1
- package/build/i18n/ja.json +2 -0
- package/build/i18n/ja.json.js +2 -0
- package/build/i18n/ja.json.js.map +1 -1
- package/build/i18n/ja.json.mjs +2 -0
- package/build/i18n/ja.json.mjs.map +1 -1
- package/build/i18n/pl.json +2 -0
- package/build/i18n/pl.json.js +2 -0
- package/build/i18n/pl.json.js.map +1 -1
- package/build/i18n/pl.json.mjs +2 -0
- package/build/i18n/pl.json.mjs.map +1 -1
- package/build/i18n/pt.json +2 -0
- package/build/i18n/pt.json.js +2 -0
- package/build/i18n/pt.json.js.map +1 -1
- package/build/i18n/pt.json.mjs +2 -0
- package/build/i18n/pt.json.mjs.map +1 -1
- package/build/i18n/ro.json +2 -0
- package/build/i18n/ro.json.js +2 -0
- package/build/i18n/ro.json.js.map +1 -1
- package/build/i18n/ro.json.mjs +2 -0
- package/build/i18n/ro.json.mjs.map +1 -1
- package/build/i18n/ru.json +2 -0
- package/build/i18n/ru.json.js +2 -0
- package/build/i18n/ru.json.js.map +1 -1
- package/build/i18n/ru.json.mjs +2 -0
- package/build/i18n/ru.json.mjs.map +1 -1
- package/build/i18n/tr.json +2 -0
- package/build/i18n/tr.json.js +2 -0
- package/build/i18n/tr.json.js.map +1 -1
- package/build/i18n/tr.json.mjs +2 -0
- package/build/i18n/tr.json.mjs.map +1 -1
- package/build/i18n/zh-CN.json +2 -0
- package/build/i18n/zh-CN.json.js +2 -0
- package/build/i18n/zh-CN.json.js.map +1 -1
- package/build/i18n/zh-CN.json.mjs +2 -0
- package/build/i18n/zh-CN.json.mjs.map +1 -1
- package/build/i18n/zh-HK.json +2 -0
- package/build/i18n/zh-HK.json.js +2 -0
- package/build/i18n/zh-HK.json.js.map +1 -1
- package/build/i18n/zh-HK.json.mjs +2 -0
- package/build/i18n/zh-HK.json.mjs.map +1 -1
- package/build/iconButton/IconButton.js.map +1 -1
- package/build/iconButton/IconButton.mjs.map +1 -1
- package/build/image/Image.js.map +1 -1
- package/build/image/Image.mjs.map +1 -1
- package/build/index.js +2 -2
- package/build/index.mjs +1 -1
- package/build/list/List.js +21 -0
- package/build/list/List.js.map +1 -0
- package/build/list/List.mjs +17 -0
- package/build/list/List.mjs.map +1 -0
- package/build/main.css +4 -2
- package/build/styles/avatarView/AvatarView.css +3 -1
- package/build/styles/button/Button.css +1 -1
- package/build/styles/main.css +4 -2
- package/build/switch/Switch.js +3 -1
- package/build/switch/Switch.js.map +1 -1
- package/build/switch/Switch.mjs +3 -1
- package/build/switch/Switch.mjs.map +1 -1
- package/build/test-utils/assets/placeholder-landscape.svg +1 -0
- package/build/test-utils/assets/placeholder-portrait.svg +1 -0
- package/build/types/button/Button.d.ts.map +1 -1
- package/build/types/button/Button.types.d.ts +1 -1
- package/build/types/button/Button.types.d.ts.map +1 -1
- package/build/types/button/index.d.ts +1 -1
- package/build/types/button/index.d.ts.map +1 -1
- package/build/types/common/RadioButton/RadioButton.d.ts +3 -1
- package/build/types/common/RadioButton/RadioButton.d.ts.map +1 -1
- package/build/types/common/initials.d.ts.map +1 -1
- package/build/types/iconButton/IconButton.d.ts +2 -2
- package/build/types/iconButton/IconButton.d.ts.map +1 -1
- package/build/types/image/Image.d.ts +3 -0
- package/build/types/image/Image.d.ts.map +1 -1
- package/build/types/image/index.d.ts +1 -0
- package/build/types/image/index.d.ts.map +1 -1
- package/build/types/index.d.ts +4 -2
- package/build/types/index.d.ts.map +1 -1
- package/build/types/legacylistItem/index.d.ts +0 -2
- package/build/types/legacylistItem/index.d.ts.map +1 -1
- package/build/types/list/List.d.ts +11 -0
- package/build/types/list/List.d.ts.map +1 -0
- package/build/types/list/index.d.ts +3 -0
- package/build/types/list/index.d.ts.map +1 -0
- package/build/types/switch/Switch.d.ts +3 -1
- package/build/types/switch/Switch.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/avatarView/AvatarView.css +3 -1
- package/src/avatarView/AvatarView.less +2 -1
- package/src/button/Button.css +1 -1
- package/src/button/Button.less +1 -1
- package/src/button/Button.spec.tsx +18 -0
- package/src/button/Button.story.tsx +9 -4
- package/src/button/Button.tsx +5 -1
- package/src/button/Button.types.ts +1 -1
- package/src/button/index.ts +1 -1
- package/src/checkboxButton/CheckboxButton.story.tsx +27 -8
- package/src/common/RadioButton/RadioButton.tsx +6 -1
- package/src/common/initials.spec.tsx +13 -0
- package/src/common/initials.ts +5 -0
- package/src/flowNavigation/animatedLabel/AnimatedLabel.tsx +1 -1
- package/src/i18n/de.json +2 -0
- package/src/i18n/fr.json +2 -0
- package/src/i18n/hu.json +2 -0
- package/src/i18n/it.json +2 -0
- package/src/i18n/ja.json +2 -0
- package/src/i18n/pl.json +2 -0
- package/src/i18n/pt.json +2 -0
- package/src/i18n/ro.json +2 -0
- package/src/i18n/ru.json +2 -0
- package/src/i18n/tr.json +2 -0
- package/src/i18n/zh-CN.json +2 -0
- package/src/i18n/zh-HK.json +2 -0
- package/src/iconButton/IconButton.story.tsx +1 -1
- package/src/iconButton/IconButton.tsx +1 -1
- package/src/image/Image.tsx +3 -0
- package/src/image/index.ts +1 -0
- package/src/index.ts +4 -2
- package/src/legacylistItem/LegacyListItem.story.tsx +2 -2
- package/src/legacylistItem/LegacyListItem.tests.story.tsx +2 -1
- package/src/legacylistItem/index.ts +0 -2
- package/src/list/List.spec.tsx +52 -0
- package/src/list/List.story.tsx +20 -0
- package/src/list/List.tsx +15 -0
- package/src/list/index.ts +2 -0
- package/src/main.css +4 -2
- package/src/switch/Switch.tsx +6 -2
- package/src/test-utils/assets/placeholder-landscape.svg +1 -0
- package/src/test-utils/assets/placeholder-portrait.svg +1 -0
- package/build/legacylistItem/List.js +0 -17
- package/build/legacylistItem/List.js.map +0 -1
- package/build/legacylistItem/List.mjs +0 -15
- package/build/legacylistItem/List.mjs.map +0 -1
- package/build/types/legacylistItem/List.d.ts +0 -6
- package/build/types/legacylistItem/List.d.ts.map +0 -1
- package/src/legacylistItem/List.tsx +0 -10
- 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:
|
|
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:
|
|
744
|
+
white-space: normal;
|
|
743
745
|
word-wrap: break-word;
|
|
744
746
|
-webkit-appearance: none;
|
|
745
747
|
-moz-appearance: none;
|
package/src/switch/Switch.tsx
CHANGED
|
@@ -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<
|
|
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 +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,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
|
-
}
|