@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.
- package/build/index.esm.js +25 -27
- package/build/index.esm.js.map +1 -1
- package/build/index.js +25 -27
- package/build/index.js.map +1 -1
- package/build/types/index.d.ts +1 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/instructionsList/InstructionsList.d.ts +4 -2
- package/build/types/instructionsList/InstructionsList.d.ts.map +1 -1
- package/build/types/instructionsList/index.d.ts +2 -2
- package/build/types/instructionsList/index.d.ts.map +1 -1
- package/build/types/typeahead/Typeahead.d.ts +0 -2
- package/build/types/typeahead/Typeahead.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/instructionsList/InstructionsList.spec.tsx +14 -0
- package/src/instructionsList/{InstructionList.story.tsx → InstructionsList.story.tsx} +14 -2
- package/src/instructionsList/InstructionsList.tsx +23 -17
- package/src/instructionsList/index.ts +3 -0
- package/src/typeahead/Typeahead.tsx +14 -25
- package/src/instructionsList/index.js +0 -3
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
|
-
|
|
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:
|
|
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,
|
|
@@ -12326,12 +12329,7 @@ class Typeahead extends React.Component {
|
|
|
12326
12329
|
query = item.label;
|
|
12327
12330
|
}
|
|
12328
12331
|
this.updateSelectedValue(selected);
|
|
12329
|
-
|
|
12330
|
-
this.hideMenu();
|
|
12331
|
-
}
|
|
12332
|
-
if (item.clearQueryOnSelect) {
|
|
12333
|
-
query = '';
|
|
12334
|
-
}
|
|
12332
|
+
this.hideMenu();
|
|
12335
12333
|
this.setState({
|
|
12336
12334
|
query
|
|
12337
12335
|
});
|
|
@@ -12455,14 +12453,14 @@ class Typeahead extends React.Component {
|
|
|
12455
12453
|
className: "dropdown-menu",
|
|
12456
12454
|
role: "menu",
|
|
12457
12455
|
"aria-labelledby": "dropdownMenu1",
|
|
12458
|
-
children: [optionsToRender.
|
|
12456
|
+
children: [optionsToRender.map((option, idx) => /*#__PURE__*/jsxRuntime.jsx(Option, {
|
|
12459
12457
|
query: query,
|
|
12460
12458
|
option: option,
|
|
12461
12459
|
selected: keyboardFocusedOptionIndex === idx,
|
|
12462
12460
|
onClick: event => {
|
|
12463
12461
|
this.onOptionSelected(event, option);
|
|
12464
12462
|
}
|
|
12465
|
-
}, `${option.label}${idx.toString()}`))
|
|
12463
|
+
}, `${option.label}${idx.toString()}`)), footer]
|
|
12466
12464
|
})
|
|
12467
12465
|
});
|
|
12468
12466
|
};
|
|
@@ -12558,10 +12556,10 @@ class Typeahead extends React.Component {
|
|
|
12558
12556
|
children: /*#__PURE__*/jsxRuntime.jsx(icons.Cross, {})
|
|
12559
12557
|
})
|
|
12560
12558
|
})]
|
|
12561
|
-
}), displayAlert
|
|
12559
|
+
}), displayAlert && /*#__PURE__*/jsxRuntime.jsx(InlineAlert, {
|
|
12562
12560
|
type: alert.type,
|
|
12563
12561
|
children: alert.message
|
|
12564
|
-
})
|
|
12562
|
+
}), menu]
|
|
12565
12563
|
})
|
|
12566
12564
|
});
|
|
12567
12565
|
}
|
|
@@ -15228,7 +15226,7 @@ exports.InlineAlert = InlineAlert;
|
|
|
15228
15226
|
exports.Input = Input;
|
|
15229
15227
|
exports.InputGroup = InputGroup;
|
|
15230
15228
|
exports.InputWithDisplayFormat = InputWithDisplayFormat;
|
|
15231
|
-
exports.InstructionsList = InstructionsList
|
|
15229
|
+
exports.InstructionsList = InstructionsList;
|
|
15232
15230
|
exports.LanguageProvider = LanguageProvider;
|
|
15233
15231
|
exports.Link = Link;
|
|
15234
15232
|
exports.ListItem = ListItem$1;
|