@tesouro/embedded-components-react 0.5.146 → 0.5.147

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 (29) hide show
  1. package/README.md +22 -1
  2. package/dist/index.d.ts +72 -22
  3. package/dist/index.js +38 -36
  4. package/dist/lib/CounterpartsWidget.d.ts +21 -18
  5. package/dist/lib/CounterpartsWidget.js +1 -2
  6. package/dist/lib/CounterpartsWidgetPublic.d.ts +976 -0
  7. package/dist/lib/CounterpartsWidgetPublic.js +10 -0
  8. package/dist/lib/CustomersWidget.d.ts +955 -0
  9. package/dist/lib/CustomersWidget.js +3 -0
  10. package/dist/lib/ReceivablesWidget.d.ts +2 -0
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index90.js +1 -0
  12. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index4.js +98 -89
  13. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index7.js +114 -108
  14. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js +40 -42
  15. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +1 -0
  16. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +90 -76
  17. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +300 -226
  18. package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/index.js +2 -0
  19. package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/index2.js +4 -0
  20. package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/index3.js +45 -0
  21. package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/index4.js +42 -0
  22. package/dist/libs/tesouro-embedded-components-react/customers-widget/feature/dist/index5.js +27 -0
  23. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +11 -12
  24. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +103 -100
  25. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +1 -0
  26. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +9 -9
  27. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index13.js +4 -74
  28. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  29. package/package.json +1 -1
@@ -1,84 +1,85 @@
1
- import { Badge as e, Button as t, DropdownMenu as n, DropdownMenuContent as r, DropdownMenuItem as i, DropdownMenuTrigger as a, RequiredFieldsLegend as o, Separator as s, Sheet as c, SheetContent as l, SheetDescription as ee, SheetHeader as te, SheetTitle as u, Skeleton as d, Typography as f, mergeRequiredFieldsLegendLabels as p } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { EmptyState as ne } from "../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
3
- import { ErrorState as re } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
1
+ import { Badge as e, Button as t, DropdownMenu as n, DropdownMenuContent as r, DropdownMenuItem as i, DropdownMenuTrigger as a, RequiredFieldsLegend as o, Separator as s, Sheet as c, SheetContent as l, SheetDescription as u, SheetHeader as ee, SheetTitle as d, Skeleton as f, Typography as p, mergeRequiredFieldsLegendLabels as m } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { EmptyState as te } from "../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
3
+ import { ErrorState as h } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
4
4
  import "../../../shared/ui/dist/index.js";
5
- import { COUNTERPART_FORM_SHEET_LABELS_EN as m } from "../../../shared/counterpart-management/ui/dist/index2.js";
6
- import { CounterpartFormFields as h } from "../../../shared/counterpart-management/ui/dist/index9.js";
5
+ import { ADDRESS_FORM_SHEET_LABELS_EN as g, COUNTERPART_FORM_SHEET_LABELS_EN as _ } from "../../../shared/counterpart-management/ui/dist/index2.js";
6
+ import { AddressFieldGroup as v } from "../../../shared/counterpart-management/ui/dist/index6.js";
7
+ import { CounterpartFormFields as y } from "../../../shared/counterpart-management/ui/dist/index9.js";
7
8
  import "../../../shared/counterpart-management/ui/dist/index.js";
8
- import { COUNTERPART_DETAILS_SHEET_LABELS_EN as g } from "./index2.js";
9
- import { useEffect as _, useState as v } from "react";
10
- import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
11
- import { EyeIcon as S, EyeOffIcon as C, MoreVerticalIcon as w, PencilIcon as T, PlusIcon as E, Trash2Icon as D, XIcon as ie } from "lucide-react";
9
+ import { COUNTERPART_DETAILS_SHEET_LABELS_EN as b } from "./index2.js";
10
+ import { useEffect as x, useState as ne } from "react";
11
+ import { Fragment as re, jsx as S, jsxs as C } from "react/jsx-runtime";
12
+ import { EyeIcon as ie, EyeOffIcon as w, MoreVerticalIcon as T, PencilIcon as E, PlusIcon as D, Trash2Icon as O, XIcon as k } from "lucide-react";
12
13
  //#region ../../libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js
13
- var O = "-";
14
- function k({ className: e }) {
15
- return /* @__PURE__ */ b(d, { className: e ?? "ttw:h-5 ttw:w-24" });
14
+ var A = "-";
15
+ function j({ className: e }) {
16
+ return /* @__PURE__ */ S(f, { className: e ?? "ttw:h-5 ttw:w-24" });
16
17
  }
17
- function A({ label: e, children: t, isLast: n }) {
18
- return /* @__PURE__ */ x("div", {
19
- className: ["ttw:grid ttw:grid-cols-[180px_1fr] ttw:gap-4 ttw:py-3", n ? "" : "ttw:border-b"].join(" "),
20
- children: [/* @__PURE__ */ b(f, {
18
+ function M({ label: e, children: t, isLast: n }) {
19
+ return /* @__PURE__ */ C("div", {
20
+ className: ["ttw:grid ttw:grid-cols-[180px_1fr] ttw:gap-4 ttw:py-3", n ? "" : "ttw:border-b ttw:border-border"].join(" "),
21
+ children: [/* @__PURE__ */ S(p, {
21
22
  variant: "body2",
22
23
  className: "ttw:text-muted-foreground",
23
24
  children: e
24
- }), /* @__PURE__ */ b("div", {
25
+ }), /* @__PURE__ */ S("div", {
25
26
  className: "ttw:min-w-0 ttw:text-sm",
26
27
  children: t
27
28
  })]
28
29
  });
29
30
  }
30
- function j({ mode: e, summary: t, labels: n }) {
31
+ function N({ mode: e, summary: t, labels: n }) {
31
32
  let r = e === "customer" ? n.summaryReceived : n.summaryPaid;
32
- return /* @__PURE__ */ x("div", {
33
+ return /* @__PURE__ */ C("div", {
33
34
  className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-md ttw:bg-muted ttw:p-5",
34
35
  children: [
35
- /* @__PURE__ */ b(f, {
36
+ /* @__PURE__ */ S(p, {
36
37
  variant: "body2",
37
38
  className: "ttw:text-muted-foreground",
38
39
  children: e === "customer" ? n.summaryAmountDue : n.summaryBalanceDue
39
40
  }),
40
- t?.isPrimaryAmountLoading ? /* @__PURE__ */ b(k, { className: "ttw:h-9 ttw:w-36" }) : /* @__PURE__ */ b(f, {
41
+ t?.isPrimaryAmountLoading ? /* @__PURE__ */ S(j, { className: "ttw:h-9 ttw:w-36" }) : /* @__PURE__ */ S(p, {
41
42
  variant: "h3",
42
43
  className: "ttw:font-semibold",
43
- children: t?.primaryAmountLabel ?? O
44
+ children: t?.primaryAmountLabel ?? A
44
45
  }),
45
- /* @__PURE__ */ x("div", {
46
+ /* @__PURE__ */ C("div", {
46
47
  className: "ttw:flex ttw:gap-8",
47
48
  children: [
48
- /* @__PURE__ */ x("div", {
49
+ /* @__PURE__ */ C("div", {
49
50
  className: "ttw:flex ttw:flex-col ttw:gap-1",
50
- children: [/* @__PURE__ */ b(f, {
51
+ children: [/* @__PURE__ */ S(p, {
51
52
  variant: "caption",
52
53
  className: "ttw:text-muted-foreground",
53
54
  children: n.summaryBilled
54
- }), t?.isBilledAmountLoading ? /* @__PURE__ */ b(k, {}) : /* @__PURE__ */ b(f, {
55
+ }), t?.isBilledAmountLoading ? /* @__PURE__ */ S(j, {}) : /* @__PURE__ */ S(p, {
55
56
  variant: "body1",
56
57
  className: "ttw:font-semibold",
57
- children: t?.billedAmountLabel ?? O
58
+ children: t?.billedAmountLabel ?? A
58
59
  })]
59
60
  }),
60
- /* @__PURE__ */ x("div", {
61
+ /* @__PURE__ */ C("div", {
61
62
  className: "ttw:flex ttw:flex-col ttw:gap-1",
62
- children: [/* @__PURE__ */ b(f, {
63
+ children: [/* @__PURE__ */ S(p, {
63
64
  variant: "caption",
64
65
  className: "ttw:text-muted-foreground",
65
66
  children: r
66
- }), t?.isReceivedOrPaidAmountLoading ? /* @__PURE__ */ b(k, {}) : /* @__PURE__ */ b(f, {
67
+ }), t?.isReceivedOrPaidAmountLoading ? /* @__PURE__ */ S(j, {}) : /* @__PURE__ */ S(p, {
67
68
  variant: "body1",
68
69
  className: "ttw:font-semibold ttw:text-green-600",
69
- children: t?.receivedOrPaidAmountLabel ?? O
70
+ children: t?.receivedOrPaidAmountLabel ?? A
70
71
  })]
71
72
  }),
72
- e === "vendor" && /* @__PURE__ */ x("div", {
73
+ e === "vendor" && /* @__PURE__ */ C("div", {
73
74
  className: "ttw:flex ttw:flex-col ttw:gap-1",
74
- children: [/* @__PURE__ */ b(f, {
75
+ children: [/* @__PURE__ */ S(p, {
75
76
  variant: "caption",
76
77
  className: "ttw:text-muted-foreground",
77
78
  children: n.summaryRejected
78
- }), t?.isRejectedAmountLoading ? /* @__PURE__ */ b(k, {}) : /* @__PURE__ */ b(f, {
79
+ }), t?.isRejectedAmountLoading ? /* @__PURE__ */ S(j, {}) : /* @__PURE__ */ S(p, {
79
80
  variant: "body1",
80
81
  className: "ttw:font-semibold",
81
- children: t?.rejectedAmountLabel ?? O
82
+ children: t?.rejectedAmountLabel ?? A
82
83
  })]
83
84
  })
84
85
  ]
@@ -86,205 +87,276 @@ function j({ mode: e, summary: t, labels: n }) {
86
87
  ]
87
88
  });
88
89
  }
89
- function M({ mode: n, documents: r, labels: i, onViewAll: a }) {
90
+ function P({ mode: n, documents: r, labels: i, onViewAll: a }) {
90
91
  if (!r || r.length === 0) return null;
91
92
  let o = n === "vendor";
92
- return /* @__PURE__ */ x("section", {
93
- className: "ttw:flex ttw:flex-col ttw:border-t ttw:pt-6",
94
- children: [/* @__PURE__ */ x("div", {
93
+ return /* @__PURE__ */ C("section", {
94
+ className: "ttw:flex ttw:flex-col ttw:border-t ttw:border-border ttw:pt-6",
95
+ children: [/* @__PURE__ */ C("div", {
95
96
  className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-4 ttw:pb-5",
96
- children: [/* @__PURE__ */ x("div", {
97
+ children: [/* @__PURE__ */ C("div", {
97
98
  className: "ttw:flex ttw:flex-col ttw:gap-1.5",
98
- children: [/* @__PURE__ */ b(f, {
99
+ children: [/* @__PURE__ */ S(p, {
99
100
  variant: "body1",
100
101
  className: "ttw:font-medium",
101
102
  children: n === "customer" ? i.recentCustomerDocumentsHeading : i.recentVendorDocumentsHeading
102
- }), /* @__PURE__ */ b(f, {
103
+ }), /* @__PURE__ */ S(p, {
103
104
  variant: "body2",
104
105
  className: "ttw:text-muted-foreground",
105
106
  children: n === "customer" ? i.recentCustomerDocumentsDescription : i.recentVendorDocumentsDescription
106
107
  })]
107
- }), a && /* @__PURE__ */ b(t, {
108
+ }), a && /* @__PURE__ */ S(t, {
108
109
  variant: "link",
109
110
  className: "ttw:h-auto ttw:p-0",
110
111
  onClick: a,
111
112
  children: i.viewAllDocumentsAction
112
113
  })]
113
- }), /* @__PURE__ */ b("div", {
114
- className: "ttw:flex ttw:flex-col ttw:gap-3 ttw:rounded-md ttw:border ttw:p-4",
114
+ }), /* @__PURE__ */ S("div", {
115
+ className: "ttw:flex ttw:flex-col ttw:gap-3 ttw:rounded-md ttw:border ttw:border-border ttw:p-4",
115
116
  children: r.map((t, n) => {
116
117
  let a = o && t.isOverdue;
117
- return /* @__PURE__ */ x("div", {
118
+ return /* @__PURE__ */ C("div", {
118
119
  className: "ttw:flex ttw:flex-col ttw:gap-3",
119
- children: [/* @__PURE__ */ x("div", {
120
+ children: [/* @__PURE__ */ C("div", {
120
121
  className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-4",
121
- children: [/* @__PURE__ */ x("div", {
122
+ children: [/* @__PURE__ */ C("div", {
122
123
  className: "ttw:flex ttw:flex-col ttw:gap-1",
123
- children: [/* @__PURE__ */ b(f, {
124
+ children: [/* @__PURE__ */ S(p, {
124
125
  variant: "h6",
125
126
  className: "ttw:font-medium",
126
127
  children: t.amountLabel
127
- }), /* @__PURE__ */ b(f, {
128
+ }), /* @__PURE__ */ S(p, {
128
129
  variant: "body2",
129
130
  className: a ? "ttw:text-destructive" : "ttw:text-muted-foreground",
130
131
  children: t.dateLabel
131
132
  })]
132
- }), /* @__PURE__ */ x("div", {
133
+ }), /* @__PURE__ */ C("div", {
133
134
  className: "ttw:flex ttw:items-center ttw:gap-2",
134
- children: [a && /* @__PURE__ */ b(e, {
135
+ children: [a && /* @__PURE__ */ S(e, {
135
136
  variant: "destructive",
136
137
  children: i.overdueTag
137
- }), /* @__PURE__ */ b(e, {
138
+ }), /* @__PURE__ */ S(e, {
138
139
  variant: t.statusTone ?? "outline",
139
140
  children: t.statusLabel
140
141
  })]
141
142
  })]
142
- }), n < r.length - 1 && /* @__PURE__ */ b(s, {})]
143
+ }), n < r.length - 1 && /* @__PURE__ */ S(s, {})]
143
144
  }, t.id);
144
145
  })
145
146
  })]
146
147
  });
147
148
  }
148
- function N({ mode: e, addressLines: n, canEdit: r, onEditAddress: i, onAddAddress: a, labels: o }) {
149
- let s = n.length > 0;
150
- return /* @__PURE__ */ x("section", {
151
- className: e === "customer" ? "ttw:flex ttw:flex-col ttw:gap-3 ttw:border-t ttw:pt-6" : "ttw:flex ttw:flex-col",
152
- children: [e === "customer" && /* @__PURE__ */ x("div", {
153
- className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-3",
154
- children: [/* @__PURE__ */ x("div", {
155
- className: "ttw:flex ttw:flex-col ttw:gap-1",
156
- children: [/* @__PURE__ */ b(f, {
157
- variant: "body1",
158
- className: "ttw:font-medium",
159
- children: o.addressHeading
160
- }), /* @__PURE__ */ b(f, {
161
- variant: "body2",
162
- className: "ttw:text-muted-foreground",
163
- children: o.customerAddressDescription
149
+ function F({ addressForm: e }) {
150
+ let n = {
151
+ ...g.fieldMarkers,
152
+ ...e.labels?.fieldMarkers
153
+ }, r = {
154
+ ...g,
155
+ ...e.labels,
156
+ fieldMarkers: n,
157
+ address: {
158
+ ...g.address,
159
+ ...e.labels?.address,
160
+ fieldMarkers: {
161
+ ...n,
162
+ ...e.labels?.address?.fieldMarkers
163
+ }
164
+ },
165
+ requiredFieldsLegend: m(n, e.labels?.requiredFieldsLegend)
166
+ };
167
+ return /* @__PURE__ */ C("form", {
168
+ className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-md ttw:border ttw:border-border ttw:bg-muted/40 ttw:p-4",
169
+ onSubmit: (t) => {
170
+ t.preventDefault(), e.onSubmit();
171
+ },
172
+ children: [
173
+ /* @__PURE__ */ S(p, {
174
+ variant: "body1",
175
+ className: "ttw:font-medium",
176
+ children: r.title
177
+ }),
178
+ e.formError && /* @__PURE__ */ S("p", {
179
+ role: "alert",
180
+ className: "ttw:rounded-md ttw:bg-destructive/10 ttw:px-3 ttw:py-2 ttw:text-sm ttw:text-destructive",
181
+ children: e.formError
182
+ }),
183
+ /* @__PURE__ */ S(o, { labels: r.requiredFieldsLegend }),
184
+ /* @__PURE__ */ S(v, {
185
+ idPrefix: "address-edit-inline",
186
+ values: e.values,
187
+ errors: e.errors,
188
+ stateOptions: e.stateOptions,
189
+ onChange: e.onChange,
190
+ labels: r.address
191
+ }),
192
+ /* @__PURE__ */ C("div", {
193
+ className: "ttw:flex ttw:justify-end ttw:gap-2",
194
+ children: [/* @__PURE__ */ S(t, {
195
+ type: "button",
196
+ variant: "outline",
197
+ disabled: e.inProgress,
198
+ onClick: e.onCancel,
199
+ children: r.cancelButton
200
+ }), /* @__PURE__ */ S(t, {
201
+ type: "submit",
202
+ disabled: e.inProgress,
203
+ children: r.saveButton
164
204
  })]
165
- }), r && /* @__PURE__ */ x(t, {
166
- type: "button",
167
- variant: "ghost",
168
- size: "sm",
169
- onClick: s ? i : a,
170
- children: [b(s ? T : E, { className: "ttw:size-4" }), s ? o.editAddressAction : o.addAddressAction]
171
- })]
172
- }), s ? /* @__PURE__ */ b("address", {
205
+ })
206
+ ]
207
+ });
208
+ }
209
+ function I({ mode: e, addressLines: n, canEdit: r, onEditAddress: i, onAddAddress: a, labels: o, addressForm: s }) {
210
+ let c = n.length > 0;
211
+ return /* @__PURE__ */ C("section", {
212
+ className: e === "customer" ? "ttw:flex ttw:flex-col ttw:gap-3 ttw:border-t ttw:border-border ttw:pt-6" : "ttw:flex ttw:flex-col",
213
+ children: [e === "customer" && !s && /* @__PURE__ */ C("div", {
214
+ className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-3",
215
+ children: [
216
+ /* @__PURE__ */ C("div", {
217
+ className: "ttw:flex ttw:flex-col ttw:gap-1",
218
+ children: [/* @__PURE__ */ S(p, {
219
+ variant: "body1",
220
+ className: "ttw:font-medium",
221
+ children: o.customerAddressHeading
222
+ }), /* @__PURE__ */ S(p, {
223
+ variant: "body2",
224
+ className: "ttw:text-muted-foreground",
225
+ children: o.customerAddressDescription
226
+ })]
227
+ }),
228
+ r && c && /* @__PURE__ */ S(t, {
229
+ type: "button",
230
+ variant: "link",
231
+ className: "ttw:h-auto ttw:p-0",
232
+ "aria-label": o.editAddressAction,
233
+ onClick: i,
234
+ children: o.editButton
235
+ }),
236
+ r && !c && /* @__PURE__ */ C(t, {
237
+ type: "button",
238
+ variant: "ghost",
239
+ size: "sm",
240
+ onClick: a,
241
+ children: [/* @__PURE__ */ S(D, { className: "ttw:size-4" }), o.addAddressAction]
242
+ })
243
+ ]
244
+ }), s ? /* @__PURE__ */ S(F, { addressForm: s }) : c ? /* @__PURE__ */ S("address", {
173
245
  className: "ttw:flex ttw:flex-col ttw:gap-1 ttw:not-italic ttw:text-sm",
174
- children: n.map((e) => /* @__PURE__ */ b("span", { children: e }, e))
175
- }) : /* @__PURE__ */ b(f, {
246
+ children: n.map((e) => /* @__PURE__ */ S("span", { children: e }, e))
247
+ }) : /* @__PURE__ */ S(p, {
176
248
  variant: "body2",
177
249
  className: "ttw:text-muted-foreground",
178
250
  children: o.noAddress
179
251
  })]
180
252
  });
181
253
  }
182
- function P({ paymentMethod: n, canEdit: r, onAddBankAccount: i, onEditBankAccount: a, onDeleteBankAccount: o, labels: s }) {
183
- return /* @__PURE__ */ x("section", {
184
- className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:border-t ttw:pt-6",
185
- children: [/* @__PURE__ */ x("div", {
254
+ function L({ paymentMethod: n, canEdit: r, onAddBankAccount: i, onEditBankAccount: a, onDeleteBankAccount: o, labels: s }) {
255
+ return /* @__PURE__ */ C("section", {
256
+ className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:border-t ttw:border-border ttw:pt-6",
257
+ children: [/* @__PURE__ */ C("div", {
186
258
  className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-3",
187
- children: [/* @__PURE__ */ x("div", {
259
+ children: [/* @__PURE__ */ C("div", {
188
260
  className: "ttw:flex ttw:flex-col ttw:gap-1",
189
- children: [/* @__PURE__ */ b(f, {
261
+ children: [/* @__PURE__ */ S(p, {
190
262
  variant: "body1",
191
263
  className: "ttw:font-medium",
192
264
  children: s.paymentMethodsHeading
193
- }), /* @__PURE__ */ b(f, {
265
+ }), /* @__PURE__ */ S(p, {
194
266
  variant: "body2",
195
267
  className: "ttw:text-muted-foreground",
196
268
  children: s.paymentMethodsDescription
197
269
  })]
198
- }), r && !n && /* @__PURE__ */ x(t, {
270
+ }), r && !n && /* @__PURE__ */ C(t, {
199
271
  type: "button",
200
272
  variant: "ghost",
201
273
  size: "sm",
202
274
  onClick: i,
203
- children: [/* @__PURE__ */ b(E, { className: "ttw:size-4" }), s.addPaymentMethodAction]
275
+ children: [/* @__PURE__ */ S(D, { className: "ttw:size-4" }), s.addPaymentMethodAction]
204
276
  })]
205
- }), n ? /* @__PURE__ */ x("div", {
206
- className: "ttw:flex ttw:flex-col ttw:gap-3 ttw:rounded-md ttw:border ttw:p-4",
207
- children: [/* @__PURE__ */ x("div", {
277
+ }), n ? /* @__PURE__ */ C("div", {
278
+ className: "ttw:flex ttw:flex-col ttw:gap-3 ttw:rounded-md ttw:border ttw:border-border ttw:p-4",
279
+ children: [/* @__PURE__ */ C("div", {
208
280
  className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-3",
209
- children: [/* @__PURE__ */ x("div", {
281
+ children: [/* @__PURE__ */ C("div", {
210
282
  className: "ttw:flex ttw:flex-col ttw:gap-1",
211
- children: [/* @__PURE__ */ b(f, {
283
+ children: [/* @__PURE__ */ S(p, {
212
284
  variant: "body2",
213
285
  className: "ttw:font-medium",
214
286
  children: n.title
215
- }), n.isIncomplete && /* @__PURE__ */ b(e, {
287
+ }), n.isIncomplete && /* @__PURE__ */ S(e, {
216
288
  variant: "outline",
217
289
  children: s.incompletePaymentMethod
218
290
  })]
219
- }), r && /* @__PURE__ */ x("div", {
291
+ }), r && /* @__PURE__ */ C("div", {
220
292
  className: "ttw:flex ttw:gap-1",
221
- children: [/* @__PURE__ */ b(t, {
293
+ children: [/* @__PURE__ */ S(t, {
222
294
  type: "button",
223
295
  variant: "ghost",
224
296
  size: "icon-sm",
225
297
  "aria-label": s.editPaymentMethodAction,
226
298
  onClick: () => a?.(n.id),
227
- children: /* @__PURE__ */ b(T, { className: "ttw:size-4" })
228
- }), /* @__PURE__ */ b(t, {
299
+ children: /* @__PURE__ */ S(E, { className: "ttw:size-4" })
300
+ }), /* @__PURE__ */ S(t, {
229
301
  type: "button",
230
302
  variant: "ghost",
231
303
  size: "icon-sm",
232
304
  "aria-label": s.deletePaymentMethodAction,
233
305
  onClick: () => o?.(n.id),
234
- children: /* @__PURE__ */ b(D, { className: "ttw:size-4" })
306
+ children: /* @__PURE__ */ S(O, { className: "ttw:size-4" })
235
307
  })]
236
308
  })]
237
- }), /* @__PURE__ */ x("div", {
309
+ }), /* @__PURE__ */ C("div", {
238
310
  className: "ttw:grid ttw:grid-cols-3 ttw:gap-3 ttw:text-sm",
239
311
  children: [
240
- /* @__PURE__ */ x("div", {
312
+ /* @__PURE__ */ C("div", {
241
313
  className: "ttw:flex ttw:flex-col ttw:gap-1",
242
- children: [/* @__PURE__ */ b("span", {
314
+ children: [/* @__PURE__ */ S("span", {
243
315
  className: "ttw:text-muted-foreground",
244
316
  children: s.accountHolderLabel
245
- }), /* @__PURE__ */ b("span", { children: n.accountHolderLabel || O })]
317
+ }), /* @__PURE__ */ S("span", { children: n.accountHolderLabel || A })]
246
318
  }),
247
- /* @__PURE__ */ x("div", {
319
+ /* @__PURE__ */ C("div", {
248
320
  className: "ttw:flex ttw:flex-col ttw:gap-1",
249
- children: [/* @__PURE__ */ b("span", {
321
+ children: [/* @__PURE__ */ S("span", {
250
322
  className: "ttw:text-muted-foreground",
251
323
  children: s.accountNumberLabel
252
- }), /* @__PURE__ */ b("span", { children: n.accountNumberLabel || O })]
324
+ }), /* @__PURE__ */ S("span", { children: n.accountNumberLabel || A })]
253
325
  }),
254
- /* @__PURE__ */ x("div", {
326
+ /* @__PURE__ */ C("div", {
255
327
  className: "ttw:flex ttw:flex-col ttw:gap-1",
256
- children: [/* @__PURE__ */ b("span", {
328
+ children: [/* @__PURE__ */ S("span", {
257
329
  className: "ttw:text-muted-foreground",
258
330
  children: s.routingNumberLabel
259
- }), /* @__PURE__ */ b("span", { children: n.routingNumberLabel || O })]
331
+ }), /* @__PURE__ */ S("span", { children: n.routingNumberLabel || A })]
260
332
  })
261
333
  ]
262
334
  })]
263
- }) : /* @__PURE__ */ b(f, {
335
+ }) : /* @__PURE__ */ S(p, {
264
336
  variant: "body2",
265
337
  className: "ttw:text-muted-foreground",
266
338
  children: s.noPaymentMethods
267
339
  })]
268
340
  });
269
341
  }
270
- function F({ mode: e, form: n }) {
342
+ function R({ mode: e, form: n }) {
271
343
  let r = {
272
- ...m.fieldMarkers,
344
+ ..._.fieldMarkers,
273
345
  ...n.labels?.fieldMarkers
274
- }, i = p(r, n.labels?.requiredFieldsLegend), a = n.labels?.cancelButton ?? m.cancelButton, s = n.labels?.saveButton ?? m.saveButton;
275
- return /* @__PURE__ */ x("form", {
346
+ }, i = m(r, n.labels?.requiredFieldsLegend), a = n.labels?.cancelButton ?? _.cancelButton, s = n.labels?.saveButton ?? _.saveButton;
347
+ return /* @__PURE__ */ C("form", {
276
348
  className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:pt-5",
277
349
  onSubmit: (e) => {
278
350
  e.preventDefault(), n.onSubmit();
279
351
  },
280
352
  children: [
281
- n.errors?.form && /* @__PURE__ */ b(f, {
353
+ n.errors?.form && /* @__PURE__ */ S(p, {
282
354
  variant: "body2",
283
355
  className: "ttw:text-destructive",
284
356
  children: n.errors.form
285
357
  }),
286
- /* @__PURE__ */ b(o, { labels: i }),
287
- /* @__PURE__ */ b(h, {
358
+ /* @__PURE__ */ S(o, { labels: i }),
359
+ /* @__PURE__ */ S(y, {
288
360
  mode: "edit",
289
361
  counterpartMode: e,
290
362
  values: n.values,
@@ -295,15 +367,15 @@ function F({ mode: e, form: n }) {
295
367
  onBankAccountChange: n.onBankAccountChange,
296
368
  labels: n.labels
297
369
  }),
298
- /* @__PURE__ */ x("div", {
299
- className: "ttw:flex ttw:justify-end ttw:gap-2 ttw:border-t ttw:pt-4",
300
- children: [/* @__PURE__ */ b(t, {
370
+ /* @__PURE__ */ C("div", {
371
+ className: "ttw:flex ttw:justify-end ttw:gap-2 ttw:border-t ttw:border-border ttw:pt-4",
372
+ children: [/* @__PURE__ */ S(t, {
301
373
  type: "button",
302
374
  variant: "outline",
303
375
  disabled: n.inProgress,
304
376
  onClick: n.onCancel,
305
377
  children: a
306
- }), /* @__PURE__ */ b(t, {
378
+ }), /* @__PURE__ */ S(t, {
307
379
  type: "submit",
308
380
  disabled: n.inProgress || n.submitDisabled,
309
381
  children: s
@@ -312,212 +384,214 @@ function F({ mode: e, form: n }) {
312
384
  ]
313
385
  });
314
386
  }
315
- function I({ open: e, onOpenChange: o, privacyResetKey: s, mode: d = "customer", counterpart: p, isLoading: m, isError: h, canEdit: E = !0, canDelete: k = !0, onEdit: I, onDelete: L, onClose: R, onEditAddress: z, onAddAddress: B, onAddBankAccount: V, onEditBankAccount: H, onDeleteBankAccount: U, onViewAllDocuments: W, onCreateDocument: G, editForm: K, labels: q }) {
387
+ function z({ open: e, onOpenChange: o, privacyResetKey: s, mode: f = "customer", counterpart: m, isLoading: g, isError: _, canEdit: v = !0, canDelete: y = !0, onEdit: E, onDelete: D, onClose: j, onEditAddress: F, onAddAddress: z, onAddBankAccount: B, onEditBankAccount: V, onDeleteBankAccount: H, onViewAllDocuments: U, onCreateDocument: W, editForm: G, addressForm: K, labels: q }) {
316
388
  let J = {
317
- ...g,
389
+ ...b,
318
390
  ...q
319
- }, [ae, Y] = v(null), X = [
320
- s ?? p?.name ?? "",
321
- p?.taxId ?? "",
322
- p?.taxIdMasked ?? ""
323
- ].join(":"), Z = e && !!p?.taxId && ae === X;
324
- _(() => {
391
+ }, [ae, Y] = ne(null), X = [
392
+ s ?? m?.name ?? "",
393
+ m?.taxId ?? "",
394
+ m?.taxIdMasked ?? ""
395
+ ].join(":"), Z = e && !!m?.taxId && ae === X;
396
+ x(() => {
325
397
  e || Y(null);
326
398
  }, [e]);
327
- let Q = d === "vendor", oe = Z ? p?.taxId ?? O : p?.taxIdMasked || p?.taxId || O, $ = p?.taxIdHelpText ?? (Q ? J.vendorTaxIdHelp : J.customerTaxIdHelp);
328
- return /* @__PURE__ */ b(c, {
399
+ let Q = f === "vendor", oe = Z ? m?.taxId ?? A : m?.taxIdMasked || m?.taxId || A, $ = m?.taxIdHelpText ?? (Q ? J.vendorTaxIdHelp : J.customerTaxIdHelp);
400
+ return /* @__PURE__ */ S(c, {
329
401
  open: e,
330
402
  onOpenChange: (e) => {
331
403
  e || Y(null), o(e);
332
404
  },
333
- children: /* @__PURE__ */ x(l, {
405
+ children: /* @__PURE__ */ C(l, {
334
406
  showCloseButton: !1,
335
407
  className: "ttw:w-160 ttw:sm:max-w-160 ttw:gap-0 ttw:overflow-y-auto",
336
- children: [/* @__PURE__ */ x(te, {
337
- className: "ttw:flex-row ttw:items-start ttw:justify-between ttw:gap-4 ttw:border-b ttw:px-6 ttw:py-6",
338
- children: [/* @__PURE__ */ x("div", {
408
+ children: [/* @__PURE__ */ C(ee, {
409
+ className: "ttw:flex-row ttw:items-start ttw:justify-between ttw:gap-4 ttw:border-b ttw:border-border ttw:px-6 ttw:py-6",
410
+ children: [/* @__PURE__ */ C("div", {
339
411
  className: "ttw:flex ttw:min-w-0 ttw:flex-col ttw:gap-1",
340
- children: [/* @__PURE__ */ b(u, {
412
+ children: [/* @__PURE__ */ S(d, {
341
413
  className: "ttw:truncate ttw:text-2xl",
342
- children: p?.name ?? J.loadingTitle
343
- }), /* @__PURE__ */ b(ee, { children: p?.subtitle ?? J.hiddenDescription })]
344
- }), /* @__PURE__ */ x("div", {
414
+ children: m?.name ?? J.loadingTitle
415
+ }), /* @__PURE__ */ S(u, { children: m?.subtitle ?? J.hiddenDescription })]
416
+ }), /* @__PURE__ */ C("div", {
345
417
  className: "ttw:flex ttw:gap-2",
346
- children: [k && p && /* @__PURE__ */ x(n, { children: [/* @__PURE__ */ b(a, {
418
+ children: [y && m && /* @__PURE__ */ C(n, { children: [/* @__PURE__ */ S(a, {
347
419
  asChild: !0,
348
- children: /* @__PURE__ */ b(t, {
420
+ children: /* @__PURE__ */ S(t, {
349
421
  type: "button",
350
422
  variant: "outline",
351
423
  size: "icon",
352
424
  "aria-label": J.openActionsMenu,
353
- children: /* @__PURE__ */ b(w, { className: "ttw:size-4" })
425
+ children: /* @__PURE__ */ S(T, { className: "ttw:size-4" })
354
426
  })
355
- }), /* @__PURE__ */ b(r, {
427
+ }), /* @__PURE__ */ S(r, {
356
428
  align: "end",
357
- children: /* @__PURE__ */ x(i, {
429
+ children: /* @__PURE__ */ C(i, {
358
430
  variant: "destructive",
359
- onClick: L,
360
- children: [/* @__PURE__ */ b(D, { className: "ttw:size-4" }), Q ? J.deleteVendorAction : J.deleteCustomerAction]
431
+ onClick: D,
432
+ children: [/* @__PURE__ */ S(O, { className: "ttw:size-4" }), Q ? J.deleteVendorAction : J.deleteCustomerAction]
361
433
  })
362
- })] }), /* @__PURE__ */ b(t, {
434
+ })] }), /* @__PURE__ */ S(t, {
363
435
  type: "button",
364
436
  variant: "outline",
365
437
  size: "icon",
366
438
  "aria-label": J.closeAction,
367
439
  onClick: () => {
368
- Y(null), R();
440
+ Y(null), j();
369
441
  },
370
- children: /* @__PURE__ */ b(ie, { className: "ttw:size-4" })
442
+ children: /* @__PURE__ */ S(k, { className: "ttw:size-4" })
371
443
  })]
372
444
  })]
373
- }), h ? /* @__PURE__ */ b("div", {
445
+ }), _ ? /* @__PURE__ */ S("div", {
374
446
  className: "ttw:p-6",
375
- children: /* @__PURE__ */ b(re, {
447
+ children: /* @__PURE__ */ S(h, {
376
448
  title: J.errorTitle,
377
449
  description: J.errorDescription
378
450
  })
379
- }) : m || !p ? /* @__PURE__ */ b("div", {
451
+ }) : g || !m ? /* @__PURE__ */ S("div", {
380
452
  className: "ttw:p-6",
381
- children: /* @__PURE__ */ b(ne, { title: J.loadingTitle })
382
- }) : /* @__PURE__ */ x("main", {
453
+ children: /* @__PURE__ */ S(te, { title: J.loadingTitle })
454
+ }) : /* @__PURE__ */ C("main", {
383
455
  className: "ttw:flex ttw:flex-col ttw:gap-6 ttw:p-6",
384
456
  children: [
385
- /* @__PURE__ */ x("div", {
457
+ /* @__PURE__ */ C("div", {
386
458
  className: "ttw:flex ttw:flex-col ttw:gap-4",
387
- children: [/* @__PURE__ */ b(j, {
388
- mode: d,
389
- summary: p.summary,
459
+ children: [/* @__PURE__ */ S(N, {
460
+ mode: f,
461
+ summary: m.summary,
390
462
  labels: J
391
- }), /* @__PURE__ */ b(t, {
463
+ }), /* @__PURE__ */ S(t, {
392
464
  type: "button",
393
465
  className: "ttw:w-fit",
394
- disabled: !G,
395
- onClick: G,
466
+ disabled: !W,
467
+ onClick: W,
396
468
  children: Q ? J.sendPaymentAction : J.issueInvoiceAction
397
469
  })]
398
470
  }),
399
- /* @__PURE__ */ b(M, {
400
- mode: d,
401
- documents: p.recentDocuments,
471
+ /* @__PURE__ */ S(P, {
472
+ mode: f,
473
+ documents: m.recentDocuments,
402
474
  labels: J,
403
- onViewAll: W
475
+ onViewAll: U
404
476
  }),
405
- K ? /* @__PURE__ */ x("section", {
477
+ G ? /* @__PURE__ */ C("section", {
406
478
  className: "ttw:flex ttw:flex-col",
407
- children: [/* @__PURE__ */ x("div", {
408
- className: "ttw:flex ttw:flex-col ttw:gap-1 ttw:border-b ttw:pb-5",
409
- children: [/* @__PURE__ */ b(f, {
479
+ children: [/* @__PURE__ */ C("div", {
480
+ className: "ttw:flex ttw:flex-col ttw:gap-1 ttw:border-b ttw:border-border ttw:pb-5",
481
+ children: [/* @__PURE__ */ S(p, {
410
482
  variant: "body1",
411
483
  className: "ttw:font-medium",
412
484
  children: Q ? J.vendorDetailsHeading : J.customerDetailsHeading
413
- }), /* @__PURE__ */ b(f, {
485
+ }), /* @__PURE__ */ S(p, {
414
486
  variant: "body2",
415
487
  className: "ttw:text-muted-foreground",
416
488
  children: Q ? J.vendorDetailsDescription : J.customerDetailsDescription
417
489
  })]
418
- }), /* @__PURE__ */ b(F, {
419
- mode: d,
420
- form: K
490
+ }), /* @__PURE__ */ S(R, {
491
+ mode: f,
492
+ form: G
421
493
  })]
422
- }) : /* @__PURE__ */ x(y, { children: [
423
- /* @__PURE__ */ x("section", {
494
+ }) : /* @__PURE__ */ C(re, { children: [
495
+ /* @__PURE__ */ C("section", {
424
496
  className: "ttw:flex ttw:flex-col",
425
497
  children: [
426
- /* @__PURE__ */ x("div", {
427
- className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-3 ttw:border-b ttw:pb-5",
428
- children: [/* @__PURE__ */ x("div", {
498
+ /* @__PURE__ */ C("div", {
499
+ className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-3 ttw:border-b ttw:border-border ttw:pb-5",
500
+ children: [/* @__PURE__ */ C("div", {
429
501
  className: "ttw:flex ttw:flex-col ttw:gap-1",
430
- children: [/* @__PURE__ */ b(f, {
502
+ children: [/* @__PURE__ */ S(p, {
431
503
  variant: "body1",
432
504
  className: "ttw:font-medium",
433
505
  children: Q ? J.vendorDetailsHeading : J.customerDetailsHeading
434
- }), /* @__PURE__ */ b(f, {
506
+ }), /* @__PURE__ */ S(p, {
435
507
  variant: "body2",
436
508
  className: "ttw:text-muted-foreground",
437
509
  children: Q ? J.vendorDetailsDescription : J.customerDetailsDescription
438
510
  })]
439
- }), E && /* @__PURE__ */ x(t, {
511
+ }), v && /* @__PURE__ */ S(t, {
440
512
  type: "button",
441
- variant: "ghost",
442
- size: "sm",
443
- onClick: I,
444
- children: [/* @__PURE__ */ b(T, { className: "ttw:size-4" }), J.editButton]
513
+ variant: "link",
514
+ className: "ttw:h-auto ttw:p-0",
515
+ onClick: E,
516
+ children: J.editButton
445
517
  })]
446
518
  }),
447
- /* @__PURE__ */ b(A, {
519
+ /* @__PURE__ */ S(M, {
448
520
  label: J.rowType,
449
- children: p.entityTypeLabel ?? O
521
+ children: m.entityTypeLabel ?? A
450
522
  }),
451
- /* @__PURE__ */ b(A, {
523
+ /* @__PURE__ */ S(M, {
452
524
  label: J.rowName,
453
- children: p.name
525
+ children: m.name
454
526
  }),
455
- /* @__PURE__ */ b(A, {
527
+ /* @__PURE__ */ S(M, {
456
528
  label: J.rowEmail,
457
- children: p.email || O
529
+ children: m.email || A
458
530
  }),
459
- !Q && /* @__PURE__ */ b(A, {
531
+ !Q && /* @__PURE__ */ S(M, {
460
532
  label: J.rowPaymentReminders,
461
- children: p.remindersLabel ?? O
533
+ children: m.remindersLabel ?? A
462
534
  }),
463
- /* @__PURE__ */ b(A, {
535
+ /* @__PURE__ */ S(M, {
464
536
  label: J.rowPhone,
465
- children: p.phone || O
537
+ children: m.phone || A
466
538
  }),
467
- /* @__PURE__ */ b(A, {
468
- label: p.entityType === "individual" ? J.rowTaxIdSsn : J.rowTaxIdEin,
539
+ /* @__PURE__ */ S(M, {
540
+ label: m.entityType === "individual" ? J.rowTaxIdSsn : J.rowTaxIdEin,
469
541
  isLast: !Q,
470
- children: /* @__PURE__ */ x("div", {
542
+ children: /* @__PURE__ */ C("div", {
471
543
  className: "ttw:flex ttw:flex-col ttw:gap-2",
472
- children: [/* @__PURE__ */ x("div", {
544
+ children: [/* @__PURE__ */ C("div", {
473
545
  className: "ttw:flex ttw:items-center ttw:gap-2",
474
- children: [/* @__PURE__ */ b("span", {
546
+ children: [/* @__PURE__ */ S("span", {
475
547
  className: "ttw:font-medium",
476
548
  children: oe
477
- }), p.taxId && /* @__PURE__ */ x(t, {
549
+ }), m.taxId && /* @__PURE__ */ C(t, {
478
550
  type: "button",
479
551
  variant: "outline",
480
552
  size: "sm",
481
553
  onClick: () => {
482
554
  Y((e) => e === X ? null : X);
483
555
  },
484
- children: [b(Z ? C : S, { className: "ttw:size-4" }), Z ? J.hideTaxId : J.showTaxId]
556
+ children: [S(Z ? w : ie, { className: "ttw:size-4" }), Z ? J.hideTaxId : J.showTaxId]
485
557
  })]
486
- }), $ && /* @__PURE__ */ b(f, {
558
+ }), $ && /* @__PURE__ */ S(p, {
487
559
  variant: "body2",
488
560
  className: "ttw:text-muted-foreground",
489
561
  children: $
490
562
  })]
491
563
  })
492
564
  }),
493
- Q && /* @__PURE__ */ b(A, {
565
+ Q && /* @__PURE__ */ S(M, {
494
566
  label: J.addressHeading,
495
567
  isLast: !0,
496
- children: /* @__PURE__ */ b(N, {
497
- mode: d,
498
- addressLines: p.addressLines,
499
- canEdit: E,
500
- onEditAddress: z,
501
- onAddAddress: B,
502
- labels: J
568
+ children: /* @__PURE__ */ S(I, {
569
+ mode: f,
570
+ addressLines: m.addressLines,
571
+ canEdit: v,
572
+ onEditAddress: F,
573
+ onAddAddress: z,
574
+ labels: J,
575
+ addressForm: K
503
576
  })
504
577
  })
505
578
  ]
506
579
  }),
507
- !Q && /* @__PURE__ */ b(N, {
508
- mode: d,
509
- addressLines: p.addressLines,
510
- canEdit: E,
511
- onEditAddress: z,
512
- onAddAddress: B,
513
- labels: J
580
+ !Q && /* @__PURE__ */ S(I, {
581
+ mode: f,
582
+ addressLines: m.addressLines,
583
+ canEdit: v,
584
+ onEditAddress: F,
585
+ onAddAddress: z,
586
+ labels: J,
587
+ addressForm: K
514
588
  }),
515
- Q && /* @__PURE__ */ b(P, {
516
- paymentMethod: p.paymentMethod,
517
- canEdit: E,
518
- onAddBankAccount: V,
519
- onEditBankAccount: H,
520
- onDeleteBankAccount: U,
589
+ Q && /* @__PURE__ */ S(L, {
590
+ paymentMethod: m.paymentMethod,
591
+ canEdit: v,
592
+ onAddBankAccount: B,
593
+ onEditBankAccount: V,
594
+ onDeleteBankAccount: H,
521
595
  labels: J
522
596
  })
523
597
  ] })
@@ -527,4 +601,4 @@ function I({ open: e, onOpenChange: o, privacyResetKey: s, mode: d = "customer",
527
601
  });
528
602
  }
529
603
  //#endregion
530
- export { I as CounterpartDetailsSheet, I as default };
604
+ export { z as CounterpartDetailsSheet, z as default };