@tesouro/embedded-components-react 0.5.231 → 0.5.233

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 (78) hide show
  1. package/README.md +1 -0
  2. package/dist/index.css +4 -0
  3. package/dist/index.d.ts +105 -2
  4. package/dist/index.js +1 -1
  5. package/dist/lib/ReceivablesWidget.d.ts +105 -2
  6. package/dist/lib/ReceivablesWidget.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +11 -10
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +92 -55
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +67 -142
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js +186 -17
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index13.js +27 -0
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index3.js +45 -74
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index4.js +68 -53
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index5.js +66 -32
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js +28 -34
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index7.js +24 -166
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index8.js +177 -1
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index9.js +42 -95
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +36 -33
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js +38 -0
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +1 -1
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +206 -147
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +2 -2
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +39 -58
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index20.js +53 -227
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +216 -287
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js +453 -43
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +103 -126
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js +122 -146
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js +145 -41
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js +39 -115
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index27.js +113 -90
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index28.js +81 -98
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index29.js +111 -27
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index30.js +26 -633
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index31.js +639 -39
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index32.js +41 -40
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index33.js +35 -74
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index34.js +73 -130
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index35.js +133 -329
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index36.js +345 -0
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +13 -12
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +15 -12
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +35 -24
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +8 -71
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +70 -17
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +31 -12
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +18 -30
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +12 -301
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +33 -1
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +14 -46
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +23 -67
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +76 -485
  55. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +395 -95
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +2 -0
  57. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +48 -2
  58. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +72 -4
  59. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +496 -1
  60. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +97 -91
  61. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +2 -236
  62. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +3 -2
  63. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +1 -249
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +89 -82
  65. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +23 -54
  66. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +223 -340
  67. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +3 -0
  68. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +249 -0
  69. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +93 -0
  70. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +59 -0
  71. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +353 -0
  72. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +18 -1
  73. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +41 -41
  74. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/clientRegistry.js +6 -3
  75. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +75 -43
  76. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  77. package/package.json +1 -1
  78. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +0 -28
@@ -1,106 +1,406 @@
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 "./index9.js";
3
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
1
+ import { Accordion as e, AccordionContent as t, AccordionItem as n, AccordionTrigger as r, Badge as i, Button as a, Sheet as o, SheetContent as ee, SheetDescription as s, SheetHeader as c, SheetTitle as l, Spinner as te, Tooltip as u, TooltipContent as d, TooltipProvider as f, TooltipTrigger as p, cn as m } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { ErrorState as h } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
3
+ import "../../../shared/ui/dist/index.js";
4
+ import { RECEIVABLE_DETAILS_PANEL_LABELS_EN as g } from "./index9.js";
5
+ import { ReceivableStatusBadge as _ } from "./index18.js";
6
+ import { RECEIVABLE_DETAILS_SECTION as v } from "./index21.js";
7
+ import { ACTION_ICON as y, ACTION_LABEL_KEY as b, STATUS_ICON as x, amountValueToneClass as S, headerIconButtonClass as C } from "./index19.js";
8
+ import { AmountCell as w } from "./index20.js";
9
+ import { AttachmentsItem as ne } from "./index22.js";
10
+ import { AuditHistoryItem as re } from "./index23.js";
11
+ import { CloseButton as T } from "./index24.js";
12
+ import { InfoRow as E } from "./index25.js";
13
+ import { OverflowMenu as ie } from "./index26.js";
14
+ import { SeriesStatusChip as ae } from "./index28.js";
15
+ import { ScheduledInvoicesTable as D } from "./index29.js";
16
+ import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
17
+ import { ChevronLeft as j, CircleAlert as M, EyeIcon as N, Repeat as P } from "lucide-react";
4
18
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js
5
- function h({ message: e }) {
6
- return e ? /* @__PURE__ */ p("p", {
7
- className: "ttw:text-sm ttw:text-destructive",
8
- children: e
19
+ function F({ open: F, onOpenChange: I, details: L, unsupported: R, isLoading: z, isError: B, onActionClick: V, onClose: H, openSections: U, onOpenSectionsChange: W, disabledActions: G, labels: K }) {
20
+ let q = {
21
+ ...g,
22
+ ...K
23
+ }, J = L?.panel, Y = B ? {
24
+ title: q.errorTitle,
25
+ description: q.errorDescription
26
+ } : R, oe = J?.amountTone === "danger", X = (e) => q[b[e]], Z = L ? x[L.status] : void 0, Q = J?.recurringSeries, $ = L && J && J.primaryActions.length > 0 ? /* @__PURE__ */ k("div", {
27
+ className: "ttw:flex ttw:items-center ttw:gap-2 ttw:border-t ttw:border-border ttw:pt-3",
28
+ children: J.primaryActions.map((e, t) => {
29
+ let n = y[e], r = t === J.primaryActions.length - 1;
30
+ return /* @__PURE__ */ A(a, {
31
+ size: "sm",
32
+ variant: r ? "default" : "outline",
33
+ onClick: () => V(e, L),
34
+ children: [/* @__PURE__ */ k(n, { className: "ttw:size-4" }), X(e)]
35
+ }, e);
36
+ })
9
37
  }) : 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",
38
+ return /* @__PURE__ */ k(o, {
39
+ open: F,
40
+ onOpenChange: I,
41
+ children: /* @__PURE__ */ A(ee, {
42
+ showCloseButton: !1,
43
+ className: "ttw:w-180 ttw:overflow-y-auto ttw:p-0 ttw:sm:max-w-180",
44
+ children: [Y || z || !L ? /* @__PURE__ */ k(T, {
45
+ label: q.closeButton,
46
+ onClose: H,
47
+ className: m(C, "ttw:absolute ttw:right-4 ttw:top-4 ttw:z-10")
48
+ }) : null, Y ? /* @__PURE__ */ A("div", {
49
+ className: "ttw:p-6",
50
+ children: [/* @__PURE__ */ A(c, {
51
+ className: "ttw:sr-only",
52
+ children: [/* @__PURE__ */ k(l, { children: Y.title }), /* @__PURE__ */ k(s, { children: q.hiddenDescription })]
53
+ }), /* @__PURE__ */ k(h, {
54
+ title: Y.title,
55
+ description: Y.description
56
+ })]
57
+ }) : z || !L || !J ? /* @__PURE__ */ A(c, {
58
+ className: "ttw:p-6",
59
+ children: [/* @__PURE__ */ k(l, { children: q.loadingTitle }), /* @__PURE__ */ k(s, {
60
+ className: "ttw:sr-only",
61
+ children: q.hiddenDescription
62
+ })]
63
+ }) : /* @__PURE__ */ A(O, { children: [
64
+ J.seriesLink ? /* @__PURE__ */ k("div", {
65
+ className: "ttw:border-b ttw:border-border ttw:px-6 ttw:py-3",
66
+ children: /* @__PURE__ */ A("button", {
67
+ type: "button",
68
+ onClick: J.seriesLink.onOpen,
69
+ className: "ttw:flex ttw:items-center ttw:gap-1 ttw:text-sm ttw:text-primary ttw:hover:underline",
70
+ children: [/* @__PURE__ */ k(j, {
71
+ className: "ttw:size-4",
72
+ "aria-hidden": "true"
73
+ }), J.seriesLink.backLabel]
74
+ })
75
+ }) : null,
76
+ /* @__PURE__ */ A(c, {
77
+ className: "ttw:flex ttw:flex-row ttw:items-start ttw:justify-between ttw:gap-2 ttw:space-y-0 ttw:px-6 ttw:py-4",
78
+ children: [/* @__PURE__ */ A("div", {
79
+ className: "ttw:flex ttw:flex-col ttw:gap-0.5",
69
80
  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 })
81
+ /* @__PURE__ */ k(l, {
82
+ className: "ttw:text-xl ttw:font-semibold ttw:text-foreground",
83
+ children: L.title
75
84
  }),
76
- /* @__PURE__ */ p(h, { message: y?.paidAt })
85
+ J.subtitle ? /* @__PURE__ */ k("p", {
86
+ className: "ttw:text-sm ttw:text-muted-foreground",
87
+ children: J.subtitle
88
+ }) : null,
89
+ /* @__PURE__ */ k(s, {
90
+ className: "ttw:sr-only",
91
+ children: q.hiddenDescription
92
+ })
77
93
  ]
78
- }),
79
- /* @__PURE__ */ m("div", {
80
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
94
+ }), /* @__PURE__ */ k(f, {
95
+ delayDuration: 500,
96
+ children: /* @__PURE__ */ A("div", {
97
+ className: "ttw:flex ttw:items-center ttw:gap-1.5",
98
+ children: [
99
+ L.pdfUrl ? /* @__PURE__ */ A(u, { children: [/* @__PURE__ */ k(p, {
100
+ asChild: !0,
101
+ children: /* @__PURE__ */ k(a, {
102
+ asChild: !0,
103
+ variant: "ghost",
104
+ size: "icon",
105
+ className: C,
106
+ children: /* @__PURE__ */ k("a", {
107
+ href: L.pdfUrl,
108
+ target: "_blank",
109
+ rel: "noreferrer",
110
+ "aria-label": q.viewPdfButton,
111
+ children: /* @__PURE__ */ k(N, { className: "ttw:size-4" })
112
+ })
113
+ })
114
+ }), /* @__PURE__ */ k(d, { children: q.viewPdfButton })] }) : null,
115
+ J.overflowActions.length > 0 ? /* @__PURE__ */ k(ie, {
116
+ actions: J.overflowActions,
117
+ triggerLabel: q.moreActionsLabel,
118
+ getActionLabel: X,
119
+ onSelect: (e) => V(e, L),
120
+ disabledActions: G,
121
+ className: C
122
+ }) : null,
123
+ /* @__PURE__ */ A(u, { children: [/* @__PURE__ */ k(p, {
124
+ asChild: !0,
125
+ children: /* @__PURE__ */ k(T, {
126
+ label: q.closeButton,
127
+ onClose: H,
128
+ className: C
129
+ })
130
+ }), /* @__PURE__ */ k(d, { children: q.closeButton })] })
131
+ ]
132
+ })
133
+ })]
134
+ }),
135
+ /* @__PURE__ */ A("div", {
136
+ className: "ttw:flex ttw:flex-col",
137
+ children: [/* @__PURE__ */ k("div", {
138
+ className: "ttw:px-6",
139
+ children: Q ? /* @__PURE__ */ A("div", {
140
+ className: "ttw:flex ttw:flex-col ttw:gap-3 ttw:rounded-lg ttw:bg-violet-50 ttw:p-4 ttw:dark:bg-violet-950",
141
+ children: [
142
+ /* @__PURE__ */ A("div", {
143
+ className: "ttw:flex ttw:flex-col ttw:gap-0.5",
144
+ children: [/* @__PURE__ */ k("span", {
145
+ className: "ttw:text-xs ttw:text-muted-foreground",
146
+ children: q.recurringAmountCaption
147
+ }), /* @__PURE__ */ A("div", {
148
+ className: "ttw:flex ttw:items-baseline ttw:gap-1.5",
149
+ children: [/* @__PURE__ */ k("span", {
150
+ className: m("ttw:text-2xl ttw:font-semibold", S[J.amountTone]),
151
+ children: Q.amountLabel
152
+ }), /* @__PURE__ */ k("span", {
153
+ className: "ttw:text-sm ttw:text-muted-foreground",
154
+ children: Q.amountPeriodLabel
155
+ })]
156
+ })]
157
+ }),
158
+ /* @__PURE__ */ A("div", {
159
+ className: "ttw:flex ttw:items-center ttw:gap-2",
160
+ children: [/* @__PURE__ */ A(i, {
161
+ variant: "outline",
162
+ className: "ttw:gap-1 ttw:border-violet-200 ttw:bg-violet-50 ttw:text-violet-700",
163
+ children: [/* @__PURE__ */ k(P, { className: "ttw:size-3" }), q.recurringBadge]
164
+ }), /* @__PURE__ */ k(ae, {
165
+ label: Q.statusLabel,
166
+ tone: Q.statusTone,
167
+ icon: Q.statusIcon
168
+ })]
169
+ }),
170
+ /* @__PURE__ */ A("div", {
171
+ className: "ttw:flex ttw:gap-12 ttw:text-sm",
172
+ children: [/* @__PURE__ */ A("div", {
173
+ className: "ttw:flex ttw:flex-col ttw:gap-0.5",
174
+ children: [/* @__PURE__ */ k("span", {
175
+ className: "ttw:text-xs ttw:text-muted-foreground",
176
+ children: q.startsOnCaption
177
+ }), /* @__PURE__ */ k("span", {
178
+ className: "ttw:text-foreground",
179
+ children: Q.startsOnLabel
180
+ })]
181
+ }), /* @__PURE__ */ A("div", {
182
+ className: "ttw:flex ttw:flex-col ttw:gap-0.5",
183
+ children: [/* @__PURE__ */ k("span", {
184
+ className: "ttw:text-xs ttw:text-muted-foreground",
185
+ children: q.endsOnCaption
186
+ }), /* @__PURE__ */ k("span", {
187
+ className: "ttw:text-foreground",
188
+ children: Q.endsOnLabel
189
+ })]
190
+ })]
191
+ }),
192
+ $
193
+ ]
194
+ }) : /* @__PURE__ */ A("div", {
195
+ className: m("ttw:flex ttw:flex-col ttw:gap-3 ttw:rounded-lg ttw:bg-muted ttw:p-4", oe && "ttw:border ttw:border-red-200"),
196
+ children: [
197
+ /* @__PURE__ */ k("div", {
198
+ className: "ttw:flex ttw:flex-row ttw:flex-wrap ttw:gap-x-12 ttw:gap-y-2",
199
+ children: J.amountRows.map((e) => /* @__PURE__ */ k(w, {
200
+ row: e,
201
+ defaultTone: J.amountTone
202
+ }, e.label))
203
+ }),
204
+ /* @__PURE__ */ A("div", {
205
+ className: "ttw:flex ttw:items-center ttw:gap-2",
206
+ children: [J.overdueLabel ? /* @__PURE__ */ A("span", {
207
+ className: "ttw:inline-flex ttw:items-center ttw:gap-1 ttw:rounded-full ttw:bg-red-100 ttw:px-2.5 ttw:py-0.5 ttw:text-xs ttw:font-medium ttw:text-red-700",
208
+ children: [/* @__PURE__ */ k(M, { className: "ttw:size-3" }), J.overdueLabel]
209
+ }) : /* @__PURE__ */ k(_, {
210
+ label: J.statusLabel,
211
+ tone: L.statusTone,
212
+ icon: Z ? /* @__PURE__ */ k(Z, { className: "ttw:size-3" }) : void 0
213
+ }), J.recurring ? /* @__PURE__ */ A(i, {
214
+ variant: "outline",
215
+ className: "ttw:gap-1 ttw:border-violet-200 ttw:bg-violet-50 ttw:text-violet-700",
216
+ children: [/* @__PURE__ */ k(P, { className: "ttw:size-3" }), q.recurringBadge]
217
+ }) : null]
218
+ }),
219
+ /* @__PURE__ */ A("div", {
220
+ className: "ttw:flex ttw:gap-12 ttw:text-sm",
221
+ children: [/* @__PURE__ */ A("div", {
222
+ className: "ttw:flex ttw:flex-col ttw:gap-0.5",
223
+ children: [/* @__PURE__ */ k("span", {
224
+ className: "ttw:text-xs ttw:text-muted-foreground",
225
+ children: q.invoiceDateCaption
226
+ }), /* @__PURE__ */ k("span", {
227
+ className: "ttw:text-foreground",
228
+ children: J.issueDateLabel
229
+ })]
230
+ }), /* @__PURE__ */ A("div", {
231
+ className: "ttw:flex ttw:flex-col ttw:gap-0.5",
232
+ children: [/* @__PURE__ */ k("span", {
233
+ className: "ttw:text-xs ttw:text-muted-foreground",
234
+ children: J.dueDateCaption
235
+ }), /* @__PURE__ */ k("span", {
236
+ className: "ttw:text-foreground",
237
+ children: J.dueDateLabel
238
+ })]
239
+ })]
240
+ }),
241
+ $
242
+ ]
243
+ })
244
+ }), /* @__PURE__ */ A("div", {
245
+ className: "ttw:px-6",
81
246
  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 })
247
+ J.paymentHistory ? /* @__PURE__ */ A("section", {
248
+ "aria-label": q.paymentHistoryHeading,
249
+ className: "ttw:border-b ttw:py-4",
250
+ children: [/* @__PURE__ */ k("h3", {
251
+ className: "ttw:mb-3 ttw:text-sm ttw:font-medium",
252
+ children: q.paymentHistoryHeading
253
+ }), J.paymentHistory.isLoading ? /* @__PURE__ */ k("div", {
254
+ className: "ttw:flex ttw:py-2",
255
+ children: /* @__PURE__ */ k(te, {
256
+ className: "ttw:size-5",
257
+ "aria-label": q.paymentHistoryLoading
258
+ })
259
+ }) : J.paymentHistory.rows.length === 0 ? /* @__PURE__ */ k("p", {
260
+ className: m("ttw:text-sm", J.paymentHistory.emptyTone === "danger" ? "ttw:text-red-600" : "ttw:text-muted-foreground"),
261
+ children: q.paymentHistoryEmpty
262
+ }) : /* @__PURE__ */ A("div", {
263
+ className: "ttw:flex ttw:flex-col",
264
+ children: [J.paymentHistory.rows.map((e) => /* @__PURE__ */ A("div", {
265
+ className: "ttw:flex ttw:justify-between ttw:border-b ttw:border-border ttw:py-2 ttw:text-sm",
266
+ children: [/* @__PURE__ */ k("span", { children: e.dateLabel }), /* @__PURE__ */ k("span", { children: e.amountLabel })]
267
+ }, e.id)), /* @__PURE__ */ A("div", {
268
+ className: "ttw:flex ttw:justify-between ttw:py-2 ttw:text-sm ttw:font-medium",
269
+ children: [/* @__PURE__ */ k("span", { children: q.paymentHistoryTotalLabel }), /* @__PURE__ */ k("span", { children: J.paymentHistory.totalLabel })]
270
+ })]
271
+ })]
272
+ }) : null,
273
+ J.customerContact.length > 0 ? /* @__PURE__ */ A("section", {
274
+ "aria-label": q.customerDetailsHeading,
275
+ className: "ttw:border-b ttw:py-4",
276
+ children: [/* @__PURE__ */ k("h3", {
277
+ className: "ttw:mb-3 ttw:text-sm ttw:font-medium",
278
+ children: q.customerDetailsHeading
279
+ }), /* @__PURE__ */ k("div", {
280
+ className: "ttw:flex ttw:flex-col",
281
+ children: J.customerContact.map((e) => /* @__PURE__ */ k(E, { ...e }, e.label))
282
+ })]
283
+ }) : null,
284
+ /* @__PURE__ */ A(e, {
285
+ type: "multiple",
286
+ value: U,
287
+ onValueChange: W,
288
+ className: "ttw:w-full",
289
+ children: [
290
+ /* @__PURE__ */ A(n, {
291
+ value: v.billing,
292
+ children: [/* @__PURE__ */ k(r, { children: q.billingHeading }), /* @__PURE__ */ k(t, { children: /* @__PURE__ */ A("div", {
293
+ className: "ttw:flex ttw:flex-col",
294
+ children: [J.billingItems.map((e) => /* @__PURE__ */ k(E, { ...e }, e.label)), J.seriesLink ? /* @__PURE__ */ A("div", {
295
+ className: "ttw:flex ttw:gap-4 ttw:border-b ttw:border-border ttw:py-3 ttw:text-sm ttw:last:border-b-0",
296
+ children: [/* @__PURE__ */ k("span", {
297
+ className: "ttw:w-40 ttw:shrink-0 ttw:text-muted-foreground",
298
+ children: q.recurringSeriesRowLabel
299
+ }), /* @__PURE__ */ k("button", {
300
+ type: "button",
301
+ onClick: J.seriesLink.onOpen,
302
+ className: "ttw:text-left ttw:text-primary ttw:hover:underline",
303
+ children: J.seriesLink.title
304
+ })]
305
+ }) : null]
306
+ }) })]
307
+ }),
308
+ J.lineItemsSection ? /* @__PURE__ */ A(n, {
309
+ value: v.lineItems,
310
+ children: [/* @__PURE__ */ k(r, { children: /* @__PURE__ */ A("span", {
311
+ className: "ttw:flex ttw:items-center ttw:gap-2",
312
+ children: [q.lineItemsHeading, /* @__PURE__ */ k(i, {
313
+ variant: "secondary",
314
+ className: "ttw:rounded-full",
315
+ children: J.lineItemsSection.countLabel
316
+ })]
317
+ }) }), /* @__PURE__ */ k(t, { children: /* @__PURE__ */ A("div", {
318
+ className: "ttw:flex ttw:flex-col ttw:text-sm",
319
+ children: [L.lineItems.length === 0 ? /* @__PURE__ */ k("p", {
320
+ className: "ttw:py-3 ttw:text-muted-foreground",
321
+ children: q.noLineItems
322
+ }) : L.lineItems.map((e) => /* @__PURE__ */ A("div", {
323
+ className: "ttw:flex ttw:items-start ttw:justify-between ttw:border-b ttw:border-border ttw:py-3",
324
+ children: [/* @__PURE__ */ A("div", {
325
+ className: "ttw:flex ttw:flex-col",
326
+ children: [/* @__PURE__ */ k("span", {
327
+ className: "ttw:font-medium",
328
+ children: e.name
329
+ }), /* @__PURE__ */ A("span", {
330
+ className: "ttw:text-muted-foreground",
331
+ children: [
332
+ e.quantityLabel,
333
+ " ",
334
+ q.lineItemMultiplier,
335
+ " ",
336
+ e.unitPriceLabel,
337
+ " ",
338
+ q.lineItemEaLabel
339
+ ]
340
+ })]
341
+ }), /* @__PURE__ */ k("span", { children: e.totalLabel })]
342
+ }, e.id)), J.lineItemsSection.totals.length > 0 ? /* @__PURE__ */ k("div", {
343
+ className: "ttw:flex ttw:flex-col ttw:gap-1 ttw:py-3",
344
+ children: J.lineItemsSection.totals.map((e) => /* @__PURE__ */ A("div", {
345
+ className: m("ttw:flex ttw:justify-between", e.emphasis && "ttw:font-medium"),
346
+ children: [/* @__PURE__ */ k("span", { children: e.label }), /* @__PURE__ */ k("span", { children: e.value })]
347
+ }, e.label))
348
+ }) : null]
349
+ }) })]
350
+ }) : null,
351
+ J.notes ? /* @__PURE__ */ A(n, {
352
+ value: v.notes,
353
+ children: [/* @__PURE__ */ k(r, { children: /* @__PURE__ */ A("span", {
354
+ className: "ttw:flex ttw:items-center ttw:gap-2",
355
+ children: [q.notesHeading, /* @__PURE__ */ k(i, {
356
+ variant: "secondary",
357
+ className: "ttw:rounded-full",
358
+ children: J.notes.countLabel
359
+ })]
360
+ }) }), /* @__PURE__ */ k(t, { children: /* @__PURE__ */ A("div", {
361
+ className: "ttw:flex ttw:flex-col ttw:gap-3 ttw:text-sm",
362
+ children: [J.notes.opening ? /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("p", {
363
+ className: "ttw:mb-1 ttw:font-medium",
364
+ children: q.notesOpeningLabel
365
+ }), /* @__PURE__ */ k("p", {
366
+ className: "ttw:text-muted-foreground",
367
+ children: J.notes.opening
368
+ })] }) : null, J.notes.closing ? /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("p", {
369
+ className: "ttw:mb-1 ttw:font-medium",
370
+ children: q.notesClosingLabel
371
+ }), /* @__PURE__ */ k("p", {
372
+ className: "ttw:text-muted-foreground",
373
+ children: J.notes.closing
374
+ })] }) : null]
375
+ }) })]
376
+ }) : null,
377
+ /* @__PURE__ */ k(ne, {
378
+ attachments: J.attachments,
379
+ labels: q
380
+ }),
381
+ /* @__PURE__ */ k(re, {
382
+ auditHistory: J.auditHistory,
383
+ labels: q
384
+ })
385
+ ]
87
386
  }),
88
- /* @__PURE__ */ p(h, { message: y?.comment })
387
+ Q ? /* @__PURE__ */ A("section", {
388
+ "aria-label": Q.scheduleTitle,
389
+ className: "ttw:border-t ttw:border-border ttw:py-4",
390
+ children: [/* @__PURE__ */ k("h3", {
391
+ className: "ttw:mb-3 ttw:text-sm ttw:font-medium",
392
+ children: Q.scheduleTitle
393
+ }), /* @__PURE__ */ k(D, {
394
+ rows: Q.schedule,
395
+ labels: q
396
+ })]
397
+ }) : null
89
398
  ]
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
- ] })
399
+ })]
400
+ })
401
+ ] })]
402
+ })
103
403
  });
104
404
  }
105
405
  //#endregion
106
- export { g as ReceivablePaymentDialog, g as default };
406
+ export { F as ReceivableDetailsPanel, F as default };
@@ -0,0 +1,2 @@
1
+ import "./index21.js";
2
+ import "./index30.js";
@@ -1,2 +1,48 @@
1
- import "react";
2
- import "react/jsx-runtime";
1
+ import { cn as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js
4
+ function r({ label: r, value: i, className: a }) {
5
+ return /* @__PURE__ */ n("li", {
6
+ className: e("ttw:flex ttw:items-center ttw:justify-between", a),
7
+ children: [/* @__PURE__ */ t("span", { children: r }), /* @__PURE__ */ t("span", { children: i })]
8
+ });
9
+ }
10
+ function i({ totals: e, labels: i }) {
11
+ return /* @__PURE__ */ n("ul", {
12
+ className: "ttw:flex ttw:w-full ttw:list-none ttw:flex-col ttw:gap-1.5",
13
+ children: [
14
+ /* @__PURE__ */ t(r, {
15
+ label: i.subtotalLabel,
16
+ value: e.subtotal,
17
+ className: "ttw:text-sm ttw:font-normal"
18
+ }),
19
+ /* @__PURE__ */ t(r, {
20
+ label: i.discountTotalLabel,
21
+ value: e.discount,
22
+ className: "ttw:text-sm ttw:font-normal"
23
+ }),
24
+ /* @__PURE__ */ t(r, {
25
+ label: i.nonTaxableSubtotalLabel,
26
+ value: e.nonTaxableSubtotal,
27
+ className: "ttw:text-sm ttw:font-normal ttw:text-muted-foreground"
28
+ }),
29
+ /* @__PURE__ */ t(r, {
30
+ label: i.taxableSubtotalLabel,
31
+ value: e.taxableSubtotal,
32
+ className: "ttw:text-sm ttw:font-normal ttw:text-muted-foreground"
33
+ }),
34
+ /* @__PURE__ */ t(r, {
35
+ label: i.taxTotalLabel,
36
+ value: e.tax,
37
+ className: "ttw:text-sm ttw:font-normal"
38
+ }),
39
+ /* @__PURE__ */ t(r, {
40
+ label: i.totalLabel,
41
+ value: e.total,
42
+ className: "ttw:text-lg ttw:font-medium"
43
+ })
44
+ ]
45
+ });
46
+ }
47
+ //#endregion
48
+ export { i as ReceivableFormTotals };
@@ -1,4 +1,72 @@
1
- import "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import "./index32.js";
3
- import "react/jsx-runtime";
4
- import "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";
3
+ //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js
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
+ ] }) });
29
+ }
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",
33
+ children: [
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
44
+ })]
45
+ }),
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
67
+ })
68
+ ]
69
+ });
70
+ }
71
+ //#endregion
72
+ export { u as ReceivableNotesSection };