@transferwise/components 46.93.0 → 46.93.2

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 (172) hide show
  1. package/build/button/LegacyButton.js +0 -2
  2. package/build/button/LegacyButton.js.map +1 -1
  3. package/build/button/LegacyButton.mjs +0 -2
  4. package/build/button/LegacyButton.mjs.map +1 -1
  5. package/build/carousel/Carousel.js +1 -3
  6. package/build/carousel/Carousel.js.map +1 -1
  7. package/build/carousel/Carousel.mjs +1 -3
  8. package/build/carousel/Carousel.mjs.map +1 -1
  9. package/build/checkbox/Checkbox.js.map +1 -1
  10. package/build/checkbox/Checkbox.mjs.map +1 -1
  11. package/build/checkboxButton/CheckboxButton.js +1 -1
  12. package/build/checkboxButton/CheckboxButton.js.map +1 -1
  13. package/build/checkboxButton/CheckboxButton.mjs +1 -1
  14. package/build/checkboxButton/CheckboxButton.mjs.map +1 -1
  15. package/build/checkboxOption/CheckboxOption.js.map +1 -1
  16. package/build/checkboxOption/CheckboxOption.mjs.map +1 -1
  17. package/build/common/bottomSheet/BottomSheet.js.map +1 -1
  18. package/build/common/bottomSheet/BottomSheet.mjs.map +1 -1
  19. package/build/common/dateUtils/isDateValid/isDateValid.js +3 -3
  20. package/build/common/dateUtils/isDateValid/isDateValid.js.map +1 -1
  21. package/build/common/dateUtils/isDateValid/isDateValid.mjs +3 -3
  22. package/build/common/dateUtils/isDateValid/isDateValid.mjs.map +1 -1
  23. package/build/common/panel/Panel.js +3 -8
  24. package/build/common/panel/Panel.js.map +1 -1
  25. package/build/common/panel/Panel.mjs +3 -8
  26. package/build/common/panel/Panel.mjs.map +1 -1
  27. package/build/dimmer/dimmerManager/DimmerManager.js.map +1 -1
  28. package/build/dimmer/dimmerManager/DimmerManager.mjs.map +1 -1
  29. package/build/dropFade/DropFade.js.map +1 -1
  30. package/build/dropFade/DropFade.mjs.map +1 -1
  31. package/build/emphasis/EmphasisHtmlTransformer.js.map +1 -1
  32. package/build/emphasis/EmphasisHtmlTransformer.mjs.map +1 -1
  33. package/build/inputs/Input.js +1 -3
  34. package/build/inputs/Input.js.map +1 -1
  35. package/build/inputs/Input.mjs +1 -3
  36. package/build/inputs/Input.mjs.map +1 -1
  37. package/build/inputs/SelectInput.js +1 -3
  38. package/build/inputs/SelectInput.js.map +1 -1
  39. package/build/inputs/SelectInput.mjs +1 -3
  40. package/build/inputs/SelectInput.mjs.map +1 -1
  41. package/build/inputs/_ButtonInput.js +1 -3
  42. package/build/inputs/_ButtonInput.js.map +1 -1
  43. package/build/inputs/_ButtonInput.mjs +1 -3
  44. package/build/inputs/_ButtonInput.mjs.map +1 -1
  45. package/build/inputs/_Popover.js +1 -3
  46. package/build/inputs/_Popover.js.map +1 -1
  47. package/build/inputs/_Popover.mjs +1 -3
  48. package/build/inputs/_Popover.mjs.map +1 -1
  49. package/build/moneyInput/currencyFormatting.js +2 -2
  50. package/build/moneyInput/currencyFormatting.js.map +1 -1
  51. package/build/moneyInput/currencyFormatting.mjs +2 -2
  52. package/build/moneyInput/currencyFormatting.mjs.map +1 -1
  53. package/build/nudge/Nudge.js +0 -2
  54. package/build/nudge/Nudge.js.map +1 -1
  55. package/build/nudge/Nudge.mjs +0 -2
  56. package/build/nudge/Nudge.mjs.map +1 -1
  57. package/build/promoCard/PromoCardContext.js +0 -1
  58. package/build/promoCard/PromoCardContext.js.map +1 -1
  59. package/build/promoCard/PromoCardContext.mjs +0 -1
  60. package/build/promoCard/PromoCardContext.mjs.map +1 -1
  61. package/build/promoCard/PromoCardGroup.js +0 -1
  62. package/build/promoCard/PromoCardGroup.js.map +1 -1
  63. package/build/promoCard/PromoCardGroup.mjs +0 -1
  64. package/build/promoCard/PromoCardGroup.mjs.map +1 -1
  65. package/build/select/Select.js +19 -25
  66. package/build/select/Select.js.map +1 -1
  67. package/build/select/Select.mjs +19 -25
  68. package/build/select/Select.mjs.map +1 -1
  69. package/build/table/Table.js +1 -3
  70. package/build/table/Table.js.map +1 -1
  71. package/build/table/Table.mjs +1 -3
  72. package/build/table/Table.mjs.map +1 -1
  73. package/build/tooltip/Tooltip.js +2 -6
  74. package/build/tooltip/Tooltip.js.map +1 -1
  75. package/build/tooltip/Tooltip.mjs +2 -6
  76. package/build/tooltip/Tooltip.mjs.map +1 -1
  77. package/build/typeahead/typeaheadInput/TypeaheadInput.js +4 -1
  78. package/build/typeahead/typeaheadInput/TypeaheadInput.js.map +1 -1
  79. package/build/typeahead/typeaheadInput/TypeaheadInput.mjs +4 -1
  80. package/build/typeahead/typeaheadInput/TypeaheadInput.mjs.map +1 -1
  81. package/build/types/button/LegacyButton.d.ts.map +1 -1
  82. package/build/types/carousel/Carousel.d.ts.map +1 -1
  83. package/build/types/checkbox/Checkbox.d.ts.map +1 -1
  84. package/build/types/checkboxOption/CheckboxOption.d.ts +1 -2
  85. package/build/types/checkboxOption/CheckboxOption.d.ts.map +1 -1
  86. package/build/types/common/bottomSheet/BottomSheet.d.ts.map +1 -1
  87. package/build/types/common/dateUtils/isDateValid/isDateValid.d.ts.map +1 -1
  88. package/build/types/common/panel/Panel.d.ts.map +1 -1
  89. package/build/types/dimmer/dimmerManager/DimmerManager.d.ts +1 -1
  90. package/build/types/dimmer/dimmerManager/DimmerManager.d.ts.map +1 -1
  91. package/build/types/dropFade/DropFade.d.ts.map +1 -1
  92. package/build/types/emphasis/EmphasisHtmlTransformer.d.ts +2 -2
  93. package/build/types/emphasis/EmphasisHtmlTransformer.d.ts.map +1 -1
  94. package/build/types/inputs/Input.d.ts.map +1 -1
  95. package/build/types/inputs/SelectInput.d.ts.map +1 -1
  96. package/build/types/inputs/_ButtonInput.d.ts.map +1 -1
  97. package/build/types/inputs/_Popover.d.ts.map +1 -1
  98. package/build/types/nudge/Nudge.d.ts.map +1 -1
  99. package/build/types/promoCard/PromoCardContext.d.ts.map +1 -1
  100. package/build/types/promoCard/PromoCardGroup.d.ts.map +1 -1
  101. package/build/types/select/Select.d.ts.map +1 -1
  102. package/build/types/table/Table.d.ts.map +1 -1
  103. package/build/types/tooltip/Tooltip.d.ts.map +1 -1
  104. package/build/types/typeahead/typeaheadInput/TypeaheadInput.d.ts.map +1 -1
  105. package/build/types/withId/story/source.d.ts +1 -1
  106. package/build/types/withId/story/source.d.ts.map +1 -1
  107. package/build/upload/steps/completeStep/completeStep.js +1 -0
  108. package/build/upload/steps/completeStep/completeStep.js.map +1 -1
  109. package/build/upload/steps/completeStep/completeStep.mjs +1 -0
  110. package/build/upload/steps/completeStep/completeStep.mjs.map +1 -1
  111. package/build/upload/steps/processingStep/processingStep.js +1 -0
  112. package/build/upload/steps/processingStep/processingStep.js.map +1 -1
  113. package/build/upload/steps/processingStep/processingStep.mjs +1 -0
  114. package/build/upload/steps/processingStep/processingStep.mjs.map +1 -1
  115. package/package.json +6 -3
  116. package/src/accordion/Accordion.story.tsx +2 -2
  117. package/src/alert/Alert.story.tsx +4 -4
  118. package/src/alert/Alert.tests.story.tsx +3 -3
  119. package/src/button/LegacyButton.tsx +0 -2
  120. package/src/carousel/Carousel.spec.tsx +0 -4
  121. package/src/carousel/Carousel.tsx +0 -1
  122. package/src/checkbox/Checkbox.tsx +0 -1
  123. package/src/checkboxButton/CheckboxButton.story.tsx +0 -2
  124. package/src/checkboxButton/CheckboxButton.tsx +1 -1
  125. package/src/checkboxOption/CheckboxOption.tsx +1 -2
  126. package/src/common/bottomSheet/BottomSheet.spec.tsx +0 -1
  127. package/src/common/bottomSheet/BottomSheet.story.tsx +1 -1
  128. package/src/common/bottomSheet/BottomSheet.tsx +0 -1
  129. package/src/common/dateUtils/isDateValid/isDateValid.ts +5 -3
  130. package/src/common/hooks/useHasIntersected/useHasIntersected.spec.js +0 -2
  131. package/src/common/panel/Panel.tsx +2 -13
  132. package/src/dimmer/Dimmer.spec.tsx +3 -1
  133. package/src/dimmer/Dimmer.story.tsx +3 -2
  134. package/src/dimmer/dimmerManager/DimmerManager.ts +1 -1
  135. package/src/display/Display.story.tsx +0 -2
  136. package/src/drawer/Drawer.story.tsx +6 -4
  137. package/src/dropFade/DropFade.story.tsx +1 -2
  138. package/src/dropFade/DropFade.tsx +0 -1
  139. package/src/emphasis/EmphasisHtmlTransformer.spec.tsx +4 -4
  140. package/src/emphasis/EmphasisHtmlTransformer.ts +2 -2
  141. package/src/flowNavigation/FlowNavigation.story.tsx +6 -1
  142. package/src/inputs/Input.tsx +0 -1
  143. package/src/inputs/SelectInput.story.tsx +6 -2
  144. package/src/inputs/SelectInput.tsx +1 -7
  145. package/src/inputs/_ButtonInput.tsx +0 -1
  146. package/src/inputs/_Popover.tsx +0 -1
  147. package/src/link/Link.story.tsx +0 -1
  148. package/src/listItem/ListItem.story.tsx +0 -2
  149. package/src/markdown/Markdown.spec.tsx +0 -1
  150. package/src/modal/Modal.story.tsx +14 -4
  151. package/src/moneyInput/currencyFormatting.ts +3 -3
  152. package/src/nudge/Nudge.tsx +0 -2
  153. package/src/popover/Popover.story.tsx +10 -2
  154. package/src/promoCard/PromoCardContext.tsx +0 -1
  155. package/src/promoCard/PromoCardGroup.story.tsx +3 -15
  156. package/src/promoCard/PromoCardGroup.tsx +0 -1
  157. package/src/provider/theme/ThemeProvider.story.tsx +3 -5
  158. package/src/select/Select.spec.tsx +0 -1
  159. package/src/select/Select.tsx +0 -3
  160. package/src/select/option/Option.spec.js +2 -2
  161. package/src/selectOption/SelectOption.story.tsx +1 -2
  162. package/src/slidingPanel/SlidingPanel.story.tsx +1 -1
  163. package/src/table/Table.tsx +0 -1
  164. package/src/test-utils/jest.setup.ts +0 -1
  165. package/src/tooltip/Tooltip.tsx +0 -2
  166. package/src/typeahead/Typeahead.story.tsx +46 -0
  167. package/src/typeahead/typeaheadInput/TypeaheadInput.tsx +4 -1
  168. package/src/upload/Upload.events.spec.js +4 -4
  169. package/src/upload/steps/completeStep/completeStep.tsx +1 -1
  170. package/src/upload/steps/processingStep/processingStep.tsx +1 -1
  171. package/src/withId/story/source.tsx +1 -1
  172. package/src/withId/withId.story.tsx +3 -1
@@ -30,11 +30,13 @@ export interface StoryContentProps {
30
30
  }
31
31
 
32
32
  const StoryContent = ({ args, screenMode }: StoryContentProps) => {
33
- // eslint-disable-next-line react-hooks/rules-of-hooks
34
33
  const [open, setOpen] = useState(args.open);
34
+
35
35
  return (
36
36
  <>
37
- <Button onClick={() => setOpen(true)}>Open Modal</Button>
37
+ <Button v2 onClick={() => setOpen(true)}>
38
+ Open Modal
39
+ </Button>
38
40
  <Modal
39
41
  {...args}
40
42
  body={
@@ -62,7 +64,11 @@ export const Basic: Story = {
62
64
  title: 'Title',
63
65
  body: lorem10,
64
66
  scroll: Scroll.VIEWPORT,
65
- footer: <Button block>Action</Button>,
67
+ footer: (
68
+ <Button v2 block>
69
+ Action
70
+ </Button>
71
+ ),
66
72
  },
67
73
  render: (args) => <StoryContent args={args} />,
68
74
  };
@@ -103,7 +109,11 @@ export const WithThemeProviderInContent: Story = {
103
109
  title: lorem10,
104
110
  body: lorem100,
105
111
  scroll: Scroll.VIEWPORT,
106
- footer: <Button block>Action</Button>,
112
+ footer: (
113
+ <Button v2 block>
114
+ Action
115
+ </Button>
116
+ ),
107
117
  },
108
118
  render: (args, { globals: { screenMode } }) => (
109
119
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
@@ -67,12 +67,12 @@ export function parseAmount(number: string, currency: string, locale = DEFAULT_L
67
67
  const precision = getCurrencyDecimals(currency);
68
68
  const groupSeparator = isNumberLocaleSupported() ? (10000).toLocaleString(validLocale)[2] : ',';
69
69
  const decimalSeparator = getDecimalSeparator(validLocale);
70
- const numberWithStandardDecimalSeparator = (number ? `${number}` : '')
70
+ const numberWithStandardDecimalSeparator = (number || '')
71
71
  .replace(new RegExp(`\\${groupSeparator}`, 'g'), '')
72
72
  .replace(new RegExp(`\\${decimalSeparator}`, 'g'), '.')
73
73
  .replace(/[^0-9.]/g, '');
74
- const parsedAmount = parseFloat(
75
- parseFloat(numberWithStandardDecimalSeparator).toFixed(precision),
74
+ const parsedAmount = Number.parseFloat(
75
+ Number.parseFloat(numberWithStandardDecimalSeparator).toFixed(precision),
76
76
  );
77
77
  return Math.abs(parsedAmount);
78
78
  }
@@ -22,7 +22,6 @@ const getLocalStorage = (): string[] => {
22
22
  return storage.map((item) => String(item));
23
23
  }
24
24
  }
25
- // eslint-disable-next-line unicorn/prefer-optional-catch-binding, no-empty
26
25
  } catch (error) {}
27
26
 
28
27
  return [];
@@ -101,7 +100,6 @@ const Nudge = ({
101
100
  if (persistDismissal && id) {
102
101
  try {
103
102
  localStorage.setItem(STORAGE_NAME, JSON.stringify([...dismissedNudgesStorage, id]));
104
- // eslint-disable-next-line unicorn/prefer-optional-catch-binding, no-empty
105
103
  } catch (error) {}
106
104
 
107
105
  setIsDismissed(true);
@@ -31,7 +31,11 @@ export default {
31
31
  preferredPlacement: Position.BOTTOM,
32
32
  title: 'Guaranteed rate',
33
33
  content: <Content />,
34
- children: <Button onClick={action(`I'm also triggered`)}>Click here to Open Popover!</Button>,
34
+ children: (
35
+ <Button v2 onClick={action(`I'm also triggered`)}>
36
+ Click here to Open Popover!
37
+ </Button>
38
+ ),
35
39
  },
36
40
  argTypes: {
37
41
  preferredPlacement: {
@@ -61,6 +65,10 @@ export const WithoutVisibleTitle: Story = {
61
65
  title: undefined,
62
66
  'aria-label': 'Guaranteed rate',
63
67
  content: <Content />,
64
- children: <Button onClick={action(`I'm also triggered`)}>Click here to Open Popover!</Button>,
68
+ children: (
69
+ <Button v2 onClick={action(`I'm also triggered`)}>
70
+ Click here to Open Popover!
71
+ </Button>
72
+ ),
65
73
  },
66
74
  } satisfies Meta<typeof Popover>;
@@ -33,7 +33,6 @@ interface PromoCardContextType {
33
33
  const defaultPromoCardContext: PromoCardContextType = {
34
34
  state: '',
35
35
  isDisabled: false,
36
- // eslint-disable-next-line @typescript-eslint/no-empty-function
37
36
  onChange: () => {},
38
37
  };
39
38
 
@@ -51,32 +51,20 @@ type Story = StoryObj<typeof PromoCardGroup>;
51
51
 
52
52
  export const Default: Story = {
53
53
  args: {
54
- children: (
55
- <>
56
- <PromoCards />
57
- </>
58
- ),
54
+ children: <PromoCards />,
59
55
  },
60
56
  };
61
57
 
62
58
  export const DefaultChecked: Story = {
63
59
  args: {
64
- children: (
65
- <>
66
- <PromoCards />
67
- </>
68
- ),
60
+ children: <PromoCards />,
69
61
  defaultChecked: 'standard',
70
62
  },
71
63
  };
72
64
 
73
65
  export const Disabled: Story = {
74
66
  args: {
75
- children: (
76
- <>
77
- <PromoCards />
78
- </>
79
- ),
67
+ children: <PromoCards />,
80
68
  isDisabled: true,
81
69
  },
82
70
  };
@@ -64,7 +64,6 @@ const PromoCardGroup: FunctionComponent<PromoCardGroupProps> = ({
64
64
  defaultChecked = '',
65
65
  id,
66
66
  isDisabled = false,
67
- // eslint-disable-next-line @typescript-eslint/no-empty-function
68
67
  onChange = () => {},
69
68
  testId,
70
69
  }) => {
@@ -12,10 +12,8 @@ type Story = StoryObj<typeof ThemeProvider>;
12
12
 
13
13
  export const PlatformTheme: Story = {
14
14
  render: () => (
15
- <>
16
- <ThemeProvider theme="platform">
17
- <Button>Button</Button>
18
- </ThemeProvider>
19
- </>
15
+ <ThemeProvider theme="platform">
16
+ <Button>Button</Button>
17
+ </ThemeProvider>
20
18
  ),
21
19
  };
@@ -31,7 +31,6 @@ describe('Select', () => {
31
31
  beforeEach(() => {
32
32
  global.requestAnimationFrame = (callback) => setTimeout(callback, 16);
33
33
 
34
- // eslint-disable-next-line jest/prefer-spy-on
35
34
  Element.prototype.scrollIntoView = mockScrollIntoView;
36
35
 
37
36
  enableDesktopScreen();
@@ -448,12 +448,10 @@ export default function Select({
448
448
  );
449
449
  }
450
450
 
451
- // eslint-disable-next-line react/prop-types
452
451
  function SeparatorOption() {
453
452
  return <li className={s('np-separator')} aria-hidden />;
454
453
  }
455
454
 
456
- // eslint-disable-next-line react/prop-types
457
455
  function HeaderOption({ children }: { children?: React.ReactNode }) {
458
456
  return (
459
457
  <li // eslint-disable-line jsx-a11y/no-noninteractive-element-interactions
@@ -500,7 +498,6 @@ export default function Select({
500
498
  : createSelectHandlerForOption(selectOption);
501
499
 
502
500
  return (
503
- /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */
504
501
  <li
505
502
  ref={isFocusedWithKeyboard ? keyboardFocusedReference : undefined}
506
503
  key={index}
@@ -17,12 +17,12 @@ describe('option', () => {
17
17
 
18
18
  it('renders the given small note', () => {
19
19
  component.setProps({ note: 'whadup' });
20
- expect(component.find(Body).last().props().children).toStrictEqual('whadup');
20
+ expect(component.find(Body).last().props().children).toBe('whadup');
21
21
  });
22
22
 
23
23
  it('renders the given secondary text in a separate line', () => {
24
24
  component.setProps({ secondary: 'secondary text' });
25
- expect(component.find(Body).last().props().children).toStrictEqual('secondary text');
25
+ expect(component.find(Body).last().props().children).toBe('secondary text');
26
26
  });
27
27
 
28
28
  it('renders a given icon', () => {
@@ -175,8 +175,8 @@ export const Basic: Story = {
175
175
  options: balances,
176
176
  },
177
177
  render: (args: SelectOptionProps) => {
178
- // eslint-disable-next-line react-hooks/rules-of-hooks
179
178
  const [selected, setSelected] = useState<SelectOptionValue | undefined>(undefined);
179
+
180
180
  function onChange(value: SelectOptionValue): void {
181
181
  setSelected(value);
182
182
  }
@@ -194,7 +194,6 @@ export const Basic: Story = {
194
194
 
195
195
  export const Variants: Story = {
196
196
  render: () => {
197
- // eslint-disable-next-line react-hooks/rules-of-hooks
198
197
  const [selected, setSelected] = useState<SelectOptionValue<CustomData>>({
199
198
  ...paymentMethods[1].options[1],
200
199
  content: null,
@@ -17,7 +17,7 @@ export const Basic = () => {
17
17
 
18
18
  return (
19
19
  <>
20
- <Button style={{ marginTop: 80 }} onClick={() => setOpen(!open)}>
20
+ <Button v2 style={{ marginTop: 80 }} onClick={() => setOpen(!open)}>
21
21
  Open Sliding Panel
22
22
  </Button>
23
23
  <SlidingPanel open={open} position={position}>
@@ -113,7 +113,6 @@ const Table = ({
113
113
  'np-table-outer-container--center': !fullWidth,
114
114
  'np-table-outer-container--full-width': fullWidth,
115
115
  })}
116
- // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
117
116
  tabIndex={0}
118
117
  data-testid="np-table-outer-container"
119
118
  >
@@ -7,7 +7,6 @@ import fetchMock from 'jest-fetch-mock';
7
7
 
8
8
  global.fetch = fetchMock as unknown as typeof global.fetch;
9
9
 
10
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
11
10
  Enzyme.configure({ adapter: new Adapter() });
12
11
 
13
12
  global.requestAnimationFrame = (callback: (time: number) => void): number => {
@@ -98,7 +98,6 @@ const Tooltip = ({
98
98
  open ? `np-panel--open np-tooltip--open` : null,
99
99
  className,
100
100
  )}
101
- // eslint-disable-next-line react/forbid-dom-props
102
101
  style={{ ...styles.popper }}
103
102
  {...attributes.popper}
104
103
  aria-hidden={!open}
@@ -111,7 +110,6 @@ const Tooltip = ({
111
110
  // @ts-expect-error
112
111
  ref={setArrowElement}
113
112
  className={clsx('np-panel__arrow')}
114
- // eslint-disable-next-line react/forbid-dom-props
115
113
  style={styles.arrow}
116
114
  />
117
115
  </div>
@@ -7,6 +7,8 @@ import { Size } from '../common';
7
7
  import { useState } from 'react';
8
8
  import { Input } from '../inputs/Input';
9
9
  import { Field } from '../field/Field';
10
+ import Button from '../button';
11
+ import Modal from '../modal';
10
12
 
11
13
  type Story = StoryObj<typeof Typeahead>;
12
14
 
@@ -231,3 +233,47 @@ export const Search: Story = {
231
233
  );
232
234
  },
233
235
  };
236
+
237
+ export const AutoFocusInModal: Story = {
238
+ render: function Render() {
239
+ const [open, setOpen] = useState<boolean>(true);
240
+ return (
241
+ <>
242
+ <Button v2 onClick={() => setOpen(true)}>
243
+ Open Modal
244
+ </Button>
245
+ <Modal
246
+ title="Global Search"
247
+ body={
248
+ <Typeahead
249
+ id="typeahead"
250
+ name="search-input"
251
+ // eslint-disable-next-line jsx-a11y/no-autofocus
252
+ autoFocus
253
+ size="md"
254
+ showSuggestions
255
+ showNewEntry={false}
256
+ addon={<SearchIcon size={24} />}
257
+ options={[
258
+ { label: 'Option 1' },
259
+ { label: 'Option 2' },
260
+ { label: 'Option 3' },
261
+ { label: 'Option 4' },
262
+ ]}
263
+ inputAutoComplete="off"
264
+ onSearch={(search) => {
265
+ console.log(search);
266
+ }}
267
+ onChange={(option) => {}}
268
+ onBlur={() => {}}
269
+ />
270
+ }
271
+ open={open}
272
+ onClose={() => {
273
+ setOpen(false);
274
+ }}
275
+ />
276
+ </>
277
+ );
278
+ },
279
+ };
@@ -46,7 +46,10 @@ export default class TypeaheadInput<T> extends Component<
46
46
  componentDidMount() {
47
47
  const { autoFocus } = this.props;
48
48
  if (autoFocus) {
49
- this.inputRef.current?.focus();
49
+ // Autofocus after context code executions (e.g open Modal) is completed
50
+ setTimeout(() => {
51
+ this.inputRef.current?.focus();
52
+ });
50
53
  }
51
54
  }
52
55
 
@@ -31,19 +31,19 @@ describe('Upload (events)', () => {
31
31
 
32
32
  it('increments dragCounter on dragenter', () => {
33
33
  component.find('.droppable').simulate('dragenter', new Event('event'));
34
- expect(component.instance().dragCounter).toStrictEqual(1);
34
+ expect(component.instance().dragCounter).toBe(1);
35
35
  });
36
36
 
37
37
  it('decrements dragCounter on dragleave', () => {
38
38
  component.find('.droppable').simulate('dragleave', new Event('event'));
39
- expect(component.instance().dragCounter).toStrictEqual(-1);
39
+ expect(component.instance().dragCounter).toBe(-1);
40
40
  });
41
41
 
42
42
  it('reset dragCounter on drop', () => {
43
43
  component.find('.droppable').simulate('dragenter', new Event('event'));
44
- expect(component.instance().dragCounter).toStrictEqual(1);
44
+ expect(component.instance().dragCounter).toBe(1);
45
45
  component.find('.droppable').simulate('drop', new Event('event'));
46
- expect(component.instance().dragCounter).toStrictEqual(0);
46
+ expect(component.instance().dragCounter).toBe(0);
47
47
  });
48
48
  });
49
49
  });
@@ -49,7 +49,7 @@ export default function CompleteStep({
49
49
  )}
50
50
  </div>
51
51
  {csButtonText && (
52
- <Button className="m-t-1" onClick={onClear}>
52
+ <Button v2 className="m-t-1" onClick={onClear}>
53
53
  {csButtonText}
54
54
  </Button>
55
55
  )}
@@ -43,7 +43,7 @@ export default function ProcessingStep({
43
43
  {psProcessingText}
44
44
  </Title>
45
45
  {psButtonText && (
46
- <Button disabled={psButtonDisabled} onClick={onClear}>
46
+ <Button v2 disabled={psButtonDisabled} onClick={onClear}>
47
47
  {psButtonText}
48
48
  </Button>
49
49
  )}
@@ -7,7 +7,7 @@ type DescribedButtonWithIdProps = WithIdProps<DescribedButtonProps>;
7
7
  function DescribedButton({ id }: DescribedButtonWithIdProps) {
8
8
  return (
9
9
  <>
10
- <Button aria-describedby={id}>Continue</Button>
10
+ <Button v2 aria-describedby={id}>Continue</Button>
11
11
 
12
12
  <p id={id} className="text-xs-center m-t-2">
13
13
  Enter an amount in either GBP or PLN
@@ -9,7 +9,9 @@ type DescribedButtonWithIdProps = WithIdProps<DescribedButtonProps>;
9
9
  function CustomButton({ id }: DescribedButtonWithIdProps) {
10
10
  return (
11
11
  <>
12
- <Button aria-describedby={id}>Continue</Button>
12
+ <Button v2 aria-describedby={id}>
13
+ Continue
14
+ </Button>
13
15
 
14
16
  <p id={id} className="text-xs-center m-t-2">
15
17
  Enter an amount in either GBP or PLN