@wise/dynamic-flow-client-internal 4.25.0-experimental-15d54e7 → 4.25.0-experimental-cd1bec2

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
@@ -65,7 +65,6 @@ __export(index_exports, {
65
65
  Header: () => Header11,
66
66
  JsonSchemaForm: () => import_dynamic_flow_client4.JsonSchemaForm,
67
67
  findRendererPropsByType: () => import_dynamic_flow_client4.findRendererPropsByType,
68
- getListItemRenderers: () => getListItemRenderers2,
69
68
  getMargin: () => getMargin2,
70
69
  isValidSchema: () => import_dynamic_flow_client4.isValidSchema,
71
70
  makeCustomFetch: () => import_dynamic_flow_client3.makeHttpClient,
@@ -842,7 +841,7 @@ var OPTION_GROUPS = {
842
841
  recent: "recent"
843
842
  };
844
843
  var GroupedList = (_a) => {
845
- var _b = _a, { renderDecisionList: renderDecisionList3 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
844
+ var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
846
845
  const { formatMessage } = (0, import_react_intl6.useIntl)();
847
846
  const { options } = rest;
848
847
  const popularOptions = options.filter((option) => option.tag === OPTION_GROUPS.popular);
@@ -850,15 +849,15 @@ var GroupedList = (_a) => {
850
849
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
851
850
  popularOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_components12.Section, { children: [
852
851
  /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components12.Header, { as: "h2", title: formatMessage(decision_messages_default.popular) }),
853
- renderDecisionList3(__spreadProps(__spreadValues({}, rest), { options: popularOptions }))
852
+ renderDecisionList2(__spreadProps(__spreadValues({}, rest), { options: popularOptions }))
854
853
  ] }) : null,
855
854
  recentOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_components12.Section, { children: [
856
855
  /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components12.Header, { as: "h2", title: formatMessage(decision_messages_default.recent) }),
857
- renderDecisionList3(__spreadProps(__spreadValues({}, rest), { options: recentOptions }))
856
+ renderDecisionList2(__spreadProps(__spreadValues({}, rest), { options: recentOptions }))
858
857
  ] }) : null,
859
858
  /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_components12.Section, { children: [
860
859
  /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components12.Header, { as: "h2", title: formatMessage(decision_messages_default.all) }),
861
- renderDecisionList3(rest)
860
+ renderDecisionList2(rest)
862
861
  ] })
863
862
  ] });
864
863
  };
@@ -918,13 +917,13 @@ var DecisionWrapper = (props) => {
918
917
  ] });
919
918
  };
920
919
  var UnfilteredDecisionList = (_a) => {
921
- var _b = _a, { renderDecisionList: renderDecisionList3 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
922
- return isGroupedDecision(rest.options) ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(GroupedList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList3 })) : renderDecisionList3(rest);
920
+ var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
921
+ return isGroupedDecision(rest.options) ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(GroupedList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList2 })) : renderDecisionList2(rest);
923
922
  };
924
923
  var FilteredDecisionList = (props) => {
925
924
  const { formatMessage } = (0, import_react_intl7.useIntl)();
926
925
  const [query, setQuery] = (0, import_react3.useState)("");
927
- const { control, options, renderDecisionList: renderDecisionList3 } = props;
926
+ const { control, options, renderDecisionList: renderDecisionList2 } = props;
928
927
  const filteredOptions = filterAndSortDecisionOptions(options, query);
929
928
  const isGrouped = isGroupedDecision(options);
930
929
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
@@ -941,7 +940,7 @@ var FilteredDecisionList = (props) => {
941
940
  ),
942
941
  isGrouped && query.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(GroupedList, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
943
942
  query.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components13.Header, { as: "h2", title: formatMessage(decision_messages_default.results), className: "m-t-4" }),
944
- filteredOptions.length > 0 ? renderDecisionList3({
943
+ filteredOptions.length > 0 ? renderDecisionList2({
945
944
  control,
946
945
  className: query.length === 0 ? "m-t-3" : "",
947
946
  options: filteredOptions
@@ -3153,231 +3152,31 @@ var import_components53 = require("@transferwise/components");
3153
3152
  // ../renderers/src/NewListItem/getInlineAlert.tsx
3154
3153
  var import_components51 = require("@transferwise/components");
3155
3154
  var import_jsx_runtime73 = require("react/jsx-runtime");
3156
- var getInlineAlert = (inlineAlert) => inlineAlert ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_components51.ListItem.Prompt, { sentiment: inlineAlert == null ? void 0 : inlineAlert.context, children: inlineAlert.content }) : void 0;
3157
3155
 
3158
3156
  // ../renderers/src/NewListItem/getMedia.tsx
3159
3157
  var import_jsx_runtime74 = require("react/jsx-runtime");
3160
- var getMedia = (media, preferAvatar) => media ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(OptionMedia, { media, preferAvatar }) : void 0;
3161
3158
 
3162
3159
  // ../renderers/src/NewListItem/getAdditionalInfo.tsx
3163
3160
  var import_components52 = require("@transferwise/components");
3164
3161
  var import_jsx_runtime75 = require("react/jsx-runtime");
3165
- var getAdditionalInfo = (additionalInfo) => {
3166
- if (!additionalInfo) {
3167
- return void 0;
3168
- }
3169
- const { href, text, onClick } = additionalInfo;
3170
- if (href || onClick) {
3171
- return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
3172
- import_components52.ListItem.AdditionalInfo,
3173
- {
3174
- action: {
3175
- label: text,
3176
- href,
3177
- onClick,
3178
- target: "_blank"
3179
- }
3180
- }
3181
- );
3182
- }
3183
- return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_components52.ListItem.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
3184
- };
3185
3162
 
3186
3163
  // ../renderers/src/NewListItem/NewDecisionRenderer.tsx
3187
3164
  var import_jsx_runtime76 = require("react/jsx-runtime");
3188
- var DecisionRenderer2 = {
3189
- canRenderType: "decision",
3190
- render: (props) => /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList: renderDecisionList2 }))
3191
- };
3192
- var renderDecisionList2 = ({ options, control }) => {
3193
- return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_jsx_runtime76.Fragment, { children: options.map((option) => {
3194
- const {
3195
- description,
3196
- disabled,
3197
- media,
3198
- title: itemTitle,
3199
- tag,
3200
- href,
3201
- additionalText,
3202
- inlineAlert,
3203
- supportingValues,
3204
- onClick
3205
- } = option;
3206
- return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
3207
- import_components53.ListItem,
3208
- {
3209
- title: itemTitle,
3210
- subtitle: description,
3211
- spotlight: control === "spotlight" ? tag === "spotlight-active" ? "active" : "inactive" : void 0,
3212
- disabled,
3213
- valueTitle: supportingValues == null ? void 0 : supportingValues.value,
3214
- valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
3215
- media: getMedia(media, control === "with-avatar" || tag === "with-avatar"),
3216
- prompt: getInlineAlert(inlineAlert),
3217
- additionalInfo: additionalText ? getAdditionalInfo({ text: additionalText }) : void 0,
3218
- control: href ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_components53.ListItem.Navigation, { href, target: "_blank" }) : /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_components53.ListItem.Navigation, { onClick })
3219
- },
3220
- JSON.stringify(option)
3221
- );
3222
- }) });
3223
- };
3224
- var NewDecisionRenderer_default = DecisionRenderer2;
3225
3165
 
3226
3166
  // ../renderers/src/NewListItem/NewListRenderer.tsx
3227
3167
  var import_components54 = require("@transferwise/components");
3228
3168
  var import_jsx_runtime77 = require("react/jsx-runtime");
3229
- var ListRenderer2 = {
3230
- canRenderType: "list",
3231
- render: ({ callToAction, control, margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: getMargin(margin), children: [
3232
- /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Header7, { title, callToAction }),
3233
- items.map((item) => {
3234
- const {
3235
- title: itemTitle,
3236
- description,
3237
- supportingValues,
3238
- media,
3239
- tag,
3240
- additionalInfo,
3241
- inlineAlert
3242
- } = item;
3243
- return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
3244
- import_components54.ListItem,
3245
- {
3246
- title: itemTitle,
3247
- subtitle: description,
3248
- valueTitle: supportingValues == null ? void 0 : supportingValues.value,
3249
- valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
3250
- media: getMedia(media, control === "with-avatar" || tag === "with-avatar"),
3251
- prompt: getInlineAlert(inlineAlert),
3252
- additionalInfo: getAdditionalInfo(additionalInfo)
3253
- },
3254
- itemTitle
3255
- );
3256
- })
3257
- ] })
3258
- };
3259
- var NewListRenderer_default = ListRenderer2;
3260
3169
 
3261
3170
  // ../renderers/src/NewListItem/NewReviewRenderer.tsx
3262
3171
  var import_components55 = require("@transferwise/components");
3263
3172
  var import_icons4 = require("@transferwise/icons");
3264
3173
  var import_jsx_runtime78 = require("react/jsx-runtime");
3265
- var IGNORED_CONTROLS = [
3266
- "horizontal",
3267
- "horizontal-end-aligned",
3268
- "horizontal-start-aligned",
3269
- "vertical-two-column"
3270
- ];
3271
- var ReviewRenderer2 = {
3272
- canRenderType: "review",
3273
- canRender: ({ control }) => control ? !IGNORED_CONTROLS.includes(control) : true,
3274
- render: ({ callToAction, control, margin, fields, title }) => /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: getMargin(margin), children: [
3275
- /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Header7, { title, callToAction }),
3276
- fields.map((field) => {
3277
- var _a;
3278
- const {
3279
- label,
3280
- value,
3281
- media,
3282
- tag,
3283
- additionalInfo,
3284
- inlineAlert,
3285
- help,
3286
- callToAction: itemCallToAction
3287
- } = field;
3288
- return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
3289
- import_components55.ListItem,
3290
- {
3291
- title: value,
3292
- subtitle: label,
3293
- inverted: true,
3294
- media: getMedia(media, control === "with-avatar" || tag === "with-avatar"),
3295
- control: (_a = getCTAControl(itemCallToAction)) != null ? _a : getHelpControl(help),
3296
- prompt: getInlineAlert(inlineAlert),
3297
- additionalInfo: getAdditionalInfo(additionalInfo)
3298
- },
3299
- JSON.stringify(field)
3300
- );
3301
- })
3302
- ] })
3303
- };
3304
- var getCTAControl = (callToAction) => {
3305
- if (!callToAction) {
3306
- return void 0;
3307
- }
3308
- const { accessibilityDescription, href, title, onClick } = callToAction;
3309
- if (href) {
3310
- return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_components55.ListItem.Button, { href, partiallyInteractive: true, "aria-description": accessibilityDescription, children: title });
3311
- }
3312
- return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
3313
- import_components55.ListItem.Button,
3314
- {
3315
- "aria-description": accessibilityDescription,
3316
- partiallyInteractive: true,
3317
- onClick,
3318
- children: title
3319
- }
3320
- );
3321
- };
3322
- var getHelpControl = (help) => {
3323
- if (!help) {
3324
- return void 0;
3325
- }
3326
- return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_components55.Popover, { content: help, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_components55.ListItem.IconButton, { partiallyInteractive: true, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_icons4.QuestionMarkCircle, {}) }) });
3327
- };
3328
- var NewReviewRenderer_default = ReviewRenderer2;
3329
3174
 
3330
3175
  // ../renderers/src/NewListItem/NewStatusListRenderer.tsx
3331
3176
  var import_components56 = require("@transferwise/components");
3332
3177
  var import_jsx_runtime79 = require("react/jsx-runtime");
3333
- var NewStatusListRenderer = {
3334
- canRenderType: "status-list",
3335
- render: ({ margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: getMargin(margin), children: [
3336
- title ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components56.Header, { title, className: "m-b-2" }) : null,
3337
- items.map((item) => {
3338
- const { callToAction, description, icon, status, title: itemTitle } = item;
3339
- return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
3340
- import_components56.ListItem,
3341
- {
3342
- title: itemTitle,
3343
- subtitle: description,
3344
- media: icon && "name" in icon ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components56.AvatarView, { badge: { status: mapStatus2(status) }, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(DynamicIcon_default, { name: icon.name }) }) : void 0,
3345
- additionalInfo: callToAction ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
3346
- import_components56.ListItem.AdditionalInfo,
3347
- {
3348
- action: {
3349
- href: callToAction.href,
3350
- onClick: callToAction.href ? void 0 : callToAction.onClick,
3351
- label: callToAction.title,
3352
- target: "_blank"
3353
- }
3354
- }
3355
- ) : void 0
3356
- },
3357
- JSON.stringify(item)
3358
- );
3359
- })
3360
- ] })
3361
- };
3362
- var mapStatus2 = (status) => {
3363
- switch (status) {
3364
- case "done":
3365
- return "positive";
3366
- case "pending":
3367
- return "pending";
3368
- default:
3369
- return void 0;
3370
- }
3371
- };
3372
- var NewStatusListRenderer_default = NewStatusListRenderer;
3373
3178
 
3374
3179
  // ../renderers/src/getWiseRenderers.ts
3375
- var getListItemRenderers = () => [
3376
- NewDecisionRenderer_default,
3377
- NewListRenderer_default,
3378
- NewReviewRenderer_default,
3379
- NewStatusListRenderer_default
3380
- ];
3381
3180
  var getWiseRenderers = () => [
3382
3181
  AddressValidationButtonRenderer_default,
3383
3182
  AlertRenderer_default,
@@ -3427,7 +3226,6 @@ var import_jsx_runtime80 = require("react/jsx-runtime");
3427
3226
  // src/dynamicFlow/renderers.ts
3428
3227
  var Header11 = Header7;
3429
3228
  var getMargin2 = getMargin;
3430
- var getListItemRenderers2 = getListItemRenderers;
3431
3229
 
3432
3230
  // src/i18n/index.ts
3433
3231
  var import_dynamic_flow_client = require("@wise/dynamic-flow-client");
package/build/main.mjs CHANGED
@@ -801,7 +801,7 @@ var OPTION_GROUPS = {
801
801
  recent: "recent"
802
802
  };
803
803
  var GroupedList = (_a) => {
804
- var _b = _a, { renderDecisionList: renderDecisionList3 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
804
+ var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
805
805
  const { formatMessage } = useIntl3();
806
806
  const { options } = rest;
807
807
  const popularOptions = options.filter((option) => option.tag === OPTION_GROUPS.popular);
@@ -809,15 +809,15 @@ var GroupedList = (_a) => {
809
809
  return /* @__PURE__ */ jsxs4(Fragment, { children: [
810
810
  popularOptions.length > 0 ? /* @__PURE__ */ jsxs4(Section, { children: [
811
811
  /* @__PURE__ */ jsx23(Header, { as: "h2", title: formatMessage(decision_messages_default.popular) }),
812
- renderDecisionList3(__spreadProps(__spreadValues({}, rest), { options: popularOptions }))
812
+ renderDecisionList2(__spreadProps(__spreadValues({}, rest), { options: popularOptions }))
813
813
  ] }) : null,
814
814
  recentOptions.length > 0 ? /* @__PURE__ */ jsxs4(Section, { children: [
815
815
  /* @__PURE__ */ jsx23(Header, { as: "h2", title: formatMessage(decision_messages_default.recent) }),
816
- renderDecisionList3(__spreadProps(__spreadValues({}, rest), { options: recentOptions }))
816
+ renderDecisionList2(__spreadProps(__spreadValues({}, rest), { options: recentOptions }))
817
817
  ] }) : null,
818
818
  /* @__PURE__ */ jsxs4(Section, { children: [
819
819
  /* @__PURE__ */ jsx23(Header, { as: "h2", title: formatMessage(decision_messages_default.all) }),
820
- renderDecisionList3(rest)
820
+ renderDecisionList2(rest)
821
821
  ] })
822
822
  ] });
823
823
  };
@@ -877,13 +877,13 @@ var DecisionWrapper = (props) => {
877
877
  ] });
878
878
  };
879
879
  var UnfilteredDecisionList = (_a) => {
880
- var _b = _a, { renderDecisionList: renderDecisionList3 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
881
- return isGroupedDecision(rest.options) ? /* @__PURE__ */ jsx24(GroupedList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList3 })) : renderDecisionList3(rest);
880
+ var _b = _a, { renderDecisionList: renderDecisionList2 } = _b, rest = __objRest(_b, ["renderDecisionList"]);
881
+ return isGroupedDecision(rest.options) ? /* @__PURE__ */ jsx24(GroupedList, __spreadProps(__spreadValues({}, rest), { renderDecisionList: renderDecisionList2 })) : renderDecisionList2(rest);
882
882
  };
883
883
  var FilteredDecisionList = (props) => {
884
884
  const { formatMessage } = useIntl4();
885
885
  const [query, setQuery] = useState3("");
886
- const { control, options, renderDecisionList: renderDecisionList3 } = props;
886
+ const { control, options, renderDecisionList: renderDecisionList2 } = props;
887
887
  const filteredOptions = filterAndSortDecisionOptions(options, query);
888
888
  const isGrouped = isGroupedDecision(options);
889
889
  return /* @__PURE__ */ jsxs5(Fragment2, { children: [
@@ -900,7 +900,7 @@ var FilteredDecisionList = (props) => {
900
900
  ),
901
901
  isGrouped && query.length === 0 ? /* @__PURE__ */ jsx24(GroupedList, __spreadValues({}, props)) : /* @__PURE__ */ jsxs5(Fragment2, { children: [
902
902
  query.length > 0 && /* @__PURE__ */ jsx24(Header2, { as: "h2", title: formatMessage(decision_messages_default.results), className: "m-t-4" }),
903
- filteredOptions.length > 0 ? renderDecisionList3({
903
+ filteredOptions.length > 0 ? renderDecisionList2({
904
904
  control,
905
905
  className: query.length === 0 ? "m-t-3" : "",
906
906
  options: filteredOptions
@@ -3121,231 +3121,31 @@ import { ListItem as ListItem3 } from "@transferwise/components";
3121
3121
  // ../renderers/src/NewListItem/getInlineAlert.tsx
3122
3122
  import { ListItem } from "@transferwise/components";
3123
3123
  import { jsx as jsx73 } from "react/jsx-runtime";
3124
- var getInlineAlert = (inlineAlert) => inlineAlert ? /* @__PURE__ */ jsx73(ListItem.Prompt, { sentiment: inlineAlert == null ? void 0 : inlineAlert.context, children: inlineAlert.content }) : void 0;
3125
3124
 
3126
3125
  // ../renderers/src/NewListItem/getMedia.tsx
3127
3126
  import { jsx as jsx74 } from "react/jsx-runtime";
3128
- var getMedia = (media, preferAvatar) => media ? /* @__PURE__ */ jsx74(OptionMedia, { media, preferAvatar }) : void 0;
3129
3127
 
3130
3128
  // ../renderers/src/NewListItem/getAdditionalInfo.tsx
3131
3129
  import { ListItem as ListItem2 } from "@transferwise/components";
3132
3130
  import { jsx as jsx75 } from "react/jsx-runtime";
3133
- var getAdditionalInfo = (additionalInfo) => {
3134
- if (!additionalInfo) {
3135
- return void 0;
3136
- }
3137
- const { href, text, onClick } = additionalInfo;
3138
- if (href || onClick) {
3139
- return /* @__PURE__ */ jsx75(
3140
- ListItem2.AdditionalInfo,
3141
- {
3142
- action: {
3143
- label: text,
3144
- href,
3145
- onClick,
3146
- target: "_blank"
3147
- }
3148
- }
3149
- );
3150
- }
3151
- return /* @__PURE__ */ jsx75(ListItem2.AdditionalInfo, { children: additionalInfo == null ? void 0 : additionalInfo.text });
3152
- };
3153
3131
 
3154
3132
  // ../renderers/src/NewListItem/NewDecisionRenderer.tsx
3155
3133
  import { Fragment as Fragment12, jsx as jsx76 } from "react/jsx-runtime";
3156
- var DecisionRenderer2 = {
3157
- canRenderType: "decision",
3158
- render: (props) => /* @__PURE__ */ jsx76(DecisionWrapper, __spreadProps(__spreadValues({}, props), { renderDecisionList: renderDecisionList2 }))
3159
- };
3160
- var renderDecisionList2 = ({ options, control }) => {
3161
- return /* @__PURE__ */ jsx76(Fragment12, { children: options.map((option) => {
3162
- const {
3163
- description,
3164
- disabled,
3165
- media,
3166
- title: itemTitle,
3167
- tag,
3168
- href,
3169
- additionalText,
3170
- inlineAlert,
3171
- supportingValues,
3172
- onClick
3173
- } = option;
3174
- return /* @__PURE__ */ jsx76(
3175
- ListItem3,
3176
- {
3177
- title: itemTitle,
3178
- subtitle: description,
3179
- spotlight: control === "spotlight" ? tag === "spotlight-active" ? "active" : "inactive" : void 0,
3180
- disabled,
3181
- valueTitle: supportingValues == null ? void 0 : supportingValues.value,
3182
- valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
3183
- media: getMedia(media, control === "with-avatar" || tag === "with-avatar"),
3184
- prompt: getInlineAlert(inlineAlert),
3185
- additionalInfo: additionalText ? getAdditionalInfo({ text: additionalText }) : void 0,
3186
- control: href ? /* @__PURE__ */ jsx76(ListItem3.Navigation, { href, target: "_blank" }) : /* @__PURE__ */ jsx76(ListItem3.Navigation, { onClick })
3187
- },
3188
- JSON.stringify(option)
3189
- );
3190
- }) });
3191
- };
3192
- var NewDecisionRenderer_default = DecisionRenderer2;
3193
3134
 
3194
3135
  // ../renderers/src/NewListItem/NewListRenderer.tsx
3195
3136
  import { ListItem as ListItem4 } from "@transferwise/components";
3196
3137
  import { jsx as jsx77, jsxs as jsxs30 } from "react/jsx-runtime";
3197
- var ListRenderer2 = {
3198
- canRenderType: "list",
3199
- render: ({ callToAction, control, margin, items, title }) => /* @__PURE__ */ jsxs30("div", { className: getMargin(margin), children: [
3200
- /* @__PURE__ */ jsx77(Header7, { title, callToAction }),
3201
- items.map((item) => {
3202
- const {
3203
- title: itemTitle,
3204
- description,
3205
- supportingValues,
3206
- media,
3207
- tag,
3208
- additionalInfo,
3209
- inlineAlert
3210
- } = item;
3211
- return /* @__PURE__ */ jsx77(
3212
- ListItem4,
3213
- {
3214
- title: itemTitle,
3215
- subtitle: description,
3216
- valueTitle: supportingValues == null ? void 0 : supportingValues.value,
3217
- valueSubtitle: supportingValues == null ? void 0 : supportingValues.subvalue,
3218
- media: getMedia(media, control === "with-avatar" || tag === "with-avatar"),
3219
- prompt: getInlineAlert(inlineAlert),
3220
- additionalInfo: getAdditionalInfo(additionalInfo)
3221
- },
3222
- itemTitle
3223
- );
3224
- })
3225
- ] })
3226
- };
3227
- var NewListRenderer_default = ListRenderer2;
3228
3138
 
3229
3139
  // ../renderers/src/NewListItem/NewReviewRenderer.tsx
3230
3140
  import { ListItem as ListItem5, Popover } from "@transferwise/components";
3231
3141
  import { QuestionMarkCircle } from "@transferwise/icons";
3232
3142
  import { jsx as jsx78, jsxs as jsxs31 } from "react/jsx-runtime";
3233
- var IGNORED_CONTROLS = [
3234
- "horizontal",
3235
- "horizontal-end-aligned",
3236
- "horizontal-start-aligned",
3237
- "vertical-two-column"
3238
- ];
3239
- var ReviewRenderer2 = {
3240
- canRenderType: "review",
3241
- canRender: ({ control }) => control ? !IGNORED_CONTROLS.includes(control) : true,
3242
- render: ({ callToAction, control, margin, fields, title }) => /* @__PURE__ */ jsxs31("div", { className: getMargin(margin), children: [
3243
- /* @__PURE__ */ jsx78(Header7, { title, callToAction }),
3244
- fields.map((field) => {
3245
- var _a;
3246
- const {
3247
- label,
3248
- value,
3249
- media,
3250
- tag,
3251
- additionalInfo,
3252
- inlineAlert,
3253
- help,
3254
- callToAction: itemCallToAction
3255
- } = field;
3256
- return /* @__PURE__ */ jsx78(
3257
- ListItem5,
3258
- {
3259
- title: value,
3260
- subtitle: label,
3261
- inverted: true,
3262
- media: getMedia(media, control === "with-avatar" || tag === "with-avatar"),
3263
- control: (_a = getCTAControl(itemCallToAction)) != null ? _a : getHelpControl(help),
3264
- prompt: getInlineAlert(inlineAlert),
3265
- additionalInfo: getAdditionalInfo(additionalInfo)
3266
- },
3267
- JSON.stringify(field)
3268
- );
3269
- })
3270
- ] })
3271
- };
3272
- var getCTAControl = (callToAction) => {
3273
- if (!callToAction) {
3274
- return void 0;
3275
- }
3276
- const { accessibilityDescription, href, title, onClick } = callToAction;
3277
- if (href) {
3278
- return /* @__PURE__ */ jsx78(ListItem5.Button, { href, partiallyInteractive: true, "aria-description": accessibilityDescription, children: title });
3279
- }
3280
- return /* @__PURE__ */ jsx78(
3281
- ListItem5.Button,
3282
- {
3283
- "aria-description": accessibilityDescription,
3284
- partiallyInteractive: true,
3285
- onClick,
3286
- children: title
3287
- }
3288
- );
3289
- };
3290
- var getHelpControl = (help) => {
3291
- if (!help) {
3292
- return void 0;
3293
- }
3294
- return /* @__PURE__ */ jsx78(Popover, { content: help, children: /* @__PURE__ */ jsx78(ListItem5.IconButton, { partiallyInteractive: true, children: /* @__PURE__ */ jsx78(QuestionMarkCircle, {}) }) });
3295
- };
3296
- var NewReviewRenderer_default = ReviewRenderer2;
3297
3143
 
3298
3144
  // ../renderers/src/NewListItem/NewStatusListRenderer.tsx
3299
3145
  import { AvatarView as AvatarView5, Header as Header10, ListItem as ListItem6 } from "@transferwise/components";
3300
3146
  import { jsx as jsx79, jsxs as jsxs32 } from "react/jsx-runtime";
3301
- var NewStatusListRenderer = {
3302
- canRenderType: "status-list",
3303
- render: ({ margin, items, title }) => /* @__PURE__ */ jsxs32("div", { className: getMargin(margin), children: [
3304
- title ? /* @__PURE__ */ jsx79(Header10, { title, className: "m-b-2" }) : null,
3305
- items.map((item) => {
3306
- const { callToAction, description, icon, status, title: itemTitle } = item;
3307
- return /* @__PURE__ */ jsx79(
3308
- ListItem6,
3309
- {
3310
- title: itemTitle,
3311
- subtitle: description,
3312
- media: icon && "name" in icon ? /* @__PURE__ */ jsx79(AvatarView5, { badge: { status: mapStatus2(status) }, children: /* @__PURE__ */ jsx79(DynamicIcon_default, { name: icon.name }) }) : void 0,
3313
- additionalInfo: callToAction ? /* @__PURE__ */ jsx79(
3314
- ListItem6.AdditionalInfo,
3315
- {
3316
- action: {
3317
- href: callToAction.href,
3318
- onClick: callToAction.href ? void 0 : callToAction.onClick,
3319
- label: callToAction.title,
3320
- target: "_blank"
3321
- }
3322
- }
3323
- ) : void 0
3324
- },
3325
- JSON.stringify(item)
3326
- );
3327
- })
3328
- ] })
3329
- };
3330
- var mapStatus2 = (status) => {
3331
- switch (status) {
3332
- case "done":
3333
- return "positive";
3334
- case "pending":
3335
- return "pending";
3336
- default:
3337
- return void 0;
3338
- }
3339
- };
3340
- var NewStatusListRenderer_default = NewStatusListRenderer;
3341
3147
 
3342
3148
  // ../renderers/src/getWiseRenderers.ts
3343
- var getListItemRenderers = () => [
3344
- NewDecisionRenderer_default,
3345
- NewListRenderer_default,
3346
- NewReviewRenderer_default,
3347
- NewStatusListRenderer_default
3348
- ];
3349
3149
  var getWiseRenderers = () => [
3350
3150
  AddressValidationButtonRenderer_default,
3351
3151
  AlertRenderer_default,
@@ -3395,7 +3195,6 @@ import { jsx as jsx80 } from "react/jsx-runtime";
3395
3195
  // src/dynamicFlow/renderers.ts
3396
3196
  var Header11 = Header7;
3397
3197
  var getMargin2 = getMargin;
3398
- var getListItemRenderers2 = getListItemRenderers;
3399
3198
 
3400
3199
  // src/i18n/index.ts
3401
3200
  import { translations as coreTranslations } from "@wise/dynamic-flow-client";
@@ -4403,7 +4202,6 @@ export {
4403
4202
  Header11 as Header,
4404
4203
  JsonSchemaForm,
4405
4204
  findRendererPropsByType,
4406
- getListItemRenderers2 as getListItemRenderers,
4407
4205
  getMargin2 as getMargin,
4408
4206
  isValidSchema,
4409
4207
  makeHttpClient as makeCustomFetch,
@@ -3,4 +3,3 @@ export declare const Header: ({ title, callToAction }: {
3
3
  callToAction?: import("@wise/dynamic-flow-types/build/renderers").CallToAction;
4
4
  }) => "" | import("react/jsx-runtime").JSX.Element | undefined;
5
5
  export declare const getMargin: (size: import("@wise/dynamic-flow-types/build/next").Margin) => "m-b-0" | "m-b-1" | "m-b-2" | "m-b-3" | "m-b-5" | "";
6
- export declare const getListItemRenderers: () => import("@wise/dynamic-flow-client").Renderers;
@@ -2,7 +2,7 @@ export { makeHttpClient as makeCustomFetch } from '@wise/dynamic-flow-client';
2
2
  export type { DynamicFlowProps, DynamicFormController, InitialAction, Step, } from '@wise/dynamic-flow-client';
3
3
  export type { AlertRendererProps, BoxRendererProps, ButtonRendererProps, CheckboxInputRendererProps, ColumnsRendererProps, DateInputRendererProps, DecisionRendererProps, DividerRendererProps, FormRendererProps, FormSectionRendererProps, HeadingRendererProps, HiddenRendererProps, ImageRendererProps, InstructionsRendererProps, IntegerInputRendererProps, LoadingIndicatorRendererProps, MarkdownRendererProps, ModalLayoutRendererProps, ModalRendererProps, MultiSelectInputRendererProps, MultiUploadInputRendererProps, NumberInputRendererProps, ParagraphRendererProps, Renderer, Renderers, RepeatableRendererProps, ReviewRendererProps, SearchRendererProps, SelectInputRendererProps, StatusListRendererProps, StepRendererProps, TextInputRendererProps, UploadInputRendererProps, } from '@wise/dynamic-flow-types/build/renderers';
4
4
  export { findRendererPropsByType, isValidSchema, JsonSchemaForm } from '@wise/dynamic-flow-client';
5
- export { Header, getMargin, getListItemRenderers } from './dynamicFlow/renderers';
5
+ export { Header, getMargin } from './dynamicFlow/renderers';
6
6
  export { default as translations } from './i18n';
7
7
  export type { DynamicFlowLegacyProps, DynamicFlowRevampProps } from './dynamicFlow/DynamicFlow';
8
8
  export { DynamicFlowLegacy, DynamicFlowRevamp, DynamicForm } from './dynamicFlow/DynamicFlow';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client-internal",
3
- "version": "4.25.0-experimental-15d54e7",
3
+ "version": "4.25.0-experimental-cd1bec2",
4
4
  "description": "Dynamic Flow web client for Wise",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.js",
@@ -74,9 +74,9 @@
74
74
  "stylelint-value-no-unknown-custom-properties": "6.0.1",
75
75
  "tsx": "4.20.4",
76
76
  "typescript": "5.9.2",
77
- "@wise/dynamic-flow-fixtures": "0.0.1",
78
- "@wise/dynamic-flow-types": "3.12.0-experimental-15d54e7",
79
- "@wise/dynamic-flow-renderers": "0.0.0"
77
+ "@wise/dynamic-flow-renderers": "0.0.0",
78
+ "@wise/dynamic-flow-types": "3.12.0-experimental-cd1bec2",
79
+ "@wise/dynamic-flow-fixtures": "0.0.1"
80
80
  },
81
81
  "peerDependencies": {
82
82
  "@transferwise/components": "^46.92.0",
@@ -91,8 +91,8 @@
91
91
  },
92
92
  "dependencies": {
93
93
  "classnames": "2.5.1",
94
- "@wise/dynamic-flow-client": "4.15.0-experimental-15d54e7",
95
- "@wise/dynamic-flow-types": "3.12.0-experimental-15d54e7"
94
+ "@wise/dynamic-flow-types": "3.12.0-experimental-cd1bec2",
95
+ "@wise/dynamic-flow-client": "4.15.0-experimental-cd1bec2"
96
96
  },
97
97
  "scripts": {
98
98
  "dev": "pnpm build:visual-tests && storybook dev -p 3005",