@tesouro/embedded-components-react 0.5.268 → 0.5.270

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/dist/index.css +4 -10
  2. package/dist/index.d.ts +13 -9
  3. package/dist/lib/ReceivablesWidget.d.ts +13 -9
  4. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index.js +3 -1
  5. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsContainer.js +44 -0
  6. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsSheetView.js +97 -0
  7. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js +76 -150
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +63 -57
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/actionsModal.js +1 -1
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/auditHistory/labels.js +1 -1
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js +161 -152
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +30 -34
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +12 -8
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/statusCards.js +18 -19
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +208 -158
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +91 -85
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +197 -196
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +147 -115
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +14 -14
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +3 -5
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +37 -34
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +22 -7
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +17 -15
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +17 -13
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +37 -31
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +29 -23
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +38 -11
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +26 -28
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +20 -14
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +8 -24
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +34 -83
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +14 -404
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +28 -2
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +79 -39
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +490 -68
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +2 -502
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +41 -216
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +70 -21
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +484 -5
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +224 -0
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +21 -263
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +8 -2
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +261 -24
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +2 -237
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +100 -3
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +21 -242
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +226 -82
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +3 -59
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +233 -178
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +85 -37
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.js +60 -0
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js +194 -0
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +45 -0
  54. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  55. package/package.json +1 -1
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +0 -100
@@ -1,72 +1,494 @@
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";
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 te, SheetTitle as c, Tooltip as l, TooltipContent as u, TooltipProvider as d, TooltipTrigger as f, Typography as p, cn as m } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { RECEIVABLE_DETAILS_PANEL_LABELS_EN as ne } from "./index13.js";
3
+ import { ReceivableStatusBadge as re } from "./index22.js";
4
+ import { RECEIVABLE_DETAILS_SECTION as h } from "./index25.js";
5
+ import { ACTION_ICON as ie, ACTION_LABEL_KEY as g, STATUS_ICON as _, amountValueToneClass as ae, headerIconButtonClass as v, headerTooltipArrowClass as y, headerTooltipClass as b, preventTooltipFocusOpen as x, sectionChevronClass as S, sectionCountBadgeClass as C, sectionItemClass as w, sectionTriggerClass as T } from "./index23.js";
6
+ import { AmountCell as E } from "./index24.js";
7
+ import { AttachmentsItem as D } from "./index26.js";
8
+ import { AuditHistoryItem as O } from "./index27.js";
9
+ import { CloseButton as k } from "./index28.js";
10
+ import { CustomerNameRow as oe } from "./index29.js";
11
+ import { DetailsMessage as se } from "./index30.js";
12
+ import { InfoRow as A } from "./index31.js";
13
+ import { LoadingSpinner as j } from "./index32.js";
14
+ import { OverflowMenu as ce } from "./index33.js";
15
+ import { SeriesStatusChip as le } from "./index35.js";
16
+ import { ScheduledInvoicesTable as ue } from "./index36.js";
17
+ import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
18
+ import { ChevronLeft as F, CircleAlert as I, EyeIcon as L, Repeat as R } from "lucide-react";
3
19
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.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
- ]
20
+ function z({ open: z, onOpenChange: B, details: V, message: H, isLoading: U, onActionClick: W, onClose: G, openSections: de, onOpenSectionsChange: fe, disabledActions: K, labels: pe }) {
21
+ let q = {
22
+ ...ne,
23
+ ...pe
24
+ }, J = V?.panel, Y = !U && !H && !!(V && J), me = J?.amountTone === "danger", X = (e) => q[g[e]], Z = V ? _[V.status] : void 0, Q = J?.recurringSeries, $ = V && J && J.primaryActions.length > 0 ? /* @__PURE__ */ N("div", {
25
+ className: "ttw:flex ttw:items-center ttw:gap-2 ttw:border-t ttw:border-border ttw:pt-3",
26
+ children: J.primaryActions.map((e, t) => {
27
+ let n = ie[e], r = t === J.primaryActions.length - 1;
28
+ return /* @__PURE__ */ P(a, {
29
+ size: "sm",
30
+ variant: r ? "default" : "outline",
31
+ disabled: K?.includes(e),
32
+ onClick: () => W(e, V),
33
+ children: [/* @__PURE__ */ N(n, { className: "ttw:size-4" }), X(e)]
34
+ }, e);
35
+ })
36
+ }) : null;
37
+ return /* @__PURE__ */ N(o, {
38
+ open: z,
39
+ modal: !1,
40
+ onOpenChange: B,
41
+ children: /* @__PURE__ */ P(ee, {
42
+ showCloseButton: !1,
43
+ onFocusOutside: (e) => e.preventDefault(),
44
+ className: "ttw:overflow-y-auto ttw:border-l-0 ttw:p-0 ttw:sm:max-w-150",
45
+ children: [
46
+ /* @__PURE__ */ N(s, {
47
+ className: "ttw:sr-only",
48
+ children: q.hiddenDescription
49
+ }),
50
+ Y ? null : /* @__PURE__ */ N(k, {
51
+ label: q.closeButton,
52
+ onClose: G,
53
+ className: m(v, "ttw:absolute ttw:right-4 ttw:top-4 ttw:z-10")
54
+ }),
55
+ H && !U ? /* @__PURE__ */ N(se, { ...H }) : !Y || !V || !J ? /* @__PURE__ */ P("div", {
56
+ className: "ttw:flex ttw:h-full ttw:w-full ttw:items-center ttw:justify-center",
57
+ children: [/* @__PURE__ */ N(c, {
58
+ className: "ttw:sr-only",
59
+ children: q.loadingTitle
60
+ }), /* @__PURE__ */ N(j, {})]
61
+ }) : /* @__PURE__ */ P(M, { children: [
62
+ J.seriesLink ? /* @__PURE__ */ N("div", {
63
+ className: "ttw:border-b ttw:border-border ttw:px-6 ttw:py-3",
64
+ children: /* @__PURE__ */ P("button", {
65
+ type: "button",
66
+ onClick: J.seriesLink.onOpen,
67
+ className: "ttw:flex ttw:items-center ttw:gap-1 ttw:text-sm ttw:text-primary ttw:hover:underline",
68
+ children: [/* @__PURE__ */ N(F, {
69
+ className: "ttw:size-4",
70
+ "aria-hidden": "true"
71
+ }), J.seriesLink.backLabel]
72
+ })
73
+ }) : null,
74
+ /* @__PURE__ */ P(te, {
75
+ 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",
76
+ children: [/* @__PURE__ */ P("div", {
77
+ className: "ttw:flex ttw:flex-col ttw:gap-0.5",
78
+ children: [/* @__PURE__ */ N(c, {
79
+ className: "ttw:text-xl ttw:font-semibold ttw:text-foreground",
80
+ children: V.title
81
+ }), J.subtitle ? /* @__PURE__ */ N(p, {
82
+ variant: "body2",
83
+ color: "muted",
84
+ children: J.subtitle
85
+ }) : null]
86
+ }), /* @__PURE__ */ N(d, {
87
+ delayDuration: 500,
88
+ children: /* @__PURE__ */ P("div", {
89
+ className: "ttw:flex ttw:items-center ttw:gap-1.5",
90
+ children: [
91
+ V.pdfUrl ? /* @__PURE__ */ P(l, { children: [/* @__PURE__ */ N(f, {
92
+ asChild: !0,
93
+ onFocus: x,
94
+ children: /* @__PURE__ */ N(a, {
95
+ asChild: !0,
96
+ variant: "ghost",
97
+ size: "icon",
98
+ className: v,
99
+ children: /* @__PURE__ */ N("a", {
100
+ href: V.pdfUrl,
101
+ target: "_blank",
102
+ rel: "noreferrer",
103
+ "aria-label": q.viewPdfButton,
104
+ children: /* @__PURE__ */ N(L, { className: "ttw:size-4" })
105
+ })
106
+ })
107
+ }), /* @__PURE__ */ N(u, {
108
+ className: b,
109
+ arrowClassName: y,
110
+ children: q.viewPdfButton
111
+ })] }) : null,
112
+ J.overflowActions.length > 0 ? /* @__PURE__ */ N(ce, {
113
+ actions: J.overflowActions,
114
+ triggerLabel: q.moreActionsLabel,
115
+ getActionLabel: X,
116
+ onSelect: (e) => W(e, V),
117
+ disabledActions: K,
118
+ className: v
119
+ }) : null,
120
+ /* @__PURE__ */ P(l, { children: [/* @__PURE__ */ N(f, {
121
+ asChild: !0,
122
+ onFocus: x,
123
+ children: /* @__PURE__ */ N(k, {
124
+ label: q.closeButton,
125
+ onClose: G,
126
+ className: v
127
+ })
128
+ }), /* @__PURE__ */ N(u, {
129
+ className: b,
130
+ arrowClassName: y,
131
+ children: q.closeButton
132
+ })] })
133
+ ]
134
+ })
135
+ })]
136
+ }),
137
+ /* @__PURE__ */ P("div", {
138
+ className: "ttw:flex ttw:flex-col",
139
+ children: [/* @__PURE__ */ N("div", {
140
+ className: "ttw:px-6",
141
+ children: Q ? /* @__PURE__ */ P("div", {
142
+ className: "ttw:flex ttw:flex-col ttw:gap-3 ttw:rounded-lg ttw:bg-violet-50 ttw:p-4",
143
+ children: [
144
+ /* @__PURE__ */ P("div", {
145
+ className: "ttw:flex ttw:flex-col ttw:gap-0.5",
146
+ children: [/* @__PURE__ */ N(p, {
147
+ variant: "caption",
148
+ color: "muted",
149
+ children: q.recurringAmountCaption
150
+ }), /* @__PURE__ */ P("div", {
151
+ className: "ttw:flex ttw:items-baseline ttw:gap-1.5",
152
+ children: [/* @__PURE__ */ N(p, {
153
+ component: "span",
154
+ variant: "h3",
155
+ className: ae[J.amountTone],
156
+ children: Q.amountLabel
157
+ }), /* @__PURE__ */ N(p, {
158
+ component: "span",
159
+ variant: "body2",
160
+ color: "muted",
161
+ children: Q.amountPeriodLabel
162
+ })]
163
+ })]
164
+ }),
165
+ /* @__PURE__ */ P("div", {
166
+ className: "ttw:flex ttw:items-center ttw:gap-2",
167
+ children: [/* @__PURE__ */ P(i, {
168
+ variant: "outline",
169
+ className: "ttw:gap-1 ttw:border-violet-200 ttw:bg-violet-50 ttw:text-violet-700",
170
+ children: [/* @__PURE__ */ N(R, { className: "ttw:size-3" }), q.recurringBadge]
171
+ }), /* @__PURE__ */ N(le, {
172
+ label: Q.statusLabel,
173
+ tone: Q.statusTone,
174
+ icon: Q.statusIcon
175
+ })]
176
+ }),
177
+ /* @__PURE__ */ P("div", {
178
+ className: "ttw:flex ttw:gap-12",
179
+ children: [/* @__PURE__ */ P("div", {
180
+ className: "ttw:flex ttw:flex-col ttw:gap-0.5",
181
+ children: [/* @__PURE__ */ N(p, {
182
+ variant: "caption",
183
+ color: "muted",
184
+ children: q.startsOnCaption
185
+ }), /* @__PURE__ */ N(p, {
186
+ component: "span",
187
+ variant: "body2",
188
+ children: Q.startsOnLabel
189
+ })]
190
+ }), /* @__PURE__ */ P("div", {
191
+ className: "ttw:flex ttw:flex-col ttw:gap-0.5",
192
+ children: [/* @__PURE__ */ N(p, {
193
+ variant: "caption",
194
+ color: "muted",
195
+ children: q.endsOnCaption
196
+ }), /* @__PURE__ */ N(p, {
197
+ component: "span",
198
+ variant: "body2",
199
+ children: Q.endsOnLabel
200
+ })]
201
+ })]
202
+ }),
203
+ $
204
+ ]
205
+ }) : /* @__PURE__ */ P("div", {
206
+ className: m("ttw:flex ttw:flex-col ttw:gap-3 ttw:rounded-lg ttw:bg-muted ttw:p-4", me && "ttw:border ttw:border-red-200"),
207
+ children: [
208
+ /* @__PURE__ */ N("div", {
209
+ className: "ttw:flex ttw:flex-row ttw:flex-wrap ttw:gap-x-12 ttw:gap-y-2",
210
+ children: J.amountRows.map((e) => /* @__PURE__ */ N(E, {
211
+ row: e,
212
+ defaultTone: J.amountTone
213
+ }, e.label))
214
+ }),
215
+ /* @__PURE__ */ P("div", {
216
+ className: "ttw:flex ttw:items-center ttw:gap-2",
217
+ children: [J.overdueLabel ? /* @__PURE__ */ P("span", {
218
+ 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",
219
+ children: [/* @__PURE__ */ N(I, { className: "ttw:size-3" }), J.overdueLabel]
220
+ }) : /* @__PURE__ */ N(re, {
221
+ label: J.statusLabel,
222
+ tone: V.statusTone,
223
+ icon: Z ? /* @__PURE__ */ N(Z, { className: "ttw:size-3" }) : void 0
224
+ }), J.recurring ? /* @__PURE__ */ P(i, {
225
+ variant: "outline",
226
+ className: "ttw:gap-1 ttw:border-violet-200 ttw:bg-violet-50 ttw:text-violet-700",
227
+ children: [/* @__PURE__ */ N(R, { className: "ttw:size-3" }), q.recurringBadge]
228
+ }) : null]
229
+ }),
230
+ /* @__PURE__ */ P("div", {
231
+ className: "ttw:flex ttw:gap-12",
232
+ children: [/* @__PURE__ */ P("div", {
233
+ className: "ttw:flex ttw:flex-col ttw:gap-0.5",
234
+ children: [/* @__PURE__ */ N(p, {
235
+ variant: "caption",
236
+ color: "muted",
237
+ children: q.invoiceDateCaption
238
+ }), /* @__PURE__ */ N(p, {
239
+ component: "span",
240
+ variant: "body2",
241
+ children: J.issueDateLabel
242
+ })]
243
+ }), /* @__PURE__ */ P("div", {
244
+ className: "ttw:flex ttw:flex-col ttw:gap-0.5",
245
+ children: [/* @__PURE__ */ N(p, {
246
+ variant: "caption",
247
+ color: "muted",
248
+ children: J.dueDateCaption
249
+ }), /* @__PURE__ */ N(p, {
250
+ component: "span",
251
+ variant: "body2",
252
+ children: J.dueDateLabel
253
+ })]
254
+ })]
255
+ }),
256
+ $
257
+ ]
258
+ })
259
+ }), /* @__PURE__ */ P("div", {
260
+ className: "ttw:px-6",
261
+ children: [
262
+ J.paymentHistory ? /* @__PURE__ */ P("section", {
263
+ "aria-label": q.paymentHistoryHeading,
264
+ className: "ttw:border-b ttw:border-border ttw:py-4",
265
+ children: [/* @__PURE__ */ N(p, {
266
+ component: "h3",
267
+ variant: "body2",
268
+ className: "ttw:mb-3 ttw:font-medium",
269
+ children: q.paymentHistoryHeading
270
+ }), J.paymentHistory.isLoading ? /* @__PURE__ */ N("div", {
271
+ className: "ttw:flex ttw:py-2",
272
+ children: /* @__PURE__ */ N(j, {
273
+ className: "ttw:size-5 ttw:border-2",
274
+ label: q.paymentHistoryLoading
275
+ })
276
+ }) : J.paymentHistory.rows.length === 0 ? /* @__PURE__ */ N(p, {
277
+ variant: "body2",
278
+ className: J.paymentHistory.emptyTone === "danger" ? "ttw:text-red-600" : "ttw:text-muted-foreground",
279
+ children: q.paymentHistoryEmpty
280
+ }) : /* @__PURE__ */ P("div", {
281
+ className: "ttw:flex ttw:flex-col",
282
+ children: [J.paymentHistory.rows.map((e) => /* @__PURE__ */ P("div", {
283
+ className: "ttw:flex ttw:justify-between ttw:border-b ttw:border-border ttw:py-2",
284
+ children: [/* @__PURE__ */ N(p, {
285
+ component: "span",
286
+ variant: "body2",
287
+ children: e.dateLabel
288
+ }), /* @__PURE__ */ N(p, {
289
+ component: "span",
290
+ variant: "body2",
291
+ children: e.amountLabel
292
+ })]
293
+ }, e.id)), /* @__PURE__ */ P("div", {
294
+ className: "ttw:flex ttw:justify-between ttw:py-2 ttw:font-medium",
295
+ children: [/* @__PURE__ */ N(p, {
296
+ component: "span",
297
+ variant: "body2",
298
+ children: q.paymentHistoryTotalLabel
299
+ }), /* @__PURE__ */ N(p, {
300
+ component: "span",
301
+ variant: "body2",
302
+ children: J.paymentHistory.totalLabel
303
+ })]
304
+ })]
305
+ })]
306
+ }) : null,
307
+ J.customerName || J.customerContact.length > 0 ? /* @__PURE__ */ P("section", {
308
+ "aria-label": q.customerDetailsHeading,
309
+ className: "ttw:border-b ttw:border-border ttw:py-4",
310
+ children: [/* @__PURE__ */ N(p, {
311
+ component: "h3",
312
+ variant: "body2",
313
+ className: "ttw:mb-3 ttw:font-medium",
314
+ children: q.customerDetailsHeading
315
+ }), /* @__PURE__ */ P("div", {
316
+ className: "ttw:flex ttw:flex-col",
317
+ children: [J.customerName ? /* @__PURE__ */ N(oe, { ...J.customerName }) : null, J.customerContact.map((e) => /* @__PURE__ */ N(A, { ...e }, e.label))]
318
+ })]
319
+ }) : null,
320
+ /* @__PURE__ */ P(e, {
321
+ type: "multiple",
322
+ value: de,
323
+ onValueChange: fe,
324
+ className: "ttw:w-full",
325
+ children: [
326
+ /* @__PURE__ */ P(n, {
327
+ value: h.billing,
328
+ className: w,
329
+ children: [/* @__PURE__ */ N(r, {
330
+ className: T,
331
+ iconClassName: S,
332
+ children: /* @__PURE__ */ N("span", {
333
+ className: "ttw:group-hover:underline",
334
+ children: q.billingHeading
335
+ })
336
+ }), /* @__PURE__ */ N(t, { children: /* @__PURE__ */ P("div", {
337
+ className: "ttw:flex ttw:flex-col",
338
+ children: [J.billingItems.map((e) => /* @__PURE__ */ N(A, { ...e }, e.label)), J.seriesLink ? /* @__PURE__ */ P("div", {
339
+ className: "ttw:flex ttw:gap-4 ttw:border-b ttw:border-border ttw:py-3 ttw:last:border-b-0",
340
+ children: [/* @__PURE__ */ N(p, {
341
+ component: "span",
342
+ variant: "body2",
343
+ color: "muted",
344
+ className: "ttw:w-40 ttw:shrink-0",
345
+ children: q.recurringSeriesRowLabel
346
+ }), /* @__PURE__ */ N("button", {
347
+ type: "button",
348
+ onClick: J.seriesLink.onOpen,
349
+ className: "ttw:text-left ttw:text-primary ttw:hover:underline",
350
+ children: J.seriesLink.title
351
+ })]
352
+ }) : null]
353
+ }) })]
354
+ }),
355
+ J.lineItemsSection ? /* @__PURE__ */ P(n, {
356
+ value: h.lineItems,
357
+ className: w,
358
+ children: [/* @__PURE__ */ N(r, {
359
+ className: T,
360
+ iconClassName: S,
361
+ children: /* @__PURE__ */ P("span", {
362
+ className: "ttw:flex ttw:items-center ttw:gap-2",
363
+ children: [/* @__PURE__ */ N("span", {
364
+ className: "ttw:group-hover:underline",
365
+ children: q.lineItemsHeading
366
+ }), /* @__PURE__ */ N(i, {
367
+ variant: "secondary",
368
+ className: C,
369
+ children: J.lineItemsSection.countLabel
370
+ })]
371
+ })
372
+ }), /* @__PURE__ */ N(t, { children: /* @__PURE__ */ P("div", {
373
+ className: "ttw:flex ttw:flex-col",
374
+ children: [V.lineItems.length === 0 ? /* @__PURE__ */ N(p, {
375
+ variant: "body2",
376
+ color: "muted",
377
+ className: "ttw:py-3",
378
+ children: q.noLineItems
379
+ }) : V.lineItems.map((e) => /* @__PURE__ */ P("div", {
380
+ className: "ttw:flex ttw:items-start ttw:justify-between ttw:border-b ttw:border-border ttw:py-3",
381
+ children: [/* @__PURE__ */ P("div", {
382
+ className: "ttw:flex ttw:flex-col",
383
+ children: [/* @__PURE__ */ N(p, {
384
+ component: "span",
385
+ variant: "body2",
386
+ className: "ttw:font-medium",
387
+ children: e.name
388
+ }), /* @__PURE__ */ P(p, {
389
+ component: "span",
390
+ variant: "body2",
391
+ color: "muted",
392
+ children: [
393
+ e.quantityLabel,
394
+ " ",
395
+ q.lineItemMultiplier,
396
+ " ",
397
+ e.unitPriceLabel,
398
+ " ",
399
+ q.lineItemEaLabel
400
+ ]
401
+ })]
402
+ }), /* @__PURE__ */ N(p, {
403
+ component: "span",
404
+ variant: "body2",
405
+ children: e.totalLabel
406
+ })]
407
+ }, e.id)), J.lineItemsSection.totals.length > 0 ? /* @__PURE__ */ N("div", {
408
+ className: "ttw:flex ttw:flex-col ttw:gap-1 ttw:py-3",
409
+ children: J.lineItemsSection.totals.map((e) => /* @__PURE__ */ P("div", {
410
+ className: m("ttw:flex ttw:justify-between", e.emphasis && "ttw:font-medium"),
411
+ children: [/* @__PURE__ */ N(p, {
412
+ component: "span",
413
+ variant: "body2",
414
+ children: e.label
415
+ }), /* @__PURE__ */ N(p, {
416
+ component: "span",
417
+ variant: "body2",
418
+ children: e.value
419
+ })]
420
+ }, e.label))
421
+ }) : null]
422
+ }) })]
423
+ }) : null,
424
+ J.notes ? /* @__PURE__ */ P(n, {
425
+ value: h.notes,
426
+ className: w,
427
+ children: [/* @__PURE__ */ N(r, {
428
+ className: T,
429
+ iconClassName: S,
430
+ children: /* @__PURE__ */ P("span", {
431
+ className: "ttw:flex ttw:items-center ttw:gap-2",
432
+ children: [/* @__PURE__ */ N("span", {
433
+ className: "ttw:group-hover:underline",
434
+ children: q.notesHeading
435
+ }), /* @__PURE__ */ N(i, {
436
+ variant: "secondary",
437
+ className: C,
438
+ children: J.notes.countLabel
439
+ })]
440
+ })
441
+ }), /* @__PURE__ */ N(t, { children: /* @__PURE__ */ P("div", {
442
+ className: "ttw:flex ttw:flex-col ttw:gap-3",
443
+ children: [J.notes.opening ? /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(p, {
444
+ variant: "body2",
445
+ className: "ttw:mb-1 ttw:font-medium",
446
+ children: q.notesOpeningLabel
447
+ }), /* @__PURE__ */ N(p, {
448
+ variant: "body2",
449
+ color: "muted",
450
+ children: J.notes.opening
451
+ })] }) : null, J.notes.closing ? /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(p, {
452
+ variant: "body2",
453
+ className: "ttw:mb-1 ttw:font-medium",
454
+ children: q.notesClosingLabel
455
+ }), /* @__PURE__ */ N(p, {
456
+ variant: "body2",
457
+ color: "muted",
458
+ children: J.notes.closing
459
+ })] }) : null]
460
+ }) })]
461
+ }) : null,
462
+ /* @__PURE__ */ N(D, {
463
+ attachments: J.attachments,
464
+ labels: q
465
+ }),
466
+ /* @__PURE__ */ N(O, {
467
+ auditHistory: J.auditHistory,
468
+ labels: q
469
+ })
470
+ ]
471
+ }),
472
+ Q ? /* @__PURE__ */ P("section", {
473
+ "aria-label": Q.scheduleTitle,
474
+ className: "ttw:border-t ttw:border-border ttw:py-4",
475
+ children: [/* @__PURE__ */ N(p, {
476
+ component: "h3",
477
+ variant: "body2",
478
+ className: "ttw:mb-3 ttw:font-medium",
479
+ children: Q.scheduleTitle
480
+ }), /* @__PURE__ */ N(ue, {
481
+ rows: Q.schedule,
482
+ labels: q
483
+ })]
484
+ }) : null
485
+ ]
486
+ })]
487
+ })
488
+ ] })
489
+ ]
490
+ })
69
491
  });
70
492
  }
71
493
  //#endregion
72
- export { u as ReceivableNotesSection };
494
+ export { z as ReceivableDetailsPanel, z as default };