@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
package/src/main.css
CHANGED
|
@@ -2432,191 +2432,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
2432
2432
|
.np-theme-personal--dark .np-flow-navigation .np-flow-header__left path {
|
|
2433
2433
|
fill: var(--color-interactive-primary);
|
|
2434
2434
|
}
|
|
2435
|
-
.wds-flow-progress {
|
|
2436
|
-
position: relative;
|
|
2437
|
-
height: 8px;
|
|
2438
|
-
height: var(--size-8);
|
|
2439
|
-
width: 100%;
|
|
2440
|
-
border-radius: 4px;
|
|
2441
|
-
border-radius: var(--size-4);
|
|
2442
|
-
overflow: hidden;
|
|
2443
|
-
--start: 0%;
|
|
2444
|
-
--end: 0%;
|
|
2445
|
-
}
|
|
2446
|
-
.wds-flow-progress .track {
|
|
2447
|
-
position: absolute;
|
|
2448
|
-
left: 0;
|
|
2449
|
-
top: 0;
|
|
2450
|
-
width: 100%;
|
|
2451
|
-
height: 100%;
|
|
2452
|
-
border-radius: 4px;
|
|
2453
|
-
border-radius: var(--size-4);
|
|
2454
|
-
}
|
|
2455
|
-
.wds-flow-progress .bar {
|
|
2456
|
-
position: absolute;
|
|
2457
|
-
left: 0;
|
|
2458
|
-
top: 0;
|
|
2459
|
-
width: 100%;
|
|
2460
|
-
height: 100%;
|
|
2461
|
-
overflow: hidden;
|
|
2462
|
-
border-radius: 4px;
|
|
2463
|
-
border-radius: var(--size-4);
|
|
2464
|
-
clip-path: inset(0 calc(100% - var(--end)) 0 var(--start));
|
|
2465
|
-
}
|
|
2466
|
-
.wds-flow-progress .tapestry {
|
|
2467
|
-
border-radius: 4px;
|
|
2468
|
-
border-radius: var(--size-4);
|
|
2469
|
-
height: 100%;
|
|
2470
|
-
background-repeat: no-repeat;
|
|
2471
|
-
background-size: 100%;
|
|
2472
|
-
}
|
|
2473
|
-
.wds-flow-progress.light .track {
|
|
2474
|
-
background-color: #E9ECEF;
|
|
2475
|
-
}
|
|
2476
|
-
.wds-flow-progress.light .tapestry {
|
|
2477
|
-
background-image: url(https://wise.com/public-resources/assets/editorial/section-tapestries/tapestry_05.jpg);
|
|
2478
|
-
}
|
|
2479
|
-
.wds-flow-progress.dark .track {
|
|
2480
|
-
background-color: #343A40;
|
|
2481
|
-
}
|
|
2482
|
-
.wds-flow-progress.dark .tapestry {
|
|
2483
|
-
background-image: url(https://wise.com/public-resources/assets/editorial/section-tapestries/tapestry_08.jpg);
|
|
2484
|
-
}
|
|
2485
|
-
.wds-flow-progress.determinate .bar {
|
|
2486
|
-
animation: determinateAnim 700ms cubic-bezier(0.47, 0, 0.67, 1) forwards;
|
|
2487
|
-
}
|
|
2488
|
-
.wds-flow-progress.indeterminate .bar {
|
|
2489
|
-
animation: indeterminateAnim 1000ms linear infinite;
|
|
2490
|
-
}
|
|
2491
|
-
.wds-flow-progress.indeterminate .tapestry.moving {
|
|
2492
|
-
animation: tapestryMove 1500ms linear infinite;
|
|
2493
|
-
}
|
|
2494
|
-
.wds-flow-progress.scale-in {
|
|
2495
|
-
transform: scaleY(0);
|
|
2496
|
-
animation: scaleIn 330ms cubic-bezier(0.33, 0, 0.23, 1.53) forwards;
|
|
2497
|
-
}
|
|
2498
|
-
.wds-flow-progress.exiting {
|
|
2499
|
-
animation: exitCollapse 320ms cubic-bezier(0.96, 0, 0.67, 1) forwards;
|
|
2500
|
-
}
|
|
2501
|
-
@keyframes determinateAnim {
|
|
2502
|
-
0% {
|
|
2503
|
-
--end: 0%;
|
|
2504
|
-
}
|
|
2505
|
-
100% {
|
|
2506
|
-
--end: 100%;
|
|
2507
|
-
}
|
|
2508
|
-
}
|
|
2509
|
-
@keyframes indeterminateAnim {
|
|
2510
|
-
0% {
|
|
2511
|
-
--start: 0%;
|
|
2512
|
-
--end: 0%;
|
|
2513
|
-
}
|
|
2514
|
-
5% {
|
|
2515
|
-
--start: 0.11%;
|
|
2516
|
-
--end: 1.01%;
|
|
2517
|
-
}
|
|
2518
|
-
10% {
|
|
2519
|
-
--start: 0.47%;
|
|
2520
|
-
--end: 2.55%;
|
|
2521
|
-
}
|
|
2522
|
-
15% {
|
|
2523
|
-
--start: 1.11%;
|
|
2524
|
-
--end: 4.72%;
|
|
2525
|
-
}
|
|
2526
|
-
20% {
|
|
2527
|
-
--start: 2.05%;
|
|
2528
|
-
--end: 7.65%;
|
|
2529
|
-
}
|
|
2530
|
-
25% {
|
|
2531
|
-
--start: 3.35%;
|
|
2532
|
-
--end: 11.53%;
|
|
2533
|
-
}
|
|
2534
|
-
30% {
|
|
2535
|
-
--start: 5.06%;
|
|
2536
|
-
--end: 16.61%;
|
|
2537
|
-
}
|
|
2538
|
-
35% {
|
|
2539
|
-
--start: 7.25%;
|
|
2540
|
-
--end: 23.25%;
|
|
2541
|
-
}
|
|
2542
|
-
40% {
|
|
2543
|
-
--start: 10%;
|
|
2544
|
-
--end: 31.97%;
|
|
2545
|
-
}
|
|
2546
|
-
45% {
|
|
2547
|
-
--start: 13.44%;
|
|
2548
|
-
--end: 43.48%;
|
|
2549
|
-
}
|
|
2550
|
-
50% {
|
|
2551
|
-
--start: 17.72%;
|
|
2552
|
-
--end: 58.19%;
|
|
2553
|
-
}
|
|
2554
|
-
55% {
|
|
2555
|
-
--start: 23.08%;
|
|
2556
|
-
--end: 74.39%;
|
|
2557
|
-
}
|
|
2558
|
-
60% {
|
|
2559
|
-
--start: 29.82%;
|
|
2560
|
-
--end: 87.45%;
|
|
2561
|
-
}
|
|
2562
|
-
65% {
|
|
2563
|
-
--start: 38.39%;
|
|
2564
|
-
--end: 95.26%;
|
|
2565
|
-
}
|
|
2566
|
-
70% {
|
|
2567
|
-
--start: 49.38%;
|
|
2568
|
-
--end: 98.98%;
|
|
2569
|
-
}
|
|
2570
|
-
75% {
|
|
2571
|
-
--start: 63.03%;
|
|
2572
|
-
--end: 100%;
|
|
2573
|
-
}
|
|
2574
|
-
80% {
|
|
2575
|
-
--start: 77.61%;
|
|
2576
|
-
--end: 100%;
|
|
2577
|
-
}
|
|
2578
|
-
85% {
|
|
2579
|
-
--start: 89.1%;
|
|
2580
|
-
--end: 100%;
|
|
2581
|
-
}
|
|
2582
|
-
90% {
|
|
2583
|
-
--start: 95.9%;
|
|
2584
|
-
--end: 100%;
|
|
2585
|
-
}
|
|
2586
|
-
95% {
|
|
2587
|
-
--start: 99.12%;
|
|
2588
|
-
--end: 100%;
|
|
2589
|
-
}
|
|
2590
|
-
100% {
|
|
2591
|
-
--start: 100%;
|
|
2592
|
-
--end: 100%;
|
|
2593
|
-
}
|
|
2594
|
-
}
|
|
2595
|
-
@keyframes tapestryMove {
|
|
2596
|
-
0% {
|
|
2597
|
-
transform: translateX(0);
|
|
2598
|
-
}
|
|
2599
|
-
100% {
|
|
2600
|
-
transform: translateX(-50%);
|
|
2601
|
-
}
|
|
2602
|
-
}
|
|
2603
|
-
@keyframes scaleIn {
|
|
2604
|
-
0% {
|
|
2605
|
-
transform: scaleY(0);
|
|
2606
|
-
}
|
|
2607
|
-
100% {
|
|
2608
|
-
transform: scaleY(1);
|
|
2609
|
-
}
|
|
2610
|
-
}
|
|
2611
|
-
@keyframes exitCollapse {
|
|
2612
|
-
0% {
|
|
2613
|
-
height: 8px;
|
|
2614
|
-
height: var(--size-8);
|
|
2615
|
-
}
|
|
2616
|
-
100% {
|
|
2617
|
-
height: 0;
|
|
2618
|
-
}
|
|
2619
|
-
}
|
|
2620
2435
|
.np-header {
|
|
2621
2436
|
display: grid;
|
|
2622
2437
|
grid-template-columns: 1fr auto;
|
package/src/main.less
CHANGED
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
@import "./emphasis/Emphasis.less";
|
|
36
36
|
@import "./flowNavigation/animatedLabel/AnimatedLabel.less";
|
|
37
37
|
@import "./flowNavigation/FlowNavigation.less";
|
|
38
|
-
@import "./flowProgress/FlowProgress.less";
|
|
39
38
|
@import "./header/Header.less";
|
|
40
39
|
@import "./image/Image.less";
|
|
41
40
|
@import "./info/Info.less";
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import AvatarView from '../avatarView';
|
|
5
|
+
import Tooltip from '../tooltip';
|
|
6
|
+
import IconButton from '../iconButton';
|
|
7
|
+
import Body from '../body';
|
|
8
|
+
|
|
9
|
+
const meta: Meta = {
|
|
10
|
+
title: 'NeptuneCSS',
|
|
11
|
+
component: () => <div>NeptuneCSS Example</div>,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
|
|
16
|
+
type Story = StoryObj;
|
|
17
|
+
|
|
18
|
+
export const Colors: Story = {
|
|
19
|
+
render: () => {
|
|
20
|
+
return (
|
|
21
|
+
<Body>
|
|
22
|
+
{colorTokens.map((token) => (
|
|
23
|
+
<ColorToken key={token} token={token} className="m-b-2" />
|
|
24
|
+
))}
|
|
25
|
+
</Body>
|
|
26
|
+
);
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const colorTokens = [
|
|
31
|
+
'--color-content-primary',
|
|
32
|
+
'--color-bright-yellow',
|
|
33
|
+
'--color-bright-orange',
|
|
34
|
+
'--color-dark-purple',
|
|
35
|
+
'--color-dark-gold',
|
|
36
|
+
'--color-bright-blue',
|
|
37
|
+
'--color-dark-charcoal',
|
|
38
|
+
'--color-white',
|
|
39
|
+
'--color-black',
|
|
40
|
+
'--color-bright-green',
|
|
41
|
+
'--color-forest-green',
|
|
42
|
+
'--color-bright-pink',
|
|
43
|
+
'--color-dark-maroon',
|
|
44
|
+
'--color-content-primary',
|
|
45
|
+
'--color-content-secondary',
|
|
46
|
+
'--color-content-tertiary',
|
|
47
|
+
'--color-content-link',
|
|
48
|
+
'--color-content-link-hover',
|
|
49
|
+
'--color-content-link-active',
|
|
50
|
+
'--color-interactive-control',
|
|
51
|
+
'--color-interactive-control-hover',
|
|
52
|
+
'--color-interactive-control-active',
|
|
53
|
+
'--color-interactive-primary',
|
|
54
|
+
'--color-interactive-primary-hover',
|
|
55
|
+
'--color-interactive-primary-active',
|
|
56
|
+
'--color-interactive-secondary',
|
|
57
|
+
'--color-interactive-secondary-hover',
|
|
58
|
+
'--color-interactive-secondary-active',
|
|
59
|
+
'--color-interactive-accent',
|
|
60
|
+
'--color-interactive-accent-hover',
|
|
61
|
+
'--color-interactive-accent-active',
|
|
62
|
+
'--color-interactive-contrast',
|
|
63
|
+
'--color-interactive-contrast-hover',
|
|
64
|
+
'--color-interactive-contrast-active',
|
|
65
|
+
'--color-interactive-neutral',
|
|
66
|
+
'--color-interactive-neutral-hover',
|
|
67
|
+
'--color-interactive-neutral-active',
|
|
68
|
+
'--color-border-neutral',
|
|
69
|
+
'--color-border-overlay',
|
|
70
|
+
'--color-background-screen',
|
|
71
|
+
'--color-background-screen-hover',
|
|
72
|
+
'--color-background-screen-active',
|
|
73
|
+
'--color-background-elevated',
|
|
74
|
+
'--color-background-neutral',
|
|
75
|
+
'--color-background-neutral-hover',
|
|
76
|
+
'--color-background-neutral-active',
|
|
77
|
+
'--color-background-overlay',
|
|
78
|
+
'--color-background-surface',
|
|
79
|
+
'--color-sentiment-negative',
|
|
80
|
+
'--color-sentiment-negative-hover',
|
|
81
|
+
'--color-sentiment-negative-active',
|
|
82
|
+
'--color-sentiment-negative-primary',
|
|
83
|
+
'--color-sentiment-negative-primary-hover',
|
|
84
|
+
'--color-sentiment-negative-primary-active',
|
|
85
|
+
'--color-sentiment-negative-secondary',
|
|
86
|
+
'--color-sentiment-negative-secondary-hover',
|
|
87
|
+
'--color-sentiment-negative-secondary-active',
|
|
88
|
+
'--color-sentiment-positive',
|
|
89
|
+
'--color-sentiment-positive-hover',
|
|
90
|
+
'--color-sentiment-positive-active',
|
|
91
|
+
'--color-sentiment-positive-primary',
|
|
92
|
+
'--color-sentiment-positive-primary-hover',
|
|
93
|
+
'--color-sentiment-positive-primary-active',
|
|
94
|
+
'--color-sentiment-positive-secondary',
|
|
95
|
+
'--color-sentiment-positive-secondary-hover',
|
|
96
|
+
'--color-sentiment-positive-secondary-active',
|
|
97
|
+
'--color-sentiment-warning',
|
|
98
|
+
'--color-sentiment-warning-hover',
|
|
99
|
+
'--color-sentiment-warning-active',
|
|
100
|
+
'--color-sentiment-warning-primary',
|
|
101
|
+
'--color-sentiment-warning-primary-hover',
|
|
102
|
+
'--color-sentiment-warning-primary-active',
|
|
103
|
+
'--color-sentiment-warning-secondary',
|
|
104
|
+
'--color-sentiment-warning-secondary-hover',
|
|
105
|
+
'--color-sentiment-warning-secondary-active',
|
|
106
|
+
'--color-sentiment-warning-content',
|
|
107
|
+
'--color-sentiment-warning-content-hover',
|
|
108
|
+
'--color-sentiment-warning-content-active',
|
|
109
|
+
'--color-contrast',
|
|
110
|
+
'--color-light',
|
|
111
|
+
'--color-dark',
|
|
112
|
+
'--color-contrast-overlay',
|
|
113
|
+
'--color-contrast-theme',
|
|
114
|
+
];
|
|
115
|
+
|
|
116
|
+
function ColorToken(props: { token: string; className?: string }) {
|
|
117
|
+
const color = `var(${props.token})`;
|
|
118
|
+
const [tooltipLabel, setTooltipLabel] = React.useState<ReactNode>('Copy Token Name');
|
|
119
|
+
return (
|
|
120
|
+
<div className={clsx('d-flex', 'align-items-center', props.className)}>
|
|
121
|
+
<IconButton
|
|
122
|
+
aria-label="Copy color"
|
|
123
|
+
size={72}
|
|
124
|
+
className="m-r-2"
|
|
125
|
+
onClick={async () => {
|
|
126
|
+
await navigator.clipboard.writeText(color);
|
|
127
|
+
setTooltipLabel('Copied!');
|
|
128
|
+
}}
|
|
129
|
+
>
|
|
130
|
+
<Tooltip label={<Body type="body-large-bold">{tooltipLabel}</Body>} position="top">
|
|
131
|
+
<AvatarView
|
|
132
|
+
size={72}
|
|
133
|
+
style={{ backgroundColor: color, border: 'solid 1px var(--color-border-neutral)' }}
|
|
134
|
+
>
|
|
135
|
+
{null}
|
|
136
|
+
</AvatarView>
|
|
137
|
+
</Tooltip>
|
|
138
|
+
</IconButton>
|
|
139
|
+
<code className="m-l-2">{props.token}</code>
|
|
140
|
+
</div>
|
|
141
|
+
);
|
|
142
|
+
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var componentsTheming = require('@wise/components-theming');
|
|
6
|
-
var clsx = require('clsx');
|
|
7
|
-
var React = require('react');
|
|
8
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
-
|
|
10
|
-
function FlowProgress({
|
|
11
|
-
type = 'indeterminate'
|
|
12
|
-
}) {
|
|
13
|
-
const indeterminate = type === 'indeterminate';
|
|
14
|
-
const determinate = !indeterminate;
|
|
15
|
-
const {
|
|
16
|
-
screenMode
|
|
17
|
-
} = componentsTheming.useTheme();
|
|
18
|
-
const [exiting, setExiting] = React.useState(false);
|
|
19
|
-
const [visible, setVisible] = React.useState(true);
|
|
20
|
-
React.useEffect(() => {
|
|
21
|
-
if (determinate) {
|
|
22
|
-
const timer = setTimeout(() => setExiting(true), 720);
|
|
23
|
-
return () => clearTimeout(timer);
|
|
24
|
-
}
|
|
25
|
-
}, [determinate]);
|
|
26
|
-
React.useEffect(() => {
|
|
27
|
-
if (exiting) {
|
|
28
|
-
const timer = setTimeout(() => setVisible(false), 300);
|
|
29
|
-
return () => clearTimeout(timer);
|
|
30
|
-
}
|
|
31
|
-
}, [exiting]);
|
|
32
|
-
if (!visible) return null;
|
|
33
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
34
|
-
className: clsx.clsx('wds-flow-progress', screenMode, indeterminate ? 'indeterminate scale-in' : 'determinate', {
|
|
35
|
-
exiting
|
|
36
|
-
}, 'm-y-1'),
|
|
37
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38
|
-
className: "track"
|
|
39
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
40
|
-
className: `bar ${indeterminate ? 'indeterminate-bar' : ''}`,
|
|
41
|
-
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
42
|
-
className: `tapestry ${indeterminate ? 'moving' : ''}`,
|
|
43
|
-
style: indeterminate ? {
|
|
44
|
-
width: '200%'
|
|
45
|
-
} : {
|
|
46
|
-
width: '100%'
|
|
47
|
-
}
|
|
48
|
-
})
|
|
49
|
-
})]
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
exports.default = FlowProgress;
|
|
54
|
-
//# sourceMappingURL=FlowProgress.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FlowProgress.js","sources":["../../src/flowProgress/FlowProgress.tsx"],"sourcesContent":["import { useTheme } from '@wise/components-theming';\nimport { clsx } from 'clsx';\nimport { useState, useEffect } from 'react';\n\nexport type Props = {\n /**\n * Type of the progress bar\n * \n * `'indeterminate'` - shows an ongoing activity without a specific completion time.\n * \n * `'determinate'` - ...\n * \n * @default 'indeterminate'\n */\n type?: 'indeterminate' | 'determinate';\n};\n\nfunction FlowProgress({ type = 'indeterminate' }: Props) {\n const indeterminate = type === 'indeterminate';\n const determinate = !indeterminate;\n const { screenMode } = useTheme();\n const [exiting, setExiting] = useState(false);\n const [visible, setVisible] = useState(true);\n\n useEffect(() => {\n if (determinate) {\n const timer = setTimeout(() => setExiting(true), 720);\n return () => clearTimeout(timer);\n }\n }, [determinate]);\n\n useEffect(() => {\n if (exiting) {\n const timer = setTimeout(() => setVisible(false), 300);\n return () => clearTimeout(timer);\n }\n }, [exiting]);\n\n if (!visible) return null;\n\n return (\n <div\n className={clsx(\n 'wds-flow-progress',\n screenMode,\n indeterminate ? 'indeterminate scale-in' : 'determinate',\n { exiting },\n 'm-y-1',\n )}\n >\n <div className=\"track\" />\n <div className={`bar ${indeterminate ? 'indeterminate-bar' : ''}`}>\n <div\n className={`tapestry ${indeterminate ? 'moving' : ''}`}\n style={indeterminate ? { width: '200%' } : { width: '100%' }}\n />\n </div>\n </div>\n );\n}\n\nexport default FlowProgress;\n"],"names":["FlowProgress","type","indeterminate","determinate","screenMode","useTheme","exiting","setExiting","useState","visible","setVisible","useEffect","timer","setTimeout","clearTimeout","_jsxs","className","clsx","children","_jsx","style","width"],"mappings":";;;;;;;;;AAiBA,SAASA,YAAYA,CAAC;AAAEC,EAAAA,IAAI,GAAG;AAAe,CAAS,EAAA;AACrD,EAAA,MAAMC,aAAa,GAAGD,IAAI,KAAK,eAAe;EAC9C,MAAME,WAAW,GAAG,CAACD,aAAa;EAClC,MAAM;AAAEE,IAAAA;GAAY,GAAGC,0BAAQ,EAAE;EACjC,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGC,cAAQ,CAAC,KAAK,CAAC;EAC7C,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGF,cAAQ,CAAC,IAAI,CAAC;AAE5CG,EAAAA,eAAS,CAAC,MAAK;AACb,IAAA,IAAIR,WAAW,EAAE;MACf,MAAMS,KAAK,GAAGC,UAAU,CAAC,MAAMN,UAAU,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC;AACrD,MAAA,OAAO,MAAMO,YAAY,CAACF,KAAK,CAAC;AAClC,IAAA;AACF,EAAA,CAAC,EAAE,CAACT,WAAW,CAAC,CAAC;AAEjBQ,EAAAA,eAAS,CAAC,MAAK;AACb,IAAA,IAAIL,OAAO,EAAE;MACX,MAAMM,KAAK,GAAGC,UAAU,CAAC,MAAMH,UAAU,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC;AACtD,MAAA,OAAO,MAAMI,YAAY,CAACF,KAAK,CAAC;AAClC,IAAA;AACF,EAAA,CAAC,EAAE,CAACN,OAAO,CAAC,CAAC;AAEb,EAAA,IAAI,CAACG,OAAO,EAAE,OAAO,IAAI;AAEzB,EAAA,oBACEM,eAAA,CAAA,KAAA,EAAA;AACEC,IAAAA,SAAS,EAAEC,SAAI,CACb,mBAAmB,EACnBb,UAAU,EACVF,aAAa,GAAG,wBAAwB,GAAG,aAAa,EACxD;AAAEI,MAAAA;KAAS,EACX,OAAO,CACP;AAAAY,IAAAA,QAAA,gBAEFC,cAAA,CAAA,KAAA,EAAA;AAAKH,MAAAA,SAAS,EAAC;KAAO,CACtB,eAAAG,cAAA,CAAA,KAAA,EAAA;AAAKH,MAAAA,SAAS,EAAE,CAAA,IAAA,EAAOd,aAAa,GAAG,mBAAmB,GAAG,EAAE,CAAA,CAAG;AAAAgB,MAAAA,QAAA,eAChEC,cAAA,CAAA,KAAA,EAAA;AACEH,QAAAA,SAAS,EAAE,CAAA,SAAA,EAAYd,aAAa,GAAG,QAAQ,GAAG,EAAE,CAAA,CAAG;QACvDkB,KAAK,EAAElB,aAAa,GAAG;AAAEmB,UAAAA,KAAK,EAAE;AAAM,SAAE,GAAG;AAAEA,UAAAA,KAAK,EAAE;AAAM;OAAG;AAEjE,KAAK,CACP;AAAA,GAAK,CAAC;AAEV;;;;"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { useTheme } from '@wise/components-theming';
|
|
2
|
-
import { clsx } from 'clsx';
|
|
3
|
-
import { useState, useEffect } from 'react';
|
|
4
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
-
|
|
6
|
-
function FlowProgress({
|
|
7
|
-
type = 'indeterminate'
|
|
8
|
-
}) {
|
|
9
|
-
const indeterminate = type === 'indeterminate';
|
|
10
|
-
const determinate = !indeterminate;
|
|
11
|
-
const {
|
|
12
|
-
screenMode
|
|
13
|
-
} = useTheme();
|
|
14
|
-
const [exiting, setExiting] = useState(false);
|
|
15
|
-
const [visible, setVisible] = useState(true);
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
if (determinate) {
|
|
18
|
-
const timer = setTimeout(() => setExiting(true), 720);
|
|
19
|
-
return () => clearTimeout(timer);
|
|
20
|
-
}
|
|
21
|
-
}, [determinate]);
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
if (exiting) {
|
|
24
|
-
const timer = setTimeout(() => setVisible(false), 300);
|
|
25
|
-
return () => clearTimeout(timer);
|
|
26
|
-
}
|
|
27
|
-
}, [exiting]);
|
|
28
|
-
if (!visible) return null;
|
|
29
|
-
return /*#__PURE__*/jsxs("div", {
|
|
30
|
-
className: clsx('wds-flow-progress', screenMode, indeterminate ? 'indeterminate scale-in' : 'determinate', {
|
|
31
|
-
exiting
|
|
32
|
-
}, 'm-y-1'),
|
|
33
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
34
|
-
className: "track"
|
|
35
|
-
}), /*#__PURE__*/jsx("div", {
|
|
36
|
-
className: `bar ${indeterminate ? 'indeterminate-bar' : ''}`,
|
|
37
|
-
children: /*#__PURE__*/jsx("div", {
|
|
38
|
-
className: `tapestry ${indeterminate ? 'moving' : ''}`,
|
|
39
|
-
style: indeterminate ? {
|
|
40
|
-
width: '200%'
|
|
41
|
-
} : {
|
|
42
|
-
width: '100%'
|
|
43
|
-
}
|
|
44
|
-
})
|
|
45
|
-
})]
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export { FlowProgress as default };
|
|
50
|
-
//# sourceMappingURL=FlowProgress.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FlowProgress.mjs","sources":["../../src/flowProgress/FlowProgress.tsx"],"sourcesContent":["import { useTheme } from '@wise/components-theming';\nimport { clsx } from 'clsx';\nimport { useState, useEffect } from 'react';\n\nexport type Props = {\n /**\n * Type of the progress bar\n * \n * `'indeterminate'` - shows an ongoing activity without a specific completion time.\n * \n * `'determinate'` - ...\n * \n * @default 'indeterminate'\n */\n type?: 'indeterminate' | 'determinate';\n};\n\nfunction FlowProgress({ type = 'indeterminate' }: Props) {\n const indeterminate = type === 'indeterminate';\n const determinate = !indeterminate;\n const { screenMode } = useTheme();\n const [exiting, setExiting] = useState(false);\n const [visible, setVisible] = useState(true);\n\n useEffect(() => {\n if (determinate) {\n const timer = setTimeout(() => setExiting(true), 720);\n return () => clearTimeout(timer);\n }\n }, [determinate]);\n\n useEffect(() => {\n if (exiting) {\n const timer = setTimeout(() => setVisible(false), 300);\n return () => clearTimeout(timer);\n }\n }, [exiting]);\n\n if (!visible) return null;\n\n return (\n <div\n className={clsx(\n 'wds-flow-progress',\n screenMode,\n indeterminate ? 'indeterminate scale-in' : 'determinate',\n { exiting },\n 'm-y-1',\n )}\n >\n <div className=\"track\" />\n <div className={`bar ${indeterminate ? 'indeterminate-bar' : ''}`}>\n <div\n className={`tapestry ${indeterminate ? 'moving' : ''}`}\n style={indeterminate ? { width: '200%' } : { width: '100%' }}\n />\n </div>\n </div>\n );\n}\n\nexport default FlowProgress;\n"],"names":["FlowProgress","type","indeterminate","determinate","screenMode","useTheme","exiting","setExiting","useState","visible","setVisible","useEffect","timer","setTimeout","clearTimeout","_jsxs","className","clsx","children","_jsx","style","width"],"mappings":";;;;;AAiBA,SAASA,YAAYA,CAAC;AAAEC,EAAAA,IAAI,GAAG;AAAe,CAAS,EAAA;AACrD,EAAA,MAAMC,aAAa,GAAGD,IAAI,KAAK,eAAe;EAC9C,MAAME,WAAW,GAAG,CAACD,aAAa;EAClC,MAAM;AAAEE,IAAAA;GAAY,GAAGC,QAAQ,EAAE;EACjC,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGC,QAAQ,CAAC,KAAK,CAAC;EAC7C,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGF,QAAQ,CAAC,IAAI,CAAC;AAE5CG,EAAAA,SAAS,CAAC,MAAK;AACb,IAAA,IAAIR,WAAW,EAAE;MACf,MAAMS,KAAK,GAAGC,UAAU,CAAC,MAAMN,UAAU,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC;AACrD,MAAA,OAAO,MAAMO,YAAY,CAACF,KAAK,CAAC;AAClC,IAAA;AACF,EAAA,CAAC,EAAE,CAACT,WAAW,CAAC,CAAC;AAEjBQ,EAAAA,SAAS,CAAC,MAAK;AACb,IAAA,IAAIL,OAAO,EAAE;MACX,MAAMM,KAAK,GAAGC,UAAU,CAAC,MAAMH,UAAU,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC;AACtD,MAAA,OAAO,MAAMI,YAAY,CAACF,KAAK,CAAC;AAClC,IAAA;AACF,EAAA,CAAC,EAAE,CAACN,OAAO,CAAC,CAAC;AAEb,EAAA,IAAI,CAACG,OAAO,EAAE,OAAO,IAAI;AAEzB,EAAA,oBACEM,IAAA,CAAA,KAAA,EAAA;AACEC,IAAAA,SAAS,EAAEC,IAAI,CACb,mBAAmB,EACnBb,UAAU,EACVF,aAAa,GAAG,wBAAwB,GAAG,aAAa,EACxD;AAAEI,MAAAA;KAAS,EACX,OAAO,CACP;AAAAY,IAAAA,QAAA,gBAEFC,GAAA,CAAA,KAAA,EAAA;AAAKH,MAAAA,SAAS,EAAC;KAAO,CACtB,eAAAG,GAAA,CAAA,KAAA,EAAA;AAAKH,MAAAA,SAAS,EAAE,CAAA,IAAA,EAAOd,aAAa,GAAG,mBAAmB,GAAG,EAAE,CAAA,CAAG;AAAAgB,MAAAA,QAAA,eAChEC,GAAA,CAAA,KAAA,EAAA;AACEH,QAAAA,SAAS,EAAE,CAAA,SAAA,EAAYd,aAAa,GAAG,QAAQ,GAAG,EAAE,CAAA,CAAG;QACvDkB,KAAK,EAAElB,aAAa,GAAG;AAAEmB,UAAAA,KAAK,EAAE;AAAM,SAAE,GAAG;AAAEA,UAAAA,KAAK,EAAE;AAAM;OAAG;AAEjE,KAAK,CACP;AAAA,GAAK,CAAC;AAEV;;;;"}
|
|
@@ -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,15 +0,0 @@
|
|
|
1
|
-
export type Props = {
|
|
2
|
-
/**
|
|
3
|
-
* Type of the progress bar
|
|
4
|
-
*
|
|
5
|
-
* `'indeterminate'` - shows an ongoing activity without a specific completion time.
|
|
6
|
-
*
|
|
7
|
-
* `'determinate'` - ...
|
|
8
|
-
*
|
|
9
|
-
* @default 'indeterminate'
|
|
10
|
-
*/
|
|
11
|
-
type?: 'indeterminate' | 'determinate';
|
|
12
|
-
};
|
|
13
|
-
declare function FlowProgress({ type }: Props): import("react").JSX.Element | null;
|
|
14
|
-
export default FlowProgress;
|
|
15
|
-
//# sourceMappingURL=FlowProgress.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FlowProgress.d.ts","sourceRoot":"","sources":["../../../src/flowProgress/FlowProgress.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,KAAK,GAAG;IAClB;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,eAAe,GAAG,aAAa,CAAC;CACxC,CAAC;AAEF,iBAAS,YAAY,CAAC,EAAE,IAAsB,EAAE,EAAE,KAAK,sCA0CtD;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/flowProgress/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,YAAY,EAAE,KAAK,IAAI,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
|