@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.js
CHANGED
|
@@ -7602,42 +7602,34 @@ const InputWithDisplayFormat = props => /*#__PURE__*/jsxRuntime.jsx(WithDisplayF
|
|
|
7602
7602
|
|
|
7603
7603
|
const InstructionsList = ({
|
|
7604
7604
|
dos,
|
|
7605
|
-
donts
|
|
7606
|
-
overrideCircleFillIcons = false
|
|
7605
|
+
donts
|
|
7607
7606
|
}) => {
|
|
7608
7607
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7609
7608
|
className: "tw-instructions",
|
|
7610
|
-
children: [dos && dos.map((doThis, index) =>
|
|
7609
|
+
children: [dos && dos.map((doThis, index) =>
|
|
7610
|
+
/*#__PURE__*/
|
|
7611
7611
|
// eslint-disable-next-line react/no-array-index-key
|
|
7612
|
-
, {
|
|
7612
|
+
jsxRuntime.jsx(Instruction, {
|
|
7613
7613
|
item: doThis,
|
|
7614
|
-
type: "do"
|
|
7615
|
-
|
|
7616
|
-
|
|
7614
|
+
type: "do"
|
|
7615
|
+
}, index)), donts && donts.map((dont, index) =>
|
|
7616
|
+
/*#__PURE__*/
|
|
7617
7617
|
// eslint-disable-next-line react/no-array-index-key
|
|
7618
|
-
, {
|
|
7618
|
+
jsxRuntime.jsx(Instruction, {
|
|
7619
7619
|
item: dont,
|
|
7620
|
-
type: "dont"
|
|
7621
|
-
overrideCircleFillIcons: overrideCircleFillIcons
|
|
7620
|
+
type: "dont"
|
|
7622
7621
|
}, index))]
|
|
7623
7622
|
});
|
|
7624
7623
|
};
|
|
7625
7624
|
function Instruction({
|
|
7626
7625
|
item,
|
|
7627
|
-
type
|
|
7628
|
-
overrideCircleFillIcons
|
|
7626
|
+
type
|
|
7629
7627
|
}) {
|
|
7630
7628
|
const isInstructionNode = typeof item === 'object' && item !== null && 'content' in item && 'aria-label' in item;
|
|
7631
7629
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7632
7630
|
className: "instruction",
|
|
7633
7631
|
"aria-label": isInstructionNode ? item['aria-label'] : undefined,
|
|
7634
|
-
children: [
|
|
7635
|
-
size: 24,
|
|
7636
|
-
className: type
|
|
7637
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(icons.Cross, {
|
|
7638
|
-
size: 24,
|
|
7639
|
-
className: type
|
|
7640
|
-
}) : type === 'do' ? /*#__PURE__*/jsxRuntime.jsx(icons.CheckCircleFill, {
|
|
7632
|
+
children: [type === 'do' ? /*#__PURE__*/jsxRuntime.jsx(icons.CheckCircleFill, {
|
|
7641
7633
|
size: 24,
|
|
7642
7634
|
className: type
|
|
7643
7635
|
}) : /*#__PURE__*/jsxRuntime.jsx(icons.CrossCircleFill, {
|
|
@@ -12592,16 +12584,16 @@ class Typeahead extends React.Component {
|
|
|
12592
12584
|
label: query
|
|
12593
12585
|
});
|
|
12594
12586
|
} else {
|
|
12595
|
-
switch (event.
|
|
12596
|
-
case
|
|
12587
|
+
switch (event.key) {
|
|
12588
|
+
case 'ArrowDown':
|
|
12597
12589
|
event.preventDefault();
|
|
12598
12590
|
this.moveFocusedOption(1);
|
|
12599
12591
|
break;
|
|
12600
|
-
case
|
|
12592
|
+
case 'ArrowUp':
|
|
12601
12593
|
event.preventDefault();
|
|
12602
12594
|
this.moveFocusedOption(-1);
|
|
12603
12595
|
break;
|
|
12604
|
-
case
|
|
12596
|
+
case 'Enter':
|
|
12605
12597
|
event.preventDefault();
|
|
12606
12598
|
if (options[keyboardFocusedOptionIndex]) {
|
|
12607
12599
|
this.selectItem(options[keyboardFocusedOptionIndex]);
|
|
@@ -12611,7 +12603,7 @@ class Typeahead extends React.Component {
|
|
|
12611
12603
|
});
|
|
12612
12604
|
}
|
|
12613
12605
|
break;
|
|
12614
|
-
case
|
|
12606
|
+
case 'Backspace':
|
|
12615
12607
|
if (multiple && !query && selected.length > 0) {
|
|
12616
12608
|
this.updateSelectedValue(selected.slice(0, -1));
|
|
12617
12609
|
}
|