@transferwise/components 46.148.1 → 46.149.1

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.
Files changed (84) hide show
  1. package/build/flowNavigation/FlowNavigation.js +56 -42
  2. package/build/flowNavigation/FlowNavigation.js.map +1 -1
  3. package/build/flowNavigation/FlowNavigation.mjs +56 -42
  4. package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
  5. package/build/main.css +52 -28
  6. package/build/overlayHeader/OverlayHeader.js +3 -0
  7. package/build/overlayHeader/OverlayHeader.js.map +1 -1
  8. package/build/overlayHeader/OverlayHeader.mjs +3 -0
  9. package/build/overlayHeader/OverlayHeader.mjs.map +1 -1
  10. package/build/prompt/CriticalBanner/CriticalBanner.js +1 -1
  11. package/build/prompt/CriticalBanner/CriticalBanner.js.map +1 -1
  12. package/build/prompt/CriticalBanner/CriticalBanner.mjs +1 -1
  13. package/build/prompt/CriticalBanner/CriticalBanner.mjs.map +1 -1
  14. package/build/styles/avatarView/AvatarView.css +1 -0
  15. package/build/styles/css/neptune.css +11 -11
  16. package/build/styles/flowNavigation/FlowNavigation.css +16 -2
  17. package/build/styles/less/legacy-variables.less +1 -1
  18. package/build/styles/less/neptune-tokens.less +2 -2
  19. package/build/styles/main.css +52 -28
  20. package/build/styles/prompt/CriticalBanner/CriticalBanner.css +19 -12
  21. package/build/styles/props/custom-media.css +1 -1
  22. package/build/styles/props/neptune-tokens.css +1 -1
  23. package/build/styles/sentimentSurface/SentimentSurface.css +1 -1
  24. package/build/styles/styles/less/neptune.css +11 -11
  25. package/build/types/flowNavigation/FlowNavigation.d.ts +15 -3
  26. package/build/types/flowNavigation/FlowNavigation.d.ts.map +1 -1
  27. package/build/types/overlayHeader/OverlayHeader.d.ts +6 -0
  28. package/build/types/overlayHeader/OverlayHeader.d.ts.map +1 -1
  29. package/package.json +15 -15
  30. package/src/avatarView/AvatarView.css +1 -0
  31. package/src/avatarView/AvatarView.less +3 -1
  32. package/src/body/Body.story.tsx +1 -5
  33. package/src/calendar/Calendar.story.tsx +1 -4
  34. package/src/checkbox/Checkbox.story.tsx +1 -4
  35. package/src/chevron/Chevron.story.tsx +1 -1
  36. package/src/container/Container.story.tsx +1 -4
  37. package/src/dateInput/DateInput.story.tsx +1 -4
  38. package/src/dateLookup/DateLookup.story.tsx +1 -4
  39. package/src/decision/Decision.story.tsx +1 -4
  40. package/src/definitionList/DefinitionList.story.tsx +1 -4
  41. package/src/dimmer/Dimmer.story.tsx +1 -5
  42. package/src/display/Display.story.tsx +1 -4
  43. package/src/emphasis/Emphasis.story.tsx +1 -5
  44. package/src/expressiveMoneyInput/ExpressiveMoneyInput.story.tsx +1 -4
  45. package/src/field/Field.story.tsx +1 -4
  46. package/src/flowNavigation/FlowNavigation.css +16 -2
  47. package/src/flowNavigation/FlowNavigation.less +20 -4
  48. package/src/flowNavigation/FlowNavigation.story.tsx +249 -0
  49. package/src/flowNavigation/FlowNavigation.tsx +91 -58
  50. package/src/header/Header.story.tsx +1 -4
  51. package/src/inputWithDisplayFormat/InputWithDisplayFormat.story.tsx +1 -4
  52. package/src/inputs/InputGroup.story.tsx +1 -4
  53. package/src/inputs/SearchInput.story.tsx +1 -4
  54. package/src/inputs/TextArea.story.tsx +1 -4
  55. package/src/instructionsList/InstructionsList.story.tsx +1 -4
  56. package/src/label/Label.story.tsx +1 -4
  57. package/src/link/Link.story.tsx +1 -4
  58. package/src/loader/Loader.story.tsx +1 -1
  59. package/src/main.css +52 -28
  60. package/src/markdown/Markdown.story.tsx +1 -5
  61. package/src/money/Money.story.tsx +0 -1
  62. package/src/moneyInput/MoneyInput.story.tsx +1 -4
  63. package/src/overlayHeader/OverlayHeader.story.tsx +4 -0
  64. package/src/overlayHeader/OverlayHeader.tsx +6 -0
  65. package/src/phoneNumberInput/PhoneNumberInput.story.tsx +1 -4
  66. package/src/promoCard/PromoCard.story.tsx +1 -4
  67. package/src/promoCard/PromoCardGroup.story.tsx +1 -4
  68. package/src/prompt/CriticalBanner/CriticalBanner.css +19 -12
  69. package/src/prompt/CriticalBanner/CriticalBanner.less +33 -25
  70. package/src/prompt/CriticalBanner/CriticalBanner.story.tsx +22 -11
  71. package/src/prompt/CriticalBanner/CriticalBanner.test.story.tsx +71 -0
  72. package/src/prompt/CriticalBanner/CriticalBanner.tsx +1 -1
  73. package/src/radio/Radio.story.tsx +1 -4
  74. package/src/radioGroup/RadioGroup.story.tsx +1 -4
  75. package/src/segmentedControl/SegmentedControl.story.tsx +1 -4
  76. package/src/sentimentSurface/SentimentSurface.css +1 -1
  77. package/src/statusIcon/StatusIcon.story.tsx +1 -1
  78. package/src/styles/less/neptune.css +11 -11
  79. package/src/textareaWithDisplayFormat/TextareaWithDisplayFormat.story.tsx +1 -4
  80. package/src/title/Title.story.tsx +1 -5
  81. package/src/typeahead/Typeahead.story.tsx +1 -4
  82. package/src/upload/Upload.story.tsx +1 -4
  83. package/src/uploadInput/UploadInput.story.tsx +1 -4
  84. package/src/flowNavigation/FlowNavigation.test.js +0 -190
@@ -30,71 +30,85 @@ 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 = /*#__PURE__*/jsxRuntime.jsx(Logo.default, {}),
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();
53
+ const screenSm = useScreenSize.useScreenSize(neptuneTokens.Breakpoint.SMALL);
54
+ const screenLg = useScreenSize.useScreenSize(neptuneTokens.Breakpoint.LARGE);
49
55
  const closeButton = onClose != null && /*#__PURE__*/jsxRuntime.jsx(CloseButton.CloseButton, {
50
56
  size: "lg",
51
57
  onClick: onClose
52
58
  });
53
- const screenSm = useScreenSize.useScreenSize(neptuneTokens.Breakpoint.SMALL);
54
- const screenLg = useScreenSize.useScreenSize(neptuneTokens.Breakpoint.LARGE);
55
59
  const newAvatar = done ? null : avatar;
56
60
  const displayGoBack = onGoBack != null && activeStep > 0;
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
67
+ }),
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 && steps && steps.length > 0 && /*#__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 && 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
+ }
57
107
  return /*#__PURE__*/jsxRuntime.jsx("div", {
58
- className: clsx.clsx('np-flow-navigation d-flex align-items-center justify-content-center p-y-3', {
108
+ className: clsx.clsx('np-flow-navigation p-y-3', {
59
109
  'np-flow-navigation--border-bottom': !done
60
110
  }),
61
- children: /*#__PURE__*/jsxRuntime.jsx(FlowHeader.default, {
62
- className: clsx.clsx('np-flow-navigation__content 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
67
- }),
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",
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,
93
- steps: steps,
94
- className: clsx.clsx('np-flow-navigation__stepper')
95
- }) : null,
96
- layout: !screenLg ? layouts.Layout.VERTICAL : layouts.Layout.HORIZONTAL
97
- })
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. If you don't need the stepper, please use OverlayHeader instead */\n steps: readonly Step[];\n}\n\nconst FlowNavigation = ({\n activeStep = 0,\n avatar,\n logo = <Logo />,\n done = false,\n onClose,\n onGoBack,\n steps,\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 return (\n <div\n className={clsx('np-flow-navigation d-flex align-items-center justify-content-center p-y-3', {\n 'np-flow-navigation--border-bottom': !done,\n })}\n >\n <FlowHeader\n className={clsx(\n 'np-flow-navigation__content 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 </div>\n );\n};\n\nexport default FlowNavigation;\n"],"names":["FlowNavigation","activeStep","avatar","logo","_jsx","Logo","done","onClose","onGoBack","steps","intl","useIntl","closeButton","CloseButton","size","onClick","screenSm","useScreenSize","Breakpoint","SMALL","screenLg","LARGE","newAvatar","displayGoBack","className","clsx","children","FlowHeader","leftContent","_jsxs","_Fragment","IconButton","priority","type","formatMessage","messages","back","ArrowLeft","AnimatedLabel","activeLabel","rightContent","bottomContent","length","Stepper","layout","Layout","VERTICAL","HORIZONTAL"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAMA,cAAc,GAAGA,CAAC;AACtBC,EAAAA,UAAU,GAAG,CAAC;EACdC,MAAM;AACNC,EAAAA,IAAI,gBAAGC,cAAA,CAACC,YAAI,IAAA,CAAG;AACfC,EAAAA,IAAI,GAAG,KAAK;EACZC,OAAO;EACPC,QAAQ;AACRC,EAAAA;AAAK,CACe,KAAI;AACxB,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE;EAEtB,MAAMC,WAAW,GAAGL,OAAO,IAAI,IAAI,iBAAIH,cAAA,CAACS,uBAAW,EAAA;AAACC,IAAAA,IAAI,EAAC,IAAI;AAACC,IAAAA,OAAO,EAAER;AAAQ,IAAG;AAElF,EAAA,MAAMS,QAAQ,GAAGC,2BAAa,CAACC,wBAAU,CAACC,KAAK,CAAC;AAChD,EAAA,MAAMC,QAAQ,GAAGH,2BAAa,CAACC,wBAAU,CAACG,KAAK,CAAC;AAEhD,EAAA,MAAMC,SAAS,GAAGhB,IAAI,GAAG,IAAI,GAAGJ,MAAM;EAEtC,MAAMqB,aAAa,GAAGf,QAAQ,IAAI,IAAI,IAAIP,UAAU,GAAG,CAAC;AAExD,EAAA,oBACEG,cAAA,CAAA,KAAA,EAAA;AACEoB,IAAAA,SAAS,EAAEC,SAAI,CAAC,2EAA2E,EAAE;AAC3F,MAAA,mCAAmC,EAAE,CAACnB;AACvC,KAAA,CAAE;IAAAoB,QAAA,eAEHtB,cAAA,CAACuB,kBAAU,EAAA;MACTH,SAAS,EAAEC,SAAI,CACb,mCAAmC,EACnCT,QAAQ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AO,EAAA;AACN1C,QAAAA,UAAU,EAAEA,UAAW;AACvBQ,QAAAA,KAAK,EAAEA,KAAM;QACbe,SAAS,EAAEC,SAAI,CAAC,6BAA6B;OAAE,CAC/C,GACA,IACL;MACDmB,MAAM,EAAE,CAACxB,QAAQ,GAAGyB,cAAM,CAACC,QAAQ,GAAGD,cAAM,CAACE;KAAW;AAE5D,GAAK,CAAC;AAEV;;;;"}
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. If not provided, the stepper won't show. */\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 * Only applies to the composable variant. Non-composable variant always uses the 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 const screenSm = useScreenSize(Breakpoint.SMALL);\n const screenLg = useScreenSize(Breakpoint.LARGE);\n\n const closeButton = onClose != null && <CloseButton size=\"lg\" onClick={onClose} />;\n\n const newAvatar = done ? null : avatar;\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 && steps && steps.length > 0 && (\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 && 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': !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","screenSm","useScreenSize","Breakpoint","SMALL","screenLg","LARGE","closeButton","CloseButton","size","onClick","newAvatar","displayGoBack","flowHeaderContent","FlowHeader","className","clsx","leftContent","_jsxs","_Fragment","children","IconButton","priority","type","formatMessage","messages","back","ArrowLeft","length","AnimatedLabel","activeLabel","rightContent","bottomContent","Stepper","layout","Layout","VERTICAL","HORIZONTAL","Container"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAMA,WAAW,gBAAGC,cAAA,CAACC,YAAI,KAAG;AA8B5B,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;AACtB,EAAA,MAAMC,QAAQ,GAAGC,2BAAa,CAACC,wBAAU,CAACC,KAAK,CAAC;AAChD,EAAA,MAAMC,QAAQ,GAAGH,2BAAa,CAACC,wBAAU,CAACG,KAAK,CAAC;EAEhD,MAAMC,WAAW,GAAGb,OAAO,IAAI,IAAI,iBAAIP,cAAA,CAACqB,uBAAW,EAAA;AAACC,IAAAA,IAAI,EAAC,IAAI;AAACC,IAAAA,OAAO,EAAEhB;AAAQ,IAAG;AAElF,EAAA,MAAMiB,SAAS,GAAGlB,IAAI,GAAG,IAAI,GAAGF,MAAM;EACtC,MAAMqB,aAAa,GAAGjB,QAAQ,IAAI,IAAI,IAAIL,UAAU,GAAG,CAAC;AAExD,EAAA,MAAMuB,iBA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,CAAA,MAAA,EAAA;AAAM4B,QAAAA,SAAS,EAAC;OAAO,CAAG,EACtDR,WAAW;AAAA,KACT,CACN;AACDyB,IAAAA,aAAa,EACX,CAACvC,IAAI,IAAIG,KAAK,IAAIA,KAAK,CAACgC,MAAM,GAAG,CAAC,gBAChCzC,cAAA,CAAC8C,eAAO,EAAA;AACN3C,MAAAA,UAAU,EAAEA,UAAW;AACvBM,MAAAA,KAAK,EAAEA,KAAM;MACbmB,SAAS,EAAEC,SAAI,CAAC,6BAA6B;KAAE,CAC/C,GACA,IACL;IACDkB,MAAM,EAAE,CAAC7B,QAAQ,GAAG8B,cAAM,CAACC,QAAQ,GAAGD,cAAM,CAACE;AAAW,GAAA,CAE3D;AAED,EAAA,IAAIxC,UAAU,EAAE;IACd,oBACEV,cAAA,CAACmD,iBAAS,EAAA;AACR7B,MAAAA,IAAI,EAAC,OAAO;AACZM,MAAAA,SAAS,EAAEC,SAAI,CAAC,mDAAmD,EAAE;AACnE,QAAA,mCAAmC,EAAElB;AACtC,OAAA,CAAE;AAAAsB,MAAAA,QAAA,EAEFP;AAAiB,KACT,CAAC;AAEhB,EAAA;AAEA,EAAA,oBACE1B,cAAA,CAAA,KAAA,EAAA;AACE4B,IAAAA,SAAS,EAAEC,SAAI,CAAC,0BAA0B,EAAE;AAC1C,MAAA,mCAAmC,EAAE,CAACvB;AACvC,KAAA,CAAE;AAAA2B,IAAAA,QAAA,EAEFP;AAAiB,GACf,CAAC;AAEV;;;;"}
@@ -26,71 +26,85 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
26
26
  import FlowHeader from '../common/flowHeader/FlowHeader.mjs';
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 = /*#__PURE__*/jsx(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();
49
+ const screenSm = useScreenSize(Breakpoint.SMALL);
50
+ const screenLg = useScreenSize(Breakpoint.LARGE);
45
51
  const closeButton = onClose != null && /*#__PURE__*/jsx(CloseButton, {
46
52
  size: "lg",
47
53
  onClick: onClose
48
54
  });
49
- const screenSm = useScreenSize(Breakpoint.SMALL);
50
- const screenLg = useScreenSize(Breakpoint.LARGE);
51
55
  const newAvatar = done ? null : avatar;
52
56
  const displayGoBack = onGoBack != null && activeStep > 0;
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
63
+ }),
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 && steps && steps.length > 0 && /*#__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 && 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
+ }
53
103
  return /*#__PURE__*/jsx("div", {
54
- className: clsx('np-flow-navigation d-flex align-items-center justify-content-center p-y-3', {
104
+ className: clsx('np-flow-navigation p-y-3', {
55
105
  'np-flow-navigation--border-bottom': !done
56
106
  }),
57
- children: /*#__PURE__*/jsx(FlowHeader, {
58
- className: clsx('np-flow-navigation__content 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
63
- }),
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",
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,
89
- steps: steps,
90
- className: clsx('np-flow-navigation__stepper')
91
- }) : null,
92
- layout: !screenLg ? Layout.VERTICAL : Layout.HORIZONTAL
93
- })
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. If you don't need the stepper, please use OverlayHeader instead */\n steps: readonly Step[];\n}\n\nconst FlowNavigation = ({\n activeStep = 0,\n avatar,\n logo = <Logo />,\n done = false,\n onClose,\n onGoBack,\n steps,\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 return (\n <div\n className={clsx('np-flow-navigation d-flex align-items-center justify-content-center p-y-3', {\n 'np-flow-navigation--border-bottom': !done,\n })}\n >\n <FlowHeader\n className={clsx(\n 'np-flow-navigation__content 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 </div>\n );\n};\n\nexport default FlowNavigation;\n"],"names":["FlowNavigation","activeStep","avatar","logo","_jsx","Logo","done","onClose","onGoBack","steps","intl","useIntl","closeButton","CloseButton","size","onClick","screenSm","useScreenSize","Breakpoint","SMALL","screenLg","LARGE","newAvatar","displayGoBack","className","clsx","children","FlowHeader","leftContent","_jsxs","_Fragment","IconButton","priority","type","formatMessage","messages","back","ArrowLeft","AnimatedLabel","activeLabel","rightContent","bottomContent","length","Stepper","layout","Layout","VERTICAL","HORIZONTAL"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAMA,cAAc,GAAGA,CAAC;AACtBC,EAAAA,UAAU,GAAG,CAAC;EACdC,MAAM;AACNC,EAAAA,IAAI,gBAAGC,GAAA,CAACC,IAAI,IAAA,CAAG;AACfC,EAAAA,IAAI,GAAG,KAAK;EACZC,OAAO;EACPC,QAAQ;AACRC,EAAAA;AAAK,CACe,KAAI;AACxB,EAAA,MAAMC,IAAI,GAAGC,OAAO,EAAE;EAEtB,MAAMC,WAAW,GAAGL,OAAO,IAAI,IAAI,iBAAIH,GAAA,CAACS,WAAW,EAAA;AAACC,IAAAA,IAAI,EAAC,IAAI;AAACC,IAAAA,OAAO,EAAER;AAAQ,IAAG;AAElF,EAAA,MAAMS,QAAQ,GAAGC,aAAa,CAACC,UAAU,CAACC,KAAK,CAAC;AAChD,EAAA,MAAMC,QAAQ,GAAGH,aAAa,CAACC,UAAU,CAACG,KAAK,CAAC;AAEhD,EAAA,MAAMC,SAAS,GAAGhB,IAAI,GAAG,IAAI,GAAGJ,MAAM;EAEtC,MAAMqB,aAAa,GAAGf,QAAQ,IAAI,IAAI,IAAIP,UAAU,GAAG,CAAC;AAExD,EAAA,oBACEG,GAAA,CAAA,KAAA,EAAA;AACEoB,IAAAA,SAAS,EAAEC,IAAI,CAAC,2EAA2E,EAAE;AAC3F,MAAA,mCAAmC,EAAE,CAACnB;AACvC,KAAA,CAAE;IAAAoB,QAAA,eAEHtB,GAAA,CAACuB,UAAU,EAAA;MACTH,SAAS,EAAEC,IAAI,CACb,mCAAmC,EACnCT,QAAQ,IAAI,IAAI,GACZ,4BAA4B,GAC5B;QACE,4BAA4B,EAAE,CAACA,QAAQ;AACvC;AACA,QAAA,wBAAwB,EAAEA,QAAQ;AAClC,QAAA,wBAAwB,EAAEI;AAC3B,OA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AAM,EAAE,CAACxB,QAAQ,GAAGyB,MAAM,CAACC,QAAQ,GAAGD,MAAM,CAACE;KAAW;AAE5D,GAAK,CAAC;AAEV;;;;"}
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. If not provided, the stepper won't show. */\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 * Only applies to the composable variant. Non-composable variant always uses the 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 const screenSm = useScreenSize(Breakpoint.SMALL);\n const screenLg = useScreenSize(Breakpoint.LARGE);\n\n const closeButton = onClose != null && <CloseButton size=\"lg\" onClick={onClose} />;\n\n const newAvatar = done ? null : avatar;\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 && steps && steps.length > 0 && (\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 && 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': !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","screenSm","useScreenSize","Breakpoint","SMALL","screenLg","LARGE","closeButton","CloseButton","size","onClick","newAvatar","displayGoBack","flowHeaderContent","FlowHeader","className","clsx","leftContent","_jsxs","_Fragment","children","IconButton","priority","type","formatMessage","messages","back","ArrowLeft","length","AnimatedLabel","activeLabel","rightContent","bottomContent","Stepper","layout","Layout","VERTICAL","HORIZONTAL","Container"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAMA,WAAW,gBAAGC,GAAA,CAACC,IAAI,KAAG;AA8B5B,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;AACtB,EAAA,MAAMC,QAAQ,GAAGC,aAAa,CAACC,UAAU,CAACC,KAAK,CAAC;AAChD,EAAA,MAAMC,QAAQ,GAAGH,aAAa,CAACC,UAAU,CAACG,KAAK,CAAC;EAEhD,MAAMC,WAAW,GAAGb,OAAO,IAAI,IAAI,iBAAIP,GAAA,CAACqB,WAAW,EAAA;AAACC,IAAAA,IAAI,EAAC,IAAI;AAACC,IAAAA,OAAO,EAAEhB;AAAQ,IAAG;AAElF,EAAA,MAAMiB,SAAS,GAAGlB,IAAI,GAAG,IAAI,GAAGF,MAAM;EACtC,MAAMqB,aAAa,GAAGjB,QAAQ,IAAI,IAAI,IAAIL,UAAU,GAAG,CAAC;AAExD,EAAA,MAAMuB,iBAAiB,gBACrB1B,GAAA,CAAC2B,UAAU,EAAA;AACTC,IAAAA,SAAS,EAAEC,IAAI,CACb,6BAA6B,EAC7B,CAACnB,UAAU,IAAI,OAAO,EACtBI,QAAQ,IAAI,IAAI,GACZ,4BAA4B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,GAAG,CAAC,gBAChCzC,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,CAAC7B,QAAQ,GAAG8B,MAAM,CAACC,QAAQ,GAAGD,MAAM,CAACE;AAAW,GAAA,CAE3D;AAED,EAAA,IAAIxC,UAAU,EAAE;IACd,oBACEV,GAAA,CAACmD,SAAS,EAAA;AACR7B,MAAAA,IAAI,EAAC,OAAO;AACZM,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;AAC1C,MAAA,mCAAmC,EAAE,CAACvB;AACvC,KAAA,CAAE;AAAA2B,IAAAA,QAAA,EAEFP;AAAiB,GACf,CAAC;AAEV;;;;"}
package/build/main.css CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly, this file was auto-generated.
3
- * Generated on Wed, 27 May 2026 15:50:09 GMT
3
+ * Generated on Tue, 09 Jun 2026 08:11:03 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -144,7 +144,7 @@
144
144
 
145
145
  /**
146
146
  * Do not edit directly, this file was auto-generated.
147
- * Generated on Wed, 27 May 2026 15:50:10 GMT
147
+ * Generated on Tue, 09 Jun 2026 08:11:04 GMT
148
148
  */
149
149
 
150
150
  .np-theme-personal {
@@ -328,7 +328,7 @@
328
328
 
329
329
  /**
330
330
  * Do not edit directly, this file was auto-generated.
331
- * Generated on Wed, 27 May 2026 15:50:10 GMT
331
+ * Generated on Tue, 09 Jun 2026 08:11:04 GMT
332
332
  */
333
333
 
334
334
  .np-theme-personal--forest-green {
@@ -512,7 +512,7 @@
512
512
 
513
513
  /**
514
514
  * Do not edit directly, this file was auto-generated.
515
- * Generated on Wed, 27 May 2026 15:50:10 GMT
515
+ * Generated on Tue, 09 Jun 2026 08:11:04 GMT
516
516
  */
517
517
 
518
518
  .np-theme-personal--bright-green {
@@ -696,7 +696,7 @@
696
696
 
697
697
  /**
698
698
  * Do not edit directly, this file was auto-generated.
699
- * Generated on Wed, 27 May 2026 15:50:10 GMT
699
+ * Generated on Tue, 09 Jun 2026 08:11:04 GMT
700
700
  */
701
701
 
702
702
  .np-theme-personal--dark {
@@ -880,7 +880,7 @@
880
880
 
881
881
  /**
882
882
  * Do not edit directly, this file was auto-generated.
883
- * Generated on Wed, 27 May 2026 15:50:10 GMT
883
+ * Generated on Tue, 09 Jun 2026 08:11:04 GMT
884
884
  */
885
885
 
886
886
  .np-theme-platform {
@@ -1064,7 +1064,7 @@
1064
1064
 
1065
1065
  /**
1066
1066
  * Do not edit directly, this file was auto-generated.
1067
- * Generated on Wed, 27 May 2026 15:50:10 GMT
1067
+ * Generated on Tue, 09 Jun 2026 08:11:04 GMT
1068
1068
  */
1069
1069
 
1070
1070
  .np-theme-platform--forest-green {
@@ -1248,7 +1248,7 @@
1248
1248
 
1249
1249
  /**
1250
1250
  * Do not edit directly, this file was auto-generated.
1251
- * Generated on Wed, 27 May 2026 15:50:10 GMT
1251
+ * Generated on Tue, 09 Jun 2026 08:11:04 GMT
1252
1252
  */
1253
1253
 
1254
1254
  .np-theme-business {
@@ -1433,7 +1433,7 @@
1433
1433
 
1434
1434
  /**
1435
1435
  * Do not edit directly, this file was auto-generated.
1436
- * Generated on Wed, 27 May 2026 15:50:10 GMT
1436
+ * Generated on Tue, 09 Jun 2026 08:11:04 GMT
1437
1437
  */
1438
1438
 
1439
1439
  .np-theme-business--dark {
@@ -1618,7 +1618,7 @@
1618
1618
 
1619
1619
  /**
1620
1620
  * Do not edit directly, this file was auto-generated.
1621
- * Generated on Wed, 27 May 2026 15:50:10 GMT
1621
+ * Generated on Tue, 09 Jun 2026 08:11:04 GMT
1622
1622
  */
1623
1623
 
1624
1624
  .np-theme-business--forest-green {
@@ -1803,7 +1803,7 @@
1803
1803
 
1804
1804
  /**
1805
1805
  * Do not edit directly, this file was auto-generated.
1806
- * Generated on Wed, 27 May 2026 15:50:11 GMT
1806
+ * Generated on Tue, 09 Jun 2026 08:11:04 GMT
1807
1807
  */
1808
1808
 
1809
1809
  .np-theme-business--bright-green {
@@ -1990,7 +1990,7 @@
1990
1990
 
1991
1991
  /**
1992
1992
  * Do not edit directly, this file was auto-generated.
1993
- * Generated on Wed, 27 May 2026 15:50:11 GMT
1993
+ * Generated on Tue, 09 Jun 2026 08:11:04 GMT
1994
1994
  */
1995
1995
 
1996
1996
  .wds-sentiment-negative-light-base {
@@ -26549,6 +26549,7 @@ a[data-toggle="tooltip"] {
26549
26549
  }
26550
26550
 
26551
26551
  .np-avatar-view .np-avatar-view-content {
26552
+ --circle-border-color: var(--color-sentiment-border-overlay, var(--color-border-neutral));
26552
26553
  color: #37517e;
26553
26554
  color: var(--color-sentiment-content-primary, var(--color-content-primary));
26554
26555
  }
@@ -28754,12 +28755,15 @@ button.np-option {
28754
28755
  }
28755
28756
 
28756
28757
  .np-flow-navigation {
28758
+ display: flex;
28759
+ align-items: center;
28760
+ justify-content: center;
28757
28761
  width: 100%;
28758
- min-height: 97px;
28762
+ box-sizing: border-box;
28763
+ min-height: 96px;
28759
28764
  }
28760
28765
 
28761
28766
  .np-flow-navigation--border-bottom {
28762
- min-height: 96px;
28763
28767
  border-bottom: 1px solid rgba(0,0,0,0.10196);
28764
28768
  border-bottom: 1px solid var(--color-border-neutral);
28765
28769
  }
@@ -28844,6 +28848,20 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
28844
28848
  visibility: hidden;
28845
28849
  }
28846
28850
 
28851
+ .np-flow-navigation--composable {
28852
+ min-height: 80px;
28853
+ }
28854
+
28855
+ @media (min-width: 320.02px) {
28856
+ .np-flow-navigation--composable {
28857
+ min-height: 128px;
28858
+ }
28859
+ }
28860
+
28861
+ .np-flow-navigation--composable .np-flow-navigation__content {
28862
+ max-width: none;
28863
+ }
28864
+
28847
28865
  .np-theme-personal--forest-green .np-flow-navigation .np-flow-header__left path,
28848
28866
  .np-theme-personal--bright-green .np-flow-navigation .np-flow-header__left path,
28849
28867
  .np-theme-personal--dark .np-flow-navigation .np-flow-header__left path {
@@ -31938,6 +31956,9 @@ html:not([dir="rtl"]) .np-navigation-option {
31938
31956
  --Prompt-actions-gap: var(--size-8);
31939
31957
  --Prompt-gap: var(--size-10) var(--size-16);
31940
31958
  --Prompt-border-radius: 0;
31959
+ --critical-banner-background-base: transparent;
31960
+ --critical-banner-background-surface: var(--color-sentiment-background-surface);
31961
+ --critical-banner-background: linear-gradient(var(--critical-banner-background-surface), var(--critical-banner-background-surface)), var(--critical-banner-background-base);
31941
31962
  container-type: inline-size;
31942
31963
  position: relative;
31943
31964
  --critical-banner-easing: cubic-bezier(0.9, 0, 0.7, 1);
@@ -31946,6 +31967,11 @@ html:not([dir="rtl"]) .np-navigation-option {
31946
31967
  actions only go full-width below mobile-max token (container query) */
31947
31968
  }
31948
31969
 
31970
+ .wds-critical-banner.wds-prompt--neutral {
31971
+ --critical-banner-background-base: var(--color-background-elevated);
31972
+ background: var(--critical-banner-background);
31973
+ }
31974
+
31949
31975
  .wds-critical-banner--media-image {
31950
31976
  width: 48px;
31951
31977
  width: var(--size-48);
@@ -32011,19 +32037,6 @@ html:not([dir="rtl"]) .np-navigation-option {
32011
32037
  min-width: 0;
32012
32038
  max-width: 480px;
32013
32039
  height: 100%;
32014
- padding-top: 3px;
32015
- }
32016
-
32017
- @media (max-width: 320px) {
32018
- .wds-critical-banner__text-wrapper {
32019
- padding-top: 0;
32020
- }
32021
- }
32022
-
32023
- @container (width < 320px) {
32024
- .wds-critical-banner__text-wrapper {
32025
- padding-top: 0;
32026
- }
32027
32040
  }
32028
32041
 
32029
32042
  .wds-critical-banner--collapsed .wds-critical-banner__title,
@@ -32096,6 +32109,15 @@ html:not([dir="rtl"]) .np-navigation-option {
32096
32109
  @container critical-banner-overhang (max-width: 600px) {
32097
32110
  .wds-critical-banner__entry-mask {
32098
32111
  --critical-banner-mobile-overhang-size: 32px;
32112
+ --critical-banner-overhang-mask: radial-gradient(circle at 100% 100%, transparent var(--critical-banner-mobile-overhang-size), #000 var(--critical-banner-mobile-overhang-size)) 0 0 / var(--critical-banner-mobile-overhang-size)
32113
+ var(--critical-banner-mobile-overhang-size) no-repeat,
32114
+ radial-gradient(
32115
+ circle at 0% 100%,
32116
+ transparent var(--critical-banner-mobile-overhang-size),
32117
+ #000 var(--critical-banner-mobile-overhang-size)
32118
+ )
32119
+ 100% 0 / var(--critical-banner-mobile-overhang-size)
32120
+ var(--critical-banner-mobile-overhang-size) no-repeat;
32099
32121
  }
32100
32122
  .wds-critical-banner__entry-mask .wds-critical-banner-overhang {
32101
32123
  margin-bottom: var(--critical-banner-mobile-overhang-size);
@@ -32108,7 +32130,9 @@ html:not([dir="rtl"]) .np-navigation-option {
32108
32130
  left: 0;
32109
32131
  height: var(--critical-banner-mobile-overhang-size);
32110
32132
  pointer-events: none;
32111
- background: radial-gradient(circle at 100% 100%, transparent var(--critical-banner-mobile-overhang-size), var(--color-sentiment-background-surface) var(--critical-banner-mobile-overhang-size)) 0 0 / var(--critical-banner-mobile-overhang-size) var(--critical-banner-mobile-overhang-size) no-repeat, radial-gradient(circle at 0% 100%, transparent var(--critical-banner-mobile-overhang-size), var(--color-sentiment-background-surface) var(--critical-banner-mobile-overhang-size)) 100% 0 / var(--critical-banner-mobile-overhang-size) var(--critical-banner-mobile-overhang-size) no-repeat;
32133
+ background: var(--critical-banner-background);
32134
+ -webkit-mask: var(--critical-banner-overhang-mask);
32135
+ mask: var(--critical-banner-overhang-mask);
32112
32136
  }
32113
32137
  }
32114
32138
 
@@ -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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,MAAMA,WAAW,gBAAGC,cAAA,CAACC,YAAI,KAAG;AAEd,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;;;;"}
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, with `steps={[]}`\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,MAAMA,WAAW,gBAAGC,GAAA,CAACC,IAAI,KAAG;AAEd,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
+ {"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, with `steps={[]}`\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;;;;"}
@@ -60,9 +60,9 @@ const CriticalBanner = ({
60
60
  const descId = React.useId();
61
61
  const ariaLabelledByIds = [media['aria-hidden'] ? undefined : mediaId, !title ? undefined : titleId].filter(Boolean).join(' ');
62
62
  const bannerSurface = /*#__PURE__*/jsxRuntime.jsxs(Container.default, {
63
+ ref: containerRef,
63
64
  size: "fluid",
64
65
  as: PrimitivePrompt.PrimitivePrompt,
65
- ref: containerRef,
66
66
  id: id,
67
67
  sentiment: sentiment,
68
68
  emphasis: sentiment === 'neutral' ? 'base' : 'elevated',