@transferwise/components 0.0.0-experimental-e76a002 → 0.0.0-experimental-a39eaa6
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/Container/Container.js +1 -2
- package/build/Container/Container.js.map +1 -1
- package/build/Container/Container.mjs +1 -2
- package/build/Container/Container.mjs.map +1 -1
- package/build/FlowNavigation/FlowNavigation.js +5 -14
- package/build/FlowNavigation/FlowNavigation.js.map +1 -1
- package/build/FlowNavigation/FlowNavigation.mjs +5 -14
- package/build/FlowNavigation/FlowNavigation.mjs.map +1 -1
- package/build/_deprecated/OverlayHeader/OverlayHeader.js +6 -41
- package/build/_deprecated/OverlayHeader/OverlayHeader.js.map +1 -1
- package/build/_deprecated/OverlayHeader/OverlayHeader.mjs +6 -41
- package/build/_deprecated/OverlayHeader/OverlayHeader.mjs.map +1 -1
- package/build/main.css +8 -40
- package/build/styles/Container/Container.css +0 -5
- package/build/styles/FlowNavigation/FlowNavigation.css +7 -13
- package/build/styles/main.css +8 -40
- package/build/types/Container/Container.d.ts +1 -5
- package/build/types/Container/Container.d.ts.map +1 -1
- package/build/types/FlowNavigation/FlowNavigation.d.ts +2 -9
- package/build/types/FlowNavigation/FlowNavigation.d.ts.map +1 -1
- package/build/types/_deprecated/OverlayHeader/OverlayHeader.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Container/Container.css +0 -5
- package/src/Container/Container.less +0 -6
- package/src/Container/Container.test.tsx +0 -17
- package/src/Container/Container.tsx +1 -14
- package/src/Container/_stories/Container.story.tsx +0 -44
- package/src/FlowNavigation/FlowNavigation.css +7 -13
- package/src/FlowNavigation/FlowNavigation.less +6 -15
- package/src/FlowNavigation/FlowNavigation.tsx +6 -27
- package/src/FlowNavigation/_stories/FlowNavigation.story.tsx +4 -87
- package/src/Loader/_stories/Loader.story.tsx +0 -48
- package/src/_deprecated/OverlayHeader/OverlayHeader.tsx +2 -21
- package/src/main.css +8 -40
- package/src/main.less +0 -1
- package/build/styles/_deprecated/OverlayHeader/OverlayHeader.css +0 -15
- package/src/_deprecated/OverlayHeader/OverlayHeader.css +0 -15
- package/src/_deprecated/OverlayHeader/OverlayHeader.less +0 -24
|
@@ -8,24 +8,17 @@ export interface FlowNavigationProps {
|
|
|
8
8
|
/** @default false */
|
|
9
9
|
done?: boolean;
|
|
10
10
|
/** Called when the close button is clicked. If not provided the close button won't show */
|
|
11
|
-
onClose?: () => void
|
|
11
|
+
onClose?: (() => void) | React.MouseEventHandler<HTMLButtonElement>;
|
|
12
12
|
/** Called when the back button is clicked. If not provided the back button won't show. The back button only shows on small screens */
|
|
13
13
|
onGoBack?: () => void;
|
|
14
14
|
/** Steps to be displayed in stepper. If not provided, the stepper won't show. */
|
|
15
15
|
steps?: readonly Step[];
|
|
16
|
-
/**
|
|
17
|
-
* When true, renders in composable mode using a fluid Container.
|
|
18
|
-
* This allows the FlowNavigation to be used within custom layout containers.
|
|
19
|
-
* @default false
|
|
20
|
-
*/
|
|
21
|
-
composable?: boolean;
|
|
22
16
|
/**
|
|
23
17
|
* Controls whether the bottom border is displayed.
|
|
24
|
-
* Only applies to the composable variant. Non-composable variant always uses the done state.
|
|
25
18
|
* @default true
|
|
26
19
|
*/
|
|
27
20
|
showBottomBorder?: boolean;
|
|
28
21
|
}
|
|
29
|
-
declare const FlowNavigation: ({ activeStep, avatar, logo, done, onClose, onGoBack, steps,
|
|
22
|
+
declare const FlowNavigation: ({ activeStep, avatar, logo, done, onClose, onGoBack, steps, showBottomBorder, }: FlowNavigationProps) => import("react").JSX.Element;
|
|
30
23
|
export default FlowNavigation;
|
|
31
24
|
//# sourceMappingURL=FlowNavigation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlowNavigation.d.ts","sourceRoot":"","sources":["../../../src/FlowNavigation/FlowNavigation.tsx"],"names":[],"mappings":"AAQA,OAAgB,EAAE,KAAK,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAWxD,MAAM,WAAW,mBAAmB;IAClC,iBAAiB;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,wBAAwB;IACxB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,qBAAqB;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,2FAA2F;IAC3F,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"FlowNavigation.d.ts","sourceRoot":"","sources":["../../../src/FlowNavigation/FlowNavigation.tsx"],"names":[],"mappings":"AAQA,OAAgB,EAAE,KAAK,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAWxD,MAAM,WAAW,mBAAmB;IAClC,iBAAiB;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,wBAAwB;IACxB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,qBAAqB;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,2FAA2F;IAC3F,OAAO,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACpE,sIAAsI;IACtI,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,iFAAiF;IACjF,KAAK,CAAC,EAAE,SAAS,IAAI,EAAE,CAAC;IACxB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,QAAA,MAAM,cAAc,GAAI,iFASrB,mBAAmB,gCAyErB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayHeader.d.ts","sourceRoot":"","sources":["../../../../src/_deprecated/OverlayHeader/OverlayHeader.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OverlayHeader.d.ts","sourceRoot":"","sources":["../../../../src/_deprecated/OverlayHeader/OverlayHeader.tsx"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,gBAAgB;IAChB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,gDAAgD;IAChD,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;CACtD;AAID;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,IAAkB,EAAE,EAAE,kBAAkB,+BAEhG"}
|
package/package.json
CHANGED
|
@@ -34,21 +34,4 @@ describe('Container', () => {
|
|
|
34
34
|
const el = screen.getByTestId('my-container');
|
|
35
35
|
expect(el).toHaveAttribute('id', 'test-id');
|
|
36
36
|
});
|
|
37
|
-
|
|
38
|
-
it('does not apply any alignment class by default (none)', () => {
|
|
39
|
-
renderContainer();
|
|
40
|
-
expect(screen.getByText(childText)).not.toHaveClass('wds-container--align-center');
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it('applies the center alignment class', () => {
|
|
44
|
-
renderContainer({ alignContent: 'center' });
|
|
45
|
-
expect(screen.getByText(childText)).toHaveClass('wds-container--align-center');
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it('does not apply alignment class when alignContent is none', () => {
|
|
49
|
-
renderContainer({ alignContent: 'none' });
|
|
50
|
-
const el = screen.getByText(childText);
|
|
51
|
-
expect(el).not.toHaveClass('wds-container--align-none');
|
|
52
|
-
expect(el).not.toHaveClass('wds-container--align-center');
|
|
53
|
-
});
|
|
54
37
|
});
|
|
@@ -6,10 +6,6 @@ import { CommonProps } from '../common';
|
|
|
6
6
|
type ContainerOwnProps<T extends ElementType> = CommonProps & {
|
|
7
7
|
/** Controls the maximum width: `fluid` (100%), `standard` (1160px), `narrow` (840px), `compact` (600px). @default 'standard' */
|
|
8
8
|
size?: 'fluid' | 'standard' | 'narrow' | 'compact';
|
|
9
|
-
/** Controls content alignment within the container.
|
|
10
|
-
* `none` applies no positioning, `center` centers content both vertically and horizontally.
|
|
11
|
-
* @default 'none' */
|
|
12
|
-
alignContent?: 'none' | 'center';
|
|
13
9
|
as?: T;
|
|
14
10
|
};
|
|
15
11
|
|
|
@@ -25,7 +21,6 @@ export type ContainerProps<T extends ElementType = 'div'> = PropsWithChildren<
|
|
|
25
21
|
*/
|
|
26
22
|
const Container = <T extends ElementType = 'div'>({
|
|
27
23
|
size = 'standard',
|
|
28
|
-
alignContent = 'none',
|
|
29
24
|
as,
|
|
30
25
|
className,
|
|
31
26
|
children,
|
|
@@ -33,15 +28,7 @@ const Container = <T extends ElementType = 'div'>({
|
|
|
33
28
|
}: ContainerProps<T>) => {
|
|
34
29
|
const Element = as ?? 'div';
|
|
35
30
|
return (
|
|
36
|
-
<Element
|
|
37
|
-
{...otherProps}
|
|
38
|
-
className={clsx(
|
|
39
|
-
'wds-container',
|
|
40
|
-
`wds-container--${size}`,
|
|
41
|
-
alignContent !== 'none' && `wds-container--align-${alignContent}`,
|
|
42
|
-
className,
|
|
43
|
-
)}
|
|
44
|
-
>
|
|
31
|
+
<Element {...otherProps} className={clsx('wds-container', `wds-container--${size}`, className)}>
|
|
45
32
|
{children}
|
|
46
33
|
</Element>
|
|
47
34
|
);
|
|
@@ -17,16 +17,11 @@ export default {
|
|
|
17
17
|
control: 'radio',
|
|
18
18
|
options: ['fluid', 'standard', 'narrow', 'compact'],
|
|
19
19
|
},
|
|
20
|
-
alignContent: {
|
|
21
|
-
control: 'radio',
|
|
22
|
-
options: ['none', 'center'],
|
|
23
|
-
},
|
|
24
20
|
as: { control: 'text' },
|
|
25
21
|
className: { table: { category: 'Common' } },
|
|
26
22
|
},
|
|
27
23
|
args: {
|
|
28
24
|
size: 'standard',
|
|
29
|
-
alignContent: 'none',
|
|
30
25
|
as: undefined,
|
|
31
26
|
className: undefined,
|
|
32
27
|
},
|
|
@@ -144,42 +139,3 @@ export const Size: Story = {
|
|
|
144
139
|
},
|
|
145
140
|
},
|
|
146
141
|
};
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Use `alignContent` to control how children are positioned inside the container. <br />
|
|
150
|
-
* `none` (default) applies no positioning — content flows naturally. `center` centers content both vertically and horizontally.
|
|
151
|
-
*/
|
|
152
|
-
export const AlignContent: Story = {
|
|
153
|
-
argTypes: {
|
|
154
|
-
size: { table: { disable: true } },
|
|
155
|
-
alignContent: { table: { disable: true } },
|
|
156
|
-
as: { table: { disable: true } },
|
|
157
|
-
className: { table: { disable: true } },
|
|
158
|
-
},
|
|
159
|
-
render: () => (
|
|
160
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: '2px' }}>
|
|
161
|
-
{(['none', 'center'] as const).map((alignContent) => (
|
|
162
|
-
<div
|
|
163
|
-
key={alignContent}
|
|
164
|
-
style={{ background: 'var(--color-background-neutral)', paddingBlock: 'var(--size-16)' }}
|
|
165
|
-
>
|
|
166
|
-
<Container size="narrow" alignContent={alignContent} style={{ minHeight: '120px' }}>
|
|
167
|
-
<div style={{ background: 'white', borderRadius: '16px', padding: 'var(--size-16)' }}>
|
|
168
|
-
<Title type="title-section">alignContent="{alignContent}"</Title>
|
|
169
|
-
<Body>Content inside the container.</Body>
|
|
170
|
-
</div>
|
|
171
|
-
</Container>
|
|
172
|
-
</div>
|
|
173
|
-
))}
|
|
174
|
-
</div>
|
|
175
|
-
),
|
|
176
|
-
parameters: {
|
|
177
|
-
docs: {
|
|
178
|
-
source: {
|
|
179
|
-
code: `<Container alignContent="none">No positioning (default)</Container>
|
|
180
|
-
|
|
181
|
-
<Container alignContent="center">Centered content</Container>`,
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
},
|
|
185
|
-
};
|
|
@@ -4,7 +4,12 @@
|
|
|
4
4
|
justify-content: center;
|
|
5
5
|
width: 100%;
|
|
6
6
|
box-sizing: border-box;
|
|
7
|
-
min-height:
|
|
7
|
+
min-height: 80px;
|
|
8
|
+
}
|
|
9
|
+
@media (min-width: 320.02px) {
|
|
10
|
+
.np-flow-navigation {
|
|
11
|
+
min-height: 128px;
|
|
12
|
+
}
|
|
8
13
|
}
|
|
9
14
|
.np-flow-navigation--border-bottom {
|
|
10
15
|
border-bottom: 1px solid rgba(0,0,0,0.10196);
|
|
@@ -13,7 +18,7 @@
|
|
|
13
18
|
.np-flow-navigation__content {
|
|
14
19
|
width: 100%;
|
|
15
20
|
min-width: 320px;
|
|
16
|
-
max-width:
|
|
21
|
+
max-width: none;
|
|
17
22
|
}
|
|
18
23
|
.np-flow-navigation__stepper {
|
|
19
24
|
padding-bottom: 0 !important;
|
|
@@ -72,17 +77,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
72
77
|
.np-flow-navigation--hidden {
|
|
73
78
|
visibility: hidden;
|
|
74
79
|
}
|
|
75
|
-
.np-flow-navigation--composable {
|
|
76
|
-
min-height: 80px;
|
|
77
|
-
}
|
|
78
|
-
@media (min-width: 320.02px) {
|
|
79
|
-
.np-flow-navigation--composable {
|
|
80
|
-
min-height: 128px;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
.np-flow-navigation--composable .np-flow-navigation__content {
|
|
84
|
-
max-width: none;
|
|
85
|
-
}
|
|
86
80
|
.np-theme-personal--forest-green .np-flow-navigation .np-flow-header__left path,
|
|
87
81
|
.np-theme-personal--bright-green .np-flow-navigation .np-flow-header__left path,
|
|
88
82
|
.np-theme-personal--dark .np-flow-navigation .np-flow-header__left path {
|
|
@@ -9,7 +9,11 @@
|
|
|
9
9
|
box-sizing: border-box;
|
|
10
10
|
|
|
11
11
|
// This is the natural height of FlowNavigation when the Avatar is displayed.
|
|
12
|
-
min-height:
|
|
12
|
+
min-height: 80px;
|
|
13
|
+
|
|
14
|
+
@media (--screen-xs) {
|
|
15
|
+
min-height: 128px;
|
|
16
|
+
}
|
|
13
17
|
|
|
14
18
|
&--border-bottom {
|
|
15
19
|
border-bottom: 1px solid var(--color-border-neutral);
|
|
@@ -18,7 +22,7 @@
|
|
|
18
22
|
&__content {
|
|
19
23
|
width: 100%;
|
|
20
24
|
min-width: 320px;
|
|
21
|
-
max-width:
|
|
25
|
+
max-width: none;
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
&__stepper {
|
|
@@ -69,19 +73,6 @@
|
|
|
69
73
|
visibility: hidden;
|
|
70
74
|
}
|
|
71
75
|
|
|
72
|
-
&--composable {
|
|
73
|
-
min-height: 80px;
|
|
74
|
-
|
|
75
|
-
@media (--screen-xs) {
|
|
76
|
-
min-height: 128px;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.np-flow-navigation__content {
|
|
80
|
-
// Remove max-width constraint for fluid layout
|
|
81
|
-
max-width: none;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
76
|
.np-theme-personal--forest-green &,
|
|
86
77
|
.np-theme-personal--bright-green &,
|
|
87
78
|
.np-theme-personal--dark & {
|
|
@@ -26,20 +26,13 @@ export interface FlowNavigationProps {
|
|
|
26
26
|
/** @default false */
|
|
27
27
|
done?: boolean;
|
|
28
28
|
/** Called when the close button is clicked. If not provided the close button won't show */
|
|
29
|
-
onClose?: () => void
|
|
29
|
+
onClose?: (() => void) | React.MouseEventHandler<HTMLButtonElement>;
|
|
30
30
|
/** Called when the back button is clicked. If not provided the back button won't show. The back button only shows on small screens */
|
|
31
31
|
onGoBack?: () => void;
|
|
32
32
|
/** Steps to be displayed in stepper. If not provided, the stepper won't show. */
|
|
33
33
|
steps?: readonly Step[];
|
|
34
|
-
/**
|
|
35
|
-
* When true, renders in composable mode using a fluid Container.
|
|
36
|
-
* This allows the FlowNavigation to be used within custom layout containers.
|
|
37
|
-
* @default false
|
|
38
|
-
*/
|
|
39
|
-
composable?: boolean;
|
|
40
34
|
/**
|
|
41
35
|
* Controls whether the bottom border is displayed.
|
|
42
|
-
* Only applies to the composable variant. Non-composable variant always uses the done state.
|
|
43
36
|
* @default true
|
|
44
37
|
*/
|
|
45
38
|
showBottomBorder?: boolean;
|
|
@@ -53,7 +46,6 @@ const FlowNavigation = ({
|
|
|
53
46
|
onClose,
|
|
54
47
|
onGoBack,
|
|
55
48
|
steps,
|
|
56
|
-
composable = false,
|
|
57
49
|
showBottomBorder = true,
|
|
58
50
|
}: FlowNavigationProps) => {
|
|
59
51
|
const intl = useIntl();
|
|
@@ -69,7 +61,6 @@ const FlowNavigation = ({
|
|
|
69
61
|
<FlowHeader
|
|
70
62
|
className={clsx(
|
|
71
63
|
'np-flow-navigation__content',
|
|
72
|
-
!composable && 'p-x-3',
|
|
73
64
|
screenSm == null
|
|
74
65
|
? 'np-flow-navigation--hidden'
|
|
75
66
|
: {
|
|
@@ -119,27 +110,15 @@ const FlowNavigation = ({
|
|
|
119
110
|
/>
|
|
120
111
|
);
|
|
121
112
|
|
|
122
|
-
if (composable) {
|
|
123
|
-
return (
|
|
124
|
-
<Container
|
|
125
|
-
size="fluid"
|
|
126
|
-
className={clsx('np-flow-navigation np-flow-navigation--composable', {
|
|
127
|
-
'np-flow-navigation--border-bottom': showBottomBorder,
|
|
128
|
-
})}
|
|
129
|
-
>
|
|
130
|
-
{flowHeaderContent}
|
|
131
|
-
</Container>
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
113
|
return (
|
|
136
|
-
<
|
|
137
|
-
|
|
138
|
-
|
|
114
|
+
<Container
|
|
115
|
+
size="fluid"
|
|
116
|
+
className={clsx('np-flow-navigation', {
|
|
117
|
+
'np-flow-navigation--border-bottom': showBottomBorder,
|
|
139
118
|
})}
|
|
140
119
|
>
|
|
141
120
|
{flowHeaderContent}
|
|
142
|
-
</
|
|
121
|
+
</Container>
|
|
143
122
|
);
|
|
144
123
|
};
|
|
145
124
|
|
|
@@ -323,7 +323,10 @@ export const SendFlow: Story = {
|
|
|
323
323
|
</Container>
|
|
324
324
|
|
|
325
325
|
<Sticky>
|
|
326
|
-
<Container
|
|
326
|
+
<Container
|
|
327
|
+
size="narrow"
|
|
328
|
+
className="d-flex justify-content-center align-items-center p-y-3"
|
|
329
|
+
>
|
|
327
330
|
<Button
|
|
328
331
|
v2
|
|
329
332
|
disabled={activeStep === 3}
|
|
@@ -381,89 +384,6 @@ export const WithOverlayHeaderComparison: Story = {
|
|
|
381
384
|
},
|
|
382
385
|
};
|
|
383
386
|
|
|
384
|
-
export const ComposableVariant: Story = {
|
|
385
|
-
args: {
|
|
386
|
-
profileType: ProfileType.PERSONAL,
|
|
387
|
-
showCloseButton: true,
|
|
388
|
-
showMobileBackButton: true,
|
|
389
|
-
done: false,
|
|
390
|
-
avatarURL: '../tapestry-01.png',
|
|
391
|
-
},
|
|
392
|
-
parameters: {
|
|
393
|
-
padding: '0',
|
|
394
|
-
chromatic: {
|
|
395
|
-
viewports,
|
|
396
|
-
},
|
|
397
|
-
},
|
|
398
|
-
render: (args) => {
|
|
399
|
-
const [activeStep, setActiveStep] = useState(2);
|
|
400
|
-
const steps = [
|
|
401
|
-
{
|
|
402
|
-
label: 'Recipient',
|
|
403
|
-
onClick: () => setActiveStep(0),
|
|
404
|
-
},
|
|
405
|
-
{
|
|
406
|
-
label: 'Amount',
|
|
407
|
-
hoverLabel: (
|
|
408
|
-
<>
|
|
409
|
-
You send 100 GBP <br />
|
|
410
|
-
You get 99.39 GBP{' '}
|
|
411
|
-
</>
|
|
412
|
-
),
|
|
413
|
-
...(activeStep > 1 && { onClick: () => setActiveStep(1) }),
|
|
414
|
-
},
|
|
415
|
-
{
|
|
416
|
-
label: 'Review',
|
|
417
|
-
...(activeStep > 2 && { onClick: () => setActiveStep(2) }),
|
|
418
|
-
},
|
|
419
|
-
{
|
|
420
|
-
label: 'Pay',
|
|
421
|
-
...(activeStep > 3 && { onClick: () => setActiveStep(3) }),
|
|
422
|
-
},
|
|
423
|
-
];
|
|
424
|
-
return (
|
|
425
|
-
<>
|
|
426
|
-
<FlowNavigation
|
|
427
|
-
composable
|
|
428
|
-
avatar={<AvatarView profileType={args.profileType} />}
|
|
429
|
-
logo={<Logo />}
|
|
430
|
-
activeStep={activeStep}
|
|
431
|
-
steps={steps}
|
|
432
|
-
onClose={args.showCloseButton ? () => alert('close') : undefined}
|
|
433
|
-
onGoBack={
|
|
434
|
-
args.showMobileBackButton
|
|
435
|
-
? () => setActiveStep(activeStep > 0 ? activeStep - 1 : 0)
|
|
436
|
-
: undefined
|
|
437
|
-
}
|
|
438
|
-
/>
|
|
439
|
-
<Container size="narrow">
|
|
440
|
-
<Body className="m-a-3">
|
|
441
|
-
<Display type={Typography.DISPLAY_SMALL}>{steps[activeStep].label} Step</Display>
|
|
442
|
-
<br />
|
|
443
|
-
{lorem10}
|
|
444
|
-
</Body>
|
|
445
|
-
</Container>
|
|
446
|
-
|
|
447
|
-
<Sticky>
|
|
448
|
-
<Container
|
|
449
|
-
size="narrow"
|
|
450
|
-
className="d-flex justify-content-center align-items-center p-y-3"
|
|
451
|
-
>
|
|
452
|
-
<Button
|
|
453
|
-
v2
|
|
454
|
-
disabled={activeStep === 3}
|
|
455
|
-
block
|
|
456
|
-
onClick={() => setActiveStep(activeStep + 1)}
|
|
457
|
-
>
|
|
458
|
-
Continue
|
|
459
|
-
</Button>
|
|
460
|
-
</Container>
|
|
461
|
-
</Sticky>
|
|
462
|
-
</>
|
|
463
|
-
);
|
|
464
|
-
},
|
|
465
|
-
};
|
|
466
|
-
|
|
467
387
|
export const WithoutStepper: Story = {
|
|
468
388
|
args: {
|
|
469
389
|
profileType: ProfileType.PERSONAL,
|
|
@@ -572,7 +492,6 @@ export const BorderControl: Story = {
|
|
|
572
492
|
|
|
573
493
|
{/* Composable: showBottomBorder=true, done=false - SHOWS BORDER */}
|
|
574
494
|
<FlowNavigation
|
|
575
|
-
composable
|
|
576
495
|
avatar={<AvatarView profileType={args.profileType} />}
|
|
577
496
|
logo={<Logo />}
|
|
578
497
|
activeStep={activeStep}
|
|
@@ -588,7 +507,6 @@ export const BorderControl: Story = {
|
|
|
588
507
|
|
|
589
508
|
{/* Composable: showBottomBorder=true, done=true - SHOWS BORDER */}
|
|
590
509
|
<FlowNavigation
|
|
591
|
-
composable
|
|
592
510
|
avatar={<AvatarView profileType={args.profileType} />}
|
|
593
511
|
logo={<Logo />}
|
|
594
512
|
activeStep={activeStep}
|
|
@@ -604,7 +522,6 @@ export const BorderControl: Story = {
|
|
|
604
522
|
|
|
605
523
|
{/* Composable: showBottomBorder=false, done=false - HIDES BORDER */}
|
|
606
524
|
<FlowNavigation
|
|
607
|
-
composable
|
|
608
525
|
avatar={<AvatarView profileType={args.profileType} />}
|
|
609
526
|
logo={<Logo />}
|
|
610
527
|
activeStep={activeStep}
|
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
-
import { useState } from 'react';
|
|
3
2
|
import { createSandboxStory } from '../../../.storybook/components/sandbox/SandboxEditor';
|
|
4
3
|
|
|
5
4
|
import Loader from '..';
|
|
6
|
-
import Button from '../../Button';
|
|
7
|
-
import Container from '../../Container';
|
|
8
|
-
import FlowNavigation from '../../FlowNavigation';
|
|
9
|
-
import Logo from '../../Logo';
|
|
10
|
-
import Sticky from '../../Sticky';
|
|
11
|
-
import Title from '../../Title';
|
|
12
|
-
import Body from '../../Body';
|
|
13
|
-
import { lorem10 } from '../../test-utils';
|
|
14
5
|
|
|
15
6
|
export default {
|
|
16
7
|
component: Loader,
|
|
@@ -40,42 +31,3 @@ export const Sandbox = createSandboxStory({
|
|
|
40
31
|
});
|
|
41
32
|
|
|
42
33
|
export const Basic: Story = {};
|
|
43
|
-
|
|
44
|
-
export const LoaderInFlow: Story = {
|
|
45
|
-
parameters: {
|
|
46
|
-
padding: '0',
|
|
47
|
-
},
|
|
48
|
-
render: () => {
|
|
49
|
-
const [activeStep] = useState(2);
|
|
50
|
-
const steps = [
|
|
51
|
-
{ label: 'Recipient' },
|
|
52
|
-
{ label: 'Amount' },
|
|
53
|
-
{ label: 'Review' },
|
|
54
|
-
{ label: 'Pay' },
|
|
55
|
-
];
|
|
56
|
-
return (
|
|
57
|
-
<>
|
|
58
|
-
<FlowNavigation
|
|
59
|
-
logo={<Logo />}
|
|
60
|
-
activeStep={activeStep}
|
|
61
|
-
steps={steps}
|
|
62
|
-
onClose={() => alert('close')}
|
|
63
|
-
/>
|
|
64
|
-
<Container size="narrow" alignContent="center" className="p-t-4">
|
|
65
|
-
<Title type="title-section">Some title</Title>
|
|
66
|
-
<Body className="m-b-4">{lorem10}</Body>
|
|
67
|
-
</Container>
|
|
68
|
-
<Container size="narrow" alignContent="center">
|
|
69
|
-
<Loader label="Loading form..." />
|
|
70
|
-
</Container>
|
|
71
|
-
<Sticky>
|
|
72
|
-
<Container size="narrow" alignContent="center" className="p-y-3">
|
|
73
|
-
<Button v2 block onClick={() => alert('continue')}>
|
|
74
|
-
Continue
|
|
75
|
-
</Button>
|
|
76
|
-
</Container>
|
|
77
|
-
</Sticky>
|
|
78
|
-
</>
|
|
79
|
-
);
|
|
80
|
-
},
|
|
81
|
-
};
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import { clsx } from 'clsx';
|
|
2
|
-
|
|
3
|
-
import { Size } from '../../common';
|
|
4
|
-
import { CloseButton } from '../../common/CloseButton';
|
|
5
|
-
import FlowHeader from '../../common/FlowHeader';
|
|
6
1
|
import Logo from '../../Logo';
|
|
2
|
+
import FlowNavigation from '../../FlowNavigation';
|
|
7
3
|
|
|
8
4
|
/**
|
|
9
5
|
* @deprecated Use `FlowNavigation` component instead, with `steps={[]}`
|
|
@@ -22,20 +18,5 @@ const defaultLogo = <Logo />;
|
|
|
22
18
|
* @deprecated Use `FlowNavigation` component instead
|
|
23
19
|
*/
|
|
24
20
|
export default function OverlayHeader({ avatar, onClose, logo = defaultLogo }: OverlayHeaderProps) {
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<div className="np-overlay-header d-flex justify-content-center">
|
|
28
|
-
<FlowHeader
|
|
29
|
-
className="np-overlay-header__content p-a-3"
|
|
30
|
-
leftContent={logo}
|
|
31
|
-
rightContent={
|
|
32
|
-
<div className={clsx('d-flex', 'align-items-center', 'order-2')}>
|
|
33
|
-
{avatar}
|
|
34
|
-
{avatar && closeButton && <span className={clsx('m-x-1')} />}
|
|
35
|
-
{closeButton}
|
|
36
|
-
</div>
|
|
37
|
-
}
|
|
38
|
-
/>
|
|
39
|
-
</div>
|
|
40
|
-
);
|
|
21
|
+
return <FlowNavigation {...{ avatar, onClose, logo }} />;
|
|
41
22
|
}
|
package/src/main.css
CHANGED
|
@@ -26110,12 +26110,6 @@ a[data-toggle="tooltip"] {
|
|
|
26110
26110
|
max-width: var(--wds-container-width-fluid);
|
|
26111
26111
|
}
|
|
26112
26112
|
|
|
26113
|
-
.wds-container--align-center {
|
|
26114
|
-
display: flex;
|
|
26115
|
-
flex-direction: column;
|
|
26116
|
-
align-items: center;
|
|
26117
|
-
}
|
|
26118
|
-
|
|
26119
26113
|
.critical-comms {
|
|
26120
26114
|
border-radius: 16px;
|
|
26121
26115
|
border-radius: var(--radius-medium);
|
|
@@ -29019,7 +29013,13 @@ button.np-option {
|
|
|
29019
29013
|
justify-content: center;
|
|
29020
29014
|
width: 100%;
|
|
29021
29015
|
box-sizing: border-box;
|
|
29022
|
-
min-height:
|
|
29016
|
+
min-height: 80px;
|
|
29017
|
+
}
|
|
29018
|
+
|
|
29019
|
+
@media (min-width: 320.02px) {
|
|
29020
|
+
.np-flow-navigation {
|
|
29021
|
+
min-height: 128px;
|
|
29022
|
+
}
|
|
29023
29023
|
}
|
|
29024
29024
|
|
|
29025
29025
|
.np-flow-navigation--border-bottom {
|
|
@@ -29030,7 +29030,7 @@ button.np-option {
|
|
|
29030
29030
|
.np-flow-navigation__content {
|
|
29031
29031
|
width: 100%;
|
|
29032
29032
|
min-width: 320px;
|
|
29033
|
-
max-width:
|
|
29033
|
+
max-width: none;
|
|
29034
29034
|
}
|
|
29035
29035
|
|
|
29036
29036
|
.np-flow-navigation__stepper {
|
|
@@ -29107,20 +29107,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
29107
29107
|
visibility: hidden;
|
|
29108
29108
|
}
|
|
29109
29109
|
|
|
29110
|
-
.np-flow-navigation--composable {
|
|
29111
|
-
min-height: 80px;
|
|
29112
|
-
}
|
|
29113
|
-
|
|
29114
|
-
@media (min-width: 320.02px) {
|
|
29115
|
-
.np-flow-navigation--composable {
|
|
29116
|
-
min-height: 128px;
|
|
29117
|
-
}
|
|
29118
|
-
}
|
|
29119
|
-
|
|
29120
|
-
.np-flow-navigation--composable .np-flow-navigation__content {
|
|
29121
|
-
max-width: none;
|
|
29122
|
-
}
|
|
29123
|
-
|
|
29124
29110
|
.np-theme-personal--forest-green .np-flow-navigation .np-flow-header__left path,
|
|
29125
29111
|
.np-theme-personal--bright-green .np-flow-navigation .np-flow-header__left path,
|
|
29126
29112
|
.np-theme-personal--dark .np-flow-navigation .np-flow-header__left path {
|
|
@@ -31656,24 +31642,6 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31656
31642
|
text-decoration: var(--nudge-link-text-decoration);
|
|
31657
31643
|
}
|
|
31658
31644
|
|
|
31659
|
-
.np-overlay-header .np-overlay-header__content {
|
|
31660
|
-
min-height: 97px;
|
|
31661
|
-
width: 100%;
|
|
31662
|
-
min-width: 320px;
|
|
31663
|
-
max-width: calc(1160px - 36px);
|
|
31664
|
-
}
|
|
31665
|
-
|
|
31666
|
-
.np-theme-personal .np-overlay-header {
|
|
31667
|
-
border-bottom: 1px solid rgba(0,0,0,0.10196);
|
|
31668
|
-
border-bottom: 1px solid var(--color-border-neutral);
|
|
31669
|
-
}
|
|
31670
|
-
|
|
31671
|
-
.np-theme-personal--forest-green .np-overlay-header .np-flow-header__left path,
|
|
31672
|
-
.np-theme-personal--bright-green .np-overlay-header .np-flow-header__left path,
|
|
31673
|
-
.np-theme-personal--dark .np-overlay-header .np-flow-header__left path {
|
|
31674
|
-
fill: var(--color-interactive-primary);
|
|
31675
|
-
}
|
|
31676
|
-
|
|
31677
31645
|
.tw-telephone {
|
|
31678
31646
|
display: flex;
|
|
31679
31647
|
}
|
package/src/main.less
CHANGED
|
@@ -63,7 +63,6 @@
|
|
|
63
63
|
@import "./_deprecated/NavigationOption/NavigationOption.less";
|
|
64
64
|
@import "./_deprecated/NavigationOptionsList/NavigationOptionsList.less";
|
|
65
65
|
@import "./Nudge/Nudge.less";
|
|
66
|
-
@import "./_deprecated/OverlayHeader/OverlayHeader.less";
|
|
67
66
|
@import "./PhoneNumberInput/PhoneNumberInput.less";
|
|
68
67
|
@import "./Popover/Popover.less";
|
|
69
68
|
@import "./PromoCard/PromoCard.less";
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
.np-overlay-header .np-overlay-header__content {
|
|
2
|
-
min-height: 97px;
|
|
3
|
-
width: 100%;
|
|
4
|
-
min-width: 320px;
|
|
5
|
-
max-width: calc(1160px - 36px);
|
|
6
|
-
}
|
|
7
|
-
.np-theme-personal .np-overlay-header {
|
|
8
|
-
border-bottom: 1px solid rgba(0,0,0,0.10196);
|
|
9
|
-
border-bottom: 1px solid var(--color-border-neutral);
|
|
10
|
-
}
|
|
11
|
-
.np-theme-personal--forest-green .np-overlay-header .np-flow-header__left path,
|
|
12
|
-
.np-theme-personal--bright-green .np-overlay-header .np-flow-header__left path,
|
|
13
|
-
.np-theme-personal--dark .np-overlay-header .np-flow-header__left path {
|
|
14
|
-
fill: var(--color-interactive-primary);
|
|
15
|
-
}
|