@transferwise/components 46.17.3 → 46.18.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 (37) hide show
  1. package/build/index.esm.js +12 -5
  2. package/build/index.esm.js.map +1 -1
  3. package/build/index.js +12 -5
  4. package/build/index.js.map +1 -1
  5. package/build/main.css +4 -0
  6. package/build/styles/instructionsList/InstructionsList.css +4 -0
  7. package/build/styles/main.css +4 -0
  8. package/build/types/accordion/Accordion.d.ts +3 -7
  9. package/build/types/accordion/Accordion.d.ts.map +1 -1
  10. package/build/types/accordion/index.d.ts +1 -0
  11. package/build/types/accordion/index.d.ts.map +1 -1
  12. package/build/types/body/Body.d.ts +1 -1
  13. package/build/types/dateLookup/DateLookup.d.ts +1 -0
  14. package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
  15. package/build/types/index.d.ts +2 -1
  16. package/build/types/index.d.ts.map +1 -1
  17. package/build/types/radioGroup/RadioGroup.d.ts +2 -1
  18. package/build/types/radioGroup/RadioGroup.d.ts.map +1 -1
  19. package/build/types/radioGroup/index.d.ts +1 -1
  20. package/build/types/radioGroup/index.d.ts.map +1 -1
  21. package/build/types/typeahead/Typeahead.d.ts +3 -1
  22. package/build/types/typeahead/Typeahead.d.ts.map +1 -1
  23. package/package.json +1 -1
  24. package/src/accordion/Accordion.tsx +6 -7
  25. package/src/accordion/index.ts +1 -0
  26. package/src/dateLookup/DateLookup.js +2 -0
  27. package/src/dateLookup/DateLookup.story.js +3 -0
  28. package/src/dateLookup/DateLookup.view.spec.js +5 -0
  29. package/src/index.ts +2 -1
  30. package/src/instructionsList/InstructionsList.css +4 -0
  31. package/src/instructionsList/InstructionsList.less +5 -0
  32. package/src/instructionsList/InstructionsList.tsx +3 -3
  33. package/src/main.css +4 -0
  34. package/src/radioGroup/RadioGroup.tsx +6 -1
  35. package/src/radioGroup/index.ts +1 -1
  36. package/src/typeahead/Typeahead.story.tsx +109 -0
  37. package/src/typeahead/Typeahead.tsx +12 -3
package/build/index.js CHANGED
@@ -4272,6 +4272,7 @@ class DateLookup extends React.PureComponent {
4272
4272
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
4273
4273
  // eslint-disable-line jsx-a11y/no-static-element-interactions
4274
4274
  ref: this.element,
4275
+ id: this.props.id,
4275
4276
  "aria-labelledby": ariaLabelledBy,
4276
4277
  className: "input-group",
4277
4278
  onKeyDown: this.handleKeyDown,
@@ -4296,6 +4297,7 @@ class DateLookup extends React.PureComponent {
4296
4297
  }
4297
4298
  }
4298
4299
  DateLookup.propTypes = {
4300
+ id: PropTypes__default.default.string,
4299
4301
  value: PropTypes__default.default.instanceOf(Date),
4300
4302
  min: PropTypes__default.default.instanceOf(Date),
4301
4303
  max: PropTypes__default.default.instanceOf(Date),
@@ -7402,7 +7404,7 @@ const InstructionsList = ({
7402
7404
  }) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
7403
7405
  children: [dontsInstructions, dosInstructions]
7404
7406
  });
7405
- return /*#__PURE__*/jsxRuntime.jsx("div", {
7407
+ return /*#__PURE__*/jsxRuntime.jsx("ul", {
7406
7408
  className: "tw-instructions",
7407
7409
  children: orderedInstructions
7408
7410
  });
@@ -7412,7 +7414,7 @@ function Instruction({
7412
7414
  type
7413
7415
  }) {
7414
7416
  const isInstructionNode = typeof item === 'object' && item !== null && 'content' in item && 'aria-label' in item;
7415
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
7417
+ return /*#__PURE__*/jsxRuntime.jsxs("li", {
7416
7418
  className: "instruction",
7417
7419
  "aria-label": isInstructionNode ? item['aria-label'] : undefined,
7418
7420
  children: [type === 'do' ? /*#__PURE__*/jsxRuntime.jsx(icons.CheckCircleFill, {
@@ -12299,7 +12301,12 @@ class Typeahead extends React.Component {
12299
12301
  query = item.label;
12300
12302
  }
12301
12303
  this.updateSelectedValue(selected);
12302
- this.hideMenu();
12304
+ if (!item.keepFocusOnSelect) {
12305
+ this.hideMenu();
12306
+ }
12307
+ if (item.clearQueryOnSelect) {
12308
+ query = '';
12309
+ }
12303
12310
  this.setState({
12304
12311
  query
12305
12312
  });
@@ -12526,10 +12533,10 @@ class Typeahead extends React.Component {
12526
12533
  children: /*#__PURE__*/jsxRuntime.jsx(icons.Cross, {})
12527
12534
  })
12528
12535
  })]
12529
- }), displayAlert && /*#__PURE__*/jsxRuntime.jsx(InlineAlert, {
12536
+ }), displayAlert ? /*#__PURE__*/jsxRuntime.jsx(InlineAlert, {
12530
12537
  type: alert.type,
12531
12538
  children: alert.message
12532
- }), menu]
12539
+ }) : menu]
12533
12540
  })
12534
12541
  });
12535
12542
  }