@transferwise/components 0.0.0-experimental-6528439 → 0.0.0-experimental-1ffdc56
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/alert/Alert.js +33 -17
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs +30 -14
- package/build/alert/Alert.mjs.map +1 -1
- package/build/avatarLayout/AvatarLayout.js +9 -2
- package/build/avatarLayout/AvatarLayout.js.map +1 -1
- package/build/avatarLayout/AvatarLayout.mjs +9 -2
- package/build/avatarLayout/AvatarLayout.mjs.map +1 -1
- package/build/button/Button.js +86 -79
- package/build/button/Button.js.map +1 -1
- package/build/button/Button.mjs +87 -80
- package/build/button/Button.mjs.map +1 -1
- package/build/button/Button.resolver.js +74 -0
- package/build/button/Button.resolver.js.map +1 -0
- package/build/button/Button.resolver.mjs +72 -0
- package/build/button/Button.resolver.mjs.map +1 -0
- package/build/button/LegacyButton.js +114 -0
- package/build/button/LegacyButton.js.map +1 -0
- package/build/button/LegacyButton.mjs +112 -0
- package/build/button/LegacyButton.mjs.map +1 -0
- package/build/common/action/Action.js +26 -15
- package/build/common/action/Action.js.map +1 -1
- package/build/common/action/Action.mjs +26 -15
- package/build/common/action/Action.mjs.map +1 -1
- package/build/common/propsValues/sentiment.js +1 -0
- package/build/common/propsValues/sentiment.js.map +1 -1
- package/build/common/propsValues/sentiment.mjs +1 -0
- package/build/common/propsValues/sentiment.mjs.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.js +10 -73
- package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.mjs +11 -74
- package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
- package/build/dimmer/Dimmer.js +67 -41
- package/build/dimmer/Dimmer.js.map +1 -1
- package/build/dimmer/Dimmer.mjs +69 -43
- package/build/dimmer/Dimmer.mjs.map +1 -1
- package/build/header/Header.js +2 -2
- package/build/header/Header.js.map +1 -1
- package/build/header/Header.mjs +1 -1
- package/build/i18n/en.json +1 -0
- package/build/i18n/en.json.js +1 -0
- package/build/i18n/en.json.js.map +1 -1
- package/build/i18n/en.json.mjs +1 -0
- package/build/i18n/en.json.mjs.map +1 -1
- package/build/index.js +2 -2
- package/build/index.mjs +1 -1
- package/build/inputs/_BottomSheet.js +8 -1
- package/build/inputs/_BottomSheet.js.map +1 -1
- package/build/inputs/_BottomSheet.mjs +9 -2
- package/build/inputs/_BottomSheet.mjs.map +1 -1
- package/build/inputs/_Popover.js +8 -1
- package/build/inputs/_Popover.js.map +1 -1
- package/build/inputs/_Popover.mjs +9 -2
- package/build/inputs/_Popover.mjs.map +1 -1
- package/build/link/Link.js +8 -3
- package/build/link/Link.js.map +1 -1
- package/build/link/Link.mjs +8 -3
- package/build/link/Link.mjs.map +1 -1
- package/build/main.css +250 -72
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.js +2 -4
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.js.map +1 -1
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs +2 -4
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs.map +1 -1
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.js +3 -5
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.js.map +1 -1
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.mjs +3 -5
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.mjs.map +1 -1
- package/build/select/Select.js +2 -2
- package/build/select/Select.js.map +1 -1
- package/build/select/Select.mjs +1 -1
- package/build/statusIcon/StatusIcon.js +5 -1
- package/build/statusIcon/StatusIcon.js.map +1 -1
- package/build/statusIcon/StatusIcon.messages.js +3 -0
- package/build/statusIcon/StatusIcon.messages.js.map +1 -1
- package/build/statusIcon/StatusIcon.messages.mjs +3 -0
- package/build/statusIcon/StatusIcon.messages.mjs.map +1 -1
- package/build/statusIcon/StatusIcon.mjs +5 -1
- package/build/statusIcon/StatusIcon.mjs.map +1 -1
- package/build/styles/avatarLayout/AvatarLayout.css +11 -0
- package/build/styles/button/Button.css +220 -15
- package/build/styles/button/Button.vars.css +46 -0
- package/build/styles/button/LegacyButton.css +23 -0
- package/build/styles/criticalBanner/CriticalCommsBanner.css +7 -72
- package/build/styles/main.css +250 -72
- package/build/styles/statusIcon/StatusIcon.css +4 -0
- package/build/types/alert/Alert.d.ts +2 -1
- package/build/types/alert/Alert.d.ts.map +1 -1
- package/build/types/avatarLayout/AvatarLayout.d.ts.map +1 -1
- package/build/types/button/Button.d.ts +2 -23
- package/build/types/button/Button.d.ts.map +1 -1
- package/build/types/button/Button.resolver.d.ts +35 -0
- package/build/types/button/Button.resolver.d.ts.map +1 -0
- package/build/types/button/Button.types.d.ts +70 -0
- package/build/types/button/Button.types.d.ts.map +1 -0
- package/build/types/button/LegacyButton.d.ts +44 -0
- package/build/types/button/LegacyButton.d.ts.map +1 -0
- package/build/types/button/index.d.ts +2 -2
- package/build/types/button/index.d.ts.map +1 -1
- package/build/types/common/action/Action.d.ts +4 -1
- package/build/types/common/action/Action.d.ts.map +1 -1
- package/build/types/common/propsValues/sentiment.d.ts +1 -0
- package/build/types/common/propsValues/sentiment.d.ts.map +1 -1
- package/build/types/criticalBanner/CriticalCommsBanner.d.ts.map +1 -1
- package/build/types/dimmer/Dimmer.d.ts.map +1 -1
- package/build/types/inputs/_BottomSheet.d.ts.map +1 -1
- package/build/types/inputs/_Popover.d.ts.map +1 -1
- package/build/types/link/Link.d.ts +2 -2
- package/build/types/link/Link.d.ts.map +1 -1
- package/build/types/primitives/PrimitiveAnchor/src/PrimitiveAnchor.d.ts.map +1 -1
- package/build/types/primitives/PrimitiveAnchor/src/PrimitiveAnchor.types.d.ts +6 -2
- package/build/types/primitives/PrimitiveAnchor/src/PrimitiveAnchor.types.d.ts.map +1 -1
- package/build/types/primitives/PrimitiveButton/src/PrimitiveButton.d.ts.map +1 -1
- package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
- package/build/types/statusIcon/StatusIcon.messages.d.ts +5 -0
- package/build/types/statusIcon/StatusIcon.messages.d.ts.map +1 -1
- package/build/types/test-utils/index.d.ts +2 -0
- package/build/types/test-utils/index.d.ts.map +1 -1
- package/build/types/test-utils/story-config.d.ts +1 -1
- package/build/types/test-utils/story-config.d.ts.map +1 -1
- package/build/types/withNextPortal/withNextPortal.d.ts.map +1 -1
- package/build/upload/steps/completeStep/completeStep.js +2 -2
- package/build/upload/steps/completeStep/completeStep.js.map +1 -1
- package/build/upload/steps/completeStep/completeStep.mjs +1 -1
- package/build/upload/steps/processingStep/processingStep.js +2 -2
- package/build/upload/steps/processingStep/processingStep.js.map +1 -1
- package/build/upload/steps/processingStep/processingStep.mjs +1 -1
- package/build/uploadInput/UploadInput.js +3 -3
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.mjs +1 -1
- package/build/withNextPortal/withNextPortal.js +2 -5
- package/build/withNextPortal/withNextPortal.js.map +1 -1
- package/build/withNextPortal/withNextPortal.mjs +2 -5
- package/build/withNextPortal/withNextPortal.mjs.map +1 -1
- package/package.json +5 -5
- package/src/alert/Alert.story.tsx +36 -0
- package/src/alert/Alert.tests.story.tsx +1 -1
- package/src/alert/Alert.tsx +37 -8
- package/src/avatarLayout/AvatarLayout.css +11 -0
- package/src/avatarLayout/AvatarLayout.less +18 -1
- package/src/avatarLayout/AvatarLayout.tsx +10 -2
- package/src/button/Button.accessibility.docs.mdx +103 -0
- package/src/button/Button.css +220 -15
- package/src/button/Button.less +228 -13
- package/src/button/Button.resolver.tsx +73 -0
- package/src/button/Button.spec.tsx +215 -226
- package/src/button/Button.story.tsx +761 -134
- package/src/button/Button.tests.story.tsx +27 -0
- package/src/button/Button.tsx +99 -132
- package/src/button/Button.types.ts +92 -0
- package/src/button/Button.vars.css +46 -0
- package/src/button/Button.vars.less +57 -0
- package/src/button/LegacyButton.css +23 -0
- package/src/button/LegacyButton.less +24 -0
- package/src/button/LegacyButton.spec.tsx +147 -0
- package/src/button/LegacyButton.story.tsx +228 -0
- package/src/button/LegacyButton.tsx +177 -0
- package/src/button/index.ts +2 -3
- package/src/common/action/Action.tsx +39 -21
- package/src/common/bottomSheet/BottomSheet.spec.tsx +3 -6
- package/src/common/bottomSheet/__snapshots__/BottomSheet.spec.tsx.snap +1 -5
- package/src/common/propsValues/sentiment.ts +1 -0
- package/src/criticalBanner/CriticalCommsBanner.css +7 -72
- package/src/criticalBanner/CriticalCommsBanner.less +12 -73
- package/src/criticalBanner/CriticalCommsBanner.story.tsx +13 -9
- package/src/criticalBanner/CriticalCommsBanner.tsx +8 -50
- package/src/dimmer/Dimmer.tsx +72 -44
- package/src/field/Field.story.tsx +1 -1
- package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +1 -2
- package/src/i18n/en.json +1 -0
- package/src/inputs/SelectInput.story.tsx +1 -1
- package/src/inputs/_BottomSheet.tsx +9 -3
- package/src/inputs/_Popover.tsx +10 -4
- package/src/label/Label.story.tsx +1 -1
- package/src/link/Link.tsx +15 -6
- package/src/main.css +250 -72
- package/src/main.less +1 -0
- package/src/primitives/PrimitiveAnchor/src/PrimitiveAnchor.tsx +2 -8
- package/src/primitives/PrimitiveAnchor/src/PrimitiveAnchor.types.ts +7 -2
- package/src/primitives/PrimitiveAnchor/test/PrimitiveAnchor.spec.tsx +1 -3
- package/src/primitives/PrimitiveButton/src/PrimitiveButton.tsx +4 -12
- package/src/primitives/PrimitiveButton/test/PrimitiveButton.spec.tsx +16 -13
- package/src/statusIcon/StatusIcon.css +4 -0
- package/src/statusIcon/StatusIcon.less +4 -0
- package/src/statusIcon/StatusIcon.messages.ts +6 -0
- package/src/statusIcon/StatusIcon.tsx +8 -1
- package/src/test-utils/Parameters.d.ts +9 -1
- package/src/test-utils/story-config.ts +10 -1
- package/src/withNextPortal/withNextPortal.tsx +1 -10
- package/src/button/__snapshots__/Button.spec.tsx.snap +0 -309
|
@@ -1,78 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
.np-theme-personal--dark & {
|
|
10
|
-
--critical-comms-background-color: var(--color-sentiment-negative);
|
|
11
|
-
--critical-comms-title-color: var(--color-contrast);
|
|
12
|
-
--critical-comms-subtitle-color: var(--color-contrast);
|
|
13
|
-
--critical-comms-subtitle-color-padding-left: 0;
|
|
14
|
-
--critical-comms-vertical-spacing: var(--size-16);
|
|
15
|
-
|
|
16
|
-
padding: var(--padding-medium);
|
|
17
|
-
|
|
18
|
-
.tw-icon-alert-circle-fill {
|
|
19
|
-
color: var(--color-contrast);
|
|
20
|
-
|
|
21
|
-
svg {
|
|
22
|
-
width: 48px;
|
|
23
|
-
height: 48px;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.cta-btn {
|
|
28
|
-
background-color: var(--color-contrast);
|
|
29
|
-
|
|
30
|
-
&:not(.disabled,:disabled):focus {
|
|
31
|
-
outline-color: var(--color-contrast);
|
|
1
|
+
.np-theme-personal {
|
|
2
|
+
.critical-comms {
|
|
3
|
+
.alert-critical {
|
|
4
|
+
color: var(--color-contrast-overlay);
|
|
5
|
+
background-color: var(--color-sentiment-negative) !important;
|
|
6
|
+
|
|
7
|
+
.np-text-title-body {
|
|
8
|
+
color: var(--color-contrast-overlay);
|
|
32
9
|
}
|
|
33
10
|
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
background-color: var(--critical-comms-background-color);
|
|
37
|
-
display: flex;
|
|
38
|
-
justify-content: center;
|
|
39
|
-
align-items: center;
|
|
40
|
-
|
|
41
|
-
@media (--screen-sm-max) {
|
|
42
|
-
display: initial;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.critical-comms--title {
|
|
46
|
-
color: var(--critical-comms-title-color);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.critical-comms--subtitle {
|
|
50
|
-
color: var(--critical-comms-subtitle-color);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.critical-comms--cta {
|
|
54
|
-
padding-left: 0;
|
|
55
|
-
|
|
56
|
-
@media (--screen-sm-max) {
|
|
57
|
-
padding-left: var(--critical-comms-subtitle-color-padding-left);
|
|
58
|
-
padding-top: var(--critical-comms-vertical-spacing);
|
|
59
|
-
min-width: 100%;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.critical-comms-body {
|
|
64
|
-
display: flex;
|
|
65
|
-
width: 100%;
|
|
66
|
-
|
|
67
|
-
@media (--screen-sm-max) {
|
|
68
|
-
flex-direction: column;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
11
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
flex-wrap: wrap;
|
|
12
|
+
.action__desktop {
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
76
15
|
}
|
|
77
16
|
}
|
|
78
|
-
}
|
|
17
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { Meta
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
2
|
|
|
3
3
|
import CriticalCommsBanner from '.';
|
|
4
|
+
import { Variant } from '../common';
|
|
5
|
+
import { storyConfig } from '../test-utils';
|
|
4
6
|
|
|
5
7
|
export default {
|
|
6
8
|
component: CriticalCommsBanner,
|
|
@@ -8,12 +10,14 @@ export default {
|
|
|
8
10
|
tags: ['autodocs'],
|
|
9
11
|
} satisfies Meta<typeof CriticalCommsBanner>;
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
export const Basic = storyConfig(
|
|
14
|
+
{
|
|
15
|
+
args: {
|
|
16
|
+
title: 'Your account is overdrawn',
|
|
17
|
+
subtitle: 'Add money within the next 30 days',
|
|
18
|
+
action: { label: 'Take action', href: 'https://wise.com' },
|
|
19
|
+
variant: Variant.DESKTOP,
|
|
20
|
+
},
|
|
18
21
|
},
|
|
19
|
-
}
|
|
22
|
+
{ variants: ['default', 'dark', 'rtl'] },
|
|
23
|
+
);
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useTheme } from '@wise/components-theming';
|
|
1
|
+
import Alert from '../alert';
|
|
3
2
|
import { clsx } from 'clsx';
|
|
4
3
|
|
|
5
|
-
import Avatar, { AvatarType } from '../avatar';
|
|
6
|
-
import Body from '../body';
|
|
7
|
-
import Button from '../button';
|
|
8
|
-
import { ControlType, Priority, Size, Typography } from '../common';
|
|
9
|
-
import Title from '../title';
|
|
10
|
-
|
|
11
4
|
export type CriticalCommsBannerProps = {
|
|
12
5
|
title: string;
|
|
13
6
|
subtitle?: string;
|
|
@@ -19,50 +12,15 @@ export type CriticalCommsBannerProps = {
|
|
|
19
12
|
};
|
|
20
13
|
|
|
21
14
|
function CriticalCommsBanner({ title, subtitle, action, className }: CriticalCommsBannerProps) {
|
|
22
|
-
const { isModern } = useTheme();
|
|
23
15
|
return (
|
|
24
16
|
<div className={clsx('critical-comms', className)}>
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
>
|
|
34
|
-
{isModern ? <AlertCircleFill /> : <DangerIcon size={24} />}
|
|
35
|
-
</Avatar>
|
|
36
|
-
<div className="critical-comms-content d-flex align-items-center flex-grow-1">
|
|
37
|
-
<div className={clsx('flex-grow-1', { 'p-x-2': !isModern })}>
|
|
38
|
-
<Title
|
|
39
|
-
type={isModern ? Typography.TITLE_BODY : Typography.TITLE_GROUP}
|
|
40
|
-
className="critical-comms--title"
|
|
41
|
-
>
|
|
42
|
-
{title}
|
|
43
|
-
</Title>
|
|
44
|
-
<Body className="critical-comms--subtitle">{subtitle}</Body>
|
|
45
|
-
</div>
|
|
46
|
-
{action ? (
|
|
47
|
-
<div className="critical-comms--cta">
|
|
48
|
-
<Button
|
|
49
|
-
block={isModern}
|
|
50
|
-
size={Size.SMALL}
|
|
51
|
-
type={ControlType.NEGATIVE}
|
|
52
|
-
priority={isModern ? Priority.SECONDARY : Priority.PRIMARY}
|
|
53
|
-
className="cta-btn"
|
|
54
|
-
onClick={() => {
|
|
55
|
-
if (action) {
|
|
56
|
-
window.location.href = action.href;
|
|
57
|
-
}
|
|
58
|
-
}}
|
|
59
|
-
>
|
|
60
|
-
{action.label}
|
|
61
|
-
</Button>
|
|
62
|
-
</div>
|
|
63
|
-
) : null}
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
17
|
+
<Alert
|
|
18
|
+
title={title}
|
|
19
|
+
message={subtitle}
|
|
20
|
+
action={{ target: action?.href, text: action?.label }}
|
|
21
|
+
className={className}
|
|
22
|
+
type="critical"
|
|
23
|
+
/>
|
|
66
24
|
</div>
|
|
67
25
|
);
|
|
68
26
|
}
|
package/src/dimmer/Dimmer.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { ThemeProvider, useTheme } from '@wise/components-theming';
|
|
1
2
|
import { clsx } from 'clsx';
|
|
2
|
-
import { MouseEvent, ReactNode, useCallback, useEffect, useRef } from 'react';
|
|
3
|
+
import { MouseEvent, ReactNode, useCallback, useEffect, useRef, useState } from 'react';
|
|
3
4
|
import { CSSTransition } from 'react-transition-group';
|
|
4
5
|
|
|
5
6
|
import {
|
|
@@ -58,6 +59,7 @@ const Dimmer = ({
|
|
|
58
59
|
onClose,
|
|
59
60
|
onExited: handleExited,
|
|
60
61
|
}: DimmerProps) => {
|
|
62
|
+
const [hasNotExited, setHasNotExited] = useState(false);
|
|
61
63
|
const dimmerReference = useRef<HTMLDivElement>(null);
|
|
62
64
|
|
|
63
65
|
const closeOnClick = (event: MouseEvent<HTMLDivElement>) => {
|
|
@@ -89,11 +91,15 @@ const Dimmer = ({
|
|
|
89
91
|
);
|
|
90
92
|
|
|
91
93
|
const onEnter = () => {
|
|
94
|
+
setHasNotExited(true);
|
|
95
|
+
|
|
92
96
|
if (dimmerReference.current) {
|
|
93
97
|
dimmerManager.add(dimmerReference.current);
|
|
94
98
|
}
|
|
95
99
|
};
|
|
96
100
|
const onExited = () => {
|
|
101
|
+
setHasNotExited(false);
|
|
102
|
+
|
|
97
103
|
if (dimmerReference.current) {
|
|
98
104
|
dimmerManager.remove(dimmerReference.current);
|
|
99
105
|
}
|
|
@@ -116,54 +122,76 @@ const Dimmer = ({
|
|
|
116
122
|
}, [handleKeyDown, open]);
|
|
117
123
|
|
|
118
124
|
return (
|
|
119
|
-
<
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
'dimmer--enter-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
<
|
|
138
|
-
<
|
|
139
|
-
ref={dimmerReference}
|
|
140
|
-
className={clsx(
|
|
141
|
-
'dimmer',
|
|
142
|
-
{ 'dimmer--scrollable': scrollable, 'dimmer--transparent': transparent },
|
|
143
|
-
className,
|
|
144
|
-
)}
|
|
145
|
-
role="presentation"
|
|
146
|
-
onClick={handleClick}
|
|
147
|
-
>
|
|
125
|
+
<DimmerWrapper open={open} hasNotExited={hasNotExited}>
|
|
126
|
+
<CSSTransition
|
|
127
|
+
nodeRef={dimmerReference}
|
|
128
|
+
in={open}
|
|
129
|
+
appear
|
|
130
|
+
// Wait for animation to finish before unmount.
|
|
131
|
+
timeout={{ enter: 0, exit: EXIT_ANIMATION }}
|
|
132
|
+
classNames={{
|
|
133
|
+
enter: clsx({ 'dimmer--enter-fade': fadeContentOnEnter }),
|
|
134
|
+
enterDone: clsx('dimmer--enter-done', {
|
|
135
|
+
'dimmer--enter-fade': fadeContentOnEnter,
|
|
136
|
+
}),
|
|
137
|
+
exit: clsx('dimmer--exit', { 'dimmer--exit-fade': fadeContentOnExit }),
|
|
138
|
+
}}
|
|
139
|
+
unmountOnExit
|
|
140
|
+
onEnter={onEnter}
|
|
141
|
+
onExited={onExited}
|
|
142
|
+
>
|
|
143
|
+
<DimmerContentWrapper scrollBody={!transparent}>
|
|
144
|
+
<FocusBoundary>
|
|
148
145
|
<div
|
|
146
|
+
ref={dimmerReference}
|
|
149
147
|
className={clsx(
|
|
150
|
-
'dimmer
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
{
|
|
154
|
-
'align-items-start': contentPosition === 'top',
|
|
155
|
-
'align-items-center': contentPosition === 'center',
|
|
156
|
-
'align-items-end': contentPosition === 'bottom',
|
|
157
|
-
},
|
|
158
|
-
],
|
|
148
|
+
'dimmer',
|
|
149
|
+
{ 'dimmer--scrollable': scrollable, 'dimmer--transparent': transparent },
|
|
150
|
+
className,
|
|
159
151
|
)}
|
|
152
|
+
role="presentation"
|
|
153
|
+
onClick={handleClick}
|
|
160
154
|
>
|
|
161
|
-
|
|
155
|
+
<div
|
|
156
|
+
className={clsx(
|
|
157
|
+
'dimmer-content-positioner',
|
|
158
|
+
contentPosition != null && [
|
|
159
|
+
'd-flex justify-content-center',
|
|
160
|
+
{
|
|
161
|
+
'align-items-start': contentPosition === 'top',
|
|
162
|
+
'align-items-center': contentPosition === 'center',
|
|
163
|
+
'align-items-end': contentPosition === 'bottom',
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
)}
|
|
167
|
+
>
|
|
168
|
+
{children}
|
|
169
|
+
</div>
|
|
162
170
|
</div>
|
|
163
|
-
</
|
|
164
|
-
</
|
|
165
|
-
</
|
|
166
|
-
</
|
|
171
|
+
</FocusBoundary>
|
|
172
|
+
</DimmerContentWrapper>
|
|
173
|
+
</CSSTransition>
|
|
174
|
+
</DimmerWrapper>
|
|
175
|
+
);
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
const DimmerWrapper: React.ComponentType<{
|
|
179
|
+
open: boolean;
|
|
180
|
+
hasNotExited: boolean;
|
|
181
|
+
children: React.ReactNode;
|
|
182
|
+
}> = ({ open, hasNotExited, children }) => {
|
|
183
|
+
const { screenMode, theme } = useTheme();
|
|
184
|
+
|
|
185
|
+
return open || hasNotExited ? (
|
|
186
|
+
<ThemeProvider
|
|
187
|
+
theme="personal"
|
|
188
|
+
screenMode={theme === 'personal' ? screenMode : 'light'}
|
|
189
|
+
isNotRootProvider
|
|
190
|
+
>
|
|
191
|
+
{children}
|
|
192
|
+
</ThemeProvider>
|
|
193
|
+
) : (
|
|
194
|
+
<>{children}</>
|
|
167
195
|
);
|
|
168
196
|
};
|
|
169
197
|
|
|
@@ -9,10 +9,9 @@ exports[`FlowNavigation on mobile renders as expected 1`] = `
|
|
|
9
9
|
class="np-flow-header d-flex flex-wrap align-items-center justify-content-between flex__item--12 np-flow-navigation__content p-x-3 np-flow-navigation--xs-max"
|
|
10
10
|
>
|
|
11
11
|
<button
|
|
12
|
-
aria-disabled="false"
|
|
13
12
|
aria-label="back to previous step"
|
|
14
13
|
aria-live="off"
|
|
15
|
-
class="
|
|
14
|
+
class="np-circle d-flex align-items-center justify-content-center np-icon-button np-icon-button-tertiary-default"
|
|
16
15
|
style="--circle-size: 40px; --circle-icon-size: 20px; --circle-font-size: 18px;"
|
|
17
16
|
type="button"
|
|
18
17
|
>
|
package/src/i18n/en.json
CHANGED
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"neptune.SelectInput.noResultsFound": "No results found",
|
|
28
28
|
"neptune.SelectOption.action.label": "Choose",
|
|
29
29
|
"neptune.SelectOption.selected.action.label": "Change chosen option",
|
|
30
|
+
"neptune.StatusIcon.iconLabel.critical": "Critical:",
|
|
30
31
|
"neptune.StatusIcon.iconLabel.error": "Error:",
|
|
31
32
|
"neptune.StatusIcon.iconLabel.information": "Information:",
|
|
32
33
|
"neptune.StatusIcon.iconLabel.pending": "Pending:",
|
|
@@ -5,7 +5,7 @@ import { Flag } from '@wise/art';
|
|
|
5
5
|
import { clsx } from 'clsx';
|
|
6
6
|
import { useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import Button from '../button
|
|
8
|
+
import Button from '../button';
|
|
9
9
|
import { getMonthNames } from '../common/dateUtils';
|
|
10
10
|
import Drawer from '../drawer';
|
|
11
11
|
import { Field } from '../field/Field';
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from '@floating-ui/react';
|
|
9
9
|
import { Transition } from '@headlessui/react';
|
|
10
10
|
import { FocusScope } from '@react-aria/focus';
|
|
11
|
-
import {
|
|
11
|
+
import { ThemeProvider, useTheme } from '@wise/components-theming';
|
|
12
12
|
import { clsx } from 'clsx';
|
|
13
13
|
import { Fragment, useState } from 'react';
|
|
14
14
|
|
|
@@ -60,6 +60,8 @@ export function BottomSheet({
|
|
|
60
60
|
|
|
61
61
|
const [floatingKey, setFloatingKey] = useState(0);
|
|
62
62
|
|
|
63
|
+
const { theme, screenMode } = useTheme();
|
|
64
|
+
|
|
63
65
|
return (
|
|
64
66
|
<>
|
|
65
67
|
{open ? <PreventScroll /> : null}
|
|
@@ -69,7 +71,11 @@ export function BottomSheet({
|
|
|
69
71
|
})}
|
|
70
72
|
|
|
71
73
|
<FloatingPortal>
|
|
72
|
-
<
|
|
74
|
+
<ThemeProvider
|
|
75
|
+
theme="personal"
|
|
76
|
+
screenMode={theme === 'personal' ? screenMode : 'light'}
|
|
77
|
+
isNotRootProvider
|
|
78
|
+
>
|
|
73
79
|
<Transition
|
|
74
80
|
show={open}
|
|
75
81
|
className="np-bottom-sheet-v2-container"
|
|
@@ -125,7 +131,7 @@ export function BottomSheet({
|
|
|
125
131
|
</FocusScope>
|
|
126
132
|
</div>
|
|
127
133
|
</Transition>
|
|
128
|
-
</
|
|
134
|
+
</ThemeProvider>
|
|
129
135
|
</FloatingPortal>
|
|
130
136
|
</>
|
|
131
137
|
);
|
package/src/inputs/_Popover.tsx
CHANGED
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
flip,
|
|
4
4
|
FloatingFocusManager,
|
|
5
5
|
FloatingPortal,
|
|
6
|
-
size as floatingSize,
|
|
7
6
|
offset,
|
|
8
7
|
type Placement,
|
|
9
8
|
shift,
|
|
9
|
+
size as floatingSize,
|
|
10
10
|
useDismiss,
|
|
11
11
|
useFloating,
|
|
12
12
|
useInteractions,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from '@floating-ui/react';
|
|
15
15
|
import { Transition } from '@headlessui/react';
|
|
16
16
|
import { FocusScope } from '@react-aria/focus';
|
|
17
|
-
import {
|
|
17
|
+
import { ThemeProvider, useTheme } from '@wise/components-theming';
|
|
18
18
|
import { clsx } from 'clsx';
|
|
19
19
|
import { useState } from 'react';
|
|
20
20
|
|
|
@@ -79,6 +79,8 @@ export function Popover({
|
|
|
79
79
|
|
|
80
80
|
const [floatingKey, setFloatingKey] = useState(0);
|
|
81
81
|
|
|
82
|
+
const { theme, screenMode } = useTheme();
|
|
83
|
+
|
|
82
84
|
return (
|
|
83
85
|
<>
|
|
84
86
|
{open ? <PreventScroll /> : null}
|
|
@@ -88,7 +90,11 @@ export function Popover({
|
|
|
88
90
|
})}
|
|
89
91
|
|
|
90
92
|
<FloatingPortal>
|
|
91
|
-
<
|
|
93
|
+
<ThemeProvider
|
|
94
|
+
theme="personal"
|
|
95
|
+
screenMode={theme === 'personal' ? screenMode : 'light'}
|
|
96
|
+
isNotRootProvider
|
|
97
|
+
>
|
|
92
98
|
<Transition
|
|
93
99
|
show={open}
|
|
94
100
|
leave="transition-opacity"
|
|
@@ -125,7 +131,7 @@ export function Popover({
|
|
|
125
131
|
</FloatingFocusManager>
|
|
126
132
|
</FocusScope>
|
|
127
133
|
</Transition>
|
|
128
|
-
</
|
|
134
|
+
</ThemeProvider>
|
|
129
135
|
</FloatingPortal>
|
|
130
136
|
</>
|
|
131
137
|
);
|
package/src/link/Link.tsx
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { NavigateAway as NavigateAwayIcon } from '@transferwise/icons';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
|
-
import { AnchorHTMLAttributes } from 'react';
|
|
4
3
|
import { useIntl } from 'react-intl';
|
|
4
|
+
import { PrimitiveAnchor } from '../primitives';
|
|
5
|
+
import type { PrimitiveAnchorProps } from '../primitives';
|
|
5
6
|
|
|
6
7
|
import { LinkLarge, LinkDefault } from '../common';
|
|
7
8
|
|
|
8
9
|
import messages from './Link.messages';
|
|
9
10
|
|
|
10
|
-
export type Props =
|
|
11
|
+
export type Props = PrimitiveAnchorProps & { type?: LinkLarge | LinkDefault };
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Standard Link component with navigate away icon
|
|
@@ -24,22 +25,30 @@ const Link = ({
|
|
|
24
25
|
onClick,
|
|
25
26
|
...props
|
|
26
27
|
}: Props) => {
|
|
28
|
+
const { formatMessage } = useIntl();
|
|
27
29
|
const isBlank = target === '_blank';
|
|
28
30
|
|
|
29
|
-
const
|
|
31
|
+
const classNames = clsx(
|
|
32
|
+
'np-link',
|
|
33
|
+
'd-inline-flex',
|
|
34
|
+
{
|
|
35
|
+
[`np-text-${type}`]: type,
|
|
36
|
+
},
|
|
37
|
+
className,
|
|
38
|
+
);
|
|
30
39
|
|
|
31
40
|
return (
|
|
32
|
-
<
|
|
41
|
+
<PrimitiveAnchor
|
|
33
42
|
href={href}
|
|
34
43
|
target={target}
|
|
35
|
-
className={
|
|
44
|
+
className={classNames}
|
|
36
45
|
aria-label={ariaLabel}
|
|
37
46
|
rel={isBlank ? 'noreferrer' : undefined}
|
|
38
47
|
onClick={onClick}
|
|
39
48
|
{...props}
|
|
40
49
|
>
|
|
41
50
|
{children} {isBlank && <NavigateAwayIcon title={formatMessage(messages.opensInNewTab)} />}
|
|
42
|
-
</
|
|
51
|
+
</PrimitiveAnchor>
|
|
43
52
|
);
|
|
44
53
|
};
|
|
45
54
|
|