@tesouro/embedded-components-react 0.2.340 → 0.2.342
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 +9 -9
- package/dist/index.css +12 -0
- package/dist/index.d.ts +27 -0
- package/dist/lib/CardsWidget.d.ts +27 -0
- package/dist/lib/CreateCardWidget.d.ts +27 -0
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/CardControlRow.js +41 -0
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/CardControls.js +46 -0
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/MerchantCategoriesControl.js +31 -0
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/PerTransactionMaximumControl.js +31 -0
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/SpendLimitControl.js +63 -0
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/labels.js +43 -0
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CreateCardWidget.js +25 -22
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/SetupView.js +159 -148
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/labels.js +25 -22
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -293,15 +293,15 @@ sonner toasts.
|
|
|
293
293
|
|
|
294
294
|
#### Props
|
|
295
295
|
|
|
296
|
-
| Prop | Type | Default | Description
|
|
297
|
-
| --------------- | ------------------------------------- | -------------- |
|
|
298
|
-
| `cardArtSrc` | `string` | **Required** | Static card plastic image URL (no name overlays).
|
|
299
|
-
| `labels` | `PartialDeep<CreateCardWidgetLabels>` | English labels | Overrides presentational copy (header, setup, mailing, preparing, success, footer). Nested groups merge per group. |
|
|
300
|
-
| `featureLabels` | toast / untitled-funding overrides | English labels | Overrides mutation toast strings and the funding-account fallback name.
|
|
301
|
-
| `className` | `string` | — | Optional class on the presentational root.
|
|
302
|
-
| `onClose` | `() => void` | — | Header close control. Omit and no close control is rendered.
|
|
303
|
-
| `onCancel` | `() => void` | — | Called when Cancel is pressed (also invokes `onClose` when both are set).
|
|
304
|
-
| `onViewCard` | `(cardId: string) => void` | — | Called with the new debit card id after a successful create when the user presses **View card**.
|
|
296
|
+
| Prop | Type | Default | Description |
|
|
297
|
+
| --------------- | ------------------------------------- | -------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
298
|
+
| `cardArtSrc` | `string` | **Required** | Static card plastic image URL (no name overlays). |
|
|
299
|
+
| `labels` | `PartialDeep<CreateCardWidgetLabels>` | English labels | Overrides presentational copy (header, setup, mailing, card controls, preparing, success, footer). Nested groups merge per group. |
|
|
300
|
+
| `featureLabels` | toast / untitled-funding overrides | English labels | Overrides mutation toast strings and the funding-account fallback name. |
|
|
301
|
+
| `className` | `string` | — | Optional class on the presentational root. |
|
|
302
|
+
| `onClose` | `() => void` | — | Header close control. Omit and no close control is rendered. |
|
|
303
|
+
| `onCancel` | `() => void` | — | Called when Cancel is pressed (also invokes `onClose` when both are set). |
|
|
304
|
+
| `onViewCard` | `(cardId: string) => void` | — | Called with the new debit card id after a successful create when the user presses **View card**. |
|
|
305
305
|
|
|
306
306
|
### CounterpartsWidget
|
|
307
307
|
|
package/dist/index.css
CHANGED
|
@@ -1327,6 +1327,9 @@
|
|
|
1327
1327
|
.ttw\:max-w-41 {
|
|
1328
1328
|
max-width: calc(var(--ttw-spacing) * 41);
|
|
1329
1329
|
}
|
|
1330
|
+
.ttw\:max-w-48 {
|
|
1331
|
+
max-width: calc(var(--ttw-spacing) * 48);
|
|
1332
|
+
}
|
|
1330
1333
|
.ttw\:max-w-56 {
|
|
1331
1334
|
max-width: calc(var(--ttw-spacing) * 56);
|
|
1332
1335
|
}
|
|
@@ -1531,6 +1534,9 @@
|
|
|
1531
1534
|
.ttw\:grow-0 {
|
|
1532
1535
|
flex-grow: 0;
|
|
1533
1536
|
}
|
|
1537
|
+
.ttw\:basis-36 {
|
|
1538
|
+
flex-basis: calc(var(--ttw-spacing) * 36);
|
|
1539
|
+
}
|
|
1534
1540
|
.ttw\:basis-56 {
|
|
1535
1541
|
flex-basis: calc(var(--ttw-spacing) * 56);
|
|
1536
1542
|
}
|
|
@@ -2433,6 +2439,12 @@
|
|
|
2433
2439
|
.ttw\:bg-destructive {
|
|
2434
2440
|
background-color: var(--ttw-destructive);
|
|
2435
2441
|
}
|
|
2442
|
+
.ttw\:bg-destructive\/5 {
|
|
2443
|
+
background-color: var(--ttw-destructive);
|
|
2444
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
2445
|
+
background-color: color-mix(in oklab, var(--ttw-destructive) 5%, transparent);
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2436
2448
|
.ttw\:bg-destructive\/10 {
|
|
2437
2449
|
background-color: var(--ttw-destructive);
|
|
2438
2450
|
@supports (color: color-mix(in lab, red, red)) {
|
package/dist/index.d.ts
CHANGED
|
@@ -2238,6 +2238,32 @@ interface CardDetailsWidgetProps extends WidgetProviderProps {
|
|
|
2238
2238
|
*/
|
|
2239
2239
|
declare function CardDetailsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, ...innerProps }: CardDetailsWidgetProps): React.JSX.Element;
|
|
2240
2240
|
|
|
2241
|
+
/**
|
|
2242
|
+
* Reset-period tab labels and notice copy are deliberately absent: the owner
|
|
2243
|
+
* supplies those through `spendLimitPeriodOptions` / `spendLimitPeriodNotices`,
|
|
2244
|
+
* so declaring them here would give consumers override keys that no component
|
|
2245
|
+
* ever reads.
|
|
2246
|
+
*/
|
|
2247
|
+
interface CardControlsLabels {
|
|
2248
|
+
currencySymbol: string;
|
|
2249
|
+
spendLimit: {
|
|
2250
|
+
title: string;
|
|
2251
|
+
description: string;
|
|
2252
|
+
amountPlaceholder: string;
|
|
2253
|
+
amountAriaLabel: string;
|
|
2254
|
+
};
|
|
2255
|
+
merchantCategories: {
|
|
2256
|
+
title: string;
|
|
2257
|
+
description: string;
|
|
2258
|
+
};
|
|
2259
|
+
perTransactionMaximum: {
|
|
2260
|
+
title: string;
|
|
2261
|
+
description: string;
|
|
2262
|
+
amountPlaceholder: string;
|
|
2263
|
+
amountAriaLabel: string;
|
|
2264
|
+
};
|
|
2265
|
+
}
|
|
2266
|
+
|
|
2241
2267
|
type PartialDeep$2<T> = {
|
|
2242
2268
|
[K in keyof T]?: T[K] extends object ? PartialDeep$2<T[K]> : T[K];
|
|
2243
2269
|
};
|
|
@@ -2273,6 +2299,7 @@ interface CreateCardWidgetLabels {
|
|
|
2273
2299
|
statePlaceholder: string;
|
|
2274
2300
|
zipLabel: string;
|
|
2275
2301
|
};
|
|
2302
|
+
cardControls: CardControlsLabels;
|
|
2276
2303
|
preparing: {
|
|
2277
2304
|
title: string;
|
|
2278
2305
|
description: string;
|
|
@@ -875,6 +875,32 @@ interface CardDetailsWidgetProps extends WidgetProviderProps {
|
|
|
875
875
|
bankLogoAlt?: string;
|
|
876
876
|
}
|
|
877
877
|
|
|
878
|
+
/**
|
|
879
|
+
* Reset-period tab labels and notice copy are deliberately absent: the owner
|
|
880
|
+
* supplies those through `spendLimitPeriodOptions` / `spendLimitPeriodNotices`,
|
|
881
|
+
* so declaring them here would give consumers override keys that no component
|
|
882
|
+
* ever reads.
|
|
883
|
+
*/
|
|
884
|
+
interface CardControlsLabels {
|
|
885
|
+
currencySymbol: string;
|
|
886
|
+
spendLimit: {
|
|
887
|
+
title: string;
|
|
888
|
+
description: string;
|
|
889
|
+
amountPlaceholder: string;
|
|
890
|
+
amountAriaLabel: string;
|
|
891
|
+
};
|
|
892
|
+
merchantCategories: {
|
|
893
|
+
title: string;
|
|
894
|
+
description: string;
|
|
895
|
+
};
|
|
896
|
+
perTransactionMaximum: {
|
|
897
|
+
title: string;
|
|
898
|
+
description: string;
|
|
899
|
+
amountPlaceholder: string;
|
|
900
|
+
amountAriaLabel: string;
|
|
901
|
+
};
|
|
902
|
+
}
|
|
903
|
+
|
|
878
904
|
type PartialDeep$1<T> = {
|
|
879
905
|
[K in keyof T]?: T[K] extends object ? PartialDeep$1<T[K]> : T[K];
|
|
880
906
|
};
|
|
@@ -910,6 +936,7 @@ interface CreateCardWidgetLabels {
|
|
|
910
936
|
statePlaceholder: string;
|
|
911
937
|
zipLabel: string;
|
|
912
938
|
};
|
|
939
|
+
cardControls: CardControlsLabels;
|
|
913
940
|
preparing: {
|
|
914
941
|
title: string;
|
|
915
942
|
description: string;
|
|
@@ -2,6 +2,32 @@ import * as React from 'react';
|
|
|
2
2
|
import { ComponentType, AnchorHTMLAttributes, ReactNode, ErrorInfo } from 'react';
|
|
3
3
|
import { FallbackProps } from 'react-error-boundary';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Reset-period tab labels and notice copy are deliberately absent: the owner
|
|
7
|
+
* supplies those through `spendLimitPeriodOptions` / `spendLimitPeriodNotices`,
|
|
8
|
+
* so declaring them here would give consumers override keys that no component
|
|
9
|
+
* ever reads.
|
|
10
|
+
*/
|
|
11
|
+
interface CardControlsLabels {
|
|
12
|
+
currencySymbol: string;
|
|
13
|
+
spendLimit: {
|
|
14
|
+
title: string;
|
|
15
|
+
description: string;
|
|
16
|
+
amountPlaceholder: string;
|
|
17
|
+
amountAriaLabel: string;
|
|
18
|
+
};
|
|
19
|
+
merchantCategories: {
|
|
20
|
+
title: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
perTransactionMaximum: {
|
|
24
|
+
title: string;
|
|
25
|
+
description: string;
|
|
26
|
+
amountPlaceholder: string;
|
|
27
|
+
amountAriaLabel: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
5
31
|
type PartialDeep<T> = {
|
|
6
32
|
[K in keyof T]?: T[K] extends object ? PartialDeep<T[K]> : T[K];
|
|
7
33
|
};
|
|
@@ -37,6 +63,7 @@ interface CreateCardWidgetLabels {
|
|
|
37
63
|
statePlaceholder: string;
|
|
38
64
|
zipLabel: string;
|
|
39
65
|
};
|
|
66
|
+
cardControls: CardControlsLabels;
|
|
40
67
|
preparing: {
|
|
41
68
|
title: string;
|
|
42
69
|
description: string;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Collapsible as e, CollapsibleContent as t, Switch as n } from "../../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { useId as r } from "react";
|
|
3
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
|
+
//#region ../../libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/CardControlRow.js
|
|
5
|
+
function o({ title: o, description: s, checked: c, onCheckedChange: l, children: u }) {
|
|
6
|
+
let d = r(), f = `${d}-title`, p = `${d}-description`, m = `${d}-drawer`;
|
|
7
|
+
return /* @__PURE__ */ a("div", {
|
|
8
|
+
className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:p-4",
|
|
9
|
+
children: [/* @__PURE__ */ a("div", {
|
|
10
|
+
className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-4",
|
|
11
|
+
children: [/* @__PURE__ */ a("div", {
|
|
12
|
+
className: "ttw:flex ttw:min-w-0 ttw:flex-col ttw:gap-1",
|
|
13
|
+
children: [/* @__PURE__ */ i("span", {
|
|
14
|
+
id: f,
|
|
15
|
+
className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
|
|
16
|
+
children: o
|
|
17
|
+
}), /* @__PURE__ */ i("span", {
|
|
18
|
+
id: p,
|
|
19
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
20
|
+
children: s
|
|
21
|
+
})]
|
|
22
|
+
}), /* @__PURE__ */ i(n, {
|
|
23
|
+
checked: c,
|
|
24
|
+
onCheckedChange: l,
|
|
25
|
+
"aria-labelledby": f,
|
|
26
|
+
"aria-describedby": p,
|
|
27
|
+
"aria-controls": m,
|
|
28
|
+
"aria-expanded": c,
|
|
29
|
+
className: "ttw:mt-0.5 ttw:shrink-0"
|
|
30
|
+
})]
|
|
31
|
+
}), /* @__PURE__ */ i(e, {
|
|
32
|
+
open: c,
|
|
33
|
+
children: /* @__PURE__ */ i(t, {
|
|
34
|
+
id: m,
|
|
35
|
+
children: u
|
|
36
|
+
})
|
|
37
|
+
})]
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { o as CardControlRow };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { cn as e } from "../../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { resolveCardControlsLabels as t } from "./labels.js";
|
|
3
|
+
import { MerchantCategoriesControl as n } from "./MerchantCategoriesControl.js";
|
|
4
|
+
import { PerTransactionMaximumControl as r } from "./PerTransactionMaximumControl.js";
|
|
5
|
+
import { SpendLimitControl as i } from "./SpendLimitControl.js";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
//#region ../../libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/CardControls.js
|
|
8
|
+
var s = () => void 0;
|
|
9
|
+
function c({ labels: c, className: l, isSpendLimitEnabled: u = !1, onSpendLimitEnabledChange: d = s, spendLimitAmount: f = "", onSpendLimitAmountChange: p = s, spendLimitPeriodOptions: m = [], selectedSpendLimitPeriod: h = null, onSpendLimitPeriodSelect: g = s, spendLimitPeriodNotices: _, isMerchantCategoriesEnabled: v = !1, onMerchantCategoriesEnabledChange: y = s, merchantCategoryOptions: b = [], selectedMerchantCategories: x = [], onMerchantCategoryToggle: S = s, isPerTransactionMaximumEnabled: C = !1, onPerTransactionMaximumEnabledChange: w = s, perTransactionMaximumAmount: T = "", onPerTransactionMaximumAmountChange: E = s }) {
|
|
10
|
+
let D = t(c);
|
|
11
|
+
return /* @__PURE__ */ o("div", {
|
|
12
|
+
className: e("ttw:flex ttw:flex-col ttw:divide-y ttw:divide-border ttw:overflow-hidden ttw:rounded-lg ttw:border ttw:border-border", l),
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ a(i, {
|
|
15
|
+
labels: D.spendLimit,
|
|
16
|
+
currencySymbol: D.currencySymbol,
|
|
17
|
+
isEnabled: u,
|
|
18
|
+
onEnabledChange: d,
|
|
19
|
+
amount: f,
|
|
20
|
+
onAmountChange: p,
|
|
21
|
+
periodOptions: m,
|
|
22
|
+
selectedPeriod: h,
|
|
23
|
+
onPeriodSelect: g,
|
|
24
|
+
periodNotices: _
|
|
25
|
+
}),
|
|
26
|
+
/* @__PURE__ */ a(n, {
|
|
27
|
+
labels: D.merchantCategories,
|
|
28
|
+
isEnabled: v,
|
|
29
|
+
onEnabledChange: y,
|
|
30
|
+
categoryOptions: b,
|
|
31
|
+
selectedCategories: x,
|
|
32
|
+
onCategoryToggle: S
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ a(r, {
|
|
35
|
+
labels: D.perTransactionMaximum,
|
|
36
|
+
currencySymbol: D.currencySymbol,
|
|
37
|
+
isEnabled: C,
|
|
38
|
+
onEnabledChange: w,
|
|
39
|
+
amount: T,
|
|
40
|
+
onAmountChange: E
|
|
41
|
+
})
|
|
42
|
+
]
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { c as CardControls };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { cn as e } from "../../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { CardControlRow as t } from "./CardControlRow.js";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { CheckIcon as i } from "lucide-react";
|
|
5
|
+
//#region ../../libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/MerchantCategoriesControl.js
|
|
6
|
+
function a({ labels: a, isEnabled: o, onEnabledChange: s, categoryOptions: c, selectedCategories: l, onCategoryToggle: u }) {
|
|
7
|
+
return /* @__PURE__ */ n(t, {
|
|
8
|
+
title: a.title,
|
|
9
|
+
description: a.description,
|
|
10
|
+
checked: o,
|
|
11
|
+
onCheckedChange: s,
|
|
12
|
+
children: /* @__PURE__ */ n("div", {
|
|
13
|
+
className: "ttw:flex ttw:flex-wrap ttw:gap-2",
|
|
14
|
+
children: c.map((t) => {
|
|
15
|
+
let a = l.includes(t.value);
|
|
16
|
+
return /* @__PURE__ */ r("button", {
|
|
17
|
+
type: "button",
|
|
18
|
+
"aria-pressed": a,
|
|
19
|
+
onClick: () => u(t.value),
|
|
20
|
+
className: e("ttw:inline-flex ttw:items-center ttw:gap-1.5 ttw:rounded-full ttw:border ttw:px-4 ttw:py-2 ttw:text-sm ttw:transition-colors", "ttw:focus-visible:outline-none ttw:focus-visible:ring-2 ttw:focus-visible:ring-ring ttw:focus-visible:ring-offset-2 ttw:focus-visible:ring-offset-background", a ? "ttw:border-primary ttw:bg-primary/5 ttw:font-semibold ttw:text-primary" : "ttw:border-border ttw:bg-background ttw:text-foreground ttw:hover:bg-accent"),
|
|
21
|
+
children: [a ? /* @__PURE__ */ n(i, {
|
|
22
|
+
"aria-hidden": !0,
|
|
23
|
+
className: "ttw:size-3.5"
|
|
24
|
+
}) : null, t.label]
|
|
25
|
+
}, t.value);
|
|
26
|
+
})
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { a as MerchantCategoriesControl };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { InputGroup as e, InputGroupAddon as t, InputGroupInput as n } from "../../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { formatAmountAriaLabel as r } from "./labels.js";
|
|
3
|
+
import { CardControlRow as i } from "./CardControlRow.js";
|
|
4
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
//#region ../../libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/PerTransactionMaximumControl.js
|
|
6
|
+
function s({ labels: s, currencySymbol: c, isEnabled: l, onEnabledChange: u, amount: d, onAmountChange: f }) {
|
|
7
|
+
return /* @__PURE__ */ a(i, {
|
|
8
|
+
title: s.title,
|
|
9
|
+
description: s.description,
|
|
10
|
+
checked: l,
|
|
11
|
+
onCheckedChange: u,
|
|
12
|
+
children: /* @__PURE__ */ o(e, {
|
|
13
|
+
className: "ttw:h-9 ttw:max-w-48 ttw:rounded-md ttw:border ttw:border-input ttw:shadow-xs ttw:has-[:focus-visible]:border-ring ttw:has-[:focus-visible]:ring-[3px] ttw:has-[:focus-visible]:ring-ring/50",
|
|
14
|
+
children: [/* @__PURE__ */ a(t, {
|
|
15
|
+
align: "inline-start",
|
|
16
|
+
"aria-hidden": !0,
|
|
17
|
+
children: c
|
|
18
|
+
}), /* @__PURE__ */ a(n, {
|
|
19
|
+
"data-has-start-addon": !0,
|
|
20
|
+
inputMode: "decimal",
|
|
21
|
+
value: d,
|
|
22
|
+
onChange: (e) => f(e.target.value),
|
|
23
|
+
placeholder: s.amountPlaceholder,
|
|
24
|
+
"aria-label": r(s.amountAriaLabel, c),
|
|
25
|
+
className: "ttw:rounded-md ttw:border-0 ttw:shadow-none ttw:focus-visible:ring-0"
|
|
26
|
+
})]
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { s as PerTransactionMaximumControl };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Alert as e, AlertDescription as t, InputGroup as n, InputGroupAddon as r, InputGroupInput as i, Tabs as a, TabsContent as o, TabsList as s, TabsTrigger as c } from "../../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { formatAmountAriaLabel as l } from "./labels.js";
|
|
3
|
+
import { CardControlRow as u } from "./CardControlRow.js";
|
|
4
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
5
|
+
import { InfoIcon as p, TriangleAlertIcon as m } from "lucide-react";
|
|
6
|
+
//#region ../../libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/SpendLimitControl.js
|
|
7
|
+
function h({ notice: n }) {
|
|
8
|
+
if (!n) return null;
|
|
9
|
+
let r = n.variant === "warning";
|
|
10
|
+
return /* @__PURE__ */ f(e, {
|
|
11
|
+
className: r ? "ttw:border-destructive/30 ttw:bg-destructive/5 ttw:text-destructive" : "ttw:border-border ttw:bg-muted ttw:text-foreground",
|
|
12
|
+
children: [/* @__PURE__ */ d(r ? m : p, { "aria-hidden": !0 }), /* @__PURE__ */ d(t, {
|
|
13
|
+
className: "ttw:text-current",
|
|
14
|
+
children: /* @__PURE__ */ f("p", { children: [n.title ? /* @__PURE__ */ f("span", {
|
|
15
|
+
className: "ttw:font-semibold",
|
|
16
|
+
children: [n.title, " "]
|
|
17
|
+
}) : null, n.description] })
|
|
18
|
+
})]
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function g({ labels: e, currencySymbol: t, isEnabled: p, onEnabledChange: m, amount: g, onAmountChange: _, periodOptions: v, selectedPeriod: y, onPeriodSelect: b, periodNotices: x }) {
|
|
22
|
+
return /* @__PURE__ */ d(u, {
|
|
23
|
+
title: e.title,
|
|
24
|
+
description: e.description,
|
|
25
|
+
checked: p,
|
|
26
|
+
onCheckedChange: m,
|
|
27
|
+
children: /* @__PURE__ */ f(a, {
|
|
28
|
+
value: y ?? "",
|
|
29
|
+
onValueChange: b,
|
|
30
|
+
children: [/* @__PURE__ */ f("div", {
|
|
31
|
+
className: "ttw:flex ttw:min-w-0 ttw:flex-wrap ttw:items-center ttw:gap-3",
|
|
32
|
+
children: [/* @__PURE__ */ f(n, {
|
|
33
|
+
className: "ttw:h-9 ttw:min-w-0 ttw:flex-1 ttw:basis-36 ttw:rounded-md ttw:border ttw:border-input ttw:shadow-xs ttw:has-[:focus-visible]:border-ring ttw:has-[:focus-visible]:ring-[3px] ttw:has-[:focus-visible]:ring-ring/50",
|
|
34
|
+
children: [/* @__PURE__ */ d(r, {
|
|
35
|
+
align: "inline-start",
|
|
36
|
+
"aria-hidden": !0,
|
|
37
|
+
children: t
|
|
38
|
+
}), /* @__PURE__ */ d(i, {
|
|
39
|
+
"data-has-start-addon": !0,
|
|
40
|
+
inputMode: "decimal",
|
|
41
|
+
value: g,
|
|
42
|
+
onChange: (e) => _(e.target.value),
|
|
43
|
+
placeholder: e.amountPlaceholder,
|
|
44
|
+
"aria-label": l(e.amountAriaLabel, t),
|
|
45
|
+
className: "ttw:rounded-md ttw:border-0 ttw:shadow-none ttw:focus-visible:ring-0"
|
|
46
|
+
})]
|
|
47
|
+
}), v.length > 0 ? /* @__PURE__ */ d(s, {
|
|
48
|
+
className: "ttw:max-w-full",
|
|
49
|
+
children: v.map((e) => /* @__PURE__ */ d(c, {
|
|
50
|
+
value: e.value,
|
|
51
|
+
children: e.label
|
|
52
|
+
}, e.value))
|
|
53
|
+
}) : null]
|
|
54
|
+
}), v.map((e) => /* @__PURE__ */ d(o, {
|
|
55
|
+
value: e.value,
|
|
56
|
+
className: "ttw:mt-4",
|
|
57
|
+
children: /* @__PURE__ */ d(h, { notice: x?.find((t) => t.value === e.value) })
|
|
58
|
+
}, e.value))]
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
export { g as SpendLimitControl };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/labels.js
|
|
2
|
+
var e = {
|
|
3
|
+
currencySymbol: "$",
|
|
4
|
+
spendLimit: {
|
|
5
|
+
title: "Spend limit",
|
|
6
|
+
description: "Cap total spend on this card. Choose how the limit resets.",
|
|
7
|
+
amountPlaceholder: "0",
|
|
8
|
+
amountAriaLabel: "Spend limit amount in {currency}"
|
|
9
|
+
},
|
|
10
|
+
merchantCategories: {
|
|
11
|
+
title: "Merchant categories",
|
|
12
|
+
description: "Only allow purchases at selected category groups. Everything else is declined."
|
|
13
|
+
},
|
|
14
|
+
perTransactionMaximum: {
|
|
15
|
+
title: "Per-transaction maximum",
|
|
16
|
+
description: "Decline any single purchase above this amount.",
|
|
17
|
+
amountPlaceholder: "0",
|
|
18
|
+
amountAriaLabel: "Per-transaction maximum amount in {currency}"
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
function t(e, t) {
|
|
22
|
+
return e.replaceAll("{currency}", t);
|
|
23
|
+
}
|
|
24
|
+
function n(t) {
|
|
25
|
+
return {
|
|
26
|
+
...e,
|
|
27
|
+
...t,
|
|
28
|
+
spendLimit: {
|
|
29
|
+
...e.spendLimit,
|
|
30
|
+
...t?.spendLimit
|
|
31
|
+
},
|
|
32
|
+
merchantCategories: {
|
|
33
|
+
...e.merchantCategories,
|
|
34
|
+
...t?.merchantCategories
|
|
35
|
+
},
|
|
36
|
+
perTransactionMaximum: {
|
|
37
|
+
...e.perTransactionMaximum,
|
|
38
|
+
...t?.perTransactionMaximum
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { e as CARD_CONTROLS_LABELS_EN, t as formatAmountAriaLabel, n as resolveCardControlsLabels };
|
|
@@ -6,6 +6,7 @@ import { Button as e, cn as t } from "../../../../../../../packages/shared-ui-sh
|
|
|
6
6
|
import { resolveCreateCardWidgetLabels as n } from "./labels.js";
|
|
7
7
|
import { CreateCardView as r } from "./types.js";
|
|
8
8
|
import { PreparingView as i } from "./PreparingView.js";
|
|
9
|
+
import "./CardControls/CardControls.js";
|
|
9
10
|
import { SetupView as a } from "./SetupView.js";
|
|
10
11
|
import { SuccessView as o } from "./SuccessView.js";
|
|
11
12
|
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
@@ -20,30 +21,30 @@ var f = {
|
|
|
20
21
|
function m(e) {
|
|
21
22
|
return e === r.Setup || e === r.Preparing || e === r.Success ? e : (console.error(`[CreateCardWidget] unexpected view ${JSON.stringify(e)}; falling back to "${r.Setup}"`), r.Setup);
|
|
22
23
|
}
|
|
23
|
-
function h({ view: h, cardArtSrc: g, labels: _, className: v, cardholderOptions: y = [], selectedCardholder: b = null, onCardholderSelect: x = p, isCardholderError: S = !1, onCardholderRetry: C, cardFormatOptions: w = [], selectedCardFormat: T = null, onCardFormatSelect: E = p, isFundingAccountVisible: D = !1, fundingAccountOptions: O = [], selectedFundingAccount: k = null, onFundingAccountSelect: A = p, isFundingAccountError: j = !1, onFundingAccountRetry: M, isMailingSectionVisible: N = !1, selectedMailingOption: P = null, onMailingOptionSelect: F = p, businessAddress: I = "", isBusinessAddressVisible: L = !1, isManualAddressVisible: R = !1, manualAddress: z = f, onManualAddressChange: B = p, stateOptions: V = [],
|
|
24
|
-
let
|
|
24
|
+
function h({ view: h, cardArtSrc: g, labels: _, className: v, cardholderOptions: y = [], selectedCardholder: b = null, onCardholderSelect: x = p, isCardholderError: S = !1, onCardholderRetry: C, cardFormatOptions: w = [], selectedCardFormat: T = null, onCardFormatSelect: E = p, isFundingAccountVisible: D = !1, fundingAccountOptions: O = [], selectedFundingAccount: k = null, onFundingAccountSelect: A = p, isFundingAccountError: j = !1, onFundingAccountRetry: M, isMailingSectionVisible: N = !1, selectedMailingOption: P = null, onMailingOptionSelect: F = p, businessAddress: I = "", isBusinessAddressVisible: L = !1, isManualAddressVisible: R = !1, manualAddress: z = f, onManualAddressChange: B = p, stateOptions: V = [], isCardControlsSectionVisible: H = !1, cardControls: U, isCreateDisabled: W = !1, onCreateClick: G = p, onCancelClick: K = p, onClose: q, onCreateAnotherClick: J = p, onViewCardClick: Y }) {
|
|
25
|
+
let X = n(_), Z = m(h), Q = Z === r.Setup;
|
|
25
26
|
return /* @__PURE__ */ l("div", {
|
|
26
27
|
className: t("ttw:relative ttw:flex ttw:h-full ttw:w-full ttw:min-h-0 ttw:flex-col ttw:bg-background", v),
|
|
27
28
|
children: [
|
|
28
29
|
/* @__PURE__ */ l("div", {
|
|
29
|
-
className: t("ttw:flex ttw:shrink-0 ttw:items-center ttw:gap-3 ttw:px-6 ttw:pt-4",
|
|
30
|
-
children: [
|
|
30
|
+
className: t("ttw:flex ttw:shrink-0 ttw:items-center ttw:gap-3 ttw:px-6 ttw:pt-4", Q ? "ttw:bg-primary/5 ttw:pb-2" : "ttw:absolute ttw:inset-x-0 ttw:top-0 ttw:z-10 ttw:bg-transparent ttw:pb-0"),
|
|
31
|
+
children: [Q ? /* @__PURE__ */ c("h2", {
|
|
31
32
|
className: "ttw:min-w-0 ttw:flex-1 ttw:text-lg ttw:font-semibold ttw:text-primary",
|
|
32
|
-
children:
|
|
33
|
-
}) : /* @__PURE__ */ c("span", { className: "ttw:flex-1" }),
|
|
33
|
+
children: X.header.title
|
|
34
|
+
}) : /* @__PURE__ */ c("span", { className: "ttw:flex-1" }), q ? /* @__PURE__ */ c(e, {
|
|
34
35
|
type: "button",
|
|
35
36
|
variant: "ghost",
|
|
36
37
|
size: "icon",
|
|
37
|
-
"aria-label":
|
|
38
|
-
onClick:
|
|
38
|
+
"aria-label": X.header.closeAriaLabel,
|
|
39
|
+
onClick: q,
|
|
39
40
|
children: /* @__PURE__ */ c(d, { className: "ttw:size-4" })
|
|
40
41
|
}) : null]
|
|
41
42
|
}),
|
|
42
|
-
|
|
43
|
+
Q ? /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", {
|
|
43
44
|
className: "ttw:min-h-0 ttw:flex-1 ttw:overflow-y-auto",
|
|
44
45
|
children: /* @__PURE__ */ c(a, {
|
|
45
46
|
cardArtSrc: g,
|
|
46
|
-
labels:
|
|
47
|
+
labels: X,
|
|
47
48
|
cardholderOptions: y,
|
|
48
49
|
selectedCardholder: b,
|
|
49
50
|
onCardholderSelect: x,
|
|
@@ -66,31 +67,33 @@ function h({ view: h, cardArtSrc: g, labels: _, className: v, cardholderOptions:
|
|
|
66
67
|
isManualAddressVisible: R,
|
|
67
68
|
manualAddress: z,
|
|
68
69
|
onManualAddressChange: B,
|
|
69
|
-
stateOptions: V
|
|
70
|
+
stateOptions: V,
|
|
71
|
+
isCardControlsSectionVisible: H,
|
|
72
|
+
cardControls: U
|
|
70
73
|
})
|
|
71
74
|
}), /* @__PURE__ */ l("div", {
|
|
72
75
|
className: "ttw:flex ttw:shrink-0 ttw:justify-end ttw:gap-3 ttw:border-t ttw:border-border ttw:bg-muted/40 ttw:px-6 ttw:py-4",
|
|
73
76
|
children: [/* @__PURE__ */ c(e, {
|
|
74
77
|
type: "button",
|
|
75
78
|
variant: "outline",
|
|
76
|
-
onClick:
|
|
77
|
-
children:
|
|
79
|
+
onClick: K,
|
|
80
|
+
children: X.footer.cancel
|
|
78
81
|
}), /* @__PURE__ */ l(e, {
|
|
79
82
|
type: "button",
|
|
80
|
-
disabled:
|
|
81
|
-
onClick:
|
|
82
|
-
children: [
|
|
83
|
+
disabled: W,
|
|
84
|
+
onClick: G,
|
|
85
|
+
children: [X.footer.createCard, /* @__PURE__ */ c(u, { className: "ttw:size-4" })]
|
|
83
86
|
})]
|
|
84
87
|
})] }) : null,
|
|
85
|
-
|
|
88
|
+
Z === r.Preparing ? /* @__PURE__ */ c(i, {
|
|
86
89
|
cardArtSrc: g,
|
|
87
|
-
labels:
|
|
90
|
+
labels: X
|
|
88
91
|
}) : null,
|
|
89
|
-
|
|
92
|
+
Z === r.Success ? /* @__PURE__ */ c(o, {
|
|
90
93
|
cardArtSrc: g,
|
|
91
|
-
labels:
|
|
92
|
-
onCreateAnotherClick:
|
|
93
|
-
onViewCardClick:
|
|
94
|
+
labels: X,
|
|
95
|
+
onCreateAnotherClick: J,
|
|
96
|
+
onViewCardClick: Y
|
|
94
97
|
}) : null
|
|
95
98
|
]
|
|
96
99
|
});
|
|
@@ -3,164 +3,175 @@ import { ErrorState as l } from "../../../../../shared/ui/dist/lib/ErrorState/Er
|
|
|
3
3
|
import "../../../../../shared/ui/dist/index.js";
|
|
4
4
|
import { MailingOptionValue as u } from "./types.js";
|
|
5
5
|
import { CardArt as d } from "./CardArt.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { CardControls as f } from "./CardControls/CardControls.js";
|
|
7
|
+
import { ManualAddressFields as p } from "./ManualAddressFields.js";
|
|
8
|
+
import { useId as m } from "react";
|
|
9
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
9
10
|
//#region ../../libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/SetupView.js
|
|
10
|
-
function
|
|
11
|
-
let
|
|
12
|
-
return /* @__PURE__ */
|
|
11
|
+
function v({ cardArtSrc: v, labels: y, cardholderOptions: b, selectedCardholder: x, onCardholderSelect: S, isCardholderError: C = !1, onCardholderRetry: w, cardFormatOptions: T, selectedCardFormat: E, onCardFormatSelect: D, isFundingAccountVisible: O, fundingAccountOptions: k, selectedFundingAccount: A, onFundingAccountSelect: j, isFundingAccountError: M = !1, onFundingAccountRetry: N, isMailingSectionVisible: P, selectedMailingOption: F, onMailingOptionSelect: I, businessAddress: L, isBusinessAddressVisible: R, isManualAddressVisible: z, manualAddress: B, onManualAddressChange: V, stateOptions: H, isCardControlsSectionVisible: U, cardControls: W }) {
|
|
12
|
+
let G = m(), K = `${G}-cardholder`, q = `${G}-card-format`, J = `${G}-funding-account`, Y = `${G}-mailing-business`, X = `${G}-mailing-custom`;
|
|
13
|
+
return /* @__PURE__ */ _("div", {
|
|
13
14
|
className: "ttw:flex ttw:flex-col",
|
|
14
|
-
children: [/* @__PURE__ */
|
|
15
|
+
children: [/* @__PURE__ */ g("div", {
|
|
15
16
|
className: "ttw:bg-primary/5 ttw:px-6 ttw:pt-2 ttw:pb-6",
|
|
16
|
-
children: /* @__PURE__ */
|
|
17
|
-
src:
|
|
18
|
-
alt:
|
|
17
|
+
children: /* @__PURE__ */ g(d, {
|
|
18
|
+
src: v,
|
|
19
|
+
alt: y.cardArtAlt
|
|
19
20
|
})
|
|
20
|
-
}), /* @__PURE__ */
|
|
21
|
+
}), /* @__PURE__ */ _("div", {
|
|
21
22
|
className: "ttw:flex ttw:flex-col ttw:gap-6 ttw:px-6 ttw:py-6",
|
|
22
|
-
children: [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ _("section", {
|
|
25
|
+
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ g("h3", {
|
|
28
|
+
className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
|
|
29
|
+
children: y.setup.sectionTitle
|
|
30
|
+
}),
|
|
31
|
+
/* @__PURE__ */ _("div", {
|
|
32
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
33
|
+
children: [/* @__PURE__ */ g(e, {
|
|
34
|
+
htmlFor: K,
|
|
35
|
+
children: y.setup.cardholderLabel
|
|
36
|
+
}), C ? /* @__PURE__ */ g(l, {
|
|
37
|
+
title: y.cardholderError.title,
|
|
38
|
+
description: y.cardholderError.description,
|
|
39
|
+
retryLabel: y.cardholderError.retry,
|
|
40
|
+
onRetry: w,
|
|
41
|
+
className: "ttw:rounded-lg ttw:border ttw:border-border ttw:py-8"
|
|
42
|
+
}) : /* @__PURE__ */ _(r, {
|
|
43
|
+
value: x ?? "",
|
|
44
|
+
onValueChange: S,
|
|
45
|
+
children: [/* @__PURE__ */ g(o, {
|
|
46
|
+
id: K,
|
|
47
|
+
className: "ttw:w-full",
|
|
48
|
+
children: /* @__PURE__ */ g(s, { placeholder: y.setup.cardholderPlaceholder })
|
|
49
|
+
}), /* @__PURE__ */ g(i, { children: b.map((e) => /* @__PURE__ */ g(a, {
|
|
50
|
+
value: e.value,
|
|
51
|
+
children: e.label
|
|
52
|
+
}, e.value)) })]
|
|
53
|
+
})]
|
|
54
|
+
}),
|
|
55
|
+
/* @__PURE__ */ _("div", {
|
|
56
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
57
|
+
children: [/* @__PURE__ */ g(e, {
|
|
58
|
+
htmlFor: q,
|
|
59
|
+
children: y.setup.cardFormatLabel
|
|
60
|
+
}), /* @__PURE__ */ _(r, {
|
|
61
|
+
value: E ?? "",
|
|
62
|
+
onValueChange: D,
|
|
63
|
+
children: [/* @__PURE__ */ g(o, {
|
|
64
|
+
id: q,
|
|
65
|
+
className: "ttw:w-full",
|
|
66
|
+
children: /* @__PURE__ */ g(s, { placeholder: y.setup.cardFormatPlaceholder })
|
|
67
|
+
}), /* @__PURE__ */ g(i, { children: T.map((e) => /* @__PURE__ */ g(a, {
|
|
68
|
+
value: e.value,
|
|
69
|
+
children: e.label
|
|
70
|
+
}, e.value)) })]
|
|
71
|
+
})]
|
|
72
|
+
}),
|
|
73
|
+
O ? /* @__PURE__ */ _("div", {
|
|
74
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
75
|
+
children: [/* @__PURE__ */ g(e, {
|
|
76
|
+
htmlFor: J,
|
|
77
|
+
children: y.setup.fundingAccountLabel
|
|
78
|
+
}), M ? /* @__PURE__ */ g(l, {
|
|
79
|
+
title: y.fundingAccountError.title,
|
|
80
|
+
description: y.fundingAccountError.description,
|
|
81
|
+
retryLabel: y.fundingAccountError.retry,
|
|
82
|
+
onRetry: N,
|
|
83
|
+
className: "ttw:rounded-lg ttw:border ttw:border-border ttw:py-8"
|
|
84
|
+
}) : /* @__PURE__ */ _(r, {
|
|
85
|
+
value: A ?? "",
|
|
86
|
+
onValueChange: j,
|
|
87
|
+
children: [/* @__PURE__ */ g(o, {
|
|
88
|
+
id: J,
|
|
89
|
+
className: "ttw:w-full",
|
|
90
|
+
children: /* @__PURE__ */ g(s, { placeholder: y.setup.fundingAccountPlaceholder })
|
|
91
|
+
}), /* @__PURE__ */ g(i, { children: k.map((e) => /* @__PURE__ */ g(a, {
|
|
92
|
+
value: e.value,
|
|
93
|
+
children: e.label
|
|
94
|
+
}, e.value)) })]
|
|
95
|
+
})]
|
|
96
|
+
}) : null
|
|
97
|
+
]
|
|
98
|
+
}),
|
|
99
|
+
P ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(c, {}), /* @__PURE__ */ _("section", {
|
|
100
|
+
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
101
|
+
children: [/* @__PURE__ */ _("div", {
|
|
102
|
+
className: "ttw:flex ttw:flex-col ttw:gap-1",
|
|
103
|
+
children: [/* @__PURE__ */ g("h3", {
|
|
104
|
+
className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
|
|
105
|
+
children: y.mailing.sectionTitle
|
|
106
|
+
}), /* @__PURE__ */ g("p", {
|
|
107
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
108
|
+
children: y.mailing.sectionDescription
|
|
93
109
|
})]
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
children: [/* @__PURE__ */ h(n, {
|
|
117
|
-
value: u.BusinessAddress,
|
|
118
|
-
id: K,
|
|
119
|
-
className: "ttw:mt-0.5"
|
|
120
|
-
}), /* @__PURE__ */ g("span", {
|
|
121
|
-
className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:flex-col ttw:gap-0.5",
|
|
122
|
-
children: [/* @__PURE__ */ h("span", {
|
|
123
|
-
className: "ttw:text-sm ttw:font-medium ttw:text-foreground",
|
|
124
|
-
children: v.mailing.businessTitle
|
|
125
|
-
}), /* @__PURE__ */ h("span", {
|
|
126
|
-
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
127
|
-
children: v.mailing.businessDescription
|
|
110
|
+
}), /* @__PURE__ */ _(t, {
|
|
111
|
+
value: F ?? "",
|
|
112
|
+
onValueChange: I,
|
|
113
|
+
className: "ttw:gap-0 ttw:overflow-hidden ttw:rounded-lg ttw:border ttw:border-border",
|
|
114
|
+
children: [/* @__PURE__ */ _("div", {
|
|
115
|
+
className: "ttw:flex ttw:flex-col ttw:gap-3 ttw:border-b ttw:border-border ttw:p-4",
|
|
116
|
+
children: [/* @__PURE__ */ _("label", {
|
|
117
|
+
htmlFor: Y,
|
|
118
|
+
className: "ttw:flex ttw:cursor-pointer ttw:items-start ttw:gap-3",
|
|
119
|
+
children: [/* @__PURE__ */ g(n, {
|
|
120
|
+
value: u.BusinessAddress,
|
|
121
|
+
id: Y,
|
|
122
|
+
className: "ttw:mt-0.5"
|
|
123
|
+
}), /* @__PURE__ */ _("span", {
|
|
124
|
+
className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:flex-col ttw:gap-0.5",
|
|
125
|
+
children: [/* @__PURE__ */ g("span", {
|
|
126
|
+
className: "ttw:text-sm ttw:font-medium ttw:text-foreground",
|
|
127
|
+
children: y.mailing.businessTitle
|
|
128
|
+
}), /* @__PURE__ */ g("span", {
|
|
129
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
130
|
+
children: y.mailing.businessDescription
|
|
131
|
+
})]
|
|
128
132
|
})]
|
|
129
|
-
})
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
})
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
133
|
+
}), R ? /* @__PURE__ */ g("div", {
|
|
134
|
+
className: "ttw:rounded-md ttw:border ttw:border-border ttw:bg-background ttw:px-3 ttw:py-2 ttw:text-sm ttw:text-foreground",
|
|
135
|
+
children: L
|
|
136
|
+
}) : null]
|
|
137
|
+
}), /* @__PURE__ */ _("div", {
|
|
138
|
+
className: "ttw:flex ttw:flex-col ttw:gap-0 ttw:p-4",
|
|
139
|
+
children: [/* @__PURE__ */ _("label", {
|
|
140
|
+
htmlFor: X,
|
|
141
|
+
className: "ttw:flex ttw:cursor-pointer ttw:items-start ttw:gap-3",
|
|
142
|
+
children: [/* @__PURE__ */ g(n, {
|
|
143
|
+
value: u.DifferentAddress,
|
|
144
|
+
id: X,
|
|
145
|
+
className: "ttw:mt-0.5"
|
|
146
|
+
}), /* @__PURE__ */ _("span", {
|
|
147
|
+
className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:flex-col ttw:gap-0.5",
|
|
148
|
+
children: [/* @__PURE__ */ g("span", {
|
|
149
|
+
className: "ttw:text-sm ttw:font-medium ttw:text-foreground",
|
|
150
|
+
children: y.mailing.customTitle
|
|
151
|
+
}), /* @__PURE__ */ g("span", {
|
|
152
|
+
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
153
|
+
children: y.mailing.customDescription
|
|
154
|
+
})]
|
|
151
155
|
})]
|
|
152
|
-
})
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
})
|
|
156
|
+
}), z ? /* @__PURE__ */ g(p, {
|
|
157
|
+
values: B,
|
|
158
|
+
stateOptions: H,
|
|
159
|
+
onChange: V,
|
|
160
|
+
labels: y.manualAddress
|
|
161
|
+
}) : null]
|
|
162
|
+
})]
|
|
159
163
|
})]
|
|
160
|
-
})]
|
|
161
|
-
|
|
164
|
+
})] }) : null,
|
|
165
|
+
U ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(c, {}), /* @__PURE__ */ g("section", {
|
|
166
|
+
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
167
|
+
children: /* @__PURE__ */ g(f, {
|
|
168
|
+
...W,
|
|
169
|
+
labels: y.cardControls
|
|
170
|
+
})
|
|
171
|
+
})] }) : null
|
|
172
|
+
]
|
|
162
173
|
})]
|
|
163
174
|
});
|
|
164
175
|
}
|
|
165
176
|
//#endregion
|
|
166
|
-
export {
|
|
177
|
+
export { v as SetupView };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { CARD_CONTROLS_LABELS_EN as e, resolveCardControlsLabels as t } from "./CardControls/labels.js";
|
|
1
2
|
//#region ../../libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/labels.js
|
|
2
|
-
var
|
|
3
|
+
var n = {
|
|
3
4
|
header: {
|
|
4
5
|
title: "Create a new card",
|
|
5
6
|
closeAriaLabel: "Close"
|
|
@@ -31,6 +32,7 @@ var e = {
|
|
|
31
32
|
statePlaceholder: "Select state",
|
|
32
33
|
zipLabel: "ZIP code"
|
|
33
34
|
},
|
|
35
|
+
cardControls: e,
|
|
34
36
|
preparing: {
|
|
35
37
|
title: "Preparing your card",
|
|
36
38
|
description: "This will only take a moment"
|
|
@@ -56,47 +58,48 @@ var e = {
|
|
|
56
58
|
retry: "Try again"
|
|
57
59
|
}
|
|
58
60
|
};
|
|
59
|
-
function
|
|
61
|
+
function r(e) {
|
|
60
62
|
return {
|
|
63
|
+
...n,
|
|
61
64
|
...e,
|
|
62
|
-
...t,
|
|
63
65
|
header: {
|
|
64
|
-
...
|
|
65
|
-
...
|
|
66
|
+
...n.header,
|
|
67
|
+
...e?.header
|
|
66
68
|
},
|
|
67
69
|
setup: {
|
|
68
|
-
...
|
|
69
|
-
...
|
|
70
|
+
...n.setup,
|
|
71
|
+
...e?.setup
|
|
70
72
|
},
|
|
71
73
|
mailing: {
|
|
72
|
-
...
|
|
73
|
-
...
|
|
74
|
+
...n.mailing,
|
|
75
|
+
...e?.mailing
|
|
74
76
|
},
|
|
75
77
|
manualAddress: {
|
|
76
|
-
...
|
|
77
|
-
...
|
|
78
|
+
...n.manualAddress,
|
|
79
|
+
...e?.manualAddress
|
|
78
80
|
},
|
|
81
|
+
cardControls: t(e?.cardControls),
|
|
79
82
|
preparing: {
|
|
80
|
-
...
|
|
81
|
-
...
|
|
83
|
+
...n.preparing,
|
|
84
|
+
...e?.preparing
|
|
82
85
|
},
|
|
83
86
|
success: {
|
|
84
|
-
...
|
|
85
|
-
...
|
|
87
|
+
...n.success,
|
|
88
|
+
...e?.success
|
|
86
89
|
},
|
|
87
90
|
footer: {
|
|
88
|
-
...
|
|
89
|
-
...
|
|
91
|
+
...n.footer,
|
|
92
|
+
...e?.footer
|
|
90
93
|
},
|
|
91
94
|
cardholderError: {
|
|
92
|
-
...
|
|
93
|
-
...
|
|
95
|
+
...n.cardholderError,
|
|
96
|
+
...e?.cardholderError
|
|
94
97
|
},
|
|
95
98
|
fundingAccountError: {
|
|
96
|
-
...
|
|
97
|
-
...
|
|
99
|
+
...n.fundingAccountError,
|
|
100
|
+
...e?.fundingAccountError
|
|
98
101
|
}
|
|
99
102
|
};
|
|
100
103
|
}
|
|
101
104
|
//#endregion
|
|
102
|
-
export {
|
|
105
|
+
export { n as CREATE_CARD_WIDGET_LABELS_EN, r as resolveCreateCardWidgetLabels };
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.2.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.2.342", n = "6e389150ca29f4124a26d9b5b5077d8c8c1a150e", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|