@tesouro/embedded-components-react 0.11.274 → 0.11.276
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/dist/index.css +61 -7
- package/dist/index.d.ts +1 -13
- package/dist/lib/RecentActivityWidget.d.ts +1 -13
- package/dist/lib/WidgetSuite.d.ts +1 -13
- package/dist/libs/tesouro-embedded-components-react/balance-history-widget/ui/dist/lib/BalanceHistoryCard/BalanceHistoryCard.js +114 -111
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/CreateAccountDialog.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index23.js +69 -69
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/CardControls/SpendLimitControl.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index4.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/lib/RecentActivityWidget/RecentActivityWidgetFeature.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/lib/RecentActivityWidget/labels.js +1 -4
- package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/lib/recentActivityView/buildRecentActivityRows.js +12 -19
- package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/ui/dist/lib/RecentActivityCard/RecentActivityCard.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index15.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index12.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +106 -106
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +142 -146
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/useOwnedQueryClient.js +31 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/AttentionStrip/AttentionStrip.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/AttentionStrip/AttentionViewBar.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/DueDateText/DueDateText.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShell.js +16 -14
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShellScrollRegion.js +17 -14
- package/dist/packages/shared-ui-shadcn/dist/index.js +448 -417
- package/package.json +1 -1
package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index23.js
CHANGED
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
import { Badge as e, Command as t, CommandGroup as n, CommandInput as r, CommandItem as i, CommandList as a,
|
|
2
|
-
import { mergeVendorSearchComboboxLabels as
|
|
3
|
-
import { useId as
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import { ChevronDown as
|
|
1
|
+
import { Badge as e, Command as t, CommandGroup as n, CommandInput as r, CommandItem as i, CommandList as a, FieldDescription as o, FieldRequirement as s, Label as c, Popover as l, PopoverContent as u, PopoverTrigger as d, Skeleton as f, cn as p } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { mergeVendorSearchComboboxLabels as m } from "./index22.js";
|
|
3
|
+
import { useId as h, useState as g } from "react";
|
|
4
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
5
|
+
import { ChevronDown as b, Plus as x } from "lucide-react";
|
|
6
6
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index23.js
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
let
|
|
10
|
-
return /* @__PURE__ */
|
|
7
|
+
var S = 5, C = "ttw:min-h-44";
|
|
8
|
+
function w({ query: w, onQueryChange: T, results: E, isLoading: D, onAddVendor: O, selectedLabel: k, badge: A, helperText: j, resultsHeading: M, addVendorDescription: N, testId: P, labels: F }) {
|
|
9
|
+
let I = m(F), L = h(), R = h(), [z, B] = g(!1);
|
|
10
|
+
return /* @__PURE__ */ y("div", {
|
|
11
11
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
12
|
-
"data-testid":
|
|
12
|
+
"data-testid": P,
|
|
13
13
|
children: [
|
|
14
|
-
/* @__PURE__ */
|
|
15
|
-
htmlFor:
|
|
16
|
-
requirement:
|
|
17
|
-
labels:
|
|
18
|
-
children:
|
|
14
|
+
/* @__PURE__ */ v(c, {
|
|
15
|
+
htmlFor: L,
|
|
16
|
+
requirement: s.Required,
|
|
17
|
+
labels: I.fieldMarkers,
|
|
18
|
+
children: I.fieldLabel
|
|
19
19
|
}),
|
|
20
|
-
/* @__PURE__ */
|
|
20
|
+
/* @__PURE__ */ y(l, {
|
|
21
21
|
modal: !0,
|
|
22
|
-
open:
|
|
23
|
-
onOpenChange:
|
|
24
|
-
children: [/* @__PURE__ */
|
|
22
|
+
open: z,
|
|
23
|
+
onOpenChange: B,
|
|
24
|
+
children: [/* @__PURE__ */ v(d, {
|
|
25
25
|
asChild: !0,
|
|
26
|
-
children: /* @__PURE__ */
|
|
26
|
+
children: /* @__PURE__ */ y("button", {
|
|
27
27
|
type: "button",
|
|
28
|
-
id:
|
|
28
|
+
id: L,
|
|
29
29
|
role: "combobox",
|
|
30
|
-
"aria-expanded":
|
|
31
|
-
"aria-controls":
|
|
30
|
+
"aria-expanded": z,
|
|
31
|
+
"aria-controls": z ? `${L}-options` : void 0,
|
|
32
32
|
"aria-required": !0,
|
|
33
|
-
"aria-describedby":
|
|
33
|
+
"aria-describedby": j ? R : void 0,
|
|
34
34
|
className: "ttw:flex ttw:h-10 ttw:w-full ttw:items-center ttw:justify-between ttw:gap-2 ttw:rounded-md ttw:border ttw:border-border ttw:bg-background ttw:px-3 ttw:text-left ttw:text-sm ttw:shadow-xs ttw:outline-none ttw:focus-visible:border-ring ttw:focus-visible:ring-[3px] ttw:focus-visible:ring-ring/50",
|
|
35
35
|
children: [
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
className:
|
|
38
|
-
children:
|
|
36
|
+
/* @__PURE__ */ v("span", {
|
|
37
|
+
className: p("ttw:min-w-0 ttw:flex-1 ttw:truncate", k ? "ttw:text-foreground" : "ttw:text-muted-foreground"),
|
|
38
|
+
children: k || I.triggerPlaceholder
|
|
39
39
|
}),
|
|
40
|
-
|
|
40
|
+
A ? /* @__PURE__ */ v(e, {
|
|
41
41
|
variant: "secondary",
|
|
42
|
-
children:
|
|
42
|
+
children: A
|
|
43
43
|
}) : null,
|
|
44
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ v(b, {
|
|
45
45
|
"aria-hidden": !0,
|
|
46
46
|
className: "ttw:size-4 ttw:shrink-0 ttw:opacity-50"
|
|
47
47
|
})
|
|
48
48
|
]
|
|
49
49
|
})
|
|
50
|
-
}), /* @__PURE__ */
|
|
51
|
-
id: `${
|
|
50
|
+
}), /* @__PURE__ */ v(u, {
|
|
51
|
+
id: `${L}-options`,
|
|
52
52
|
align: "start",
|
|
53
53
|
className: "ttw:w-[var(--radix-popover-trigger-width)] ttw:p-0",
|
|
54
|
-
children: /* @__PURE__ */
|
|
54
|
+
children: /* @__PURE__ */ y(t, {
|
|
55
55
|
shouldFilter: !1,
|
|
56
|
-
children: [/* @__PURE__ */
|
|
57
|
-
value:
|
|
58
|
-
onValueChange:
|
|
59
|
-
placeholder:
|
|
60
|
-
"aria-label":
|
|
61
|
-
}), /* @__PURE__ */
|
|
62
|
-
className:
|
|
63
|
-
|
|
56
|
+
children: [/* @__PURE__ */ v(r, {
|
|
57
|
+
value: w,
|
|
58
|
+
onValueChange: T,
|
|
59
|
+
placeholder: I.placeholder,
|
|
60
|
+
"aria-label": I.placeholder
|
|
61
|
+
}), /* @__PURE__ */ y(a, {
|
|
62
|
+
className: p("ttw:max-h-72", C),
|
|
63
|
+
"aria-busy": D || void 0,
|
|
64
|
+
children: [D ? /* @__PURE__ */ y("div", {
|
|
64
65
|
className: "ttw:flex ttw:flex-col ttw:gap-2 ttw:p-2",
|
|
65
|
-
|
|
66
|
-
children: [/* @__PURE__ */ y("span", {
|
|
66
|
+
children: [/* @__PURE__ */ v("span", {
|
|
67
67
|
className: "ttw:sr-only",
|
|
68
|
-
children:
|
|
69
|
-
}), Array.from({ length:
|
|
68
|
+
children: I.loading
|
|
69
|
+
}), Array.from({ length: S }).map((e, t) => /* @__PURE__ */ y("div", {
|
|
70
70
|
className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-4 ttw:px-2 ttw:py-1.5",
|
|
71
|
-
children: [/* @__PURE__ */
|
|
71
|
+
children: [/* @__PURE__ */ v(f, {
|
|
72
72
|
height: 14,
|
|
73
73
|
width: "55%"
|
|
74
|
-
}), /* @__PURE__ */
|
|
74
|
+
}), /* @__PURE__ */ v(f, {
|
|
75
75
|
height: 14,
|
|
76
76
|
width: "30%"
|
|
77
77
|
})]
|
|
78
78
|
}, t))]
|
|
79
|
-
}) :
|
|
80
|
-
className:
|
|
81
|
-
children:
|
|
82
|
-
}) : /* @__PURE__ */
|
|
83
|
-
heading:
|
|
84
|
-
children:
|
|
79
|
+
}) : E.length === 0 ? /* @__PURE__ */ v("div", {
|
|
80
|
+
className: p("ttw:flex ttw:items-center ttw:justify-center ttw:py-6 ttw:text-center ttw:text-sm", C),
|
|
81
|
+
children: I.emptyResults
|
|
82
|
+
}) : /* @__PURE__ */ v(n, {
|
|
83
|
+
heading: M,
|
|
84
|
+
children: E.map((e, t) => /* @__PURE__ */ v(i, {
|
|
85
85
|
value: `${e.name} ${e.email} ${t}`,
|
|
86
86
|
onSelect: () => e.onSelect(),
|
|
87
|
-
children: /* @__PURE__ */
|
|
87
|
+
children: /* @__PURE__ */ y("div", {
|
|
88
88
|
className: "ttw:flex ttw:min-w-0 ttw:flex-col",
|
|
89
|
-
children: [/* @__PURE__ */
|
|
89
|
+
children: [/* @__PURE__ */ v("span", {
|
|
90
90
|
className: "ttw:truncate ttw:text-foreground",
|
|
91
91
|
children: e.name
|
|
92
|
-
}), e.email ? /* @__PURE__ */
|
|
92
|
+
}), e.email ? /* @__PURE__ */ v("span", {
|
|
93
93
|
className: "ttw:truncate ttw:text-xs ttw:text-muted-foreground",
|
|
94
94
|
children: e.email
|
|
95
95
|
}) : null]
|
|
96
96
|
})
|
|
97
97
|
}, `${e.name}:${e.email}:${t}`))
|
|
98
|
-
}),
|
|
98
|
+
}), O ? /* @__PURE__ */ v(_, { children: /* @__PURE__ */ y(i, {
|
|
99
99
|
value: "__add_vendor__",
|
|
100
100
|
onSelect: () => {
|
|
101
|
-
|
|
101
|
+
B(!1), O();
|
|
102
102
|
},
|
|
103
|
-
className: "ttw:sticky ttw:bottom-0 ttw:bg-popover ttw:text-primary",
|
|
104
|
-
children: [/* @__PURE__ */
|
|
103
|
+
className: "ttw:sticky ttw:bottom-0 ttw:border-t ttw:border-border ttw:bg-popover ttw:text-primary",
|
|
104
|
+
children: [/* @__PURE__ */ v(x, { className: "ttw:size-4 ttw:text-primary" }), /* @__PURE__ */ y("div", {
|
|
105
105
|
className: "ttw:flex ttw:min-w-0 ttw:flex-col",
|
|
106
|
-
children: [/* @__PURE__ */
|
|
106
|
+
children: [/* @__PURE__ */ v("span", {
|
|
107
107
|
className: "ttw:truncate",
|
|
108
|
-
children:
|
|
109
|
-
}),
|
|
108
|
+
children: I.addVendorAction
|
|
109
|
+
}), N ? /* @__PURE__ */ v("span", {
|
|
110
110
|
className: "ttw:truncate ttw:text-xs ttw:text-muted-foreground",
|
|
111
|
-
children:
|
|
111
|
+
children: N
|
|
112
112
|
}) : null]
|
|
113
113
|
})]
|
|
114
|
-
})
|
|
114
|
+
}) }) : null]
|
|
115
115
|
})]
|
|
116
116
|
})
|
|
117
117
|
})]
|
|
118
118
|
}),
|
|
119
|
-
|
|
120
|
-
id:
|
|
121
|
-
children:
|
|
119
|
+
j ? /* @__PURE__ */ v(o, {
|
|
120
|
+
id: R,
|
|
121
|
+
children: j
|
|
122
122
|
}) : null
|
|
123
123
|
]
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
|
-
export {
|
|
126
|
+
export { w as VendorSearchCombobox, w as default };
|
|
@@ -9,7 +9,7 @@ function g({ notice: n }) {
|
|
|
9
9
|
if (!n) return null;
|
|
10
10
|
let r = n.variant === "warning";
|
|
11
11
|
return /* @__PURE__ */ p(e, {
|
|
12
|
-
className: r ? "ttw:border-destructive/30 ttw:bg-destructive/5 ttw:text-destructive" : "ttw:border-border ttw:bg-muted ttw:text-foreground",
|
|
12
|
+
className: r ? "ttw:border-destructive/30 ttw:bg-destructive/5 ttw:text-destructive-subtle-foreground" : "ttw:border-border ttw:bg-muted ttw:text-foreground",
|
|
13
13
|
children: [/* @__PURE__ */ f(r ? h : m, { "aria-hidden": !0 }), /* @__PURE__ */ f(t, {
|
|
14
14
|
className: "ttw:text-current",
|
|
15
15
|
children: /* @__PURE__ */ p("p", { children: [n.title ? /* @__PURE__ */ p("span", {
|
|
@@ -84,7 +84,7 @@ function m({ view: m, isDragging: h, disabled: g, inputRef: _, onBrowseClick: v,
|
|
|
84
84
|
}) : /* @__PURE__ */ s(r, {
|
|
85
85
|
variant: "caption",
|
|
86
86
|
role: "alert",
|
|
87
|
-
className: "ttw:text-destructive",
|
|
87
|
+
className: "ttw:text-destructive-subtle-foreground",
|
|
88
88
|
children: t.message
|
|
89
89
|
})]
|
|
90
90
|
}),
|
package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index4.js
CHANGED
|
@@ -31,7 +31,7 @@ function u({ id: t, label: n, value: u, options: d, disabled: f, error: p, onVal
|
|
|
31
31
|
let n = `${t}-${e.value}`, i = u === e.value;
|
|
32
32
|
return /* @__PURE__ */ c(r, {
|
|
33
33
|
htmlFor: n,
|
|
34
|
-
className: o("ttw:flex ttw:cursor-pointer ttw:items-start ttw:gap-3 ttw:font-normal", _ && "ttw:h-full ttw:rounded-lg ttw:border ttw:p-4", _ && (p ? "ttw:border-destructive ttw:bg-card" : i ? "ttw:border-primary ttw:bg-primary/
|
|
34
|
+
className: o("ttw:flex ttw:cursor-pointer ttw:items-start ttw:gap-3 ttw:font-normal", _ && "ttw:h-full ttw:rounded-lg ttw:border ttw:p-4", _ && (p ? "ttw:border-destructive ttw:bg-card" : i ? "ttw:border-primary ttw:bg-primary/5" : "ttw:border-border ttw:bg-card")),
|
|
35
35
|
children: [/* @__PURE__ */ s(a, {
|
|
36
36
|
id: n,
|
|
37
37
|
value: e.value,
|
|
@@ -36,7 +36,7 @@ function C({ labels: a, onTransactionClick: m, className: C, style: w }) {
|
|
|
36
36
|
B,
|
|
37
37
|
F,
|
|
38
38
|
j
|
|
39
|
-
]), H = x(() => h(L ?? [],
|
|
39
|
+
]), H = x(() => h(L ?? [], g(/* @__PURE__ */ new Date())), [L]), U = y((e) => {
|
|
40
40
|
let t = L?.[Number(e)]?.bankAccount.id;
|
|
41
41
|
t && m && (E(p.TransactionClicked), m(t));
|
|
42
42
|
}, [
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { RECENT_ACTIVITY_CARD_LABELS_EN as e } from "../../../../ui/dist/lib/RecentActivityCard/labels.js";
|
|
2
2
|
import "../../../../ui/dist/index.js";
|
|
3
3
|
// ../../libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/lib/RecentActivityWidget/labels.js
|
|
4
|
-
var t = {
|
|
5
|
-
...e,
|
|
6
|
-
rowAriaLabel: ({ description: e, nickname: t, last4: n, date: r, amount: i }) => `${e}, ${t} ending ${n}, ${r}, ${i}`
|
|
7
|
-
};
|
|
4
|
+
var t = { ...e };
|
|
8
5
|
export { t as RECENT_ACTIVITY_WIDGET_LABELS_EN };
|
|
@@ -39,26 +39,19 @@ function s(i) {
|
|
|
39
39
|
});
|
|
40
40
|
return `${i.direction === "CREDIT" ? "+" : r}${s}`;
|
|
41
41
|
}
|
|
42
|
-
function c(e, t
|
|
43
|
-
return e.map((
|
|
44
|
-
let
|
|
42
|
+
function c(e, t) {
|
|
43
|
+
return e.map((n, r) => {
|
|
44
|
+
let a = i(n.date), c = r === 0 ? t : e[r - 1].date, l = s(n), { nickname: u, accountNumberLast4: d } = n.bankAccount;
|
|
45
45
|
return {
|
|
46
|
-
id: String(
|
|
47
|
-
month:
|
|
48
|
-
day:
|
|
49
|
-
...o(
|
|
50
|
-
date:
|
|
51
|
-
title:
|
|
52
|
-
accountName:
|
|
53
|
-
accountLast4:
|
|
54
|
-
amount:
|
|
55
|
-
ariaLabel: t.rowAriaLabel({
|
|
56
|
-
description: r.description,
|
|
57
|
-
nickname: d,
|
|
58
|
-
last4: f,
|
|
59
|
-
date: c.spoken,
|
|
60
|
-
amount: u
|
|
61
|
-
})
|
|
46
|
+
id: String(r),
|
|
47
|
+
month: a.month,
|
|
48
|
+
day: a.day,
|
|
49
|
+
...o(n.date, c) ? { year: a.year } : {},
|
|
50
|
+
date: a.spoken,
|
|
51
|
+
title: n.description,
|
|
52
|
+
accountName: u,
|
|
53
|
+
accountLast4: d,
|
|
54
|
+
amount: l
|
|
62
55
|
};
|
|
63
56
|
});
|
|
64
57
|
}
|
|
@@ -107,7 +107,6 @@ function _({ rows: s, onRowClick: u, isLoading: _ = !1, isError: v = !1, onRetry
|
|
|
107
107
|
"data-testid": x?.row,
|
|
108
108
|
children: [r > 0 && /* @__PURE__ */ d(e, {}), u ? /* @__PURE__ */ d("button", {
|
|
109
109
|
type: "button",
|
|
110
|
-
"aria-label": t.ariaLabel,
|
|
111
110
|
onClick: () => u(t.id),
|
|
112
111
|
className: n(g, "ttw:cursor-pointer ttw:outline-none ttw:hover:bg-muted ttw:focus-visible:outline-2 ttw:focus-visible:outline-offset-2 ttw:focus-visible:outline-ring ttw:focus-visible:outline-solid"),
|
|
113
112
|
children: /* @__PURE__ */ d(h, {
|
|
@@ -123,9 +123,9 @@ function p({ rows: p, isLoading: m = !1, isError: h = !1, showPagination: g = !1
|
|
|
123
123
|
onRowClick: (e) => e.onSelect(),
|
|
124
124
|
rowAriaLabel: A,
|
|
125
125
|
isRowActionable: (e) => !e.isInactive,
|
|
126
|
-
rowClassName: (e) => e.isInactive ? "ttw:cursor-default ttw:
|
|
126
|
+
rowClassName: (e) => e.isInactive ? "ttw:cursor-default ttw:text-muted-foreground ttw:hover:bg-transparent" : void 0,
|
|
127
127
|
renderCard: !h && p.length > 0 ? (t) => /* @__PURE__ */ d("div", {
|
|
128
|
-
className: r("ttw:flex ttw:flex-col ttw:gap-2", t.isInactive && "ttw:
|
|
128
|
+
className: r("ttw:flex ttw:flex-col ttw:gap-2", t.isInactive && "ttw:text-muted-foreground"),
|
|
129
129
|
children: [
|
|
130
130
|
M(t),
|
|
131
131
|
/* @__PURE__ */ d("div", {
|
package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index12.js
CHANGED
|
@@ -12,11 +12,12 @@ function b({ id: e, label: t }) {
|
|
|
12
12
|
function x({ option: t, isSelected: n, isDisabled: r, reason: o, onToggle: c }) {
|
|
13
13
|
let l = r && !n, u = /* @__PURE__ */ g("label", {
|
|
14
14
|
"data-testid": `approver-option-${t.id}`,
|
|
15
|
-
className: `ttw:flex ttw:w-full ttw:items-center ttw:gap-2 ttw:rounded-sm ttw:px-2 ttw:py-1.5 ttw:text-sm ${r ? "ttw:cursor-not-allowed ttw:
|
|
15
|
+
className: `ttw:flex ttw:w-full ttw:items-center ttw:gap-2 ttw:rounded-sm ttw:px-2 ttw:py-1.5 ttw:text-sm ${r ? "ttw:cursor-not-allowed ttw:text-muted-foreground" : "ttw:cursor-pointer ttw:hover:bg-accent ttw:hover:text-accent-foreground"}`,
|
|
16
16
|
children: [
|
|
17
17
|
/* @__PURE__ */ h(e, {
|
|
18
18
|
checked: n,
|
|
19
19
|
"aria-disabled": l,
|
|
20
|
+
className: r ? "ttw:opacity-50" : void 0,
|
|
20
21
|
onCheckedChange: () => {
|
|
21
22
|
l || c();
|
|
22
23
|
}
|
|
@@ -66,7 +67,7 @@ var S = ({ value: e, options: S, onChange: C, lockedSections: w, lockedOptions:
|
|
|
66
67
|
asChild: !0,
|
|
67
68
|
children: /* @__PURE__ */ g("div", {
|
|
68
69
|
ref: L,
|
|
69
|
-
className: `ttw:flex ttw:min-h-9 ttw:w-full ttw:cursor-text ttw:flex-wrap ttw:items-center ttw:gap-1.5 ttw:rounded-md ttw:border ttw:bg-transparent ttw:px-2.5 ttw:py-1.5 ttw:has-[:disabled]:cursor-not-allowed ttw:has-[:disabled]:
|
|
70
|
+
className: `ttw:flex ttw:min-h-9 ttw:w-full ttw:cursor-text ttw:flex-wrap ttw:items-center ttw:gap-1.5 ttw:rounded-md ttw:border ttw:bg-transparent ttw:px-2.5 ttw:py-1.5 ttw:has-[:disabled]:cursor-not-allowed ttw:has-[:disabled]:bg-muted ${D ? "ttw:border-destructive" : "ttw:border-input"}`,
|
|
70
71
|
children: [
|
|
71
72
|
e.map((e, t) => /* @__PURE__ */ g(l, { children: [t > 0 ? /* @__PURE__ */ h("span", {
|
|
72
73
|
className: "ttw:text-xs ttw:text-muted-foreground",
|
|
@@ -3,179 +3,179 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { createClientSecretInstaller as e } from "../../../../data-access/dist/lib/scopedClientSecret.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { EmbedApiProvider as i } from "../../../../data-access/dist/lib/EmbedApiContext.js";
|
|
6
|
+
import { createEmbeddedClient as t } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
|
|
7
|
+
import { EmbedApiProvider as n } from "../../../../data-access/dist/lib/EmbedApiContext.js";
|
|
9
8
|
import "../../../../data-access/dist/index.js";
|
|
10
|
-
import { resolveUIFramework as
|
|
9
|
+
import { resolveUIFramework as r } from "../../../../ui/dist/lib/UIContext/UIContext.js";
|
|
11
10
|
import { UIProvider as ee } from "../../../../ui/dist/lib/UIContext/UIProvider.js";
|
|
12
11
|
import { useDesignSystemEnsurer as te } from "../../../../ui/dist/lib/UIContext/uiRendererRegistry.js";
|
|
13
12
|
import "../../../../ui/dist/index.js";
|
|
14
|
-
import { getGlobalSnapshot as
|
|
13
|
+
import { getGlobalSnapshot as i, subscribeToGlobal as ne } from "./globalStore.js";
|
|
15
14
|
import { configureEmbeddedClient as re } from "../analytics/client.js";
|
|
16
|
-
import { generateCorrelationId as
|
|
17
|
-
import { WidgetContext as
|
|
18
|
-
import { resolveOrgId as
|
|
19
|
-
import { useWidgetFetch as
|
|
20
|
-
import { deriveOrganizationStatus as
|
|
21
|
-
import { deriveWidgetInitState as
|
|
22
|
-
import { useTokenRefreshRef as
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
15
|
+
import { generateCorrelationId as a } from "../analytics/ids.js";
|
|
16
|
+
import { WidgetContext as o } from "./WidgetContext.js";
|
|
17
|
+
import { resolveOrgId as s, useAuthEpoch as c } from "./utils.js";
|
|
18
|
+
import { useWidgetFetch as l } from "./useWidgetFetch.js";
|
|
19
|
+
import { deriveOrganizationStatus as u } from "./deriveOrganizationStatus.js";
|
|
20
|
+
import { deriveWidgetInitState as ie, useWidgetInitPublisher as ae } from "./useWidgetInitPublisher.js";
|
|
21
|
+
import { useTokenRefreshRef as oe } from "./useTokenRefreshRef.js";
|
|
22
|
+
import { useOwnedQueryClient as se } from "./useOwnedQueryClient.js";
|
|
23
|
+
import { useEffect as d, useMemo as f, useRef as p, useState as m, useSyncExternalStore as h } from "react";
|
|
24
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
25
|
+
import { QueryClient as ce, QueryClientProvider as le } from "@tanstack/react-query";
|
|
26
26
|
// ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js
|
|
27
|
-
function
|
|
28
|
-
let
|
|
29
|
-
enabled:
|
|
30
|
-
organizationId:
|
|
31
|
-
rootCorrelationId:
|
|
32
|
-
}), [
|
|
27
|
+
function _({ children: _, baseUrl: v, widgetToken: y, organizationId: b, configClient: x, gatewayRouting: S, linkComponent: C, uiFramework: w, analytics: ue, unstable_initResponseOverride: T, disclosuresAcceptance: E, providerLabels: D }) {
|
|
28
|
+
let O = h(ne, i, i), k = v ?? O.baseUrl, A = y === void 0 ? O.widgetToken : y, j = b === void 0 ? O.organizationId : b, M = x ?? O.configClient, N = S ?? O.gatewayRouting, P = C ?? O.linkComponent, F = w ?? O.uiFramework, I = ue !== !1, [L] = m(a), R = p({
|
|
29
|
+
enabled: I,
|
|
30
|
+
organizationId: j,
|
|
31
|
+
rootCorrelationId: L
|
|
32
|
+
}), [z] = m(() => new ce({ defaultOptions: {
|
|
33
33
|
queries: {
|
|
34
34
|
retry: !1,
|
|
35
35
|
refetchOnWindowFocus: !1
|
|
36
36
|
},
|
|
37
37
|
mutations: { retry: !1 }
|
|
38
38
|
} }));
|
|
39
|
-
|
|
40
|
-
let
|
|
41
|
-
|
|
42
|
-
let
|
|
43
|
-
let e = re(
|
|
44
|
-
tokenRef:
|
|
45
|
-
analyticsContextRef:
|
|
46
|
-
clientSecretRef:
|
|
47
|
-
gatewayRouting:
|
|
48
|
-
refreshTokenRef:
|
|
39
|
+
se(z);
|
|
40
|
+
let B = p(A);
|
|
41
|
+
B.current = A;
|
|
42
|
+
let V = oe(), H = p(null), de = f(() => e(H), []), fe = c(A), U = f(() => {
|
|
43
|
+
let e = re(t(k), {
|
|
44
|
+
tokenRef: B,
|
|
45
|
+
analyticsContextRef: R,
|
|
46
|
+
clientSecretRef: H,
|
|
47
|
+
gatewayRouting: N,
|
|
48
|
+
refreshTokenRef: V
|
|
49
49
|
});
|
|
50
|
-
return
|
|
50
|
+
return M ? M(e) : e;
|
|
51
51
|
}, [
|
|
52
|
-
|
|
53
|
-
j,
|
|
52
|
+
k,
|
|
54
53
|
M,
|
|
55
|
-
|
|
54
|
+
N,
|
|
55
|
+
V
|
|
56
56
|
]);
|
|
57
|
-
|
|
58
|
-
if (!
|
|
57
|
+
d(() => {
|
|
58
|
+
if (!I || !("window" in globalThis)) return;
|
|
59
59
|
let e = !1;
|
|
60
60
|
return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled: t }) => {
|
|
61
61
|
e || t();
|
|
62
62
|
}), () => {
|
|
63
63
|
e = !0;
|
|
64
64
|
};
|
|
65
|
-
}, [
|
|
66
|
-
let
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}, [
|
|
70
|
-
let { result:
|
|
65
|
+
}, [I]);
|
|
66
|
+
let W = te(r(F));
|
|
67
|
+
d(() => {
|
|
68
|
+
W && W().catch(() => {});
|
|
69
|
+
}, [W]);
|
|
70
|
+
let { result: pe, loading: G, error: K, initStaleForToken: me, initReplacementPending: he, refetch: q } = l(T ? null : U, A, R), J = A ? T ?? pe ?? void 0 : void 0, Y = !T && me, X = s(j, Y ? void 0 : J?.organizationId), ge = u({
|
|
71
71
|
organizationId: X,
|
|
72
|
-
cascadeOrgId:
|
|
72
|
+
cascadeOrgId: j,
|
|
73
73
|
ownsFetch: !0,
|
|
74
74
|
parentStatus: "none",
|
|
75
|
-
hasToken: !!
|
|
76
|
-
loading:
|
|
77
|
-
error:
|
|
75
|
+
hasToken: !!A,
|
|
76
|
+
loading: G,
|
|
77
|
+
error: K,
|
|
78
78
|
hasResult: !!J,
|
|
79
|
-
initReplacementPending:
|
|
80
|
-
}),
|
|
81
|
-
hasToken: !!
|
|
82
|
-
loading:
|
|
83
|
-
error:
|
|
79
|
+
initReplacementPending: he
|
|
80
|
+
}), _e = f(() => ie({
|
|
81
|
+
hasToken: !!A,
|
|
82
|
+
loading: G,
|
|
83
|
+
error: K,
|
|
84
84
|
initResponse: J,
|
|
85
85
|
initStaleForToken: Y
|
|
86
86
|
}), [
|
|
87
|
-
|
|
88
|
-
W,
|
|
87
|
+
A,
|
|
89
88
|
G,
|
|
89
|
+
K,
|
|
90
90
|
J,
|
|
91
91
|
Y
|
|
92
92
|
]);
|
|
93
|
-
|
|
94
|
-
let Z =
|
|
95
|
-
enabled:
|
|
93
|
+
ae(_e, A);
|
|
94
|
+
let Z = f(() => ({
|
|
95
|
+
enabled: I,
|
|
96
96
|
organizationId: X,
|
|
97
|
-
rootCorrelationId:
|
|
97
|
+
rootCorrelationId: L
|
|
98
98
|
}), [
|
|
99
|
-
|
|
99
|
+
I,
|
|
100
100
|
X,
|
|
101
|
-
|
|
101
|
+
L
|
|
102
102
|
]);
|
|
103
|
-
|
|
104
|
-
let Q =
|
|
105
|
-
baseUrl:
|
|
106
|
-
widgetToken:
|
|
107
|
-
organizationId:
|
|
108
|
-
configClient:
|
|
109
|
-
gatewayRouting:
|
|
110
|
-
linkComponent:
|
|
111
|
-
uiFramework:
|
|
103
|
+
R.current = Z;
|
|
104
|
+
let Q = f(() => ({
|
|
105
|
+
baseUrl: v,
|
|
106
|
+
widgetToken: y,
|
|
107
|
+
organizationId: b,
|
|
108
|
+
configClient: x,
|
|
109
|
+
gatewayRouting: S,
|
|
110
|
+
linkComponent: C,
|
|
111
|
+
uiFramework: w
|
|
112
112
|
}), [
|
|
113
|
-
g,
|
|
114
|
-
_,
|
|
115
113
|
v,
|
|
116
114
|
y,
|
|
117
115
|
b,
|
|
118
116
|
x,
|
|
119
|
-
S
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
117
|
+
S,
|
|
118
|
+
C,
|
|
119
|
+
w
|
|
120
|
+
]), $ = f(() => ({
|
|
121
|
+
baseUrl: k,
|
|
122
|
+
widgetToken: A,
|
|
123
123
|
organizationId: X,
|
|
124
|
-
configClient:
|
|
125
|
-
gatewayRouting:
|
|
126
|
-
linkComponent:
|
|
127
|
-
uiFramework:
|
|
124
|
+
configClient: M,
|
|
125
|
+
gatewayRouting: N,
|
|
126
|
+
linkComponent: P,
|
|
127
|
+
uiFramework: F,
|
|
128
128
|
initResponse: J
|
|
129
129
|
}), [
|
|
130
|
-
O,
|
|
131
130
|
k,
|
|
131
|
+
A,
|
|
132
132
|
X,
|
|
133
|
-
j,
|
|
134
133
|
M,
|
|
135
134
|
N,
|
|
136
135
|
P,
|
|
136
|
+
F,
|
|
137
137
|
J
|
|
138
|
-
]),
|
|
138
|
+
]), ve = f(() => ({
|
|
139
139
|
resolved: $,
|
|
140
140
|
own: Q,
|
|
141
141
|
refetch: q,
|
|
142
|
-
loading:
|
|
143
|
-
error:
|
|
142
|
+
loading: G,
|
|
143
|
+
error: K,
|
|
144
144
|
analytics: Z,
|
|
145
|
-
cascadeOrgId:
|
|
145
|
+
cascadeOrgId: j,
|
|
146
146
|
initResponseStaleForToken: Y,
|
|
147
|
-
disclosuresAcceptance:
|
|
148
|
-
providerLabels:
|
|
147
|
+
disclosuresAcceptance: E,
|
|
148
|
+
providerLabels: D
|
|
149
149
|
}), [
|
|
150
150
|
$,
|
|
151
151
|
Q,
|
|
152
152
|
q,
|
|
153
|
-
W,
|
|
154
153
|
G,
|
|
154
|
+
K,
|
|
155
155
|
Z,
|
|
156
|
-
|
|
156
|
+
j,
|
|
157
157
|
Y,
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
E,
|
|
159
|
+
D
|
|
160
160
|
]);
|
|
161
|
-
return /* @__PURE__ */
|
|
162
|
-
client:
|
|
163
|
-
children: /* @__PURE__ */
|
|
164
|
-
client:
|
|
161
|
+
return /* @__PURE__ */ g(le, {
|
|
162
|
+
client: z,
|
|
163
|
+
children: /* @__PURE__ */ g(n, {
|
|
164
|
+
client: U,
|
|
165
165
|
organizationId: X,
|
|
166
|
-
widgetToken:
|
|
167
|
-
installClientSecret:
|
|
168
|
-
authEpoch:
|
|
169
|
-
organizationStatus:
|
|
170
|
-
children: /* @__PURE__ */
|
|
171
|
-
value:
|
|
172
|
-
children: /* @__PURE__ */
|
|
173
|
-
linkComponent:
|
|
174
|
-
uiFramework:
|
|
175
|
-
children:
|
|
166
|
+
widgetToken: A,
|
|
167
|
+
installClientSecret: de,
|
|
168
|
+
authEpoch: fe,
|
|
169
|
+
organizationStatus: ge,
|
|
170
|
+
children: /* @__PURE__ */ g(o.Provider, {
|
|
171
|
+
value: ve,
|
|
172
|
+
children: /* @__PURE__ */ g(ee, {
|
|
173
|
+
linkComponent: P,
|
|
174
|
+
uiFramework: F,
|
|
175
|
+
children: _
|
|
176
176
|
})
|
|
177
177
|
})
|
|
178
178
|
})
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
|
-
export {
|
|
181
|
+
export { _ as RootWidgetProvider };
|