@transferwise/components 0.0.0-experimental-46166ff → 0.0.0-experimental-34deb6d
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 +0 -3
- package/build/index.js.map +1 -1
- package/build/index.mjs +0 -1
- package/build/index.mjs.map +1 -1
- package/build/inputs/SelectInput.js +6 -2
- package/build/inputs/SelectInput.js.map +1 -1
- package/build/inputs/SelectInput.mjs +6 -2
- package/build/inputs/SelectInput.mjs.map +1 -1
- package/build/listItem/ListItem.js.map +1 -1
- package/build/listItem/ListItem.mjs.map +1 -1
- package/build/main.css +0 -185
- package/build/styles/main.css +0 -185
- package/build/types/index.d.ts +0 -5
- package/build/types/index.d.ts.map +1 -1
- package/build/types/inputs/SelectInput.d.ts +2 -1
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/listItem/ListItem.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +0 -6
- package/src/inputs/SelectInput.story.tsx +23 -10
- package/src/inputs/SelectInput.tsx +7 -2
- package/src/listItem/ListItem.tsx +2 -1
- package/src/main.css +0 -185
- package/src/main.less +0 -1
- package/src/neptune-css/NeptuneCSS.story.tsx +142 -0
- package/build/flowProgress/FlowProgress.js +0 -54
- package/build/flowProgress/FlowProgress.js.map +0 -1
- package/build/flowProgress/FlowProgress.mjs +0 -50
- package/build/flowProgress/FlowProgress.mjs.map +0 -1
- package/build/styles/flowProgress/FlowProgress.css +0 -185
- package/build/types/flowProgress/FlowProgress.d.ts +0 -15
- package/build/types/flowProgress/FlowProgress.d.ts.map +0 -1
- package/build/types/flowProgress/index.d.ts +0 -3
- package/build/types/flowProgress/index.d.ts.map +0 -1
- package/src/flowProgress/FlowProgress.css +0 -185
- package/src/flowProgress/FlowProgress.less +0 -126
- package/src/flowProgress/FlowProgress.story.tsx +0 -85
- package/src/flowProgress/FlowProgress.tsx +0 -62
- package/src/flowProgress/index.ts +0 -2
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
.wds-flow-progress {
|
|
2
|
-
position: relative;
|
|
3
|
-
height: 8px;
|
|
4
|
-
height: var(--size-8);
|
|
5
|
-
width: 100%;
|
|
6
|
-
border-radius: 4px;
|
|
7
|
-
border-radius: var(--size-4);
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
--start: 0%;
|
|
10
|
-
--end: 0%;
|
|
11
|
-
}
|
|
12
|
-
.wds-flow-progress .track {
|
|
13
|
-
position: absolute;
|
|
14
|
-
left: 0;
|
|
15
|
-
top: 0;
|
|
16
|
-
width: 100%;
|
|
17
|
-
height: 100%;
|
|
18
|
-
border-radius: 4px;
|
|
19
|
-
border-radius: var(--size-4);
|
|
20
|
-
}
|
|
21
|
-
.wds-flow-progress .bar {
|
|
22
|
-
position: absolute;
|
|
23
|
-
left: 0;
|
|
24
|
-
top: 0;
|
|
25
|
-
width: 100%;
|
|
26
|
-
height: 100%;
|
|
27
|
-
overflow: hidden;
|
|
28
|
-
border-radius: 4px;
|
|
29
|
-
border-radius: var(--size-4);
|
|
30
|
-
clip-path: inset(0 calc(100% - var(--end)) 0 var(--start));
|
|
31
|
-
}
|
|
32
|
-
.wds-flow-progress .tapestry {
|
|
33
|
-
border-radius: 4px;
|
|
34
|
-
border-radius: var(--size-4);
|
|
35
|
-
height: 100%;
|
|
36
|
-
background-repeat: no-repeat;
|
|
37
|
-
background-size: 100%;
|
|
38
|
-
}
|
|
39
|
-
.wds-flow-progress.light .track {
|
|
40
|
-
background-color: #E9ECEF;
|
|
41
|
-
}
|
|
42
|
-
.wds-flow-progress.light .tapestry {
|
|
43
|
-
background-image: url(https://wise.com/public-resources/assets/editorial/section-tapestries/tapestry_05.jpg);
|
|
44
|
-
}
|
|
45
|
-
.wds-flow-progress.dark .track {
|
|
46
|
-
background-color: #343A40;
|
|
47
|
-
}
|
|
48
|
-
.wds-flow-progress.dark .tapestry {
|
|
49
|
-
background-image: url(https://wise.com/public-resources/assets/editorial/section-tapestries/tapestry_08.jpg);
|
|
50
|
-
}
|
|
51
|
-
.wds-flow-progress.determinate .bar {
|
|
52
|
-
animation: determinateAnim 700ms cubic-bezier(0.47, 0, 0.67, 1) forwards;
|
|
53
|
-
}
|
|
54
|
-
.wds-flow-progress.indeterminate .bar {
|
|
55
|
-
animation: indeterminateAnim 1000ms linear infinite;
|
|
56
|
-
}
|
|
57
|
-
.wds-flow-progress.indeterminate .tapestry.moving {
|
|
58
|
-
animation: tapestryMove 1500ms linear infinite;
|
|
59
|
-
}
|
|
60
|
-
.wds-flow-progress.scale-in {
|
|
61
|
-
transform: scaleY(0);
|
|
62
|
-
animation: scaleIn 330ms cubic-bezier(0.33, 0, 0.23, 1.53) forwards;
|
|
63
|
-
}
|
|
64
|
-
.wds-flow-progress.exiting {
|
|
65
|
-
animation: exitCollapse 320ms cubic-bezier(0.96, 0, 0.67, 1) forwards;
|
|
66
|
-
}
|
|
67
|
-
@keyframes determinateAnim {
|
|
68
|
-
0% {
|
|
69
|
-
--end: 0%;
|
|
70
|
-
}
|
|
71
|
-
100% {
|
|
72
|
-
--end: 100%;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
@keyframes indeterminateAnim {
|
|
76
|
-
0% {
|
|
77
|
-
--start: 0%;
|
|
78
|
-
--end: 0%;
|
|
79
|
-
}
|
|
80
|
-
5% {
|
|
81
|
-
--start: 0.11%;
|
|
82
|
-
--end: 1.01%;
|
|
83
|
-
}
|
|
84
|
-
10% {
|
|
85
|
-
--start: 0.47%;
|
|
86
|
-
--end: 2.55%;
|
|
87
|
-
}
|
|
88
|
-
15% {
|
|
89
|
-
--start: 1.11%;
|
|
90
|
-
--end: 4.72%;
|
|
91
|
-
}
|
|
92
|
-
20% {
|
|
93
|
-
--start: 2.05%;
|
|
94
|
-
--end: 7.65%;
|
|
95
|
-
}
|
|
96
|
-
25% {
|
|
97
|
-
--start: 3.35%;
|
|
98
|
-
--end: 11.53%;
|
|
99
|
-
}
|
|
100
|
-
30% {
|
|
101
|
-
--start: 5.06%;
|
|
102
|
-
--end: 16.61%;
|
|
103
|
-
}
|
|
104
|
-
35% {
|
|
105
|
-
--start: 7.25%;
|
|
106
|
-
--end: 23.25%;
|
|
107
|
-
}
|
|
108
|
-
40% {
|
|
109
|
-
--start: 10%;
|
|
110
|
-
--end: 31.97%;
|
|
111
|
-
}
|
|
112
|
-
45% {
|
|
113
|
-
--start: 13.44%;
|
|
114
|
-
--end: 43.48%;
|
|
115
|
-
}
|
|
116
|
-
50% {
|
|
117
|
-
--start: 17.72%;
|
|
118
|
-
--end: 58.19%;
|
|
119
|
-
}
|
|
120
|
-
55% {
|
|
121
|
-
--start: 23.08%;
|
|
122
|
-
--end: 74.39%;
|
|
123
|
-
}
|
|
124
|
-
60% {
|
|
125
|
-
--start: 29.82%;
|
|
126
|
-
--end: 87.45%;
|
|
127
|
-
}
|
|
128
|
-
65% {
|
|
129
|
-
--start: 38.39%;
|
|
130
|
-
--end: 95.26%;
|
|
131
|
-
}
|
|
132
|
-
70% {
|
|
133
|
-
--start: 49.38%;
|
|
134
|
-
--end: 98.98%;
|
|
135
|
-
}
|
|
136
|
-
75% {
|
|
137
|
-
--start: 63.03%;
|
|
138
|
-
--end: 100%;
|
|
139
|
-
}
|
|
140
|
-
80% {
|
|
141
|
-
--start: 77.61%;
|
|
142
|
-
--end: 100%;
|
|
143
|
-
}
|
|
144
|
-
85% {
|
|
145
|
-
--start: 89.1%;
|
|
146
|
-
--end: 100%;
|
|
147
|
-
}
|
|
148
|
-
90% {
|
|
149
|
-
--start: 95.9%;
|
|
150
|
-
--end: 100%;
|
|
151
|
-
}
|
|
152
|
-
95% {
|
|
153
|
-
--start: 99.12%;
|
|
154
|
-
--end: 100%;
|
|
155
|
-
}
|
|
156
|
-
100% {
|
|
157
|
-
--start: 100%;
|
|
158
|
-
--end: 100%;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
@keyframes tapestryMove {
|
|
162
|
-
0% {
|
|
163
|
-
transform: translateX(0);
|
|
164
|
-
}
|
|
165
|
-
100% {
|
|
166
|
-
transform: translateX(-50%);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
@keyframes scaleIn {
|
|
170
|
-
0% {
|
|
171
|
-
transform: scaleY(0);
|
|
172
|
-
}
|
|
173
|
-
100% {
|
|
174
|
-
transform: scaleY(1);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
@keyframes exitCollapse {
|
|
178
|
-
0% {
|
|
179
|
-
height: 8px;
|
|
180
|
-
height: var(--size-8);
|
|
181
|
-
}
|
|
182
|
-
100% {
|
|
183
|
-
height: 0;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
.wds-flow-progress {
|
|
2
|
-
position: relative;
|
|
3
|
-
height: var(--size-8);
|
|
4
|
-
width: 100%;
|
|
5
|
-
border-radius: var(--size-4);
|
|
6
|
-
overflow: hidden;
|
|
7
|
-
|
|
8
|
-
.track {
|
|
9
|
-
position: absolute;
|
|
10
|
-
left: 0;
|
|
11
|
-
top: 0;
|
|
12
|
-
width: 100%;
|
|
13
|
-
height: 100%;
|
|
14
|
-
border-radius: var(--size-4);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.bar {
|
|
18
|
-
position: absolute;
|
|
19
|
-
left: 0;
|
|
20
|
-
top: 0;
|
|
21
|
-
width: 100%;
|
|
22
|
-
height: 100%;
|
|
23
|
-
overflow: hidden;
|
|
24
|
-
border-radius: var(--size-4);
|
|
25
|
-
clip-path: inset(0 calc(100% - var(--end)) 0 var(--start));
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.tapestry {
|
|
29
|
-
border-radius: var(--size-4);
|
|
30
|
-
height: 100%;
|
|
31
|
-
background-repeat: no-repeat;
|
|
32
|
-
background-size: 100%;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
&.light {
|
|
36
|
-
.track {
|
|
37
|
-
background-color: #E9ECEF;
|
|
38
|
-
}
|
|
39
|
-
.tapestry {
|
|
40
|
-
// TODO: source image from web-art
|
|
41
|
-
background-image: url(https://wise.com/public-resources/assets/editorial/section-tapestries/tapestry_05.jpg);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
&.dark {
|
|
46
|
-
.track {
|
|
47
|
-
background-color: #343A40;
|
|
48
|
-
}
|
|
49
|
-
.tapestry {
|
|
50
|
-
// TODO: source image from web-art
|
|
51
|
-
background-image: url(https://wise.com/public-resources/assets/editorial/section-tapestries/tapestry_08.jpg);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
--start: 0%;
|
|
56
|
-
--end: 0%;
|
|
57
|
-
|
|
58
|
-
&.determinate {
|
|
59
|
-
.bar {
|
|
60
|
-
animation: determinateAnim 700ms cubic-bezier(0.47, 0, 0.67, 1) forwards;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
&.indeterminate {
|
|
65
|
-
.bar {
|
|
66
|
-
animation: indeterminateAnim 1000ms linear infinite; // Updated: Combined animation for start/end with pre-eased keyframes
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.tapestry.moving {
|
|
70
|
-
animation: tapestryMove 1500ms linear infinite; // Kept: Moving tapestry underneath
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
&.scale-in {
|
|
75
|
-
transform: scaleY(0);
|
|
76
|
-
animation: scaleIn 330ms cubic-bezier(0.33, 0, 0.23, 1.53) forwards;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
&.exiting {
|
|
80
|
-
animation: exitCollapse 320ms cubic-bezier(0.96, 0, 0.67, 1) forwards;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
@keyframes determinateAnim {
|
|
85
|
-
0% { --end: 0%; }
|
|
86
|
-
100% { --end: 100%; }
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
@keyframes indeterminateAnim {
|
|
90
|
-
0% { --start: 0.00%; --end: 0.00%; }
|
|
91
|
-
5% { --start: 0.11%; --end: 1.01%; }
|
|
92
|
-
10% { --start: 0.47%; --end: 2.55%; }
|
|
93
|
-
15% { --start: 1.11%; --end: 4.72%; }
|
|
94
|
-
20% { --start: 2.05%; --end: 7.65%; }
|
|
95
|
-
25% { --start: 3.35%; --end: 11.53%; }
|
|
96
|
-
30% { --start: 5.06%; --end: 16.61%; }
|
|
97
|
-
35% { --start: 7.25%; --end: 23.25%; }
|
|
98
|
-
40% { --start: 10.00%; --end: 31.97%; }
|
|
99
|
-
45% { --start: 13.44%; --end: 43.48%; }
|
|
100
|
-
50% { --start: 17.72%; --end: 58.19%; }
|
|
101
|
-
55% { --start: 23.08%; --end: 74.39%; }
|
|
102
|
-
60% { --start: 29.82%; --end: 87.45%; }
|
|
103
|
-
65% { --start: 38.39%; --end: 95.26%; }
|
|
104
|
-
70% { --start: 49.38%; --end: 98.98%; }
|
|
105
|
-
75% { --start: 63.03%; --end: 100.00%; }
|
|
106
|
-
80% { --start: 77.61%; --end: 100.00%; }
|
|
107
|
-
85% { --start: 89.10%; --end: 100.00%; }
|
|
108
|
-
90% { --start: 95.90%; --end: 100.00%; }
|
|
109
|
-
95% { --start: 99.12%; --end: 100.00%; }
|
|
110
|
-
100% { --start: 100.00%; --end: 100.00%; }
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
@keyframes tapestryMove {
|
|
114
|
-
0% { transform: translateX(0); }
|
|
115
|
-
100% { transform: translateX(-50%); }
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
@keyframes scaleIn {
|
|
119
|
-
0% { transform: scaleY(0); }
|
|
120
|
-
100% { transform: scaleY(1); }
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
@keyframes exitCollapse {
|
|
124
|
-
0% { height: var(--size-8); }
|
|
125
|
-
100% { height: 0; }
|
|
126
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
3
|
-
import FlowProgress, { FlowProgressProps } from './index';
|
|
4
|
-
import { storyConfig } from '../test-utils';
|
|
5
|
-
import Sticky from '../sticky';
|
|
6
|
-
import Button from '../button';
|
|
7
|
-
import Body from '../body';
|
|
8
|
-
import IconButton from '../iconButton';
|
|
9
|
-
import { Cross } from '@transferwise/icons';
|
|
10
|
-
|
|
11
|
-
const meta: Meta<typeof FlowProgress> = {
|
|
12
|
-
title: 'FlowProgress',
|
|
13
|
-
component: FlowProgress,
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default meta;
|
|
17
|
-
|
|
18
|
-
type Story = StoryObj<typeof FlowProgress>;
|
|
19
|
-
|
|
20
|
-
export const Determinate: Story = storyConfig(
|
|
21
|
-
{
|
|
22
|
-
args: {},
|
|
23
|
-
render: () => {
|
|
24
|
-
const [someStep, setSomeStep] = React.useState(1);
|
|
25
|
-
const nextStep = () => setSomeStep((prev) => prev + 1);
|
|
26
|
-
return (
|
|
27
|
-
<>
|
|
28
|
-
<FlowProgress key={someStep} type="determinate" />
|
|
29
|
-
<Sticky open position="bottom">
|
|
30
|
-
<Body className="p-a-1">
|
|
31
|
-
<Button v2 block onClick={nextStep}>
|
|
32
|
-
Next Step
|
|
33
|
-
</Button>
|
|
34
|
-
</Body>
|
|
35
|
-
</Sticky>
|
|
36
|
-
</>
|
|
37
|
-
);
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
variants: [
|
|
42
|
-
'default',
|
|
43
|
-
// 'dark'
|
|
44
|
-
],
|
|
45
|
-
},
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
export const Indeterminate: Story = storyConfig(
|
|
49
|
-
{
|
|
50
|
-
args: {},
|
|
51
|
-
render: () => <>
|
|
52
|
-
<FlowProgress type="indeterminate" />
|
|
53
|
-
{/* IconButton here just for cute demo */}
|
|
54
|
-
<IconButton priority="tertiary"><Cross /></IconButton>
|
|
55
|
-
</>,
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
variants: [
|
|
59
|
-
'default',
|
|
60
|
-
// 'dark'
|
|
61
|
-
],
|
|
62
|
-
},
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
export const IndeterminateToDeterminate: Story = storyConfig(
|
|
66
|
-
{
|
|
67
|
-
args: {},
|
|
68
|
-
render: () => {
|
|
69
|
-
const [progressType, setProgressType] = React.useState<FlowProgressProps['type']>('indeterminate');
|
|
70
|
-
setTimeout(() => setProgressType('determinate'), 3000);
|
|
71
|
-
return (
|
|
72
|
-
<Body>
|
|
73
|
-
<FlowProgress type={progressType} />
|
|
74
|
-
<IconButton priority="tertiary"><Cross /></IconButton>
|
|
75
|
-
</Body>
|
|
76
|
-
)
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
variants: [
|
|
81
|
-
'default',
|
|
82
|
-
// 'dark'
|
|
83
|
-
],
|
|
84
|
-
},
|
|
85
|
-
);
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { useTheme } from '@wise/components-theming';
|
|
2
|
-
import { clsx } from 'clsx';
|
|
3
|
-
import { useState, useEffect } from 'react';
|
|
4
|
-
|
|
5
|
-
export type Props = {
|
|
6
|
-
/**
|
|
7
|
-
* Type of the progress bar
|
|
8
|
-
*
|
|
9
|
-
* `'indeterminate'` - shows an ongoing activity without a specific completion time.
|
|
10
|
-
*
|
|
11
|
-
* `'determinate'` - ...
|
|
12
|
-
*
|
|
13
|
-
* @default 'indeterminate'
|
|
14
|
-
*/
|
|
15
|
-
type?: 'indeterminate' | 'determinate';
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
function FlowProgress({ type = 'indeterminate' }: Props) {
|
|
19
|
-
const indeterminate = type === 'indeterminate';
|
|
20
|
-
const determinate = !indeterminate;
|
|
21
|
-
const { screenMode } = useTheme();
|
|
22
|
-
const [exiting, setExiting] = useState(false);
|
|
23
|
-
const [visible, setVisible] = useState(true);
|
|
24
|
-
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
if (determinate) {
|
|
27
|
-
const timer = setTimeout(() => setExiting(true), 720);
|
|
28
|
-
return () => clearTimeout(timer);
|
|
29
|
-
}
|
|
30
|
-
}, [determinate]);
|
|
31
|
-
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
if (exiting) {
|
|
34
|
-
const timer = setTimeout(() => setVisible(false), 300);
|
|
35
|
-
return () => clearTimeout(timer);
|
|
36
|
-
}
|
|
37
|
-
}, [exiting]);
|
|
38
|
-
|
|
39
|
-
if (!visible) return null;
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<div
|
|
43
|
-
className={clsx(
|
|
44
|
-
'wds-flow-progress',
|
|
45
|
-
screenMode,
|
|
46
|
-
indeterminate ? 'indeterminate scale-in' : 'determinate',
|
|
47
|
-
{ exiting },
|
|
48
|
-
'm-y-1',
|
|
49
|
-
)}
|
|
50
|
-
>
|
|
51
|
-
<div className="track" />
|
|
52
|
-
<div className={`bar ${indeterminate ? 'indeterminate-bar' : ''}`}>
|
|
53
|
-
<div
|
|
54
|
-
className={`tapestry ${indeterminate ? 'moving' : ''}`}
|
|
55
|
-
style={indeterminate ? { width: '200%' } : { width: '100%' }}
|
|
56
|
-
/>
|
|
57
|
-
</div>
|
|
58
|
-
</div>
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export default FlowProgress;
|