@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
@@ -4239,6 +4239,7 @@ class DateLookup extends PureComponent {
4239
4239
  return /*#__PURE__*/jsxs("div", {
4240
4240
  // eslint-disable-line jsx-a11y/no-static-element-interactions
4241
4241
  ref: this.element,
4242
+ id: this.props.id,
4242
4243
  "aria-labelledby": ariaLabelledBy,
4243
4244
  className: "input-group",
4244
4245
  onKeyDown: this.handleKeyDown,
@@ -4263,6 +4264,7 @@ class DateLookup extends PureComponent {
4263
4264
  }
4264
4265
  }
4265
4266
  DateLookup.propTypes = {
4267
+ id: PropTypes.string,
4266
4268
  value: PropTypes.instanceOf(Date),
4267
4269
  min: PropTypes.instanceOf(Date),
4268
4270
  max: PropTypes.instanceOf(Date),
@@ -7369,7 +7371,7 @@ const InstructionsList = ({
7369
7371
  }) : /*#__PURE__*/jsxs(Fragment, {
7370
7372
  children: [dontsInstructions, dosInstructions]
7371
7373
  });
7372
- return /*#__PURE__*/jsx("div", {
7374
+ return /*#__PURE__*/jsx("ul", {
7373
7375
  className: "tw-instructions",
7374
7376
  children: orderedInstructions
7375
7377
  });
@@ -7379,7 +7381,7 @@ function Instruction({
7379
7381
  type
7380
7382
  }) {
7381
7383
  const isInstructionNode = typeof item === 'object' && item !== null && 'content' in item && 'aria-label' in item;
7382
- return /*#__PURE__*/jsxs("div", {
7384
+ return /*#__PURE__*/jsxs("li", {
7383
7385
  className: "instruction",
7384
7386
  "aria-label": isInstructionNode ? item['aria-label'] : undefined,
7385
7387
  children: [type === 'do' ? /*#__PURE__*/jsx(CheckCircleFill, {
@@ -12266,7 +12268,12 @@ class Typeahead extends Component {
12266
12268
  query = item.label;
12267
12269
  }
12268
12270
  this.updateSelectedValue(selected);
12269
- this.hideMenu();
12271
+ if (!item.keepFocusOnSelect) {
12272
+ this.hideMenu();
12273
+ }
12274
+ if (item.clearQueryOnSelect) {
12275
+ query = '';
12276
+ }
12270
12277
  this.setState({
12271
12278
  query
12272
12279
  });
@@ -12493,10 +12500,10 @@ class Typeahead extends Component {
12493
12500
  children: /*#__PURE__*/jsx(Cross, {})
12494
12501
  })
12495
12502
  })]
12496
- }), displayAlert && /*#__PURE__*/jsx(InlineAlert, {
12503
+ }), displayAlert ? /*#__PURE__*/jsx(InlineAlert, {
12497
12504
  type: alert.type,
12498
12505
  children: alert.message
12499
- }), menu]
12506
+ }) : menu]
12500
12507
  })
12501
12508
  });
12502
12509
  }