@transferwise/components 46.148.1 → 46.149.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) 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 +31 -14
  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/css/neptune.css +11 -11
  15. package/build/styles/flowNavigation/FlowNavigation.css +16 -2
  16. package/build/styles/less/legacy-variables.less +1 -1
  17. package/build/styles/less/neptune-tokens.less +2 -2
  18. package/build/styles/main.css +31 -14
  19. package/build/styles/props/custom-media.css +1 -1
  20. package/build/styles/props/neptune-tokens.css +1 -1
  21. package/build/styles/sentimentSurface/SentimentSurface.css +1 -1
  22. package/build/styles/styles/less/neptune.css +11 -11
  23. package/build/types/flowNavigation/FlowNavigation.d.ts +15 -3
  24. package/build/types/flowNavigation/FlowNavigation.d.ts.map +1 -1
  25. package/build/types/overlayHeader/OverlayHeader.d.ts +6 -0
  26. package/build/types/overlayHeader/OverlayHeader.d.ts.map +1 -1
  27. package/package.json +15 -15
  28. package/src/body/Body.story.tsx +1 -5
  29. package/src/calendar/Calendar.story.tsx +1 -4
  30. package/src/checkbox/Checkbox.story.tsx +1 -4
  31. package/src/chevron/Chevron.story.tsx +1 -1
  32. package/src/container/Container.story.tsx +1 -4
  33. package/src/dateInput/DateInput.story.tsx +1 -4
  34. package/src/dateLookup/DateLookup.story.tsx +1 -4
  35. package/src/decision/Decision.story.tsx +1 -4
  36. package/src/definitionList/DefinitionList.story.tsx +1 -4
  37. package/src/dimmer/Dimmer.story.tsx +1 -5
  38. package/src/display/Display.story.tsx +1 -4
  39. package/src/emphasis/Emphasis.story.tsx +1 -5
  40. package/src/expressiveMoneyInput/ExpressiveMoneyInput.story.tsx +1 -4
  41. package/src/field/Field.story.tsx +1 -4
  42. package/src/flowNavigation/FlowNavigation.css +16 -2
  43. package/src/flowNavigation/FlowNavigation.less +20 -4
  44. package/src/flowNavigation/FlowNavigation.story.tsx +249 -0
  45. package/src/flowNavigation/FlowNavigation.tsx +91 -58
  46. package/src/header/Header.story.tsx +1 -4
  47. package/src/inputWithDisplayFormat/InputWithDisplayFormat.story.tsx +1 -4
  48. package/src/inputs/InputGroup.story.tsx +1 -4
  49. package/src/inputs/SearchInput.story.tsx +1 -4
  50. package/src/inputs/TextArea.story.tsx +1 -4
  51. package/src/instructionsList/InstructionsList.story.tsx +1 -4
  52. package/src/label/Label.story.tsx +1 -4
  53. package/src/link/Link.story.tsx +1 -4
  54. package/src/loader/Loader.story.tsx +1 -1
  55. package/src/main.css +31 -14
  56. package/src/markdown/Markdown.story.tsx +1 -5
  57. package/src/money/Money.story.tsx +0 -1
  58. package/src/moneyInput/MoneyInput.story.tsx +1 -4
  59. package/src/overlayHeader/OverlayHeader.story.tsx +4 -0
  60. package/src/overlayHeader/OverlayHeader.tsx +6 -0
  61. package/src/phoneNumberInput/PhoneNumberInput.story.tsx +1 -4
  62. package/src/promoCard/PromoCard.story.tsx +1 -4
  63. package/src/promoCard/PromoCardGroup.story.tsx +1 -4
  64. package/src/prompt/CriticalBanner/CriticalBanner.story.tsx +1 -1
  65. package/src/prompt/CriticalBanner/CriticalBanner.tsx +1 -1
  66. package/src/radio/Radio.story.tsx +1 -4
  67. package/src/radioGroup/RadioGroup.story.tsx +1 -4
  68. package/src/segmentedControl/SegmentedControl.story.tsx +1 -4
  69. package/src/sentimentSurface/SentimentSurface.css +1 -1
  70. package/src/statusIcon/StatusIcon.story.tsx +1 -1
  71. package/src/styles/less/neptune.css +11 -11
  72. package/src/textareaWithDisplayFormat/TextareaWithDisplayFormat.story.tsx +1 -4
  73. package/src/title/Title.story.tsx +1 -5
  74. package/src/typeahead/Typeahead.story.tsx +1 -4
  75. package/src/upload/Upload.story.tsx +1 -4
  76. package/src/uploadInput/UploadInput.story.tsx +1 -4
  77. package/src/flowNavigation/FlowNavigation.test.js +0 -190
@@ -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 {
@@ -1,10 +1,7 @@
1
1
  import { StoryObj } from '@storybook/react-webpack5';
2
2
  import { userEvent, within } from 'storybook/test';
3
3
 
4
- import {
5
- createSandboxStory,
6
- globalScope,
7
- } from '../../.storybook/components/sandbox/SandboxEditor';
4
+ import { createSandboxStory, globalScope } from '../../.storybook/components/sandbox/SandboxEditor';
8
5
  import TextareaWithDisplayFormat from './TextareaWithDisplayFormat';
9
6
  import { Field } from '../field/Field';
10
7
 
@@ -1,10 +1,7 @@
1
1
  import { Typography } from '../common/propsValues/typography';
2
2
 
3
3
  import Title from './Title';
4
- import {
5
- createSandboxStory,
6
- globalScope,
7
- } from '../../.storybook/components/sandbox/SandboxEditor';
4
+ import { createSandboxStory, globalScope } from '../../.storybook/components/sandbox/SandboxEditor';
8
5
 
9
6
  export default {
10
7
  component: Title,
@@ -37,4 +34,3 @@ export const Basic = () => {
37
34
  </>
38
35
  );
39
36
  };
40
-
@@ -3,10 +3,7 @@ import { Search as SearchIcon } from '@transferwise/icons';
3
3
  import { userEvent, within, fn } from 'storybook/test';
4
4
  import { useState } from 'react';
5
5
 
6
- import {
7
- createSandboxStory,
8
- globalScope,
9
- } from '../../.storybook/components/sandbox/SandboxEditor';
6
+ import { createSandboxStory, globalScope } from '../../.storybook/components/sandbox/SandboxEditor';
10
7
  import { Sentiment, Size } from '../common';
11
8
  import { Input } from '../inputs/Input';
12
9
  import { Field } from '../field/Field';
@@ -1,10 +1,7 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
2
  import { fn } from 'storybook/test';
3
3
 
4
- import {
5
- createSandboxStory,
6
- globalScope,
7
- } from '../../.storybook/components/sandbox/SandboxEditor';
4
+ import { createSandboxStory, globalScope } from '../../.storybook/components/sandbox/SandboxEditor';
8
5
  import Upload from '.';
9
6
  import { MAX_SIZE_DEFAULT } from './Upload';
10
7
 
@@ -1,9 +1,6 @@
1
1
  import { StoryFn, Meta } from '@storybook/react-webpack5';
2
2
 
3
- import {
4
- createSandboxStory,
5
- globalScope,
6
- } from '../../.storybook/components/sandbox/SandboxEditor';
3
+ import { createSandboxStory, globalScope } from '../../.storybook/components/sandbox/SandboxEditor';
7
4
  import { Field } from '../field/Field';
8
5
 
9
6
  import UploadInput, { UploadInputProps } from './UploadInput';
@@ -1,190 +0,0 @@
1
- import { Breakpoint } from '@transferwise/neptune-tokens';
2
- import AvatarView from '../avatarView';
3
- import { mockMatchMedia, render, screen } from '../test-utils';
4
-
5
- import FlowNavigation from './FlowNavigation';
6
-
7
- mockMatchMedia();
8
-
9
- jest.mock('./animatedLabel', () => {
10
- return function ({ className, activeLabel }) {
11
- return (
12
- <div className={className} data-testid={`activeLabel-${activeLabel}`}>
13
- AnimatedLabel
14
- </div>
15
- );
16
- };
17
- });
18
-
19
- describe('FlowNavigation', () => {
20
- beforeEach(() => {
21
- window.innerWidth = Breakpoint.LARGE + 1;
22
- });
23
-
24
- const props = {
25
- avatar: <AvatarView profileName="Tim Mike" />,
26
- logo: <img alt="logo" src="logo.svg" width="138" height="24" />,
27
- onClose: jest.fn(),
28
- steps: [
29
- {
30
- label: 'label-0',
31
- },
32
- { label: 'label-1' },
33
- { label: 'label-2' },
34
- ],
35
- activeStep: 0,
36
- };
37
-
38
- it(`renders full Logo`, () => {
39
- render(<FlowNavigation {...props} />);
40
- expect(logoFull()).toBeInTheDocument();
41
- });
42
-
43
- it(`renders separator if avatar and onClose are provided`, () => {
44
- const { container } = render(<FlowNavigation {...props} />);
45
-
46
- expect(container.querySelector('span.m-x-1')).toBeInTheDocument();
47
- });
48
-
49
- it(`doesn't render separator if avatar or onClose are not provided`, () => {
50
- const { container, rerender } = render(<FlowNavigation {...props} onClose={null} />);
51
-
52
- expect(container.querySelector('.separator')).not.toBeInTheDocument();
53
-
54
- rerender(<FlowNavigation {...props} avatar={null} />);
55
-
56
- expect(container.querySelector('.separator')).not.toBeInTheDocument();
57
- });
58
-
59
- it(`doesn't render separator if done is true`, () => {
60
- const { container, rerender } = render(<FlowNavigation {...props} onClose={null} />);
61
-
62
- expect(container.querySelector('.separator')).not.toBeInTheDocument();
63
-
64
- rerender(<FlowNavigation {...props} avatar={null} done />);
65
-
66
- expect(container.querySelector('.separator')).not.toBeInTheDocument();
67
- });
68
-
69
- it(`renders border based on done`, () => {
70
- const { container, rerender } = render(<FlowNavigation {...props} onClose={null} />);
71
-
72
- expect(container.querySelector('.np-flow-navigation--border-bottom')).toBeInTheDocument();
73
-
74
- rerender(<FlowNavigation {...props} avatar={null} done />);
75
-
76
- expect(container.querySelector('.np-flow-navigation--border-bottom')).not.toBeInTheDocument();
77
- });
78
-
79
- it(`hides stepper when done is true`, () => {
80
- const { container, rerender } = render(<FlowNavigation {...props} onClose={null} />);
81
-
82
- expect(container.querySelector('.np-flow-navigation__stepper')).toBeInTheDocument();
83
-
84
- rerender(<FlowNavigation {...props} avatar={null} done />);
85
-
86
- expect(container.querySelector('.np-flow-navigation__stepper')).not.toBeInTheDocument();
87
- });
88
-
89
- it(`does not render stepper when steps is empty`, () => {
90
- const { container } = render(<FlowNavigation {...props} steps={[]} />);
91
-
92
- expect(container.querySelector('.np-flow-navigation__stepper')).not.toBeInTheDocument();
93
- expect(container.querySelector('.tw-stepper')).not.toBeInTheDocument();
94
- });
95
-
96
- it(`hides label when done is true`, () => {
97
- const { rerender } = render(<FlowNavigation {...props} done={false} />);
98
-
99
- expect(screen.getByText('label-0')).toBeInTheDocument();
100
-
101
- rerender(<FlowNavigation {...props} done />);
102
-
103
- expect(screen.queryByText('label-0')).not.toBeInTheDocument();
104
- });
105
-
106
- it(`renders xs-max class`, () => {
107
- window.innerWidth = Breakpoint.SMALL - 1;
108
- const { container } = render(<FlowNavigation {...props} onClose={null} />);
109
-
110
- expect(container.querySelector('.np-flow-navigation--xs-max')).toBeInTheDocument();
111
- });
112
-
113
- it(`renders sm class`, () => {
114
- window.innerWidth = Breakpoint.SMALL;
115
- const { container } = render(<FlowNavigation {...props} onClose={null} />);
116
-
117
- expect(container.querySelector('.np-flow-navigation--sm')).toBeInTheDocument();
118
- });
119
-
120
- it(`renders lg class`, () => {
121
- window.innerWidth = Breakpoint.LARGE;
122
- const { container } = render(<FlowNavigation {...props} onClose={null} />);
123
-
124
- expect(container.querySelector('.np-flow-navigation--lg')).toBeInTheDocument();
125
- });
126
-
127
- describe('on mobile', () => {
128
- beforeEach(() => {
129
- window.innerWidth = Breakpoint.SMALL - 1;
130
- });
131
-
132
- it('renders Logo', () => {
133
- render(<FlowNavigation {...props} />);
134
- expect(screen.getByAltText('logo')).toBeInTheDocument();
135
- });
136
-
137
- it('renders flag if activeStep <= 0 onGoBack or is not provided', () => {
138
- const { rerender } = render(
139
- <FlowNavigation {...props} activeStep={0} onGoBack={undefined} />,
140
- );
141
-
142
- const flag = screen.queryByAltText('logo');
143
-
144
- expect(flag).toBeInTheDocument();
145
-
146
- rerender(<FlowNavigation {...props} activeStep={1} onGoBack={undefined} />);
147
-
148
- expect(flag).toBeInTheDocument();
149
-
150
- rerender(<FlowNavigation {...props} activeStep={0} onGoBack={jest.fn()} />);
151
-
152
- expect(flag).toBeInTheDocument();
153
-
154
- rerender(<FlowNavigation {...props} activeStep={1} onGoBack={jest.fn()} />);
155
-
156
- expect(flag).not.toBeInTheDocument();
157
- });
158
-
159
- it('renders BackButton with AnimatedLabel if onGoBack is provided and activeStep > 0', () => {
160
- const { rerender } = render(<FlowNavigation {...props} onGoBack={jest.fn()} />);
161
-
162
- expect(
163
- screen.queryByRole('button', { name: /back to previous step/i }),
164
- ).not.toBeInTheDocument();
165
-
166
- rerender(<FlowNavigation {...props} activeStep={1} />);
167
- expect(
168
- screen.queryByRole('button', { name: /back to previous step/i }),
169
- ).not.toBeInTheDocument();
170
-
171
- rerender(<FlowNavigation {...props} activeStep={1} onGoBack={jest.fn()} />);
172
-
173
- expect(screen.getByRole('button', { name: /back to previous step/i })).toBeInTheDocument();
174
- expect(screen.getByText('AnimatedLabel')).toBeInTheDocument();
175
- });
176
-
177
- it('renders correct AnimatedLabel', () => {
178
- const { rerender } = render(
179
- <FlowNavigation {...props} activeStep={1} onGoBack={jest.fn()} />,
180
- );
181
-
182
- expect(screen.getByTestId('activeLabel-1')).toBeInTheDocument();
183
-
184
- rerender(<FlowNavigation {...props} activeStep={2} onGoBack={jest.fn()} />);
185
-
186
- expect(screen.getByTestId('activeLabel-2')).toBeInTheDocument();
187
- });
188
- });
189
- const logoFull = () => screen.getByAltText(`logo`);
190
- });