@tesouro/embedded-components-react 0.5.200 → 0.5.201

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