@transferwise/components 0.0.0-experimental-102c421 → 0.0.0-experimental-151e673
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/SegmentedControl/SegmentedControl.js +9 -2
- package/build/SegmentedControl/SegmentedControl.js.map +1 -1
- package/build/SegmentedControl/SegmentedControl.mjs +9 -2
- package/build/SegmentedControl/SegmentedControl.mjs.map +1 -1
- package/build/main.css +54 -62
- package/build/styles/AvatarLayout/AvatarLayout.css +26 -9
- 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/SegmentedControl/SegmentedControl.css +2 -1
- 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 +54 -62
- 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/build/types/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/AvatarLayout/AvatarLayout.css +26 -9
- package/src/AvatarLayout/AvatarLayout.less +46 -22
- package/src/AvatarLayout/_stories/AvatarLayout.test.story.tsx +17 -42
- 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/Field/_stories/Field.test.story.tsx +48 -37
- package/src/FlowNavigation/_stories/FlowNavigation.rtl.test.story.tsx +78 -0
- package/src/FlowNavigation/_stories/FlowNavigation.test.story.tsx +0 -44
- 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/Label/_stories/Label.test.story.tsx +35 -22
- package/src/ListItem/_stories/subcomponents.tsx +1 -1
- package/src/MoneyInput/_stories/MoneyInput.rtl.test.story.tsx +1 -1
- 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/Popover/_stories/Popover.rtl.test.story.tsx +40 -50
- package/src/ProcessIndicator/ProcessIndicator.tsx +1 -1
- package/src/ProgressBar/_stories/ProgressBar.test.story.tsx +19 -33
- package/src/SegmentedControl/SegmentedControl.css +2 -1
- package/src/SegmentedControl/SegmentedControl.less +4 -2
- package/src/SegmentedControl/SegmentedControl.tsx +8 -2
- package/src/SegmentedControl/_stories/SegmentedControl.test.story.tsx +16 -8
- package/src/SlidingPanel/SlidingPanel.css +0 -8
- package/src/SlidingPanel/SlidingPanel.less +0 -6
- 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 +54 -62
- 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
|
@@ -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
|
};
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
background: var(--color-background-screen);
|
|
36
36
|
border-radius: 24px;
|
|
37
37
|
border-radius: var(--size-24);
|
|
38
|
-
transition: left 300ms
|
|
38
|
+
transition: left 300ms,
|
|
39
|
+
right 300ms;
|
|
39
40
|
}
|
|
40
41
|
.segmented-control__segments--no-animate::after {
|
|
41
42
|
transition: none !important;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
justify-content: center;
|
|
13
13
|
align-items: center;
|
|
14
14
|
background: var(--color-background-neutral);
|
|
15
|
-
border-radius: var(--size-24);
|
|
15
|
+
border-radius: var(--size-24);
|
|
16
16
|
transition: outline 300ms;
|
|
17
17
|
outline: 2px solid transparent;
|
|
18
18
|
}
|
|
@@ -31,7 +31,9 @@
|
|
|
31
31
|
z-index: 0;
|
|
32
32
|
background: var(--color-background-screen);
|
|
33
33
|
border-radius: var(--size-24);
|
|
34
|
-
transition:
|
|
34
|
+
transition:
|
|
35
|
+
left 300ms,
|
|
36
|
+
right 300ms;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
.segmented-control__segments--no-animate::after {
|
|
@@ -3,6 +3,7 @@ import { createRef, useEffect, useRef, useState } from 'react';
|
|
|
3
3
|
|
|
4
4
|
import Body from '../Body';
|
|
5
5
|
import { Typography } from '../common';
|
|
6
|
+
import { useDirection } from '../common/hooks';
|
|
6
7
|
|
|
7
8
|
type SegmentBase = { id: string; label: string; value: string };
|
|
8
9
|
|
|
@@ -40,6 +41,7 @@ const SegmentedControl = ({
|
|
|
40
41
|
}: SegmentedControlProps) => {
|
|
41
42
|
const isMountedRef = useRef(false);
|
|
42
43
|
const [animate, setAnimate] = useState(false);
|
|
44
|
+
const { isRTL } = useDirection();
|
|
43
45
|
|
|
44
46
|
const segmentsRef = useRef<HTMLDivElement>(null);
|
|
45
47
|
|
|
@@ -62,8 +64,12 @@ const SegmentedControl = ({
|
|
|
62
64
|
// This is so we can animate the highlight to the selected segment
|
|
63
65
|
if (selectedSegmentRef?.current && segmentsRef.current) {
|
|
64
66
|
const { style } = segmentsRef.current;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
const segment = selectedSegmentRef.current;
|
|
68
|
+
const inlineOffset = isRTL
|
|
69
|
+
? segmentsRef.current.offsetWidth - segment.offsetLeft - segment.offsetWidth
|
|
70
|
+
: segment.offsetLeft;
|
|
71
|
+
style.setProperty('--segment-highlight-width', `${segment.offsetWidth}px`);
|
|
72
|
+
style.setProperty('--segment-highlight-x', `${inlineOffset}px`);
|
|
67
73
|
}
|
|
68
74
|
};
|
|
69
75
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
1
2
|
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
3
|
import { withRTLDiff } from '../../../.storybook/decorators/RtlDiffDecorator';
|
|
3
4
|
import SegmentedControl from '../SegmentedControl';
|
|
@@ -22,24 +23,31 @@ const viewSegments = [
|
|
|
22
23
|
{ id: 'seg-gamma', label: 'Gamma', value: 'gamma', controls: 'panel-gamma' },
|
|
23
24
|
] as const;
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
function InteractiveSegmentedControl() {
|
|
27
|
+
const [inputValue, setInputValue] = useState('one');
|
|
28
|
+
const [viewValue, setViewValue] = useState('beta');
|
|
29
|
+
|
|
30
|
+
return (
|
|
27
31
|
<>
|
|
28
32
|
<SegmentedControl
|
|
29
33
|
name="rtl-input"
|
|
30
34
|
mode="input"
|
|
31
35
|
segments={inputSegments}
|
|
32
|
-
value=
|
|
33
|
-
onChange={
|
|
36
|
+
value={inputValue}
|
|
37
|
+
onChange={setInputValue}
|
|
34
38
|
/>
|
|
35
39
|
<SegmentedControl
|
|
36
40
|
name="rtl-view"
|
|
37
41
|
mode="view"
|
|
38
42
|
segments={viewSegments}
|
|
39
|
-
value=
|
|
40
|
-
onChange={
|
|
43
|
+
value={viewValue}
|
|
44
|
+
onChange={setViewValue}
|
|
41
45
|
/>
|
|
42
46
|
</>
|
|
43
|
-
)
|
|
44
|
-
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const RTLDiff: Story = {
|
|
51
|
+
render: () => <InteractiveSegmentedControl />,
|
|
52
|
+
...withRTLDiff({ width: 'stretch', renderAs: 'iframe' }),
|
|
45
53
|
};
|
|
@@ -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,9 +85,6 @@
|
|
|
85
85
|
|
|
86
86
|
&.sliding-panel--border-right {
|
|
87
87
|
box-shadow: inset 1px 0 0 0 var(--color-border-neutral);
|
|
88
|
-
[dir="rtl"] & {
|
|
89
|
-
box-shadow: inset -1px 0 0 0 var(--color-border-neutral);
|
|
90
|
-
}
|
|
91
88
|
}
|
|
92
89
|
|
|
93
90
|
&.sliding-panel--border-bottom {
|
|
@@ -96,9 +93,6 @@
|
|
|
96
93
|
|
|
97
94
|
&.sliding-panel--border-left {
|
|
98
95
|
box-shadow: inset -1px 0 0 0 var(--color-border-neutral);
|
|
99
|
-
[dir="rtl"] & {
|
|
100
|
-
box-shadow: inset 1px 0 0 0 var(--color-border-neutral);
|
|
101
|
-
}
|
|
102
96
|
}
|
|
103
97
|
}
|
|
104
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
|
-
};
|