@tesouro/embedded-components-react 0.11.64 → 0.11.66

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.
Files changed (48) hide show
  1. package/README.md +14 -14
  2. package/dist/index.css +6 -27
  3. package/dist/index.d.ts +28 -40
  4. package/dist/lib/CounterpartsWidget.d.ts +26 -39
  5. package/dist/lib/CounterpartsWidgetPublic.d.ts +26 -39
  6. package/dist/lib/CustomersWidget.d.ts +26 -39
  7. package/dist/lib/OfferWidget.d.ts +1 -1
  8. package/dist/lib/ReceivablesWidget.d.ts +14 -4
  9. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsContainer.js +8 -12
  10. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsPanel.js +93 -110
  11. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +52 -52
  12. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsActions.js +72 -107
  13. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsSheetView.js +27 -27
  14. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsTable.js +112 -145
  15. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js +13 -16
  16. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +3 -122
  17. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/mocks/labels.js +5 -5
  18. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index.js +1 -1
  19. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +44 -65
  20. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +157 -134
  21. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +18 -14
  22. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index5.js +362 -55
  23. package/dist/libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/OfferWidget/OfferWidget.js +3 -3
  24. package/dist/libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/analytics/events.js +4 -4
  25. package/dist/libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/testIds.js +6 -6
  26. package/dist/libs/tesouro-embedded-components-react/offer-widget/ui/dist/index2.js +1 -1
  27. package/dist/libs/tesouro-embedded-components-react/offer-widget/ui/dist/index3.js +2 -2
  28. package/dist/libs/tesouro-embedded-components-react/offer-widget/ui/dist/index7.js +32 -44
  29. package/dist/libs/tesouro-embedded-components-react/offer-widget/ui/dist/index8.js +14 -23
  30. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +11 -11
  31. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +7 -7
  32. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +16 -9
  33. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useAddressForm.js +2 -66
  34. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useDeleteController.js +48 -46
  35. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +5 -5
  36. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index10.js +138 -149
  37. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index11.js +19 -20
  38. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js +1 -0
  39. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index13.js +21 -27
  40. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +1 -1
  41. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index3.js +0 -1
  42. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index8.js +2 -2
  43. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index9.js +30 -63
  44. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/isDisclosuresAcceptanceRequired.js +1 -1
  45. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  46. package/package.json +1 -1
  47. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index6.js +0 -211
  48. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index7.js +0 -509
@@ -1,66 +1,373 @@
1
- import { Button as e, LABEL_LABELS_EN as t, RequiredFieldsLegend as n, Spinner as r, Typography as i, mergeRequiredFieldsLegendLabels as a } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { CounterpartAddressFields as o } from "../../../shared/counterpart-management/ui/dist/index7.js";
3
- import "../../../shared/counterpart-management/ui/dist/index.js";
4
- import { addressFieldLabels as s } from "./index4.js";
5
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
1
+ import { Badge as e, Button as t, DescriptionList as n, DisplayAmount as r, DropdownMenu as i, DropdownMenuContent as a, DropdownMenuItem as o, DropdownMenuTrigger as s, FormSheet as c, Heading as l, Separator as u, Skeleton as d, Tooltip as f, TooltipContent as p, TooltipProvider as m, TooltipTrigger as h } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { ErrorState as g } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
3
+ import { LoadingRegion as _ } from "../../../shared/ui/dist/lib/LoadingRegion/LoadingRegion.js";
4
+ import "../../../shared/ui/dist/index.js";
5
+ import { COUNTERPART_DETAILS_SHEET_LABELS_EN as v } from "./index2.js";
6
+ import { BILL_STATUS_BADGE_COLOR as y, INVOICE_STATUS_BADGE_COLOR as b } from "./index4.js";
7
+ import { useEffect as x, useState as S } from "react";
8
+ import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
9
+ import { EyeIcon as E, EyeOffIcon as D, MoreVerticalIcon as O } from "lucide-react";
6
10
  // ../../libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index5.js
7
- function u({ form: u, labels: d }) {
8
- let f = {
9
- ...t,
10
- ...u.fieldMarkers
11
- };
12
- return /* @__PURE__ */ l("form", {
13
- className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-[10px] ttw:border ttw:border-border ttw:bg-muted ttw:p-4",
14
- onSubmit: (e) => {
15
- e.preventDefault(), u.onSubmit();
16
- },
17
- children: [/* @__PURE__ */ l("div", {
18
- className: "ttw:flex ttw:flex-col ttw:gap-4",
11
+ var k = "—";
12
+ function A({ label: e, children: n, onClick: r }) {
13
+ return /* @__PURE__ */ T(f, { children: [/* @__PURE__ */ w(h, {
14
+ asChild: !0,
15
+ children: /* @__PURE__ */ w(t, {
16
+ type: "button",
17
+ variant: "ghost",
18
+ size: "icon-sm",
19
+ "aria-label": e,
20
+ onClick: r,
21
+ children: n
22
+ })
23
+ }), /* @__PURE__ */ w(p, { children: e })] });
24
+ }
25
+ function j({ label: e, itemLabel: n, onSelect: r }) {
26
+ return /* @__PURE__ */ T(i, { children: [/* @__PURE__ */ T(f, { children: [/* @__PURE__ */ w(h, {
27
+ asChild: !0,
28
+ children: /* @__PURE__ */ w(s, {
29
+ asChild: !0,
30
+ children: /* @__PURE__ */ w(t, {
31
+ type: "button",
32
+ variant: "ghost",
33
+ size: "icon-sm",
34
+ "aria-label": e,
35
+ children: /* @__PURE__ */ w(O, {})
36
+ })
37
+ })
38
+ }), /* @__PURE__ */ w(p, { children: e })] }), /* @__PURE__ */ w(a, {
39
+ align: "end",
40
+ children: /* @__PURE__ */ w(o, {
41
+ variant: "destructive",
42
+ onClick: r,
43
+ children: n
44
+ })
45
+ })] });
46
+ }
47
+ function M({ label: e, value: t, isLoading: n }) {
48
+ return /* @__PURE__ */ T("div", {
49
+ className: "ttw:flex ttw:flex-col ttw:gap-1",
50
+ children: [/* @__PURE__ */ w("span", {
51
+ className: "ttw:text-sm ttw:text-muted-foreground",
52
+ children: e
53
+ }), n ? /* @__PURE__ */ w(d, { className: "ttw:h-5 ttw:w-24" }) : /* @__PURE__ */ w("span", {
54
+ className: "ttw:text-sm ttw:font-medium ttw:tabular-nums",
55
+ children: t ?? k
56
+ })]
57
+ });
58
+ }
59
+ function N({ mode: e, summary: t, labels: n }) {
60
+ return /* @__PURE__ */ T("div", {
61
+ className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-lg ttw:bg-muted ttw:p-4",
62
+ children: [/* @__PURE__ */ T("div", {
63
+ className: "ttw:flex ttw:flex-col ttw:gap-1",
64
+ children: [/* @__PURE__ */ w("span", {
65
+ className: "ttw:text-sm ttw:text-muted-foreground",
66
+ children: e === "customer" ? n.summaryAmountDue : n.summaryBalanceDue
67
+ }), t?.isPrimaryAmountLoading ? /* @__PURE__ */ w(d, { className: "ttw:h-9 ttw:w-36" }) : /* @__PURE__ */ w(r, { children: t?.primaryAmountLabel ?? k })]
68
+ }), /* @__PURE__ */ T("div", {
69
+ className: "ttw:flex ttw:flex-wrap ttw:gap-x-8 ttw:gap-y-4",
19
70
  children: [
20
- /* @__PURE__ */ c("div", {
21
- className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-3 ttw:border-b ttw:border-border ttw:pt-6 ttw:pb-7",
22
- children: /* @__PURE__ */ c(i, {
23
- variant: "body1",
24
- className: "ttw:font-medium",
25
- children: u.hasExistingAddress ? d.editingAddressHeading : d.addingAddressHeading
26
- })
71
+ /* @__PURE__ */ w(M, {
72
+ label: e === "customer" ? n.summaryInvoiced : n.summaryBilled,
73
+ value: t?.billedAmountLabel,
74
+ isLoading: t?.isBilledAmountLoading
27
75
  }),
28
- /* @__PURE__ */ c(n, { labels: a(f, u.requiredFieldsLegend) }),
29
- u.formError && /* @__PURE__ */ c(i, {
30
- variant: "body2",
31
- color: "destructive",
32
- role: "alert",
33
- children: u.formError
76
+ /* @__PURE__ */ w(M, {
77
+ label: e === "customer" ? n.summaryReceived : n.summaryPaid,
78
+ value: t?.receivedOrPaidAmountLabel,
79
+ isLoading: t?.isReceivedOrPaidAmountLoading
34
80
  }),
35
- /* @__PURE__ */ c(o, {
36
- idPrefix: "counterpart-address-form",
37
- values: u.values,
38
- errors: u.errors,
39
- stateOptions: u.stateOptions,
40
- disabled: u.inProgress,
41
- onChange: u.onChange,
42
- labels: s(d, {
43
- ...f,
44
- ...u.addressFieldMarkers
45
- })
81
+ e === "vendor" && /* @__PURE__ */ w(M, {
82
+ label: n.summaryRejected,
83
+ value: t?.rejectedAmountLabel,
84
+ isLoading: t?.isRejectedAmountLoading
46
85
  })
47
86
  ]
48
- }), /* @__PURE__ */ l("div", {
49
- className: "ttw:flex ttw:justify-end ttw:gap-4 ttw:pt-6",
50
- children: [/* @__PURE__ */ c(e, {
87
+ })]
88
+ });
89
+ }
90
+ function P({ status: t }) {
91
+ let n = t.kind === "bill" ? y[t.tone] : b[t.tone];
92
+ return "tone" in n ? /* @__PURE__ */ w(e, {
93
+ tone: n.tone,
94
+ children: t.label
95
+ }) : /* @__PURE__ */ w(e, {
96
+ accent: n.accent,
97
+ children: t.label
98
+ });
99
+ }
100
+ function F({ mode: n, documents: r, labels: i, onViewAll: a }) {
101
+ if (!r || r.length === 0) return null;
102
+ let o = n === "vendor";
103
+ return /* @__PURE__ */ T("section", {
104
+ className: "ttw:flex ttw:flex-col ttw:gap-3",
105
+ children: [/* @__PURE__ */ T("div", {
106
+ className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-4",
107
+ children: [/* @__PURE__ */ T("div", {
108
+ className: "ttw:flex ttw:flex-col ttw:gap-1",
109
+ children: [/* @__PURE__ */ w(l, {
110
+ variant: "subsection",
111
+ level: 3,
112
+ children: o ? i.recentVendorDocumentsHeading : i.recentCustomerDocumentsHeading
113
+ }), /* @__PURE__ */ w("p", {
114
+ className: "ttw:text-sm ttw:text-muted-foreground",
115
+ children: o ? i.recentVendorDocumentsDescription : i.recentCustomerDocumentsDescription
116
+ })]
117
+ }), a && /* @__PURE__ */ w(t, {
51
118
  type: "button",
52
- variant: "outline",
53
- className: "ttw:w-fit ttw:border-border",
54
- disabled: u.inProgress,
55
- onClick: u.onCancel,
56
- children: d.cancelButton
57
- }), /* @__PURE__ */ l(e, {
58
- type: "submit",
59
- className: "ttw:w-fit",
60
- disabled: u.inProgress || u.submitDisabled,
61
- children: [u.inProgress && /* @__PURE__ */ c(r, {}), d.saveButton]
119
+ variant: "link",
120
+ className: "ttw:h-auto ttw:p-0",
121
+ onClick: a,
122
+ children: i.viewAllDocumentsAction
62
123
  })]
124
+ }), /* @__PURE__ */ w("ul", {
125
+ className: "ttw:flex ttw:flex-col ttw:gap-3",
126
+ children: r.map((t, n) => {
127
+ let a = o && t.isOverdue;
128
+ return /* @__PURE__ */ T("li", {
129
+ className: "ttw:flex ttw:flex-col ttw:gap-3",
130
+ children: [/* @__PURE__ */ T("div", {
131
+ className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-4",
132
+ children: [/* @__PURE__ */ T("div", {
133
+ className: "ttw:flex ttw:flex-col ttw:gap-1",
134
+ children: [/* @__PURE__ */ w("span", {
135
+ className: "ttw:text-sm ttw:font-medium ttw:tabular-nums",
136
+ children: t.amountLabel
137
+ }), /* @__PURE__ */ T("span", {
138
+ className: "ttw:flex ttw:flex-wrap ttw:gap-x-2 ttw:text-sm ttw:text-muted-foreground",
139
+ children: [t.documentNumberLabel && /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("span", { children: t.documentNumberLabel }), /* @__PURE__ */ w("span", {
140
+ "aria-hidden": "true",
141
+ children: "·"
142
+ })] }), /* @__PURE__ */ w("span", { children: t.dateLabel })]
143
+ })]
144
+ }), /* @__PURE__ */ T("div", {
145
+ className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:justify-end ttw:gap-2",
146
+ children: [a && /* @__PURE__ */ w(e, {
147
+ tone: "destructive",
148
+ children: i.overdueTag
149
+ }), /* @__PURE__ */ w(P, { status: t.status })]
150
+ })]
151
+ }), n < r.length - 1 && /* @__PURE__ */ w(u, {})]
152
+ }, t.id);
153
+ })
63
154
  })]
64
155
  });
65
156
  }
66
- export { u as CounterpartAddressForm };
157
+ function I({ paymentMethod: r, canEdit: i, onAddBankAccount: a, onEditBankAccount: o, onDeleteBankAccount: s, labels: c }) {
158
+ return /* @__PURE__ */ T("section", {
159
+ className: "ttw:flex ttw:flex-col ttw:gap-3",
160
+ children: [/* @__PURE__ */ T("div", {
161
+ className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-4",
162
+ children: [/* @__PURE__ */ T("div", {
163
+ className: "ttw:flex ttw:flex-col ttw:gap-1",
164
+ children: [/* @__PURE__ */ w(l, {
165
+ variant: "subsection",
166
+ level: 3,
167
+ children: c.paymentMethodsHeading
168
+ }), /* @__PURE__ */ w("p", {
169
+ className: "ttw:text-sm ttw:text-muted-foreground",
170
+ children: c.paymentMethodsDescription
171
+ })]
172
+ }), i && !r && /* @__PURE__ */ w(t, {
173
+ type: "button",
174
+ variant: "link",
175
+ className: "ttw:h-auto ttw:p-0",
176
+ onClick: a,
177
+ children: c.addPaymentMethodAction
178
+ })]
179
+ }), r ? /* @__PURE__ */ T("div", {
180
+ className: "ttw:flex ttw:flex-col ttw:gap-2 ttw:rounded-lg ttw:bg-muted ttw:p-4",
181
+ children: [/* @__PURE__ */ T("div", {
182
+ className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-3",
183
+ children: [/* @__PURE__ */ T("div", {
184
+ className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-2",
185
+ children: [/* @__PURE__ */ w("span", {
186
+ className: "ttw:text-sm ttw:font-medium",
187
+ children: r.title
188
+ }), r.isIncomplete && /* @__PURE__ */ w(e, {
189
+ tone: "warning",
190
+ children: c.incompletePaymentMethod
191
+ })]
192
+ }), i && /* @__PURE__ */ T("div", {
193
+ className: "ttw:flex ttw:items-center ttw:gap-1",
194
+ children: [/* @__PURE__ */ w(t, {
195
+ type: "button",
196
+ variant: "link",
197
+ className: "ttw:h-auto ttw:px-2 ttw:py-0",
198
+ "aria-label": c.editPaymentMethodAction,
199
+ onClick: () => o?.(r.id),
200
+ children: c.editButton
201
+ }), /* @__PURE__ */ w(j, {
202
+ label: c.paymentMethodActionsMenu,
203
+ itemLabel: c.deletePaymentMethodAction,
204
+ onSelect: () => s?.(r.id)
205
+ })]
206
+ })]
207
+ }), /* @__PURE__ */ w(n, { items: [
208
+ {
209
+ label: c.accountHolderLabel,
210
+ value: r.accountHolderLabel || k
211
+ },
212
+ {
213
+ label: c.accountNumberLabel,
214
+ value: r.accountNumberLabel || k
215
+ },
216
+ {
217
+ label: c.routingNumberLabel,
218
+ value: r.routingNumberLabel || k
219
+ }
220
+ ] })]
221
+ }) : /* @__PURE__ */ w("p", {
222
+ className: "ttw:text-sm ttw:text-muted-foreground",
223
+ children: c.noPaymentMethods
224
+ })]
225
+ });
226
+ }
227
+ function L({ label: e }) {
228
+ return /* @__PURE__ */ T(_, {
229
+ isLoading: !0,
230
+ loadingLabel: e,
231
+ className: "ttw:flex ttw:flex-col ttw:gap-6 ttw:py-5",
232
+ children: [/* @__PURE__ */ w(d, { className: "ttw:h-32 ttw:w-full" }), /* @__PURE__ */ T("div", {
233
+ className: "ttw:flex ttw:flex-col ttw:gap-3",
234
+ children: [
235
+ /* @__PURE__ */ w(d, { className: "ttw:h-5 ttw:w-40" }),
236
+ /* @__PURE__ */ w(d, { className: "ttw:h-5 ttw:w-full" }),
237
+ /* @__PURE__ */ w(d, { className: "ttw:h-5 ttw:w-full" }),
238
+ /* @__PURE__ */ w(d, { className: "ttw:h-5 ttw:w-full" })
239
+ ]
240
+ })]
241
+ });
242
+ }
243
+ function R({ open: e, onOpenChange: r, privacyResetKey: i, mode: a = "customer", counterpart: o, isLoading: s, isError: u, canEdit: d = !0, canEditProfile: f = d, canEditPaymentMethod: p = d, canDelete: h = !0, onEdit: _, onDelete: y, onAddBankAccount: b, onEditBankAccount: O, onDeleteBankAccount: M, onViewAllDocuments: P, onCreateDocument: R, labels: z }) {
244
+ let B = {
245
+ ...v,
246
+ ...z
247
+ }, [V, H] = S(null), U = [
248
+ i ?? o?.name ?? "",
249
+ o?.taxId ?? "",
250
+ o?.taxIdMasked ?? ""
251
+ ].join(":"), W = e && !!o?.taxId && V === U;
252
+ x(() => {
253
+ e || H(null);
254
+ }, [e]);
255
+ let G = a === "vendor", K = G ? B.vendorDetailsHeading : B.customerDetailsHeading, q = (e) => {
256
+ e || H(null), r(e);
257
+ };
258
+ if (u) return /* @__PURE__ */ w(c, {
259
+ open: e,
260
+ onOpenChange: q,
261
+ title: K,
262
+ labels: { close: B.closeAction },
263
+ children: /* @__PURE__ */ w(g, {
264
+ title: G ? B.notFoundVendorTitle : B.notFoundCustomerTitle,
265
+ description: G ? B.notFoundVendorDescription : B.notFoundCustomerDescription
266
+ })
267
+ });
268
+ let J = s || !o, Y = W ? o?.taxId ?? k : o?.taxIdMasked || o?.taxId || k, X = o?.taxIdHelpText ?? (G ? B.vendorTaxIdHelp : B.customerTaxIdHelp), Z = o ? [
269
+ {
270
+ label: B.rowType,
271
+ value: o.entityTypeLabel ?? k
272
+ },
273
+ {
274
+ label: B.rowName,
275
+ value: o.name
276
+ },
277
+ {
278
+ label: B.rowEmail,
279
+ value: o.email || k
280
+ },
281
+ ...G ? [] : [{
282
+ label: B.rowPaymentReminders,
283
+ value: o.remindersLabel ?? k
284
+ }],
285
+ {
286
+ label: B.rowPhone,
287
+ value: o.phone || k
288
+ },
289
+ {
290
+ label: o.entityType === "individual" ? B.rowTaxIdSsn : B.rowTaxIdEin,
291
+ value: /* @__PURE__ */ T("div", {
292
+ className: "ttw:flex ttw:flex-col ttw:gap-1",
293
+ children: [/* @__PURE__ */ T("div", {
294
+ className: "ttw:flex ttw:items-center ttw:gap-1",
295
+ children: [/* @__PURE__ */ w("span", { children: Y }), o.taxId && /* @__PURE__ */ w(A, {
296
+ label: W ? B.hideTaxId : B.showTaxId,
297
+ onClick: () => H((e) => e === U ? null : U),
298
+ children: w(W ? D : E, {})
299
+ })]
300
+ }), X && /* @__PURE__ */ w("span", {
301
+ className: "ttw:text-sm ttw:font-normal ttw:text-muted-foreground",
302
+ children: X
303
+ })]
304
+ })
305
+ },
306
+ {
307
+ label: B.addressHeading,
308
+ value: o.addressLines.length > 0 ? /* @__PURE__ */ w("address", {
309
+ className: "ttw:flex ttw:flex-col ttw:not-italic",
310
+ children: o.addressLines.map((e) => /* @__PURE__ */ w("span", { children: e }, e))
311
+ }) : /* @__PURE__ */ w("span", {
312
+ className: "ttw:font-normal ttw:text-muted-foreground",
313
+ children: B.noAddress
314
+ })
315
+ }
316
+ ] : [];
317
+ return /* @__PURE__ */ w(m, { children: /* @__PURE__ */ w(c, {
318
+ open: e,
319
+ onOpenChange: q,
320
+ title: J ? K : o.name,
321
+ description: J ? void 0 : o.subtitle,
322
+ labels: { close: B.closeAction },
323
+ headerActions: J ? void 0 : /* @__PURE__ */ T(C, { children: [f && /* @__PURE__ */ w(t, {
324
+ type: "button",
325
+ variant: "ghost",
326
+ size: "sm",
327
+ onClick: _,
328
+ children: B.editButton
329
+ }), h && /* @__PURE__ */ w(j, {
330
+ label: B.openActionsMenu,
331
+ itemLabel: G ? B.deleteVendorAction : B.deleteCustomerAction,
332
+ onSelect: y
333
+ })] }),
334
+ primaryAction: R && !J ? /* @__PURE__ */ w(t, {
335
+ type: "button",
336
+ onClick: R,
337
+ children: G ? B.sendPaymentAction : B.issueInvoiceAction
338
+ }) : void 0,
339
+ children: J ? /* @__PURE__ */ w(L, { label: B.loadingTitle }) : /* @__PURE__ */ T("div", {
340
+ className: "ttw:flex ttw:flex-col ttw:gap-6 ttw:py-5",
341
+ children: [
342
+ /* @__PURE__ */ w(N, {
343
+ mode: a,
344
+ summary: o.summary,
345
+ labels: B
346
+ }),
347
+ /* @__PURE__ */ w(F, {
348
+ mode: a,
349
+ documents: o.recentDocuments,
350
+ labels: B,
351
+ onViewAll: P
352
+ }),
353
+ /* @__PURE__ */ T("section", {
354
+ className: "ttw:flex ttw:flex-col ttw:gap-1",
355
+ children: [/* @__PURE__ */ w(l, {
356
+ variant: "subsection",
357
+ level: 3,
358
+ children: K
359
+ }), /* @__PURE__ */ w(n, { items: Z })]
360
+ }),
361
+ G && /* @__PURE__ */ w(I, {
362
+ paymentMethod: o.paymentMethod,
363
+ canEdit: p,
364
+ onAddBankAccount: b,
365
+ onEditBankAccount: O,
366
+ onDeleteBankAccount: M,
367
+ labels: B
368
+ })
369
+ ]
370
+ })
371
+ }) });
372
+ }
373
+ export { R as CounterpartDetailsSheet, R as default };
@@ -31,11 +31,11 @@ var C = 2 ** 31 - 1, w = /* @__PURE__ */ new Set([
31
31
  [d.DeniedByYou]: "deniedByYou",
32
32
  [d.DeniedByOther]: "deniedByOther"
33
33
  }, E = {
34
- [d.DraftStartedByOther]: h.Brand,
34
+ [d.DraftStartedByOther]: h.Info,
35
35
  [d.SubmittedByYou]: h.Warning,
36
36
  [d.SubmittedByOther]: h.Warning,
37
- [d.DeniedByYou]: h.Danger,
38
- [d.DeniedByOther]: h.Danger
37
+ [d.DeniedByYou]: h.Destructive,
38
+ [d.DeniedByOther]: h.Destructive
39
39
  };
40
40
  function D(e) {
41
41
  return e in T;
@@ -1,7 +1,7 @@
1
1
  // ../../libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/analytics/events.js
2
2
  var e = {
3
- Mounted: "marketing.mounted",
4
- OpenModal: "marketing.open_modal",
5
- PrimaryCta: "marketing.primary_cta"
6
- }, t = "marketing";
3
+ Mounted: "offer.mounted",
4
+ OpenModal: "offer.open_modal",
5
+ PrimaryCta: "offer.primary_cta"
6
+ }, t = "offer";
7
7
  export { e as OfferWidgetAnalyticsEvent, t as WIDGET_NAME };
@@ -1,10 +1,10 @@
1
1
  // ../../libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/testIds.js
2
2
  var e = {
3
- root: "marketing-widget",
4
- learnMoreButton: "marketing-widget-learn-more-button",
5
- applyNowButton: "marketing-widget-apply-now-button",
6
- statusMessage: "marketing-widget-status-message",
7
- modal: "marketing-widget-modal",
8
- primaryCtaButton: "marketing-widget-primary-cta-button"
3
+ root: "offer-widget",
4
+ learnMoreButton: "offer-widget-learn-more-button",
5
+ applyNowButton: "offer-widget-apply-now-button",
6
+ statusMessage: "offer-widget-status-message",
7
+ modal: "offer-widget-modal",
8
+ primaryCtaButton: "offer-widget-primary-cta-button"
9
9
  };
10
10
  export { e as offerWidgetTestIds };
@@ -3,7 +3,7 @@ var e = {
3
3
  applyNow: "Apply now",
4
4
  learnMore: "Learn more",
5
5
  primaryCta: "Start application",
6
- primaryCtaSubtext: "takes about 5 minutes",
6
+ primaryCtaSubtext: "Takes 5 minutes",
7
7
  dismissModalAriaLabel: "Close offer modal"
8
8
  };
9
9
  export { e as OFFER_WIDGET_LABELS_EN };
@@ -6,8 +6,8 @@ var e = {
6
6
  Dollar: "dollar",
7
7
  Card: "card"
8
8
  }, t = {
9
- Brand: "brand",
9
+ Info: "info",
10
10
  Warning: "warning",
11
- Danger: "danger"
11
+ Destructive: "destructive"
12
12
  };
13
13
  export { e as OfferBenefitIcon, t as OfferWidgetStatusTone };
@@ -3,28 +3,28 @@ import { OFFER_WIDGET_LABELS_EN as a } from "./index2.js";
3
3
  import { OfferBenefitItem as o } from "./index5.js";
4
4
  import { OfferWidgetHowItWorks as s } from "./index6.js";
5
5
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
6
- import { ArrowRight as u, X as d } from "lucide-react";
6
+ import { X as u } from "lucide-react";
7
7
  // ../../libs/tesouro-embedded-components-react/offer-widget/ui/dist/index7.js
8
- function f({ open: f, vspLogo: p, providedByCaption: m, primaryModalHeader: h, howItWorksHeader: g, howItWorksSteps: _, fromDayOneHeader: v, benefits: y, onClose: b, onPrimaryCtaClick: x, labels: S, testIds: C }) {
9
- let w = {
8
+ function d({ open: d, vspLogo: f, providedByCaption: p, primaryModalHeader: m, howItWorksHeader: h, howItWorksSteps: g, fromDayOneHeader: _, benefits: v, onClose: y, onPrimaryCtaClick: b, labels: x, testIds: S }) {
9
+ let C = {
10
10
  ...a,
11
- ...S
11
+ ...x
12
12
  };
13
13
  return /* @__PURE__ */ c(t, {
14
- open: f,
14
+ open: d,
15
15
  onOpenChange: (e) => {
16
- e || b();
16
+ e || y();
17
17
  },
18
18
  children: /* @__PURE__ */ l(r, {
19
- "data-testid": C?.root,
19
+ "data-testid": S?.root,
20
20
  showCloseButton: !1,
21
21
  className: "ttw:max-h-[90vh] ttw:max-w-[500px] ttw:gap-0 ttw:overflow-y-auto ttw:p-6",
22
22
  children: [
23
23
  /* @__PURE__ */ c(n, {
24
24
  className: "ttw:absolute ttw:right-4 ttw:top-4 ttw:cursor-pointer ttw:rounded-sm ttw:text-muted-foreground ttw:opacity-70 ttw:ring-offset-background ttw:transition-opacity ttw:hover:opacity-100 ttw:focus:outline-hidden ttw:focus:ring-2 ttw:focus:ring-ring ttw:focus:ring-offset-2",
25
- onClick: b,
26
- "aria-label": w.dismissModalAriaLabel,
27
- children: /* @__PURE__ */ c(d, {
25
+ onClick: y,
26
+ "aria-label": C.dismissModalAriaLabel,
27
+ children: /* @__PURE__ */ c(u, {
28
28
  className: "ttw:size-5",
29
29
  "aria-hidden": !0
30
30
  })
@@ -32,66 +32,54 @@ function f({ open: f, vspLogo: p, providedByCaption: m, primaryModalHeader: h, h
32
32
  /* @__PURE__ */ l("div", {
33
33
  className: "ttw:mb-6 ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-3",
34
34
  children: [/* @__PURE__ */ c("img", {
35
- src: p.src,
36
- alt: p.alt,
35
+ src: f.src,
36
+ alt: f.alt,
37
37
  height: 40,
38
- width: p.width,
38
+ width: f.width,
39
39
  className: "ttw:h-10 ttw:w-auto ttw:max-w-[120px] ttw:object-contain"
40
40
  }), /* @__PURE__ */ l("div", {
41
41
  className: "ttw:min-w-0",
42
42
  children: [/* @__PURE__ */ c(i, {
43
43
  className: "ttw:text-lg ttw:font-semibold ttw:leading-tight",
44
- children: h
44
+ children: m
45
45
  }), /* @__PURE__ */ c("p", {
46
46
  className: "ttw:text-sm ttw:text-muted-foreground",
47
- children: m
47
+ children: p
48
48
  })]
49
49
  })]
50
50
  }),
51
51
  /* @__PURE__ */ c(s, {
52
- header: g,
53
- steps: _
52
+ header: h,
53
+ steps: g
54
54
  }),
55
- y.length === 0 ? null : /* @__PURE__ */ l("div", {
55
+ v.length === 0 ? null : /* @__PURE__ */ l("div", {
56
56
  className: "ttw:mb-6 ttw:rounded-lg ttw:bg-muted ttw:p-[18px]",
57
57
  children: [/* @__PURE__ */ c("p", {
58
58
  className: "ttw:mb-3 ttw:text-xs ttw:font-semibold ttw:uppercase ttw:tracking-wide ttw:text-muted-foreground",
59
- children: v
59
+ children: _
60
60
  }), /* @__PURE__ */ c("div", {
61
61
  className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
62
- children: y.map((e) => /* @__PURE__ */ c(o, {
62
+ children: v.map((e) => /* @__PURE__ */ c(o, {
63
63
  text: e.text,
64
64
  icon: e.icon
65
65
  }, e.text))
66
66
  })]
67
67
  }),
68
- /* @__PURE__ */ c("div", {
69
- className: "ttw:flex ttw:justify-center",
70
- children: /* @__PURE__ */ c(e, {
68
+ /* @__PURE__ */ l("div", {
69
+ className: "ttw:flex ttw:flex-col ttw:items-center ttw:gap-2",
70
+ children: [/* @__PURE__ */ c(e, {
71
71
  type: "button",
72
- onClick: x,
73
- className: "ttw:h-auto ttw:w-full ttw:py-3",
74
- "data-testid": C?.primaryCtaButton,
75
- children: /* @__PURE__ */ l("span", {
76
- className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:justify-center ttw:gap-x-2 ttw:whitespace-normal",
77
- children: [/* @__PURE__ */ l("span", {
78
- className: "ttw:flex ttw:items-center ttw:gap-2",
79
- children: [/* @__PURE__ */ c("span", {
80
- className: "ttw:font-semibold",
81
- children: w.primaryCta
82
- }), /* @__PURE__ */ c(u, {
83
- className: "ttw:size-4",
84
- "aria-hidden": !0
85
- })]
86
- }), /* @__PURE__ */ c("span", {
87
- className: "ttw:text-sm ttw:font-normal ttw:opacity-90",
88
- children: w.primaryCtaSubtext
89
- })]
90
- })
91
- })
72
+ onClick: b,
73
+ className: "ttw:w-full",
74
+ "data-testid": S?.primaryCtaButton,
75
+ children: C.primaryCta
76
+ }), /* @__PURE__ */ c("p", {
77
+ className: "ttw:text-sm ttw:text-muted-foreground",
78
+ children: C.primaryCtaSubtext
79
+ })]
92
80
  })
93
81
  ]
94
82
  })
95
83
  });
96
84
  }
97
- export { f as OfferWidgetModal };
85
+ export { d as OfferWidgetModal };