@transferwise/components 0.0.0-experimental-a1b5585 → 0.0.0-experimental-999c033
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/ProcessIndicator/ProcessIndicator.js +1 -1
- package/build/ProcessIndicator/ProcessIndicator.js.map +1 -1
- package/build/ProcessIndicator/ProcessIndicator.mjs +1 -1
- package/build/ProcessIndicator/ProcessIndicator.mjs.map +1 -1
- package/build/main.css +64 -56
- package/build/styles/AvatarView/AvatarView.css +0 -8
- package/build/styles/AvatarView/Dot/Dot.css +0 -8
- package/build/styles/CheckboxButton/CheckboxButton.css +0 -3
- package/build/styles/Nudge/Nudge.css +38 -4
- package/build/styles/SlidingPanel/SlidingPanel.css +0 -8
- package/build/styles/UploadInput/UploadItem/UploadItem.css +5 -4
- package/build/styles/_deprecated/Badge/Badge.css +2 -4
- package/build/styles/css/accordion.css +0 -3
- package/build/styles/css/buttons.css +7 -1
- package/build/styles/css/chevron.css +0 -3
- package/build/styles/css/neptune.css +19 -25
- package/build/styles/css/process.css +9 -15
- package/build/styles/css/tick.css +3 -6
- package/build/styles/main.css +64 -56
- package/build/styles/styles/less/accordion.css +0 -3
- package/build/styles/styles/less/buttons.css +7 -1
- package/build/styles/styles/less/chevron.css +0 -3
- package/build/styles/styles/less/neptune.css +19 -25
- package/build/styles/styles/less/process.css +9 -15
- package/build/styles/styles/less/tick.css +3 -6
- package/package.json +2 -2
- package/src/AvatarView/AvatarView.css +0 -8
- package/src/AvatarView/Dot/Dot.css +0 -8
- package/src/AvatarView/Dot/Dot.less +1 -7
- package/src/Button/_stories/Button.test.story.tsx +1 -1
- package/src/Checkbox/_stories/Checkbox.story.tsx +1 -1
- package/src/Checkbox/_stories/Checkbox.test.story.tsx +2 -3
- package/src/CheckboxButton/CheckboxButton.css +0 -3
- package/src/CheckboxButton/CheckboxButton.less +0 -4
- package/src/Chevron/_stories/Chevron.test.story.tsx +2 -2
- package/src/Header/_stories/Header.test.story.tsx +1 -1
- package/src/Info/_stories/Info.rtl.test.story.tsx +10 -35
- package/src/Info/_stories/Info.story.tsx +1 -1
- package/src/Inputs/SelectInput/_stories/SelectInput.test.story.tsx +1 -1
- package/src/ListItem/_stories/subcomponents.tsx +1 -1
- package/src/MoneyInput/_stories/MoneyInput.rtl.test.story.tsx +1 -1
- package/src/Nudge/Nudge.css +38 -4
- package/src/Nudge/Nudge.less +4 -4
- package/src/Nudge/_stories/Nudge.test.story.tsx +12 -29
- package/src/PhoneNumberInput/_stories/{PhoneNumberInput.rtl.test.story.tsx → PhoneNumberInput.test.story.tsx} +10 -18
- package/src/ProcessIndicator/ProcessIndicator.tsx +1 -1
- package/src/ProgressBar/_stories/ProgressBar.test.story.tsx +19 -33
- package/src/SlidingPanel/SlidingPanel.css +0 -8
- package/src/SlidingPanel/SlidingPanel.less +0 -8
- package/src/SlidingPanel/_stories/SlidingPanel.rtl.test.story.tsx +3 -4
- package/src/Snackbar/_stories/Snackbar.rtl.test.story.tsx +16 -14
- package/src/Snackbar/_stories/Snackbar.story.tsx +1 -1
- package/src/Snackbar/_stories/Snackbar.test.story.tsx +1 -1
- package/src/StatusIcon/_stories/StatusIcon.test.story.tsx +4 -12
- package/src/UploadInput/UploadItem/UploadItem.css +5 -4
- package/src/UploadInput/UploadItem/UploadItem.less +6 -7
- package/src/UploadInput/_stories/UploadInput.test.story.tsx +1 -1
- package/src/_deprecated/Badge/Badge.css +2 -4
- package/src/_deprecated/Badge/Badge.less +14 -7
- package/src/_deprecated/CriticalBanner/_stories/CriticalCommsBanner.test.story.tsx +16 -0
- package/src/_deprecated/OverlayHeader/_stories/OverlayHeader.test.story.tsx +0 -15
- package/src/main.css +64 -56
- package/src/styles/less/accordion.css +0 -3
- package/src/styles/less/buttons.css +7 -1
- package/src/styles/less/buttons.less +11 -3
- package/src/styles/less/chevron.css +0 -3
- package/src/styles/less/chevron.less +0 -4
- package/src/styles/less/neptune.css +19 -25
- package/src/styles/less/process.css +9 -15
- package/src/styles/less/process.less +6 -13
- package/src/styles/less/tick.css +3 -6
- package/src/styles/less/tick.less +3 -7
- package/src/Loader/_stories/Loader.test.story.tsx +0 -23
- package/src/ProcessIndicator/_stories/ProcessIndicator.test.story.tsx +0 -32
|
@@ -10,45 +10,28 @@ export default {
|
|
|
10
10
|
|
|
11
11
|
type Story = StoryObj<typeof Nudge>;
|
|
12
12
|
|
|
13
|
-
const MEDIA_NAMES = [
|
|
14
|
-
'globe',
|
|
15
|
-
'lock',
|
|
16
|
-
'wallet',
|
|
17
|
-
'gear',
|
|
18
|
-
'invite-letter',
|
|
19
|
-
'personal-card',
|
|
20
|
-
'business-card',
|
|
21
|
-
'heart',
|
|
22
|
-
'multi-currency',
|
|
23
|
-
'shopping-bag',
|
|
24
|
-
'flower',
|
|
25
|
-
'gift-box',
|
|
26
|
-
'backpack',
|
|
27
|
-
'documents',
|
|
28
|
-
] as const;
|
|
29
|
-
|
|
30
13
|
export const RTLDiff: Story = {
|
|
31
14
|
render: () => (
|
|
32
15
|
<>
|
|
33
|
-
{MEDIA_NAMES.map((mediaName) => (
|
|
34
|
-
<Nudge
|
|
35
|
-
key={mediaName}
|
|
36
|
-
mediaName={mediaName}
|
|
37
|
-
title={mediaName}
|
|
38
|
-
link="Link"
|
|
39
|
-
href="#"
|
|
40
|
-
onDismiss={() => {}}
|
|
41
|
-
/>
|
|
42
|
-
))}
|
|
43
16
|
<Nudge
|
|
44
17
|
mediaName="globe"
|
|
45
|
-
title="With
|
|
18
|
+
title="With media and dismiss"
|
|
19
|
+
link="Link"
|
|
20
|
+
href="#"
|
|
21
|
+
onDismiss={() => {}}
|
|
22
|
+
/>
|
|
23
|
+
<div style={{ marginTop: 16 }} />
|
|
24
|
+
<Nudge
|
|
25
|
+
mediaName="globe"
|
|
26
|
+
title="With media, action, and dismiss"
|
|
46
27
|
action={{ text: 'Learn more', href: '#' }}
|
|
47
28
|
onDismiss={() => {}}
|
|
48
29
|
/>
|
|
30
|
+
<div style={{ marginTop: 16 }} />
|
|
49
31
|
<Nudge title="Without media, with dismiss" link="Link" href="#" onDismiss={() => {}} />
|
|
32
|
+
<div style={{ marginTop: 16 }} />
|
|
50
33
|
<Nudge title="Without media, no dismiss" link="Link" href="#" />
|
|
51
34
|
</>
|
|
52
35
|
),
|
|
53
|
-
...withRTLDiff(
|
|
36
|
+
...withRTLDiff(),
|
|
54
37
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
-
import { userEvent, within } from 'storybook/test';
|
|
3
2
|
|
|
4
3
|
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
5
4
|
import Field from '../../Field/Field';
|
|
@@ -7,13 +6,21 @@ import PhoneNumberInput from '..';
|
|
|
7
6
|
|
|
8
7
|
export default {
|
|
9
8
|
component: PhoneNumberInput,
|
|
10
|
-
title: 'Forms/PhoneNumberInput/Tests
|
|
9
|
+
title: 'Forms/PhoneNumberInput/Tests',
|
|
11
10
|
tags: ['!autodocs', '!manifest'],
|
|
12
11
|
} satisfies Meta<typeof PhoneNumberInput>;
|
|
13
12
|
|
|
14
13
|
type Story = StoryObj<typeof PhoneNumberInput>;
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
/**
|
|
16
|
+
* The country code selector sits on the inline-start side of the phone number input.
|
|
17
|
+
* In RTL the two elements should swap sides — the selector moves to the right and
|
|
18
|
+
* the text field moves to the left. This diff verifies the flex row reverses correctly.
|
|
19
|
+
*
|
|
20
|
+
* Size variants are included because the size prop changes the input-group class and
|
|
21
|
+
* may affect spacing between the two sub-inputs.
|
|
22
|
+
*/
|
|
23
|
+
export const RTLDiff: Story = {
|
|
17
24
|
render: () => (
|
|
18
25
|
<>
|
|
19
26
|
<Field label="Default (md)">
|
|
@@ -35,18 +42,3 @@ export const Sizes: Story = {
|
|
|
35
42
|
),
|
|
36
43
|
...withRTLDiff(),
|
|
37
44
|
};
|
|
38
|
-
|
|
39
|
-
export const DropdownOpen: Story = {
|
|
40
|
-
render: () => (
|
|
41
|
-
<Field label="Phone number">
|
|
42
|
-
<PhoneNumberInput onChange={() => {}} />
|
|
43
|
-
</Field>
|
|
44
|
-
),
|
|
45
|
-
play: async ({ canvasElement }) => {
|
|
46
|
-
const canvas = within(canvasElement);
|
|
47
|
-
const trigger = canvas.queryByRole('combobox');
|
|
48
|
-
if (!trigger) return;
|
|
49
|
-
await userEvent.click(trigger);
|
|
50
|
-
},
|
|
51
|
-
...withRTLDiff({ renderAs: 'iframe', hAlign: 'center' }),
|
|
52
|
-
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
4
4
|
import ProgressBar from '..';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
@@ -12,36 +12,22 @@ export default {
|
|
|
12
12
|
type Story = StoryObj<typeof ProgressBar>;
|
|
13
13
|
|
|
14
14
|
export const RTLDiff: Story = {
|
|
15
|
-
render: () =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
);
|
|
34
|
-
},
|
|
35
|
-
...withRTLDiff({
|
|
36
|
-
i18n: {
|
|
37
|
-
title1: { ltr: 'Send 5,550 GBP', rtl: 'أرسل ٥٬٥٥٠ جنيه إسترليني' },
|
|
38
|
-
description: {
|
|
39
|
-
ltr: 'You have 3 days to reach your goal.',
|
|
40
|
-
rtl: 'لديك ٣ أيام للوصول إلى هدفك.',
|
|
41
|
-
},
|
|
42
|
-
textEnd1: { ltr: '200 GBP to go', rtl: '٢٠٠ جنيه إسترليني متبقي' },
|
|
43
|
-
title2: { ltr: 'Total limit', rtl: 'الحد الإجمالي' },
|
|
44
|
-
textEnd2: { ltr: '200 GBP remaining', rtl: '٢٠٠ جنيه إسترليني متبقي' },
|
|
45
|
-
},
|
|
46
|
-
}),
|
|
15
|
+
render: () => (
|
|
16
|
+
<>
|
|
17
|
+
<ProgressBar
|
|
18
|
+
id="progress-bar-with-description"
|
|
19
|
+
title="Send 5,550 GBP"
|
|
20
|
+
description="You have 3 days to reach your goal."
|
|
21
|
+
progress={{ value: 50, max: 100 }}
|
|
22
|
+
textEnd="200 GBP to go"
|
|
23
|
+
/>
|
|
24
|
+
<ProgressBar
|
|
25
|
+
id="progress-bar-without-description"
|
|
26
|
+
title="Total limit"
|
|
27
|
+
progress={{ value: 800, max: 1000 }}
|
|
28
|
+
textEnd="200 GBP remaining"
|
|
29
|
+
/>
|
|
30
|
+
</>
|
|
31
|
+
),
|
|
32
|
+
...withRTLDiff(),
|
|
47
33
|
};
|
|
@@ -73,10 +73,6 @@
|
|
|
73
73
|
box-shadow: inset 1px 0 0 0 rgba(0,0,0,0.10196);
|
|
74
74
|
box-shadow: inset 1px 0 0 0 var(--color-border-neutral);
|
|
75
75
|
}
|
|
76
|
-
[dir="rtl"] .np-theme-personal .sliding-panel.sliding-panel--border-right {
|
|
77
|
-
box-shadow: inset -1px 0 0 0 rgba(0,0,0,0.10196);
|
|
78
|
-
box-shadow: inset -1px 0 0 0 var(--color-border-neutral);
|
|
79
|
-
}
|
|
80
76
|
.np-theme-personal .sliding-panel.sliding-panel--border-bottom {
|
|
81
77
|
box-shadow: inset 0 1px 0 0 rgba(0,0,0,0.10196);
|
|
82
78
|
box-shadow: inset 0 1px 0 0 var(--color-border-neutral);
|
|
@@ -85,7 +81,3 @@
|
|
|
85
81
|
box-shadow: inset -1px 0 0 0 rgba(0,0,0,0.10196);
|
|
86
82
|
box-shadow: inset -1px 0 0 0 var(--color-border-neutral);
|
|
87
83
|
}
|
|
88
|
-
[dir="rtl"] .np-theme-personal .sliding-panel.sliding-panel--border-left {
|
|
89
|
-
box-shadow: inset 1px 0 0 0 rgba(0,0,0,0.10196);
|
|
90
|
-
box-shadow: inset 1px 0 0 0 var(--color-border-neutral);
|
|
91
|
-
}
|
|
@@ -85,10 +85,6 @@
|
|
|
85
85
|
|
|
86
86
|
&.sliding-panel--border-right {
|
|
87
87
|
box-shadow: inset 1px 0 0 0 var(--color-border-neutral);
|
|
88
|
-
|
|
89
|
-
[dir="rtl"] & {
|
|
90
|
-
box-shadow: inset -1px 0 0 0 var(--color-border-neutral);
|
|
91
|
-
}
|
|
92
88
|
}
|
|
93
89
|
|
|
94
90
|
&.sliding-panel--border-bottom {
|
|
@@ -97,10 +93,6 @@
|
|
|
97
93
|
|
|
98
94
|
&.sliding-panel--border-left {
|
|
99
95
|
box-shadow: inset -1px 0 0 0 var(--color-border-neutral);
|
|
100
|
-
|
|
101
|
-
[dir="rtl"] & {
|
|
102
|
-
box-shadow: inset 1px 0 0 0 var(--color-border-neutral);
|
|
103
|
-
}
|
|
104
96
|
}
|
|
105
97
|
}
|
|
106
98
|
}
|
|
@@ -11,15 +11,14 @@ export default {
|
|
|
11
11
|
|
|
12
12
|
type Story = StoryObj<typeof SlidingPanel>;
|
|
13
13
|
|
|
14
|
-
const iframeDiff = withRTLDiff({ renderAs: 'iframe'
|
|
14
|
+
const iframeDiff = withRTLDiff({ renderAs: 'iframe' });
|
|
15
15
|
|
|
16
16
|
const containerStyle: React.CSSProperties = {
|
|
17
17
|
position: 'relative',
|
|
18
|
-
width:
|
|
18
|
+
width: 300,
|
|
19
19
|
height: 120,
|
|
20
20
|
overflow: 'hidden',
|
|
21
|
-
border: '1px
|
|
22
|
-
background: '#f5f5f5',
|
|
21
|
+
border: '1px dashed #ccc',
|
|
23
22
|
};
|
|
24
23
|
|
|
25
24
|
const panelContentStyle: React.CSSProperties = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useState } from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
3
3
|
|
|
4
4
|
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
@@ -6,38 +6,40 @@ import { Snackbar } from '../Snackbar';
|
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
8
|
component: Snackbar,
|
|
9
|
-
title: '
|
|
9
|
+
title: 'Dialogs/Snackbar/Tests/RTL Diff',
|
|
10
10
|
tags: ['!autodocs', '!manifest'],
|
|
11
11
|
} satisfies Meta<typeof Snackbar>;
|
|
12
12
|
|
|
13
13
|
type Story = StoryObj<typeof Snackbar>;
|
|
14
14
|
|
|
15
15
|
const TIMEOUT = 10_000_000;
|
|
16
|
+
const iframeDiff = withRTLDiff({ renderAs: 'iframe' });
|
|
16
17
|
|
|
17
|
-
function
|
|
18
|
-
const [timestamp
|
|
19
|
-
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
// eslint-disable-next-line react-hooks/set-state-in-effect
|
|
22
|
-
setTimestamp(1);
|
|
23
|
-
}, []);
|
|
18
|
+
function RenderWithAction() {
|
|
19
|
+
const [timestamp] = useState(() => Date.now());
|
|
24
20
|
|
|
25
21
|
return (
|
|
26
22
|
<Snackbar
|
|
27
23
|
text={<span>Transfer completed successfully</span>}
|
|
28
24
|
timestamp={timestamp}
|
|
29
25
|
timeout={TIMEOUT}
|
|
30
|
-
action={
|
|
26
|
+
action={{ label: 'View' }}
|
|
31
27
|
/>
|
|
32
28
|
);
|
|
33
29
|
}
|
|
34
30
|
|
|
31
|
+
function RenderWithoutAction() {
|
|
32
|
+
const [timestamp] = useState(() => Date.now());
|
|
33
|
+
|
|
34
|
+
return <Snackbar text={<span>Settings saved</span>} timestamp={timestamp} timeout={TIMEOUT} />;
|
|
35
|
+
}
|
|
36
|
+
|
|
35
37
|
export const WithAction: Story = {
|
|
36
|
-
render: () => <
|
|
37
|
-
...
|
|
38
|
+
render: () => <RenderWithAction />,
|
|
39
|
+
...iframeDiff,
|
|
38
40
|
};
|
|
39
41
|
|
|
40
42
|
export const WithoutAction: Story = {
|
|
41
|
-
render: () => <
|
|
42
|
-
...
|
|
43
|
+
render: () => <RenderWithoutAction />,
|
|
44
|
+
...iframeDiff,
|
|
43
45
|
};
|
|
@@ -9,7 +9,7 @@ import { SnackbarConsumer } from '../SnackbarContext';
|
|
|
9
9
|
import SnackbarProvider from '../SnackbarProvider';
|
|
10
10
|
|
|
11
11
|
export default {
|
|
12
|
-
title: '
|
|
12
|
+
title: 'Dialogs/Snackbar/Tests',
|
|
13
13
|
component: Snackbar,
|
|
14
14
|
argTypes: {},
|
|
15
15
|
tags: ['!autodocs', '!manifest'],
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
|
|
3
|
-
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
4
3
|
import { Sentiment, Size } from '../../common';
|
|
5
4
|
import SentimentSurface from '../../SentimentSurface';
|
|
5
|
+
import { withVariantConfig } from '../../../.storybook/helpers';
|
|
6
6
|
|
|
7
7
|
import StatusIcon, { StatusIconSentiment } from '../StatusIcon';
|
|
8
8
|
|
|
@@ -90,17 +90,9 @@ export const Variants: Story = {
|
|
|
90
90
|
},
|
|
91
91
|
};
|
|
92
92
|
|
|
93
|
-
export const
|
|
94
|
-
render:
|
|
95
|
-
|
|
96
|
-
<StatusIcon sentiment="positive" />
|
|
97
|
-
<StatusIcon sentiment="negative" />
|
|
98
|
-
<StatusIcon sentiment="warning" />
|
|
99
|
-
<StatusIcon sentiment="neutral" />
|
|
100
|
-
<StatusIcon sentiment="pending" />
|
|
101
|
-
</>
|
|
102
|
-
),
|
|
103
|
-
...withRTLDiff(),
|
|
93
|
+
export const RTL: Story = {
|
|
94
|
+
render: Variants.render,
|
|
95
|
+
...withVariantConfig(['rtl']),
|
|
104
96
|
};
|
|
105
97
|
|
|
106
98
|
/**
|
|
@@ -41,7 +41,8 @@
|
|
|
41
41
|
.np-upload-input__item .np-upload-input__title,
|
|
42
42
|
.np-upload-input__item .np-upload-input__text {
|
|
43
43
|
margin: 0;
|
|
44
|
-
text-align:
|
|
44
|
+
-moz-text-align-last: left;
|
|
45
|
+
text-align-last: left;
|
|
45
46
|
color: #5d7079;
|
|
46
47
|
color: var(--color-content-secondary);
|
|
47
48
|
}
|
|
@@ -97,7 +98,7 @@
|
|
|
97
98
|
justify-content: center;
|
|
98
99
|
}
|
|
99
100
|
.np-upload-input__item .np-upload-input__item-action .np-upload-input__item-button:before {
|
|
100
|
-
content:
|
|
101
|
+
content: '';
|
|
101
102
|
display: block;
|
|
102
103
|
inline-size: var(--clickAreaSize);
|
|
103
104
|
block-size: var(--clickAreaSize);
|
|
@@ -152,8 +153,8 @@
|
|
|
152
153
|
padding-inline-start: var(--size-16);
|
|
153
154
|
}
|
|
154
155
|
.np-upload-input__item .np-upload-input-errors > li::before {
|
|
155
|
-
content:
|
|
156
|
-
content:
|
|
156
|
+
content: '•' ;
|
|
157
|
+
content: '•' / '';
|
|
157
158
|
position: absolute;
|
|
158
159
|
display: block;
|
|
159
160
|
inset-inline-start: 0;
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
.np-upload-input__title,
|
|
40
40
|
.np-upload-input__text {
|
|
41
41
|
margin: 0;
|
|
42
|
-
text-align: left;
|
|
42
|
+
text-align-last: left;
|
|
43
43
|
color: var(--color-content-secondary);
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
--buttonTopRightOffset: var(--size-16);
|
|
65
65
|
// Offset towards the parent's top-right edge
|
|
66
66
|
// ensuring no overflow on smaller screens
|
|
67
|
-
--clickAreaTopRightOffset: calc((var(--clickAreaSize) - var(--iconSize)) *
|
|
67
|
+
--clickAreaTopRightOffset: calc((var(--clickAreaSize) - var(--iconSize)) * -.5);
|
|
68
68
|
|
|
69
69
|
position: absolute;
|
|
70
70
|
right: var(--buttonTopRightOffset);
|
|
@@ -84,16 +84,14 @@
|
|
|
84
84
|
border: 0;
|
|
85
85
|
background-color: var(--color-background-neutral);
|
|
86
86
|
color: var(--color-interactive-primary);
|
|
87
|
-
transition:
|
|
88
|
-
color,
|
|
89
|
-
background-color 0.15s ease-in-out;
|
|
87
|
+
transition: color, background-color 0.15s ease-in-out;
|
|
90
88
|
outline-offset: 0;
|
|
91
89
|
display: flex;
|
|
92
90
|
align-items: center;
|
|
93
91
|
justify-content: center;
|
|
94
92
|
|
|
95
93
|
&:before {
|
|
96
|
-
content:
|
|
94
|
+
content: '';
|
|
97
95
|
display: block;
|
|
98
96
|
width: var(--clickAreaSize);
|
|
99
97
|
height: var(--clickAreaSize);
|
|
@@ -118,6 +116,7 @@
|
|
|
118
116
|
padding: 0;
|
|
119
117
|
|
|
120
118
|
&:hover:not(:has(.np-upload-input__item-button:hover)) {
|
|
119
|
+
|
|
121
120
|
&:before,
|
|
122
121
|
& + .np-upload-input__item:before {
|
|
123
122
|
width: 100%;
|
|
@@ -159,7 +158,7 @@
|
|
|
159
158
|
padding-left: var(--size-16);
|
|
160
159
|
|
|
161
160
|
&::before {
|
|
162
|
-
content:
|
|
161
|
+
content: '•' / '';
|
|
163
162
|
position: absolute;
|
|
164
163
|
display: block;
|
|
165
164
|
left: 0;
|
|
@@ -15,14 +15,12 @@
|
|
|
15
15
|
--badge-border-color: rgba(0, 0, 0, 0.08);
|
|
16
16
|
}
|
|
17
17
|
.tw-badge > .tw-badge__children {
|
|
18
|
-
--badge-h-side: left;
|
|
19
18
|
-webkit-mask-image: radial-gradient(circle at top calc(100% - var(--badge-mask-offset) - var(--badge-content-position)) left calc(100% - var(--badge-mask-offset) - var(--badge-content-position)), transparent 0, transparent calc(var(--badge-size) / 2 + var(--badge-mask)), black calc(var(--badge-size) / 2 + var(--badge-mask) + 0.5px));
|
|
20
19
|
mask-image: radial-gradient(circle at top calc(100% - var(--badge-mask-offset) - var(--badge-content-position)) left calc(100% - var(--badge-mask-offset) - var(--badge-content-position)), transparent 0, transparent calc(var(--badge-size) / 2 + var(--badge-mask)), black calc(var(--badge-size) / 2 + var(--badge-mask) + 0.5px));
|
|
21
|
-
-webkit-mask-image: radial-gradient(circle at top calc(100% - var(--badge-mask-offset) - var(--badge-content-position)) var(--badge-h-side) calc(100% - var(--badge-mask-offset) - var(--badge-content-position)), transparent 0, transparent calc(var(--badge-size) / 2 + var(--badge-mask)), black calc(var(--badge-size) / 2 + var(--badge-mask) + 0.5px));
|
|
22
|
-
mask-image: radial-gradient(circle at top calc(100% - var(--badge-mask-offset) - var(--badge-content-position)) var(--badge-h-side) calc(100% - var(--badge-mask-offset) - var(--badge-content-position)), transparent 0, transparent calc(var(--badge-size) / 2 + var(--badge-mask)), black calc(var(--badge-size) / 2 + var(--badge-mask) + 0.5px));
|
|
23
20
|
}
|
|
24
21
|
[dir="rtl"] .tw-badge > .tw-badge__children {
|
|
25
|
-
--badge-
|
|
22
|
+
-webkit-mask-image: radial-gradient(circle at top calc(100% - var(--badge-mask-offset)) right calc(100% - var(--badge-mask-offset)), transparent 0, transparent calc(var(--badge-size) / 2 + var(--badge-mask)), black calc(var(--badge-size) / 2 + var(--badge-mask) + 0.5px));
|
|
23
|
+
mask-image: radial-gradient(circle at top calc(100% - var(--badge-mask-offset)) right calc(100% - var(--badge-mask-offset)), transparent 0, transparent calc(var(--badge-size) / 2 + var(--badge-mask)), black calc(var(--badge-size) / 2 + var(--badge-mask) + 0.5px));
|
|
26
24
|
}
|
|
27
25
|
.tw-badge > .tw-badge__content {
|
|
28
26
|
position: absolute;
|
|
@@ -29,19 +29,26 @@
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
& > &__children {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
[dir="rtl"] & {
|
|
35
|
-
--badge-h-side: right;
|
|
36
|
-
}
|
|
32
|
+
// Not possible to add a logical property (inset-inline-start) to replace left position inside a gradient.
|
|
33
|
+
// RTL direction sorted out with conditional attributes.
|
|
37
34
|
|
|
38
35
|
mask-image: radial-gradient(
|
|
39
|
-
circle at top calc(100% - var(--badge-mask-offset) - var(--badge-content-position))
|
|
40
|
-
|
|
36
|
+
circle at top calc(100% - var(--badge-mask-offset) - var(--badge-content-position)) left
|
|
37
|
+
calc(100% - var(--badge-mask-offset) - var(--badge-content-position)),
|
|
41
38
|
transparent 0,
|
|
42
39
|
transparent calc(var(--badge-size) / 2 + var(--badge-mask)),
|
|
43
40
|
black calc(var(--badge-size) / 2 + var(--badge-mask) + 0.5px)
|
|
44
41
|
);
|
|
42
|
+
|
|
43
|
+
[dir="rtl"] & {
|
|
44
|
+
mask-image: radial-gradient(
|
|
45
|
+
circle at top calc(100% - var(--badge-mask-offset)) right
|
|
46
|
+
calc(100% - var(--badge-mask-offset)),
|
|
47
|
+
transparent 0,
|
|
48
|
+
transparent calc(var(--badge-size) / 2 + var(--badge-mask)),
|
|
49
|
+
black calc(var(--badge-size) / 2 + var(--badge-mask) + 0.5px)
|
|
50
|
+
);
|
|
51
|
+
}
|
|
45
52
|
}
|
|
46
53
|
|
|
47
54
|
& > &__content {
|
|
@@ -36,6 +36,22 @@ export const Sentiments: Story = {
|
|
|
36
36
|
]),
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
+
export const RTL: Story = {
|
|
40
|
+
render: (args) => (
|
|
41
|
+
<>
|
|
42
|
+
<CriticalCommsBanner {...args} sentiment="negative" />
|
|
43
|
+
<CriticalCommsBanner {...args} sentiment="warning" />
|
|
44
|
+
<CriticalCommsBanner {...args} sentiment="neutral" />
|
|
45
|
+
</>
|
|
46
|
+
),
|
|
47
|
+
args: {
|
|
48
|
+
subtitle: 'Add money within the next 30 days',
|
|
49
|
+
action: { label: 'Take action', href: 'https://wise.com' },
|
|
50
|
+
className: 'm-b-1',
|
|
51
|
+
},
|
|
52
|
+
...withVariantConfig(['rtl']),
|
|
53
|
+
};
|
|
54
|
+
|
|
39
55
|
export const Mobile: Story = {
|
|
40
56
|
args: {
|
|
41
57
|
subtitle: 'Add money within the next 30 days',
|
|
@@ -40,18 +40,3 @@ export const RTLDiff: Story = {
|
|
|
40
40
|
),
|
|
41
41
|
...withRTLDiff(),
|
|
42
42
|
};
|
|
43
|
-
|
|
44
|
-
export const RTLDiffMobile: Story = {
|
|
45
|
-
render: () => (
|
|
46
|
-
<OverlayHeader
|
|
47
|
-
logo={<Logo />}
|
|
48
|
-
avatar={
|
|
49
|
-
<AvatarView>
|
|
50
|
-
<Person size="24" />
|
|
51
|
-
</AvatarView>
|
|
52
|
-
}
|
|
53
|
-
onClose={() => {}}
|
|
54
|
-
/>
|
|
55
|
-
),
|
|
56
|
-
...withRTLDiff({ viewport: 'largeMobile' }),
|
|
57
|
-
};
|