@transferwise/components 46.15.0 → 46.16.0
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 +26 -17
- package/build/index.esm.js.map +1 -1
- package/build/index.js +26 -17
- 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/moneyInput/MoneyInput.d.ts +1 -0
- package/build/types/moneyInput/MoneyInput.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 +31 -17
- package/src/instructionsList/index.ts +3 -0
- package/src/moneyInput/MoneyInput.rtl.spec.tsx +12 -0
- package/src/moneyInput/MoneyInput.tsx +12 -2
- package/src/instructionsList/index.js +0 -3
package/build/index.js
CHANGED
|
@@ -7416,23 +7416,31 @@ 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' ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
7437
|
+
children: [dosInstructions, dontsInstructions]
|
|
7438
|
+
}) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
7439
|
+
children: [dontsInstructions, dosInstructions]
|
|
7440
|
+
});
|
|
7441
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7422
7442
|
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))]
|
|
7443
|
+
children: orderedInstructions
|
|
7436
7444
|
});
|
|
7437
7445
|
};
|
|
7438
7446
|
function Instruction({
|
|
@@ -7456,7 +7464,6 @@ function Instruction({
|
|
|
7456
7464
|
})]
|
|
7457
7465
|
});
|
|
7458
7466
|
}
|
|
7459
|
-
var InstructionsList$1 = InstructionsList;
|
|
7460
7467
|
|
|
7461
7468
|
const Loader = ({
|
|
7462
7469
|
small = false,
|
|
@@ -7791,6 +7798,7 @@ class MoneyInput extends React.Component {
|
|
|
7791
7798
|
size,
|
|
7792
7799
|
addon,
|
|
7793
7800
|
id,
|
|
7801
|
+
'aria-labelledby': ariaLabelledBy,
|
|
7794
7802
|
selectProps,
|
|
7795
7803
|
maxLengthOverride
|
|
7796
7804
|
} = this.props;
|
|
@@ -7814,6 +7822,7 @@ class MoneyInput extends React.Component {
|
|
|
7814
7822
|
const isFixedCurrency = !this.state.searchQuery && hasSingleCurrency() || !onCurrencyChange;
|
|
7815
7823
|
const disabled = !this.props.onAmountChange;
|
|
7816
7824
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7825
|
+
"aria-labelledby": ariaLabelledBy,
|
|
7817
7826
|
className: classNames__default.default(this.style('tw-money-input'), this.style('input-group'), this.style(`input-group-${size}`)),
|
|
7818
7827
|
children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
|
|
7819
7828
|
id: id,
|
|
@@ -15223,7 +15232,7 @@ exports.InlineAlert = InlineAlert;
|
|
|
15223
15232
|
exports.Input = Input;
|
|
15224
15233
|
exports.InputGroup = InputGroup;
|
|
15225
15234
|
exports.InputWithDisplayFormat = InputWithDisplayFormat;
|
|
15226
|
-
exports.InstructionsList = InstructionsList
|
|
15235
|
+
exports.InstructionsList = InstructionsList;
|
|
15227
15236
|
exports.LanguageProvider = LanguageProvider;
|
|
15228
15237
|
exports.Link = Link;
|
|
15229
15238
|
exports.ListItem = ListItem$1;
|