@wise/dynamic-flow-client 3.23.1-experimental-3a3c1f1 → 3.24.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
@@ -144,10 +144,10 @@ var init_clsx = __esm({
144
144
  }
145
145
  });
146
146
 
147
- // ../../node_modules/.pnpm/@wise+art@2.16.2_@transferwise+neptune-css@14.19.1_@types+react@18.3.11_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-c8ed1f53.esm.js
147
+ // ../../node_modules/.pnpm/@wise+art@2.16.3_@transferwise+neptune-css@14.19.1_@types+react@18.3.11_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-a91e5689.esm.js
148
148
  var import_react7, import_jsx_runtime17, unknownFlagName, Flag, Sizes, ImageSizes, imageSizes, Assets, RenderMode;
149
- var init_index_c8ed1f53_esm = __esm({
150
- "../../node_modules/.pnpm/@wise+art@2.16.2_@transferwise+neptune-css@14.19.1_@types+react@18.3.11_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-c8ed1f53.esm.js"() {
149
+ var init_index_a91e5689_esm = __esm({
150
+ "../../node_modules/.pnpm/@wise+art@2.16.3_@transferwise+neptune-css@14.19.1_@types+react@18.3.11_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-a91e5689.esm.js"() {
151
151
  "use strict";
152
152
  init_clsx();
153
153
  import_react7 = require("react");
@@ -165,18 +165,16 @@ var init_index_c8ed1f53_esm = __esm({
165
165
  }, [code]);
166
166
  const detailed = intrinsicSize >= 150;
167
167
  const name = fallback !== "unknown" ? `${code.toLowerCase()}${fallback == null && detailed ? "-detailed" : ""}` : unknownFlagName;
168
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", {
168
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("img", {
169
169
  className: clsx(`wds-flag wds-flag-${name}`, className),
170
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("img", {
171
- src: `https://wise.com/web-art/assets/flags/${name}.svg`,
172
- loading,
173
- alt: "",
174
- width: intrinsicSize,
175
- height: intrinsicSize,
176
- onError: () => {
177
- setFallback((prev) => prev == null && detailed ? "simple" : "unknown");
178
- }
179
- })
170
+ src: `https://wise.com/web-art/assets/flags/${name}.svg`,
171
+ loading,
172
+ alt: "",
173
+ width: intrinsicSize,
174
+ height: intrinsicSize,
175
+ onError: () => {
176
+ setFallback((prev) => prev == null && detailed ? "simple" : "unknown");
177
+ }
180
178
  });
181
179
  };
182
180
  (function(Sizes2) {
@@ -5907,13 +5905,21 @@ var z = /* @__PURE__ */ Object.freeze({
5907
5905
  quotelessJson,
5908
5906
  ZodError
5909
5907
  });
5910
- var sizeSchema = z.union([
5911
- z.literal("xs"),
5912
- z.literal("sm"),
5913
- z.literal("md"),
5914
- z.literal("lg"),
5915
- z.literal("xl")
5908
+ var imageSchema = z.object({
5909
+ text: z.string().optional(),
5910
+ url: z.string(),
5911
+ accessibilityDescription: z.string().optional()
5912
+ });
5913
+ var httpMethodSchema = z.union([
5914
+ z.literal("GET"),
5915
+ z.literal("POST"),
5916
+ z.literal("PUT"),
5917
+ z.literal("PATCH"),
5918
+ z.literal("DELETE")
5916
5919
  ]);
5920
+ var iconNamedSchema = z.object({
5921
+ name: z.string()
5922
+ });
5917
5923
  var contextSchema = z.union([
5918
5924
  z.literal("positive"),
5919
5925
  z.literal("neutral"),
@@ -5924,107 +5930,18 @@ var contextSchema = z.union([
5924
5930
  z.literal("info"),
5925
5931
  z.literal("primary")
5926
5932
  ]);
5927
- var columnsLayoutBiasSchema = z.union([
5928
- z.literal("none"),
5929
- z.literal("left"),
5930
- z.literal("right")
5931
- ]);
5932
- var statusListLayoutStatusSchema = z.union([
5933
- z.literal("not-done"),
5934
- z.literal("pending"),
5935
- z.literal("done")
5936
- ]);
5937
- var alignSchema = z.union([z.literal("left"), z.literal("center"), z.literal("right")]);
5938
- var formLayoutSchemaReferenceSchema = z.object({
5939
- $ref: z.string()
5940
- });
5941
- var modalLayoutTriggerSchema = z.object({
5942
- title: z.string()
5943
- });
5944
- var httpMethodSchema = z.union([
5945
- z.literal("GET"),
5946
- z.literal("POST"),
5947
- z.literal("PUT"),
5948
- z.literal("PATCH"),
5949
- z.literal("DELETE")
5950
- ]);
5951
- var dividerLayoutSchema = z.object({
5952
- type: z.literal("divider"),
5953
- control: z.string().optional(),
5954
- margin: sizeSchema.optional()
5933
+ var iconTextSchema = z.object({
5934
+ text: z.string()
5955
5935
  });
5956
- var listLayoutStatusSchema = z.union([
5957
- z.literal("warning"),
5958
- z.literal("neutral"),
5959
- z.literal("positive")
5936
+ var sizeSchema = z.union([
5937
+ z.literal("xs"),
5938
+ z.literal("sm"),
5939
+ z.literal("md"),
5940
+ z.literal("lg"),
5941
+ z.literal("xl")
5960
5942
  ]);
5961
- var headingLayoutSchema = z.object({
5962
- type: z.literal("heading"),
5963
- text: z.string(),
5964
- size: sizeSchema.optional(),
5965
- align: alignSchema.optional(),
5966
- control: z.string().optional(),
5967
- margin: sizeSchema.optional()
5968
- });
5969
- var formLayoutSchema = z.object({
5970
- type: z.literal("form"),
5971
- schema: formLayoutSchemaReferenceSchema.optional(),
5972
- schemaId: z.string(),
5973
- control: z.string().optional(),
5974
- margin: sizeSchema.optional()
5975
- });
5976
- var imageLayoutSchema = z.object({
5977
- type: z.literal("image"),
5978
- text: z.string().optional(),
5979
- url: z.string(),
5980
- size: sizeSchema.optional(),
5981
- accessibilityDescription: z.string().optional(),
5982
- control: z.string().optional(),
5983
- margin: sizeSchema.optional()
5984
- });
5985
- var infoLayoutSchema = z.object({
5986
- type: z.literal("info"),
5987
- markdown: z.string(),
5988
- align: alignSchema.optional(),
5989
- control: z.string().optional(),
5990
- margin: sizeSchema.optional()
5991
- });
5992
- var loadingIndicatorLayoutSchema = z.object({
5993
- type: z.literal("loading-indicator"),
5994
- size: sizeSchema.optional(),
5995
- control: z.string().optional(),
5996
- margin: sizeSchema.optional()
5997
- });
5998
- var paragraphLayoutSchema = z.object({
5999
- type: z.literal("paragraph"),
6000
- text: z.string(),
6001
- align: alignSchema.optional(),
6002
- control: z.string().optional(),
6003
- margin: sizeSchema.optional()
6004
- });
6005
- var instructionsLayoutItemSchema = z.object({
6006
- text: z.string(),
6007
- context: contextSchema
6008
- });
6009
- var helpSchema = z.object({
6010
- markdown: z.string()
6011
- });
6012
- var imageSchema = z.object({
6013
- text: z.string().optional(),
6014
- url: z.string(),
6015
- accessibilityDescription: z.string().optional()
6016
- });
6017
- var summaryProviderSchema = z.object({
6018
- providesTitle: z.boolean().optional(),
6019
- providesDescription: z.boolean().optional(),
6020
- providesIcon: z.boolean().optional(),
6021
- providesImage: z.boolean().optional()
6022
- });
6023
- var validateAsyncSchema = z.object({
6024
- param: z.string(),
6025
- method: httpMethodSchema,
6026
- url: z.string()
6027
- });
5943
+ var alignSchema = z.union([z.literal("left"), z.literal("center"), z.literal("right")]);
5944
+ var iconSchema = z.union([iconNamedSchema, iconTextSchema]);
6028
5945
  var autocompleteTokenSchema = z.union([
6029
5946
  z.literal("on"),
6030
5947
  z.literal("name"),
@@ -6090,14 +6007,106 @@ var autocompleteTokenSchema = z.union([
6090
6007
  z.literal("fax"),
6091
6008
  z.literal("pager")
6092
6009
  ]);
6093
- var stringSchemaFormatSchema = z.union([
6094
- z.literal("date"),
6095
- z.literal("email"),
6096
- z.literal("numeric"),
6097
- z.literal("password"),
6098
- z.literal("phone-number"),
6099
- z.literal("base64url")
6010
+ var loadingIndicatorLayoutSchema = z.object({
6011
+ type: z.literal("loading-indicator"),
6012
+ size: sizeSchema.optional(),
6013
+ control: z.string().optional(),
6014
+ margin: sizeSchema.optional()
6015
+ });
6016
+ var paragraphLayoutSchema = z.object({
6017
+ type: z.literal("paragraph"),
6018
+ text: z.string(),
6019
+ align: alignSchema.optional(),
6020
+ control: z.string().optional(),
6021
+ margin: sizeSchema.optional()
6022
+ });
6023
+ var dividerLayoutSchema = z.object({
6024
+ type: z.literal("divider"),
6025
+ control: z.string().optional(),
6026
+ margin: sizeSchema.optional()
6027
+ });
6028
+ var listLayoutStatusSchema = z.union([
6029
+ z.literal("warning"),
6030
+ z.literal("neutral"),
6031
+ z.literal("positive")
6032
+ ]);
6033
+ var formLayoutSchemaReferenceSchema = z.object({
6034
+ $ref: z.string()
6035
+ });
6036
+ var imageLayoutSchema = z.object({
6037
+ type: z.literal("image"),
6038
+ text: z.string().optional(),
6039
+ url: z.string(),
6040
+ size: sizeSchema.optional(),
6041
+ accessibilityDescription: z.string().optional(),
6042
+ control: z.string().optional(),
6043
+ margin: sizeSchema.optional()
6044
+ });
6045
+ var statusListLayoutStatusSchema = z.union([
6046
+ z.literal("not-done"),
6047
+ z.literal("pending"),
6048
+ z.literal("done")
6049
+ ]);
6050
+ var instructionsLayoutItemSchema = z.object({
6051
+ text: z.string(),
6052
+ context: contextSchema
6053
+ });
6054
+ var modalLayoutTriggerSchema = z.object({
6055
+ title: z.string()
6056
+ });
6057
+ var searchLayoutSchema = z.object({
6058
+ type: z.literal("search"),
6059
+ title: z.string(),
6060
+ method: httpMethodSchema,
6061
+ url: z.string(),
6062
+ param: z.string(),
6063
+ emptyMessage: z.string().optional(),
6064
+ control: z.string().optional(),
6065
+ margin: sizeSchema.optional()
6066
+ });
6067
+ var infoLayoutSchema = z.object({
6068
+ type: z.literal("info"),
6069
+ markdown: z.string(),
6070
+ align: alignSchema.optional(),
6071
+ control: z.string().optional(),
6072
+ margin: sizeSchema.optional()
6073
+ });
6074
+ var formLayoutSchema = z.object({
6075
+ type: z.literal("form"),
6076
+ schema: formLayoutSchemaReferenceSchema.optional(),
6077
+ schemaId: z.string(),
6078
+ control: z.string().optional(),
6079
+ margin: sizeSchema.optional()
6080
+ });
6081
+ var headingLayoutSchema = z.object({
6082
+ type: z.literal("heading"),
6083
+ text: z.string(),
6084
+ size: sizeSchema.optional(),
6085
+ align: alignSchema.optional(),
6086
+ control: z.string().optional(),
6087
+ margin: sizeSchema.optional()
6088
+ });
6089
+ var markdownLayoutSchema = z.object({
6090
+ type: z.literal("markdown"),
6091
+ content: z.string(),
6092
+ align: alignSchema.optional(),
6093
+ control: z.string().optional(),
6094
+ margin: sizeSchema.optional()
6095
+ });
6096
+ var columnsLayoutBiasSchema = z.union([
6097
+ z.literal("none"),
6098
+ z.literal("left"),
6099
+ z.literal("right")
6100
6100
  ]);
6101
+ var helpSchema = z.object({
6102
+ markdown: z.string()
6103
+ });
6104
+ var searchSearchRequestSchema = z.object({
6105
+ url: z.string(),
6106
+ method: httpMethodSchema,
6107
+ param: z.string(),
6108
+ query: z.string()
6109
+ });
6101
6110
  var jsonElementSchema = z.lazy(
6102
6111
  () => z.union([
6103
6112
  z.string(),
@@ -6107,7 +6116,6 @@ var jsonElementSchema = z.lazy(
6107
6116
  z.array(jsonElementSchema)
6108
6117
  ]).nullable()
6109
6118
  );
6110
- var uploadSourceSchema = z.union([z.literal("camera"), z.literal("file")]);
6111
6119
  var externalSchema = z.object({
6112
6120
  url: z.string()
6113
6121
  });
@@ -6115,28 +6123,42 @@ var stepErrorSchema = z.object({
6115
6123
  error: z.string().optional(),
6116
6124
  validation: jsonElementSchema.optional()
6117
6125
  });
6118
- var errorResponseBodySchema = z.object({
6119
- refreshFormUrl: z.string().optional(),
6120
- analytics: z.record(z.string()).optional(),
6121
- error: z.string().optional(),
6122
- validation: jsonElementSchema.optional(),
6123
- refreshUrl: z.string().optional()
6126
+ var stringSchemaFormatSchema = z.union([
6127
+ z.literal("date"),
6128
+ z.literal("email"),
6129
+ z.literal("numeric"),
6130
+ z.literal("password"),
6131
+ z.literal("phone-number"),
6132
+ z.literal("base64url")
6133
+ ]);
6134
+ var summarySummariserSchema = z.object({
6135
+ defaultTitle: z.string().optional(),
6136
+ defaultDescription: z.string().optional(),
6137
+ defaultIcon: iconSchema.optional(),
6138
+ defaultImage: imageLayoutSchema.optional(),
6139
+ providesTitle: z.boolean().optional(),
6140
+ providesDescription: z.boolean().optional(),
6141
+ providesIcon: z.boolean().optional(),
6142
+ providesImage: z.boolean().optional()
6124
6143
  });
6125
- var searchSearchRequestSchema = z.object({
6126
- url: z.string(),
6127
- method: httpMethodSchema,
6144
+ var validateAsyncSchema = z.object({
6128
6145
  param: z.string(),
6129
- query: z.string()
6146
+ method: httpMethodSchema,
6147
+ url: z.string()
6130
6148
  });
6149
+ var summaryProviderSchema = z.object({
6150
+ providesTitle: z.boolean().optional(),
6151
+ providesDescription: z.boolean().optional(),
6152
+ providesIcon: z.boolean().optional(),
6153
+ providesImage: z.boolean().optional()
6154
+ });
6155
+ var uploadSourceSchema = z.union([z.literal("camera"), z.literal("file")]);
6131
6156
  var navigationStackBehaviorSchema = z.union([
6132
6157
  z.literal("default"),
6133
6158
  z.literal("remove-previous"),
6134
6159
  z.literal("remove-all"),
6135
6160
  z.literal("replace-current")
6136
6161
  ]);
6137
- var linkSchema = z.object({
6138
- url: z.string()
6139
- });
6140
6162
  var actionTypeSchema = z.union([
6141
6163
  z.literal("primary"),
6142
6164
  z.literal("secondary"),
@@ -6144,11 +6166,9 @@ var actionTypeSchema = z.union([
6144
6166
  z.literal("positive"),
6145
6167
  z.literal("negative")
6146
6168
  ]);
6147
- var iconNamedSchema = z.object({
6148
- name: z.string()
6149
- });
6150
- var iconTextSchema = z.object({
6151
- text: z.string()
6169
+ var summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
6170
+ var linkSchema = z.object({
6171
+ url: z.string()
6152
6172
  });
6153
6173
  var actionSchema = z.object({
6154
6174
  title: z.string().optional(),
@@ -6165,26 +6185,19 @@ var actionSchema = z.object({
6165
6185
  timeout: z.number().optional(),
6166
6186
  skipValidation: z.boolean().optional()
6167
6187
  });
6168
- var markdownLayoutSchema = z.object({
6169
- type: z.literal("markdown"),
6170
- content: z.string(),
6171
- align: alignSchema.optional(),
6172
- control: z.string().optional(),
6173
- margin: sizeSchema.optional()
6174
- });
6175
- var searchLayoutSchema = z.object({
6176
- type: z.literal("search"),
6188
+ var listLayoutItemSchema = z.object({
6177
6189
  title: z.string(),
6178
- method: httpMethodSchema,
6179
- url: z.string(),
6180
- param: z.string(),
6181
- emptyMessage: z.string().optional(),
6182
- control: z.string().optional(),
6183
- margin: sizeSchema.optional()
6190
+ description: z.string().optional(),
6191
+ icon: iconSchema,
6192
+ status: listLayoutStatusSchema.optional()
6184
6193
  });
6185
- var reviewLayoutCallToActionSchema = z.object({
6194
+ var decisionLayoutOptionSchema = z.object({
6195
+ action: actionSchema,
6186
6196
  title: z.string(),
6187
- action: actionSchema
6197
+ description: z.string().optional(),
6198
+ disabled: z.boolean().optional(),
6199
+ icon: iconSchema.optional(),
6200
+ image: imageLayoutSchema.optional()
6188
6201
  });
6189
6202
  var instructionsLayoutSchema = z.object({
6190
6203
  type: z.literal("instructions"),
@@ -6193,38 +6206,27 @@ var instructionsLayoutSchema = z.object({
6193
6206
  control: z.string().optional(),
6194
6207
  margin: sizeSchema.optional()
6195
6208
  });
6196
- var iconSchema = z.union([iconNamedSchema, iconTextSchema]);
6197
6209
  var behaviorSchema = z.object({
6198
6210
  action: actionSchema.optional(),
6199
6211
  link: linkSchema.optional()
6200
6212
  });
6213
+ var buttonLayoutSchema = z.object({
6214
+ type: z.literal("button"),
6215
+ size: sizeSchema.optional(),
6216
+ title: z.string().optional(),
6217
+ action: actionSchema,
6218
+ context: contextSchema.optional(),
6219
+ disabled: z.boolean().optional(),
6220
+ pinOrder: z.number().optional(),
6221
+ control: z.string().optional(),
6222
+ margin: sizeSchema.optional()
6223
+ });
6201
6224
  var reviewLayoutFieldSchema = z.object({
6202
6225
  label: z.string(),
6203
6226
  value: z.string(),
6227
+ rawValue: z.string().optional(),
6204
6228
  help: helpSchema.optional()
6205
6229
  });
6206
- var alertLayoutCallToActionSchema = z.object({
6207
- title: z.string(),
6208
- accessibilityDescription: z.string().optional(),
6209
- behavior: behaviorSchema
6210
- });
6211
- var summarySummariserSchema = z.object({
6212
- defaultTitle: z.string().optional(),
6213
- defaultDescription: z.string().optional(),
6214
- defaultIcon: iconSchema.optional(),
6215
- defaultImage: imageLayoutSchema.optional(),
6216
- providesTitle: z.boolean().optional(),
6217
- providesDescription: z.boolean().optional(),
6218
- providesIcon: z.boolean().optional(),
6219
- providesImage: z.boolean().optional()
6220
- });
6221
- var linkHandlerSchema = z.object({
6222
- regexPattern: z.string(),
6223
- action: actionSchema
6224
- });
6225
- var actionResponseBodySchema = z.object({
6226
- action: actionSchema
6227
- });
6228
6230
  var searchResultSearchSchema = z.object({
6229
6231
  type: z.literal("search"),
6230
6232
  title: z.string(),
@@ -6241,6 +6243,20 @@ var searchResultActionSchema = z.object({
6241
6243
  image: imageLayoutSchema.optional(),
6242
6244
  value: actionSchema
6243
6245
  });
6246
+ var actionResponseBodySchema = z.object({
6247
+ action: actionSchema
6248
+ });
6249
+ var errorResponseBodySchema = z.object({
6250
+ refreshFormUrl: z.string().optional(),
6251
+ analytics: z.record(z.string()).optional(),
6252
+ error: z.string().optional(),
6253
+ validation: jsonElementSchema.optional(),
6254
+ refreshUrl: z.string().optional()
6255
+ });
6256
+ var linkHandlerSchema = z.object({
6257
+ regexPattern: z.string(),
6258
+ action: actionSchema
6259
+ });
6244
6260
  var pollingOnErrorSchema = z.object({
6245
6261
  action: actionSchema
6246
6262
  });
@@ -6248,33 +6264,33 @@ var navigationBackBehaviorSchema = z.object({
6248
6264
  title: z.string().optional(),
6249
6265
  action: actionSchema
6250
6266
  });
6251
- var summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
6252
- var buttonLayoutSchema = z.object({
6253
- type: z.literal("button"),
6254
- size: sizeSchema.optional(),
6267
+ var reviewLayoutCallToActionSchema = z.object({
6268
+ title: z.string(),
6269
+ action: actionSchema
6270
+ });
6271
+ var alertLayoutCallToActionSchema = z.object({
6272
+ title: z.string(),
6273
+ accessibilityDescription: z.string().optional(),
6274
+ behavior: behaviorSchema
6275
+ });
6276
+ var listLayoutSchema = z.object({
6277
+ type: z.literal("list"),
6278
+ items: z.array(listLayoutItemSchema),
6279
+ title: z.string().optional(),
6280
+ control: z.string().optional(),
6281
+ margin: sizeSchema.optional()
6282
+ });
6283
+ var decisionLayoutSchema = z.object({
6284
+ type: z.literal("decision"),
6255
6285
  title: z.string().optional(),
6256
- action: actionSchema,
6257
- context: contextSchema.optional(),
6258
- disabled: z.boolean().optional(),
6259
- pinOrder: z.number().optional(),
6286
+ options: z.array(decisionLayoutOptionSchema),
6260
6287
  control: z.string().optional(),
6261
6288
  margin: sizeSchema.optional()
6262
6289
  });
6263
- var decisionLayoutOptionSchema = z.object({
6264
- action: actionSchema,
6290
+ var itemCallToActionSchema = z.object({
6265
6291
  title: z.string(),
6266
- description: z.string().optional(),
6267
- disabled: z.boolean().optional(),
6268
- icon: iconSchema.optional(),
6269
- image: imageLayoutSchema.optional()
6270
- });
6271
- var alertLayoutSchema = z.object({
6272
- type: z.literal("alert"),
6273
- markdown: z.string(),
6274
- context: contextSchema.optional(),
6275
- control: z.string().optional(),
6276
- margin: sizeSchema.optional(),
6277
- callToAction: alertLayoutCallToActionSchema.optional()
6292
+ accessibilityDescription: z.string().optional(),
6293
+ behavior: behaviorSchema
6278
6294
  });
6279
6295
  var reviewLayoutSchema = z.object({
6280
6296
  type: z.literal("review"),
@@ -6286,16 +6302,27 @@ var reviewLayoutSchema = z.object({
6286
6302
  control: z.string().optional(),
6287
6303
  margin: sizeSchema.optional()
6288
6304
  });
6289
- var listLayoutItemSchema = z.object({
6290
- title: z.string(),
6291
- description: z.string().optional(),
6292
- icon: iconSchema,
6293
- status: listLayoutStatusSchema.optional()
6305
+ var searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
6306
+ var pollingSchema = z.object({
6307
+ url: z.string(),
6308
+ interval: z.number().optional(),
6309
+ delay: z.number().optional(),
6310
+ timeout: z.number().optional(),
6311
+ maxAttempts: z.number(),
6312
+ onError: pollingOnErrorSchema
6294
6313
  });
6295
- var itemCallToActionSchema = z.object({
6296
- title: z.string(),
6297
- accessibilityDescription: z.string().optional(),
6298
- behavior: behaviorSchema
6314
+ var navigationSchema = z.object({
6315
+ backButton: navigationBackBehaviorSchema.optional(),
6316
+ back: navigationBackBehaviorSchema.optional(),
6317
+ stackBehavior: navigationStackBehaviorSchema.optional()
6318
+ });
6319
+ var alertLayoutSchema = z.object({
6320
+ type: z.literal("alert"),
6321
+ markdown: z.string(),
6322
+ context: contextSchema.optional(),
6323
+ control: z.string().optional(),
6324
+ margin: sizeSchema.optional(),
6325
+ callToAction: alertLayoutCallToActionSchema.optional()
6299
6326
  });
6300
6327
  var statusListLayoutItemSchema = z.object({
6301
6328
  title: z.string(),
@@ -6304,6 +6331,9 @@ var statusListLayoutItemSchema = z.object({
6304
6331
  status: statusListLayoutStatusSchema.optional(),
6305
6332
  callToAction: itemCallToActionSchema.optional()
6306
6333
  });
6334
+ var searchResponseBodySchema = z.object({
6335
+ results: z.array(searchResultSchema)
6336
+ });
6307
6337
  var blobSchemaSchema = z.object({
6308
6338
  type: z.literal("blob"),
6309
6339
  promoted: z.boolean().optional(),
@@ -6342,34 +6372,6 @@ var constSchemaSchema = z.object({
6342
6372
  analyticsId: z.string().optional(),
6343
6373
  disabled: z.boolean().optional()
6344
6374
  });
6345
- var pollingSchema = z.object({
6346
- url: z.string(),
6347
- interval: z.number().optional(),
6348
- delay: z.number().optional(),
6349
- timeout: z.number().optional(),
6350
- maxAttempts: z.number(),
6351
- onError: pollingOnErrorSchema
6352
- });
6353
- var navigationSchema = z.object({
6354
- backButton: navigationBackBehaviorSchema.optional(),
6355
- back: navigationBackBehaviorSchema.optional(),
6356
- stackBehavior: navigationStackBehaviorSchema.optional()
6357
- });
6358
- var searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
6359
- var decisionLayoutSchema = z.object({
6360
- type: z.literal("decision"),
6361
- title: z.string().optional(),
6362
- options: z.array(decisionLayoutOptionSchema),
6363
- control: z.string().optional(),
6364
- margin: sizeSchema.optional()
6365
- });
6366
- var listLayoutSchema = z.object({
6367
- type: z.literal("list"),
6368
- items: z.array(listLayoutItemSchema),
6369
- title: z.string().optional(),
6370
- control: z.string().optional(),
6371
- margin: sizeSchema.optional()
6372
- });
6373
6375
  var statusListLayoutSchema = z.object({
6374
6376
  type: z.literal("status-list"),
6375
6377
  items: z.array(statusListLayoutItemSchema),
@@ -6377,19 +6379,6 @@ var statusListLayoutSchema = z.object({
6377
6379
  control: z.string().optional(),
6378
6380
  margin: sizeSchema.optional()
6379
6381
  });
6380
- var searchResponseBodySchema = z.object({
6381
- results: z.array(searchResultSchema)
6382
- });
6383
- var columnsLayoutSchema = z.lazy(
6384
- () => z.object({
6385
- type: z.literal("columns"),
6386
- left: z.array(layoutSchema),
6387
- right: z.array(layoutSchema),
6388
- bias: columnsLayoutBiasSchema.optional(),
6389
- control: z.string().optional(),
6390
- margin: sizeSchema.optional()
6391
- })
6392
- );
6393
6382
  var layoutSchema = z.lazy(
6394
6383
  () => z.union([
6395
6384
  alertLayoutSchema,
@@ -6413,6 +6402,26 @@ var layoutSchema = z.lazy(
6413
6402
  statusListLayoutSchema
6414
6403
  ])
6415
6404
  );
6405
+ var boxLayoutSchema = z.lazy(
6406
+ () => z.object({
6407
+ type: z.literal("box"),
6408
+ components: z.array(layoutSchema),
6409
+ width: sizeSchema.optional(),
6410
+ border: z.boolean().optional(),
6411
+ control: z.string().optional(),
6412
+ margin: sizeSchema.optional()
6413
+ })
6414
+ );
6415
+ var columnsLayoutSchema = z.lazy(
6416
+ () => z.object({
6417
+ type: z.literal("columns"),
6418
+ left: z.array(layoutSchema),
6419
+ right: z.array(layoutSchema),
6420
+ bias: columnsLayoutBiasSchema.optional(),
6421
+ control: z.string().optional(),
6422
+ margin: sizeSchema.optional()
6423
+ })
6424
+ );
6416
6425
  var modalLayoutSchema = z.lazy(
6417
6426
  () => z.object({
6418
6427
  type: z.literal("modal"),
@@ -6428,14 +6437,25 @@ var modalLayoutContentSchema = z.lazy(
6428
6437
  components: z.array(layoutSchema)
6429
6438
  })
6430
6439
  );
6431
- var boxLayoutSchema = z.lazy(
6440
+ var stepSchema = z.lazy(
6432
6441
  () => z.object({
6433
- type: z.literal("box"),
6434
- components: z.array(layoutSchema),
6435
- width: sizeSchema.optional(),
6436
- border: z.boolean().optional(),
6437
- control: z.string().optional(),
6438
- margin: sizeSchema.optional()
6442
+ key: z.string().optional(),
6443
+ type: z.string().optional(),
6444
+ actions: z.array(actionSchema).optional(),
6445
+ refreshFormUrl: z.string().optional(),
6446
+ id: z.string(),
6447
+ title: z.string(),
6448
+ schemas: z.array(schemaSchema),
6449
+ layout: z.array(layoutSchema),
6450
+ description: z.string().optional(),
6451
+ model: jsonElementSchema.optional(),
6452
+ external: externalSchema.optional(),
6453
+ polling: pollingSchema.optional(),
6454
+ linkHandlers: z.array(linkHandlerSchema).optional(),
6455
+ analytics: z.record(z.string()).optional(),
6456
+ errors: stepErrorSchema.optional(),
6457
+ navigation: navigationSchema.optional(),
6458
+ refreshUrl: z.string().optional()
6439
6459
  })
6440
6460
  );
6441
6461
  var schemaSchema = z.lazy(
@@ -6661,21 +6681,17 @@ var stringSchemaSchema = z.lazy(
6661
6681
  help: helpSchema.optional()
6662
6682
  })
6663
6683
  );
6664
- var persistAsyncSchema = z.lazy(
6665
- () => z.object({
6666
- param: z.string(),
6667
- idProperty: z.string(),
6668
- schema: schemaSchema,
6669
- url: z.string(),
6670
- method: httpMethodSchema
6671
- })
6672
- );
6673
- var arraySchemaTupleSchema = z.lazy(
6684
+ var arraySchemaListSchema = z.lazy(
6674
6685
  () => z.object({
6675
6686
  type: z.literal("array"),
6676
6687
  promoted: z.boolean().optional(),
6677
6688
  $id: z.string().optional(),
6678
- items: z.array(schemaSchema),
6689
+ items: schemaSchema,
6690
+ addItemTitle: z.string(),
6691
+ editItemTitle: z.string(),
6692
+ minItems: z.number().optional(),
6693
+ maxItems: z.number().optional(),
6694
+ placeholder: z.string().optional(),
6679
6695
  title: z.string().optional(),
6680
6696
  description: z.string().optional(),
6681
6697
  control: z.string().optional(),
@@ -6683,24 +6699,30 @@ var arraySchemaTupleSchema = z.lazy(
6683
6699
  icon: iconSchema.optional(),
6684
6700
  image: imageSchema.optional(),
6685
6701
  keywords: z.array(z.string()).optional(),
6686
- summary: summaryProviderSchema.optional(),
6702
+ summary: summarySummariserSchema.optional(),
6687
6703
  analyticsId: z.string().optional(),
6688
6704
  persistAsync: persistAsyncSchema.optional(),
6689
6705
  validationAsync: validateAsyncSchema.optional(),
6690
- alert: alertLayoutSchema.optional()
6706
+ alert: alertLayoutSchema.optional(),
6707
+ validationMessages: z.record(z.string()).optional(),
6708
+ disabled: z.boolean().optional()
6691
6709
  })
6692
6710
  );
6693
- var arraySchemaListSchema = z.lazy(
6711
+ var persistAsyncSchema = z.lazy(
6712
+ () => z.object({
6713
+ param: z.string(),
6714
+ idProperty: z.string(),
6715
+ schema: schemaSchema,
6716
+ url: z.string(),
6717
+ method: httpMethodSchema
6718
+ })
6719
+ );
6720
+ var arraySchemaTupleSchema = z.lazy(
6694
6721
  () => z.object({
6695
6722
  type: z.literal("array"),
6696
6723
  promoted: z.boolean().optional(),
6697
6724
  $id: z.string().optional(),
6698
- items: schemaSchema,
6699
- addItemTitle: z.string(),
6700
- editItemTitle: z.string(),
6701
- minItems: z.number().optional(),
6702
- maxItems: z.number().optional(),
6703
- placeholder: z.string().optional(),
6725
+ items: z.array(schemaSchema),
6704
6726
  title: z.string().optional(),
6705
6727
  description: z.string().optional(),
6706
6728
  control: z.string().optional(),
@@ -6708,34 +6730,11 @@ var arraySchemaListSchema = z.lazy(
6708
6730
  icon: iconSchema.optional(),
6709
6731
  image: imageSchema.optional(),
6710
6732
  keywords: z.array(z.string()).optional(),
6711
- summary: summarySummariserSchema.optional(),
6733
+ summary: summaryProviderSchema.optional(),
6712
6734
  analyticsId: z.string().optional(),
6713
6735
  persistAsync: persistAsyncSchema.optional(),
6714
6736
  validationAsync: validateAsyncSchema.optional(),
6715
- alert: alertLayoutSchema.optional(),
6716
- validationMessages: z.record(z.string()).optional(),
6717
- disabled: z.boolean().optional()
6718
- })
6719
- );
6720
- var stepSchema = z.lazy(
6721
- () => z.object({
6722
- key: z.string().optional(),
6723
- type: z.string().optional(),
6724
- actions: z.array(actionSchema).optional(),
6725
- refreshFormUrl: z.string().optional(),
6726
- id: z.string(),
6727
- title: z.string(),
6728
- schemas: z.array(schemaSchema),
6729
- layout: z.array(layoutSchema),
6730
- description: z.string().optional(),
6731
- model: jsonElementSchema.optional(),
6732
- external: externalSchema.optional(),
6733
- polling: pollingSchema.optional(),
6734
- linkHandlers: z.array(linkHandlerSchema).optional(),
6735
- analytics: z.record(z.string()).optional(),
6736
- errors: stepErrorSchema.optional(),
6737
- navigation: navigationSchema.optional(),
6738
- refreshUrl: z.string().optional()
6737
+ alert: alertLayoutSchema.optional()
6739
6738
  })
6740
6739
  );
6741
6740
  var validateStep = (step) => validate(step, stepSchema);
@@ -9338,6 +9337,7 @@ var createMultiUploadInputComponent = (uploadInputProps, updateComponent) => {
9338
9337
 
9339
9338
  // src/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToMultiUploadComponent.ts
9340
9339
  var arraySchemaToMultiUploadComponent = (schemaMapperProps, mapperProps) => {
9340
+ var _a;
9341
9341
  const { getErrorMessageFunctions } = mapperProps;
9342
9342
  const { localValue, model, schema, required = false } = schemaMapperProps;
9343
9343
  const uploadSchema = getUploadSchema(schema.items);
@@ -9351,7 +9351,10 @@ var arraySchemaToMultiUploadComponent = (schemaMapperProps, mapperProps) => {
9351
9351
  ];
9352
9352
  const persistAsyncConfig = getPersistAsyncConfig(schema.items);
9353
9353
  const format = getFormat(schema.items);
9354
- const combinedSchemaProps = __spreadProps(__spreadValues({}, schemaMapperProps), { persistAsyncConfig, schema: uploadSchema });
9354
+ const combinedSchemaProps = __spreadProps(__spreadValues({}, schemaMapperProps), {
9355
+ persistAsyncConfig,
9356
+ schema: __spreadProps(__spreadValues({}, uploadSchema), { hidden: (_a = schema.hidden) != null ? _a : uploadSchema.hidden })
9357
+ });
9355
9358
  const { onValueChange } = mapperProps;
9356
9359
  const { performPersistAsync } = getPersistAsyncInitialState(combinedSchemaProps, mapperProps);
9357
9360
  const value = performPersistAsync ? getValueForPersistAsync(localValue) : [];
@@ -9914,6 +9917,11 @@ var formLayoutToComponent = (uid, { schemaId, schema: schemaRef, control, margin
9914
9917
  const { step, stepLocalValue } = mapperProps;
9915
9918
  const { schemas, model, errors } = step;
9916
9919
  const id = schemaId != null ? schemaId : schemaRef == null ? void 0 : schemaRef.$ref;
9920
+ if (id == null) {
9921
+ throw new Error(
9922
+ "FormLayouts must refer to a schema. Set the `schemaId` property to the intended schema."
9923
+ );
9924
+ }
9917
9925
  const schema = schemas.find((s) => s.$id === id);
9918
9926
  if (!schema) {
9919
9927
  throw new Error("Schema not found in schemas array.");
@@ -11242,15 +11250,34 @@ var AlertRenderer = {
11242
11250
  type: context,
11243
11251
  className: getMargin(margin),
11244
11252
  message: markdown,
11245
- action: (callToAction == null ? void 0 : callToAction.type) === "link" ? {
11246
- text: callToAction.title,
11247
- "aria-label": callToAction.accessibilityDescription,
11248
- href: callToAction.href,
11249
- target: "_blank"
11250
- } : void 0
11253
+ action: mapCtaToAlertAction(callToAction)
11251
11254
  }
11252
11255
  )
11253
11256
  };
11257
+ var mapCtaToAlertAction = (callToAction) => {
11258
+ if (!callToAction) {
11259
+ return void 0;
11260
+ }
11261
+ const { accessibilityDescription, title } = callToAction;
11262
+ const sharedProps = {
11263
+ "aria-label": accessibilityDescription,
11264
+ text: title
11265
+ };
11266
+ if (callToAction.type === "link") {
11267
+ const { href } = callToAction;
11268
+ return __spreadProps(__spreadValues({}, sharedProps), {
11269
+ href,
11270
+ target: "_blank"
11271
+ });
11272
+ }
11273
+ if (callToAction.type === "action") {
11274
+ const { onClick } = callToAction;
11275
+ return __spreadProps(__spreadValues({}, sharedProps), {
11276
+ onClick
11277
+ });
11278
+ }
11279
+ return void 0;
11280
+ };
11254
11281
  var AlertRenderer_default = AlertRenderer;
11255
11282
 
11256
11283
  // ../renderers/src/components/FieldInput.tsx
@@ -11608,8 +11635,8 @@ var DateInputRenderer_default = DateInputRenderer;
11608
11635
  // ../renderers/src/DecisionRenderer.tsx
11609
11636
  var import_components9 = require("@transferwise/components");
11610
11637
 
11611
- // ../../node_modules/.pnpm/@wise+art@2.16.2_@transferwise+neptune-css@14.19.1_@types+react@18.3.11_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index.esm.js
11612
- init_index_c8ed1f53_esm();
11638
+ // ../../node_modules/.pnpm/@wise+art@2.16.3_@transferwise+neptune-css@14.19.1_@types+react@18.3.11_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index.esm.js
11639
+ init_index_a91e5689_esm();
11613
11640
  init_clsx();
11614
11641
  var import_react8 = require("react");
11615
11642
  var import_jsx_runtime18 = require("react/jsx-runtime");
@@ -14941,7 +14968,7 @@ var getTextAlignmentAndMargin2 = (component) => `${getTextAlignment2(component.a
14941
14968
 
14942
14969
  // src/legacy/layout/alert/DynamicAlert.tsx
14943
14970
  var import_jsx_runtime71 = require("react/jsx-runtime");
14944
- var DynamicAlert = ({ component: alert }) => {
14971
+ var DynamicAlert = ({ component: alert, onAction }) => {
14945
14972
  const { context, markdown, margin } = alert;
14946
14973
  return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
14947
14974
  import_components42.Alert,
@@ -14949,27 +14976,36 @@ var DynamicAlert = ({ component: alert }) => {
14949
14976
  type: mapContextToAlertType(legacy_mapContext(context)),
14950
14977
  className: getMargin2(margin),
14951
14978
  message: markdown,
14952
- action: getAlertAction(alert)
14979
+ action: getAlertAction(alert, onAction)
14953
14980
  }
14954
14981
  );
14955
14982
  };
14956
14983
  var isAlertLayout = (layout) => {
14957
14984
  return Object.hasOwnProperty.call(layout, "type") && layout.type === "alert";
14958
14985
  };
14959
- var getAlertAction = (component) => {
14986
+ var getAlertAction = (component, onAction) => {
14960
14987
  if (!isAlertLayout(component) || !component.callToAction) {
14961
14988
  return void 0;
14962
14989
  }
14963
14990
  const { title, accessibilityDescription, behavior } = component.callToAction;
14964
- if (!behavior.link) {
14965
- return void 0;
14991
+ const { action, link } = behavior;
14992
+ if (link) {
14993
+ return {
14994
+ text: title,
14995
+ "aria-label": accessibilityDescription,
14996
+ href: link.url,
14997
+ target: "_blank"
14998
+ };
14999
+ }
15000
+ if (action && onAction) {
15001
+ return {
15002
+ text: title,
15003
+ "aria-label": accessibilityDescription,
15004
+ onClick: () => {
15005
+ onAction(action);
15006
+ }
15007
+ };
14966
15008
  }
14967
- return {
14968
- text: title,
14969
- "aria-label": accessibilityDescription,
14970
- href: behavior.link.url,
14971
- target: "_blank"
14972
- };
14973
15009
  };
14974
15010
  var legacy_mapContext = (context) => {
14975
15011
  switch (context) {
@@ -18032,7 +18068,7 @@ function DynamicLayout(props) {
18032
18068
  case "image":
18033
18069
  return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(DynamicImage_default, { component }, getKey(component));
18034
18070
  case "alert":
18035
- return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(DynamicAlert_default, { component }, getKey(component));
18071
+ return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(DynamicAlert_default, { component, onAction }, getKey(component));
18036
18072
  case "review":
18037
18073
  return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(DynamicReview_default, { component, onAction }, getKey(component));
18038
18074
  case "divider":