@wise/dynamic-flow-client 3.21.2 → 3.22.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.
Files changed (54) hide show
  1. package/build/main.css +14 -0
  2. package/build/main.js +656 -392
  3. package/build/main.min.js +1 -1
  4. package/build/main.mjs +520 -256
  5. package/build/types/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.d.ts +1 -0
  6. package/build/types/legacy/layout/list/DynamicStatusList.d.ts +1 -1
  7. package/build/types/legacy/test-utils/index.d.ts +1 -1
  8. package/build/types/legacy/test-utils/legacy-utils.d.ts +1 -15
  9. package/build/types/revamp/domain/components/BooleanInputComponent.d.ts +3 -3
  10. package/build/types/revamp/domain/components/DateInputComponent.d.ts +3 -3
  11. package/build/types/revamp/domain/components/IntegerInputComponent.d.ts +3 -3
  12. package/build/types/revamp/domain/components/MultiSelectInputComponent.d.ts +3 -3
  13. package/build/types/revamp/domain/components/MultiUploadInputComponent.d.ts +1 -0
  14. package/build/types/revamp/domain/components/NumberInputComponent.d.ts +3 -3
  15. package/build/types/revamp/domain/components/{repeatableComponent/RepeatableComponent.d.ts → RepeatableComponent.d.ts} +3 -3
  16. package/build/types/revamp/domain/components/SelectInputComponent.d.ts +1 -0
  17. package/build/types/revamp/domain/components/StatusListComponent.d.ts +19 -2
  18. package/build/types/revamp/domain/components/TextInputComponent.d.ts +3 -3
  19. package/build/types/revamp/domain/components/UploadInputComponent.d.ts +1 -0
  20. package/build/types/revamp/domain/features/validationAsync/getComponentValidationAsync.d.ts +2 -2
  21. package/build/types/revamp/domain/features/validationAsync/getInitialValidationAsyncState.d.ts +2 -0
  22. package/build/types/revamp/domain/mappers/layout/statusListLayoutToComponent.d.ts +2 -1
  23. package/build/types/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToComponent.d.ts +1 -1
  24. package/build/types/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToRepeatableComponent.d.ts +1 -1
  25. package/build/types/revamp/domain/mappers/schema/utils/getValidationAsyncInitialState.d.ts +1 -1
  26. package/build/types/revamp/domain/mappers/schema/utils/mapCommonSchemaProps.d.ts +1 -1
  27. package/build/types/revamp/domain/types.d.ts +5 -4
  28. package/build/types/revamp/renderers/mappers/repeatableComponentToProps.d.ts +1 -1
  29. package/build/types/revamp/renderers/mappers/utils/inputComponentToProps.d.ts +3 -1
  30. package/build/types/revamp/utils/type-utils.d.ts +1 -1
  31. package/package.json +4 -6
  32. package/build/types/legacy/dynamicFlow/tests/DynamicFlow.legacy.spec.d.ts +0 -1
  33. package/build/types/legacy/formControl/FormControl.spec.d.ts +0 -1
  34. package/build/types/legacy/jsonSchemaForm/JsonSchemaForm.spec.d.ts +0 -1
  35. package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/ArrayTypeSchema.spec.d.ts +0 -1
  36. package/build/types/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.errors.spec.d.ts +0 -1
  37. package/build/types/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.spec.d.ts +0 -1
  38. package/build/types/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.spec.d.ts +0 -1
  39. package/build/types/legacy/jsonSchemaForm/genericSchema/GenericSchema.spec.d.ts +0 -1
  40. package/build/types/legacy/jsonSchemaForm/help/Help.spec.d.ts +0 -1
  41. package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.spec.d.ts +0 -1
  42. package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.spec.d.ts +0 -1
  43. package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.spec.d.ts +0 -1
  44. package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.spec.d.ts +0 -1
  45. package/build/types/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.spec.d.ts +0 -1
  46. package/build/types/legacy/layout/DynamicLayout.end-to-end.spec.d.ts +0 -1
  47. package/build/types/legacy/layout/DynamicLayout.spec.d.ts +0 -1
  48. package/build/types/legacy/layout/box/DynamicBox.spec.d.ts +0 -1
  49. package/build/types/legacy/layout/columns/DynamicColumns.spec.d.ts +0 -1
  50. package/build/types/legacy/layout/decision/DynamicDecision.spec.d.ts +0 -1
  51. package/build/types/legacy/layout/divider/DynamicDivider.spec.d.ts +0 -1
  52. package/build/types/legacy/layout/form/DynamicForm.spec.d.ts +0 -1
  53. package/build/types/legacy/step/layoutStep/LayoutStep.spec.d.ts +0 -1
  54. package/build/types/revamp/domain/features/validationAsync/getInitialValidationState.d.ts +0 -2
package/build/main.mjs CHANGED
@@ -1450,7 +1450,7 @@ var allOfComponentToProps = ({ control, description, help, title }, children) =>
1450
1450
 
1451
1451
  // src/revamp/renderers/mappers/utils/inputComponentToProps.ts
1452
1452
  var inputComponentToProps = (component, type) => {
1453
- var _a, _b;
1453
+ var _a;
1454
1454
  const {
1455
1455
  autoComplete,
1456
1456
  control,
@@ -1462,29 +1462,46 @@ var inputComponentToProps = (component, type) => {
1462
1462
  placeholder,
1463
1463
  required,
1464
1464
  title,
1465
+ validationAsyncState,
1465
1466
  onBlur,
1466
1467
  onFocus
1467
1468
  } = component;
1468
- const validationState = componentHasValidationState(component) ? component.validationState : void 0;
1469
- const { messages } = validationState != null ? validationState : {};
1469
+ const { messages } = validationAsyncState != null ? validationAsyncState : {};
1470
1470
  return {
1471
1471
  type,
1472
1472
  autoComplete,
1473
1473
  control,
1474
- description: (_a = messages == null ? void 0 : messages.success) != null ? _a : description,
1474
+ description,
1475
1475
  disabled,
1476
- error: (_b = messages == null ? void 0 : messages.error) != null ? _b : errors[0],
1476
+ error: (_a = messages == null ? void 0 : messages.error) != null ? _a : errors == null ? void 0 : errors[0],
1477
1477
  help,
1478
1478
  id,
1479
1479
  label: title,
1480
1480
  placeholder,
1481
1481
  required,
1482
+ validationState: getValidationState(errors, validationAsyncState),
1482
1483
  value: component.getLocalValue(),
1483
1484
  onBlur: onBlur.bind(component),
1484
1485
  onFocus: onFocus.bind(component)
1485
1486
  };
1486
1487
  };
1487
- var componentHasValidationState = (component) => Boolean("validationState" in component && component.validationState);
1488
+ var getValidationState = (errors, validationAsyncState) => {
1489
+ if (validationAsyncState) {
1490
+ if (validationAsyncState == null ? void 0 : validationAsyncState.messages.error) {
1491
+ return { status: "invalid", message: validationAsyncState == null ? void 0 : validationAsyncState.messages.error };
1492
+ }
1493
+ if (validationAsyncState == null ? void 0 : validationAsyncState.messages.success) {
1494
+ return { status: "valid", message: validationAsyncState == null ? void 0 : validationAsyncState.messages.success };
1495
+ }
1496
+ }
1497
+ if (errors) {
1498
+ if (errors.length > 0) {
1499
+ return { status: "invalid", message: errors[0] };
1500
+ }
1501
+ return { status: "valid" };
1502
+ }
1503
+ return void 0;
1504
+ };
1488
1505
 
1489
1506
  // src/revamp/renderers/mappers/booleanInputComponentToProps.ts
1490
1507
  var booleanInputComponentToProps = (component) => {
@@ -1732,17 +1749,27 @@ var repeatableComponentToProps = (component, children, editableItemChildren) =>
1732
1749
  description,
1733
1750
  editableItem: editableItemChildren,
1734
1751
  editItemTitle,
1752
+ error: errors == null ? void 0 : errors[0],
1735
1753
  items: itemProps,
1736
1754
  maxItems,
1737
1755
  minItems,
1738
1756
  title,
1739
- error: errors[0],
1757
+ validationState: getValidationState2(errors),
1740
1758
  onAdd: onAdd.bind(component),
1741
1759
  onEdit: onEdit.bind(component),
1742
1760
  onSave: onSave.bind(component),
1743
1761
  onRemove: onRemove.bind(component)
1744
1762
  };
1745
1763
  };
1764
+ var getValidationState2 = (errors) => {
1765
+ if (errors) {
1766
+ if (errors.length > 0) {
1767
+ return { status: "invalid", message: errors[0] };
1768
+ }
1769
+ return { status: "valid" };
1770
+ }
1771
+ return void 0;
1772
+ };
1746
1773
 
1747
1774
  // src/revamp/renderers/mappers/reviewComponentToProps.ts
1748
1775
  var reviewComponentToProps = ({
@@ -7368,18 +7395,18 @@ var getDebouncedPerformRefresh = (performRefresh) => performRefresh ? debounce(p
7368
7395
  // src/revamp/domain/features/validationAsync/getComponentValidationAsync.ts
7369
7396
  var getComponentValidationAsync = (update, performValidationAsync) => (
7370
7397
  /**
7371
- * Will update the validationState when a new request is made, and will update
7398
+ * Will update the validationAsyncState when a new request is made, and will update
7372
7399
  * the description or set errors when the request completes.
7373
7400
  */
7374
- async (validationState, currentValue) => {
7375
- const { abortController, lastSubmitted } = validationState;
7401
+ async (validationAsyncState, currentValue) => {
7402
+ const { abortController, lastSubmitted } = validationAsyncState;
7376
7403
  if (lastSubmitted === currentValue) {
7377
7404
  return;
7378
7405
  }
7379
7406
  const newAbortController = abortAndResetController(abortController);
7380
7407
  if (isNullish(currentValue)) {
7381
7408
  update((draft) => {
7382
- draft.validationState = {
7409
+ draft.validationAsyncState = {
7383
7410
  abortController: newAbortController,
7384
7411
  lastSubmitted: currentValue,
7385
7412
  messages: {}
@@ -7391,7 +7418,7 @@ var getComponentValidationAsync = (update, performValidationAsync) => (
7391
7418
  const newSubmission = performValidationAsync({ value: currentValue, signal }).then((message) => {
7392
7419
  update((draft) => {
7393
7420
  if (message) {
7394
- draft.validationState.messages.success = message;
7421
+ draft.validationAsyncState.messages.success = message;
7395
7422
  }
7396
7423
  });
7397
7424
  return message;
@@ -7400,11 +7427,11 @@ var getComponentValidationAsync = (update, performValidationAsync) => (
7400
7427
  return null;
7401
7428
  }
7402
7429
  update((draft) => {
7403
- draft.validationState.messages.error = error.message;
7430
+ draft.validationAsyncState.messages.error = error.message;
7404
7431
  });
7405
7432
  });
7406
7433
  update((draft) => {
7407
- draft.validationState = {
7434
+ draft.validationAsyncState = {
7408
7435
  abortController: newAbortController,
7409
7436
  lastSubmitted: currentValue,
7410
7437
  messages: {}
@@ -7459,7 +7486,7 @@ var createNumberInputComponent = (numberInputProps, updateComponent) => {
7459
7486
  onChange(updatedValue) {
7460
7487
  update((draft) => {
7461
7488
  draft.errors = [];
7462
- draft.validationState.messages = {};
7489
+ draft.validationAsyncState.messages = {};
7463
7490
  draft.value = updatedValue;
7464
7491
  });
7465
7492
  performDebouncedRefresh == null ? void 0 : performDebouncedRefresh();
@@ -7508,7 +7535,7 @@ var createNumberInputComponent = (numberInputProps, updateComponent) => {
7508
7535
  return __spreadProps(__spreadValues({}, numberComponent), {
7509
7536
  onBlur() {
7510
7537
  if (this.validate()) {
7511
- validateAsync(this.validationState, this.getLocalValue()).catch(() => {
7538
+ validateAsync(this.validationAsyncState, this.getLocalValue()).catch(() => {
7512
7539
  });
7513
7540
  }
7514
7541
  }
@@ -7820,7 +7847,7 @@ var mapCommonSchemaProps = (schemaMapperProps) => {
7820
7847
  control,
7821
7848
  description,
7822
7849
  disabled: schemaHasDisabled(schema) ? schema.disabled : false,
7823
- errors: isString(validationErrors) ? [validationErrors] : [],
7850
+ errors: isString(validationErrors) ? [validationErrors] : void 0,
7824
7851
  hidden: Boolean(hidden),
7825
7852
  keywords,
7826
7853
  required: Boolean(required),
@@ -7879,8 +7906,8 @@ var getValidationMessage = (json) => {
7879
7906
  return isString(message) ? message : null;
7880
7907
  };
7881
7908
 
7882
- // src/revamp/domain/features/validationAsync/getInitialValidationState.ts
7883
- var getInitialValidationState = () => ({
7909
+ // src/revamp/domain/features/validationAsync/getInitialValidationAsyncState.ts
7910
+ var getInitialValidationAsyncState = () => ({
7884
7911
  abortController: new AbortController(),
7885
7912
  lastSubmitted: null,
7886
7913
  messages: {}
@@ -7889,8 +7916,8 @@ var getInitialValidationState = () => ({
7889
7916
  // src/revamp/domain/mappers/schema/utils/getValidationAsyncInitialState.ts
7890
7917
  var getValidationAsyncInitialState = (schemaMapperProps, mapperProps) => {
7891
7918
  const performValidationAsync = getValidationAsyncFn(schemaMapperProps, mapperProps);
7892
- const validationState = getInitialValidationState();
7893
- return { performValidationAsync, validationState };
7919
+ const validationAsyncState = getInitialValidationAsyncState();
7920
+ return { performValidationAsync, validationAsyncState };
7894
7921
  };
7895
7922
  var getValidationAsyncFn = (schemaMapperProps, mapperProps) => {
7896
7923
  const { schema } = schemaMapperProps;
@@ -7919,7 +7946,7 @@ var numberSchemaToComponent = (schemaMapperProps, mapperProps) => {
7919
7946
  schemaMapperProps,
7920
7947
  mapperProps
7921
7948
  );
7922
- const { performValidationAsync, validationState } = getValidationAsyncInitialState(
7949
+ const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
7923
7950
  schemaMapperProps,
7924
7951
  mapperProps
7925
7952
  );
@@ -7938,7 +7965,7 @@ var numberSchemaToComponent = (schemaMapperProps, mapperProps) => {
7938
7965
  maximum,
7939
7966
  minimum,
7940
7967
  persistedState,
7941
- validationState,
7968
+ validationAsyncState,
7942
7969
  performPersistAsync,
7943
7970
  performRefresh: getPerformRefresh(schema, onRefresh),
7944
7971
  performValidationAsync,
@@ -8200,7 +8227,7 @@ var createIntegerInputComponent = (integerInputProps, updateComponent) => {
8200
8227
  onChange(updatedValue) {
8201
8228
  update((draft) => {
8202
8229
  draft.errors = [];
8203
- draft.validationState.messages = {};
8230
+ draft.validationAsyncState.messages = {};
8204
8231
  draft.value = updatedValue;
8205
8232
  });
8206
8233
  performDebouncedRefresh == null ? void 0 : performDebouncedRefresh();
@@ -8249,7 +8276,7 @@ var createIntegerInputComponent = (integerInputProps, updateComponent) => {
8249
8276
  return __spreadProps(__spreadValues({}, integerComponent), {
8250
8277
  onBlur() {
8251
8278
  if (this.validate()) {
8252
- validateAsync(this.validationState, this.getLocalValue()).catch(() => {
8279
+ validateAsync(this.validationAsyncState, this.getLocalValue()).catch(() => {
8253
8280
  });
8254
8281
  }
8255
8282
  }
@@ -8268,7 +8295,7 @@ var integerSchemaToComponent = (schemaMapperProps, mapperProps) => {
8268
8295
  schemaMapperProps,
8269
8296
  mapperProps
8270
8297
  );
8271
- const { performValidationAsync, validationState } = getValidationAsyncInitialState(
8298
+ const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
8272
8299
  schemaMapperProps,
8273
8300
  mapperProps
8274
8301
  );
@@ -8288,7 +8315,7 @@ var integerSchemaToComponent = (schemaMapperProps, mapperProps) => {
8288
8315
  minimum,
8289
8316
  persistedState,
8290
8317
  value,
8291
- validationState,
8318
+ validationAsyncState,
8292
8319
  performPersistAsync,
8293
8320
  performRefresh: getPerformRefresh(schema, onRefresh),
8294
8321
  performValidationAsync,
@@ -8491,7 +8518,7 @@ var createDateInputComponent = (textInputProps, updateComponent) => {
8491
8518
  onChange(updatedValue) {
8492
8519
  update((draft) => {
8493
8520
  draft.errors = [];
8494
- draft.validationState.messages = {};
8521
+ draft.validationAsyncState.messages = {};
8495
8522
  draft.value = updatedValue;
8496
8523
  });
8497
8524
  performRefresh == null ? void 0 : performRefresh();
@@ -8542,7 +8569,7 @@ var createDateInputComponent = (textInputProps, updateComponent) => {
8542
8569
  return __spreadProps(__spreadValues({}, dateInputComponent), {
8543
8570
  onBlur() {
8544
8571
  if (this.validate()) {
8545
- validateAsync(this.validationState, this.getLocalValue()).catch(() => {
8572
+ validateAsync(this.validationAsyncState, this.getLocalValue()).catch(() => {
8546
8573
  });
8547
8574
  }
8548
8575
  }
@@ -8566,7 +8593,7 @@ var stringSchemaToDateInputComponent = (schemaMapperProps, mapperProps) => {
8566
8593
  schemaMapperProps,
8567
8594
  mapperProps
8568
8595
  );
8569
- const { performValidationAsync, validationState } = getValidationAsyncInitialState(
8596
+ const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
8570
8597
  schemaMapperProps,
8571
8598
  mapperProps
8572
8599
  );
@@ -8585,7 +8612,7 @@ var stringSchemaToDateInputComponent = (schemaMapperProps, mapperProps) => {
8585
8612
  maximumDate,
8586
8613
  value,
8587
8614
  persistedState,
8588
- validationState,
8615
+ validationAsyncState,
8589
8616
  performPersistAsync,
8590
8617
  performRefresh: getPerformRefresh(schema, onRefresh),
8591
8618
  performValidationAsync,
@@ -8797,7 +8824,7 @@ var createTextInputComponent = (textInputProps, updateComponent) => {
8797
8824
  onChange(updatedValue) {
8798
8825
  update((draft) => {
8799
8826
  draft.errors = [];
8800
- draft.validationState.messages = {};
8827
+ draft.validationAsyncState.messages = {};
8801
8828
  draft.value = updatedValue;
8802
8829
  });
8803
8830
  performDebouncedRefresh == null ? void 0 : performDebouncedRefresh();
@@ -8846,7 +8873,7 @@ var createTextInputComponent = (textInputProps, updateComponent) => {
8846
8873
  return __spreadProps(__spreadValues({}, inputComponent), {
8847
8874
  onBlur() {
8848
8875
  if (this.validate()) {
8849
- validateAsync(this.validationState, this.getLocalValue()).catch(() => {
8876
+ validateAsync(this.validationAsyncState, this.getLocalValue()).catch(() => {
8850
8877
  });
8851
8878
  }
8852
8879
  }
@@ -8875,7 +8902,7 @@ var stringSchemaToTextInputComponent = (schemaMapperProps, mapperProps) => {
8875
8902
  schemaMapperProps,
8876
8903
  mapperProps
8877
8904
  );
8878
- const { performValidationAsync, validationState } = getValidationAsyncInitialState(
8905
+ const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
8879
8906
  schemaMapperProps,
8880
8907
  mapperProps
8881
8908
  );
@@ -8897,7 +8924,7 @@ var stringSchemaToTextInputComponent = (schemaMapperProps, mapperProps) => {
8897
8924
  minLength,
8898
8925
  value,
8899
8926
  persistedState,
8900
- validationState,
8927
+ validationAsyncState,
8901
8928
  performPersistAsync,
8902
8929
  performRefresh: getPerformRefresh(schema, onRefresh),
8903
8930
  performValidationAsync,
@@ -8949,7 +8976,7 @@ var createContainerComponent = (containerProps) => __spreadProps(__spreadValues(
8949
8976
  }
8950
8977
  });
8951
8978
 
8952
- // src/revamp/domain/components/repeatableComponent/RepeatableComponent.ts
8979
+ // src/revamp/domain/components/RepeatableComponent.ts
8953
8980
  var createRepeatableComponent = (repeatableProps, updateComponent) => {
8954
8981
  const _a = repeatableProps, {
8955
8982
  uid,
@@ -9094,7 +9121,8 @@ var arraySchemaToRepeatableComponent = (schemaMapperProps, mapperProps) => {
9094
9121
  schema: items,
9095
9122
  localValue: editableValue,
9096
9123
  model: localValueToJsonElement(editableValue),
9097
- validationErrors: void 0
9124
+ validationErrors: void 0,
9125
+ required: true
9098
9126
  },
9099
9127
  mapperProps
9100
9128
  );
@@ -9376,7 +9404,7 @@ var createMultiSelectComponent = (multiSelectProps, updateComponent) => {
9376
9404
  onSelect(indices) {
9377
9405
  inputComponent.onSelect.call(this, indices);
9378
9406
  if (this.validate()) {
9379
- validateAsync(this.validationState, this.getLocalValue()).catch(() => {
9407
+ validateAsync(this.validationAsyncState, this.getLocalValue()).catch(() => {
9380
9408
  });
9381
9409
  }
9382
9410
  }
@@ -9427,7 +9455,7 @@ var arraySchemaToMultiSelectComponent = (schemaMapperProps, mapperProps) => {
9427
9455
  const { maxItems, minItems, title, validationMessages } = schema;
9428
9456
  const { getErrorMessageFunctions, onRefresh, onValueChange, updateComponent } = mapperProps;
9429
9457
  const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
9430
- const { performValidationAsync, validationState } = getValidationAsyncInitialState(
9458
+ const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
9431
9459
  schemaMapperProps,
9432
9460
  mapperProps
9433
9461
  );
@@ -9446,7 +9474,7 @@ var arraySchemaToMultiSelectComponent = (schemaMapperProps, mapperProps) => {
9446
9474
  options,
9447
9475
  required,
9448
9476
  title,
9449
- validationState,
9477
+ validationAsyncState,
9450
9478
  performValidationAsync,
9451
9479
  performRefresh: getPerformRefresh(schema, onRefresh),
9452
9480
  onValueChange
@@ -9622,7 +9650,7 @@ var createBooleanInputComponent = (booleanInputProps, updateComponent) => {
9622
9650
  return __spreadProps(__spreadValues({}, booleanComponent), {
9623
9651
  onChange(updatedValue) {
9624
9652
  booleanComponent.onChange.call(this, updatedValue);
9625
- validateAsync(this.validationState, this.getLocalValue()).catch(() => {
9653
+ validateAsync(this.validationAsyncState, this.getLocalValue()).catch(() => {
9626
9654
  });
9627
9655
  }
9628
9656
  });
@@ -9640,7 +9668,7 @@ var booleanSchemaToComponent = (schemaMapperProps, mapperProps) => {
9640
9668
  schemaMapperProps,
9641
9669
  mapperProps
9642
9670
  );
9643
- const { performValidationAsync, validationState } = getValidationAsyncInitialState(
9671
+ const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
9644
9672
  schemaMapperProps,
9645
9673
  mapperProps
9646
9674
  );
@@ -9651,7 +9679,7 @@ var booleanSchemaToComponent = (schemaMapperProps, mapperProps) => {
9651
9679
  __spreadProps(__spreadValues({}, mapCommonSchemaProps(schemaMapperProps)), {
9652
9680
  value: value != null ? value : false,
9653
9681
  persistedState,
9654
- validationState,
9682
+ validationAsyncState,
9655
9683
  performPersistAsync,
9656
9684
  performRefresh,
9657
9685
  performValidationAsync,
@@ -10186,13 +10214,44 @@ var createStatusListComponent = (statusListProps) => __spreadProps(__spreadValue
10186
10214
  });
10187
10215
 
10188
10216
  // src/revamp/domain/mappers/layout/statusListLayoutToComponent.ts
10189
- var statusListLayoutToComponent = (uid, { control, items, margin = "md", title }) => createStatusListComponent({
10217
+ var statusListLayoutToComponent = (uid, { control, items, margin = "md", title }, { onAction, onLink }) => createStatusListComponent({
10190
10218
  uid,
10191
10219
  control,
10192
- items,
10220
+ items: items.map((item) => {
10221
+ var _a, _b, _c;
10222
+ return __spreadProps(__spreadValues({}, item), {
10223
+ href: (_c = (_b = (_a = item == null ? void 0 : item.callToAction) == null ? void 0 : _a.behavior) == null ? void 0 : _b.link) == null ? void 0 : _c.url,
10224
+ callToAction: item.callToAction ? getItemCallToAction(item.callToAction, onAction, onLink) : void 0
10225
+ });
10226
+ }),
10193
10227
  margin,
10194
10228
  title
10195
10229
  });
10230
+ var getItemCallToAction = (callToAction, onAction, onLink) => {
10231
+ const { accessibilityDescription, behavior, title } = callToAction;
10232
+ if (behavior.link) {
10233
+ const { url } = behavior.link;
10234
+ return {
10235
+ accessibilityDescription,
10236
+ href: url,
10237
+ title,
10238
+ onClick: () => {
10239
+ void onLink(url);
10240
+ }
10241
+ };
10242
+ }
10243
+ if (behavior.action) {
10244
+ const { action } = behavior;
10245
+ return {
10246
+ accessibilityDescription,
10247
+ title,
10248
+ onClick: () => {
10249
+ void onAction(action);
10250
+ }
10251
+ };
10252
+ }
10253
+ return void 0;
10254
+ };
10196
10255
 
10197
10256
  // src/revamp/domain/mappers/layout/listLayoutToComponent.ts
10198
10257
  var listLayoutToComponent = (uid, { control, items, margin = "md", title }) => createStatusListComponent({
@@ -10259,7 +10318,7 @@ var mapLayoutToComponent = (uid, layout, mapperProps) => {
10259
10318
  case "search":
10260
10319
  return searchLayoutToComponent(uid, layout, mapperProps);
10261
10320
  case "status-list":
10262
- return statusListLayoutToComponent(uid, layout);
10321
+ return statusListLayoutToComponent(uid, layout, mapperProps);
10263
10322
  default:
10264
10323
  throw new Error(`Invalid layout type in ${JSON.stringify(layout)}`);
10265
10324
  }
@@ -11141,10 +11200,29 @@ function LabelContentWithHelp({ text, help }) {
11141
11200
 
11142
11201
  // ../renderers/src/components/FieldInput.tsx
11143
11202
  import { jsx as jsx10 } from "react/jsx-runtime";
11144
- function FieldInput({ id, children, label, error, description, help }) {
11203
+ function FieldInput({ id, children, label, validation, description, help }) {
11145
11204
  const labelContent = label && help ? /* @__PURE__ */ jsx10(LabelContentWithHelp, { text: label, help }) : label;
11146
- return /* @__PURE__ */ jsx10(Field, { id, label: labelContent, hint: description, error, children });
11205
+ return /* @__PURE__ */ jsx10(
11206
+ Field,
11207
+ {
11208
+ id,
11209
+ label: labelContent,
11210
+ description,
11211
+ message: validation == null ? void 0 : validation.message,
11212
+ sentiment: mapStatusToSentiment(validation),
11213
+ children
11214
+ }
11215
+ );
11147
11216
  }
11217
+ var mapStatusToSentiment = (validation) => {
11218
+ if (validation) {
11219
+ if (validation.status === "valid") {
11220
+ return "positive";
11221
+ }
11222
+ return "negative";
11223
+ }
11224
+ return void 0;
11225
+ };
11148
11226
  var FieldInput_default = FieldInput;
11149
11227
 
11150
11228
  // ../renderers/src/BooleanInputRenderer.tsx
@@ -11153,9 +11231,27 @@ import { jsx as jsx11 } from "react/jsx-runtime";
11153
11231
  var BooleanInputRenderer = {
11154
11232
  canRenderType: "input-boolean",
11155
11233
  render: (props) => {
11156
- const _a = props, { id, control, label = "", description, help, error, type, value } = _a, rest = __objRest(_a, ["id", "control", "label", "description", "help", "error", "type", "value"]);
11234
+ const _a = props, {
11235
+ id,
11236
+ control,
11237
+ label = "",
11238
+ description,
11239
+ help,
11240
+ type,
11241
+ validationState,
11242
+ value
11243
+ } = _a, rest = __objRest(_a, [
11244
+ "id",
11245
+ "control",
11246
+ "label",
11247
+ "description",
11248
+ "help",
11249
+ "type",
11250
+ "validationState",
11251
+ "value"
11252
+ ]);
11157
11253
  const checkboxProps = __spreadProps(__spreadValues({}, rest), { label, secondary: description, checked: value });
11158
- return /* @__PURE__ */ jsx11(FieldInput_default, { id, label: "", description: "", error, help, children: /* @__PURE__ */ jsx11(Checkbox, __spreadValues({ id }, checkboxProps)) });
11254
+ return /* @__PURE__ */ jsx11(FieldInput_default, { id, label: "", description: "", validation: validationState, help, children: /* @__PURE__ */ jsx11(Checkbox, __spreadValues({ id }, checkboxProps)) });
11159
11255
  }
11160
11256
  };
11161
11257
  var BooleanInputRenderer_default = BooleanInputRenderer;
@@ -11380,23 +11476,33 @@ var DateInputRenderer = {
11380
11476
  control,
11381
11477
  label,
11382
11478
  description,
11383
- error,
11384
11479
  type,
11385
11480
  help,
11481
+ validationState,
11386
11482
  value: initialValue
11387
11483
  } = _a, rest = __objRest(_a, [
11388
11484
  "id",
11389
11485
  "control",
11390
11486
  "label",
11391
11487
  "description",
11392
- "error",
11393
11488
  "type",
11394
11489
  "help",
11490
+ "validationState",
11395
11491
  "value"
11396
11492
  ]);
11397
11493
  const value = initialValue != null ? initialValue : "";
11398
11494
  const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
11399
- return /* @__PURE__ */ jsx16(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx16(VariableDateInput_default, { control, inputProps }) });
11495
+ return /* @__PURE__ */ jsx16(
11496
+ FieldInput_default,
11497
+ {
11498
+ id,
11499
+ label,
11500
+ description,
11501
+ validation: validationState,
11502
+ help,
11503
+ children: /* @__PURE__ */ jsx16(VariableDateInput_default, { control, inputProps })
11504
+ }
11505
+ );
11400
11506
  }
11401
11507
  };
11402
11508
  var DateInputRenderer_default = DateInputRenderer;
@@ -11684,23 +11790,33 @@ import { jsx as jsx29 } from "react/jsx-runtime";
11684
11790
  var IntegerInputRenderer = {
11685
11791
  canRenderType: "input-integer",
11686
11792
  render: (props) => {
11687
- const _a = props, { id, label, error, description, help, type, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "error", "description", "help", "type", "value", "onChange"]);
11688
- return /* @__PURE__ */ jsx29(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx29(
11689
- Input,
11690
- __spreadValues({
11793
+ const _a = props, { id, label, description, help, type, validationState, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "description", "help", "type", "validationState", "value", "onChange"]);
11794
+ return /* @__PURE__ */ jsx29(
11795
+ FieldInput_default,
11796
+ {
11691
11797
  id,
11692
- name: id,
11693
- type: "number",
11694
- step: "1",
11695
- pattern: "\\d+",
11696
- value: value != null ? value : "",
11697
- onChange: ({ target: { value: newValue } }) => {
11698
- const parsedValue = Number.parseInt(newValue, 10);
11699
- onChange(Number.isNaN(parsedValue) ? null : parsedValue);
11700
- },
11701
- onWheel
11702
- }, rest)
11703
- ) });
11798
+ label,
11799
+ description,
11800
+ validation: validationState,
11801
+ help,
11802
+ children: /* @__PURE__ */ jsx29(
11803
+ Input,
11804
+ __spreadValues({
11805
+ id,
11806
+ name: id,
11807
+ type: "number",
11808
+ step: "1",
11809
+ pattern: "\\d+",
11810
+ value: value != null ? value : "",
11811
+ onChange: ({ target: { value: newValue } }) => {
11812
+ const parsedValue = Number.parseInt(newValue, 10);
11813
+ onChange(Number.isNaN(parsedValue) ? null : parsedValue);
11814
+ },
11815
+ onWheel
11816
+ }, rest)
11817
+ )
11818
+ }
11819
+ );
11704
11820
  }
11705
11821
  };
11706
11822
  var IntegerInputRenderer_default = IntegerInputRenderer;
@@ -11806,10 +11922,10 @@ function MultiSelectInputRendererComponent(props) {
11806
11922
  disabled,
11807
11923
  label,
11808
11924
  help,
11809
- error,
11810
11925
  options,
11811
11926
  placeholder,
11812
11927
  selectedIndices,
11928
+ validationState,
11813
11929
  onSelect
11814
11930
  } = props;
11815
11931
  const mergedIndices = stagedIndices != null ? stagedIndices : selectedIndices;
@@ -11840,39 +11956,49 @@ function MultiSelectInputRendererComponent(props) {
11840
11956
  };
11841
11957
  return /* @__PURE__ */ jsx34(SelectInputOptionContent, __spreadValues({}, contentProps));
11842
11958
  };
11843
- return /* @__PURE__ */ jsx34(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx34(
11844
- SelectInput,
11959
+ return /* @__PURE__ */ jsx34(
11960
+ FieldInput_default,
11845
11961
  {
11846
11962
  id,
11847
- items: options.map((option, index) => {
11848
- var _a, _b, _c;
11849
- return {
11850
- type: "option",
11851
- value: index,
11852
- filterMatchers: [
11853
- ...(_a = option.keywords) != null ? _a : [],
11854
- (_b = option.title) != null ? _b : "",
11855
- (_c = option.description) != null ? _c : ""
11856
- ],
11857
- disabled: option.disabled
11858
- };
11859
- }),
11860
- disabled,
11861
- placeholder,
11862
- value: mergedIndices,
11863
- renderValue,
11864
- multiple: true,
11865
- onChange: (values) => {
11866
- setStagedIndices(values);
11867
- },
11868
- onClose: () => {
11869
- if (stagedIndices) {
11870
- onSelect(stagedIndices);
11871
- setStagedIndices(void 0);
11963
+ label,
11964
+ help,
11965
+ description,
11966
+ validation: validationState,
11967
+ children: /* @__PURE__ */ jsx34(
11968
+ SelectInput,
11969
+ {
11970
+ id,
11971
+ items: options.map((option, index) => {
11972
+ var _a, _b, _c;
11973
+ return {
11974
+ type: "option",
11975
+ value: index,
11976
+ filterMatchers: [
11977
+ ...(_a = option.keywords) != null ? _a : [],
11978
+ (_b = option.title) != null ? _b : "",
11979
+ (_c = option.description) != null ? _c : ""
11980
+ ],
11981
+ disabled: option.disabled
11982
+ };
11983
+ }),
11984
+ disabled,
11985
+ placeholder,
11986
+ value: mergedIndices,
11987
+ renderValue,
11988
+ multiple: true,
11989
+ onChange: (values) => {
11990
+ setStagedIndices(values);
11991
+ },
11992
+ onClose: () => {
11993
+ if (stagedIndices) {
11994
+ onSelect(stagedIndices);
11995
+ setStagedIndices(void 0);
11996
+ }
11997
+ }
11872
11998
  }
11873
- }
11999
+ )
11874
12000
  }
11875
- ) });
12001
+ );
11876
12002
  }
11877
12003
  var MultiSelectInputRenderer_default = MultiSelectInputRenderer;
11878
12004
 
@@ -11888,8 +12014,8 @@ function UploadFieldInput({
11888
12014
  children,
11889
12015
  label,
11890
12016
  description,
11891
- error,
11892
- help
12017
+ help,
12018
+ validation
11893
12019
  }) {
11894
12020
  const labelContent = label && help ? /* @__PURE__ */ jsx35(LabelContentWithHelp, { text: label, help }) : label;
11895
12021
  const descriptionId = description ? `${id}-description` : void 0;
@@ -11897,12 +12023,12 @@ function UploadFieldInput({
11897
12023
  "div",
11898
12024
  {
11899
12025
  className: (0, import_classnames3.default)("form-group d-block", {
11900
- "has-error": !!error
12026
+ "has-error": (validation == null ? void 0 : validation.status) === "invalid"
11901
12027
  }),
11902
12028
  children: [
11903
12029
  /* @__PURE__ */ jsx35("label", { htmlFor: id, className: "control-label", children: labelContent }),
11904
12030
  children,
11905
- error && /* @__PURE__ */ jsx35(InlineAlert, { type: "negative", id: descriptionId, children: error })
12031
+ (validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ jsx35(InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
11906
12032
  ]
11907
12033
  }
11908
12034
  );
@@ -11945,10 +12071,10 @@ var MultiUploadInputRenderer = {
11945
12071
  label,
11946
12072
  description,
11947
12073
  disabled,
11948
- error,
11949
12074
  maxSize,
11950
12075
  maxItems,
11951
12076
  uploadLabel,
12077
+ validationState,
11952
12078
  onUpload,
11953
12079
  onDelete
11954
12080
  } = props;
@@ -11961,22 +12087,32 @@ var MultiUploadInputRenderer = {
11961
12087
  };
11962
12088
  const onDeleteFile = async (fileId) => onDelete(String(fileId));
11963
12089
  const descriptionId = description ? `${id}-description` : void 0;
11964
- return /* @__PURE__ */ jsx36(UploadFieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx36(
11965
- UploadInput,
12090
+ return /* @__PURE__ */ jsx36(
12091
+ UploadFieldInput_default,
11966
12092
  {
11967
12093
  id,
11968
- "aria-describedby": descriptionId,
12094
+ label,
11969
12095
  description,
11970
- disabled,
11971
- fileTypes: getAcceptsString(accepts),
11972
- maxFiles: maxItems,
11973
- multiple: true,
11974
- sizeLimit: maxSize ? toKilobytes(maxSize) : void 0,
11975
- uploadButtonTitle: uploadLabel,
11976
- onDeleteFile,
11977
- onUploadFile
12096
+ validation: validationState,
12097
+ help,
12098
+ children: /* @__PURE__ */ jsx36(
12099
+ UploadInput,
12100
+ {
12101
+ id,
12102
+ "aria-describedby": descriptionId,
12103
+ description,
12104
+ disabled,
12105
+ fileTypes: getAcceptsString(accepts),
12106
+ maxFiles: maxItems,
12107
+ multiple: true,
12108
+ sizeLimit: maxSize ? toKilobytes(maxSize) : void 0,
12109
+ uploadButtonTitle: uploadLabel,
12110
+ onDeleteFile,
12111
+ onUploadFile
12112
+ }
12113
+ )
11978
12114
  }
11979
- ) });
12115
+ );
11980
12116
  }
11981
12117
  };
11982
12118
  var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
@@ -11987,21 +12123,31 @@ import { jsx as jsx37 } from "react/jsx-runtime";
11987
12123
  var NumberInputRenderer = {
11988
12124
  canRenderType: "input-number",
11989
12125
  render: (props) => {
11990
- const _a = props, { id, label, error, description, help, type, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "error", "description", "help", "type", "value", "onChange"]);
11991
- return /* @__PURE__ */ jsx37(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx37(
11992
- Input2,
11993
- __spreadValues({
12126
+ const _a = props, { id, label, description, help, type, validationState, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "description", "help", "type", "validationState", "value", "onChange"]);
12127
+ return /* @__PURE__ */ jsx37(
12128
+ FieldInput_default,
12129
+ {
11994
12130
  id,
11995
- name: id,
11996
- type: "number",
11997
- value: value != null ? value : "",
11998
- onChange: ({ target: { value: newValue } }) => {
11999
- const parsedValue = Number.parseFloat(newValue);
12000
- onChange(Number.isNaN(parsedValue) ? null : parsedValue);
12001
- },
12002
- onWheel
12003
- }, rest)
12004
- ) });
12131
+ label,
12132
+ description,
12133
+ validation: validationState,
12134
+ help,
12135
+ children: /* @__PURE__ */ jsx37(
12136
+ Input2,
12137
+ __spreadValues({
12138
+ id,
12139
+ name: id,
12140
+ type: "number",
12141
+ value: value != null ? value : "",
12142
+ onChange: ({ target: { value: newValue } }) => {
12143
+ const parsedValue = Number.parseFloat(newValue);
12144
+ onChange(Number.isNaN(parsedValue) ? null : parsedValue);
12145
+ },
12146
+ onWheel
12147
+ }, rest)
12148
+ )
12149
+ }
12150
+ );
12005
12151
  }
12006
12152
  };
12007
12153
  var NumberInputRenderer_default = NumberInputRenderer;
@@ -12121,9 +12267,9 @@ function Repeatable(props) {
12121
12267
  description,
12122
12268
  editableItem,
12123
12269
  editItemTitle,
12124
- error,
12125
12270
  items,
12126
12271
  title,
12272
+ validationState,
12127
12273
  onEdit,
12128
12274
  onAdd,
12129
12275
  onSave,
@@ -12159,7 +12305,7 @@ function Repeatable(props) {
12159
12305
  "div",
12160
12306
  {
12161
12307
  className: (0, import_classnames5.default)("form-group", {
12162
- "has-error": error
12308
+ "has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
12163
12309
  }),
12164
12310
  children: [
12165
12311
  items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx39(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
@@ -12172,7 +12318,7 @@ function Repeatable(props) {
12172
12318
  onClick: () => onAddItem()
12173
12319
  }
12174
12320
  ),
12175
- error && /* @__PURE__ */ jsx39(InlineAlert2, { type: "negative", children: error })
12321
+ (validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx39(InlineAlert2, { type: "negative", children: validationState.message })
12176
12322
  ]
12177
12323
  }
12178
12324
  ),
@@ -12237,22 +12383,26 @@ var generic_error_messages_default2 = defineMessages9({
12237
12383
  });
12238
12384
 
12239
12385
  // ../renderers/src/SearchRenderer/ErrorResult.tsx
12386
+ import { Button as Button5 } from "@transferwise/components";
12240
12387
  import { jsx as jsx40, jsxs as jsxs12 } from "react/jsx-runtime";
12241
12388
  function ErrorResult({ state }) {
12242
12389
  const intl = useIntl7();
12390
+ const buttonVisualProps = {
12391
+ priority: "tertiary",
12392
+ size: "sm",
12393
+ style: { marginTop: "-2px", padding: "0", width: "auto", display: "inline" }
12394
+ };
12243
12395
  return /* @__PURE__ */ jsxs12("p", { className: "m-t-2", children: [
12244
12396
  intl.formatMessage(generic_error_messages_default2.genericError),
12245
12397
  "\xA0",
12246
12398
  /* @__PURE__ */ jsx40(
12247
- "a",
12248
- {
12249
- href: "/",
12250
- onClick: (e) => {
12251
- e.preventDefault();
12399
+ Button5,
12400
+ __spreadProps(__spreadValues({}, buttonVisualProps), {
12401
+ onClick: () => {
12252
12402
  state.onRetry();
12253
12403
  },
12254
12404
  children: intl.formatMessage(generic_error_messages_default2.retry)
12255
- }
12405
+ })
12256
12406
  )
12257
12407
  ] });
12258
12408
  }
@@ -12272,7 +12422,7 @@ function BlockSearchRendererComponent({
12272
12422
  const [hasSearched, setHasSearched] = useState7(false);
12273
12423
  const trackEvent = useTrackEvent();
12274
12424
  return /* @__PURE__ */ jsxs13("div", { className: getMargin(margin), children: [
12275
- /* @__PURE__ */ jsx41(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: /* @__PURE__ */ jsx41(
12425
+ /* @__PURE__ */ jsx41(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx41(
12276
12426
  Input4,
12277
12427
  {
12278
12428
  id,
@@ -12355,7 +12505,7 @@ function InlineSearchRenderer({
12355
12505
  const [hasSearched, setHasSearched] = useState8(false);
12356
12506
  const trackEvent = useTrackEvent();
12357
12507
  const intl = useIntl8();
12358
- return /* @__PURE__ */ jsx42("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx42(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: /* @__PURE__ */ jsx42(
12508
+ return /* @__PURE__ */ jsx42("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx42(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx42(
12359
12509
  Typeahead,
12360
12510
  {
12361
12511
  id: "typeahead-input-id",
@@ -12431,30 +12581,40 @@ function RadioInputRendererComponent(props) {
12431
12581
  children,
12432
12582
  description,
12433
12583
  disabled,
12434
- error,
12435
12584
  help,
12436
12585
  label,
12437
12586
  options,
12438
12587
  selectedIndex,
12588
+ validationState,
12439
12589
  onSelect
12440
12590
  } = props;
12441
12591
  return /* @__PURE__ */ jsxs14(Fragment6, { children: [
12442
- /* @__PURE__ */ jsx44(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx44("span", { children: /* @__PURE__ */ jsx44(
12443
- RadioGroup,
12592
+ /* @__PURE__ */ jsx44(
12593
+ FieldInput_default,
12444
12594
  {
12445
- name: id,
12446
- radios: options.map((option, index) => ({
12447
- label: option.title,
12448
- value: index,
12449
- secondary: option.description,
12450
- disabled: option.disabled || disabled,
12451
- avatar: /* @__PURE__ */ jsx44(OptionMedia, { icon: option.icon, image: option.image })
12452
- })),
12453
- selectedValue: selectedIndex != null ? selectedIndex : void 0,
12454
- onChange: onSelect
12455
- },
12456
- `${id}-${selectedIndex}`
12457
- ) }) }),
12595
+ id,
12596
+ label,
12597
+ help,
12598
+ description,
12599
+ validation: validationState,
12600
+ children: /* @__PURE__ */ jsx44("span", { children: /* @__PURE__ */ jsx44(
12601
+ RadioGroup,
12602
+ {
12603
+ name: id,
12604
+ radios: options.map((option, index) => ({
12605
+ label: option.title,
12606
+ value: index,
12607
+ secondary: option.description,
12608
+ disabled: option.disabled || disabled,
12609
+ avatar: /* @__PURE__ */ jsx44(OptionMedia, { icon: option.icon, image: option.image })
12610
+ })),
12611
+ selectedValue: selectedIndex != null ? selectedIndex : void 0,
12612
+ onChange: onSelect
12613
+ },
12614
+ `${id}-${selectedIndex}`
12615
+ ) })
12616
+ }
12617
+ ),
12458
12618
  children
12459
12619
  ] });
12460
12620
  }
@@ -12469,11 +12629,11 @@ function TabInputRendererComponent(props) {
12469
12629
  children,
12470
12630
  description,
12471
12631
  disabled,
12472
- error,
12473
12632
  help,
12474
12633
  label,
12475
12634
  options,
12476
12635
  selectedIndex,
12636
+ validationState,
12477
12637
  onSelect
12478
12638
  } = props;
12479
12639
  useEffect4(() => {
@@ -12482,21 +12642,31 @@ function TabInputRendererComponent(props) {
12482
12642
  }
12483
12643
  }, [selectedIndex, onSelect, options.length]);
12484
12644
  return /* @__PURE__ */ jsxs15(Fragment7, { children: [
12485
- /* @__PURE__ */ jsx45(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx45(
12486
- Tabs,
12645
+ /* @__PURE__ */ jsx45(
12646
+ FieldInput_default,
12487
12647
  {
12488
- name: id,
12489
- selected: selectedIndex != null ? selectedIndex : 0,
12490
- tabs: options.map((option) => ({
12491
- title: option.title,
12492
- // if we pass null, we get some props-types console errors
12493
- // eslint-disable-next-line react/jsx-no-useless-fragment
12494
- content: /* @__PURE__ */ jsx45(Fragment7, {}),
12495
- disabled: option.disabled || disabled
12496
- })),
12497
- onTabSelect: onSelect
12648
+ id,
12649
+ label,
12650
+ help,
12651
+ description,
12652
+ validation: validationState,
12653
+ children: /* @__PURE__ */ jsx45(
12654
+ Tabs,
12655
+ {
12656
+ name: id,
12657
+ selected: selectedIndex != null ? selectedIndex : 0,
12658
+ tabs: options.map((option) => ({
12659
+ title: option.title,
12660
+ // if we pass null, we get some props-types console errors
12661
+ // eslint-disable-next-line react/jsx-no-useless-fragment
12662
+ content: /* @__PURE__ */ jsx45(Fragment7, {}),
12663
+ disabled: option.disabled || disabled
12664
+ })),
12665
+ onTabSelect: onSelect
12666
+ }
12667
+ )
12498
12668
  }
12499
- ) }),
12669
+ ),
12500
12670
  children
12501
12671
  ] });
12502
12672
  }
@@ -12529,13 +12699,13 @@ function SelectInputRendererComponent(props) {
12529
12699
  children,
12530
12700
  description,
12531
12701
  disabled,
12532
- error,
12533
12702
  help,
12534
12703
  label,
12535
12704
  options,
12536
12705
  placeholder,
12537
12706
  required,
12538
12707
  selectedIndex,
12708
+ validationState,
12539
12709
  onSelect
12540
12710
  } = props;
12541
12711
  const items = options.map(
@@ -12566,20 +12736,30 @@ function SelectInputRendererComponent(props) {
12566
12736
  return /* @__PURE__ */ jsx47(SelectInputOptionContent2, __spreadValues({}, contentProps));
12567
12737
  };
12568
12738
  return /* @__PURE__ */ jsxs16(Fragment8, { children: [
12569
- /* @__PURE__ */ jsx47(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx47(
12570
- SelectInput2,
12739
+ /* @__PURE__ */ jsx47(
12740
+ FieldInput_default,
12571
12741
  {
12572
- name: id,
12573
- placeholder,
12574
- items,
12575
- disabled,
12576
- value: selectedIndex,
12577
- renderValue,
12578
- filterable: items.length >= 8,
12579
- onChange: onSelect,
12580
- onClear: required ? void 0 : () => onSelect(null)
12742
+ id,
12743
+ label,
12744
+ help,
12745
+ description,
12746
+ validation: validationState,
12747
+ children: /* @__PURE__ */ jsx47(
12748
+ SelectInput2,
12749
+ {
12750
+ name: id,
12751
+ placeholder,
12752
+ items,
12753
+ disabled,
12754
+ value: selectedIndex,
12755
+ renderValue,
12756
+ filterable: items.length >= 8,
12757
+ onChange: onSelect,
12758
+ onClear: required ? void 0 : () => onSelect(null)
12759
+ }
12760
+ )
12581
12761
  }
12582
- ) }),
12762
+ ),
12583
12763
  children
12584
12764
  ] });
12585
12765
  }
@@ -12589,28 +12769,48 @@ import { useEffect as useEffect5 } from "react";
12589
12769
  import { SegmentedControl } from "@transferwise/components";
12590
12770
  import { Fragment as Fragment9, jsx as jsx48, jsxs as jsxs17 } from "react/jsx-runtime";
12591
12771
  function SegmentedInputRendererComponent(props) {
12592
- const { id, children, description, error, help, label, options, selectedIndex, onSelect } = props;
12772
+ const {
12773
+ id,
12774
+ children,
12775
+ description,
12776
+ help,
12777
+ label,
12778
+ options,
12779
+ selectedIndex,
12780
+ validationState,
12781
+ onSelect
12782
+ } = props;
12593
12783
  useEffect5(() => {
12594
12784
  if (!isValidIndex2(selectedIndex, options.length)) {
12595
12785
  onSelect(0);
12596
12786
  }
12597
12787
  }, [selectedIndex, onSelect, options.length]);
12598
12788
  return /* @__PURE__ */ jsxs17(Fragment9, { children: [
12599
- /* @__PURE__ */ jsx48(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx48(
12600
- SegmentedControl,
12789
+ /* @__PURE__ */ jsx48(
12790
+ FieldInput_default,
12601
12791
  {
12602
- name: `${id}-segmented-control`,
12603
- value: String(selectedIndex),
12604
- mode: "view",
12605
- segments: options.map((option, index) => ({
12606
- id: String(index),
12607
- value: String(index),
12608
- label: option.title,
12609
- controls: `${id}-children`
12610
- })),
12611
- onChange: (value) => onSelect(Number(value))
12792
+ id,
12793
+ label,
12794
+ help,
12795
+ description,
12796
+ validation: validationState,
12797
+ children: /* @__PURE__ */ jsx48(
12798
+ SegmentedControl,
12799
+ {
12800
+ name: `${id}-segmented-control`,
12801
+ value: String(selectedIndex),
12802
+ mode: "view",
12803
+ segments: options.map((option, index) => ({
12804
+ id: String(index),
12805
+ value: String(index),
12806
+ label: option.title,
12807
+ controls: `${id}-children`
12808
+ })),
12809
+ onChange: (value) => onSelect(Number(value))
12810
+ }
12811
+ )
12612
12812
  }
12613
- ) }),
12813
+ ),
12614
12814
  /* @__PURE__ */ jsx48("div", { id: `${id}-children`, children })
12615
12815
  ] });
12616
12816
  }
@@ -12643,15 +12843,22 @@ var StatusListRenderer = {
12643
12843
  canRenderType: "status-list",
12644
12844
  render: ({ margin, items, title }) => /* @__PURE__ */ jsxs18("div", { className: getMargin(margin), children: [
12645
12845
  title ? /* @__PURE__ */ jsx50(Header5, { title }) : null,
12646
- items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */ jsx50(
12846
+ items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ jsx50(
12647
12847
  Summary,
12648
12848
  {
12649
12849
  title: itemTitle,
12650
12850
  description,
12651
12851
  icon: icon && "name" in icon ? /* @__PURE__ */ jsx50(DynamicIcon_default, { name: icon.name }) : null,
12652
- status: mapStatus(status)
12852
+ status: mapStatus(status),
12853
+ action: callToAction ? {
12854
+ "aria-label": callToAction.accessibilityDescription,
12855
+ href: callToAction.href,
12856
+ text: callToAction.title,
12857
+ target: callToAction.href ? "_blank" : void 0,
12858
+ onClick: callToAction.href ? void 0 : callToAction.onClick
12859
+ } : void 0
12653
12860
  },
12654
- `${title}/${description || ""}`
12861
+ `${itemTitle}/${description || ""}`
12655
12862
  ))
12656
12863
  ] })
12657
12864
  };
@@ -12753,6 +12960,7 @@ var TextInputRenderer = {
12753
12960
  maxLength,
12754
12961
  minLength,
12755
12962
  type,
12963
+ validationState,
12756
12964
  value: initialValue
12757
12965
  } = _a, rest = __objRest(_a, [
12758
12966
  "id",
@@ -12764,11 +12972,22 @@ var TextInputRenderer = {
12764
12972
  "maxLength",
12765
12973
  "minLength",
12766
12974
  "type",
12975
+ "validationState",
12767
12976
  "value"
12768
12977
  ]);
12769
12978
  const value = initialValue != null ? initialValue : "";
12770
12979
  const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
12771
- return /* @__PURE__ */ jsx52(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx52(VariableTextInput_default, { control, inputProps }) });
12980
+ return /* @__PURE__ */ jsx52(
12981
+ FieldInput_default,
12982
+ {
12983
+ id,
12984
+ label,
12985
+ description,
12986
+ validation: validationState,
12987
+ help,
12988
+ children: /* @__PURE__ */ jsx52(VariableTextInput_default, { control, inputProps })
12989
+ }
12990
+ );
12772
12991
  }
12773
12992
  };
12774
12993
  var TextInputRenderer_default = TextInputRenderer;
@@ -12779,7 +12998,7 @@ import { jsx as jsx53 } from "react/jsx-runtime";
12779
12998
  var UploadInputRenderer = {
12780
12999
  canRenderType: "input-upload",
12781
13000
  render: (props) => {
12782
- const { id, accepts, error, label, description, disabled, maxSize, onUpload } = props;
13001
+ const { id, accepts, label, description, disabled, maxSize, validationState, onUpload } = props;
12783
13002
  const onUploadFile = async (formData) => {
12784
13003
  const file = formData.get("file");
12785
13004
  return onUpload(file).then(() => ({
@@ -12791,19 +13010,28 @@ var UploadInputRenderer = {
12791
13010
  };
12792
13011
  return (
12793
13012
  // We don't pass help here as there is no sensible place to display it
12794
- /* @__PURE__ */ jsx53(UploadFieldInput_default, { id, label: void 0, description: void 0, error, children: /* @__PURE__ */ jsx53(
12795
- UploadInput2,
13013
+ /* @__PURE__ */ jsx53(
13014
+ UploadFieldInput_default,
12796
13015
  {
12797
13016
  id,
12798
- description,
12799
- disabled,
12800
- fileTypes: getAcceptsString(accepts),
12801
- sizeLimit: maxSize ? toKilobytes(maxSize) : void 0,
12802
- uploadButtonTitle: label,
12803
- onDeleteFile,
12804
- onUploadFile
13017
+ label: void 0,
13018
+ description: void 0,
13019
+ validation: validationState,
13020
+ children: /* @__PURE__ */ jsx53(
13021
+ UploadInput2,
13022
+ {
13023
+ id,
13024
+ description,
13025
+ disabled,
13026
+ fileTypes: getAcceptsString(accepts),
13027
+ sizeLimit: maxSize ? toKilobytes(maxSize) : void 0,
13028
+ uploadButtonTitle: label,
13029
+ onDeleteFile,
13030
+ onUploadFile
13031
+ }
13032
+ )
12805
13033
  }
12806
- ) })
13034
+ )
12807
13035
  );
12808
13036
  }
12809
13037
  };
@@ -12818,10 +13046,10 @@ var LargeUploadRenderer = {
12818
13046
  label,
12819
13047
  description,
12820
13048
  disabled,
12821
- error,
12822
13049
  help,
12823
13050
  maxSize,
12824
13051
  type,
13052
+ validationState,
12825
13053
  onUpload
12826
13054
  } = _a, rest = __objRest(_a, [
12827
13055
  "id",
@@ -12830,10 +13058,10 @@ var LargeUploadRenderer = {
12830
13058
  "label",
12831
13059
  "description",
12832
13060
  "disabled",
12833
- "error",
12834
13061
  "help",
12835
13062
  "maxSize",
12836
13063
  "type",
13064
+ "validationState",
12837
13065
  "onUpload"
12838
13066
  ]);
12839
13067
  const uploadProps = __spreadProps(__spreadValues({}, rest), { id, name: id });
@@ -12846,16 +13074,26 @@ var LargeUploadRenderer = {
12846
13074
  throw e;
12847
13075
  }
12848
13076
  };
12849
- return /* @__PURE__ */ jsx53(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx53(
12850
- Upload,
12851
- __spreadProps(__spreadValues({}, uploadProps), {
12852
- usAccept: getAcceptsString(accepts),
12853
- usDisabled: disabled,
12854
- onSuccess: onUploadFile,
12855
- onFailure: async () => onUpload(null),
12856
- onCancel: async () => onUpload(null)
12857
- })
12858
- ) });
13077
+ return /* @__PURE__ */ jsx53(
13078
+ FieldInput_default,
13079
+ {
13080
+ id,
13081
+ label,
13082
+ description,
13083
+ validation: validationState,
13084
+ help,
13085
+ children: /* @__PURE__ */ jsx53(
13086
+ Upload,
13087
+ __spreadProps(__spreadValues({}, uploadProps), {
13088
+ usAccept: getAcceptsString(accepts),
13089
+ usDisabled: disabled,
13090
+ onSuccess: onUploadFile,
13091
+ onFailure: async () => onUpload(null),
13092
+ onCancel: async () => onUpload(null)
13093
+ })
13094
+ )
13095
+ }
13096
+ );
12859
13097
  }
12860
13098
  };
12861
13099
 
@@ -12952,7 +13190,7 @@ var external_confirmation_messages_default = defineMessages10({
12952
13190
  });
12953
13191
 
12954
13192
  // ../renderers/src/step/ExternalConfirmationDialog.tsx
12955
- import { Button as Button5, Markdown as Markdown5 } from "@transferwise/components";
13193
+ import { Button as Button6, Markdown as Markdown5 } from "@transferwise/components";
12956
13194
  import { jsx as jsx55, jsxs as jsxs20 } from "react/jsx-runtime";
12957
13195
  function ExternalConfirmationDialog({
12958
13196
  external,
@@ -12964,7 +13202,7 @@ function ExternalConfirmationDialog({
12964
13202
  /* @__PURE__ */ jsx55(Markdown5, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(external.url) }) }),
12965
13203
  /* @__PURE__ */ jsx55("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs20("div", { className: "df-box-renderer-width-lg", children: [
12966
13204
  /* @__PURE__ */ jsx55(
12967
- Button5,
13205
+ Button6,
12968
13206
  {
12969
13207
  block: true,
12970
13208
  className: "m-b-2",
@@ -12977,7 +13215,7 @@ function ExternalConfirmationDialog({
12977
13215
  children: formatMessage(external_confirmation_messages_default.open)
12978
13216
  }
12979
13217
  ),
12980
- /* @__PURE__ */ jsx55(Button5, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
13218
+ /* @__PURE__ */ jsx55(Button6, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
12981
13219
  ] }) })
12982
13220
  ] }) });
12983
13221
  }
@@ -13011,15 +13249,13 @@ import { ArrowLeft } from "@transferwise/icons";
13011
13249
  import { jsx as jsx56, jsxs as jsxs21 } from "react/jsx-runtime";
13012
13250
  function BackButton({ title, onClick }) {
13013
13251
  return /* @__PURE__ */ jsx56("div", { className: "m-b-2", children: /* @__PURE__ */ jsxs21(
13014
- "a",
13252
+ "button",
13015
13253
  {
13016
- href: "/",
13254
+ type: "button",
13017
13255
  className: "df-back-btn",
13256
+ title,
13018
13257
  "aria-label": title,
13019
- onClick: (event) => {
13020
- event.preventDefault();
13021
- onClick();
13022
- },
13258
+ onClick,
13023
13259
  children: [
13024
13260
  /* @__PURE__ */ jsx56("span", { className: "sr-only", children: title }),
13025
13261
  /* @__PURE__ */ jsx56(Avatar4, { type: "icon", children: /* @__PURE__ */ jsx56(ArrowLeft, { size: "24" }) })
@@ -14704,7 +14940,7 @@ var getBoxWidthClasses = (component) => {
14704
14940
  var DynamicBox_default = DynamicBox;
14705
14941
 
14706
14942
  // src/legacy/layout/button/DynamicButton.tsx
14707
- import { Button as Button6 } from "@transferwise/components";
14943
+ import { Button as Button7 } from "@transferwise/components";
14708
14944
 
14709
14945
  // src/legacy/layout/button/utils.ts
14710
14946
  var priorities = {
@@ -14776,7 +15012,7 @@ function DynamicButtonWithoutBehavior(props) {
14776
15012
  }
14777
15013
  };
14778
15014
  return /* @__PURE__ */ jsx72(
14779
- Button6,
15015
+ Button7,
14780
15016
  {
14781
15017
  size: getButtonSize(component.size),
14782
15018
  type: priority === "tertiary" ? void 0 : type,
@@ -14808,7 +15044,7 @@ function DynamicButtonWithBehavior(props) {
14808
15044
  }
14809
15045
  };
14810
15046
  return /* @__PURE__ */ jsx72(
14811
- Button6,
15047
+ Button7,
14812
15048
  {
14813
15049
  size: getButtonSize(component.size),
14814
15050
  type: priority === "tertiary" ? void 0 : type,
@@ -14910,7 +15146,7 @@ var DynamicDivider = ({ component }) => {
14910
15146
  var DynamicDivider_default = DynamicDivider;
14911
15147
 
14912
15148
  // src/legacy/layout/external/DynamicExternal.tsx
14913
- import { Button as Button7, Loader as Loader2, Size as Size2 } from "@transferwise/components";
15149
+ import { Button as Button8, Loader as Loader2, Size as Size2 } from "@transferwise/components";
14914
15150
  import { useCallback as useCallback6, useEffect as useEffect8 } from "react";
14915
15151
  import { useIntl as useIntl10 } from "react-intl";
14916
15152
 
@@ -14943,7 +15179,7 @@ var DynamicExternal = ({ component, onAction }) => {
14943
15179
  return /* @__PURE__ */ jsxs25(Fragment11, { children: [
14944
15180
  /* @__PURE__ */ jsx76(Loader2, { size: Size2.LARGE, classNames: { "tw-loader": "tw-loader m-x-auto" } }),
14945
15181
  /* @__PURE__ */ jsx76("br", {}),
14946
- /* @__PURE__ */ jsx76(Button7, { priority: "tertiary", block: true, onClick: openExternalUrl, children: retryTitle || intl.formatMessage(DynamicExternal_messages_default.retryTitle) })
15182
+ /* @__PURE__ */ jsx76(Button8, { priority: "tertiary", block: true, onClick: openExternalUrl, children: retryTitle || intl.formatMessage(DynamicExternal_messages_default.retryTitle) })
14947
15183
  ] });
14948
15184
  };
14949
15185
  var DynamicExternal_default = DynamicExternal;
@@ -14964,7 +15200,7 @@ var getSchemaColumnClasses = (width) => ({
14964
15200
  "col-sm-4": width === "sm"
14965
15201
  });
14966
15202
  function AllOfSchema(props) {
14967
- const { disabled = false } = props;
15203
+ const { disabled = false, hideTitle = false } = props;
14968
15204
  const onChangeModelIndex = (index, onChangeProps) => {
14969
15205
  const modelSchema = props.schema.allOf[index];
14970
15206
  models[index] = getValidObjectModelParts(onChangeProps.model, modelSchema) || {};
@@ -14973,7 +15209,7 @@ function AllOfSchema(props) {
14973
15209
  };
14974
15210
  const [models, setModels] = useState12(splitModel(props.model, props.schema.allOf));
14975
15211
  return /* @__PURE__ */ jsxs26(Fragment12, { children: [
14976
- props.schema.title && /* @__PURE__ */ jsx77(Header8, { title: props.schema.title }),
15212
+ props.schema.title && !hideTitle && /* @__PURE__ */ jsx77(Header8, { title: props.schema.title }),
14977
15213
  props.schema.description && /* @__PURE__ */ jsx77("p", { children: props.schema.description }),
14978
15214
  /* @__PURE__ */ jsx77("div", { className: "row", children: props.schema.allOf.map((schema, index) => (
14979
15215
  // eslint-disable-next-line react/no-array-index-key
@@ -17795,19 +18031,47 @@ var DynamicLayout_default = DynamicLayout;
17795
18031
  // src/legacy/layout/list/DynamicStatusList.tsx
17796
18032
  import { Header as Header13, Summary as Summary2 } from "@transferwise/components";
17797
18033
  import { jsx as jsx108, jsxs as jsxs38 } from "react/jsx-runtime";
17798
- var DynamicStatusList = ({ component }) => {
18034
+ var DynamicStatusList = ({ component, onAction }) => {
17799
18035
  return /* @__PURE__ */ jsxs38("div", { className: getMargin2(component.margin || "md"), children: [
17800
18036
  component.title ? /* @__PURE__ */ jsx108(Header13, { title: component.title }) : null,
17801
- component.items.map(mapListItemToSummary)
18037
+ component.items.map((item) => mapListItemToSummary(item, onAction))
17802
18038
  ] });
17803
18039
  };
17804
- var mapListItemToSummary = ({ title, description, icon, status }) => {
17805
- const props = __spreadValues(__spreadValues({
18040
+ var mapListItemToSummary = (props, onAction) => {
18041
+ const { title, description, icon, status } = props;
18042
+ const summaryProps = __spreadValues(__spreadValues({
17806
18043
  key: `${title}/${description || ""}`,
17807
18044
  title,
17808
- description
18045
+ description,
18046
+ action: "callToAction" in props ? callToActionToSummaryAction(props == null ? void 0 : props.callToAction, onAction) : void 0
17809
18047
  }, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */ jsx108(DynamicIcon_default2, { type: icon.name }) } : {}), status ? { status: statusMap[status] } : {});
17810
- return /* @__PURE__ */ jsx108(Summary2, __spreadValues({}, props));
18048
+ return /* @__PURE__ */ jsx108(Summary2, __spreadValues({}, summaryProps));
18049
+ };
18050
+ var callToActionToSummaryAction = (callToAction, onAction) => {
18051
+ if (!callToAction) {
18052
+ return void 0;
18053
+ }
18054
+ const { accessibilityDescription, behavior, title } = callToAction;
18055
+ if (behavior.link) {
18056
+ const { link } = behavior;
18057
+ return {
18058
+ text: title,
18059
+ "aria-label": accessibilityDescription,
18060
+ href: link.url,
18061
+ target: "_blank"
18062
+ };
18063
+ }
18064
+ if (behavior.action) {
18065
+ const { action } = behavior;
18066
+ return {
18067
+ text: title,
18068
+ "aria-label": accessibilityDescription,
18069
+ onClick: () => {
18070
+ onAction(action);
18071
+ }
18072
+ };
18073
+ }
18074
+ return void 0;
17811
18075
  };
17812
18076
  var statusListMap = {
17813
18077
  done: "done",
@@ -17841,7 +18105,7 @@ var DynamicLoadingIndicator = ({ component }) => {
17841
18105
  var DynamicLoadingIndicator_default = DynamicLoadingIndicator;
17842
18106
 
17843
18107
  // src/legacy/layout/paragraph/DynamicParagraph.tsx
17844
- import { Button as Button8 } from "@transferwise/components";
18108
+ import { Button as Button9 } from "@transferwise/components";
17845
18109
  import { useIntl as useIntl20 } from "react-intl";
17846
18110
 
17847
18111
  // src/common/messages/paragraph.messages.ts
@@ -17900,7 +18164,7 @@ function CopyableDynamicParagraph({ component }) {
17900
18164
  style: { textOverflow: "ellipsis" }
17901
18165
  }
17902
18166
  ),
17903
- /* @__PURE__ */ jsx110(Button8, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default2.copy) })
18167
+ /* @__PURE__ */ jsx110(Button9, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default2.copy) })
17904
18168
  ] });
17905
18169
  }
17906
18170
  function noop4() {
@@ -18213,7 +18477,7 @@ function TypeaheadFooter2({
18213
18477
  var DynamicSearch_default = DynamicSearch;
18214
18478
 
18215
18479
  // src/legacy/layout/modal/DynamicModal.tsx
18216
- import { Button as Button9, Modal as Modal4 } from "@transferwise/components";
18480
+ import { Button as Button10, Modal as Modal4 } from "@transferwise/components";
18217
18481
  import { useState as useState25 } from "react";
18218
18482
  import { jsx as jsx115, jsxs as jsxs44 } from "react/jsx-runtime";
18219
18483
  function DynamicModal(props) {
@@ -18221,7 +18485,7 @@ function DynamicModal(props) {
18221
18485
  const { component, onAction } = props;
18222
18486
  const { margin = "md" } = component;
18223
18487
  return /* @__PURE__ */ jsxs44("div", { className: getTextAlignmentAndMargin2({ margin }), children: [
18224
- /* @__PURE__ */ jsx115(Button9, { priority: "tertiary", block: true, onClick: () => isVisible(true), children: component.trigger.title }),
18488
+ /* @__PURE__ */ jsx115(Button10, { priority: "tertiary", block: true, onClick: () => isVisible(true), children: component.trigger.title }),
18225
18489
  /* @__PURE__ */ jsx115(
18226
18490
  Modal4,
18227
18491
  {
@@ -18774,7 +19038,7 @@ var CameraCapture_messages_default = defineMessages18({
18774
19038
  });
18775
19039
 
18776
19040
  // src/common/cameraCapture/components/bottomBar/BottomBar.tsx
18777
- import { Button as Button10, ControlType, Priority, Size as Size3 } from "@transferwise/components";
19041
+ import { Button as Button11, ControlType, Priority, Size as Size3 } from "@transferwise/components";
18778
19042
  import { useIntl as useIntl25 } from "react-intl";
18779
19043
  import { jsx as jsx119, jsxs as jsxs46 } from "react/jsx-runtime";
18780
19044
  var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ jsx119("div", { className: "bottom-bar", children: /* @__PURE__ */ jsx119(CaptureButton, { onClick: onCapture }) });
@@ -18785,7 +19049,7 @@ var ReviewBottomBar = ({
18785
19049
  const intl = useIntl25();
18786
19050
  return /* @__PURE__ */ jsx119("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ jsx119("div", { className: "row", children: /* @__PURE__ */ jsxs46("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
18787
19051
  /* @__PURE__ */ jsx119(
18788
- Button10,
19052
+ Button11,
18789
19053
  {
18790
19054
  className: "m-b-1",
18791
19055
  block: true,
@@ -18796,7 +19060,7 @@ var ReviewBottomBar = ({
18796
19060
  }
18797
19061
  ),
18798
19062
  /* @__PURE__ */ jsx119(
18799
- Button10,
19063
+ Button11,
18800
19064
  {
18801
19065
  className: "m-b-2",
18802
19066
  block: true,
@@ -19087,13 +19351,13 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
19087
19351
  var Overlay_default = Overlay;
19088
19352
 
19089
19353
  // src/common/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.tsx
19090
- import { Button as Button11 } from "@transferwise/components";
19354
+ import { Button as Button12 } from "@transferwise/components";
19091
19355
  import { jsx as jsx122, jsxs as jsxs49 } from "react/jsx-runtime";
19092
19356
  function CameraErrorScreen({ title, description, actionButton, onAction }) {
19093
19357
  return /* @__PURE__ */ jsx122("div", { className: "container p-t-5", children: /* @__PURE__ */ jsx122("div", { className: "row", children: /* @__PURE__ */ jsxs49("div", { className: "col-md-6 col-md-offset-3", children: [
19094
19358
  /* @__PURE__ */ jsx122("h2", { className: "text-xs-center m-b-3", children: title }),
19095
19359
  /* @__PURE__ */ jsx122("p", { className: "text-xs-center m-b-5", children: description }),
19096
- onAction && actionButton && /* @__PURE__ */ jsx122(Button11, { block: true, onClick: onAction, children: actionButton })
19360
+ onAction && actionButton && /* @__PURE__ */ jsx122(Button12, { block: true, onClick: onAction, children: actionButton })
19097
19361
  ] }) }) });
19098
19362
  }
19099
19363
  var CameraErrorScreen_default = CameraErrorScreen;