@wise/dynamic-flow-client 2.3.2 → 2.5.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/main.js CHANGED
@@ -99,9 +99,9 @@ var require_classnames = __commonJS({
99
99
  }
100
100
  });
101
101
 
102
- // ../../node_modules/.pnpm/react-webcam@7.1.1_react-dom@18.2.0_react@18.2.0/node_modules/react-webcam/dist/react-webcam.js
102
+ // ../../node_modules/.pnpm/react-webcam@7.2.0_react-dom@18.2.0_react@18.2.0/node_modules/react-webcam/dist/react-webcam.js
103
103
  var require_react_webcam = __commonJS({
104
- "../../node_modules/.pnpm/react-webcam@7.1.1_react-dom@18.2.0_react@18.2.0/node_modules/react-webcam/dist/react-webcam.js"(exports, module2) {
104
+ "../../node_modules/.pnpm/react-webcam@7.2.0_react-dom@18.2.0_react@18.2.0/node_modules/react-webcam/dist/react-webcam.js"(exports, module2) {
105
105
  "use strict";
106
106
  (function webpackUniversalModuleDefinition(root, factory) {
107
107
  if (typeof exports === "object" && typeof module2 === "object")
@@ -477,7 +477,7 @@ var require_react_webcam = __commonJS({
477
477
  Webcam3.prototype.render = function() {
478
478
  var _this = this;
479
479
  var _a = this, state = _a.state, props = _a.props;
480
- var audio = props.audio, forceScreenshotSourceSize = props.forceScreenshotSourceSize, onUserMedia = props.onUserMedia, onUserMediaError = props.onUserMediaError, screenshotFormat = props.screenshotFormat, screenshotQuality = props.screenshotQuality, minScreenshotWidth = props.minScreenshotWidth, minScreenshotHeight = props.minScreenshotHeight, audioConstraints = props.audioConstraints, videoConstraints = props.videoConstraints, imageSmoothing = props.imageSmoothing, mirrored = props.mirrored, _b = props.style, style = _b === void 0 ? {} : _b, children = props.children, rest = __rest(props, ["audio", "forceScreenshotSourceSize", "onUserMedia", "onUserMediaError", "screenshotFormat", "screenshotQuality", "minScreenshotWidth", "minScreenshotHeight", "audioConstraints", "videoConstraints", "imageSmoothing", "mirrored", "style", "children"]);
480
+ var audio = props.audio, forceScreenshotSourceSize = props.forceScreenshotSourceSize, disablePictureInPicture = props.disablePictureInPicture, onUserMedia = props.onUserMedia, onUserMediaError = props.onUserMediaError, screenshotFormat = props.screenshotFormat, screenshotQuality = props.screenshotQuality, minScreenshotWidth = props.minScreenshotWidth, minScreenshotHeight = props.minScreenshotHeight, audioConstraints = props.audioConstraints, videoConstraints = props.videoConstraints, imageSmoothing = props.imageSmoothing, mirrored = props.mirrored, _b = props.style, style = _b === void 0 ? {} : _b, children = props.children, rest = __rest(props, ["audio", "forceScreenshotSourceSize", "disablePictureInPicture", "onUserMedia", "onUserMediaError", "screenshotFormat", "screenshotQuality", "minScreenshotWidth", "minScreenshotHeight", "audioConstraints", "videoConstraints", "imageSmoothing", "mirrored", "style", "children"]);
481
481
  var videoStyle = mirrored ? __assign(__assign({}, style), { transform: (style.transform || "") + " scaleX(-1)" }) : style;
482
482
  var childrenProps = {
483
483
  getScreenshot: this.getScreenshot.bind(this)
@@ -485,7 +485,7 @@ var require_react_webcam = __commonJS({
485
485
  return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](
486
486
  react__WEBPACK_IMPORTED_MODULE_0__["Fragment"],
487
487
  null,
488
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("video", __assign({ autoPlay: true, src: state.src, muted: !audio, playsInline: true, ref: function(ref) {
488
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("video", __assign({ autoPlay: true, disablePictureInPicture, src: state.src, muted: !audio, playsInline: true, ref: function(ref) {
489
489
  _this.video = ref;
490
490
  }, style: videoStyle }, rest)),
491
491
  children && children(childrenProps)
@@ -493,6 +493,7 @@ var require_react_webcam = __commonJS({
493
493
  };
494
494
  Webcam3.defaultProps = {
495
495
  audio: false,
496
+ disablePictureInPicture: false,
496
497
  forceScreenshotSourceSize: false,
497
498
  imageSmoothing: true,
498
499
  mirrored: false,
@@ -2018,11 +2019,15 @@ var FormControlType = {
2018
2019
  RADIO: "radio",
2019
2020
  CHECKBOX: "checkbox",
2020
2021
  SELECT: "select",
2022
+ EMAIL: "email",
2021
2023
  FILE: "file",
2022
2024
  DATE: "date",
2023
2025
  DATETIME: "date-time",
2024
2026
  DATELOOKUP: "date-lookup",
2025
2027
  TEL: "tel",
2028
+ // For string schemas with number format
2029
+ NUMERIC: "numeric",
2030
+ // For number schemas
2026
2031
  NUMBER: "number",
2027
2032
  HIDDEN: "hidden",
2028
2033
  PASSWORD: "password",
@@ -2621,6 +2626,7 @@ var DynamicExternal_default = DynamicExternal;
2621
2626
  var import_react22 = require("react");
2622
2627
 
2623
2628
  // src/jsonSchemaForm/allOfSchema/AllOfSchema.tsx
2629
+ var import_components6 = require("@transferwise/components");
2624
2630
  var import_classnames = __toESM(require_classnames());
2625
2631
  var import_react11 = require("react");
2626
2632
  var import_jsx_runtime17 = require("react/jsx-runtime");
@@ -2648,7 +2654,7 @@ var AllOfSchema = (props) => {
2648
2654
  };
2649
2655
  const [models, setModels] = (0, import_react11.useState)(splitModel(props.model, props.schema.allOf));
2650
2656
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
2651
- props.schema.title && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h3", { className: "page-header", children: props.schema.title }),
2657
+ props.schema.title && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_components6.Header, { title: props.schema.title }),
2652
2658
  props.schema.description && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: props.schema.description }),
2653
2659
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "row", children: props.schema.allOf.map((schema, index) => (
2654
2660
  // eslint-disable-next-line react/no-array-index-key
@@ -2676,12 +2682,12 @@ AllOfSchema.defaultProps = {
2676
2682
  var AllOfSchema_default = AllOfSchema;
2677
2683
 
2678
2684
  // src/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
2679
- var import_components7 = require("@transferwise/components");
2685
+ var import_components8 = require("@transferwise/components");
2680
2686
  var import_classnames2 = __toESM(require_classnames());
2681
2687
  var import_react12 = require("react");
2682
2688
 
2683
2689
  // src/jsonSchemaForm/controlFeedback/ControlFeedback.tsx
2684
- var import_components6 = require("@transferwise/components");
2690
+ var import_components7 = require("@transferwise/components");
2685
2691
  var import_formatting = require("@transferwise/formatting");
2686
2692
  var import_react_intl5 = require("react-intl");
2687
2693
 
@@ -2748,12 +2754,12 @@ var ControlFeedback = (props) => {
2748
2754
  const validationMessages = __spreadValues(__spreadValues(__spreadValues({}, defaultValidationMessages), props.validationMessages), props.schema.validationMessages);
2749
2755
  const isErrorVisible = (props.submitted || !props.changed) && !!props.errors;
2750
2756
  const isValidationVisible = !isErrorVisible && (props.submitted || props.changed && props.blurred) && !!((_a = props.validations) == null ? void 0 : _a.length);
2751
- const isDescriptionVisible = props.focused && props.schema.description && !isValidationVisible;
2757
+ const isDescriptionVisible = props.schema.description && !isErrorVisible && !isValidationVisible;
2752
2758
  const hasInfoMessage = !!props.infoMessage;
2753
2759
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { id: props.id, children: [
2754
- isErrorVisible ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components6.InlineAlert, { type: "error", children: props.errors }) : null,
2755
- isValidationVisible ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components6.InlineAlert, { type: "error", children: props.validations.map((validation) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { children: validationMessages[validation] }, validation)) }) : null,
2756
- (isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_components6.InlineAlert, { type: "info", children: [
2760
+ isErrorVisible ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components7.InlineAlert, { type: "error", children: props.errors }) : null,
2761
+ isValidationVisible ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components7.InlineAlert, { type: "error", children: props.validations.map((validation) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { children: validationMessages[validation] }, validation)) }) : null,
2762
+ (isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_components7.InlineAlert, { type: "info", children: [
2757
2763
  isDescriptionVisible && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { children: props.schema.description }),
2758
2764
  hasInfoMessage && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { children: props.infoMessage })
2759
2765
  ] })
@@ -2961,7 +2967,7 @@ var MultipleFileUploadSchema = (props) => {
2961
2967
  const feedbackId = `${uid}-feedback`;
2962
2968
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: (0, import_classnames2.default)("form-group", { "has-error": showError }), children: [
2963
2969
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("label", { className: "d-block control-label", htmlFor: uid, children: props.schema.title }),
2964
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_components7.UploadInput, __spreadValues({}, uploadInputProps)) }),
2970
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_components8.UploadInput, __spreadValues({}, uploadInputProps)) }),
2965
2971
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2966
2972
  ControlFeedback_default,
2967
2973
  {
@@ -2992,7 +2998,7 @@ function getSuccessfullyProcessedFiles(allFiles) {
2992
2998
  return allFiles.filter((file) => !file.error && file.status === "succeeded");
2993
2999
  }
2994
3000
  function convertFileIdsToComponentFileObjects(fileIds) {
2995
- return fileIds.map((id) => isValidId(id) ? { id, status: import_components7.Status.SUCCEEDED } : null).filter((item) => item !== null);
3001
+ return fileIds.map((id) => isValidId(id) ? { id, status: import_components8.Status.SUCCEEDED } : null).filter((item) => item !== null);
2996
3002
  }
2997
3003
  function isValidId(id) {
2998
3004
  return isNumber(id) || isString(id);
@@ -3003,25 +3009,26 @@ function getValidationMessages(schema, required, defaultErrorMessages) {
3003
3009
  }
3004
3010
 
3005
3011
  // src/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.tsx
3006
- var import_components9 = require("@transferwise/components");
3012
+ var import_components10 = require("@transferwise/components");
3007
3013
  var import_icons = require("@transferwise/icons");
3008
3014
  var import_react13 = require("react");
3009
3015
  var import_react_intl11 = require("react-intl");
3010
3016
 
3011
3017
  // src/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.tsx
3012
- var import_components8 = require("@transferwise/components");
3018
+ var import_components9 = require("@transferwise/components");
3013
3019
  var import_jsx_runtime20 = require("react/jsx-runtime");
3014
3020
  var ItemSummaryOption = ({
3015
3021
  item,
3016
3022
  onClick
3017
3023
  }) => {
3018
3024
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3019
- import_components8.NavigationOption,
3025
+ import_components9.NavigationOption,
3020
3026
  {
3021
3027
  onClick,
3022
3028
  media: getNavigationOptionMedia(item),
3023
3029
  title: item.title,
3024
- content: item.description
3030
+ content: item.description,
3031
+ showMediaAtAllSizes: true
3025
3032
  }
3026
3033
  );
3027
3034
  };
@@ -3346,7 +3353,7 @@ var RepeatableSchema = ({
3346
3353
  };
3347
3354
  const { formatMessage } = (0, import_react_intl11.useIntl)();
3348
3355
  return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
3349
- schema.title && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_components9.Header, { title: schema.title }),
3356
+ schema.title && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_components10.Header, { title: schema.title }),
3350
3357
  itemSummaries && itemSummaries.map((itemSummary) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3351
3358
  ItemSummaryOption,
3352
3359
  {
@@ -3356,15 +3363,16 @@ var RepeatableSchema = ({
3356
3363
  JSON.stringify(itemSummary)
3357
3364
  )),
3358
3365
  /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3359
- import_components9.NavigationOption,
3366
+ import_components10.NavigationOption,
3360
3367
  {
3361
3368
  onClick: onAddItem,
3362
3369
  media: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons.Plus, {}),
3363
- title: schema.addItemTitle || formatMessage(RepeatableSchema_messages_default.addItemTitle)
3370
+ title: schema.addItemTitle || formatMessage(RepeatableSchema_messages_default.addItemTitle),
3371
+ showMediaAtAllSizes: true
3364
3372
  }
3365
3373
  ),
3366
3374
  /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3367
- import_components9.Modal,
3375
+ import_components10.Modal,
3368
3376
  {
3369
3377
  open: openModalType !== null,
3370
3378
  onClose: onCancelEdit,
@@ -3525,11 +3533,12 @@ ObjectSchema.defaultProps = {
3525
3533
  var ObjectSchema_default = ObjectSchema;
3526
3534
 
3527
3535
  // src/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
3536
+ var import_components14 = require("@transferwise/components");
3528
3537
  var import_classnames4 = __toESM(require_classnames());
3529
3538
  var import_react17 = require("react");
3530
3539
 
3531
3540
  // src/jsonSchemaForm/help/Help.tsx
3532
- var import_components10 = require("@transferwise/components");
3541
+ var import_components11 = require("@transferwise/components");
3533
3542
  var import_react_intl13 = require("react-intl");
3534
3543
 
3535
3544
  // src/jsonSchemaForm/help/Help.messages.js
@@ -3547,10 +3556,10 @@ var import_jsx_runtime26 = require("react/jsx-runtime");
3547
3556
  var Help = (props) => {
3548
3557
  const intl = (0, import_react_intl13.useIntl)();
3549
3558
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3550
- import_components10.Info,
3559
+ import_components11.Info,
3551
3560
  {
3552
3561
  className: "m-l-1",
3553
- content: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_components10.Markdown, { children: props.help.markdown }),
3562
+ content: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_components11.Markdown, { children: props.help.markdown }),
3554
3563
  presentation: "POPOVER",
3555
3564
  size: "sm",
3556
3565
  "aria-label": intl.formatMessage(Help_messages_default.helpAria)
@@ -3563,7 +3572,7 @@ var Help_default = Help;
3563
3572
  var import_react16 = require("react");
3564
3573
 
3565
3574
  // src/formControl/FormControl.tsx
3566
- var import_components11 = require("@transferwise/components");
3575
+ var import_components12 = require("@transferwise/components");
3567
3576
  var import_react15 = require("react");
3568
3577
 
3569
3578
  // src/formControl/utils/value-utils.ts
@@ -3673,17 +3682,96 @@ var logInvalidTypeFallbackWarning = ({
3673
3682
  );
3674
3683
  };
3675
3684
 
3685
+ // src/formControl/utils/getAutocompleteString.ts
3686
+ var getAutocompleteString = (hints) => {
3687
+ const validHints = hints.filter((hint) => autocompleteHintMap[hint]);
3688
+ if (validHints.length === 0) {
3689
+ return "off";
3690
+ }
3691
+ return validHints.map((hint) => autocompleteHintMap[hint]).join(" ");
3692
+ };
3693
+ var autocompleteHintMap = {
3694
+ on: "on",
3695
+ name: "name",
3696
+ namePrefix: "honorific-prefix",
3697
+ givenName: "given-name",
3698
+ additionalName: "additional-name",
3699
+ familyName: "family-name",
3700
+ nameSuffix: "honorific-suffix",
3701
+ nickname: "nickname",
3702
+ email: "email",
3703
+ // Web doesn't have a specific mapping for new username, but this is semantically close enough
3704
+ newUsername: "username",
3705
+ username: "username",
3706
+ newPassword: "new-password",
3707
+ password: "current-password",
3708
+ oneTimeCode: "one-time-code",
3709
+ jobTitle: "organization-title",
3710
+ organizationName: "organization",
3711
+ fullStreetAddress: "street-address",
3712
+ streetAddressLine1: "address-line1",
3713
+ streetAddressLine2: "address-line2",
3714
+ streetAddressLine3: "address-line3",
3715
+ addressLevel1: "address-level1",
3716
+ addressLevel2: "address-level2",
3717
+ addressLevel3: "address-level3",
3718
+ addressLevel4: "address-level4",
3719
+ countryCode: "country",
3720
+ countryName: "country-name",
3721
+ postalCode: "postal-code",
3722
+ creditCardName: "cc-name",
3723
+ creditCardGivenName: "cc-given-name",
3724
+ creditCardMiddleName: "cc-additional-name",
3725
+ creditCardFamilyName: "cc-family-name",
3726
+ creditCardNumber: "cc-number",
3727
+ creditCardExpiration: "cc-exp",
3728
+ creditCardExpirationMonth: "cc-exp-month",
3729
+ creditCardExpirationYear: "cc-exp-year",
3730
+ creditCardSecurityCode: "cc-csc",
3731
+ creditCardType: "cc-type",
3732
+ transactionCurrency: "transaction-currency",
3733
+ transactionAmount: "transaction-amount",
3734
+ language: "language",
3735
+ birthdate: "bday",
3736
+ birthdateDay: "bday-day",
3737
+ birthdateMonth: "bday-month",
3738
+ birthdateYear: "bday-year",
3739
+ gender: "sex",
3740
+ phoneNumber: "tel",
3741
+ phoneCountryCode: "tel-country-code",
3742
+ phoneNational: "tel-national",
3743
+ phoneAreaCode: "tel-area-code",
3744
+ phoneLocal: "tel-local",
3745
+ phoneLocalPrefix: "tel-local-prefix",
3746
+ phoneLocalSuffix: "tel-local-suffix",
3747
+ phoneExtension: "tel-extension",
3748
+ url: "url",
3749
+ photo: "photo",
3750
+ impp: "impp",
3751
+ shipping: "shipping",
3752
+ billing: "billing",
3753
+ home: "home",
3754
+ work: "work",
3755
+ mobile: "mobile",
3756
+ fax: "fax",
3757
+ pager: "pager"
3758
+ };
3759
+
3676
3760
  // src/formControl/FormControl.tsx
3677
3761
  var import_jsx_runtime27 = require("react/jsx-runtime");
3678
3762
  var _FormControl = class _FormControl extends import_react15.PureComponent {
3679
3763
  constructor(props) {
3680
3764
  super(props);
3681
- /**
3682
- * autocomplete hides our form help so we need to disable it when help text
3683
- * is present. Chrome ignores autocomplete=off, the only way to disable it is
3684
- * to provide an 'invalid' value, for which 'disabled' serves.
3685
- */
3686
- this.getAutocompleteStatus = () => this.props.autoComplete ? "on" : "disabled";
3765
+ this.getAutocompleteValue = () => {
3766
+ const { autoComplete, autocompleteHint } = this.props;
3767
+ if (isArray(autocompleteHint)) {
3768
+ return getAutocompleteString(autocompleteHint);
3769
+ }
3770
+ if (autoComplete === true) {
3771
+ return "on";
3772
+ }
3773
+ return "off";
3774
+ };
3687
3775
  this.handleOnChange = (value) => {
3688
3776
  this.props.onChange(value);
3689
3777
  };
@@ -3764,7 +3852,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
3764
3852
  switch (type) {
3765
3853
  case FormControlType.RADIO:
3766
3854
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3767
- import_components11.RadioGroup,
3855
+ import_components12.RadioGroup,
3768
3856
  {
3769
3857
  radios: options.map(this.mapOption),
3770
3858
  name,
@@ -3774,7 +3862,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
3774
3862
  );
3775
3863
  case FormControlType.CHECKBOX:
3776
3864
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3777
- import_components11.Checkbox,
3865
+ import_components12.Checkbox,
3778
3866
  {
3779
3867
  checked: getSafeBooleanValue(value, { coerceValue: true }),
3780
3868
  disabled,
@@ -3789,7 +3877,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
3789
3877
  case FormControlType.SELECT: {
3790
3878
  const search = options.length >= 20;
3791
3879
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3792
- import_components11.Select,
3880
+ import_components12.Select,
3793
3881
  {
3794
3882
  id,
3795
3883
  selected: this.getSelectedOption(options),
@@ -3813,7 +3901,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
3813
3901
  }
3814
3902
  case FormControlType.TAB:
3815
3903
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3816
- import_components11.Tabs,
3904
+ import_components12.Tabs,
3817
3905
  {
3818
3906
  selected: ((_a = this.getSelectedOption(options)) == null ? void 0 : _a.value) || 0,
3819
3907
  tabs: options.map((option) => ({
@@ -3831,11 +3919,12 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
3831
3919
  }
3832
3920
  }
3833
3921
  );
3834
- case FormControlType.NUMBER:
3922
+ case FormControlType.NUMERIC:
3923
+ case FormControlType.NUMBER: {
3835
3924
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3836
3925
  "input",
3837
3926
  {
3838
- autoComplete: this.getAutocompleteStatus(),
3927
+ autoComplete: this.getAutocompleteValue(),
3839
3928
  className: "form-control",
3840
3929
  disabled,
3841
3930
  id,
@@ -3849,7 +3938,11 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
3849
3938
  value: getSafeStringOrNumberValue(value, { coerceValue: true }),
3850
3939
  onBlur: this.handleOnBlur,
3851
3940
  onChange: (event) => {
3852
- this.props.onChange(parseFloat(event.target.value));
3941
+ if (type === FormControlType.NUMERIC) {
3942
+ this.props.onChange(event.target.value);
3943
+ } else {
3944
+ this.props.onChange(parseFloat(event.target.value));
3945
+ }
3853
3946
  },
3854
3947
  onFocus: this.handleOnFocus,
3855
3948
  onWheel: (event) => {
@@ -3860,6 +3953,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
3860
3953
  "aria-describedby": describedBy
3861
3954
  }
3862
3955
  );
3956
+ }
3863
3957
  case FormControlType.HIDDEN:
3864
3958
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3865
3959
  "input",
@@ -3874,7 +3968,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
3874
3968
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3875
3969
  "input",
3876
3970
  {
3877
- autoComplete: this.getAutocompleteStatus(),
3971
+ autoComplete: this.getAutocompleteValue(),
3878
3972
  className: "form-control",
3879
3973
  disabled,
3880
3974
  id,
@@ -3892,7 +3986,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
3892
3986
  case FormControlType.DATE:
3893
3987
  case FormControlType.DATETIME:
3894
3988
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3895
- import_components11.DateInput,
3989
+ import_components12.DateInput,
3896
3990
  {
3897
3991
  disabled,
3898
3992
  size,
@@ -3906,7 +4000,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
3906
4000
  );
3907
4001
  case FormControlType.DATELOOKUP: {
3908
4002
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3909
- import_components11.DateLookup,
4003
+ import_components12.DateLookup,
3910
4004
  {
3911
4005
  value: getSafeDateStringValue(value),
3912
4006
  min: minDate,
@@ -3924,7 +4018,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
3924
4018
  }
3925
4019
  case FormControlType.TEL:
3926
4020
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3927
- import_components11.PhoneNumberInput,
4021
+ import_components12.PhoneNumberInput,
3928
4022
  {
3929
4023
  disabled,
3930
4024
  countryCode,
@@ -3952,11 +4046,11 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
3952
4046
  onFocus: this.handleOnFocus,
3953
4047
  onBlur: this.handleOnBlur,
3954
4048
  disabled,
3955
- autoComplete: this.getAutocompleteStatus()
4049
+ autoComplete: this.getAutocompleteValue()
3956
4050
  };
3957
4051
  if (this.props.displayPattern) {
3958
4052
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3959
- import_components11.TextareaWithDisplayFormat,
4053
+ import_components12.TextareaWithDisplayFormat,
3960
4054
  __spreadProps(__spreadValues({
3961
4055
  displayPattern: this.props.displayPattern
3962
4056
  }, textareaProps), {
@@ -3978,7 +4072,7 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
3978
4072
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3979
4073
  // @ts-expect-error - TODO: Remove this once Upload is migrated to TypeScript
3980
4074
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3981
- import_components11.Upload,
4075
+ import_components12.Upload,
3982
4076
  __spreadProps(__spreadValues({}, uploadProps), {
3983
4077
  usAccept: uploadProps.usAccept || "*",
3984
4078
  usDisabled: uploadProps.usDisabled || disabled,
@@ -3996,9 +4090,10 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
3996
4090
  );
3997
4091
  }
3998
4092
  case FormControlType.TEXT:
4093
+ case FormControlType.EMAIL:
3999
4094
  default: {
4000
4095
  const inputProps = {
4001
- type: "text",
4096
+ type: type === FormControlType.EMAIL ? "email" : "text",
4002
4097
  className: "form-control",
4003
4098
  id,
4004
4099
  name,
@@ -4011,11 +4106,11 @@ var _FormControl = class _FormControl extends import_react15.PureComponent {
4011
4106
  onFocus: this.handleOnFocus,
4012
4107
  onBlur: this.handleOnBlur,
4013
4108
  disabled,
4014
- autoComplete: this.getAutocompleteStatus()
4109
+ autoComplete: this.getAutocompleteValue()
4015
4110
  };
4016
4111
  if (this.props.displayPattern) {
4017
4112
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4018
- import_components11.InputWithDisplayFormat,
4113
+ import_components12.InputWithDisplayFormat,
4019
4114
  __spreadProps(__spreadValues({
4020
4115
  displayPattern: this.props.displayPattern
4021
4116
  }, inputProps), {
@@ -4072,7 +4167,7 @@ _FormControl.defaultProps = {
4072
4167
  var FormControl = _FormControl;
4073
4168
 
4074
4169
  // src/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
4075
- var import_components12 = require("@transferwise/components");
4170
+ var import_components13 = require("@transferwise/components");
4076
4171
  var import_jsx_runtime28 = require("react/jsx-runtime");
4077
4172
  var mapConstSchemaToOption = (schema, controlType) => {
4078
4173
  switch (controlType) {
@@ -4121,17 +4216,17 @@ var getIconPropertyForSelectOption = (icon) => {
4121
4216
  var getAvatarPropertyForRadioOption = ({ image, icon }) => {
4122
4217
  if (image == null ? void 0 : image.url) {
4123
4218
  return {
4124
- avatar: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components12.Avatar, { type: import_components12.AvatarType.THUMBNAIL, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("img", { src: image.url, alt: "" }) })
4219
+ avatar: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components13.Avatar, { type: import_components13.AvatarType.THUMBNAIL, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("img", { src: image.url, alt: "" }) })
4125
4220
  };
4126
4221
  }
4127
4222
  if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
4128
4223
  return {
4129
- avatar: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components12.Avatar, { type: import_components12.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DynamicIcon_default, { type: icon.name }) })
4224
+ avatar: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components13.Avatar, { type: import_components13.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DynamicIcon_default, { type: icon.name }) })
4130
4225
  };
4131
4226
  }
4132
4227
  if (icon == null ? void 0 : icon.text) {
4133
4228
  return {
4134
- avatar: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components12.Avatar, { type: import_components12.AvatarType.INITIALS, children: icon.text })
4229
+ avatar: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components13.Avatar, { type: import_components13.AvatarType.INITIALS, children: icon.text })
4135
4230
  };
4136
4231
  }
4137
4232
  return null;
@@ -4166,23 +4261,12 @@ var getControlType = (schema) => {
4166
4261
  }
4167
4262
  return schema.control || FormControlType.SELECT;
4168
4263
  }
4264
+ if (isStringSchema(schema)) {
4265
+ return getStringSchemaControlType(schema);
4266
+ }
4169
4267
  if ("control" in schema && schema.control) {
4170
4268
  return schema.control;
4171
4269
  }
4172
- if (schema.type === "string") {
4173
- switch (schema.format) {
4174
- case "date":
4175
- return "date";
4176
- case "password":
4177
- return "password";
4178
- case "phone-number":
4179
- return "tel";
4180
- case "base64url":
4181
- return "file";
4182
- default:
4183
- return "text";
4184
- }
4185
- }
4186
4270
  if (schema.type === "boolean") {
4187
4271
  return "checkbox";
4188
4272
  }
@@ -4191,6 +4275,34 @@ var getControlType = (schema) => {
4191
4275
  }
4192
4276
  return schema.type;
4193
4277
  };
4278
+ var getStringSchemaControlType = ({
4279
+ format,
4280
+ control
4281
+ }) => {
4282
+ if (control) {
4283
+ return stringControlToFormControlType[control] || control;
4284
+ }
4285
+ if (format) {
4286
+ return stringFormatToFormControlType[format] || "text";
4287
+ }
4288
+ return "text";
4289
+ };
4290
+ var stringControlToFormControlType = {
4291
+ "date-lookup": "date-lookup",
4292
+ password: "password",
4293
+ textarea: "textarea",
4294
+ email: "email",
4295
+ numeric: "numeric",
4296
+ "phone-number": "tel"
4297
+ };
4298
+ var stringFormatToFormControlType = {
4299
+ date: "date",
4300
+ // Legacy formats
4301
+ email: "email",
4302
+ base64url: "file",
4303
+ password: "password",
4304
+ "phone-number": "tel"
4305
+ };
4194
4306
  var getOptions = (schema, controlType) => {
4195
4307
  if (schema.oneOf) {
4196
4308
  return schema.oneOf.map((childSchema) => mapConstSchemaToOption(childSchema, controlType));
@@ -4223,6 +4335,7 @@ var SchemaFormControl = (props) => {
4223
4335
  options: options || [],
4224
4336
  placeholder: schema.placeholder,
4225
4337
  autoComplete: !schema.help,
4338
+ autocompleteHint: schema.autocompleteHint,
4226
4339
  disabled: disabled || schema.disabled,
4227
4340
  displayPattern: schema.displayFormat,
4228
4341
  // TODO: LOW avoid type assertion below
@@ -4334,6 +4447,7 @@ var OneOfSchema = (props) => {
4334
4447
  const feedbackId = `${id}-feedback`;
4335
4448
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
4336
4449
  (props.schema.oneOf.length > 1 || isConstSchema(props.schema.oneOf[0])) && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
4450
+ props.schema.alert && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DynamicAlert_default, { component: props.schema.alert }),
4337
4451
  /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: (0, import_classnames4.default)(formGroupClasses), children: [
4338
4452
  getTitleAndHelp(props.schema, id),
4339
4453
  /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
@@ -4364,8 +4478,7 @@ var OneOfSchema = (props) => {
4364
4478
  infoMessage: null
4365
4479
  }
4366
4480
  )
4367
- ] }),
4368
- props.schema.alert && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DynamicAlert_default, { component: props.schema.alert })
4481
+ ] })
4369
4482
  ] }),
4370
4483
  isNoNConstSchema(props.schema.oneOf[schemaIndex]) && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4371
4484
  GenericSchema_default,
@@ -4383,16 +4496,17 @@ var OneOfSchema = (props) => {
4383
4496
  ] });
4384
4497
  };
4385
4498
  function getTitleAndHelp(schema, id) {
4499
+ var _a;
4386
4500
  const helpElement = schema.help ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Help_default, { help: schema.help }) : null;
4387
- const titleElement = isConstSchema(schema.oneOf[0]) ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "control-label d-inline", htmlFor: id, children: [
4501
+ const titleElement = isConstSchema(schema.oneOf[0]) ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "m-b-1", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "control-label d-inline", htmlFor: id, children: [
4388
4502
  schema.title,
4389
4503
  " ",
4390
4504
  helpElement
4391
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("h4", { className: "m-b-2", children: [
4505
+ ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_jsx_runtime30.Fragment, { children: helpElement ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("h4", { className: "m-b-2", children: [
4392
4506
  schema.title,
4393
4507
  " ",
4394
4508
  helpElement
4395
- ] });
4509
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_components14.Header, { title: (_a = schema.title) != null ? _a : "" }) });
4396
4510
  return schema.title ? titleElement : helpElement;
4397
4511
  }
4398
4512
  function getValidations(props, schemaIndex) {
@@ -4432,7 +4546,7 @@ var import_classnames5 = __toESM(require_classnames());
4432
4546
  var import_react19 = require("react");
4433
4547
 
4434
4548
  // src/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.tsx
4435
- var import_components13 = require("@transferwise/components");
4549
+ var import_components15 = require("@transferwise/components");
4436
4550
  var import_react18 = require("react");
4437
4551
  var import_jsx_runtime31 = require("react/jsx-runtime");
4438
4552
  var UploadInputAdapter = (props) => {
@@ -4450,7 +4564,7 @@ var UploadInputAdapter = (props) => {
4450
4564
  onCancel
4451
4565
  } = props;
4452
4566
  const onEvent = useEventDispatcher();
4453
- const files = (0, import_react18.useMemo)(() => fileId ? [{ id: fileId, status: import_components13.Status.SUCCEEDED }] : [], [fileId]);
4567
+ const files = (0, import_react18.useMemo)(() => fileId ? [{ id: fileId, status: import_components15.Status.SUCCEEDED }] : [], [fileId]);
4454
4568
  const uploadFile = (formData) => {
4455
4569
  onEvent("Dynamic Flow - PersistAsync", { status: "pending", schemaId: id });
4456
4570
  return httpClient(`${httpOptions.url}`, {
@@ -4469,7 +4583,7 @@ var UploadInputAdapter = (props) => {
4469
4583
  });
4470
4584
  };
4471
4585
  return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4472
- import_components13.UploadInput,
4586
+ import_components15.UploadInput,
4473
4587
  {
4474
4588
  id,
4475
4589
  fileInputName: httpOptions.fileInputName,
@@ -4605,7 +4719,7 @@ var getSelectionFromModel = (schema, model) => {
4605
4719
  };
4606
4720
 
4607
4721
  // src/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.tsx
4608
- var import_components14 = require("@transferwise/components");
4722
+ var import_components16 = require("@transferwise/components");
4609
4723
  var import_jsx_runtime34 = require("react/jsx-runtime");
4610
4724
  var PromotedOneOfCheckboxControl = (props) => {
4611
4725
  const { id, selection, setSelection } = props;
@@ -4617,13 +4731,13 @@ var PromotedOneOfCheckboxControl = (props) => {
4617
4731
  const toggleSelection = () => {
4618
4732
  setSelection(checked ? selectionWhenUnchecked : selectionWhenChecked);
4619
4733
  };
4620
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "form-group", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_components14.Checkbox, { id, label: title, checked, onChange: toggleSelection }) });
4734
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "form-group", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_components16.Checkbox, { id, label: title, checked, onChange: toggleSelection }) });
4621
4735
  };
4622
4736
  PromotedOneOfCheckboxControl.defaultProps = {};
4623
4737
  var PromotedOneOfCheckboxControl_default = PromotedOneOfCheckboxControl;
4624
4738
 
4625
4739
  // src/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.tsx
4626
- var import_components15 = require("@transferwise/components");
4740
+ var import_components17 = require("@transferwise/components");
4627
4741
  var import_jsx_runtime35 = require("react/jsx-runtime");
4628
4742
  var PromotedOneOfRadioControl = (props) => {
4629
4743
  var _a, _b;
@@ -4644,7 +4758,7 @@ var PromotedOneOfRadioControl = (props) => {
4644
4758
  return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "form-group", children: [
4645
4759
  title && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("label", { className: "control-label", htmlFor: id, children: title }),
4646
4760
  /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
4647
- import_components15.RadioGroup,
4761
+ import_components17.RadioGroup,
4648
4762
  {
4649
4763
  name: "promoted-selection",
4650
4764
  selectedValue: selection,
@@ -4735,7 +4849,7 @@ function getOtherOneOf(schema) {
4735
4849
  var PromotedOneOfSchema_default = PromotedOneOfSchema;
4736
4850
 
4737
4851
  // src/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
4738
- var import_components16 = require("@transferwise/components");
4852
+ var import_components18 = require("@transferwise/components");
4739
4853
  var import_react_intl15 = require("react-intl");
4740
4854
 
4741
4855
  // src/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.js
@@ -4759,7 +4873,7 @@ var ReadOnlySchema = ({ schema, model }) => {
4759
4873
  const { title = "" } = schema;
4760
4874
  const { formatMessage } = (0, import_react_intl15.useIntl)();
4761
4875
  const value = getValueForSchema({ schema, model, formatMessage });
4762
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components16.DefinitionList, { layout: import_components16.Layout.VERTICAL_ONE_COLUMN, definitions: [{ title, value, key: "" }] });
4876
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components18.DefinitionList, { layout: import_components18.Layout.VERTICAL_ONE_COLUMN, definitions: [{ title, value, key: "" }] });
4763
4877
  };
4764
4878
  var ReadOnlySchema_default = ReadOnlySchema;
4765
4879
  function getValueForSchema({
@@ -5003,18 +5117,18 @@ var DynamicHeading = (props) => {
5003
5117
  var DynamicHeading_default = DynamicHeading;
5004
5118
 
5005
5119
  // src/layout/markdown/DynamicMarkdown.tsx
5006
- var import_components17 = require("@transferwise/components");
5120
+ var import_components19 = require("@transferwise/components");
5007
5121
  var import_jsx_runtime43 = require("react/jsx-runtime");
5008
5122
  var DynamicMarkdown = ({ component }) => {
5009
5123
  const { content, align, margin } = component;
5010
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_components17.Markdown, { config: { link: { target: "_blank" } }, children: content }) });
5124
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_components19.Markdown, { config: { link: { target: "_blank" } }, children: content }) });
5011
5125
  };
5012
5126
  var DynamicInfo = ({ component }) => {
5013
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: getTextAlignmentAndMargin(component), children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_components17.Markdown, { config: { link: { target: "_blank" } }, children: component.markdown }) });
5127
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: getTextAlignmentAndMargin(component), children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_components19.Markdown, { config: { link: { target: "_blank" } }, children: component.markdown }) });
5014
5128
  };
5015
5129
 
5016
5130
  // src/layout/image/DynamicImage.tsx
5017
- var import_components18 = require("@transferwise/components");
5131
+ var import_components20 = require("@transferwise/components");
5018
5132
  var import_react24 = require("react");
5019
5133
  var import_jsx_runtime44 = require("react/jsx-runtime");
5020
5134
  var DynamicImage = ({ component: image }) => {
@@ -5033,7 +5147,7 @@ var DynamicImage = ({ component: image }) => {
5033
5147
  if (!imageSource) {
5034
5148
  return null;
5035
5149
  }
5036
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_components18.Image, __spreadValues({ className: `img-responsive ${getMargin(margin || "md")}` }, imageProps)) });
5150
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_components20.Image, __spreadValues({ className: `img-responsive ${getMargin(margin || "md")}` }, imageProps)) });
5037
5151
  };
5038
5152
  var readImageBlobAsDataURL = (imageBlob) => {
5039
5153
  return new Promise((resolve, reject) => {
@@ -5066,7 +5180,7 @@ var getImageSource = async (httpClient, imageUrl) => {
5066
5180
  var DynamicImage_default = DynamicImage;
5067
5181
 
5068
5182
  // src/layout/instructions/DynamicInstructions.tsx
5069
- var import_components19 = require("@transferwise/components");
5183
+ var import_components21 = require("@transferwise/components");
5070
5184
  var import_jsx_runtime45 = require("react/jsx-runtime");
5071
5185
  var doContext = ["positive", "neutral"];
5072
5186
  var dontContext = ["warning", "negative"];
@@ -5075,8 +5189,8 @@ var DynamicInstructions = ({ component }) => {
5075
5189
  const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
5076
5190
  const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
5077
5191
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: getMargin(component.margin || "md"), children: [
5078
- component.title ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_components19.Header, { title: component.title }) : null,
5079
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_components19.InstructionsList, { dos, donts })
5192
+ component.title ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_components21.Header, { title: component.title }) : null,
5193
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_components21.InstructionsList, { dos, donts })
5080
5194
  ] });
5081
5195
  };
5082
5196
  var DynamicInstructions_default = DynamicInstructions;
@@ -5173,15 +5287,11 @@ var DynamicLayout = (props) => {
5173
5287
  var DynamicLayout_default = DynamicLayout;
5174
5288
 
5175
5289
  // src/layout/list/DynamicStatusList.tsx
5176
- var import_components20 = require("@transferwise/components");
5290
+ var import_components22 = require("@transferwise/components");
5177
5291
  var import_jsx_runtime47 = require("react/jsx-runtime");
5178
5292
  var DynamicStatusList = ({ component }) => {
5179
5293
  return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: getMargin(component.margin || "md"), children: [
5180
- component.title ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("h4", { className: "m-b-2", children: [
5181
- " ",
5182
- component.title,
5183
- " "
5184
- ] }) : null,
5294
+ component.title ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components22.Header, { title: component.title }) : null,
5185
5295
  component.items.map(mapListItemToSummary)
5186
5296
  ] });
5187
5297
  };
@@ -5191,7 +5301,7 @@ var mapListItemToSummary = ({ title, description, icon, status }) => {
5191
5301
  title,
5192
5302
  description
5193
5303
  }, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DynamicIcon_default, { type: icon.name }) } : {}), status ? { status: statusMap[status] } : {});
5194
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components20.Summary, __spreadValues({}, props));
5304
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components22.Summary, __spreadValues({}, props));
5195
5305
  };
5196
5306
  var statusListMap = {
5197
5307
  done: "done",
@@ -5207,12 +5317,12 @@ var statusMap = __spreadValues(__spreadValues({}, statusListMap), legacyStatusMa
5207
5317
  var DynamicStatusList_default = DynamicStatusList;
5208
5318
 
5209
5319
  // src/layout/loadingIndicator/DynamicLoadingIndicator.tsx
5210
- var import_components21 = require("@transferwise/components");
5320
+ var import_components23 = require("@transferwise/components");
5211
5321
  var import_jsx_runtime48 = require("react/jsx-runtime");
5212
5322
  var DynamicLoadingIndicator = ({ component }) => {
5213
5323
  const { margin, size = "md" } = component;
5214
5324
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5215
- import_components21.Loader,
5325
+ import_components23.Loader,
5216
5326
  {
5217
5327
  size,
5218
5328
  classNames: {
@@ -5225,7 +5335,7 @@ var DynamicLoadingIndicator = ({ component }) => {
5225
5335
  var DynamicLoadingIndicator_default = DynamicLoadingIndicator;
5226
5336
 
5227
5337
  // src/layout/paragraph/DynamicParagraph.tsx
5228
- var import_components23 = require("@transferwise/components");
5338
+ var import_components25 = require("@transferwise/components");
5229
5339
  var import_react_intl17 = require("react-intl");
5230
5340
 
5231
5341
  // src/layout/paragraph/DynamicParagraph.messages.ts
@@ -5244,10 +5354,10 @@ var DynamicParagraph_messages_default = (0, import_react_intl16.defineMessages)(
5244
5354
  });
5245
5355
 
5246
5356
  // src/layout/paragraph/useSnackBarIfAvailable.ts
5247
- var import_components22 = require("@transferwise/components");
5357
+ var import_components24 = require("@transferwise/components");
5248
5358
  var import_react25 = require("react");
5249
5359
  function useSnackBarIfAvailable() {
5250
- const context = (0, import_react25.useContext)(import_components22.SnackbarContext);
5360
+ const context = (0, import_react25.useContext)(import_components24.SnackbarContext);
5251
5361
  return context ? context.createSnackbar : noop2;
5252
5362
  }
5253
5363
  function noop2() {
@@ -5281,7 +5391,7 @@ var CopyableDynamicParagraph = ({ component }) => {
5281
5391
  style: { textOverflow: "ellipsis" }
5282
5392
  }
5283
5393
  ),
5284
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components23.Button, { block: true, onClick: copy, children: formatMessage(DynamicParagraph_messages_default.copy) })
5394
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components25.Button, { block: true, onClick: copy, children: formatMessage(DynamicParagraph_messages_default.copy) })
5285
5395
  ] });
5286
5396
  };
5287
5397
  function noop3() {
@@ -5289,7 +5399,7 @@ function noop3() {
5289
5399
  var DynamicParagraph_default = DynamicParagraph;
5290
5400
 
5291
5401
  // src/layout/review/DynamicReview.tsx
5292
- var import_components24 = require("@transferwise/components");
5402
+ var import_components26 = require("@transferwise/components");
5293
5403
  var import_jsx_runtime50 = require("react/jsx-runtime");
5294
5404
  var getDefinitions = (orientation, review) => {
5295
5405
  return review.fields.map(
@@ -5323,28 +5433,22 @@ var getReviewLayout = (review) => {
5323
5433
  var DynamicReview = (props) => {
5324
5434
  const review = props.component;
5325
5435
  const margin = getMargin(review.margin || "xs");
5326
- const getReviewAction = (action) => {
5327
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
5328
- "a",
5329
- {
5330
- href: action.url,
5331
- className: "pull-right",
5332
- role: "button",
5333
- onClick: (event) => {
5334
- event.preventDefault();
5335
- props.onAction(action);
5336
- },
5337
- children: action.title
5436
+ const getReviewAction = (title, action) => ({
5437
+ text: title != null ? title : "",
5438
+ href: action.url,
5439
+ onClick: (event) => {
5440
+ event.preventDefault();
5441
+ if (action) {
5442
+ props.onAction(action);
5338
5443
  }
5339
- );
5340
- };
5444
+ }
5445
+ });
5341
5446
  const orientation = getReviewLayout(review);
5342
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
5343
- review.title && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("h6", { className: "m-b-2", children: [
5344
- review.title,
5345
- review.action && getReviewAction(review.action)
5346
- ] }),
5347
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components24.DefinitionList, { layout: orientation, definitions: getDefinitions(orientation, review) }) })
5447
+ const callToAction = review.callToAction ? getReviewAction(review.callToAction.title, review.callToAction.action) : null;
5448
+ const legacyCallToAction = !callToAction && review.action ? getReviewAction(review.action.title || "", review.action) : null;
5449
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: margin, children: [
5450
+ review.title && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components26.Header, { title: review.title, action: callToAction || legacyCallToAction || void 0 }),
5451
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components26.DefinitionList, { layout: orientation, definitions: getDefinitions(orientation, review) }) })
5348
5452
  ] });
5349
5453
  };
5350
5454
  var DynamicReview_default = DynamicReview;
@@ -5353,16 +5457,17 @@ var DynamicReview_default = DynamicReview;
5353
5457
  var import_react27 = require("react");
5354
5458
 
5355
5459
  // src/layout/search/SearchInput.tsx
5356
- var import_components25 = require("@transferwise/components");
5460
+ var import_components27 = require("@transferwise/components");
5357
5461
  var import_jsx_runtime51 = require("react/jsx-runtime");
5358
5462
  var SearchInput = ({ title, value, onFocus, onChange }) => {
5359
5463
  return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("label", { className: "control-label d-inline", children: [
5360
5464
  title,
5361
5465
  /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
5362
- import_components25.Input,
5466
+ import_components27.Input,
5363
5467
  {
5364
5468
  type: "text",
5365
5469
  value,
5470
+ className: "m-t-1",
5366
5471
  onFocus,
5367
5472
  onChange: (event) => onChange(event.currentTarget.value)
5368
5473
  }
@@ -5371,7 +5476,7 @@ var SearchInput = ({ title, value, onFocus, onChange }) => {
5371
5476
  };
5372
5477
 
5373
5478
  // src/layout/search/SearchResults.tsx
5374
- var import_components26 = require("@transferwise/components");
5479
+ var import_components28 = require("@transferwise/components");
5375
5480
  var import_react_intl19 = require("react-intl");
5376
5481
 
5377
5482
  // src/dynamicFlow/utils/errorBoundary/ErrorBoundary.messages.ts
@@ -5395,9 +5500,9 @@ var SearchResults = ({ results, emptyMessage, onSelect }) => {
5395
5500
  if (results.length === 0) {
5396
5501
  return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "m-t-2", children: emptyMessage });
5397
5502
  }
5398
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components26.NavigationOptionsList, { children: results.map((result) => {
5503
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components28.NavigationOptionsList, { children: results.map((result) => {
5399
5504
  return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
5400
- import_components26.NavigationOption,
5505
+ import_components28.NavigationOption,
5401
5506
  {
5402
5507
  title: result.title,
5403
5508
  content: result.description,
@@ -5615,7 +5720,7 @@ var BasicTypeSchema = (props) => {
5615
5720
  const formGroupClasses = {
5616
5721
  "form-group": true,
5617
5722
  "has-error": (props.submitted || !changed) && !!props.errors || (props.submitted || changed && blurred) && !!validations.length,
5618
- "has-info": focused && !!props.schema.description || !!props.infoMessage
5723
+ "has-info": !!props.schema.description || !!props.infoMessage
5619
5724
  };
5620
5725
  const showLabel = props.schema.format !== "file" && props.schema.type !== "boolean";
5621
5726
  const schemaHelp = props.schema.help;
@@ -5623,7 +5728,7 @@ var BasicTypeSchema = (props) => {
5623
5728
  return !isHidden ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
5624
5729
  props.schema.alert && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(DynamicAlert_default, { component: props.schema.alert }),
5625
5730
  /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: (0, import_classnames6.default)(formGroupClasses), children: [
5626
- showLabel && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "d-inline-block", children: [
5731
+ showLabel && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "d-inline-block m-b-1", children: [
5627
5732
  /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("label", { className: "control-label d-inline", htmlFor: id, children: props.schema.title }),
5628
5733
  !!schemaHelp && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Help_default, { help: schemaHelp })
5629
5734
  ] }),
@@ -6036,7 +6141,7 @@ var CameraCapture_messages_default = (0, import_react_intl22.defineMessages)({
6036
6141
  });
6037
6142
 
6038
6143
  // src/step/cameraStep/cameraCapture/components/bottomBar/BottomBar.tsx
6039
- var import_components27 = require("@transferwise/components");
6144
+ var import_components29 = require("@transferwise/components");
6040
6145
  var import_react_intl23 = require("react-intl");
6041
6146
  var import_jsx_runtime57 = require("react/jsx-runtime");
6042
6147
  var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bottom-bar", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(CaptureButton, { onClick: onCapture }) });
@@ -6047,24 +6152,24 @@ var ReviewBottomBar = ({
6047
6152
  const intl = (0, import_react_intl23.useIntl)();
6048
6153
  return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
6049
6154
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
6050
- import_components27.Button,
6155
+ import_components29.Button,
6051
6156
  {
6052
6157
  className: "m-b-1",
6053
6158
  block: true,
6054
- size: import_components27.Size.MEDIUM,
6055
- type: import_components27.ControlType.ACCENT,
6159
+ size: import_components29.Size.MEDIUM,
6160
+ type: import_components29.ControlType.ACCENT,
6056
6161
  onClick: onSubmit,
6057
6162
  children: intl.formatMessage(CameraCapture_messages_default.reviewSubmit)
6058
6163
  }
6059
6164
  ),
6060
6165
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
6061
- import_components27.Button,
6166
+ import_components29.Button,
6062
6167
  {
6063
6168
  className: "m-b-2",
6064
6169
  block: true,
6065
- size: import_components27.Size.MEDIUM,
6066
- type: import_components27.ControlType.ACCENT,
6067
- priority: import_components27.Priority.SECONDARY,
6170
+ size: import_components29.Size.MEDIUM,
6171
+ type: import_components29.ControlType.ACCENT,
6172
+ priority: import_components29.Priority.SECONDARY,
6068
6173
  onClick: onRetry,
6069
6174
  children: intl.formatMessage(CameraCapture_messages_default.reviewRetry)
6070
6175
  }
@@ -6303,7 +6408,7 @@ var Overlay = ({
6303
6408
  var Overlay_default = Overlay;
6304
6409
 
6305
6410
  // src/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.tsx
6306
- var import_components28 = require("@transferwise/components");
6411
+ var import_components30 = require("@transferwise/components");
6307
6412
  var import_react_intl27 = require("react-intl");
6308
6413
 
6309
6414
  // src/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.ts
@@ -6333,7 +6438,7 @@ var NoCameraAccess = ({ onAction }) => {
6333
6438
  return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { id: "no-camera-access", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "container p-t-5", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [
6334
6439
  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h2", { className: "text-xs-center m-b-3", children: intl.formatMessage(NoCameraAccess_messages_default.title) }),
6335
6440
  /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { className: "text-xs-center m-b-5", children: intl.formatMessage(NoCameraAccess_messages_default.paragraph) }),
6336
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_components28.Button, { block: true, onClick: onAction, children: intl.formatMessage(NoCameraAccess_messages_default.action) })
6441
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_components30.Button, { block: true, onClick: onAction, children: intl.formatMessage(NoCameraAccess_messages_default.action) })
6337
6442
  ] }) }) }) });
6338
6443
  };
6339
6444
  var NoCameraAccess_default = NoCameraAccess;
@@ -6702,7 +6807,7 @@ function getOrigin(url) {
6702
6807
  }
6703
6808
 
6704
6809
  // src/dynamicFlow/BackButton.tsx
6705
- var import_components30 = require("@transferwise/components");
6810
+ var import_components32 = require("@transferwise/components");
6706
6811
  var import_icons2 = require("@transferwise/icons");
6707
6812
  var import_jsx_runtime65 = require("react/jsx-runtime");
6708
6813
  var BackButton = ({ title, action, onAction }) => {
@@ -6718,7 +6823,7 @@ var BackButton = ({ title, action, onAction }) => {
6718
6823
  "aria-label": title,
6719
6824
  children: [
6720
6825
  /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "sr-only", children: title }),
6721
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_components30.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_icons2.ArrowLeft, { size: "24" }) })
6826
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_components32.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_icons2.ArrowLeft, { size: "24" }) })
6722
6827
  ]
6723
6828
  }
6724
6829
  );
@@ -6892,19 +6997,19 @@ var isInlineSchema = (schema) => {
6892
6997
  };
6893
6998
 
6894
6999
  // src/dynamicFlow/utils/useLoader.tsx
6895
- var import_components31 = require("@transferwise/components");
7000
+ var import_components33 = require("@transferwise/components");
6896
7001
  var import_react41 = require("react");
6897
7002
  var import_jsx_runtime67 = require("react/jsx-runtime");
6898
7003
  function useLoader(loaderConfig, initialState) {
6899
7004
  const config = __spreadValues({
6900
- size: import_components31.Size.EXTRA_LARGE,
7005
+ size: import_components33.Size.EXTRA_LARGE,
6901
7006
  initial: true,
6902
7007
  submission: false
6903
7008
  }, loaderConfig);
6904
7009
  const [loadingState, setLoadingState] = (0, import_react41.useState)(initialState);
6905
7010
  const shouldDisplayLoader = config.initial && loadingState === "initial" || config.submission && loadingState === "submission";
6906
7011
  const loader = shouldDisplayLoader ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
6907
- import_components31.Loader,
7012
+ import_components33.Loader,
6908
7013
  {
6909
7014
  size: config.size,
6910
7015
  classNames: { "tw-loader": "tw-loader m-x-auto" },
@@ -6918,20 +7023,20 @@ function useLoader(loaderConfig, initialState) {
6918
7023
  var import_react42 = require("react");
6919
7024
 
6920
7025
  // src/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.tsx
6921
- var import_components32 = require("@transferwise/components");
7026
+ var import_components34 = require("@transferwise/components");
6922
7027
  var import_react_intl33 = require("react-intl");
6923
7028
  var import_jsx_runtime68 = require("react/jsx-runtime");
6924
7029
  var ErrorBoundaryAlert = ({ onDismiss }) => {
6925
7030
  const { formatMessage } = (0, import_react_intl33.useIntl)();
6926
7031
  return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
6927
- import_components32.Alert,
7032
+ import_components34.Alert,
6928
7033
  {
6929
7034
  action: {
6930
7035
  text: formatMessage(ErrorBoundary_messages_default.retry),
6931
7036
  href: window.location.href
6932
7037
  },
6933
7038
  message: formatMessage(ErrorBoundary_messages_default.errorAlert),
6934
- type: import_components32.Sentiment.NEGATIVE,
7039
+ type: import_components34.Sentiment.NEGATIVE,
6935
7040
  className: "m-b-3",
6936
7041
  onDismiss
6937
7042
  }
@@ -7929,7 +8034,7 @@ var th_default = {
7929
8034
  // src/i18n/tr.json
7930
8035
  var tr_default = {
7931
8036
  "dynamicFlows.ArraySchema.addItem": "Kaydet",
7932
- "dynamicFlows.ArraySchema.addItemTitle": "Add Item",
8037
+ "dynamicFlows.ArraySchema.addItemTitle": "\xD6\u011Fe ekle",
7933
8038
  "dynamicFlows.ArraySchema.editItem": "Kaydet",
7934
8039
  "dynamicFlows.ArraySchema.maxItemsError": "L\xFCtfen {maxItems} veya daha az ekleme yap\u0131n",
7935
8040
  "dynamicFlows.ArraySchema.minItemsError": "L\xFCtfen en az {minItems} ekleme yap\u0131n.",
@@ -7942,7 +8047,7 @@ var tr_default = {
7942
8047
  "dynamicFlows.CameraCapture.reviewInstructions": "Foto\u011Fraf\u0131n\u0131z net, okunakl\u0131 ve eksiksiz mi?",
7943
8048
  "dynamicFlows.CameraCapture.reviewRetry": "Hay\u0131r, tekrar dene",
7944
8049
  "dynamicFlows.CameraCapture.reviewSubmit": "Evet, g\xF6nder",
7945
- "dynamicFlows.CameraCapture.rotatePhone.text": "Rotate your phone to portrait view to take a photo",
8050
+ "dynamicFlows.CameraCapture.rotatePhone.text": "Foto\u011Fraf \xE7ekmek i\xE7in telefonunuzu dik pozisyonda tutun",
7946
8051
  "dynamicFlows.ControlFeedback.maxLength": "L\xFCtfen {maxLength} veya daha az karakter girin.",
7947
8052
  "dynamicFlows.ControlFeedback.maximum": "L\xFCtfen {maximum} veya daha d\xFC\u015F\xFCk bir say\u0131 girin.",
7948
8053
  "dynamicFlows.ControlFeedback.maximumDate": "L\xFCtfen {maximum} veya daha erken bir tarih girin.",