@tesouro/embedded-components-react 0.5.204 → 0.5.206

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 (56) hide show
  1. package/README.md +15 -14
  2. package/dist/index.d.ts +49 -4
  3. package/dist/index.js +1 -1
  4. package/dist/lib/ReceivablesWidget.d.ts +49 -4
  5. package/dist/lib/ReceivablesWidget.js +1 -1
  6. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +7 -7
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index2.js +26 -23
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index3.js +79 -2
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js +88 -193
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index11.js +184 -31
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +32 -145
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +150 -47
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js +37 -293
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +58 -70
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +86 -99
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +48 -233
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +336 -0
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +75 -0
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index20.js +115 -0
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +270 -0
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +1 -1
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +95 -394
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +422 -72
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +15 -10
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +94 -1
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index11.js +3 -4
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +24 -11
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +1 -1
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +3 -264
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +3 -72
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +16 -421
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +1 -106
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +4 -93
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +11 -343
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +5 -159
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +1 -0
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +264 -0
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +72 -0
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +401 -0
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +106 -0
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +93 -0
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +344 -0
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index3.js +182 -32
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +27 -154
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index5.js +203 -20
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +161 -1
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +16 -3
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index8.js +25 -3
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +3 -17
  51. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +38 -38
  52. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +213 -202
  53. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +136 -116
  54. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  55. package/dist/packages/shared-ui-shadcn/dist/index.js +1763 -1749
  56. package/package.json +1 -1
@@ -0,0 +1,401 @@
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 "./index3.js";
3
+ import { ReceivableNotesSection as k } from "./index22.js";
4
+ import { useId as ee } from "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
+ //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js
8
+ var F = "__none__", I = "__manage__";
9
+ function L({ message: e }) {
10
+ return e ? /* @__PURE__ */ A("p", {
11
+ className: "ttw:text-sm ttw:text-destructive",
12
+ children: e
13
+ }) : null;
14
+ }
15
+ function te({ 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
+ let T = `${e}-line-${t.id}`;
17
+ return /* @__PURE__ */ j("li", {
18
+ className: "ttw:flex ttw:h-9 ttw:items-center ttw:gap-2.5",
19
+ children: [
20
+ /* @__PURE__ */ A("div", {
21
+ className: "ttw:min-w-30 ttw:flex-1",
22
+ children: y(t, {
23
+ inputId: `${T}-name`,
24
+ invalid: !!i?.name,
25
+ focusOnMount: o
26
+ })
27
+ }),
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
+ children: [
31
+ /* @__PURE__ */ A("button", {
32
+ type: "button",
33
+ "aria-label": p.decreaseQuantityButton,
34
+ disabled: a ? !a.canDecreaseQuantity : !1,
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: () => S(-1),
37
+ children: /* @__PURE__ */ A(M, { className: "ttw:size-3.5" })
38
+ }),
39
+ /* @__PURE__ */ A("input", {
40
+ id: `${T}-quantity`,
41
+ "aria-label": p.quantityLabel,
42
+ "aria-invalid": !!i?.quantity || void 0,
43
+ type: "text",
44
+ inputMode: "decimal",
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
+ value: t.quantity,
47
+ onChange: (e) => b({ quantity: e.target.value }),
48
+ onBlur: () => x("quantity")
49
+ }),
50
+ /* @__PURE__ */ A("button", {
51
+ type: "button",
52
+ "aria-label": p.increaseQuantityButton,
53
+ disabled: a ? !a.canIncreaseQuantity : !1,
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: () => S(1),
56
+ children: /* @__PURE__ */ A(N, { className: "ttw:size-3.5" })
57
+ })
58
+ ]
59
+ }),
60
+ /* @__PURE__ */ j(m, {
61
+ value: t.unit || F,
62
+ onValueChange: (e) => {
63
+ if (e === I) {
64
+ C?.();
65
+ return;
66
+ }
67
+ b({ unit: e === F ? "" : e });
68
+ },
69
+ children: [/* @__PURE__ */ A(_, {
70
+ id: `${T}-unit`,
71
+ "aria-label": p.unitLabel,
72
+ "aria-invalid": !!i?.measureUnit || void 0,
73
+ className: "ttw:w-22",
74
+ children: /* @__PURE__ */ A(v, {
75
+ className: "ttw:truncate",
76
+ placeholder: p.unitPlaceholder
77
+ })
78
+ }), /* @__PURE__ */ j(h, { children: [
79
+ C && /* @__PURE__ */ j(g, {
80
+ value: I,
81
+ className: "ttw:font-semibold ttw:text-primary ttw:hover:text-primary ttw:focus:text-primary",
82
+ children: [/* @__PURE__ */ A(N, { className: "ttw:text-primary" }), p.manageUnitsOption]
83
+ }),
84
+ /* @__PURE__ */ A(g, {
85
+ value: F,
86
+ children: p.unitNone
87
+ }),
88
+ d.map((e) => /* @__PURE__ */ A(g, {
89
+ value: e.value,
90
+ children: e.label
91
+ }, e.value))
92
+ ] })]
93
+ }),
94
+ /* @__PURE__ */ j(c, {
95
+ className: "ttw:w-full ttw:max-w-41 ttw:min-w-29",
96
+ children: [/* @__PURE__ */ A(l, {
97
+ align: "inline-start",
98
+ children: f
99
+ }), /* @__PURE__ */ A(u, {
100
+ id: `${T}-price`,
101
+ "aria-label": p.priceLabel,
102
+ "aria-invalid": !!i?.price || void 0,
103
+ "data-has-start-addon": !0,
104
+ type: "text",
105
+ inputMode: "decimal",
106
+ className: "ttw:text-right",
107
+ value: t.price,
108
+ onChange: (e) => b({ price: e.target.value }),
109
+ onBlur: () => x("price")
110
+ })]
111
+ }),
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, {
122
+ type: "button",
123
+ variant: "ghost",
124
+ size: "sm",
125
+ "aria-label": p.removeLineItemButton,
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",
127
+ onClick: w,
128
+ children: /* @__PURE__ */ A(P, {})
129
+ })
130
+ ]
131
+ });
132
+ }
133
+ function R({ open: r, onOpenChange: M, mode: P = "create", values: F, errors: I, currencyOptions: R, unitOptions: ne, currencySymbol: re, lineItemControls: z, 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, showDueDateField: X, billingSection: se, bankAccountSection: ce, attachmentsSection: le, cancelDisabled: ue, saveDisabled: de, onSubmit: fe, onCancel: pe, labels: me }) {
134
+ let Z = {
135
+ ...O,
136
+ ...me
137
+ }, Q = ee(), $ = P === "edit", he = D("ttw:grid ttw:gap-4", $ && X ? "ttw:grid-cols-3" : "ttw:grid-cols-2");
138
+ return /* @__PURE__ */ A(y, {
139
+ open: r,
140
+ onOpenChange: M,
141
+ children: /* @__PURE__ */ j(b, {
142
+ className: "ttw:w-180 ttw:overflow-y-auto ttw:sm:max-w-180",
143
+ children: [
144
+ /* @__PURE__ */ j(C, { children: [/* @__PURE__ */ A(w, { children: P === "edit" ? Z.editTitle : Z.createTitle }), /* @__PURE__ */ A(x, {
145
+ className: "ttw:sr-only",
146
+ children: Z.hiddenDescription
147
+ })] }),
148
+ /* @__PURE__ */ A("form", {
149
+ id: Q,
150
+ onSubmit: (e) => {
151
+ e.preventDefault(), e.stopPropagation(), fe();
152
+ },
153
+ children: /* @__PURE__ */ j("div", {
154
+ className: "ttw:flex ttw:flex-col ttw:gap-5 ttw:px-6 ttw:pb-6",
155
+ children: [
156
+ I?.form && /* @__PURE__ */ A("p", {
157
+ role: "alert",
158
+ className: "ttw:rounded-md ttw:bg-destructive/10 ttw:px-3 ttw:py-2 ttw:text-sm ttw:text-destructive",
159
+ children: I.form
160
+ }),
161
+ /* @__PURE__ */ j("div", {
162
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
163
+ children: [
164
+ /* @__PURE__ */ A(d, { children: Z.documentTypeLabel }),
165
+ /* @__PURE__ */ j(f, {
166
+ className: "ttw:flex ttw:flex-row ttw:gap-6",
167
+ disabled: P === "edit",
168
+ value: F.type,
169
+ onValueChange: (e) => G({ type: e }),
170
+ children: [/* @__PURE__ */ j("div", {
171
+ className: "ttw:flex ttw:items-center ttw:gap-2",
172
+ children: [/* @__PURE__ */ A(p, {
173
+ value: "invoice",
174
+ id: `${Q}-invoice`
175
+ }), /* @__PURE__ */ A(d, {
176
+ htmlFor: `${Q}-invoice`,
177
+ children: Z.typeInvoice
178
+ })]
179
+ }), /* @__PURE__ */ j("div", {
180
+ className: "ttw:flex ttw:items-center ttw:gap-2",
181
+ children: [/* @__PURE__ */ A(p, {
182
+ value: "quote",
183
+ id: `${Q}-quote`
184
+ }), /* @__PURE__ */ A(d, {
185
+ htmlFor: `${Q}-quote`,
186
+ children: Z.typeQuote
187
+ })]
188
+ })]
189
+ }),
190
+ /* @__PURE__ */ A(L, { message: I?.type })
191
+ ]
192
+ }),
193
+ /* @__PURE__ */ j("div", {
194
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
195
+ children: [
196
+ /* @__PURE__ */ A(d, { children: Z.customerLabel }),
197
+ U,
198
+ /* @__PURE__ */ A("p", {
199
+ className: "ttw:text-xs ttw:text-muted-foreground",
200
+ children: Z.customerHint
201
+ }),
202
+ /* @__PURE__ */ A(L, { message: I?.customerId })
203
+ ]
204
+ }),
205
+ /* @__PURE__ */ j("div", {
206
+ className: he,
207
+ children: [
208
+ /* @__PURE__ */ j("div", {
209
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
210
+ children: [
211
+ /* @__PURE__ */ A(d, {
212
+ htmlFor: `${Q}-currency`,
213
+ children: Z.currencyLabel
214
+ }),
215
+ /* @__PURE__ */ j(m, {
216
+ value: F.currency,
217
+ onValueChange: (e) => G({ currency: e }),
218
+ children: [/* @__PURE__ */ A(_, {
219
+ id: `${Q}-currency`,
220
+ children: /* @__PURE__ */ A(v, {})
221
+ }), /* @__PURE__ */ A(h, { children: R.map((e) => /* @__PURE__ */ A(g, {
222
+ value: e.value,
223
+ children: e.label
224
+ }, e.value)) })]
225
+ }),
226
+ /* @__PURE__ */ A(L, { message: I?.currency })
227
+ ]
228
+ }),
229
+ $ && /* @__PURE__ */ j("div", {
230
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
231
+ children: [
232
+ /* @__PURE__ */ A(d, {
233
+ htmlFor: `${Q}-issue-date`,
234
+ children: Z.issueDateLabel
235
+ }),
236
+ /* @__PURE__ */ A(s, {
237
+ id: `${Q}-issue-date`,
238
+ type: "date",
239
+ value: F.issueDate,
240
+ onChange: (e) => G({ issueDate: e.target.value })
241
+ }),
242
+ /* @__PURE__ */ A(L, { message: I?.issueDate })
243
+ ]
244
+ }),
245
+ X && /* @__PURE__ */ j("div", {
246
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
247
+ children: [
248
+ /* @__PURE__ */ A(d, {
249
+ htmlFor: `${Q}-due-date`,
250
+ children: Z.dueDateLabel
251
+ }),
252
+ /* @__PURE__ */ A(s, {
253
+ id: `${Q}-due-date`,
254
+ type: "date",
255
+ value: F.dueDate,
256
+ onChange: (e) => G({ dueDate: e.target.value })
257
+ }),
258
+ /* @__PURE__ */ A(L, { message: I?.dueDate })
259
+ ]
260
+ })
261
+ ]
262
+ }),
263
+ se,
264
+ /* @__PURE__ */ j("div", {
265
+ className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:rounded-xl ttw:border ttw:border-border ttw:p-6",
266
+ children: [
267
+ /* @__PURE__ */ j("div", {
268
+ className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:pb-4",
269
+ children: [/* @__PURE__ */ A(E, {
270
+ variant: "h4",
271
+ children: Z.lineItemsHeading
272
+ }), /* @__PURE__ */ A(E, {
273
+ variant: "body2",
274
+ color: "muted",
275
+ className: "ttw:font-medium",
276
+ children: Z.lineItemsDescription
277
+ })]
278
+ }),
279
+ I?.lineItemsSummary?.length ? /* @__PURE__ */ A(e, {
280
+ variant: "destructive",
281
+ className: "ttw:mb-2",
282
+ children: /* @__PURE__ */ A(t, { children: /* @__PURE__ */ A("ul", { children: I.lineItemsSummary.map((e) => /* @__PURE__ */ A("li", { children: e }, e)) }) })
283
+ }) : null,
284
+ /* @__PURE__ */ j("ul", {
285
+ className: "ttw:flex ttw:flex-col ttw:gap-2.5",
286
+ children: [/* @__PURE__ */ j("li", {
287
+ "aria-hidden": !0,
288
+ className: "ttw:flex ttw:h-5 ttw:items-center ttw:gap-2.5 ttw:text-sm ttw:leading-5 ttw:font-medium",
289
+ children: [
290
+ /* @__PURE__ */ A("span", {
291
+ className: "ttw:inline-flex ttw:min-w-30 ttw:flex-1 ttw:whitespace-nowrap",
292
+ children: Z.productLabel
293
+ }),
294
+ /* @__PURE__ */ A("span", {
295
+ className: "ttw:w-24 ttw:min-w-24",
296
+ children: Z.quantityLabel
297
+ }),
298
+ /* @__PURE__ */ A("span", {
299
+ className: "ttw:w-20.5 ttw:min-w-20.5",
300
+ children: Z.unitLabel
301
+ }),
302
+ /* @__PURE__ */ A("span", {
303
+ className: "ttw:w-full ttw:max-w-41 ttw:min-w-29",
304
+ children: Z.priceLabel
305
+ }),
306
+ /* @__PURE__ */ A("span", {
307
+ className: "ttw:w-12 ttw:min-w-12",
308
+ children: Z.taxableLabel
309
+ }),
310
+ F.lineItems.length > 1 && /* @__PURE__ */ A("span", { className: "ttw:w-10 ttw:min-w-10" })
311
+ ]
312
+ }), V ? /* @__PURE__ */ A("li", {
313
+ className: "ttw:flex ttw:h-9 ttw:items-center ttw:justify-center",
314
+ children: /* @__PURE__ */ A(T, { className: "ttw:size-5" })
315
+ }) : F.lineItems.map((e) => /* @__PURE__ */ A(te, {
316
+ formId: Q,
317
+ lineItem: e,
318
+ errors: I?.lineItems?.[e.id],
319
+ controls: z?.[e.id],
320
+ focusOnMount: e.id === B,
321
+ canRemove: F.lineItems.length > 1,
322
+ unitOptions: ne,
323
+ currencySymbol: re,
324
+ labels: Z,
325
+ renderProductSelector: W,
326
+ onChange: (t) => K(e.id, t),
327
+ onCommit: (t) => q(e.id, t),
328
+ onQuantityStep: (t) => J(e.id, t),
329
+ onManageUnits: ie,
330
+ onRemove: () => oe(e.id)
331
+ }, e.id))]
332
+ }),
333
+ /* @__PURE__ */ j(n, {
334
+ type: "button",
335
+ variant: "ghost",
336
+ className: "ttw:w-fit ttw:text-primary ttw:hover:text-primary",
337
+ onClick: ae,
338
+ children: [/* @__PURE__ */ A(N, { className: "ttw:size-5 ttw:text-primary" }), Z.addLineItemButton]
339
+ }),
340
+ /* @__PURE__ */ A(i, { children: /* @__PURE__ */ j(a, {
341
+ className: "ttw:flex-row ttw:justify-end",
342
+ children: [/* @__PURE__ */ A(o, {
343
+ htmlFor: `${Q}-tax-rate`,
344
+ children: Z.taxRateLabel
345
+ }), /* @__PURE__ */ j(c, {
346
+ className: "ttw:w-40 ttw:has-[>[data-align=inline-end]]:[&>input]:pr-0",
347
+ children: [/* @__PURE__ */ A(u, {
348
+ id: `${Q}-tax-rate`,
349
+ className: "ttw:text-right",
350
+ placeholder: Z.taxRatePlaceholder,
351
+ type: "text",
352
+ inputMode: "decimal",
353
+ value: F.taxRate,
354
+ onChange: (e) => G({ taxRate: e.target.value }),
355
+ onBlur: Y
356
+ }), /* @__PURE__ */ A(l, {
357
+ align: "inline-end",
358
+ children: Z.taxRateSuffix
359
+ })]
360
+ })]
361
+ }) })
362
+ ]
363
+ }),
364
+ ce,
365
+ /* @__PURE__ */ A(k, {
366
+ idPrefix: Q,
367
+ openingNote: F.openingNote,
368
+ closingNote: F.closingNote,
369
+ openingNoteError: I?.openingNote,
370
+ closingNoteError: I?.closingNote,
371
+ disabled: H,
372
+ onOpeningNoteChange: (e) => G({ openingNote: e }),
373
+ onClosingNoteChange: (e) => G({ closingNote: e }),
374
+ labels: Z
375
+ }),
376
+ le
377
+ ]
378
+ })
379
+ }),
380
+ /* @__PURE__ */ A(S, { children: /* @__PURE__ */ j("div", {
381
+ className: "ttw:flex ttw:justify-end ttw:gap-2",
382
+ children: [/* @__PURE__ */ A(n, {
383
+ type: "button",
384
+ variant: "ghost",
385
+ disabled: ue,
386
+ onClick: pe,
387
+ children: Z.cancelButton
388
+ }), /* @__PURE__ */ A(n, {
389
+ type: "submit",
390
+ form: Q,
391
+ loading: H,
392
+ disabled: de,
393
+ children: P === "edit" ? Z.updateButton : Z.createButton
394
+ })]
395
+ }) })
396
+ ]
397
+ })
398
+ });
399
+ }
400
+ //#endregion
401
+ export { R as ReceivableFormSheet, R as default };
@@ -0,0 +1,106 @@
1
+ import { Button as e, Dialog as t, DialogContent as n, DialogDescription as r, DialogFooter as i, DialogHeader as a, DialogTitle as o, Input as s, Label as c, RadioGroup as l, RadioGroupItem as u, Textarea as d } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { RECEIVABLE_PAYMENT_DIALOG_LABELS_EN as f } from "./index3.js";
3
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
4
+ //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js
5
+ function h({ message: e }) {
6
+ return e ? /* @__PURE__ */ p("p", {
7
+ className: "ttw:text-sm ttw:text-destructive",
8
+ children: e
9
+ }) : null;
10
+ }
11
+ function g({ open: g, onOpenChange: _, values: v, errors: y, inProgress: b, onChange: x, onSubmit: S, onCancel: C, labels: w }) {
12
+ let T = {
13
+ ...f,
14
+ ...w
15
+ };
16
+ return /* @__PURE__ */ p(t, {
17
+ open: g,
18
+ onOpenChange: _,
19
+ children: /* @__PURE__ */ m(n, { children: [
20
+ /* @__PURE__ */ m(a, { children: [/* @__PURE__ */ p(o, { children: T.title }), /* @__PURE__ */ p(r, { children: T.description })] }),
21
+ /* @__PURE__ */ m("div", {
22
+ className: "ttw:flex ttw:flex-col ttw:gap-4",
23
+ children: [
24
+ y?.form && /* @__PURE__ */ p("p", {
25
+ className: "ttw:rounded-md ttw:bg-destructive/10 ttw:px-3 ttw:py-2 ttw:text-sm ttw:text-destructive",
26
+ children: y.form
27
+ }),
28
+ /* @__PURE__ */ m("div", {
29
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
30
+ children: [/* @__PURE__ */ p(c, { children: T.modeLabel }), /* @__PURE__ */ m(l, {
31
+ className: "ttw:flex ttw:flex-row ttw:gap-6",
32
+ value: v.mode,
33
+ onValueChange: (e) => x({ mode: e }),
34
+ children: [/* @__PURE__ */ m("div", {
35
+ className: "ttw:flex ttw:items-center ttw:gap-2",
36
+ children: [/* @__PURE__ */ p(u, {
37
+ value: "full",
38
+ id: "receivable-payment-full"
39
+ }), /* @__PURE__ */ p(c, {
40
+ htmlFor: "receivable-payment-full",
41
+ children: T.fullPayment
42
+ })]
43
+ }), /* @__PURE__ */ m("div", {
44
+ className: "ttw:flex ttw:items-center ttw:gap-2",
45
+ children: [/* @__PURE__ */ p(u, {
46
+ value: "partial",
47
+ id: "receivable-payment-partial"
48
+ }), /* @__PURE__ */ p(c, {
49
+ htmlFor: "receivable-payment-partial",
50
+ children: T.partialPayment
51
+ })]
52
+ })]
53
+ })]
54
+ }),
55
+ v.mode === "partial" && /* @__PURE__ */ m("div", {
56
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
57
+ children: [
58
+ /* @__PURE__ */ p(c, { children: T.amountPaidLabel }),
59
+ /* @__PURE__ */ p(s, {
60
+ inputMode: "decimal",
61
+ value: v.amountPaid,
62
+ onChange: (e) => x({ amountPaid: e.target.value })
63
+ }),
64
+ /* @__PURE__ */ p(h, { message: y?.amountPaid })
65
+ ]
66
+ }),
67
+ v.mode === "full" && /* @__PURE__ */ m("div", {
68
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
69
+ children: [
70
+ /* @__PURE__ */ p(c, { children: T.paidAtLabel }),
71
+ /* @__PURE__ */ p(s, {
72
+ type: "date",
73
+ value: v.paidAt,
74
+ onChange: (e) => x({ paidAt: e.target.value })
75
+ }),
76
+ /* @__PURE__ */ p(h, { message: y?.paidAt })
77
+ ]
78
+ }),
79
+ /* @__PURE__ */ m("div", {
80
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
81
+ children: [
82
+ /* @__PURE__ */ p(c, { children: T.commentLabel }),
83
+ /* @__PURE__ */ p(d, {
84
+ rows: 3,
85
+ value: v.comment,
86
+ onChange: (e) => x({ comment: e.target.value })
87
+ }),
88
+ /* @__PURE__ */ p(h, { message: y?.comment })
89
+ ]
90
+ })
91
+ ]
92
+ }),
93
+ /* @__PURE__ */ m(i, { children: [/* @__PURE__ */ p(e, {
94
+ variant: "ghost",
95
+ onClick: C,
96
+ children: T.cancelButton
97
+ }), /* @__PURE__ */ p(e, {
98
+ loading: b,
99
+ onClick: S,
100
+ children: T.submitButton
101
+ })] })
102
+ ] })
103
+ });
104
+ }
105
+ //#endregion
106
+ export { g as ReceivablePaymentDialog, g as default };
@@ -0,0 +1,93 @@
1
+ import { Button as e, Dialog as t, DialogContent as n, DialogDescription as r, DialogFooter as i, DialogHeader as a, DialogTitle as o, Input as s, Label as c, Textarea as l } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { RECEIVABLE_SEND_DIALOG_LABELS_EN as u } from "./index3.js";
3
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
4
+ //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js
5
+ function p({ message: e }) {
6
+ return e ? /* @__PURE__ */ d("p", {
7
+ className: "ttw:text-sm ttw:text-destructive",
8
+ children: e
9
+ }) : null;
10
+ }
11
+ function m({ open: m, onOpenChange: h, values: g, errors: _, inProgress: v, onChange: y, onSubmit: b, onCancel: x, labels: S }) {
12
+ let C = {
13
+ ...u,
14
+ ...S
15
+ };
16
+ return /* @__PURE__ */ d(t, {
17
+ open: m,
18
+ onOpenChange: h,
19
+ children: /* @__PURE__ */ f(n, { children: [
20
+ /* @__PURE__ */ f(a, { children: [/* @__PURE__ */ d(o, { children: C.title }), /* @__PURE__ */ d(r, { children: C.description })] }),
21
+ /* @__PURE__ */ f("div", {
22
+ className: "ttw:flex ttw:flex-col ttw:gap-4",
23
+ children: [
24
+ _?.form && /* @__PURE__ */ d("p", {
25
+ className: "ttw:rounded-md ttw:bg-destructive/10 ttw:px-3 ttw:py-2 ttw:text-sm ttw:text-destructive",
26
+ children: _.form
27
+ }),
28
+ /* @__PURE__ */ f("div", {
29
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
30
+ children: [
31
+ /* @__PURE__ */ d(c, { children: C.toLabel }),
32
+ /* @__PURE__ */ d(s, {
33
+ value: g.to,
34
+ onChange: (e) => y({ to: e.target.value })
35
+ }),
36
+ /* @__PURE__ */ d(p, { message: _?.to })
37
+ ]
38
+ }),
39
+ /* @__PURE__ */ f("div", {
40
+ className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
41
+ children: [/* @__PURE__ */ f("div", {
42
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
43
+ children: [/* @__PURE__ */ d(c, { children: C.ccLabel }), /* @__PURE__ */ d(s, {
44
+ value: g.cc,
45
+ onChange: (e) => y({ cc: e.target.value })
46
+ })]
47
+ }), /* @__PURE__ */ f("div", {
48
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
49
+ children: [/* @__PURE__ */ d(c, { children: C.bccLabel }), /* @__PURE__ */ d(s, {
50
+ value: g.bcc,
51
+ onChange: (e) => y({ bcc: e.target.value })
52
+ })]
53
+ })]
54
+ }),
55
+ /* @__PURE__ */ f("div", {
56
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
57
+ children: [
58
+ /* @__PURE__ */ d(c, { children: C.subjectLabel }),
59
+ /* @__PURE__ */ d(s, {
60
+ value: g.subject,
61
+ onChange: (e) => y({ subject: e.target.value })
62
+ }),
63
+ /* @__PURE__ */ d(p, { message: _?.subject })
64
+ ]
65
+ }),
66
+ /* @__PURE__ */ f("div", {
67
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
68
+ children: [
69
+ /* @__PURE__ */ d(c, { children: C.bodyLabel }),
70
+ /* @__PURE__ */ d(l, {
71
+ rows: 6,
72
+ value: g.body,
73
+ onChange: (e) => y({ body: e.target.value })
74
+ }),
75
+ /* @__PURE__ */ d(p, { message: _?.body })
76
+ ]
77
+ })
78
+ ]
79
+ }),
80
+ /* @__PURE__ */ f(i, { children: [/* @__PURE__ */ d(e, {
81
+ variant: "ghost",
82
+ onClick: x,
83
+ children: C.cancelButton
84
+ }), /* @__PURE__ */ d(e, {
85
+ loading: v,
86
+ onClick: b,
87
+ children: C.sendButton
88
+ })] })
89
+ ] })
90
+ });
91
+ }
92
+ //#endregion
93
+ export { m as ReceivableSendDialog, m as default };