@transferwise/components 0.0.0-experimental-892d236 → 0.0.0-experimental-5d4d1ec

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.
package/build/index.js CHANGED
@@ -7416,23 +7416,27 @@ const InputWithDisplayFormat = props => /*#__PURE__*/jsxRuntime.jsx(WithDisplayF
7416
7416
 
7417
7417
  const InstructionsList = ({
7418
7418
  dos,
7419
- donts
7419
+ donts,
7420
+ sort = 'dosFirst'
7420
7421
  }) => {
7421
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
7422
+ const dosInstructions = dos?.map((doThis, index) =>
7423
+ /*#__PURE__*/
7424
+ // eslint-disable-next-line react/no-array-index-key
7425
+ jsxRuntime.jsx(Instruction, {
7426
+ item: doThis,
7427
+ type: "do"
7428
+ }, index)) ?? null;
7429
+ const dontsInstructions = donts?.map((dont, index) =>
7430
+ /*#__PURE__*/
7431
+ // eslint-disable-next-line react/no-array-index-key
7432
+ jsxRuntime.jsx(Instruction, {
7433
+ item: dont,
7434
+ type: "dont"
7435
+ }, index)) ?? null;
7436
+ const orderedInstructions = sort === 'dosFirst' ? [dosInstructions, dontsInstructions] : [dontsInstructions, dosInstructions];
7437
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
7422
7438
  className: "tw-instructions",
7423
- children: [dos && dos.map((doThis, index) =>
7424
- /*#__PURE__*/
7425
- // eslint-disable-next-line react/no-array-index-key
7426
- jsxRuntime.jsx(Instruction, {
7427
- item: doThis,
7428
- type: "do"
7429
- }, index)), donts && donts.map((dont, index) =>
7430
- /*#__PURE__*/
7431
- // eslint-disable-next-line react/no-array-index-key
7432
- jsxRuntime.jsx(Instruction, {
7433
- item: dont,
7434
- type: "dont"
7435
- }, index))]
7439
+ children: orderedInstructions
7436
7440
  });
7437
7441
  };
7438
7442
  function Instruction({
@@ -7456,7 +7460,6 @@ function Instruction({
7456
7460
  })]
7457
7461
  });
7458
7462
  }
7459
- var InstructionsList$1 = InstructionsList;
7460
7463
 
7461
7464
  const Loader = ({
7462
7465
  small = false,
@@ -15223,7 +15226,7 @@ exports.InlineAlert = InlineAlert;
15223
15226
  exports.Input = Input;
15224
15227
  exports.InputGroup = InputGroup;
15225
15228
  exports.InputWithDisplayFormat = InputWithDisplayFormat;
15226
- exports.InstructionsList = InstructionsList$1;
15229
+ exports.InstructionsList = InstructionsList;
15227
15230
  exports.LanguageProvider = LanguageProvider;
15228
15231
  exports.Link = Link;
15229
15232
  exports.ListItem = ListItem$1;