@transferwise/components 46.35.0 → 46.36.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/index.js +69 -67
- package/build/index.js.map +1 -1
- package/build/index.mjs +70 -68
- package/build/index.mjs.map +1 -1
- package/build/main.css +1 -0
- package/build/styles/main.css +1 -0
- package/build/styles/nudge/Nudge.css +1 -0
- package/build/types/common/action/Action.d.ts +15 -0
- package/build/types/common/action/Action.d.ts.map +1 -0
- package/build/types/nudge/Nudge.d.ts +4 -4
- package/build/types/nudge/Nudge.d.ts.map +1 -1
- package/build/types/select/Select.d.ts.map +1 -1
- package/build/types/summary/Summary.d.ts +2 -4
- package/build/types/summary/Summary.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/alert/Alert.tsx +2 -30
- package/src/common/action/Action.tsx +44 -0
- package/src/main.css +1 -0
- package/src/nudge/Nudge.css +1 -0
- package/src/nudge/Nudge.less +1 -0
- package/src/nudge/Nudge.story.tsx +34 -0
- package/src/nudge/Nudge.tsx +6 -4
- package/src/select/Select.js +1 -2
- package/src/summary/Summary.tsx +3 -15
package/build/main.css
CHANGED
|
@@ -3637,6 +3637,7 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
3637
3637
|
align-self: var(--nudge-content-flex-alignment);
|
|
3638
3638
|
display: flex;
|
|
3639
3639
|
flex-direction: column;
|
|
3640
|
+
align-items: start;
|
|
3640
3641
|
}
|
|
3641
3642
|
.wds-nudge-container .wds-nudge-content .wds-nudge-title {
|
|
3642
3643
|
color: var(--nudge-title-color);
|
package/build/styles/main.css
CHANGED
|
@@ -3637,6 +3637,7 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
3637
3637
|
align-self: var(--nudge-content-flex-alignment);
|
|
3638
3638
|
display: flex;
|
|
3639
3639
|
flex-direction: column;
|
|
3640
|
+
align-items: start;
|
|
3640
3641
|
}
|
|
3641
3642
|
.wds-nudge-container .wds-nudge-content .wds-nudge-title {
|
|
3642
3643
|
color: var(--nudge-title-color);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type ActionOptions = {
|
|
3
|
+
'aria-label'?: string;
|
|
4
|
+
href?: string;
|
|
5
|
+
target?: string;
|
|
6
|
+
text: React.ReactNode;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
};
|
|
9
|
+
type Props = {
|
|
10
|
+
action: ActionOptions;
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function Action({ action, className }: Props): import("react").JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=Action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Action.d.ts","sourceRoot":"","sources":["../../../../src/common/action/Action.tsx"],"names":[],"mappings":";AAIA,MAAM,MAAM,aAAa,GAAG;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,MAAM,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,KAAK,+BA0BlD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Assets } from '@wise/art';
|
|
2
2
|
import { ReactNode, MouseEvent } from 'react';
|
|
3
|
+
import { ActionOptions } from '../common/action/Action';
|
|
3
4
|
export declare const STORAGE_NAME = "dismissedNudges";
|
|
4
5
|
type MediaNameType = `${Assets.GLOBE}` | `${Assets.LOCK}` | `${Assets.WALLET}` | `${Assets.GEAR}` | `${Assets.INVITE_LETTER}` | `${Assets.PERSONAL_CARD}` | `${Assets.BUSINESS_CARD}` | `${Assets.HEART}` | `${Assets.MULTI_CURRENCY}` | `${Assets.SHOPPING_BAG}`;
|
|
5
6
|
type BaseProps = {
|
|
@@ -8,14 +9,13 @@ type BaseProps = {
|
|
|
8
9
|
/** Media name */
|
|
9
10
|
mediaName?: MediaNameType;
|
|
10
11
|
title: ReactNode;
|
|
11
|
-
/** Element inside link */
|
|
12
12
|
link?: ReactNode;
|
|
13
|
-
/** Href for the link */
|
|
14
13
|
href?: string;
|
|
15
|
-
/** Fired when the user clicks on the link */
|
|
16
14
|
onClick?: (event?: MouseEvent<HTMLSpanElement>) => void;
|
|
17
15
|
/** Fired when the user clicks on close button */
|
|
18
16
|
onDismiss?: () => void;
|
|
17
|
+
/** An optional call to action to sit under the main body of the nudge. If your label is short, use aria-label to provide more context */
|
|
18
|
+
action?: ActionOptions;
|
|
19
19
|
className?: string;
|
|
20
20
|
};
|
|
21
21
|
export interface OptionalId extends BaseProps {
|
|
@@ -36,6 +36,6 @@ export interface RequiredPersistProps extends BaseProps {
|
|
|
36
36
|
isPreviouslyDismissed?: (value: boolean) => void;
|
|
37
37
|
}
|
|
38
38
|
export type Props = OptionalId | RequiredPersistProps;
|
|
39
|
-
declare const Nudge: ({ media, mediaName, title, link, href, onClick, onDismiss, persistDismissal, isPreviouslyDismissed, id, className, }: Props) => import("react").JSX.Element | null;
|
|
39
|
+
declare const Nudge: ({ media, mediaName, title, link, href, onClick, onDismiss, persistDismissal, isPreviouslyDismissed, id, className, action, }: Props) => import("react").JSX.Element | null;
|
|
40
40
|
export default Nudge;
|
|
41
41
|
//# sourceMappingURL=Nudge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Nudge.d.ts","sourceRoot":"","sources":["../../../src/nudge/Nudge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAqB,MAAM,WAAW,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAuB,UAAU,EAAE,MAAM,OA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CAAC;IACZ,gBAAgB,CAAC,EAAE,KAAK,CAAC;IACzB,qBAAqB,CAAC,EAAE,SAAS,CAAC;CACnC;AAED,MAAM,WAAW,oBAAqB,SAAQ,SAAS;IACrD,2IAA2I;IAC3I,EAAE,EAAE,MAAM,CAAC;IACX,yFAAyF;IACzF,gBAAgB,EAAE,IAAI,CAAC;IACvB;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAClD;AAED,MAAM,MAAM,KAAK,GAAG,UAAU,GAAG,oBAAoB,CAAC;AAEtD,QAAA,MAAM,KAAK,iIAaR,KAAK,uCAgFP,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/select/Select.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/select/Select.js"],"names":[],"mappings":"AA8EA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;gCAkeC"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { ElementType, ReactNode } from 'react';
|
|
2
2
|
import { StatusDone, StatusNotDone, StatusPending } from '../common';
|
|
3
3
|
import { InfoProps } from '../info';
|
|
4
|
-
import {
|
|
4
|
+
import { ActionOptions } from '../common/action/Action';
|
|
5
5
|
export interface Props {
|
|
6
6
|
/**
|
|
7
7
|
* Action displayed at the bottom of the Summary
|
|
8
8
|
*/
|
|
9
|
-
action?:
|
|
10
|
-
text: ReactNode;
|
|
11
|
-
};
|
|
9
|
+
action?: ActionOptions;
|
|
12
10
|
/**
|
|
13
11
|
* Decides which html element should wrap the Summary
|
|
14
12
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Summary.d.ts","sourceRoot":"","sources":["../../../src/summary/Summary.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAgB,SAA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;AAEF,eAAe,OAAO,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transferwise/components",
|
|
3
|
-
"version": "46.
|
|
3
|
+
"version": "46.36.0",
|
|
4
4
|
"description": "Neptune React components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -94,9 +94,9 @@
|
|
|
94
94
|
"react-intl": "^6.6.6",
|
|
95
95
|
"rollup": "^4.17.2",
|
|
96
96
|
"storybook": "^7.6.19",
|
|
97
|
-
"@transferwise/less-config": "3.1.0",
|
|
98
97
|
"@transferwise/neptune-css": "14.10.0",
|
|
99
|
-
"@wise/components-theming": "1.3.0"
|
|
98
|
+
"@wise/components-theming": "1.3.0",
|
|
99
|
+
"@transferwise/less-config": "3.1.0"
|
|
100
100
|
},
|
|
101
101
|
"peerDependencies": {
|
|
102
102
|
"@transferwise/icons": "^3.7.0",
|
package/src/alert/Alert.tsx
CHANGED
|
@@ -4,12 +4,12 @@ import { useState, useRef, useEffect } from 'react';
|
|
|
4
4
|
import Body from '../body/Body';
|
|
5
5
|
import { Sentiment, Size, Typography, Variant } from '../common';
|
|
6
6
|
import { CloseButton } from '../common/closeButton';
|
|
7
|
-
import Link from '../link';
|
|
8
7
|
import StatusIcon from '../statusIcon';
|
|
9
8
|
import Title from '../title/Title';
|
|
10
9
|
import { logActionRequired } from '../utilities';
|
|
11
10
|
|
|
12
11
|
import InlineMarkdown from './inlineMarkdown';
|
|
12
|
+
import { Action } from '../common/action/Action';
|
|
13
13
|
|
|
14
14
|
export type AlertAction = {
|
|
15
15
|
'aria-label'?: string;
|
|
@@ -181,7 +181,7 @@ export default function Alert({
|
|
|
181
181
|
{children || <InlineMarkdown>{message}</InlineMarkdown>}
|
|
182
182
|
</Body>
|
|
183
183
|
</div>
|
|
184
|
-
{action && <Action action={action} />}
|
|
184
|
+
{action && <Action action={action} className="m-t-1" />}
|
|
185
185
|
</div>
|
|
186
186
|
</div>
|
|
187
187
|
{onDismiss && (
|
|
@@ -208,31 +208,3 @@ function alertArrowClassNames(arrow: `${AlertArrowPosition}`) {
|
|
|
208
208
|
return 'arrow';
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
|
-
|
|
212
|
-
function Action({ action }: { action: AlertAction }) {
|
|
213
|
-
if ('href' in action) {
|
|
214
|
-
return (
|
|
215
|
-
<Link
|
|
216
|
-
href={action.href}
|
|
217
|
-
className="m-t-1"
|
|
218
|
-
aria-label={action['aria-label']}
|
|
219
|
-
target={action.target}
|
|
220
|
-
type={Typography.LINK_LARGE}
|
|
221
|
-
onClick={action.onClick}
|
|
222
|
-
>
|
|
223
|
-
{action.text}
|
|
224
|
-
</Link>
|
|
225
|
-
);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
return (
|
|
229
|
-
<button
|
|
230
|
-
type="button"
|
|
231
|
-
aria-label={action['aria-label']}
|
|
232
|
-
className="btn-unstyled np-text-link-large m-t-1"
|
|
233
|
-
onClick={action.onClick}
|
|
234
|
-
>
|
|
235
|
-
{action.text}
|
|
236
|
-
</button>
|
|
237
|
-
);
|
|
238
|
-
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import Link from '../../link';
|
|
3
|
+
import { Typography } from '../propsValues/typography';
|
|
4
|
+
|
|
5
|
+
export type ActionOptions = {
|
|
6
|
+
'aria-label'?: string;
|
|
7
|
+
href?: string;
|
|
8
|
+
target?: string;
|
|
9
|
+
text: React.ReactNode;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
type Props = {
|
|
14
|
+
action: ActionOptions;
|
|
15
|
+
className?: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export function Action({ action, className }: Props) {
|
|
19
|
+
if ('href' in action) {
|
|
20
|
+
return (
|
|
21
|
+
<Link
|
|
22
|
+
href={action.href}
|
|
23
|
+
className={className}
|
|
24
|
+
aria-label={action['aria-label']}
|
|
25
|
+
target={action.target}
|
|
26
|
+
type={Typography.LINK_LARGE}
|
|
27
|
+
onClick={action.onClick}
|
|
28
|
+
>
|
|
29
|
+
{action.text}
|
|
30
|
+
</Link>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<button
|
|
36
|
+
type="button"
|
|
37
|
+
aria-label={action['aria-label']}
|
|
38
|
+
className={classNames('btn-unstyled np-text-link-large', className)}
|
|
39
|
+
onClick={action.onClick}
|
|
40
|
+
>
|
|
41
|
+
{action.text}
|
|
42
|
+
</button>
|
|
43
|
+
);
|
|
44
|
+
}
|
package/src/main.css
CHANGED
|
@@ -3637,6 +3637,7 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
3637
3637
|
align-self: var(--nudge-content-flex-alignment);
|
|
3638
3638
|
display: flex;
|
|
3639
3639
|
flex-direction: column;
|
|
3640
|
+
align-items: start;
|
|
3640
3641
|
}
|
|
3641
3642
|
.wds-nudge-container .wds-nudge-content .wds-nudge-title {
|
|
3642
3643
|
color: var(--nudge-title-color);
|
package/src/nudge/Nudge.css
CHANGED
package/src/nudge/Nudge.less
CHANGED
|
@@ -135,3 +135,37 @@ export const DefaultWithPersist = () => {
|
|
|
135
135
|
</div>
|
|
136
136
|
);
|
|
137
137
|
};
|
|
138
|
+
|
|
139
|
+
export const WithAction = () => {
|
|
140
|
+
return (
|
|
141
|
+
<div>
|
|
142
|
+
<Nudge
|
|
143
|
+
mediaName="globe"
|
|
144
|
+
title="Text that is no longer than two lines."
|
|
145
|
+
id="NEPTUNE_TEST_COMPONENT"
|
|
146
|
+
className="m-y-2"
|
|
147
|
+
persistDismissal
|
|
148
|
+
isPreviouslyDismissed={action('is previously dismissed first alert')}
|
|
149
|
+
action={{
|
|
150
|
+
href: '#',
|
|
151
|
+
text: 'Learn more',
|
|
152
|
+
}}
|
|
153
|
+
onDismiss={action('dismissed')}
|
|
154
|
+
/>
|
|
155
|
+
|
|
156
|
+
<Nudge
|
|
157
|
+
mediaName="globe"
|
|
158
|
+
title="Text that is no longer than two lines2."
|
|
159
|
+
id="NEPTUNE_TEST_COMPONENT_2"
|
|
160
|
+
className="m-y-2"
|
|
161
|
+
persistDismissal
|
|
162
|
+
isPreviouslyDismissed={action('is previously dismissed second alert')}
|
|
163
|
+
action={{
|
|
164
|
+
onClick: action('action click'),
|
|
165
|
+
text: 'Perform action',
|
|
166
|
+
}}
|
|
167
|
+
onDismiss={action('dismissed')}
|
|
168
|
+
/>
|
|
169
|
+
</div>
|
|
170
|
+
);
|
|
171
|
+
};
|
package/src/nudge/Nudge.tsx
CHANGED
|
@@ -3,9 +3,10 @@ import classNames from 'classnames';
|
|
|
3
3
|
import { ReactNode, useEffect, useState, MouseEvent } from 'react';
|
|
4
4
|
|
|
5
5
|
import Body from '../body';
|
|
6
|
-
import {
|
|
6
|
+
import { Typography } from '../common';
|
|
7
7
|
import { CloseButton } from '../common/closeButton';
|
|
8
8
|
import Link from '../link';
|
|
9
|
+
import { Action, ActionOptions } from '../common/action/Action';
|
|
9
10
|
|
|
10
11
|
// WARNING: Changing this will cause nudges to reappear wherever persist nudge is used and privacy team will need to be updated too
|
|
11
12
|
export const STORAGE_NAME = 'dismissedNudges';
|
|
@@ -45,14 +46,13 @@ type BaseProps = {
|
|
|
45
46
|
/** Media name */
|
|
46
47
|
mediaName?: MediaNameType;
|
|
47
48
|
title: ReactNode;
|
|
48
|
-
/** Element inside link */
|
|
49
49
|
link?: ReactNode;
|
|
50
|
-
/** Href for the link */
|
|
51
50
|
href?: string;
|
|
52
|
-
/** Fired when the user clicks on the link */
|
|
53
51
|
onClick?: (event?: MouseEvent<HTMLSpanElement>) => void;
|
|
54
52
|
/** Fired when the user clicks on close button */
|
|
55
53
|
onDismiss?: () => void;
|
|
54
|
+
/** An optional call to action to sit under the main body of the nudge. If your label is short, use aria-label to provide more context */
|
|
55
|
+
action?: ActionOptions;
|
|
56
56
|
className?: string;
|
|
57
57
|
};
|
|
58
58
|
|
|
@@ -89,6 +89,7 @@ const Nudge = ({
|
|
|
89
89
|
isPreviouslyDismissed,
|
|
90
90
|
id,
|
|
91
91
|
className,
|
|
92
|
+
action,
|
|
92
93
|
}: Props) => {
|
|
93
94
|
const [isDismissed, setIsDismissed] = useState(false);
|
|
94
95
|
const [isMounted, setIsMounted] = useState(false);
|
|
@@ -161,6 +162,7 @@ const Nudge = ({
|
|
|
161
162
|
{link}
|
|
162
163
|
</Link>
|
|
163
164
|
)}
|
|
165
|
+
{action && <Action action={action} className="m-t-1" />}
|
|
164
166
|
</div>
|
|
165
167
|
{onDismiss || persistDismissal ? (
|
|
166
168
|
<CloseButton className="wds-nudge-control" size="sm" onClick={handleOnDismiss} />
|
package/src/select/Select.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { useId } from '@radix-ui/react-id';
|
|
2
1
|
import { useTheme } from '@wise/components-theming';
|
|
3
2
|
import classNames from 'classnames';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
|
-
import { useState, useEffect, useRef, useMemo } from 'react';
|
|
4
|
+
import { useState, useEffect, useRef, useMemo, useId } from 'react';
|
|
6
5
|
import { useIntl } from 'react-intl';
|
|
7
6
|
|
|
8
7
|
import Button from '../button';
|
package/src/summary/Summary.tsx
CHANGED
|
@@ -18,10 +18,10 @@ import {
|
|
|
18
18
|
Sentiment,
|
|
19
19
|
} from '../common';
|
|
20
20
|
import Info, { InfoProps } from '../info';
|
|
21
|
-
import Link, { LinkProps } from '../link';
|
|
22
21
|
import StatusIcon from '../statusIcon';
|
|
23
22
|
|
|
24
23
|
import messages from './Summary.messages';
|
|
24
|
+
import { Action, ActionOptions } from '../common/action/Action';
|
|
25
25
|
|
|
26
26
|
const BadgeIcons = {
|
|
27
27
|
[Status.DONE]: CheckCircleIcon,
|
|
@@ -43,9 +43,7 @@ export interface Props {
|
|
|
43
43
|
/**
|
|
44
44
|
* Action displayed at the bottom of the Summary
|
|
45
45
|
*/
|
|
46
|
-
action?:
|
|
47
|
-
text: ReactNode;
|
|
48
|
-
};
|
|
46
|
+
action?: ActionOptions;
|
|
49
47
|
/**
|
|
50
48
|
* Decides which html element should wrap the Summary
|
|
51
49
|
*/
|
|
@@ -168,17 +166,7 @@ const Summary = ({
|
|
|
168
166
|
{description}
|
|
169
167
|
</Body>
|
|
170
168
|
)}
|
|
171
|
-
{action &&
|
|
172
|
-
<Link
|
|
173
|
-
href={action.href}
|
|
174
|
-
target={action.target}
|
|
175
|
-
className="np-summary__action"
|
|
176
|
-
aria-label={action['aria-label']}
|
|
177
|
-
onClick={action.onClick}
|
|
178
|
-
>
|
|
179
|
-
{action.text}
|
|
180
|
-
</Link>
|
|
181
|
-
)}
|
|
169
|
+
{action && <Action action={action} className="np-summary__action" />}
|
|
182
170
|
</div>
|
|
183
171
|
{info && (
|
|
184
172
|
<Info
|