@transferwise/components 0.0.0-experimental-c8fc1dc → 0.0.0-experimental-10c3d0b
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 +16 -24
- package/build/index.esm.js.map +1 -1
- package/build/index.js +16 -24
- package/build/index.js.map +1 -1
- package/build/types/instructionsList/InstructionsList.d.ts +2 -4
- package/build/types/instructionsList/InstructionsList.d.ts.map +1 -1
- package/build/types/typeahead/Typeahead.d.ts.map +1 -1
- package/package.json +16 -19
- package/src/button/Button.story.tsx +3 -3
- package/src/common/fakeEvents.js +18 -0
- package/src/dateInput/DateInput.story.tsx +4 -3
- package/src/dateLookup/DateLookup.story.js +4 -3
- package/src/dateLookup/dateTrigger/DateTrigger.spec.js +3 -2
- package/src/info/Info.story.tsx +3 -3
- package/src/inputWithDisplayFormat/InputWithDisplayFormat.story.js +2 -7
- package/src/inputs/SelectInput.story.tsx +7 -7
- package/src/instructionsList/InstructionList.story.tsx +0 -1
- package/src/instructionsList/InstructionsList.tsx +12 -41
- package/src/logo/Logo.js +4 -4
- package/src/moneyInput/MoneyInput.story.tsx +3 -3
- package/src/snackbar/Snackbar.story.tsx +3 -3
- package/src/textareaWithDisplayFormat/TextareaWithDisplayFormat.story.tsx +5 -4
- package/src/tooltip/Tooltip.story.tsx +3 -3
- package/src/typeahead/Typeahead.js +5 -6
- package/src/typeahead/Typeahead.spec.js +0 -2
- package/src/typeahead/Typeahead.story.js +3 -4
package/build/index.esm.js
CHANGED
|
@@ -7568,42 +7568,34 @@ const InputWithDisplayFormat = props => /*#__PURE__*/jsx(WithDisplayFormat, {
|
|
|
7568
7568
|
|
|
7569
7569
|
const InstructionsList = ({
|
|
7570
7570
|
dos,
|
|
7571
|
-
donts
|
|
7572
|
-
overrideCircleFillIcons = false
|
|
7571
|
+
donts
|
|
7573
7572
|
}) => {
|
|
7574
7573
|
return /*#__PURE__*/jsxs("div", {
|
|
7575
7574
|
className: "tw-instructions",
|
|
7576
|
-
children: [dos && dos.map((doThis, index) =>
|
|
7575
|
+
children: [dos && dos.map((doThis, index) =>
|
|
7576
|
+
/*#__PURE__*/
|
|
7577
7577
|
// eslint-disable-next-line react/no-array-index-key
|
|
7578
|
-
, {
|
|
7578
|
+
jsx(Instruction, {
|
|
7579
7579
|
item: doThis,
|
|
7580
|
-
type: "do"
|
|
7581
|
-
|
|
7582
|
-
|
|
7580
|
+
type: "do"
|
|
7581
|
+
}, index)), donts && donts.map((dont, index) =>
|
|
7582
|
+
/*#__PURE__*/
|
|
7583
7583
|
// eslint-disable-next-line react/no-array-index-key
|
|
7584
|
-
, {
|
|
7584
|
+
jsx(Instruction, {
|
|
7585
7585
|
item: dont,
|
|
7586
|
-
type: "dont"
|
|
7587
|
-
overrideCircleFillIcons: overrideCircleFillIcons
|
|
7586
|
+
type: "dont"
|
|
7588
7587
|
}, index))]
|
|
7589
7588
|
});
|
|
7590
7589
|
};
|
|
7591
7590
|
function Instruction({
|
|
7592
7591
|
item,
|
|
7593
|
-
type
|
|
7594
|
-
overrideCircleFillIcons
|
|
7592
|
+
type
|
|
7595
7593
|
}) {
|
|
7596
7594
|
const isInstructionNode = typeof item === 'object' && item !== null && 'content' in item && 'aria-label' in item;
|
|
7597
7595
|
return /*#__PURE__*/jsxs("div", {
|
|
7598
7596
|
className: "instruction",
|
|
7599
7597
|
"aria-label": isInstructionNode ? item['aria-label'] : undefined,
|
|
7600
|
-
children: [
|
|
7601
|
-
size: 24,
|
|
7602
|
-
className: type
|
|
7603
|
-
}) : /*#__PURE__*/jsx(Cross, {
|
|
7604
|
-
size: 24,
|
|
7605
|
-
className: type
|
|
7606
|
-
}) : type === 'do' ? /*#__PURE__*/jsx(CheckCircleFill, {
|
|
7598
|
+
children: [type === 'do' ? /*#__PURE__*/jsx(CheckCircleFill, {
|
|
7607
7599
|
size: 24,
|
|
7608
7600
|
className: type
|
|
7609
7601
|
}) : /*#__PURE__*/jsx(CrossCircleFill, {
|
|
@@ -12558,16 +12550,16 @@ class Typeahead extends Component {
|
|
|
12558
12550
|
label: query
|
|
12559
12551
|
});
|
|
12560
12552
|
} else {
|
|
12561
|
-
switch (event.
|
|
12562
|
-
case
|
|
12553
|
+
switch (event.key) {
|
|
12554
|
+
case 'ArrowDown':
|
|
12563
12555
|
event.preventDefault();
|
|
12564
12556
|
this.moveFocusedOption(1);
|
|
12565
12557
|
break;
|
|
12566
|
-
case
|
|
12558
|
+
case 'ArrowUp':
|
|
12567
12559
|
event.preventDefault();
|
|
12568
12560
|
this.moveFocusedOption(-1);
|
|
12569
12561
|
break;
|
|
12570
|
-
case
|
|
12562
|
+
case 'Enter':
|
|
12571
12563
|
event.preventDefault();
|
|
12572
12564
|
if (options[keyboardFocusedOptionIndex]) {
|
|
12573
12565
|
this.selectItem(options[keyboardFocusedOptionIndex]);
|
|
@@ -12577,7 +12569,7 @@ class Typeahead extends Component {
|
|
|
12577
12569
|
});
|
|
12578
12570
|
}
|
|
12579
12571
|
break;
|
|
12580
|
-
case
|
|
12572
|
+
case 'Backspace':
|
|
12581
12573
|
if (multiple && !query && selected.length > 0) {
|
|
12582
12574
|
this.updateSelectedValue(selected.slice(0, -1));
|
|
12583
12575
|
}
|