@transferwise/components 45.21.3 → 45.23.0
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.esm.js +103 -77
- package/build/index.esm.js.map +1 -1
- package/build/index.js +103 -77
- package/build/index.js.map +1 -1
- package/build/main.css +1 -1
- package/build/styles/flowNavigation/FlowNavigation.css +1 -1
- package/build/styles/flowNavigation/animatedLabel/AnimatedLabel.css +1 -1
- package/build/styles/header/Header.css +1 -1
- package/build/styles/inputs/SelectInput.css +1 -1
- package/build/styles/main.css +1 -1
- package/build/styles/overlayHeader/OverlayHeader.css +1 -1
- package/build/types/common/flowHeader/FlowHeader.d.ts.map +1 -1
- package/build/types/flowNavigation/FlowNavigation.d.ts.map +1 -1
- package/build/types/flowNavigation/animatedLabel/AnimatedLabel.d.ts +1 -2
- package/build/types/flowNavigation/animatedLabel/AnimatedLabel.d.ts.map +1 -1
- package/build/types/flowNavigation/backButton/BackButton.d.ts +10 -11
- package/build/types/flowNavigation/backButton/BackButton.d.ts.map +1 -1
- package/build/types/header/Header.d.ts +1 -1
- package/build/types/header/Header.d.ts.map +1 -1
- package/build/types/inputs/SelectInput.d.ts +5 -1
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/overlayHeader/OverlayHeader.d.ts.map +1 -1
- package/build/types/title/Title.d.ts +1 -1
- package/build/types/title/Title.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/common/flowHeader/FlowHeader.tsx +4 -22
- package/src/common/flowHeader/__snapshots__/FlowHeader.spec.js.snap +6 -22
- package/src/flowNavigation/FlowNavigation.css +1 -1
- package/src/flowNavigation/FlowNavigation.less +0 -9
- package/src/flowNavigation/FlowNavigation.spec.js +3 -3
- package/src/flowNavigation/FlowNavigation.story.js +22 -189
- package/src/flowNavigation/FlowNavigation.tsx +22 -27
- package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +18 -26
- package/src/flowNavigation/animatedLabel/AnimatedLabel.css +1 -1
- package/src/flowNavigation/animatedLabel/AnimatedLabel.less +0 -6
- package/src/flowNavigation/animatedLabel/AnimatedLabel.spec.js +7 -21
- package/src/flowNavigation/animatedLabel/AnimatedLabel.tsx +8 -17
- package/src/flowNavigation/animatedLabel/__snapshots__/AnimatedLabel.spec.js.snap +4 -4
- package/src/flowNavigation/backButton/BackButton.js +14 -9
- package/src/flowNavigation/backButton/BackButton.spec.js +3 -2
- package/src/flowNavigation/backButton/__snapshots__/BackButton.spec.js.snap +28 -21
- package/src/header/Header.css +1 -1
- package/src/header/Header.less +5 -0
- package/src/header/Header.tsx +21 -2
- package/src/inputs/SelectInput.css +1 -1
- package/src/inputs/SelectInput.less +7 -10
- package/src/inputs/SelectInput.spec.tsx +40 -0
- package/src/inputs/SelectInput.story.tsx +18 -0
- package/src/inputs/SelectInput.tsx +46 -12
- package/src/inputs/_BottomSheet.less +1 -1
- package/src/inputs/_Popover.less +1 -0
- package/src/main.css +1 -1
- package/src/overlayHeader/OverlayHeader.css +1 -1
- package/src/overlayHeader/OverlayHeader.js +6 -4
- package/src/overlayHeader/OverlayHeader.less +0 -8
- package/src/overlayHeader/OverlayHeader.spec.js +1 -1
- package/src/overlayHeader/__snapshots__/OverlayHeader.spec.js.snap +10 -14
- package/src/title/Title.tsx +1 -1
- package/src/flowNavigation/animatedLabel/AnimatedLabel.story.js +0 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
.np-overlay-header .np-overlay-header__content{max-width:1164px;min-height:97px;min-width:320px;width:100%}.np-
|
|
1
|
+
.np-overlay-header .np-overlay-header__content{max-width:1164px;min-height:97px;min-width:320px;width:100%}.np-theme-personal .np-overlay-header{border-bottom:1px solid #0000001a;border-bottom:1px solid var(--color-border-neutral)}.np-theme-personal--bright-green .np-overlay-header .np-flow-header__left path,.np-theme-personal--dark .np-overlay-header .np-flow-header__left path,.np-theme-personal--forest-green .np-overlay-header .np-flow-header__left path{fill:var(--color-interactive-primary)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlowHeader.d.ts","sourceRoot":"","sources":["../../../../src/common/flowHeader/FlowHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,MAAM,WAAW,eAAe;IAC9B,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC;IAC7C,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAChC;AAED,QAAA,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"FlowHeader.d.ts","sourceRoot":"","sources":["../../../../src/common/flowHeader/FlowHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,MAAM,WAAW,eAAe;IAC9B,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC;IAC7C,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAChC;AAED,QAAA,MAAM,UAAU,wFAuCf,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlowNavigation.d.ts","sourceRoot":"","sources":["../../../src/flowNavigation/FlowNavigation.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAgB,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAMnD,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,2FAA2F;IAC3F,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,sIAAsI;IACtI,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,wGAAwG;IACxG,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AAED,QAAA,MAAM,cAAc,kEAQjB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"FlowNavigation.d.ts","sourceRoot":"","sources":["../../../src/flowNavigation/FlowNavigation.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAgB,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAMnD,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,2FAA2F;IAC3F,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,sIAAsI;IACtI,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,wGAAwG;IACxG,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AAED,QAAA,MAAM,cAAc,kEAQjB,mBAAmB,sBAqErB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -3,8 +3,7 @@ export interface AnimatedLabelProps {
|
|
|
3
3
|
activeLabel: number;
|
|
4
4
|
className?: string;
|
|
5
5
|
labels: React.ReactNode[];
|
|
6
|
-
'aria-label': string;
|
|
7
6
|
}
|
|
8
|
-
declare const AnimatedLabel: ({ activeLabel, className, labels
|
|
7
|
+
declare const AnimatedLabel: ({ activeLabel, className, labels }: AnimatedLabelProps) => React.JSX.Element;
|
|
9
8
|
export default AnimatedLabel;
|
|
10
9
|
//# sourceMappingURL=AnimatedLabel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimatedLabel.d.ts","sourceRoot":"","sources":["../../../../src/flowNavigation/animatedLabel/AnimatedLabel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AnimatedLabel.d.ts","sourceRoot":"","sources":["../../../../src/flowNavigation/animatedLabel/AnimatedLabel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;CAC3B;AAED,QAAA,MAAM,aAAa,uCAAwC,kBAAkB,sBAkB5E,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
export default BackButton;
|
|
2
|
-
declare function BackButton({
|
|
3
|
-
label: any;
|
|
2
|
+
declare function BackButton({ className, onClick, "aria-label": ariaLabel }: {
|
|
4
3
|
className: any;
|
|
5
4
|
onClick: any;
|
|
5
|
+
"aria-label": any;
|
|
6
6
|
}): import("react").JSX.Element;
|
|
7
7
|
declare namespace BackButton {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
const propTypes: {
|
|
9
|
+
'aria-label': any;
|
|
10
|
+
className: any;
|
|
11
|
+
label: any;
|
|
12
|
+
onClick: any;
|
|
13
|
+
};
|
|
13
14
|
namespace defaultProps {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
const label_1: undefined;
|
|
17
|
-
export { label_1 as label };
|
|
15
|
+
const className: undefined;
|
|
16
|
+
const label: undefined;
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
19
|
//# sourceMappingURL=BackButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackButton.d.ts","sourceRoot":"","sources":["../../../../src/flowNavigation/backButton/BackButton.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"BackButton.d.ts","sourceRoot":"","sources":["../../../../src/flowNavigation/backButton/BackButton.js"],"names":[],"mappings":";AAMA;;;;gCAWC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/header/Header.tsx"],"names":[],"mappings":";AAGA,OAAqB,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAE/E,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAc,MAAM,WAAW,CAAC;AAI3F,KAAK,WAAW,GAAG,iBAAiB,GAAG;IACrC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,iBAAiB,GAAG,WAAW,GAAG,iBAAiB,CAAC;AAEzD,KAAK,eAAe,GAAG,WAAW,GAAG,SAAS,CAAC;AAE/C,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG;IACtC;;OAEG;IACH,MAAM,CAAC,EAAE,iBAAiB,GAAG,eAAe,CAAC;IAC7C;;;;OAIG;IACH,EAAE,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/header/Header.tsx"],"names":[],"mappings":";AAGA,OAAqB,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAE/E,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAc,MAAM,WAAW,CAAC;AAI3F,KAAK,WAAW,GAAG,iBAAiB,GAAG;IACrC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,iBAAiB,GAAG,WAAW,GAAG,iBAAiB,CAAC;AAEzD,KAAK,eAAe,GAAG,WAAW,GAAG,SAAS,CAAC;AAE/C,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG;IACtC;;OAEG;IACH,MAAM,CAAC,EAAE,iBAAiB,GAAG,eAAe,CAAC;IAC7C;;;;OAIG;IACH,EAAE,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAiCF;;;;GAIG;AACH,eAAO,MAAM,MAAM,qCAA6C,WAAW,gCA4B1E,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -23,6 +23,10 @@ export interface SelectInputProps<T = string> {
|
|
|
23
23
|
value?: T;
|
|
24
24
|
compareValues?: (keyof NonNullable<T> & string) | ((a: T | undefined, b: T | undefined) => boolean);
|
|
25
25
|
renderValue?: (value: NonNullable<T>, withinTrigger: boolean) => React.ReactNode;
|
|
26
|
+
renderFooter?: (args: {
|
|
27
|
+
resultsEmpty: boolean;
|
|
28
|
+
normalizedQuery: string | null | undefined;
|
|
29
|
+
}) => React.ReactNode;
|
|
26
30
|
renderTrigger?: (args: {
|
|
27
31
|
content: React.ReactNode;
|
|
28
32
|
placeholderShown: boolean;
|
|
@@ -39,7 +43,7 @@ export interface SelectInputProps<T = string> {
|
|
|
39
43
|
onChange?: (value: T) => void;
|
|
40
44
|
onClear?: () => void;
|
|
41
45
|
}
|
|
42
|
-
export declare function SelectInput<T = string>({ name, placeholder, items, defaultValue, value: controlledValue, compareValues, renderValue, renderTrigger, filterable, filterPlaceholder, disabled, size, className, onChange, onClear, }: SelectInputProps<T>): import("react").JSX.Element;
|
|
46
|
+
export declare function SelectInput<T = string>({ name, placeholder, items, defaultValue, value: controlledValue, compareValues, renderValue, renderFooter, renderTrigger, filterable, filterPlaceholder, disabled, size, className, onChange, onClear, }: SelectInputProps<T>): import("react").JSX.Element;
|
|
43
47
|
type SelectInputTriggerButtonElementType = 'button' | React.ComponentType;
|
|
44
48
|
export type SelectInputTriggerButtonProps<T extends SelectInputTriggerButtonElementType = 'button'> = Merge<React.ComponentPropsWithoutRef<T>, {
|
|
45
49
|
as?: T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectInput.d.ts","sourceRoot":"","sources":["../../../src/inputs/SelectInput.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAkCjC,MAAM,WAAW,qBAAqB,CAAC,CAAC,GAAG,MAAM;IAC/C,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,CAAC,CAAC;IACT,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB,CAAC,CAAC,GAAG,MAAM;IAC9C,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS,qBAAqB,CAAC,CAAC,CAAC,EAAE,CAAC;CAC9C;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,MAAM,IAClC,qBAAqB,CAAC,CAAC,CAAC,GACxB,oBAAoB,CAAC,CAAC,CAAC,GACvB,wBAAwB,CAAC;AAyD7B,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,MAAM;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,KAAK,EAAE,SAAS,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAClD,YAAY,CAAC,EAAE,CAAC,CAAC;IACjB,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,aAAa,CAAC,EACV,CAAC,MAAM,WAAW,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,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tD,KAAK,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE;IAAE,EAAE,CAAC,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAEzD,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,mCAAmC,GAAG,QAAQ,EAAE,EACjG,EAAkB,EAClB,GAAG,SAAS,EACb,EAAE,6BAA6B,CAAC,CAAC,CAAC,+BAWlC;AA+SD,MAAM,WAAW,6BAA6B;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAED,wBAAgB,wBAAwB,CAAC,EACvC,KAAK,EACL,IAAI,EACJ,WAAW,EACX,IAAI,GACL,EAAE,6BAA6B,+BAiD/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayHeader.d.ts","sourceRoot":"","sources":["../../../src/overlayHeader/OverlayHeader.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"OverlayHeader.d.ts","sourceRoot":"","sources":["../../../src/overlayHeader/OverlayHeader.js"],"names":[],"mappings":";AAQA;;;;gCAiBC"}
|
|
@@ -4,7 +4,7 @@ type Props = LabelHTMLAttributes<HTMLHeadingElement | HTMLSpanElement | HTMLLabe
|
|
|
4
4
|
/**
|
|
5
5
|
* Default value will based one `type` prop
|
|
6
6
|
*/
|
|
7
|
-
as?: 'span' | 'label' | 'li' | Heading;
|
|
7
|
+
as?: 'span' | 'label' | 'li' | 'legend' | Heading;
|
|
8
8
|
/**
|
|
9
9
|
* Default value: {@link DEFAULT_TYPE}
|
|
10
10
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Title.d.ts","sourceRoot":"","sources":["../../../src/title/Title.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAa,MAAM,OAAO,CAAC;AAEzE,OAAO,EAAE,UAAU,EAAc,OAAO,EAAE,MAAM,WAAW,CAAC;AAY5D,KAAK,KAAK,GAAG,mBAAmB,CAAC,kBAAkB,GAAG,eAAe,GAAG,gBAAgB,CAAC,GACvF,gBAAgB,CAAC,aAAa,CAAC,GAAG;IAChC;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Title.d.ts","sourceRoot":"","sources":["../../../src/title/Title.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAa,MAAM,OAAO,CAAC;AAEzE,OAAO,EAAE,UAAU,EAAc,OAAO,EAAE,MAAM,WAAW,CAAC;AAY5D,KAAK,KAAK,GAAG,mBAAmB,CAAC,kBAAkB,GAAG,eAAe,GAAG,gBAAgB,CAAC,GACvF,gBAAgB,CAAC,aAAa,CAAC,GAAG;IAChC;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,QAAQ,GAAG,OAAO,CAAC;IAClD;;OAEG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,CAAC;AAEJ,iBAAS,KAAK,CAAC,EAAE,EAAE,EAAE,IAAmB,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,+BAUrE;AAED,eAAe,KAAK,CAAC"}
|
package/package.json
CHANGED
|
@@ -32,31 +32,13 @@ const FlowHeader = React.forwardRef(
|
|
|
32
32
|
'd-flex',
|
|
33
33
|
'flex-wrap',
|
|
34
34
|
'align-items-center',
|
|
35
|
+
'justify-content-between',
|
|
36
|
+
'flex__item--12',
|
|
35
37
|
className,
|
|
36
38
|
)}
|
|
37
39
|
>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
'flex__item--8': isVertical,
|
|
41
|
-
})}
|
|
42
|
-
>
|
|
43
|
-
{leftContent}
|
|
44
|
-
</div>
|
|
45
|
-
|
|
46
|
-
<div
|
|
47
|
-
className={classNames(
|
|
48
|
-
'align-items-center',
|
|
49
|
-
'd-flex',
|
|
50
|
-
'np-flow-header__right',
|
|
51
|
-
'justify-content-end',
|
|
52
|
-
{
|
|
53
|
-
'flex__item--4 ': isVertical,
|
|
54
|
-
'order-2': !isVertical,
|
|
55
|
-
},
|
|
56
|
-
)}
|
|
57
|
-
>
|
|
58
|
-
{rightContent}
|
|
59
|
-
</div>
|
|
40
|
+
{leftContent}
|
|
41
|
+
{rightContent}
|
|
60
42
|
<div
|
|
61
43
|
className={classNames('align-items-center', 'd-flex', 'justify-content-center', {
|
|
62
44
|
'flex__item--12': isVertical,
|
|
@@ -3,18 +3,10 @@
|
|
|
3
3
|
exports[`FlowHeader renders as expected 1`] = `
|
|
4
4
|
<div>
|
|
5
5
|
<div
|
|
6
|
-
class="np-flow-header d-flex flex-wrap align-items-center className"
|
|
6
|
+
class="np-flow-header d-flex flex-wrap align-items-center justify-content-between flex__item--12 className"
|
|
7
7
|
>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
>
|
|
11
|
-
leftContent
|
|
12
|
-
</div>
|
|
13
|
-
<div
|
|
14
|
-
class="align-items-center d-flex np-flow-header__right justify-content-end order-2"
|
|
15
|
-
>
|
|
16
|
-
rightContent
|
|
17
|
-
</div>
|
|
8
|
+
leftContent
|
|
9
|
+
rightContent
|
|
18
10
|
<div
|
|
19
11
|
class="align-items-center d-flex justify-content-center order-1 flex-grow-1"
|
|
20
12
|
>
|
|
@@ -27,18 +19,10 @@ exports[`FlowHeader renders as expected 1`] = `
|
|
|
27
19
|
exports[`FlowHeader renders as expected with vertical layout 1`] = `
|
|
28
20
|
<div>
|
|
29
21
|
<div
|
|
30
|
-
class="np-flow-header d-flex flex-wrap align-items-center className"
|
|
22
|
+
class="np-flow-header d-flex flex-wrap align-items-center justify-content-between flex__item--12 className"
|
|
31
23
|
>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
>
|
|
35
|
-
leftContent
|
|
36
|
-
</div>
|
|
37
|
-
<div
|
|
38
|
-
class="align-items-center d-flex np-flow-header__right justify-content-end flex__item--4 "
|
|
39
|
-
>
|
|
40
|
-
rightContent
|
|
41
|
-
</div>
|
|
24
|
+
leftContent
|
|
25
|
+
rightContent
|
|
42
26
|
<div
|
|
43
27
|
class="align-items-center d-flex justify-content-center flex__item--12"
|
|
44
28
|
>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.np-flow-navigation{min-height:97px;width:100%}.np-flow-navigation--border-bottom{border-bottom:1px solid #0000001a;border-bottom:1px solid var(--color-border-neutral);min-height:96px}.np-flow-navigation__content{max-width:1164px;min-width:320px;width:100%}.np-flow-navigation__stepper{padding-bottom:0!important}[dir=rtl] .np-flow-navigation__stepper{padding-right:0!important}[dir=rtl] .np-flow-navigation__stepper,html:not([dir=rtl]) .np-flow-navigation__stepper{padding-left:0!important}html:not([dir=rtl]) .np-flow-navigation__stepper{padding-right:0!important}.np-flow-navigation--xs-max .np-flow-navigation__stepper .tw-stepper-steps{display:none}.np-flow-navigation--xs-max .np-flow-navigation__stepper .progress{margin-bottom:0}.np-flow-navigation--xs-max .np-animated-label{height:auto}.np-flow-navigation--sm .np-flow-navigation__stepper{min-height:56px}[dir=rtl] .np-flow-navigation--sm .np-flow-navigation__stepper{padding-right:24px!important;padding-right:var(--size-24)!important}[dir=rtl] .np-flow-navigation--sm .np-flow-navigation__stepper,html:not([dir=rtl]) .np-flow-navigation--sm .np-flow-navigation__stepper{padding-left:24px!important;padding-left:var(--size-24)!important}html:not([dir=rtl]) .np-flow-navigation--sm .np-flow-navigation__stepper{padding-right:24px!important;padding-right:var(--size-24)!important}.np-flow-navigation--lg .np-flow-navigation__stepper{max-width:562px}.np-flow-navigation--lg .np-flow-header__left,.np-flow-navigation--lg .np-flow-header__right{width:180px}.np-flow-navigation
|
|
1
|
+
.np-flow-navigation{min-height:97px;width:100%}.np-flow-navigation--border-bottom{border-bottom:1px solid #0000001a;border-bottom:1px solid var(--color-border-neutral);min-height:96px}.np-flow-navigation__content{max-width:1164px;min-width:320px;width:100%}.np-flow-navigation__stepper{padding-bottom:0!important}[dir=rtl] .np-flow-navigation__stepper{padding-right:0!important}[dir=rtl] .np-flow-navigation__stepper,html:not([dir=rtl]) .np-flow-navigation__stepper{padding-left:0!important}html:not([dir=rtl]) .np-flow-navigation__stepper{padding-right:0!important}.np-flow-navigation--xs-max .np-flow-navigation__stepper .tw-stepper-steps{display:none}.np-flow-navigation--xs-max .np-flow-navigation__stepper .progress{margin-bottom:0}.np-flow-navigation--xs-max .np-animated-label{height:auto}.np-flow-navigation--sm .np-flow-navigation__stepper{min-height:56px}[dir=rtl] .np-flow-navigation--sm .np-flow-navigation__stepper{padding-right:24px!important;padding-right:var(--size-24)!important}[dir=rtl] .np-flow-navigation--sm .np-flow-navigation__stepper,html:not([dir=rtl]) .np-flow-navigation--sm .np-flow-navigation__stepper{padding-left:24px!important;padding-left:var(--size-24)!important}html:not([dir=rtl]) .np-flow-navigation--sm .np-flow-navigation__stepper{padding-right:24px!important;padding-right:var(--size-24)!important}.np-flow-navigation--lg .np-flow-navigation__stepper{max-width:562px}.np-flow-navigation--lg .np-flow-header__left,.np-flow-navigation--lg .np-flow-header__right{width:180px}.np-flow-navigation--hidden{visibility:hidden}.np-theme-personal--bright-green .np-flow-navigation .np-flow-header__left path,.np-theme-personal--dark .np-flow-navigation .np-flow-header__left path,.np-theme-personal--forest-green .np-flow-navigation .np-flow-header__left path{fill:var(--color-interactive-primary)}
|
|
@@ -73,7 +73,7 @@ describe('FlowNavigation', () => {
|
|
|
73
73
|
it(`renders separator if avatar and onClose are provided`, () => {
|
|
74
74
|
const { container } = render(<FlowNavigation {...props} />);
|
|
75
75
|
|
|
76
|
-
expect(container.querySelector('.
|
|
76
|
+
expect(container.querySelector('span.m-x-1')).toBeInTheDocument();
|
|
77
77
|
});
|
|
78
78
|
|
|
79
79
|
it(`doesn't render separator if avatar or onClose are not provided`, () => {
|
|
@@ -194,11 +194,11 @@ describe('FlowNavigation', () => {
|
|
|
194
194
|
<FlowNavigation {...props} activeStep={1} onGoBack={jest.fn()} />,
|
|
195
195
|
);
|
|
196
196
|
|
|
197
|
-
expect(screen.getByTestId('activeLabel-
|
|
197
|
+
expect(screen.getByTestId('activeLabel-1')).toBeInTheDocument();
|
|
198
198
|
|
|
199
199
|
rerender(<FlowNavigation {...props} activeStep={2} onGoBack={jest.fn()} />);
|
|
200
200
|
|
|
201
|
-
expect(screen.getByTestId('activeLabel-
|
|
201
|
+
expect(screen.getByTestId('activeLabel-2')).toBeInTheDocument();
|
|
202
202
|
});
|
|
203
203
|
});
|
|
204
204
|
const logoFull = () => screen.getByAltText(`logo`);
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { boolean, select, text } from '@storybook/addon-knobs';
|
|
2
2
|
import { Person as ProfileIcon, Briefcase as BriefcaseIcon } from '@transferwise/icons';
|
|
3
|
-
import { Illustration } from '@wise/art';
|
|
4
3
|
import { useState } from 'react';
|
|
5
4
|
|
|
6
5
|
import Avatar, { AvatarType } from '../avatar';
|
|
7
6
|
import AvatarWrapper from '../avatarWrapper';
|
|
7
|
+
import Body from '../body';
|
|
8
|
+
import Button from '../button';
|
|
8
9
|
import { ProfileType, Size } from '../common';
|
|
9
|
-
import Logo
|
|
10
|
+
import Logo from '../logo';
|
|
10
11
|
import OverlayHeader from '../overlayHeader';
|
|
11
12
|
|
|
12
13
|
import FlowNavigation from './FlowNavigation';
|
|
@@ -21,13 +22,18 @@ const avatarProfiles = {
|
|
|
21
22
|
Profile: <ProfileIcon />,
|
|
22
23
|
};
|
|
23
24
|
|
|
24
|
-
export const
|
|
25
|
+
export const Varients = () => {
|
|
25
26
|
const [activeStep, setActiveStep] = useState(4);
|
|
26
27
|
const [closed, setClosed] = useState(false);
|
|
27
28
|
const showAvatar = select('avatar', Object.keys(avatarProfiles), 'Profile');
|
|
28
29
|
const showCloseButton = boolean('show closeButton', true);
|
|
29
30
|
const showMobileBackButton = boolean('show mobile backButton', true);
|
|
30
31
|
const done = boolean('done', false);
|
|
32
|
+
const profileType = select('profileType', Object.keys(ProfileType));
|
|
33
|
+
const avatarURL = text(
|
|
34
|
+
'avatarURL',
|
|
35
|
+
'https://wise.design/api/images/Logo-LogoFastFlagAvatar.webp',
|
|
36
|
+
);
|
|
31
37
|
|
|
32
38
|
return !closed ? (
|
|
33
39
|
<>
|
|
@@ -82,60 +88,8 @@ export const WithAvatarIcon = () => {
|
|
|
82
88
|
/>
|
|
83
89
|
|
|
84
90
|
<FlowNavigation
|
|
85
|
-
avatar={
|
|
86
|
-
!showAvatar ? null : (
|
|
87
|
-
<Avatar type={AvatarType.ICON} size={Size.MEDIUM}>
|
|
88
|
-
{avatarProfiles[showAvatar]}
|
|
89
|
-
</Avatar>
|
|
90
|
-
)
|
|
91
|
-
}
|
|
92
|
-
logo={<Logo type={LogoType.WISE_BUSINESS} />}
|
|
93
|
-
activeStep={activeStep}
|
|
94
91
|
done={done}
|
|
95
|
-
steps={[
|
|
96
|
-
{
|
|
97
|
-
label: 'Amount',
|
|
98
|
-
hoverLabel: (
|
|
99
|
-
<>
|
|
100
|
-
<div>
|
|
101
|
-
<strong>100 GBP</strong>
|
|
102
|
-
</div>
|
|
103
|
-
0.2351 ETH
|
|
104
|
-
</>
|
|
105
|
-
),
|
|
106
|
-
onClick: () => setActiveStep(0),
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
label: 'You',
|
|
110
|
-
hoverLabel: (
|
|
111
|
-
<>
|
|
112
|
-
<div>
|
|
113
|
-
<strong>Elena Durante</strong>
|
|
114
|
-
</div>
|
|
115
|
-
elenadurante@test.com
|
|
116
|
-
</>
|
|
117
|
-
),
|
|
118
|
-
onClick: () => setActiveStep(1),
|
|
119
|
-
},
|
|
120
|
-
{ label: 'Recipient', hoverLabel: 'Daniele Tomboro', onClick: () => setActiveStep(2) },
|
|
121
|
-
{ label: 'Review', hoverLabel: 'Antonio Dozortevo', onClick: () => setActiveStep(3) },
|
|
122
|
-
{
|
|
123
|
-
label: 'Pay',
|
|
124
|
-
hoverLabel: 'Enrico Gusso II',
|
|
125
|
-
onClick: () => setActiveStep(4),
|
|
126
|
-
},
|
|
127
|
-
]}
|
|
128
|
-
onClose={showCloseButton && (() => setClosed(true))}
|
|
129
|
-
onGoBack={
|
|
130
|
-
showMobileBackButton && (() => setActiveStep(activeStep > 0 ? activeStep - 1 : 0))
|
|
131
|
-
}
|
|
132
|
-
/>
|
|
133
|
-
|
|
134
|
-
<FlowNavigation
|
|
135
|
-
avatar={false}
|
|
136
|
-
logo={<Logo />}
|
|
137
92
|
activeStep={activeStep}
|
|
138
|
-
done={done}
|
|
139
93
|
steps={[
|
|
140
94
|
{
|
|
141
95
|
label: 'Amount',
|
|
@@ -171,15 +125,14 @@ export const WithAvatarIcon = () => {
|
|
|
171
125
|
]}
|
|
172
126
|
onClose={showCloseButton && (() => setClosed(true))}
|
|
173
127
|
onGoBack={
|
|
174
|
-
showMobileBackButton && (() => setActiveStep(activeStep > 0 ? activeStep - 1 : 0))
|
|
128
|
+
showMobileBackButton && (() => setActiveStep(activeStep - 1 > 0 ? activeStep - 1 : 0))
|
|
175
129
|
}
|
|
176
130
|
/>
|
|
177
131
|
|
|
178
132
|
<FlowNavigation
|
|
179
|
-
avatar={false}
|
|
180
|
-
logo={<Logo type={LogoType.WISE_BUSINESS} />}
|
|
181
|
-
activeStep={activeStep}
|
|
182
133
|
done={done}
|
|
134
|
+
avatar={<AvatarWrapper url={avatarURL} profileType={profileType} />}
|
|
135
|
+
activeStep={activeStep}
|
|
183
136
|
steps={[
|
|
184
137
|
{
|
|
185
138
|
label: 'Amount',
|
|
@@ -215,140 +168,20 @@ export const WithAvatarIcon = () => {
|
|
|
215
168
|
]}
|
|
216
169
|
onClose={showCloseButton && (() => setClosed(true))}
|
|
217
170
|
onGoBack={
|
|
218
|
-
showMobileBackButton && (() => setActiveStep(activeStep > 0 ? activeStep - 1 : 0))
|
|
171
|
+
showMobileBackButton && (() => setActiveStep(activeStep - 1 > 0 ? activeStep - 1 : 0))
|
|
219
172
|
}
|
|
220
173
|
/>
|
|
221
|
-
<div
|
|
222
|
-
className="bg--dark"
|
|
223
|
-
style={{
|
|
224
|
-
textAlign: 'center',
|
|
225
|
-
width: '538px',
|
|
226
|
-
height: '30px',
|
|
227
|
-
margin: '24px auto',
|
|
228
|
-
color: 'white',
|
|
229
|
-
}}
|
|
230
|
-
>
|
|
231
|
-
Content to test that the flow nav is centred
|
|
232
|
-
</div>
|
|
233
|
-
</>
|
|
234
|
-
) : null;
|
|
235
|
-
};
|
|
236
174
|
|
|
237
|
-
|
|
238
|
-
const [activeStep, setActiveStep] = useState(4);
|
|
239
|
-
const [closed, setClosed] = useState(false);
|
|
240
|
-
const showAvatar = boolean('show avatar', true);
|
|
241
|
-
const showCloseButton = boolean('show closeButton', true);
|
|
242
|
-
const showMobileBackButton = boolean('show mobile backButton', true);
|
|
243
|
-
const done = boolean('done', false);
|
|
175
|
+
<Body className="text-xs-center m-a-3">Content to test that the flow nav is centred</Body>
|
|
244
176
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
)
|
|
254
|
-
}
|
|
255
|
-
activeStep={activeStep}
|
|
256
|
-
steps={[
|
|
257
|
-
{
|
|
258
|
-
label: 'Amount',
|
|
259
|
-
hoverLabel: (
|
|
260
|
-
<>
|
|
261
|
-
<div>
|
|
262
|
-
<strong>100 GBP</strong>
|
|
263
|
-
</div>
|
|
264
|
-
0.2351 ETH
|
|
265
|
-
</>
|
|
266
|
-
),
|
|
267
|
-
onClick: () => setActiveStep(0),
|
|
268
|
-
},
|
|
269
|
-
{
|
|
270
|
-
label: 'You',
|
|
271
|
-
hoverLabel: (
|
|
272
|
-
<>
|
|
273
|
-
<div>
|
|
274
|
-
<strong>Elena Durante</strong>
|
|
275
|
-
</div>
|
|
276
|
-
elenadurante@test.com
|
|
277
|
-
</>
|
|
278
|
-
),
|
|
279
|
-
onClick: () => setActiveStep(1),
|
|
280
|
-
},
|
|
281
|
-
{ label: 'Recipient', hoverLabel: 'Daniele Tomboro', onClick: () => setActiveStep(2) },
|
|
282
|
-
{ label: 'Review', hoverLabel: 'Antonio Dozortevo', onClick: () => setActiveStep(3) },
|
|
283
|
-
{
|
|
284
|
-
label: 'Pay',
|
|
285
|
-
hoverLabel: 'Enrico Gusso II',
|
|
286
|
-
onClick: () => setActiveStep(4),
|
|
287
|
-
},
|
|
288
|
-
]}
|
|
289
|
-
onClose={showCloseButton && (() => setClosed(true))}
|
|
290
|
-
onGoBack={
|
|
291
|
-
showMobileBackButton && (() => setActiveStep(activeStep - 1 > 0 ? activeStep - 1 : 0))
|
|
292
|
-
}
|
|
293
|
-
/>
|
|
294
|
-
) : null;
|
|
295
|
-
};
|
|
296
|
-
|
|
297
|
-
export const WithAvatarWrapper = () => {
|
|
298
|
-
const [activeStep, setActiveStep] = useState(4);
|
|
299
|
-
const [closed, setClosed] = useState(false);
|
|
300
|
-
const profileType = select('profileType', Object.keys(ProfileType));
|
|
301
|
-
const showCloseButton = boolean('show closeButton', true);
|
|
302
|
-
const showMobileBackButton = boolean('show mobile backButton', true);
|
|
303
|
-
const avatarURL = text(
|
|
304
|
-
'avatarURL',
|
|
305
|
-
'https://wise.design/api/images/Logo-LogoFastFlagAvatar.webp',
|
|
306
|
-
);
|
|
307
|
-
const done = boolean('done', false);
|
|
308
|
-
|
|
309
|
-
return !closed ? (
|
|
310
|
-
<FlowNavigation
|
|
311
|
-
done={done}
|
|
312
|
-
avatar={<AvatarWrapper url={avatarURL} profileType={profileType} />}
|
|
313
|
-
activeStep={activeStep}
|
|
314
|
-
steps={[
|
|
315
|
-
{
|
|
316
|
-
label: 'Amount',
|
|
317
|
-
hoverLabel: (
|
|
318
|
-
<>
|
|
319
|
-
<div>
|
|
320
|
-
<strong>100 GBP</strong>
|
|
321
|
-
</div>
|
|
322
|
-
0.2351 ETH
|
|
323
|
-
</>
|
|
324
|
-
),
|
|
325
|
-
onClick: () => setActiveStep(0),
|
|
326
|
-
},
|
|
327
|
-
{
|
|
328
|
-
label: 'You',
|
|
329
|
-
hoverLabel: (
|
|
330
|
-
<>
|
|
331
|
-
<div>
|
|
332
|
-
<strong>Elena Durante</strong>
|
|
333
|
-
</div>
|
|
334
|
-
elenadurante@test.com
|
|
335
|
-
</>
|
|
336
|
-
),
|
|
337
|
-
onClick: () => setActiveStep(1),
|
|
338
|
-
},
|
|
339
|
-
{ label: 'Recipient', hoverLabel: 'Daniele Tomboro', onClick: () => setActiveStep(2) },
|
|
340
|
-
{ label: 'Review', hoverLabel: 'Antonio Dozortevo', onClick: () => setActiveStep(3) },
|
|
341
|
-
{
|
|
342
|
-
label: 'Pay',
|
|
343
|
-
hoverLabel: 'Enrico Gusso II',
|
|
344
|
-
onClick: () => setActiveStep(4),
|
|
345
|
-
},
|
|
346
|
-
]}
|
|
347
|
-
onClose={showCloseButton && (() => setClosed(true))}
|
|
348
|
-
onGoBack={
|
|
349
|
-
showMobileBackButton && (() => setActiveStep(activeStep - 1 > 0 ? activeStep - 1 : 0))
|
|
350
|
-
}
|
|
351
|
-
/>
|
|
177
|
+
<Button
|
|
178
|
+
className="m-t-2"
|
|
179
|
+
disabled={activeStep === 4}
|
|
180
|
+
onClick={() => setActiveStep(activeStep + 1)}
|
|
181
|
+
>
|
|
182
|
+
Next Step
|
|
183
|
+
</Button>
|
|
184
|
+
</>
|
|
352
185
|
) : null;
|
|
353
186
|
};
|
|
354
187
|
|
|
@@ -42,31 +42,11 @@ const FlowNavigation = ({
|
|
|
42
42
|
const [clientWidth] = useClientWidth({ ref: reference });
|
|
43
43
|
const closeButton = onClose != null && <CloseButton size="lg" onClick={onClose} />;
|
|
44
44
|
const isSmall = clientWidth != null && clientWidth < Breakpoint.SMALL;
|
|
45
|
+
const isLarge = clientWidth != null && clientWidth >= Breakpoint.LARGE;
|
|
45
46
|
|
|
46
47
|
const newAvatar = done ? null : avatar;
|
|
47
48
|
|
|
48
|
-
const
|
|
49
|
-
const displayGoBack = onGoBack != null && activeStep > 0;
|
|
50
|
-
return (
|
|
51
|
-
<>
|
|
52
|
-
{displayGoBack ? (
|
|
53
|
-
<BackButton
|
|
54
|
-
label={
|
|
55
|
-
<AnimatedLabel
|
|
56
|
-
className="m-x-1"
|
|
57
|
-
labels={steps.map((step) => step.label)}
|
|
58
|
-
activeLabel={activeStep - 1}
|
|
59
|
-
aria-label={intl.formatMessage(messages.back)}
|
|
60
|
-
/>
|
|
61
|
-
}
|
|
62
|
-
onClick={onGoBack}
|
|
63
|
-
/>
|
|
64
|
-
) : (
|
|
65
|
-
logo
|
|
66
|
-
)}
|
|
67
|
-
</>
|
|
68
|
-
);
|
|
69
|
-
};
|
|
49
|
+
const displayGoBack = onGoBack != null && activeStep > 0;
|
|
70
50
|
|
|
71
51
|
return (
|
|
72
52
|
<div
|
|
@@ -82,15 +62,30 @@ const FlowNavigation = ({
|
|
|
82
62
|
'np-flow-navigation--xs-max': isSmall,
|
|
83
63
|
// Size switches on parent container which may or may not have the same size as the window.
|
|
84
64
|
'np-flow-navigation--sm': clientWidth != null && clientWidth >= Breakpoint.SMALL,
|
|
85
|
-
'np-flow-navigation--lg':
|
|
65
|
+
'np-flow-navigation--lg': isLarge,
|
|
86
66
|
})}
|
|
87
|
-
leftContent={
|
|
88
|
-
rightContent={
|
|
67
|
+
leftContent={
|
|
89
68
|
<>
|
|
69
|
+
{isSmall && displayGoBack ? (
|
|
70
|
+
<BackButton aria-label={intl.formatMessage(messages.back)} onClick={onGoBack} />
|
|
71
|
+
) : (
|
|
72
|
+
logo
|
|
73
|
+
)}
|
|
74
|
+
{isSmall && (
|
|
75
|
+
<AnimatedLabel
|
|
76
|
+
className="m-x-1"
|
|
77
|
+
labels={steps.map((step) => step.label)}
|
|
78
|
+
activeLabel={activeStep}
|
|
79
|
+
/>
|
|
80
|
+
)}
|
|
81
|
+
</>
|
|
82
|
+
}
|
|
83
|
+
rightContent={
|
|
84
|
+
<div className={classNames('d-flex', 'align-items-center', { 'order-2': isLarge })}>
|
|
90
85
|
{newAvatar}
|
|
91
|
-
{newAvatar && closeButton && <span className="
|
|
86
|
+
{newAvatar && closeButton && <span className="m-x-1" />}
|
|
92
87
|
{closeButton}
|
|
93
|
-
|
|
88
|
+
</div>
|
|
94
89
|
}
|
|
95
90
|
bottomContent={
|
|
96
91
|
!done && (
|