@transferwise/components 0.0.0-experimental-32cf8db → 0.0.0-experimental-68c810c

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
@@ -7489,47 +7489,48 @@ InputWithDisplayFormat.propTypes = {
7489
7489
  };
7490
7490
  var InputWithDisplayFormat$1 = InputWithDisplayFormat;
7491
7491
 
7492
- const InstructionsList = props => {
7493
- const {
7494
- isModern
7495
- } = componentsTheming.useTheme();
7496
- const {
7497
- dos,
7498
- donts
7499
- } = props;
7500
- const DontIcon = isModern ? icons.CrossCircleFill : icons.CrossCircle;
7501
- const DoIcon = isModern ? icons.CheckCircleFill : icons.CheckCircle;
7492
+ const InstructionsList = ({
7493
+ dos,
7494
+ donts
7495
+ }) => {
7502
7496
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
7503
7497
  className: "tw-instructions",
7504
7498
  children: [dos && dos.map((doThis, index) =>
7505
7499
  /*#__PURE__*/
7506
7500
  // eslint-disable-next-line react/no-array-index-key
7507
- jsxRuntime.jsxs("div", {
7508
- className: "instruction",
7509
- children: [/*#__PURE__*/jsxRuntime.jsx(DoIcon, {
7510
- size: 24,
7511
- className: "do"
7512
- }), /*#__PURE__*/jsxRuntime.jsx(Body, {
7513
- className: "text-primary",
7514
- type: exports.Typography.BODY_LARGE,
7515
- children: doThis
7516
- })]
7501
+ jsxRuntime.jsx(Instruction, {
7502
+ item: doThis,
7503
+ type: "do"
7517
7504
  }, index)), donts && donts.map((dont, index) =>
7518
7505
  /*#__PURE__*/
7519
7506
  // eslint-disable-next-line react/no-array-index-key
7520
- jsxRuntime.jsxs("div", {
7521
- className: "instruction",
7522
- children: [/*#__PURE__*/jsxRuntime.jsx(DontIcon, {
7523
- size: 24,
7524
- className: "dont"
7525
- }), /*#__PURE__*/jsxRuntime.jsx(Body, {
7526
- className: "text-primary",
7527
- type: exports.Typography.BODY_LARGE,
7528
- children: dont
7529
- })]
7507
+ jsxRuntime.jsx(Instruction, {
7508
+ item: dont,
7509
+ type: "dont"
7530
7510
  }, index))]
7531
7511
  });
7532
7512
  };
7513
+ function Instruction({
7514
+ item,
7515
+ type
7516
+ }) {
7517
+ const isInstructionNode = typeof item === 'object' && item !== null && 'content' in item && 'aria-label' in item;
7518
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
7519
+ className: "instruction",
7520
+ "aria-label": isInstructionNode ? item['aria-label'] : undefined,
7521
+ children: [type === 'do' ? /*#__PURE__*/jsxRuntime.jsx(icons.CheckCircleFill, {
7522
+ size: 24,
7523
+ className: type
7524
+ }) : /*#__PURE__*/jsxRuntime.jsx(icons.CrossCircleFill, {
7525
+ size: 24,
7526
+ className: type
7527
+ }), /*#__PURE__*/jsxRuntime.jsx(Body, {
7528
+ className: "text-primary",
7529
+ type: exports.Typography.BODY_LARGE,
7530
+ children: isInstructionNode ? item.content : item
7531
+ })]
7532
+ });
7533
+ }
7533
7534
  var InstructionsList$1 = InstructionsList;
7534
7535
 
7535
7536
  const Loader = ({