@transferwise/components 0.0.0-experimental-c91775b → 0.0.0-experimental-09b5867
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/flowNavigation/FlowNavigation.js +55 -41
- package/build/flowNavigation/FlowNavigation.js.map +1 -1
- package/build/flowNavigation/FlowNavigation.mjs +55 -41
- package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
- package/build/main.css +19 -2
- package/build/overlayHeader/OverlayHeader.js +3 -0
- package/build/overlayHeader/OverlayHeader.js.map +1 -1
- package/build/overlayHeader/OverlayHeader.mjs +3 -0
- package/build/overlayHeader/OverlayHeader.mjs.map +1 -1
- package/build/styles/flowNavigation/FlowNavigation.css +16 -2
- package/build/styles/main.css +19 -2
- package/build/types/flowNavigation/FlowNavigation.d.ts +15 -2
- package/build/types/flowNavigation/FlowNavigation.d.ts.map +1 -1
- package/build/types/overlayHeader/OverlayHeader.d.ts +6 -0
- package/build/types/overlayHeader/OverlayHeader.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/flowNavigation/FlowNavigation.css +16 -2
- package/src/flowNavigation/FlowNavigation.less +20 -4
- package/src/flowNavigation/FlowNavigation.story.tsx +240 -0
- package/src/flowNavigation/FlowNavigation.tsx +90 -54
- package/src/main.css +19 -2
- package/src/overlayHeader/OverlayHeader.story.tsx +4 -0
- package/src/overlayHeader/OverlayHeader.tsx +6 -0
- package/src/flowNavigation/FlowNavigation.test.js +0 -190
|
@@ -30,20 +30,24 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
30
30
|
var FlowHeader = require('../common/flowHeader/FlowHeader.js');
|
|
31
31
|
var Logo = require('../logo/Logo.js');
|
|
32
32
|
var Stepper = require('../stepper/Stepper.js');
|
|
33
|
+
var Container = require('../container/Container.js');
|
|
33
34
|
var useScreenSize = require('../common/hooks/useScreenSize.js');
|
|
34
35
|
var FlowNavigation_messages = require('./FlowNavigation.messages.js');
|
|
35
36
|
var AnimatedLabel = require('./animatedLabel/AnimatedLabel.js');
|
|
36
37
|
var IconButton = require('../iconButton/IconButton.js');
|
|
37
38
|
var icons = require('@transferwise/icons');
|
|
38
39
|
|
|
40
|
+
const defaultLogo = /*#__PURE__*/jsxRuntime.jsx(Logo.default, {});
|
|
39
41
|
const FlowNavigation = ({
|
|
40
42
|
activeStep = 0,
|
|
41
43
|
avatar,
|
|
42
|
-
logo =
|
|
44
|
+
logo = defaultLogo,
|
|
43
45
|
done = false,
|
|
44
46
|
onClose,
|
|
45
47
|
onGoBack,
|
|
46
|
-
steps
|
|
48
|
+
steps,
|
|
49
|
+
composable = false,
|
|
50
|
+
showBottomBorder = true
|
|
47
51
|
}) => {
|
|
48
52
|
const intl = reactIntl.useIntl();
|
|
49
53
|
const closeButton = onClose != null && /*#__PURE__*/jsxRuntime.jsx(CloseButton.CloseButton, {
|
|
@@ -54,47 +58,57 @@ const FlowNavigation = ({
|
|
|
54
58
|
const screenLg = useScreenSize.useScreenSize(neptuneTokens.Breakpoint.LARGE);
|
|
55
59
|
const newAvatar = done ? null : avatar;
|
|
56
60
|
const displayGoBack = onGoBack != null && activeStep > 0;
|
|
57
|
-
|
|
58
|
-
className: clsx.clsx('np-flow-
|
|
59
|
-
'np-flow-navigation--
|
|
61
|
+
const flowHeaderContent = /*#__PURE__*/jsxRuntime.jsx(FlowHeader.default, {
|
|
62
|
+
className: clsx.clsx('np-flow-navigation__content', !composable && 'p-x-3', screenSm == null ? 'np-flow-navigation--hidden' : {
|
|
63
|
+
'np-flow-navigation--xs-max': !screenSm,
|
|
64
|
+
// Size switches on parent container which may or may not have the same size as the window.
|
|
65
|
+
'np-flow-navigation--sm': screenSm,
|
|
66
|
+
'np-flow-navigation--lg': screenLg
|
|
60
67
|
}),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
onClick: onGoBack,
|
|
75
|
-
children: /*#__PURE__*/jsxRuntime.jsx(icons.ArrowLeft, {})
|
|
76
|
-
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
77
|
-
className: "np-flow-header__left",
|
|
78
|
-
children: logo
|
|
79
|
-
}), !screenSm && !done && /*#__PURE__*/jsxRuntime.jsx(AnimatedLabel.default, {
|
|
80
|
-
className: "m-x-1",
|
|
81
|
-
steps: steps,
|
|
82
|
-
activeLabel: activeStep
|
|
83
|
-
})]
|
|
84
|
-
}),
|
|
85
|
-
rightContent: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
86
|
-
className: "np-flow-header__right d-flex align-items-center justify-content-end order-2--lg",
|
|
87
|
-
children: [newAvatar, newAvatar && closeButton && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
88
|
-
className: "m-x-1"
|
|
89
|
-
}), closeButton]
|
|
90
|
-
}),
|
|
91
|
-
bottomContent: !done && steps.length > 0 ? /*#__PURE__*/jsxRuntime.jsx(Stepper.default, {
|
|
92
|
-
activeStep: activeStep,
|
|
68
|
+
leftContent: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
69
|
+
children: [!screenSm && displayGoBack ? /*#__PURE__*/jsxRuntime.jsx(IconButton.default, {
|
|
70
|
+
size: 40,
|
|
71
|
+
priority: "tertiary",
|
|
72
|
+
type: "default",
|
|
73
|
+
"aria-label": intl.formatMessage(FlowNavigation_messages.default.back),
|
|
74
|
+
onClick: onGoBack,
|
|
75
|
+
children: /*#__PURE__*/jsxRuntime.jsx(icons.ArrowLeft, {})
|
|
76
|
+
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
77
|
+
className: "np-flow-header__left",
|
|
78
|
+
children: logo
|
|
79
|
+
}), !screenSm && !done && /*#__PURE__*/jsxRuntime.jsx(AnimatedLabel.default, {
|
|
80
|
+
className: "m-x-1",
|
|
93
81
|
steps: steps,
|
|
94
|
-
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
|
|
82
|
+
activeLabel: activeStep
|
|
83
|
+
})]
|
|
84
|
+
}),
|
|
85
|
+
rightContent: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
86
|
+
className: "np-flow-header__right d-flex align-items-center justify-content-end order-2--lg",
|
|
87
|
+
children: [newAvatar, newAvatar && closeButton && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
88
|
+
className: "m-x-1"
|
|
89
|
+
}), closeButton]
|
|
90
|
+
}),
|
|
91
|
+
bottomContent: !done && steps.length > 0 ? /*#__PURE__*/jsxRuntime.jsx(Stepper.default, {
|
|
92
|
+
activeStep: activeStep,
|
|
93
|
+
steps: steps,
|
|
94
|
+
className: clsx.clsx('np-flow-navigation__stepper')
|
|
95
|
+
}) : null,
|
|
96
|
+
layout: !screenLg ? layouts.Layout.VERTICAL : layouts.Layout.HORIZONTAL
|
|
97
|
+
});
|
|
98
|
+
if (composable) {
|
|
99
|
+
return /*#__PURE__*/jsxRuntime.jsx(Container.default, {
|
|
100
|
+
size: "fluid",
|
|
101
|
+
className: clsx.clsx('np-flow-navigation np-flow-navigation--composable', {
|
|
102
|
+
'np-flow-navigation--border-bottom': showBottomBorder
|
|
103
|
+
}),
|
|
104
|
+
children: flowHeaderContent
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
108
|
+
className: clsx.clsx('np-flow-navigation p-y-3', {
|
|
109
|
+
'np-flow-navigation--border-bottom': showBottomBorder && !done
|
|
110
|
+
}),
|
|
111
|
+
children: flowHeaderContent
|
|
98
112
|
});
|
|
99
113
|
};
|
|
100
114
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlowNavigation.js","sources":["../../src/flowNavigation/FlowNavigation.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\nimport { Breakpoint } from '@transferwise/neptune-tokens';\n\nimport { Layout } from '../common';\nimport { CloseButton } from '../common/closeButton';\nimport FlowHeader from '../common/flowHeader/FlowHeader';\nimport Logo from '../logo';\nimport Stepper, { type Step } from '../stepper/Stepper';\n\nimport { useScreenSize } from '../common/hooks/useScreenSize';\nimport messages from './FlowNavigation.messages';\nimport AnimatedLabel from './animatedLabel';\nimport IconButton from '../iconButton';\nimport { ArrowLeft } from '@transferwise/icons';\n\nexport interface FlowNavigationProps {\n /** @default 0 */\n activeStep?: number;\n avatar?: React.ReactNode;\n /** @default <Logo /> */\n logo?: React.ReactNode;\n /** @default false */\n done?: boolean;\n /** Called when the close button is clicked. If not provided the close button won't show */\n onClose?: () => void;\n /** Called when the back button is clicked. If not provided the back button won't show. The back button only shows on small screens */\n onGoBack?: () => void;\n /** Steps to be displayed in stepper.
|
|
1
|
+
{"version":3,"file":"FlowNavigation.js","sources":["../../src/flowNavigation/FlowNavigation.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\nimport { Breakpoint } from '@transferwise/neptune-tokens';\n\nimport { Layout } from '../common';\nimport { CloseButton } from '../common/closeButton';\nimport FlowHeader from '../common/flowHeader/FlowHeader';\nimport Logo from '../logo';\nimport Stepper, { type Step } from '../stepper/Stepper';\nimport Container from '../container';\n\nimport { useScreenSize } from '../common/hooks/useScreenSize';\nimport messages from './FlowNavigation.messages';\nimport AnimatedLabel from './animatedLabel';\nimport IconButton from '../iconButton';\nimport { ArrowLeft } from '@transferwise/icons';\n\nconst defaultLogo = <Logo />;\n\nexport interface FlowNavigationProps {\n /** @default 0 */\n activeStep?: number;\n avatar?: React.ReactNode;\n /** @default <Logo /> */\n logo?: React.ReactNode;\n /** @default false */\n done?: boolean;\n /** Called when the close button is clicked. If not provided the close button won't show */\n onClose?: () => void;\n /** Called when the back button is clicked. If not provided the back button won't show. The back button only shows on small screens */\n onGoBack?: () => void;\n /** Steps to be displayed in stepper. Pass an empty array to hide the stepper. */\n steps: readonly Step[];\n /**\n * When true, renders in composable mode using a fluid Container.\n * This allows the FlowNavigation to be used within custom layout containers.\n * @default false\n */\n composable?: boolean;\n /**\n * Controls whether the bottom border is displayed.\n * - Non-composable variant: When true (default), shows border based on done state (!done). When false, always hides.\n * - Composable variant: Directly controls border visibility, ignoring done state.\n * @default true\n */\n showBottomBorder?: boolean;\n}\n\nconst FlowNavigation = ({\n activeStep = 0,\n avatar,\n logo = defaultLogo,\n done = false,\n onClose,\n onGoBack,\n steps,\n composable = false,\n showBottomBorder = true,\n}: FlowNavigationProps) => {\n const intl = useIntl();\n\n const closeButton = onClose != null && <CloseButton size=\"lg\" onClick={onClose} />;\n\n const screenSm = useScreenSize(Breakpoint.SMALL);\n const screenLg = useScreenSize(Breakpoint.LARGE);\n\n const newAvatar = done ? null : avatar;\n\n const displayGoBack = onGoBack != null && activeStep > 0;\n\n const flowHeaderContent = (\n <FlowHeader\n className={clsx(\n 'np-flow-navigation__content',\n !composable && 'p-x-3',\n screenSm == null\n ? 'np-flow-navigation--hidden'\n : {\n 'np-flow-navigation--xs-max': !screenSm,\n // Size switches on parent container which may or may not have the same size as the window.\n 'np-flow-navigation--sm': screenSm,\n 'np-flow-navigation--lg': screenLg,\n },\n )}\n leftContent={\n <>\n {!screenSm && displayGoBack ? (\n <IconButton\n size={40}\n priority=\"tertiary\"\n type=\"default\"\n aria-label={intl.formatMessage(messages.back)}\n onClick={onGoBack}\n >\n <ArrowLeft />\n </IconButton>\n ) : (\n <div className=\"np-flow-header__left\">{logo}</div>\n )}\n {!screenSm && !done && (\n <AnimatedLabel className=\"m-x-1\" steps={steps} activeLabel={activeStep} />\n )}\n </>\n }\n rightContent={\n <div className=\"np-flow-header__right d-flex align-items-center justify-content-end order-2--lg\">\n {newAvatar}\n {newAvatar && closeButton && <span className=\"m-x-1\" />}\n {closeButton}\n </div>\n }\n bottomContent={\n !done && steps.length > 0 ? (\n <Stepper\n activeStep={activeStep}\n steps={steps}\n className={clsx('np-flow-navigation__stepper')}\n />\n ) : null\n }\n layout={!screenLg ? Layout.VERTICAL : Layout.HORIZONTAL}\n />\n );\n\n if (composable) {\n return (\n <Container\n size=\"fluid\"\n className={clsx('np-flow-navigation np-flow-navigation--composable', {\n 'np-flow-navigation--border-bottom': showBottomBorder,\n })}\n >\n {flowHeaderContent}\n </Container>\n );\n }\n\n return (\n <div\n className={clsx('np-flow-navigation p-y-3', {\n 'np-flow-navigation--border-bottom': showBottomBorder && !done,\n })}\n >\n {flowHeaderContent}\n </div>\n );\n};\n\nexport default FlowNavigation;\n"],"names":["defaultLogo","_jsx","Logo","FlowNavigation","activeStep","avatar","logo","done","onClose","onGoBack","steps","composable","showBottomBorder","intl","useIntl","closeButton","CloseButton","size","onClick","screenSm","useScreenSize","Breakpoint","SMALL","screenLg","LARGE","newAvatar","displayGoBack","flowHeaderContent","FlowHeader","className","clsx","leftContent","_jsxs","_Fragment","children","IconButton","priority","type","formatMessage","messages","back","ArrowLeft","AnimatedLabel","activeLabel","rightContent","bottomContent","length","Stepper","layout","Layout","VERTICAL","HORIZONTAL","Container"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAMA,WAAW,gBAAGC,cAAA,CAACC,YAAI,KAAG;AA+B5B,MAAMC,cAAc,GAAGA,CAAC;AACtBC,EAAAA,UAAU,GAAG,CAAC;EACdC,MAAM;AACNC,EAAAA,IAAI,GAAGN,WAAW;AAClBO,EAAAA,IAAI,GAAG,KAAK;EACZC,OAAO;EACPC,QAAQ;EACRC,KAAK;AACLC,EAAAA,UAAU,GAAG,KAAK;AAClBC,EAAAA,gBAAgB,GAAG;AAAI,CACH,KAAI;AACxB,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE;EAEtB,MAAMC,WAAW,GAAGP,OAAO,IAAI,IAAI,iBAAIP,cAAA,CAACe,uBAAW,EAAA;AAACC,IAAAA,IAAI,EAAC,IAAI;AAACC,IAAAA,OAAO,EAAEV;AAAQ,IAAG;AAElF,EAAA,MAAMW,QAAQ,GAAGC,2BAAa,C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|
|
27
27
|
import Logo from '../logo/Logo.mjs';
|
|
28
28
|
import Stepper from '../stepper/Stepper.mjs';
|
|
29
|
+
import Container from '../container/Container.mjs';
|
|
29
30
|
import { useScreenSize } from '../common/hooks/useScreenSize.mjs';
|
|
30
31
|
import messages from './FlowNavigation.messages.mjs';
|
|
31
32
|
import AnimatedLabel from './animatedLabel/AnimatedLabel.mjs';
|
|
32
33
|
import IconButton from '../iconButton/IconButton.mjs';
|
|
33
34
|
import { ArrowLeft } from '@transferwise/icons';
|
|
34
35
|
|
|
36
|
+
const defaultLogo = /*#__PURE__*/jsx(Logo, {});
|
|
35
37
|
const FlowNavigation = ({
|
|
36
38
|
activeStep = 0,
|
|
37
39
|
avatar,
|
|
38
|
-
logo =
|
|
40
|
+
logo = defaultLogo,
|
|
39
41
|
done = false,
|
|
40
42
|
onClose,
|
|
41
43
|
onGoBack,
|
|
42
|
-
steps
|
|
44
|
+
steps,
|
|
45
|
+
composable = false,
|
|
46
|
+
showBottomBorder = true
|
|
43
47
|
}) => {
|
|
44
48
|
const intl = useIntl();
|
|
45
49
|
const closeButton = onClose != null && /*#__PURE__*/jsx(CloseButton, {
|
|
@@ -50,47 +54,57 @@ const FlowNavigation = ({
|
|
|
50
54
|
const screenLg = useScreenSize(Breakpoint.LARGE);
|
|
51
55
|
const newAvatar = done ? null : avatar;
|
|
52
56
|
const displayGoBack = onGoBack != null && activeStep > 0;
|
|
53
|
-
|
|
54
|
-
className: clsx('np-flow-
|
|
55
|
-
'np-flow-navigation--
|
|
57
|
+
const flowHeaderContent = /*#__PURE__*/jsx(FlowHeader, {
|
|
58
|
+
className: clsx('np-flow-navigation__content', !composable && 'p-x-3', screenSm == null ? 'np-flow-navigation--hidden' : {
|
|
59
|
+
'np-flow-navigation--xs-max': !screenSm,
|
|
60
|
+
// Size switches on parent container which may or may not have the same size as the window.
|
|
61
|
+
'np-flow-navigation--sm': screenSm,
|
|
62
|
+
'np-flow-navigation--lg': screenLg
|
|
56
63
|
}),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
onClick: onGoBack,
|
|
71
|
-
children: /*#__PURE__*/jsx(ArrowLeft, {})
|
|
72
|
-
}) : /*#__PURE__*/jsx("div", {
|
|
73
|
-
className: "np-flow-header__left",
|
|
74
|
-
children: logo
|
|
75
|
-
}), !screenSm && !done && /*#__PURE__*/jsx(AnimatedLabel, {
|
|
76
|
-
className: "m-x-1",
|
|
77
|
-
steps: steps,
|
|
78
|
-
activeLabel: activeStep
|
|
79
|
-
})]
|
|
80
|
-
}),
|
|
81
|
-
rightContent: /*#__PURE__*/jsxs("div", {
|
|
82
|
-
className: "np-flow-header__right d-flex align-items-center justify-content-end order-2--lg",
|
|
83
|
-
children: [newAvatar, newAvatar && closeButton && /*#__PURE__*/jsx("span", {
|
|
84
|
-
className: "m-x-1"
|
|
85
|
-
}), closeButton]
|
|
86
|
-
}),
|
|
87
|
-
bottomContent: !done && steps.length > 0 ? /*#__PURE__*/jsx(Stepper, {
|
|
88
|
-
activeStep: activeStep,
|
|
64
|
+
leftContent: /*#__PURE__*/jsxs(Fragment, {
|
|
65
|
+
children: [!screenSm && displayGoBack ? /*#__PURE__*/jsx(IconButton, {
|
|
66
|
+
size: 40,
|
|
67
|
+
priority: "tertiary",
|
|
68
|
+
type: "default",
|
|
69
|
+
"aria-label": intl.formatMessage(messages.back),
|
|
70
|
+
onClick: onGoBack,
|
|
71
|
+
children: /*#__PURE__*/jsx(ArrowLeft, {})
|
|
72
|
+
}) : /*#__PURE__*/jsx("div", {
|
|
73
|
+
className: "np-flow-header__left",
|
|
74
|
+
children: logo
|
|
75
|
+
}), !screenSm && !done && /*#__PURE__*/jsx(AnimatedLabel, {
|
|
76
|
+
className: "m-x-1",
|
|
89
77
|
steps: steps,
|
|
90
|
-
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
|
|
78
|
+
activeLabel: activeStep
|
|
79
|
+
})]
|
|
80
|
+
}),
|
|
81
|
+
rightContent: /*#__PURE__*/jsxs("div", {
|
|
82
|
+
className: "np-flow-header__right d-flex align-items-center justify-content-end order-2--lg",
|
|
83
|
+
children: [newAvatar, newAvatar && closeButton && /*#__PURE__*/jsx("span", {
|
|
84
|
+
className: "m-x-1"
|
|
85
|
+
}), closeButton]
|
|
86
|
+
}),
|
|
87
|
+
bottomContent: !done && steps.length > 0 ? /*#__PURE__*/jsx(Stepper, {
|
|
88
|
+
activeStep: activeStep,
|
|
89
|
+
steps: steps,
|
|
90
|
+
className: clsx('np-flow-navigation__stepper')
|
|
91
|
+
}) : null,
|
|
92
|
+
layout: !screenLg ? Layout.VERTICAL : Layout.HORIZONTAL
|
|
93
|
+
});
|
|
94
|
+
if (composable) {
|
|
95
|
+
return /*#__PURE__*/jsx(Container, {
|
|
96
|
+
size: "fluid",
|
|
97
|
+
className: clsx('np-flow-navigation np-flow-navigation--composable', {
|
|
98
|
+
'np-flow-navigation--border-bottom': showBottomBorder
|
|
99
|
+
}),
|
|
100
|
+
children: flowHeaderContent
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
return /*#__PURE__*/jsx("div", {
|
|
104
|
+
className: clsx('np-flow-navigation p-y-3', {
|
|
105
|
+
'np-flow-navigation--border-bottom': showBottomBorder && !done
|
|
106
|
+
}),
|
|
107
|
+
children: flowHeaderContent
|
|
94
108
|
});
|
|
95
109
|
};
|
|
96
110
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlowNavigation.mjs","sources":["../../src/flowNavigation/FlowNavigation.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\nimport { Breakpoint } from '@transferwise/neptune-tokens';\n\nimport { Layout } from '../common';\nimport { CloseButton } from '../common/closeButton';\nimport FlowHeader from '../common/flowHeader/FlowHeader';\nimport Logo from '../logo';\nimport Stepper, { type Step } from '../stepper/Stepper';\n\nimport { useScreenSize } from '../common/hooks/useScreenSize';\nimport messages from './FlowNavigation.messages';\nimport AnimatedLabel from './animatedLabel';\nimport IconButton from '../iconButton';\nimport { ArrowLeft } from '@transferwise/icons';\n\nexport interface FlowNavigationProps {\n /** @default 0 */\n activeStep?: number;\n avatar?: React.ReactNode;\n /** @default <Logo /> */\n logo?: React.ReactNode;\n /** @default false */\n done?: boolean;\n /** Called when the close button is clicked. If not provided the close button won't show */\n onClose?: () => void;\n /** Called when the back button is clicked. If not provided the back button won't show. The back button only shows on small screens */\n onGoBack?: () => void;\n /** Steps to be displayed in stepper.
|
|
1
|
+
{"version":3,"file":"FlowNavigation.mjs","sources":["../../src/flowNavigation/FlowNavigation.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\nimport { Breakpoint } from '@transferwise/neptune-tokens';\n\nimport { Layout } from '../common';\nimport { CloseButton } from '../common/closeButton';\nimport FlowHeader from '../common/flowHeader/FlowHeader';\nimport Logo from '../logo';\nimport Stepper, { type Step } from '../stepper/Stepper';\nimport Container from '../container';\n\nimport { useScreenSize } from '../common/hooks/useScreenSize';\nimport messages from './FlowNavigation.messages';\nimport AnimatedLabel from './animatedLabel';\nimport IconButton from '../iconButton';\nimport { ArrowLeft } from '@transferwise/icons';\n\nconst defaultLogo = <Logo />;\n\nexport interface FlowNavigationProps {\n /** @default 0 */\n activeStep?: number;\n avatar?: React.ReactNode;\n /** @default <Logo /> */\n logo?: React.ReactNode;\n /** @default false */\n done?: boolean;\n /** Called when the close button is clicked. If not provided the close button won't show */\n onClose?: () => void;\n /** Called when the back button is clicked. If not provided the back button won't show. The back button only shows on small screens */\n onGoBack?: () => void;\n /** Steps to be displayed in stepper. Pass an empty array to hide the stepper. */\n steps: readonly Step[];\n /**\n * When true, renders in composable mode using a fluid Container.\n * This allows the FlowNavigation to be used within custom layout containers.\n * @default false\n */\n composable?: boolean;\n /**\n * Controls whether the bottom border is displayed.\n * - Non-composable variant: When true (default), shows border based on done state (!done). When false, always hides.\n * - Composable variant: Directly controls border visibility, ignoring done state.\n * @default true\n */\n showBottomBorder?: boolean;\n}\n\nconst FlowNavigation = ({\n activeStep = 0,\n avatar,\n logo = defaultLogo,\n done = false,\n onClose,\n onGoBack,\n steps,\n composable = false,\n showBottomBorder = true,\n}: FlowNavigationProps) => {\n const intl = useIntl();\n\n const closeButton = onClose != null && <CloseButton size=\"lg\" onClick={onClose} />;\n\n const screenSm = useScreenSize(Breakpoint.SMALL);\n const screenLg = useScreenSize(Breakpoint.LARGE);\n\n const newAvatar = done ? null : avatar;\n\n const displayGoBack = onGoBack != null && activeStep > 0;\n\n const flowHeaderContent = (\n <FlowHeader\n className={clsx(\n 'np-flow-navigation__content',\n !composable && 'p-x-3',\n screenSm == null\n ? 'np-flow-navigation--hidden'\n : {\n 'np-flow-navigation--xs-max': !screenSm,\n // Size switches on parent container which may or may not have the same size as the window.\n 'np-flow-navigation--sm': screenSm,\n 'np-flow-navigation--lg': screenLg,\n },\n )}\n leftContent={\n <>\n {!screenSm && displayGoBack ? (\n <IconButton\n size={40}\n priority=\"tertiary\"\n type=\"default\"\n aria-label={intl.formatMessage(messages.back)}\n onClick={onGoBack}\n >\n <ArrowLeft />\n </IconButton>\n ) : (\n <div className=\"np-flow-header__left\">{logo}</div>\n )}\n {!screenSm && !done && (\n <AnimatedLabel className=\"m-x-1\" steps={steps} activeLabel={activeStep} />\n )}\n </>\n }\n rightContent={\n <div className=\"np-flow-header__right d-flex align-items-center justify-content-end order-2--lg\">\n {newAvatar}\n {newAvatar && closeButton && <span className=\"m-x-1\" />}\n {closeButton}\n </div>\n }\n bottomContent={\n !done && steps.length > 0 ? (\n <Stepper\n activeStep={activeStep}\n steps={steps}\n className={clsx('np-flow-navigation__stepper')}\n />\n ) : null\n }\n layout={!screenLg ? Layout.VERTICAL : Layout.HORIZONTAL}\n />\n );\n\n if (composable) {\n return (\n <Container\n size=\"fluid\"\n className={clsx('np-flow-navigation np-flow-navigation--composable', {\n 'np-flow-navigation--border-bottom': showBottomBorder,\n })}\n >\n {flowHeaderContent}\n </Container>\n );\n }\n\n return (\n <div\n className={clsx('np-flow-navigation p-y-3', {\n 'np-flow-navigation--border-bottom': showBottomBorder && !done,\n })}\n >\n {flowHeaderContent}\n </div>\n );\n};\n\nexport default FlowNavigation;\n"],"names":["defaultLogo","_jsx","Logo","FlowNavigation","activeStep","avatar","logo","done","onClose","onGoBack","steps","composable","showBottomBorder","intl","useIntl","closeButton","CloseButton","size","onClick","screenSm","useScreenSize","Breakpoint","SMALL","screenLg","LARGE","newAvatar","displayGoBack","flowHeaderContent","FlowHeader","className","clsx","leftContent","_jsxs","_Fragment","children","IconButton","priority","type","formatMessage","messages","back","ArrowLeft","AnimatedLabel","activeLabel","rightContent","bottomContent","length","Stepper","layout","Layout","VERTICAL","HORIZONTAL","Container"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAMA,WAAW,gBAAGC,GAAA,CAACC,IAAI,KAAG;AA+B5B,MAAMC,cAAc,GAAGA,CAAC;AACtBC,EAAAA,UAAU,GAAG,CAAC;EACdC,MAAM;AACNC,EAAAA,IAAI,GAAGN,WAAW;AAClBO,EAAAA,IAAI,GAAG,KAAK;EACZC,OAAO;EACPC,QAAQ;EACRC,KAAK;AACLC,EAAAA,UAAU,GAAG,KAAK;AAClBC,EAAAA,gBAAgB,GAAG;AAAI,CACH,KAAI;AACxB,EAAA,MAAMC,IAAI,GAAGC,OAAO,EAAE;EAEtB,MAAMC,WAAW,GAAGP,OAAO,IAAI,IAAI,iBAAIP,GAAA,CAACe,WAAW,EAAA;AAACC,IAAAA,IAAI,EAAC,IAAI;AAACC,IAAAA,OAAO,EAAEV;AAAQ,IAAG;AAElF,EAAA,MAAMW,QAAQ,GAAGC,aAAa,CAACC,UAAU,CAACC,KAAK,CAAC;AAChD,EAAA,MAAMC,QAAQ,GAAGH,aAAa,CAACC,UA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,KAAA,EAAA;AAAKH,MAAAA,SAAS,EAAC,iFAAiF;AAAAK,MAAAA,QAAA,GAC7FT,SAAS,EACTA,SAAS,IAAIV,WAAW,iBAAId,GAAA,CAAA,MAAA,EAAA;AAAM4B,QAAAA,SAAS,EAAC;OAAO,CAAG,EACtDd,WAAW;AAAA,KACT,CACN;AACD8B,IAAAA,aAAa,EACX,CAACtC,IAAI,IAAIG,KAAK,CAACoC,MAAM,GAAG,CAAC,gBACvB7C,GAAA,CAAC8C,OAAO,EAAA;AACN3C,MAAAA,UAAU,EAAEA,UAAW;AACvBM,MAAAA,KAAK,EAAEA,KAAM;MACbmB,SAAS,EAAEC,IAAI,CAAC,6BAA6B;KAAE,CAC/C,GACA,IACL;IACDkB,MAAM,EAAE,CAACzB,QAAQ,GAAG0B,MAAM,CAACC,QAAQ,GAAGD,MAAM,CAACE;AAAW,GAAA,CAE3D;AAED,EAAA,IAAIxC,UAAU,EAAE;IACd,oBACEV,GAAA,CAACmD,SAAS,EAAA;AACRnC,MAAAA,IAAI,EAAC,OAAO;AACZY,MAAAA,SAAS,EAAEC,IAAI,CAAC,mDAAmD,EAAE;AACnE,QAAA,mCAAmC,EAAElB;AACtC,OAAA,CAAE;AAAAsB,MAAAA,QAAA,EAEFP;AAAiB,KACT,CAAC;AAEhB,EAAA;AAEA,EAAA,oBACE1B,GAAA,CAAA,KAAA,EAAA;AACE4B,IAAAA,SAAS,EAAEC,IAAI,CAAC,0BAA0B,EAAE;MAC1C,mCAAmC,EAAElB,gBAAgB,IAAI,CAACL;AAC3D,KAAA,CAAE;AAAA2B,IAAAA,QAAA,EAEFP;AAAiB,GACf,CAAC;AAEV;;;;"}
|
package/build/main.css
CHANGED
|
@@ -28754,12 +28754,15 @@ button.np-option {
|
|
|
28754
28754
|
}
|
|
28755
28755
|
|
|
28756
28756
|
.np-flow-navigation {
|
|
28757
|
+
display: flex;
|
|
28758
|
+
align-items: center;
|
|
28759
|
+
justify-content: center;
|
|
28757
28760
|
width: 100%;
|
|
28758
|
-
|
|
28761
|
+
box-sizing: border-box;
|
|
28762
|
+
min-height: 96px;
|
|
28759
28763
|
}
|
|
28760
28764
|
|
|
28761
28765
|
.np-flow-navigation--border-bottom {
|
|
28762
|
-
min-height: 96px;
|
|
28763
28766
|
border-bottom: 1px solid rgba(0,0,0,0.10196);
|
|
28764
28767
|
border-bottom: 1px solid var(--color-border-neutral);
|
|
28765
28768
|
}
|
|
@@ -28844,6 +28847,20 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
28844
28847
|
visibility: hidden;
|
|
28845
28848
|
}
|
|
28846
28849
|
|
|
28850
|
+
.np-flow-navigation--composable {
|
|
28851
|
+
min-height: 80px;
|
|
28852
|
+
}
|
|
28853
|
+
|
|
28854
|
+
@media (min-width: 320.02px) {
|
|
28855
|
+
.np-flow-navigation--composable {
|
|
28856
|
+
min-height: 128px;
|
|
28857
|
+
}
|
|
28858
|
+
}
|
|
28859
|
+
|
|
28860
|
+
.np-flow-navigation--composable .np-flow-navigation__content {
|
|
28861
|
+
max-width: none;
|
|
28862
|
+
}
|
|
28863
|
+
|
|
28847
28864
|
.np-theme-personal--forest-green .np-flow-navigation .np-flow-header__left path,
|
|
28848
28865
|
.np-theme-personal--bright-green .np-flow-navigation .np-flow-header__left path,
|
|
28849
28866
|
.np-theme-personal--dark .np-flow-navigation .np-flow-header__left path {
|
|
@@ -30,6 +30,9 @@ var FlowHeader = require('../common/flowHeader/FlowHeader.js');
|
|
|
30
30
|
var Logo = require('../logo/Logo.js');
|
|
31
31
|
|
|
32
32
|
const defaultLogo = /*#__PURE__*/jsxRuntime.jsx(Logo.default, {});
|
|
33
|
+
/**
|
|
34
|
+
* @deprecated Use `FlowNavigation` component instead
|
|
35
|
+
*/
|
|
33
36
|
function OverlayHeader({
|
|
34
37
|
avatar,
|
|
35
38
|
onClose,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayHeader.js","sources":["../../src/overlayHeader/OverlayHeader.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport { Size } from '../common';\nimport { CloseButton } from '../common/closeButton';\nimport FlowHeader from '../common/flowHeader';\nimport Logo from '../logo';\n\nexport interface OverlayHeaderProps {\n /** An Avatar */\n avatar?: React.ReactNode;\n logo?: React.ReactNode;\n /** Function called when the close is clicked */\n onClose?: React.MouseEventHandler<HTMLButtonElement>;\n}\n\nconst defaultLogo = <Logo />;\n\nexport default function OverlayHeader({ avatar, onClose, logo = defaultLogo }: OverlayHeaderProps) {\n const closeButton = onClose && <CloseButton size={Size.LARGE} onClick={onClose} />;\n return (\n <div className=\"np-overlay-header d-flex justify-content-center\">\n <FlowHeader\n className=\"np-overlay-header__content p-a-3\"\n leftContent={logo}\n rightContent={\n <div className={clsx('d-flex', 'align-items-center', 'order-2')}>\n {avatar}\n {avatar && closeButton && <span className={clsx('m-x-1')} />}\n {closeButton}\n </div>\n }\n />\n </div>\n );\n}\n"],"names":["defaultLogo","_jsx","Logo","OverlayHeader","avatar","onClose","logo","closeButton","CloseButton","size","Size","LARGE","onClick","className","children","FlowHeader","leftContent","rightContent","_jsxs","clsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"OverlayHeader.js","sources":["../../src/overlayHeader/OverlayHeader.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport { Size } from '../common';\nimport { CloseButton } from '../common/closeButton';\nimport FlowHeader from '../common/flowHeader';\nimport Logo from '../logo';\n\n/**\n * @deprecated Use `FlowNavigation` component instead\n */\nexport interface OverlayHeaderProps {\n /** An Avatar */\n avatar?: React.ReactNode;\n logo?: React.ReactNode;\n /** Function called when the close is clicked */\n onClose?: React.MouseEventHandler<HTMLButtonElement>;\n}\n\nconst defaultLogo = <Logo />;\n\n/**\n * @deprecated Use `FlowNavigation` component instead\n */\nexport default function OverlayHeader({ avatar, onClose, logo = defaultLogo }: OverlayHeaderProps) {\n const closeButton = onClose && <CloseButton size={Size.LARGE} onClick={onClose} />;\n return (\n <div className=\"np-overlay-header d-flex justify-content-center\">\n <FlowHeader\n className=\"np-overlay-header__content p-a-3\"\n leftContent={logo}\n rightContent={\n <div className={clsx('d-flex', 'align-items-center', 'order-2')}>\n {avatar}\n {avatar && closeButton && <span className={clsx('m-x-1')} />}\n {closeButton}\n </div>\n }\n />\n </div>\n );\n}\n"],"names":["defaultLogo","_jsx","Logo","OverlayHeader","avatar","onClose","logo","closeButton","CloseButton","size","Size","LARGE","onClick","className","children","FlowHeader","leftContent","rightContent","_jsxs","clsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAMA,WAAW,gBAAGC,cAAA,CAACC,YAAI,KAAG;AAE5B;;AAEG;AACW,SAAUC,aAAaA,CAAC;EAAEC,MAAM;EAAEC,OAAO;AAAEC,EAAAA,IAAI,GAAGN;AAAW,CAAsB,EAAA;AAC/F,EAAA,MAAMO,WAAW,GAAGF,OAAO,iBAAIJ,cAAA,CAACO,uBAAW,EAAA;IAACC,IAAI,EAAEC,SAAI,CAACC,KAAM;AAACC,IAAAA,OAAO,EAAEP;AAAQ,GAAA,CAAG;AAClF,EAAA,oBACEJ,cAAA,CAAA,KAAA,EAAA;AAAKY,IAAAA,SAAS,EAAC,iDAAiD;IAAAC,QAAA,eAC9Db,cAAA,CAACc,kBAAU,EAAA;AACTF,MAAAA,SAAS,EAAC,kCAAkC;AAC5CG,MAAAA,WAAW,EAAEV,IAAK;AAClBW,MAAAA,YAAY,eACVC,eAAA,CAAA,KAAA,EAAA;QAAKL,SAAS,EAAEM,SAAI,CAAC,QAAQ,EAAE,oBAAoB,EAAE,SAAS,CAAE;AAAAL,QAAAA,QAAA,GAC7DV,MAAM,EACNA,MAAM,IAAIG,WAAW,iBAAIN,cAAA,CAAA,MAAA,EAAA;UAAMY,SAAS,EAAEM,SAAI,CAAC,OAAO;UAAK,EAC3DZ,WAAW;OACT;KACN;AAEL,GAAK,CAAC;AAEV;;;;"}
|
|
@@ -26,6 +26,9 @@ import FlowHeader from '../common/flowHeader/FlowHeader.mjs';
|
|
|
26
26
|
import Logo from '../logo/Logo.mjs';
|
|
27
27
|
|
|
28
28
|
const defaultLogo = /*#__PURE__*/jsx(Logo, {});
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated Use `FlowNavigation` component instead
|
|
31
|
+
*/
|
|
29
32
|
function OverlayHeader({
|
|
30
33
|
avatar,
|
|
31
34
|
onClose,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayHeader.mjs","sources":["../../src/overlayHeader/OverlayHeader.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport { Size } from '../common';\nimport { CloseButton } from '../common/closeButton';\nimport FlowHeader from '../common/flowHeader';\nimport Logo from '../logo';\n\nexport interface OverlayHeaderProps {\n /** An Avatar */\n avatar?: React.ReactNode;\n logo?: React.ReactNode;\n /** Function called when the close is clicked */\n onClose?: React.MouseEventHandler<HTMLButtonElement>;\n}\n\nconst defaultLogo = <Logo />;\n\nexport default function OverlayHeader({ avatar, onClose, logo = defaultLogo }: OverlayHeaderProps) {\n const closeButton = onClose && <CloseButton size={Size.LARGE} onClick={onClose} />;\n return (\n <div className=\"np-overlay-header d-flex justify-content-center\">\n <FlowHeader\n className=\"np-overlay-header__content p-a-3\"\n leftContent={logo}\n rightContent={\n <div className={clsx('d-flex', 'align-items-center', 'order-2')}>\n {avatar}\n {avatar && closeButton && <span className={clsx('m-x-1')} />}\n {closeButton}\n </div>\n }\n />\n </div>\n );\n}\n"],"names":["defaultLogo","_jsx","Logo","OverlayHeader","avatar","onClose","logo","closeButton","CloseButton","size","Size","LARGE","onClick","className","children","FlowHeader","leftContent","rightContent","_jsxs","clsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"OverlayHeader.mjs","sources":["../../src/overlayHeader/OverlayHeader.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport { Size } from '../common';\nimport { CloseButton } from '../common/closeButton';\nimport FlowHeader from '../common/flowHeader';\nimport Logo from '../logo';\n\n/**\n * @deprecated Use `FlowNavigation` component instead\n */\nexport interface OverlayHeaderProps {\n /** An Avatar */\n avatar?: React.ReactNode;\n logo?: React.ReactNode;\n /** Function called when the close is clicked */\n onClose?: React.MouseEventHandler<HTMLButtonElement>;\n}\n\nconst defaultLogo = <Logo />;\n\n/**\n * @deprecated Use `FlowNavigation` component instead\n */\nexport default function OverlayHeader({ avatar, onClose, logo = defaultLogo }: OverlayHeaderProps) {\n const closeButton = onClose && <CloseButton size={Size.LARGE} onClick={onClose} />;\n return (\n <div className=\"np-overlay-header d-flex justify-content-center\">\n <FlowHeader\n className=\"np-overlay-header__content p-a-3\"\n leftContent={logo}\n rightContent={\n <div className={clsx('d-flex', 'align-items-center', 'order-2')}>\n {avatar}\n {avatar && closeButton && <span className={clsx('m-x-1')} />}\n {closeButton}\n </div>\n }\n />\n </div>\n );\n}\n"],"names":["defaultLogo","_jsx","Logo","OverlayHeader","avatar","onClose","logo","closeButton","CloseButton","size","Size","LARGE","onClick","className","children","FlowHeader","leftContent","rightContent","_jsxs","clsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAMA,WAAW,gBAAGC,GAAA,CAACC,IAAI,KAAG;AAE5B;;AAEG;AACW,SAAUC,aAAaA,CAAC;EAAEC,MAAM;EAAEC,OAAO;AAAEC,EAAAA,IAAI,GAAGN;AAAW,CAAsB,EAAA;AAC/F,EAAA,MAAMO,WAAW,GAAGF,OAAO,iBAAIJ,GAAA,CAACO,WAAW,EAAA;IAACC,IAAI,EAAEC,IAAI,CAACC,KAAM;AAACC,IAAAA,OAAO,EAAEP;AAAQ,GAAA,CAAG;AAClF,EAAA,oBACEJ,GAAA,CAAA,KAAA,EAAA;AAAKY,IAAAA,SAAS,EAAC,iDAAiD;IAAAC,QAAA,eAC9Db,GAAA,CAACc,UAAU,EAAA;AACTF,MAAAA,SAAS,EAAC,kCAAkC;AAC5CG,MAAAA,WAAW,EAAEV,IAAK;AAClBW,MAAAA,YAAY,eACVC,IAAA,CAAA,KAAA,EAAA;QAAKL,SAAS,EAAEM,IAAI,CAAC,QAAQ,EAAE,oBAAoB,EAAE,SAAS,CAAE;AAAAL,QAAAA,QAAA,GAC7DV,MAAM,EACNA,MAAM,IAAIG,WAAW,iBAAIN,GAAA,CAAA,MAAA,EAAA;UAAMY,SAAS,EAAEM,IAAI,CAAC,OAAO;UAAK,EAC3DZ,WAAW;OACT;KACN;AAEL,GAAK,CAAC;AAEV;;;;"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
.np-flow-navigation {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
2
5
|
width: 100%;
|
|
3
|
-
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
min-height: 96px;
|
|
4
8
|
}
|
|
5
9
|
.np-flow-navigation--border-bottom {
|
|
6
|
-
min-height: 96px;
|
|
7
10
|
border-bottom: 1px solid rgba(0,0,0,0.10196);
|
|
8
11
|
border-bottom: 1px solid var(--color-border-neutral);
|
|
9
12
|
}
|
|
@@ -69,6 +72,17 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
69
72
|
.np-flow-navigation--hidden {
|
|
70
73
|
visibility: hidden;
|
|
71
74
|
}
|
|
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
|
+
}
|
|
72
86
|
.np-theme-personal--forest-green .np-flow-navigation .np-flow-header__left path,
|
|
73
87
|
.np-theme-personal--bright-green .np-flow-navigation .np-flow-header__left path,
|
|
74
88
|
.np-theme-personal--dark .np-flow-navigation .np-flow-header__left path {
|
package/build/styles/main.css
CHANGED
|
@@ -28754,12 +28754,15 @@ button.np-option {
|
|
|
28754
28754
|
}
|
|
28755
28755
|
|
|
28756
28756
|
.np-flow-navigation {
|
|
28757
|
+
display: flex;
|
|
28758
|
+
align-items: center;
|
|
28759
|
+
justify-content: center;
|
|
28757
28760
|
width: 100%;
|
|
28758
|
-
|
|
28761
|
+
box-sizing: border-box;
|
|
28762
|
+
min-height: 96px;
|
|
28759
28763
|
}
|
|
28760
28764
|
|
|
28761
28765
|
.np-flow-navigation--border-bottom {
|
|
28762
|
-
min-height: 96px;
|
|
28763
28766
|
border-bottom: 1px solid rgba(0,0,0,0.10196);
|
|
28764
28767
|
border-bottom: 1px solid var(--color-border-neutral);
|
|
28765
28768
|
}
|
|
@@ -28844,6 +28847,20 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
28844
28847
|
visibility: hidden;
|
|
28845
28848
|
}
|
|
28846
28849
|
|
|
28850
|
+
.np-flow-navigation--composable {
|
|
28851
|
+
min-height: 80px;
|
|
28852
|
+
}
|
|
28853
|
+
|
|
28854
|
+
@media (min-width: 320.02px) {
|
|
28855
|
+
.np-flow-navigation--composable {
|
|
28856
|
+
min-height: 128px;
|
|
28857
|
+
}
|
|
28858
|
+
}
|
|
28859
|
+
|
|
28860
|
+
.np-flow-navigation--composable .np-flow-navigation__content {
|
|
28861
|
+
max-width: none;
|
|
28862
|
+
}
|
|
28863
|
+
|
|
28847
28864
|
.np-theme-personal--forest-green .np-flow-navigation .np-flow-header__left path,
|
|
28848
28865
|
.np-theme-personal--bright-green .np-flow-navigation .np-flow-header__left path,
|
|
28849
28866
|
.np-theme-personal--dark .np-flow-navigation .np-flow-header__left path {
|
|
@@ -11,9 +11,22 @@ export interface FlowNavigationProps {
|
|
|
11
11
|
onClose?: () => void;
|
|
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
|
-
/** Steps to be displayed in stepper.
|
|
14
|
+
/** Steps to be displayed in stepper. Pass an empty array to hide the stepper. */
|
|
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
|
+
/**
|
|
23
|
+
* Controls whether the bottom border is displayed.
|
|
24
|
+
* - Non-composable variant: When true (default), shows border based on done state (!done). When false, always hides.
|
|
25
|
+
* - Composable variant: Directly controls border visibility, ignoring done state.
|
|
26
|
+
* @default true
|
|
27
|
+
*/
|
|
28
|
+
showBottomBorder?: boolean;
|
|
16
29
|
}
|
|
17
|
-
declare const FlowNavigation: ({ activeStep, avatar, logo, done, onClose, onGoBack, steps, }: FlowNavigationProps) => import("react").JSX.Element;
|
|
30
|
+
declare const FlowNavigation: ({ activeStep, avatar, logo, done, onClose, onGoBack, steps, composable, showBottomBorder, }: FlowNavigationProps) => import("react").JSX.Element;
|
|
18
31
|
export default FlowNavigation;
|
|
19
32
|
//# 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;
|
|
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;IACrB,sIAAsI;IACtI,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,iFAAiF;IACjF,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IACvB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,QAAA,MAAM,cAAc,GAAI,6FAUrB,mBAAmB,gCAwFrB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Use `FlowNavigation` component instead
|
|
3
|
+
*/
|
|
1
4
|
export interface OverlayHeaderProps {
|
|
2
5
|
/** An Avatar */
|
|
3
6
|
avatar?: React.ReactNode;
|
|
@@ -5,5 +8,8 @@ export interface OverlayHeaderProps {
|
|
|
5
8
|
/** Function called when the close is clicked */
|
|
6
9
|
onClose?: React.MouseEventHandler<HTMLButtonElement>;
|
|
7
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Use `FlowNavigation` component instead
|
|
13
|
+
*/
|
|
8
14
|
export default function OverlayHeader({ avatar, onClose, logo }: OverlayHeaderProps): import("react").JSX.Element;
|
|
9
15
|
//# sourceMappingURL=OverlayHeader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayHeader.d.ts","sourceRoot":"","sources":["../../../src/overlayHeader/OverlayHeader.tsx"],"names":[],"mappings":"AAOA,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,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,IAAkB,EAAE,EAAE,kBAAkB,+BAiBhG"}
|
|
1
|
+
{"version":3,"file":"OverlayHeader.d.ts","sourceRoot":"","sources":["../../../src/overlayHeader/OverlayHeader.tsx"],"names":[],"mappings":"AAOA;;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,+BAiBhG"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
.np-flow-navigation {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
2
5
|
width: 100%;
|
|
3
|
-
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
min-height: 96px;
|
|
4
8
|
}
|
|
5
9
|
.np-flow-navigation--border-bottom {
|
|
6
|
-
min-height: 96px;
|
|
7
10
|
border-bottom: 1px solid rgba(0,0,0,0.10196);
|
|
8
11
|
border-bottom: 1px solid var(--color-border-neutral);
|
|
9
12
|
}
|
|
@@ -69,6 +72,17 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
69
72
|
.np-flow-navigation--hidden {
|
|
70
73
|
visibility: hidden;
|
|
71
74
|
}
|
|
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
|
+
}
|
|
72
86
|
.np-theme-personal--forest-green .np-flow-navigation .np-flow-header__left path,
|
|
73
87
|
.np-theme-personal--bright-green .np-flow-navigation .np-flow-header__left path,
|
|
74
88
|
.np-theme-personal--dark .np-flow-navigation .np-flow-header__left path {
|