@wise/dynamic-flow-client-internal 4.14.1 → 4.15.1
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/README.md +12 -0
- package/build/i18n/nl.json +4 -4
- package/build/main.css +37 -13
- package/build/main.js +98 -17
- package/build/main.mjs +88 -7
- package/build/types/dynamicFlow/DynamicFlow.d.ts +1 -0
- package/package.json +16 -16
package/README.md
CHANGED
|
@@ -71,6 +71,18 @@ return (
|
|
|
71
71
|
);
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
+
#### Container-based image sizes
|
|
75
|
+
|
|
76
|
+
To enable container queries for image layout components, add the following class name to the `className` property of the `DynamicFlow` component:
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
<DynamicFlow
|
|
80
|
+
className="df-prefer-container-queries"
|
|
81
|
+
{...allOtherProps}
|
|
82
|
+
/>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
|
|
74
86
|
### For non-CRAB apps
|
|
75
87
|
|
|
76
88
|
You'll need to merge the '@transferwise/components' translations with the '@wise/dynamic-flow-client' translations.
|
package/build/i18n/nl.json
CHANGED
|
@@ -15,19 +15,19 @@
|
|
|
15
15
|
"df.wise.ControlFeedback.patternDate": "Voer een datum in de juiste indeling in.",
|
|
16
16
|
"df.wise.ControlFeedback.required": "Vul dit veld in.",
|
|
17
17
|
"df.wise.ControlFeedback.type": "Onjuist type",
|
|
18
|
-
"df.wise.DynamicParagraph.copied": "Naar klembord
|
|
18
|
+
"df.wise.DynamicParagraph.copied": "Naar klembord gekopieerd",
|
|
19
19
|
"df.wise.DynamicParagraph.copy": "Kopiëren",
|
|
20
20
|
"df.wise.ErrorBoundary.errorAlert": "Er is iets misgegaan.",
|
|
21
21
|
"df.wise.ErrorBoundary.retry": "Opnieuw proberen",
|
|
22
22
|
"df.wise.ExternalConfirmation.cancel": "Annuleren",
|
|
23
23
|
"df.wise.ExternalConfirmation.description": "Bevestig dat je **{origin}** in een nieuw browsertabblad wilt openen.",
|
|
24
24
|
"df.wise.ExternalConfirmation.open": "In nieuw tabblad openen",
|
|
25
|
-
"df.wise.ExternalConfirmation.title": "
|
|
25
|
+
"df.wise.ExternalConfirmation.title": "Bevestigen",
|
|
26
26
|
"df.wise.Help.ariaLabel": "Klik hier voor meer informatie.",
|
|
27
27
|
"df.wise.MultiSelect.summary": "{first} en nog {count}",
|
|
28
28
|
"df.wise.MultipleFileUploadSchema.maxFileSizeError": "Het bestand is te groot. Upload een kleiner bestand.",
|
|
29
29
|
"df.wise.MultipleFileUploadSchema.maxItemsError": "Upload {maxItems} of minder bestanden.",
|
|
30
|
-
"df.wise.MultipleFileUploadSchema.minItemsError": "Upload
|
|
31
|
-
"df.wise.PersistAsyncSchema.genericError": "Er
|
|
30
|
+
"df.wise.MultipleFileUploadSchema.minItemsError": "Upload minimaal {minItems} bestand(en).",
|
|
31
|
+
"df.wise.PersistAsyncSchema.genericError": "Er is iets misgegaan, probeer het opnieuw.",
|
|
32
32
|
"df.wise.SearchLayout.loading": "Laden..."
|
|
33
33
|
}
|
package/build/main.css
CHANGED
|
@@ -287,39 +287,63 @@ button.df-back-btn {
|
|
|
287
287
|
height: auto;
|
|
288
288
|
width: 100%;
|
|
289
289
|
}
|
|
290
|
-
/*
|
|
290
|
+
/* wide screens (or default) */
|
|
291
291
|
.df-image.xs img {
|
|
292
|
-
width:
|
|
292
|
+
width: 100px;
|
|
293
293
|
}
|
|
294
294
|
.df-image.sm img {
|
|
295
|
-
width:
|
|
295
|
+
width: 200px;
|
|
296
296
|
}
|
|
297
297
|
.df-image.md img {
|
|
298
|
-
width:
|
|
298
|
+
width: 300px;
|
|
299
299
|
}
|
|
300
300
|
.df-image.lg img {
|
|
301
|
-
width:
|
|
301
|
+
width: 500px;
|
|
302
302
|
}
|
|
303
|
-
|
|
304
|
-
|
|
303
|
+
.df-image.xl img {
|
|
304
|
+
max-width: 600px;
|
|
305
|
+
}
|
|
306
|
+
/* narrow screens */
|
|
307
|
+
@media (width <576px) {
|
|
305
308
|
.df-image.xs img {
|
|
306
|
-
width:
|
|
309
|
+
width: 50px;
|
|
307
310
|
}
|
|
308
311
|
|
|
309
312
|
.df-image.sm img {
|
|
310
|
-
width:
|
|
313
|
+
width: 100px;
|
|
311
314
|
}
|
|
312
315
|
|
|
313
316
|
.df-image.md img {
|
|
314
|
-
width:
|
|
317
|
+
width: 200px;
|
|
315
318
|
}
|
|
316
319
|
|
|
317
320
|
.df-image.lg img {
|
|
318
|
-
width:
|
|
321
|
+
width: 300px;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* This speficies the container for container queries about width.
|
|
326
|
+
* We don't use it by default, but integrations can specify it using the className prop in the DF component.
|
|
327
|
+
*/
|
|
328
|
+
.df-prefer-container-queries {
|
|
329
|
+
container-type: inline-size;
|
|
330
|
+
}
|
|
331
|
+
/* narrow container */
|
|
332
|
+
@container (max-width: 576px) {
|
|
333
|
+
.df-image.xs img {
|
|
334
|
+
width: 50px;
|
|
319
335
|
}
|
|
320
336
|
|
|
321
|
-
.df-image.
|
|
322
|
-
|
|
337
|
+
.df-image.sm img {
|
|
338
|
+
width: 100px;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.df-image.md img {
|
|
342
|
+
width: 200px;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.df-image.lg img {
|
|
346
|
+
width: 300px;
|
|
323
347
|
}
|
|
324
348
|
}
|
|
325
349
|
.df-back-btn .tw-avatar__content {
|
package/build/main.js
CHANGED
|
@@ -665,7 +665,7 @@ var translations = languages.reduce(
|
|
|
665
665
|
var i18n_default = translations;
|
|
666
666
|
|
|
667
667
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
668
|
-
var
|
|
668
|
+
var import_react14 = require("react");
|
|
669
669
|
var import_react_intl16 = require("react-intl");
|
|
670
670
|
var import_dynamic_flow_client2 = require("@wise/dynamic-flow-client");
|
|
671
671
|
|
|
@@ -3171,6 +3171,81 @@ var SectionRenderer = {
|
|
|
3171
3171
|
};
|
|
3172
3172
|
var SectionRenderer_default = SectionRenderer;
|
|
3173
3173
|
|
|
3174
|
+
// ../renderers/src/TabsRenderer.tsx
|
|
3175
|
+
var import_components43 = require("@transferwise/components");
|
|
3176
|
+
var import_react13 = require("react");
|
|
3177
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
3178
|
+
var TabsRenderer = {
|
|
3179
|
+
canRenderType: "tabs",
|
|
3180
|
+
render: (props) => {
|
|
3181
|
+
switch (props.control) {
|
|
3182
|
+
case "segmented":
|
|
3183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
3184
|
+
case "chips":
|
|
3185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
3186
|
+
default:
|
|
3187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TabsRendererComponent, __spreadValues({}, props));
|
|
3188
|
+
}
|
|
3189
|
+
}
|
|
3190
|
+
};
|
|
3191
|
+
function TabsRendererComponent({ uid, margin, tabs }) {
|
|
3192
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react13.useState)(0);
|
|
3193
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
3194
|
+
import_components43.Tabs,
|
|
3195
|
+
{
|
|
3196
|
+
name: uid,
|
|
3197
|
+
selected: selectedIndex != null ? selectedIndex : 0,
|
|
3198
|
+
tabs: tabs.map((option) => ({
|
|
3199
|
+
title: option.title,
|
|
3200
|
+
disabled: false,
|
|
3201
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "m-t-2", children: [
|
|
3202
|
+
" ",
|
|
3203
|
+
option.children,
|
|
3204
|
+
" "
|
|
3205
|
+
] })
|
|
3206
|
+
})),
|
|
3207
|
+
onTabSelect: setSelectedIndex
|
|
3208
|
+
}
|
|
3209
|
+
) });
|
|
3210
|
+
}
|
|
3211
|
+
function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
3212
|
+
var _a;
|
|
3213
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react13.useState)(0);
|
|
3214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: getMargin(margin), children: [
|
|
3215
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
3216
|
+
import_components43.SegmentedControl,
|
|
3217
|
+
{
|
|
3218
|
+
name: uid,
|
|
3219
|
+
value: String(selectedIndex),
|
|
3220
|
+
mode: "view",
|
|
3221
|
+
segments: tabs.map((tab, index) => ({
|
|
3222
|
+
id: String(index),
|
|
3223
|
+
value: String(index),
|
|
3224
|
+
label: tab.title,
|
|
3225
|
+
controls: `${uid}-children`
|
|
3226
|
+
})),
|
|
3227
|
+
onChange: (value) => setSelectedIndex(Number(value))
|
|
3228
|
+
}
|
|
3229
|
+
),
|
|
3230
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
3231
|
+
] });
|
|
3232
|
+
}
|
|
3233
|
+
function ChipsTabsRendererComponent({ uid, margin, tabs }) {
|
|
3234
|
+
var _a;
|
|
3235
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react13.useState)(0);
|
|
3236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: getMargin(margin), children: [
|
|
3237
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
3238
|
+
import_components43.Chips,
|
|
3239
|
+
{
|
|
3240
|
+
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
3241
|
+
selected: selectedIndex,
|
|
3242
|
+
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
3243
|
+
}
|
|
3244
|
+
),
|
|
3245
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
3246
|
+
] });
|
|
3247
|
+
}
|
|
3248
|
+
|
|
3174
3249
|
// ../renderers/src/getWiseRenderers.ts
|
|
3175
3250
|
var getWiseRenderers = () => [
|
|
3176
3251
|
AlertRenderer_default,
|
|
@@ -3203,6 +3278,7 @@ var getWiseRenderers = () => [
|
|
|
3203
3278
|
SelectInputRenderer_default,
|
|
3204
3279
|
SectionRenderer_default,
|
|
3205
3280
|
StatusListRenderer_default,
|
|
3281
|
+
TabsRenderer,
|
|
3206
3282
|
TextInputRenderer_default,
|
|
3207
3283
|
UploadInputRenderer,
|
|
3208
3284
|
SplashStepRenderer,
|
|
@@ -3211,17 +3287,20 @@ var getWiseRenderers = () => [
|
|
|
3211
3287
|
];
|
|
3212
3288
|
|
|
3213
3289
|
// ../renderers/src/ModalContentRenderer.tsx
|
|
3214
|
-
var
|
|
3215
|
-
var
|
|
3290
|
+
var import_components44 = require("@transferwise/components");
|
|
3291
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
3216
3292
|
var ModalContentRenderer = {
|
|
3217
3293
|
canRenderType: "modal-content",
|
|
3218
3294
|
render: ({ title, children, open, onClose }) => {
|
|
3219
|
-
return /* @__PURE__ */ (0,
|
|
3295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_components44.Modal, { open, title, body: children, onClose });
|
|
3220
3296
|
}
|
|
3221
3297
|
};
|
|
3222
3298
|
|
|
3223
3299
|
// src/dynamicFlow/telemetry/app-version.ts
|
|
3224
|
-
var appVersion =
|
|
3300
|
+
var appVersion = (
|
|
3301
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
3302
|
+
typeof process !== "undefined" ? "4.15.1" : "0.0.0"
|
|
3303
|
+
);
|
|
3225
3304
|
|
|
3226
3305
|
// src/dynamicFlow/telemetry/getLogEvent.ts
|
|
3227
3306
|
var getLogEvent = (onLog) => (level, message, extra) => {
|
|
@@ -3260,15 +3339,16 @@ var getTrackEvent = (onEvent, onAnalytics, onThemeChange) => (name, properties)
|
|
|
3260
3339
|
};
|
|
3261
3340
|
|
|
3262
3341
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
3263
|
-
var
|
|
3342
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
3264
3343
|
var wiseRenderers = getWiseRenderers();
|
|
3265
3344
|
function DynamicFlowLegacy(props) {
|
|
3266
3345
|
const { customFetch = globalThis.fetch } = props;
|
|
3267
3346
|
const coreProps = __spreadProps(__spreadValues({}, props), { httpClient: customFetch });
|
|
3268
|
-
return /* @__PURE__ */ (0,
|
|
3347
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_dynamic_flow_client2.DynamicFlow, __spreadValues({}, coreProps));
|
|
3269
3348
|
}
|
|
3270
3349
|
function DynamicFlowRevamp(props) {
|
|
3271
3350
|
const {
|
|
3351
|
+
className = "",
|
|
3272
3352
|
customFetch = globalThis.fetch,
|
|
3273
3353
|
renderers,
|
|
3274
3354
|
onAnalytics,
|
|
@@ -3278,12 +3358,12 @@ function DynamicFlowRevamp(props) {
|
|
|
3278
3358
|
onThemeChange
|
|
3279
3359
|
} = props;
|
|
3280
3360
|
const httpClient = useWiseHttpClient(customFetch);
|
|
3281
|
-
const mergedRenderers = (0,
|
|
3361
|
+
const mergedRenderers = (0, import_react14.useMemo)(
|
|
3282
3362
|
() => [ModalContentRenderer, ...renderers != null ? renderers : [], ...wiseRenderers],
|
|
3283
3363
|
[renderers]
|
|
3284
3364
|
);
|
|
3285
|
-
const logEvent = (0,
|
|
3286
|
-
const trackEvent = (0,
|
|
3365
|
+
const logEvent = (0, import_react14.useMemo)(() => getLogEvent(onLog), [onLog]);
|
|
3366
|
+
const trackEvent = (0, import_react14.useMemo)(
|
|
3287
3367
|
() => getTrackEvent(onEvent, onAnalytics, onThemeChange),
|
|
3288
3368
|
[onEvent, onAnalytics, onThemeChange]
|
|
3289
3369
|
);
|
|
@@ -3294,10 +3374,11 @@ function DynamicFlowRevamp(props) {
|
|
|
3294
3374
|
onLog: logEvent,
|
|
3295
3375
|
onLink
|
|
3296
3376
|
});
|
|
3297
|
-
return /* @__PURE__ */ (0,
|
|
3377
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_dynamic_flow_client2.DynamicFlowCoreRevamp, __spreadValues({}, coreProps)) });
|
|
3298
3378
|
}
|
|
3299
|
-
var DynamicForm = (0,
|
|
3379
|
+
var DynamicForm = (0, import_react14.forwardRef)(function DynamicForm2(props, ref) {
|
|
3300
3380
|
const {
|
|
3381
|
+
className = "",
|
|
3301
3382
|
customFetch = globalThis.fetch,
|
|
3302
3383
|
renderers,
|
|
3303
3384
|
onAnalytics,
|
|
@@ -3307,12 +3388,12 @@ var DynamicForm = (0, import_react13.forwardRef)(function DynamicForm2(props, re
|
|
|
3307
3388
|
onThemeChange
|
|
3308
3389
|
} = props;
|
|
3309
3390
|
const httpClient = useWiseHttpClient(customFetch);
|
|
3310
|
-
const mergedRenderers = (0,
|
|
3391
|
+
const mergedRenderers = (0, import_react14.useMemo)(
|
|
3311
3392
|
() => [ModalContentRenderer, ...renderers != null ? renderers : [], ...wiseRenderers],
|
|
3312
3393
|
[renderers]
|
|
3313
3394
|
);
|
|
3314
|
-
const logEvent = (0,
|
|
3315
|
-
const trackEvent = (0,
|
|
3395
|
+
const logEvent = (0, import_react14.useMemo)(() => getLogEvent(onLog), [onLog]);
|
|
3396
|
+
const trackEvent = (0, import_react14.useMemo)(
|
|
3316
3397
|
() => getTrackEvent(onEvent, onAnalytics, onThemeChange),
|
|
3317
3398
|
[onEvent, onAnalytics, onThemeChange]
|
|
3318
3399
|
);
|
|
@@ -3323,11 +3404,11 @@ var DynamicForm = (0, import_react13.forwardRef)(function DynamicForm2(props, re
|
|
|
3323
3404
|
onLog: logEvent,
|
|
3324
3405
|
onLink
|
|
3325
3406
|
});
|
|
3326
|
-
return /* @__PURE__ */ (0,
|
|
3407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_dynamic_flow_client2.DynamicFormCore, __spreadProps(__spreadValues({}, coreProps), { ref })) });
|
|
3327
3408
|
});
|
|
3328
3409
|
var useWiseHttpClient = (httpClient) => {
|
|
3329
3410
|
const { locale } = (0, import_react_intl16.useIntl)();
|
|
3330
|
-
return (0,
|
|
3411
|
+
return (0, import_react14.useCallback)(
|
|
3331
3412
|
async (input, init = {}) => {
|
|
3332
3413
|
const headers = new Headers(init.headers);
|
|
3333
3414
|
headers.set("accept-language", locale);
|
package/build/main.mjs
CHANGED
|
@@ -3147,6 +3147,81 @@ var SectionRenderer = {
|
|
|
3147
3147
|
};
|
|
3148
3148
|
var SectionRenderer_default = SectionRenderer;
|
|
3149
3149
|
|
|
3150
|
+
// ../renderers/src/TabsRenderer.tsx
|
|
3151
|
+
import { Chips, SegmentedControl as SegmentedControl2, Tabs as Tabs2 } from "@transferwise/components";
|
|
3152
|
+
import { useState as useState8 } from "react";
|
|
3153
|
+
import { jsx as jsx60, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3154
|
+
var TabsRenderer = {
|
|
3155
|
+
canRenderType: "tabs",
|
|
3156
|
+
render: (props) => {
|
|
3157
|
+
switch (props.control) {
|
|
3158
|
+
case "segmented":
|
|
3159
|
+
return /* @__PURE__ */ jsx60(SegmentedTabsRendererComponent, __spreadValues({}, props));
|
|
3160
|
+
case "chips":
|
|
3161
|
+
return /* @__PURE__ */ jsx60(ChipsTabsRendererComponent, __spreadValues({}, props));
|
|
3162
|
+
default:
|
|
3163
|
+
return /* @__PURE__ */ jsx60(TabsRendererComponent, __spreadValues({}, props));
|
|
3164
|
+
}
|
|
3165
|
+
}
|
|
3166
|
+
};
|
|
3167
|
+
function TabsRendererComponent({ uid, margin, tabs }) {
|
|
3168
|
+
const [selectedIndex, setSelectedIndex] = useState8(0);
|
|
3169
|
+
return /* @__PURE__ */ jsx60("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx60(
|
|
3170
|
+
Tabs2,
|
|
3171
|
+
{
|
|
3172
|
+
name: uid,
|
|
3173
|
+
selected: selectedIndex != null ? selectedIndex : 0,
|
|
3174
|
+
tabs: tabs.map((option) => ({
|
|
3175
|
+
title: option.title,
|
|
3176
|
+
disabled: false,
|
|
3177
|
+
content: /* @__PURE__ */ jsxs25("div", { className: "m-t-2", children: [
|
|
3178
|
+
" ",
|
|
3179
|
+
option.children,
|
|
3180
|
+
" "
|
|
3181
|
+
] })
|
|
3182
|
+
})),
|
|
3183
|
+
onTabSelect: setSelectedIndex
|
|
3184
|
+
}
|
|
3185
|
+
) });
|
|
3186
|
+
}
|
|
3187
|
+
function SegmentedTabsRendererComponent({ uid, margin, tabs }) {
|
|
3188
|
+
var _a;
|
|
3189
|
+
const [selectedIndex, setSelectedIndex] = useState8(0);
|
|
3190
|
+
return /* @__PURE__ */ jsxs25("div", { className: getMargin(margin), children: [
|
|
3191
|
+
/* @__PURE__ */ jsx60(
|
|
3192
|
+
SegmentedControl2,
|
|
3193
|
+
{
|
|
3194
|
+
name: uid,
|
|
3195
|
+
value: String(selectedIndex),
|
|
3196
|
+
mode: "view",
|
|
3197
|
+
segments: tabs.map((tab, index) => ({
|
|
3198
|
+
id: String(index),
|
|
3199
|
+
value: String(index),
|
|
3200
|
+
label: tab.title,
|
|
3201
|
+
controls: `${uid}-children`
|
|
3202
|
+
})),
|
|
3203
|
+
onChange: (value) => setSelectedIndex(Number(value))
|
|
3204
|
+
}
|
|
3205
|
+
),
|
|
3206
|
+
/* @__PURE__ */ jsx60("div", { id: `${uid}-children`, className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
3207
|
+
] });
|
|
3208
|
+
}
|
|
3209
|
+
function ChipsTabsRendererComponent({ uid, margin, tabs }) {
|
|
3210
|
+
var _a;
|
|
3211
|
+
const [selectedIndex, setSelectedIndex] = useState8(0);
|
|
3212
|
+
return /* @__PURE__ */ jsxs25("div", { className: getMargin(margin), children: [
|
|
3213
|
+
/* @__PURE__ */ jsx60(
|
|
3214
|
+
Chips,
|
|
3215
|
+
{
|
|
3216
|
+
chips: tabs.map((tab, index) => ({ label: tab.title, value: index })),
|
|
3217
|
+
selected: selectedIndex,
|
|
3218
|
+
onChange: ({ selectedValue }) => setSelectedIndex(Number(selectedValue))
|
|
3219
|
+
}
|
|
3220
|
+
),
|
|
3221
|
+
/* @__PURE__ */ jsx60("div", { className: "m-t-2", children: (_a = tabs[selectedIndex]) == null ? void 0 : _a.children })
|
|
3222
|
+
] });
|
|
3223
|
+
}
|
|
3224
|
+
|
|
3150
3225
|
// ../renderers/src/getWiseRenderers.ts
|
|
3151
3226
|
var getWiseRenderers = () => [
|
|
3152
3227
|
AlertRenderer_default,
|
|
@@ -3179,6 +3254,7 @@ var getWiseRenderers = () => [
|
|
|
3179
3254
|
SelectInputRenderer_default,
|
|
3180
3255
|
SectionRenderer_default,
|
|
3181
3256
|
StatusListRenderer_default,
|
|
3257
|
+
TabsRenderer,
|
|
3182
3258
|
TextInputRenderer_default,
|
|
3183
3259
|
UploadInputRenderer,
|
|
3184
3260
|
SplashStepRenderer,
|
|
@@ -3188,16 +3264,19 @@ var getWiseRenderers = () => [
|
|
|
3188
3264
|
|
|
3189
3265
|
// ../renderers/src/ModalContentRenderer.tsx
|
|
3190
3266
|
import { Modal as Modal4 } from "@transferwise/components";
|
|
3191
|
-
import { jsx as
|
|
3267
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
3192
3268
|
var ModalContentRenderer = {
|
|
3193
3269
|
canRenderType: "modal-content",
|
|
3194
3270
|
render: ({ title, children, open, onClose }) => {
|
|
3195
|
-
return /* @__PURE__ */
|
|
3271
|
+
return /* @__PURE__ */ jsx61(Modal4, { open, title, body: children, onClose });
|
|
3196
3272
|
}
|
|
3197
3273
|
};
|
|
3198
3274
|
|
|
3199
3275
|
// src/dynamicFlow/telemetry/app-version.ts
|
|
3200
|
-
var appVersion =
|
|
3276
|
+
var appVersion = (
|
|
3277
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
3278
|
+
typeof process !== "undefined" ? "4.15.1" : "0.0.0"
|
|
3279
|
+
);
|
|
3201
3280
|
|
|
3202
3281
|
// src/dynamicFlow/telemetry/getLogEvent.ts
|
|
3203
3282
|
var getLogEvent = (onLog) => (level, message, extra) => {
|
|
@@ -3236,15 +3315,16 @@ var getTrackEvent = (onEvent, onAnalytics, onThemeChange) => (name, properties)
|
|
|
3236
3315
|
};
|
|
3237
3316
|
|
|
3238
3317
|
// src/dynamicFlow/DynamicFlow.tsx
|
|
3239
|
-
import { jsx as
|
|
3318
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
3240
3319
|
var wiseRenderers = getWiseRenderers();
|
|
3241
3320
|
function DynamicFlowLegacy(props) {
|
|
3242
3321
|
const { customFetch = globalThis.fetch } = props;
|
|
3243
3322
|
const coreProps = __spreadProps(__spreadValues({}, props), { httpClient: customFetch });
|
|
3244
|
-
return /* @__PURE__ */
|
|
3323
|
+
return /* @__PURE__ */ jsx62(DynamicFlowCoreLegacy, __spreadValues({}, coreProps));
|
|
3245
3324
|
}
|
|
3246
3325
|
function DynamicFlowRevamp(props) {
|
|
3247
3326
|
const {
|
|
3327
|
+
className = "",
|
|
3248
3328
|
customFetch = globalThis.fetch,
|
|
3249
3329
|
renderers,
|
|
3250
3330
|
onAnalytics,
|
|
@@ -3270,10 +3350,11 @@ function DynamicFlowRevamp(props) {
|
|
|
3270
3350
|
onLog: logEvent,
|
|
3271
3351
|
onLink
|
|
3272
3352
|
});
|
|
3273
|
-
return /* @__PURE__ */
|
|
3353
|
+
return /* @__PURE__ */ jsx62("div", { className, children: /* @__PURE__ */ jsx62(DynamicFlowCoreRevamp, __spreadValues({}, coreProps)) });
|
|
3274
3354
|
}
|
|
3275
3355
|
var DynamicForm = forwardRef(function DynamicForm2(props, ref) {
|
|
3276
3356
|
const {
|
|
3357
|
+
className = "",
|
|
3277
3358
|
customFetch = globalThis.fetch,
|
|
3278
3359
|
renderers,
|
|
3279
3360
|
onAnalytics,
|
|
@@ -3299,7 +3380,7 @@ var DynamicForm = forwardRef(function DynamicForm2(props, ref) {
|
|
|
3299
3380
|
onLog: logEvent,
|
|
3300
3381
|
onLink
|
|
3301
3382
|
});
|
|
3302
|
-
return /* @__PURE__ */
|
|
3383
|
+
return /* @__PURE__ */ jsx62("div", { className, children: /* @__PURE__ */ jsx62(DynamicFormCore, __spreadProps(__spreadValues({}, coreProps), { ref })) });
|
|
3303
3384
|
});
|
|
3304
3385
|
var useWiseHttpClient = (httpClient) => {
|
|
3305
3386
|
const { locale } = useIntl9();
|
|
@@ -13,6 +13,7 @@ export declare function DynamicFlowLegacy(props: DynamicFlowLegacyProps): import
|
|
|
13
13
|
type MakeOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
14
14
|
export type OnThemeChange = (theme: Theming['theme']) => void;
|
|
15
15
|
export type DynamicFlowRevampProps = (MakeOptional<Omit<DynamicFlowRevampPropsWithInitialAction, 'httpClient'>, 'renderers' | 'onLink'> | MakeOptional<Omit<DynamicFlowRevampPropsWithInitialStep, 'httpClient'>, 'renderers' | 'onLink'>) & {
|
|
16
|
+
className?: string;
|
|
16
17
|
customFetch?: DynamicFlowCoreRevampProps['httpClient'];
|
|
17
18
|
onAnalytics?: DynamicFlowCoreRevampProps['onEvent'];
|
|
18
19
|
onThemeChange?: OnThemeChange;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/dynamic-flow-client-internal",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.15.1",
|
|
4
4
|
"description": "Dynamic Flow web client for Wise",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/main.js",
|
|
@@ -36,39 +36,39 @@
|
|
|
36
36
|
"@babel/preset-env": "7.27.2",
|
|
37
37
|
"@babel/preset-react": "7.27.1",
|
|
38
38
|
"@babel/preset-typescript": "7.27.1",
|
|
39
|
-
"@chromatic-com/storybook": "4.0.
|
|
39
|
+
"@chromatic-com/storybook": "4.0.1",
|
|
40
40
|
"@formatjs/cli": "^6.7.2",
|
|
41
|
-
"@storybook/react-vite": "9.0.
|
|
41
|
+
"@storybook/react-vite": "9.0.12",
|
|
42
42
|
"@testing-library/dom": "10.4.0",
|
|
43
43
|
"@testing-library/jest-dom": "6.6.3",
|
|
44
44
|
"@testing-library/react": "16.3.0",
|
|
45
45
|
"@testing-library/user-event": "14.6.1",
|
|
46
46
|
"@transferwise/components": "46.98.1",
|
|
47
47
|
"@transferwise/formatting": "^2.13.1",
|
|
48
|
-
"@transferwise/icons": "3.22.
|
|
48
|
+
"@transferwise/icons": "3.22.2",
|
|
49
49
|
"@transferwise/neptune-css": "14.24.4",
|
|
50
50
|
"@types/jest": "29.5.14",
|
|
51
51
|
"@types/react": "18.3.23",
|
|
52
52
|
"@types/react-dom": "18.3.7",
|
|
53
53
|
"@wise/art": "2.21.2",
|
|
54
54
|
"@wise/components-theming": "^1.6.3",
|
|
55
|
-
"babel-jest": "
|
|
55
|
+
"babel-jest": "30.0.2",
|
|
56
56
|
"currency-flags": "4.0.7",
|
|
57
57
|
"esbuild": "0.25.5",
|
|
58
|
-
"eslint-plugin-storybook": "9.0.
|
|
59
|
-
"jest": "
|
|
60
|
-
"jest-environment-jsdom": "
|
|
58
|
+
"eslint-plugin-storybook": "9.0.12",
|
|
59
|
+
"jest": "30.0.2",
|
|
60
|
+
"jest-environment-jsdom": "30.0.2",
|
|
61
61
|
"jest-fetch-mock": "^3.0.3",
|
|
62
|
-
"jest-watch-typeahead": "^
|
|
62
|
+
"jest-watch-typeahead": "^3.0.1",
|
|
63
63
|
"npm-run-all2": "7.0.2",
|
|
64
|
-
"postcss": "^8.5.
|
|
64
|
+
"postcss": "^8.5.6",
|
|
65
65
|
"postcss-cli": "^11.0.1",
|
|
66
|
-
"postcss-import": "^16.1.
|
|
66
|
+
"postcss-import": "^16.1.1",
|
|
67
67
|
"react": "18.3.1",
|
|
68
68
|
"react-dom": "18.3.1",
|
|
69
69
|
"react-intl": "6.8.9",
|
|
70
|
-
"storybook": "^9.0.
|
|
71
|
-
"stylelint": "16.
|
|
70
|
+
"storybook": "^9.0.12",
|
|
71
|
+
"stylelint": "16.21.0",
|
|
72
72
|
"stylelint-config-standard": "36.0.1",
|
|
73
73
|
"stylelint-no-unsupported-browser-features": "8.0.4",
|
|
74
74
|
"stylelint-value-no-unknown-custom-properties": "6.0.1",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"typescript": "5.8.3",
|
|
77
77
|
"@wise/dynamic-flow-fixtures": "0.0.1",
|
|
78
78
|
"@wise/dynamic-flow-renderers": "0.0.0",
|
|
79
|
-
"@wise/dynamic-flow-types": "3.
|
|
79
|
+
"@wise/dynamic-flow-types": "3.6.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.
|
|
95
|
-
"@wise/dynamic-flow-types": "3.
|
|
94
|
+
"@wise/dynamic-flow-client": "4.8.1",
|
|
95
|
+
"@wise/dynamic-flow-types": "3.6.1"
|
|
96
96
|
},
|
|
97
97
|
"scripts": {
|
|
98
98
|
"dev": "pnpm build:visual-tests && storybook dev -p 3005",
|