@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.
@@ -7455,47 +7455,48 @@ InputWithDisplayFormat.propTypes = {
7455
7455
  };
7456
7456
  var InputWithDisplayFormat$1 = InputWithDisplayFormat;
7457
7457
 
7458
- const InstructionsList = props => {
7459
- const {
7460
- isModern
7461
- } = useTheme();
7462
- const {
7463
- dos,
7464
- donts
7465
- } = props;
7466
- const DontIcon = isModern ? CrossCircleFill : CrossCircle;
7467
- const DoIcon = isModern ? CheckCircleFill : CheckCircle;
7458
+ const InstructionsList = ({
7459
+ dos,
7460
+ donts
7461
+ }) => {
7468
7462
  return /*#__PURE__*/jsxs("div", {
7469
7463
  className: "tw-instructions",
7470
7464
  children: [dos && dos.map((doThis, index) =>
7471
7465
  /*#__PURE__*/
7472
7466
  // eslint-disable-next-line react/no-array-index-key
7473
- jsxs("div", {
7474
- className: "instruction",
7475
- children: [/*#__PURE__*/jsx(DoIcon, {
7476
- size: 24,
7477
- className: "do"
7478
- }), /*#__PURE__*/jsx(Body, {
7479
- className: "text-primary",
7480
- type: Typography.BODY_LARGE,
7481
- children: doThis
7482
- })]
7467
+ jsx(Instruction, {
7468
+ item: doThis,
7469
+ type: "do"
7483
7470
  }, index)), donts && donts.map((dont, index) =>
7484
7471
  /*#__PURE__*/
7485
7472
  // eslint-disable-next-line react/no-array-index-key
7486
- jsxs("div", {
7487
- className: "instruction",
7488
- children: [/*#__PURE__*/jsx(DontIcon, {
7489
- size: 24,
7490
- className: "dont"
7491
- }), /*#__PURE__*/jsx(Body, {
7492
- className: "text-primary",
7493
- type: Typography.BODY_LARGE,
7494
- children: dont
7495
- })]
7473
+ jsx(Instruction, {
7474
+ item: dont,
7475
+ type: "dont"
7496
7476
  }, index))]
7497
7477
  });
7498
7478
  };
7479
+ function Instruction({
7480
+ item,
7481
+ type
7482
+ }) {
7483
+ const isInstructionNode = typeof item === 'object' && item !== null && 'content' in item && 'aria-label' in item;
7484
+ return /*#__PURE__*/jsxs("div", {
7485
+ className: "instruction",
7486
+ "aria-label": isInstructionNode ? item['aria-label'] : undefined,
7487
+ children: [type === 'do' ? /*#__PURE__*/jsx(CheckCircleFill, {
7488
+ size: 24,
7489
+ className: type
7490
+ }) : /*#__PURE__*/jsx(CrossCircleFill, {
7491
+ size: 24,
7492
+ className: type
7493
+ }), /*#__PURE__*/jsx(Body, {
7494
+ className: "text-primary",
7495
+ type: Typography.BODY_LARGE,
7496
+ children: isInstructionNode ? item.content : item
7497
+ })]
7498
+ });
7499
+ }
7499
7500
  var InstructionsList$1 = InstructionsList;
7500
7501
 
7501
7502
  const Loader = ({