@tesouro/embedded-components-react 0.5.197 → 0.5.200

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 (22) hide show
  1. package/dist/index.d.ts +9 -1
  2. package/dist/lib/ReceivablesWidget.d.ts +9 -1
  3. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/data-access/dist/index.js +4 -3
  4. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index5.js +78 -77
  5. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index25.js +258 -257
  6. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +4 -4
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index6.js +8 -4
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +4 -4
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +62 -380
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +369 -89
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +73 -60
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +80 -331
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +344 -0
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +10 -2
  15. package/dist/libs/tesouro-embedded-components-react/shared/bank-disclosures/feature/dist/lib/BankDisclosuresWidget/collectDisclosureDocuments.js +3 -4
  16. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +6 -5
  17. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/disclosures/personDisclosure.js +6 -0
  18. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/disclosures/useAcceptWidgetDisclosures.js +20 -19
  19. package/dist/libs/tesouro-embedded-components-react/shared/data-access-mocks/dist/lib/fixtures.js +27 -11
  20. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  21. package/dist/packages/shared-ui-shadcn/dist/index.js +1263 -1256
  22. package/package.json +1 -1
@@ -16,10 +16,10 @@ import "../../../shared/product-catalog/feature/dist/index.js";
16
16
  import { useReceivablesWidget as l } from "./index12.js";
17
17
  import { ReceivableActionDialog as u } from "../../ui/dist/index3.js";
18
18
  import { ReceivableDetailsSheet as d } from "../../ui/dist/index12.js";
19
- import { ReceivableFormSheet as f } from "../../ui/dist/index13.js";
20
- import { ReceivablePaymentDialog as p } from "../../ui/dist/index14.js";
21
- import { ReceivableSendDialog as m } from "../../ui/dist/index15.js";
22
- import { ReceivablesScreen as h } from "../../ui/dist/index16.js";
19
+ import { ReceivableFormSheet as f } from "../../ui/dist/index14.js";
20
+ import { ReceivablePaymentDialog as p } from "../../ui/dist/index15.js";
21
+ import { ReceivableSendDialog as m } from "../../ui/dist/index16.js";
22
+ import { ReceivablesScreen as h } from "../../ui/dist/index17.js";
23
23
  import "../../ui/dist/index.js";
24
24
  import { useEffect as g, useState as _ } from "react";
25
25
  import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
@@ -21,7 +21,8 @@ function d() {
21
21
  currency: "USD",
22
22
  issueDate: (/* @__PURE__ */ new Date()).toISOString().slice(0, 10),
23
23
  dueDate: "",
24
- memo: "",
24
+ openingNote: "",
25
+ closingNote: "",
25
26
  paymentTermsId: "",
26
27
  lineItems: [n()]
27
28
  };
@@ -261,7 +262,8 @@ function k({ values: e, billingAddressId: t, unitNamesById: n }) {
261
262
  counterpart_id: e.customerId,
262
263
  currency: e.currency,
263
264
  line_items: a,
264
- memo: e.memo || void 0
265
+ memo: e.openingNote,
266
+ footer: e.closingNote
265
267
  };
266
268
  return e.type === "quote" ? {
267
269
  ...o,
@@ -287,7 +289,8 @@ function A(e, t) {
287
289
  currency: e.currency,
288
290
  issueDate: N(e.issue_date),
289
291
  dueDate: N(e.type === "quote" ? e.expiry_date : e.due_date),
290
- memo: e.memo ?? "",
292
+ openingNote: e.memo ?? "",
293
+ closingNote: e.footer ?? "",
291
294
  paymentTermsId: i,
292
295
  lineItems: a.length > 0 ? a : [n(e.currency)]
293
296
  };
@@ -298,7 +301,8 @@ function j({ values: e, billingAddressId: t, lineItemChanges: n }) {
298
301
  counterpart_id: e.customerId,
299
302
  currency: e.currency,
300
303
  issue_date: e.issueDate || void 0,
301
- memo: e.memo || void 0
304
+ memo: e.openingNote,
305
+ footer: e.closingNote
302
306
  };
303
307
  return e.type === "quote" ? { quote: {
304
308
  ...r,
@@ -4,8 +4,8 @@ import "./index4.js";
4
4
  import "./index10.js";
5
5
  import "./index11.js";
6
6
  import { ReceivableDetailsSheet as t } from "./index12.js";
7
- import { ReceivableFormSheet as n } from "./index13.js";
8
- import { ReceivablePaymentDialog as r } from "./index14.js";
9
- import { ReceivableSendDialog as i } from "./index15.js";
10
- import { ReceivablesScreen as a } from "./index16.js";
7
+ import { ReceivableFormSheet as n } from "./index14.js";
8
+ import { ReceivablePaymentDialog as r } from "./index15.js";
9
+ import { ReceivableSendDialog as i } from "./index16.js";
10
+ import { ReceivablesScreen as a } from "./index17.js";
11
11
  export { e as ReceivableActionDialog, t as ReceivableDetailsSheet, n as ReceivableFormSheet, r as ReceivablePaymentDialog, i as ReceivableSendDialog, a as ReceivablesScreen };
@@ -1,390 +1,72 @@
1
- import { Alert as e, AlertDescription as t, Button as n, Input as r, InputGroup as i, InputGroupAddon as a, InputGroupInput as o, Label as s, RadioGroup as c, RadioGroupItem as l, Select as u, SelectContent as d, SelectItem as f, SelectTrigger as p, SelectValue as m, Sheet as h, SheetContent as g, SheetDescription as _, SheetFooter as v, SheetHeader as y, SheetTitle as b, Spinner as x, Textarea as S, Typography as C, cn as w } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { RECEIVABLE_FORM_SHEET_LABELS_EN as T } from "./index2.js";
3
- import { useId as E } from "react";
4
- import { jsx as D, jsxs as O } from "react/jsx-runtime";
5
- import { MinusIcon as k, PlusIcon as A, Trash2Icon as j } from "lucide-react";
1
+ import { Field as e, FieldContent as t, FieldDescription as n, FieldError as r, FieldLabel as i, Textarea as a, Typography as o } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
6
3
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js
7
- var M = "__none__", N = "__manage__";
8
- function P({ message: e }) {
9
- return e ? /* @__PURE__ */ D("p", {
10
- className: "ttw:text-sm ttw:text-destructive",
11
- children: e
12
- }) : null;
4
+ function l({ id: l, value: u, error: d, disabled: f, label: p, optionalSuffix: m, placeholder: h, description: g, onChange: _ }) {
5
+ return /* @__PURE__ */ s(e, { children: /* @__PURE__ */ c(t, { children: [
6
+ /* @__PURE__ */ c(i, {
7
+ htmlFor: l,
8
+ className: "ttw:text-nowrap",
9
+ children: [p, /* @__PURE__ */ s(o, {
10
+ variant: "body2",
11
+ component: "span",
12
+ color: "muted",
13
+ className: "ttw:leading-snug",
14
+ children: m
15
+ })]
16
+ }),
17
+ /* @__PURE__ */ s(a, {
18
+ id: l,
19
+ value: u,
20
+ disabled: f,
21
+ placeholder: h,
22
+ className: "ttw:h-26 ttw:resize-none",
23
+ "aria-invalid": !!d,
24
+ onChange: (e) => _(e.target.value)
25
+ }),
26
+ /* @__PURE__ */ s(n, { children: g }),
27
+ /* @__PURE__ */ s(r, { errors: d ? [{ message: d }] : [] })
28
+ ] }) });
13
29
  }
14
- function ee({ formId: e, lineItem: t, errors: r, controls: s, focusOnMount: c, canRemove: l, unitOptions: h, currencySymbol: g, labels: _, renderProductSelector: v, onChange: y, onCommit: b, onQuantityStep: x, onManageUnits: S, onRemove: C }) {
15
- let T = `${e}-line-${t.id}`;
16
- return /* @__PURE__ */ O("li", {
17
- className: "ttw:flex ttw:h-9 ttw:items-center ttw:gap-2.5",
30
+ function u({ idPrefix: e, openingNote: t, closingNote: n, openingNoteError: r, closingNoteError: i, disabled: a, onOpeningNoteChange: u, onClosingNoteChange: d, labels: f }) {
31
+ return /* @__PURE__ */ c("div", {
32
+ className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:rounded-xl ttw:border ttw:border-border ttw:p-6",
18
33
  children: [
19
- /* @__PURE__ */ D("div", {
20
- className: "ttw:min-w-30 ttw:flex-1",
21
- children: v(t, {
22
- inputId: `${T}-name`,
23
- invalid: !!r?.name,
24
- focusOnMount: c
25
- })
26
- }),
27
- /* @__PURE__ */ O("div", {
28
- className: w("ttw:flex ttw:h-9 ttw:w-26 ttw:min-w-26 ttw:items-center ttw:rounded-md ttw:border ttw:border-input ttw:shadow-xs", r?.quantity && "ttw:border-destructive"),
29
- children: [
30
- /* @__PURE__ */ D("button", {
31
- type: "button",
32
- "aria-label": _.decreaseQuantityButton,
33
- disabled: s ? !s.canDecreaseQuantity : !1,
34
- className: "ttw:flex ttw:size-6 ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-sm ttw:text-muted-foreground ttw:hover:bg-accent ttw:disabled:pointer-events-none ttw:disabled:opacity-50",
35
- onClick: () => x(-1),
36
- children: /* @__PURE__ */ D(k, { className: "ttw:size-3.5" })
37
- }),
38
- /* @__PURE__ */ D("input", {
39
- id: `${T}-quantity`,
40
- "aria-label": _.quantityLabel,
41
- "aria-invalid": !!r?.quantity || void 0,
42
- type: "text",
43
- inputMode: "decimal",
44
- className: "ttw:h-full ttw:w-full ttw:min-w-0 ttw:bg-transparent ttw:px-0 ttw:text-center ttw:text-sm ttw:outline-none",
45
- value: t.quantity,
46
- onChange: (e) => y({ quantity: e.target.value }),
47
- onBlur: () => b("quantity")
48
- }),
49
- /* @__PURE__ */ D("button", {
50
- type: "button",
51
- "aria-label": _.increaseQuantityButton,
52
- disabled: s ? !s.canIncreaseQuantity : !1,
53
- className: "ttw:flex ttw:size-6 ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-sm ttw:text-muted-foreground ttw:hover:bg-accent ttw:disabled:pointer-events-none ttw:disabled:opacity-50",
54
- onClick: () => x(1),
55
- children: /* @__PURE__ */ D(A, { className: "ttw:size-3.5" })
56
- })
57
- ]
58
- }),
59
- /* @__PURE__ */ O(u, {
60
- value: t.unit || M,
61
- onValueChange: (e) => {
62
- if (e === N) {
63
- S?.();
64
- return;
65
- }
66
- y({ unit: e === M ? "" : e });
67
- },
68
- children: [/* @__PURE__ */ D(p, {
69
- id: `${T}-unit`,
70
- "aria-label": _.unitLabel,
71
- "aria-invalid": !!r?.measureUnit || void 0,
72
- className: "ttw:w-22",
73
- children: /* @__PURE__ */ D(m, {
74
- className: "ttw:truncate",
75
- placeholder: _.unitPlaceholder
76
- })
77
- }), /* @__PURE__ */ O(d, { children: [
78
- S && /* @__PURE__ */ O(f, {
79
- value: N,
80
- className: "ttw:font-semibold ttw:text-primary ttw:hover:text-primary ttw:focus:text-primary",
81
- children: [/* @__PURE__ */ D(A, { className: "ttw:text-primary" }), _.manageUnitsOption]
82
- }),
83
- /* @__PURE__ */ D(f, {
84
- value: M,
85
- children: _.unitNone
86
- }),
87
- h.map((e) => /* @__PURE__ */ D(f, {
88
- value: e.value,
89
- children: e.label
90
- }, e.value))
91
- ] })]
92
- }),
93
- /* @__PURE__ */ O(i, {
94
- className: "ttw:w-full ttw:max-w-41 ttw:min-w-29",
95
- children: [/* @__PURE__ */ D(a, {
96
- align: "inline-start",
97
- children: g
98
- }), /* @__PURE__ */ D(o, {
99
- id: `${T}-price`,
100
- "aria-label": _.priceLabel,
101
- "aria-invalid": !!r?.price || void 0,
102
- "data-has-start-addon": !0,
103
- type: "text",
104
- inputMode: "decimal",
105
- className: "ttw:text-right",
106
- value: t.price,
107
- onChange: (e) => y({ price: e.target.value }),
108
- onBlur: () => b("price")
34
+ /* @__PURE__ */ c("div", {
35
+ className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:pb-4",
36
+ children: [/* @__PURE__ */ s(o, {
37
+ variant: "h4",
38
+ children: f.notesHeading
39
+ }), /* @__PURE__ */ s(o, {
40
+ variant: "body2",
41
+ color: "muted",
42
+ className: "ttw:font-medium",
43
+ children: f.notesDescription
109
44
  })]
110
45
  }),
111
- l && /* @__PURE__ */ D(n, {
112
- type: "button",
113
- variant: "ghost",
114
- size: "sm",
115
- "aria-label": _.removeLineItemButton,
116
- className: "ttw:w-10 ttw:rounded-none ttw:border-l ttw:border-border ttw:pl-4 ttw:text-muted-foreground ttw:hover:bg-transparent ttw:hover:text-destructive ttw:has-[>svg]:pr-0",
117
- onClick: C,
118
- children: /* @__PURE__ */ D(j, {})
46
+ /* @__PURE__ */ s(l, {
47
+ id: `${e}-opening-note`,
48
+ value: t,
49
+ error: r,
50
+ disabled: a,
51
+ label: f.openingNoteLabel,
52
+ optionalSuffix: f.optionalSuffix,
53
+ placeholder: f.openingNotePlaceholder,
54
+ description: f.openingNoteDescription,
55
+ onChange: u
56
+ }),
57
+ /* @__PURE__ */ s(l, {
58
+ id: `${e}-closing-note`,
59
+ value: n,
60
+ error: i,
61
+ disabled: a,
62
+ label: f.closingNoteLabel,
63
+ optionalSuffix: f.optionalSuffix,
64
+ placeholder: f.closingNotePlaceholder,
65
+ description: f.closingNoteDescription,
66
+ onChange: d
119
67
  })
120
68
  ]
121
69
  });
122
70
  }
123
- function F({ open: i, onOpenChange: a, mode: o = "create", values: w, errors: k, currencyOptions: j, paymentTermsOptions: M, unitOptions: N, currencySymbol: F, lineItemControls: I, autoFocusLineItemId: L, lineItemsLoading: R, inProgress: te, customerSelector: z, renderProductSelector: B, onChange: V, onLineItemChange: H, onLineItemCommit: U, onLineItemQuantityStep: W, onManageUnits: G, onAddLineItem: K, onRemoveLineItem: q, onSubmit: J, onCancel: Y, labels: X }) {
124
- let Z = {
125
- ...T,
126
- ...X
127
- }, Q = E(), $ = o === "edit", ne = w.type === "invoice" || o === "edit", re = $ ? "ttw:grid ttw:grid-cols-3 ttw:gap-4" : "ttw:grid ttw:grid-cols-2 ttw:gap-4";
128
- return /* @__PURE__ */ D(h, {
129
- open: i,
130
- onOpenChange: a,
131
- children: /* @__PURE__ */ O(g, {
132
- className: "ttw:w-180 ttw:overflow-y-auto ttw:sm:max-w-180",
133
- children: [
134
- /* @__PURE__ */ O(y, { children: [/* @__PURE__ */ D(b, { children: o === "edit" ? Z.editTitle : Z.createTitle }), /* @__PURE__ */ D(_, {
135
- className: "ttw:sr-only",
136
- children: Z.hiddenDescription
137
- })] }),
138
- /* @__PURE__ */ D("form", {
139
- id: Q,
140
- onSubmit: (e) => {
141
- e.preventDefault(), e.stopPropagation(), J();
142
- },
143
- children: /* @__PURE__ */ O("div", {
144
- className: "ttw:flex ttw:flex-col ttw:gap-5 ttw:px-6 ttw:pb-6",
145
- children: [
146
- k?.form && /* @__PURE__ */ D("p", {
147
- role: "alert",
148
- className: "ttw:rounded-md ttw:bg-destructive/10 ttw:px-3 ttw:py-2 ttw:text-sm ttw:text-destructive",
149
- children: k.form
150
- }),
151
- /* @__PURE__ */ O("div", {
152
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
153
- children: [
154
- /* @__PURE__ */ D(s, { children: Z.documentTypeLabel }),
155
- /* @__PURE__ */ O(c, {
156
- className: "ttw:flex ttw:flex-row ttw:gap-6",
157
- disabled: o === "edit",
158
- value: w.type,
159
- onValueChange: (e) => V({ type: e }),
160
- children: [/* @__PURE__ */ O("div", {
161
- className: "ttw:flex ttw:items-center ttw:gap-2",
162
- children: [/* @__PURE__ */ D(l, {
163
- value: "invoice",
164
- id: `${Q}-invoice`
165
- }), /* @__PURE__ */ D(s, {
166
- htmlFor: `${Q}-invoice`,
167
- children: Z.typeInvoice
168
- })]
169
- }), /* @__PURE__ */ O("div", {
170
- className: "ttw:flex ttw:items-center ttw:gap-2",
171
- children: [/* @__PURE__ */ D(l, {
172
- value: "quote",
173
- id: `${Q}-quote`
174
- }), /* @__PURE__ */ D(s, {
175
- htmlFor: `${Q}-quote`,
176
- children: Z.typeQuote
177
- })]
178
- })]
179
- }),
180
- /* @__PURE__ */ D(P, { message: k?.type })
181
- ]
182
- }),
183
- /* @__PURE__ */ O("div", {
184
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
185
- children: [
186
- /* @__PURE__ */ D(s, { children: Z.customerLabel }),
187
- z,
188
- /* @__PURE__ */ D("p", {
189
- className: "ttw:text-xs ttw:text-muted-foreground",
190
- children: Z.customerHint
191
- }),
192
- /* @__PURE__ */ D(P, { message: k?.customerId })
193
- ]
194
- }),
195
- /* @__PURE__ */ O("div", {
196
- className: re,
197
- children: [
198
- /* @__PURE__ */ O("div", {
199
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
200
- children: [
201
- /* @__PURE__ */ D(s, {
202
- htmlFor: `${Q}-currency`,
203
- children: Z.currencyLabel
204
- }),
205
- /* @__PURE__ */ O(u, {
206
- value: w.currency,
207
- onValueChange: (e) => V({ currency: e }),
208
- children: [/* @__PURE__ */ D(p, {
209
- id: `${Q}-currency`,
210
- children: /* @__PURE__ */ D(m, {})
211
- }), /* @__PURE__ */ D(d, { children: j.map((e) => /* @__PURE__ */ D(f, {
212
- value: e.value,
213
- children: e.label
214
- }, e.value)) })]
215
- }),
216
- /* @__PURE__ */ D(P, { message: k?.currency })
217
- ]
218
- }),
219
- $ && /* @__PURE__ */ O("div", {
220
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
221
- children: [
222
- /* @__PURE__ */ D(s, {
223
- htmlFor: `${Q}-issue-date`,
224
- children: Z.issueDateLabel
225
- }),
226
- /* @__PURE__ */ D(r, {
227
- id: `${Q}-issue-date`,
228
- type: "date",
229
- value: w.issueDate,
230
- onChange: (e) => V({ issueDate: e.target.value })
231
- }),
232
- /* @__PURE__ */ D(P, { message: k?.issueDate })
233
- ]
234
- }),
235
- /* @__PURE__ */ O("div", {
236
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
237
- children: [
238
- /* @__PURE__ */ D(s, {
239
- htmlFor: `${Q}-due-date`,
240
- children: Z.dueDateLabel
241
- }),
242
- /* @__PURE__ */ D(r, {
243
- id: `${Q}-due-date`,
244
- type: "date",
245
- value: w.dueDate,
246
- onChange: (e) => V({ dueDate: e.target.value })
247
- }),
248
- /* @__PURE__ */ D(P, { message: k?.dueDate })
249
- ]
250
- })
251
- ]
252
- }),
253
- ne && /* @__PURE__ */ O("div", {
254
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
255
- children: [
256
- /* @__PURE__ */ D(s, {
257
- htmlFor: `${Q}-payment-terms`,
258
- children: Z.paymentTermsLabel
259
- }),
260
- /* @__PURE__ */ O(u, {
261
- value: w.paymentTermsId || void 0,
262
- onValueChange: (e) => V({ paymentTermsId: e === "__none__" ? "" : e }),
263
- children: [/* @__PURE__ */ D(p, {
264
- id: `${Q}-payment-terms`,
265
- children: /* @__PURE__ */ D(m, { placeholder: Z.paymentTermsPlaceholder })
266
- }), /* @__PURE__ */ O(d, { children: [/* @__PURE__ */ D(f, {
267
- value: "__none__",
268
- children: Z.paymentTermsNone
269
- }), M.map((e) => /* @__PURE__ */ D(f, {
270
- value: e.value,
271
- children: e.label
272
- }, e.value))] })]
273
- }),
274
- /* @__PURE__ */ D(P, { message: k?.paymentTermsId })
275
- ]
276
- }),
277
- /* @__PURE__ */ O("div", {
278
- className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:rounded-xl ttw:border ttw:border-border ttw:p-6",
279
- children: [
280
- /* @__PURE__ */ O("div", {
281
- className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:pb-4",
282
- children: [/* @__PURE__ */ D(C, {
283
- variant: "h4",
284
- children: Z.lineItemsHeading
285
- }), /* @__PURE__ */ D(C, {
286
- variant: "body2",
287
- color: "muted",
288
- className: "ttw:font-medium",
289
- children: Z.lineItemsDescription
290
- })]
291
- }),
292
- k?.lineItemsSummary?.length ? /* @__PURE__ */ D(e, {
293
- variant: "destructive",
294
- className: "ttw:mb-2",
295
- children: /* @__PURE__ */ D(t, { children: /* @__PURE__ */ D("ul", { children: k.lineItemsSummary.map((e) => /* @__PURE__ */ D("li", { children: e }, e)) }) })
296
- }) : null,
297
- /* @__PURE__ */ O("ul", {
298
- className: "ttw:flex ttw:flex-col ttw:gap-2.5",
299
- children: [/* @__PURE__ */ O("li", {
300
- "aria-hidden": !0,
301
- className: "ttw:flex ttw:h-5 ttw:items-center ttw:gap-2.5 ttw:text-sm ttw:leading-5 ttw:font-medium",
302
- children: [
303
- /* @__PURE__ */ D("span", {
304
- className: "ttw:inline-flex ttw:min-w-30 ttw:flex-1 ttw:whitespace-nowrap",
305
- children: Z.productLabel
306
- }),
307
- /* @__PURE__ */ D("span", {
308
- className: "ttw:w-24 ttw:min-w-24",
309
- children: Z.quantityLabel
310
- }),
311
- /* @__PURE__ */ D("span", {
312
- className: "ttw:w-20.5 ttw:min-w-20.5",
313
- children: Z.unitLabel
314
- }),
315
- /* @__PURE__ */ D("span", {
316
- className: "ttw:w-full ttw:max-w-41 ttw:min-w-29",
317
- children: Z.priceLabel
318
- }),
319
- w.lineItems.length > 1 && /* @__PURE__ */ D("span", { className: "ttw:w-10 ttw:min-w-10" })
320
- ]
321
- }), R ? /* @__PURE__ */ D("li", {
322
- className: "ttw:flex ttw:h-9 ttw:items-center ttw:justify-center",
323
- children: /* @__PURE__ */ D(x, { className: "ttw:size-5" })
324
- }) : w.lineItems.map((e) => /* @__PURE__ */ D(ee, {
325
- formId: Q,
326
- lineItem: e,
327
- errors: k?.lineItems?.[e.id],
328
- controls: I?.[e.id],
329
- focusOnMount: e.id === L,
330
- canRemove: w.lineItems.length > 1,
331
- unitOptions: N,
332
- currencySymbol: F,
333
- labels: Z,
334
- renderProductSelector: B,
335
- onChange: (t) => H(e.id, t),
336
- onCommit: (t) => U(e.id, t),
337
- onQuantityStep: (t) => W(e.id, t),
338
- onManageUnits: G,
339
- onRemove: () => q(e.id)
340
- }, e.id))]
341
- }),
342
- /* @__PURE__ */ O(n, {
343
- type: "button",
344
- variant: "ghost",
345
- className: "ttw:w-fit ttw:text-primary ttw:hover:text-primary",
346
- onClick: K,
347
- children: [/* @__PURE__ */ D(A, { className: "ttw:size-5 ttw:text-primary" }), Z.addLineItemButton]
348
- })
349
- ]
350
- }),
351
- /* @__PURE__ */ O("div", {
352
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
353
- children: [
354
- /* @__PURE__ */ D(s, {
355
- htmlFor: `${Q}-memo`,
356
- children: Z.memoLabel
357
- }),
358
- /* @__PURE__ */ D(S, {
359
- id: `${Q}-memo`,
360
- rows: 3,
361
- value: w.memo,
362
- onChange: (e) => V({ memo: e.target.value })
363
- }),
364
- /* @__PURE__ */ D(P, { message: k?.memo })
365
- ]
366
- })
367
- ]
368
- })
369
- }),
370
- /* @__PURE__ */ D(v, { children: /* @__PURE__ */ O("div", {
371
- className: "ttw:flex ttw:justify-end ttw:gap-2",
372
- children: [/* @__PURE__ */ D(n, {
373
- type: "button",
374
- variant: "ghost",
375
- onClick: Y,
376
- children: Z.cancelButton
377
- }), /* @__PURE__ */ D(n, {
378
- type: "submit",
379
- form: Q,
380
- loading: te,
381
- disabled: R,
382
- children: o === "edit" ? Z.updateButton : Z.createButton
383
- })]
384
- }) })
385
- ]
386
- })
387
- });
388
- }
389
71
  //#endregion
390
- export { F as ReceivableFormSheet, F as default };
72
+ export { u as ReceivableNotesSection };