@transferwise/components 0.0.0-experimental-20865d1 → 0.0.0-experimental-b73b0cb

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.
@@ -7382,23 +7382,27 @@ const InputWithDisplayFormat = props => /*#__PURE__*/jsx(WithDisplayFormat, {
7382
7382
 
7383
7383
  const InstructionsList = ({
7384
7384
  dos,
7385
- donts
7385
+ donts,
7386
+ sort = 'dosFirst'
7386
7387
  }) => {
7387
- return /*#__PURE__*/jsxs("div", {
7388
+ const dosInstructions = dos?.map((doThis, index) =>
7389
+ /*#__PURE__*/
7390
+ // eslint-disable-next-line react/no-array-index-key
7391
+ jsx(Instruction, {
7392
+ item: doThis,
7393
+ type: "do"
7394
+ }, index)) ?? null;
7395
+ const dontsInstructions = donts?.map((dont, index) =>
7396
+ /*#__PURE__*/
7397
+ // eslint-disable-next-line react/no-array-index-key
7398
+ jsx(Instruction, {
7399
+ item: dont,
7400
+ type: "dont"
7401
+ }, index)) ?? null;
7402
+ const orderedInstructions = sort === 'dosFirst' ? [dosInstructions, dontsInstructions] : [dontsInstructions, dosInstructions];
7403
+ return /*#__PURE__*/jsx("div", {
7388
7404
  className: "tw-instructions",
7389
- children: [dos && dos.map((doThis, index) =>
7390
- /*#__PURE__*/
7391
- // eslint-disable-next-line react/no-array-index-key
7392
- jsx(Instruction, {
7393
- item: doThis,
7394
- type: "do"
7395
- }, index)), donts && donts.map((dont, index) =>
7396
- /*#__PURE__*/
7397
- // eslint-disable-next-line react/no-array-index-key
7398
- jsx(Instruction, {
7399
- item: dont,
7400
- type: "dont"
7401
- }, index))]
7405
+ children: orderedInstructions
7402
7406
  });
7403
7407
  };
7404
7408
  function Instruction({
@@ -7422,7 +7426,6 @@ function Instruction({
7422
7426
  })]
7423
7427
  });
7424
7428
  }
7425
- var InstructionsList$1 = InstructionsList;
7426
7429
 
7427
7430
  const Loader = ({
7428
7431
  small = false,
@@ -12292,12 +12295,7 @@ class Typeahead extends Component {
12292
12295
  query = item.label;
12293
12296
  }
12294
12297
  this.updateSelectedValue(selected);
12295
- if (!item.keepFocusOnSelect) {
12296
- this.hideMenu();
12297
- }
12298
- if (item.clearQueryOnSelect) {
12299
- query = '';
12300
- }
12298
+ this.hideMenu();
12301
12299
  this.setState({
12302
12300
  query
12303
12301
  });
@@ -12421,14 +12419,14 @@ class Typeahead extends Component {
12421
12419
  className: "dropdown-menu",
12422
12420
  role: "menu",
12423
12421
  "aria-labelledby": "dropdownMenu1",
12424
- children: [optionsToRender.length > 0 ? optionsToRender.map((option, idx) => /*#__PURE__*/jsx(Option, {
12422
+ children: [optionsToRender.map((option, idx) => /*#__PURE__*/jsx(Option, {
12425
12423
  query: query,
12426
12424
  option: option,
12427
12425
  selected: keyboardFocusedOptionIndex === idx,
12428
12426
  onClick: event => {
12429
12427
  this.onOptionSelected(event, option);
12430
12428
  }
12431
- }, `${option.label}${idx.toString()}`)) : null, footer]
12429
+ }, `${option.label}${idx.toString()}`)), footer]
12432
12430
  })
12433
12431
  });
12434
12432
  };
@@ -12524,10 +12522,10 @@ class Typeahead extends Component {
12524
12522
  children: /*#__PURE__*/jsx(Cross, {})
12525
12523
  })
12526
12524
  })]
12527
- }), displayAlert ? /*#__PURE__*/jsx(InlineAlert, {
12525
+ }), displayAlert && /*#__PURE__*/jsx(InlineAlert, {
12528
12526
  type: alert.type,
12529
12527
  children: alert.message
12530
- }) : menu]
12528
+ }), menu]
12531
12529
  })
12532
12530
  });
12533
12531
  }
@@ -15153,5 +15151,5 @@ const translations = {
15153
15151
  'zh-HK': zhHK
15154
15152
  };
15155
15153
 
15156
- export { Accordion, ActionButton, ActionOption, Alert$1 as Alert, ArrowPosition as AlertArrowPosition, Avatar, AvatarType, AvatarWrapper, Badge, Card as BaseCard, Body, BottomSheet$2 as BottomSheet, Breakpoint, Button, Card$2 as Card, Checkbox$1 as Checkbox, CheckboxButton$1 as CheckboxButton, CheckboxOption, Chevron, Chip, Chips, CircularButton$1 as CircularButton, ControlType, CriticalCommsBanner, DEFAULT_LANG, DEFAULT_LOCALE, DateInput, DateLookup$1 as DateLookup, DateMode, Decision, DecisionPresentation, DecisionType, DefinitionList$1 as DefinitionList, Dimmer$1 as Dimmer, Direction, DirectionProvider, Display, Drawer$1 as Drawer, DropFade, DynamicFieldDefinitionList$1 as DynamicFieldDefinitionList, Emphasis, FileType, FlowNavigation, Header, Image, Info, InfoPresentation, InlineAlert, Input, InputGroup, InputWithDisplayFormat, InstructionsList$1 as InstructionsList, LanguageProvider, Layout, Link, ListItem$1 as ListItem, Loader$1 as Loader, Logo$1 as Logo, LogoType, Markdown$1 as Markdown, MarkdownNodeType, Modal, Money$1 as Money, MoneyInput$1 as MoneyInput, MonthFormat, NavigationOption, NavigationOptionList$1 as NavigationOptionsList, Nudge, Option$2 as Option, OverlayHeader$1 as OverlayHeader, PhoneNumberInput, Popover$2 as Popover, Position, Priority, ProcessIndicator$1 as ProcessIndicator, ProfileType, Progress, ProgressBar, PromoCard$1 as PromoCard, PromoCard$1 as PromoCardGroup, Provider$1 as Provider, RTL_LANGUAGES, Radio, RadioGroup, RadioOption, SUPPORTED_LANGUAGES, Scroll, SearchInput, Section, SegmentedControl, Select, SelectInput, SelectInputOptionContent, SelectInputTriggerButton, Sentiment, Size, SlidingPanel$1 as SlidingPanel, SnackbarConsumer, SnackbarContext, SnackbarPortal, SnackbarProvider, Status, StatusIcon, Stepper, Sticky$1 as Sticky, Summary, Switch, SwitchOption, Tabs$1 as Tabs, TextArea, TextareaWithDisplayFormat, Theme, Title, Tooltip$1 as Tooltip, Type, Typeahead, Typography, Upload$1 as Upload, UploadInput, UploadStep, Variant, Width, adjustLocale, getCountryFromLocale, getDirectionFromLocale, getLangFromLocale, isBrowser, isServerSide, translations, useDirection, useLayout, useScreenSize, useSnackbar };
15154
+ export { Accordion, ActionButton, ActionOption, Alert$1 as Alert, ArrowPosition as AlertArrowPosition, Avatar, AvatarType, AvatarWrapper, Badge, Card as BaseCard, Body, BottomSheet$2 as BottomSheet, Breakpoint, Button, Card$2 as Card, Checkbox$1 as Checkbox, CheckboxButton$1 as CheckboxButton, CheckboxOption, Chevron, Chip, Chips, CircularButton$1 as CircularButton, ControlType, CriticalCommsBanner, DEFAULT_LANG, DEFAULT_LOCALE, DateInput, DateLookup$1 as DateLookup, DateMode, Decision, DecisionPresentation, DecisionType, DefinitionList$1 as DefinitionList, Dimmer$1 as Dimmer, Direction, DirectionProvider, Display, Drawer$1 as Drawer, DropFade, DynamicFieldDefinitionList$1 as DynamicFieldDefinitionList, Emphasis, FileType, FlowNavigation, Header, Image, Info, InfoPresentation, InlineAlert, Input, InputGroup, InputWithDisplayFormat, InstructionsList, LanguageProvider, Layout, Link, ListItem$1 as ListItem, Loader$1 as Loader, Logo$1 as Logo, LogoType, Markdown$1 as Markdown, MarkdownNodeType, Modal, Money$1 as Money, MoneyInput$1 as MoneyInput, MonthFormat, NavigationOption, NavigationOptionList$1 as NavigationOptionsList, Nudge, Option$2 as Option, OverlayHeader$1 as OverlayHeader, PhoneNumberInput, Popover$2 as Popover, Position, Priority, ProcessIndicator$1 as ProcessIndicator, ProfileType, Progress, ProgressBar, PromoCard$1 as PromoCard, PromoCard$1 as PromoCardGroup, Provider$1 as Provider, RTL_LANGUAGES, Radio, RadioGroup, RadioOption, SUPPORTED_LANGUAGES, Scroll, SearchInput, Section, SegmentedControl, Select, SelectInput, SelectInputOptionContent, SelectInputTriggerButton, Sentiment, Size, SlidingPanel$1 as SlidingPanel, SnackbarConsumer, SnackbarContext, SnackbarPortal, SnackbarProvider, Status, StatusIcon, Stepper, Sticky$1 as Sticky, Summary, Switch, SwitchOption, Tabs$1 as Tabs, TextArea, TextareaWithDisplayFormat, Theme, Title, Tooltip$1 as Tooltip, Type, Typeahead, Typography, Upload$1 as Upload, UploadInput, UploadStep, Variant, Width, adjustLocale, getCountryFromLocale, getDirectionFromLocale, getLangFromLocale, isBrowser, isServerSide, translations, useDirection, useLayout, useScreenSize, useSnackbar };
15157
15155
  //# sourceMappingURL=index.esm.js.map