@tesouro/embedded-components-react 0.5.20 → 0.5.23

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.
@@ -3,252 +3,253 @@ import { ErrorState as a } from "../../../shared/ui/dist/lib/ErrorState/ErrorSta
3
3
  import "../../../shared/ui/dist/index.js";
4
4
  import { ApprovalPolicyCard as o } from "./index13.js";
5
5
  import "./index14.js";
6
- import { BillRejectionNotice as s } from "./index16.js";
7
- import { BillStatusBadge as c } from "./index19.js";
6
+ import { BillRejectionNotice as s } from "./index17.js";
7
+ import { BADGE_TONE_CLASS_NAME as c } from "./index15.js";
8
+ import { BillStatusBadge as l } from "./index19.js";
8
9
  import "./index20.js";
9
- import { DueDateValue as l } from "./index22.js";
10
+ import { DueDateValue as u } from "./index22.js";
10
11
  import "./index23.js";
11
- import { PaymentHistoryList as u } from "./index24.js";
12
+ import { PaymentHistoryList as d } from "./index24.js";
12
13
  import "./index25.js";
13
- import { VendorSummaryCard as d } from "./index28.js";
14
+ import { VendorSummaryCard as f } from "./index28.js";
14
15
  import "./index29.js";
15
- import { mergeBillDetailBodyLabels as f } from "./index30.js";
16
- import { BillActionButtons as p, NO_BILL_ACTIONS as m } from "./index15.js";
17
- import { useMemo as h } from "react";
18
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
19
- import { AlertTriangle as v } from "lucide-react";
16
+ import { mergeBillDetailBodyLabels as p } from "./index30.js";
17
+ import { BillActionButtons as m, NO_BILL_ACTIONS as h } from "./index16.js";
18
+ import { useMemo as g } from "react";
19
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
20
+ import { AlertTriangle as y } from "lucide-react";
20
21
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js
21
- var y = "ttw:text-base ttw:font-semibold", b = "ttw:px-3 ttw:py-2", x = "ttw:flex ttw:items-center ttw:justify-between ttw:gap-4 ttw:border-b ttw:border-border ttw:py-3 ttw:last:border-b-0";
22
- function S({ view: S, actions: C = m, scheduledSummary: w, showApprovalOverrideNotice: T, paymentInstructionsForm: E, hideMissingPaymentInstructions: D, onEditPaymentInstructions: O, paymentHistoryError: k, paymentHistoryLoading: A, isLoading: j, isError: M, labels: N }) {
23
- let P = h(() => f(N), [N]), F = h(() => ({
24
- ...P.payToCard,
25
- payToHeading: S?.paidOnLabel ? P.payToHeadingPaid : P.payToHeading
26
- }), [P, S?.paidOnLabel]);
27
- if (M) return /* @__PURE__ */ g(a, {
28
- title: P.errorTitle,
29
- description: P.errorDescription
22
+ var b = "ttw:text-base ttw:font-semibold", x = "ttw:px-3 ttw:py-2", S = "ttw:flex ttw:items-center ttw:justify-between ttw:gap-4 ttw:border-b ttw:border-border ttw:py-3 ttw:last:border-b-0";
23
+ function C({ view: C, actions: w = h, scheduledSummary: T, showApprovalOverrideNotice: E, paymentInstructionsForm: D, hideMissingPaymentInstructions: O, onEditPaymentInstructions: k, paymentHistoryError: A, paymentHistoryLoading: j, isLoading: M, isError: N, labels: P }) {
24
+ let F = g(() => p(P), [P]), I = g(() => ({
25
+ ...F.payToCard,
26
+ payToHeading: C?.paidOnLabel ? F.payToHeadingPaid : F.payToHeading
27
+ }), [F, C?.paidOnLabel]);
28
+ if (N) return /* @__PURE__ */ _(a, {
29
+ title: F.errorTitle,
30
+ description: F.errorDescription
30
31
  });
31
- if (j || !S) return /* @__PURE__ */ _("div", {
32
+ if (M || !C) return /* @__PURE__ */ v("div", {
32
33
  "aria-hidden": !0,
33
34
  className: "ttw:flex ttw:flex-col ttw:gap-6",
34
35
  children: [
35
- /* @__PURE__ */ g(n, { className: "ttw:h-40 ttw:w-full" }),
36
- /* @__PURE__ */ g(n, { className: "ttw:h-32 ttw:w-full" }),
37
- /* @__PURE__ */ g(n, { className: "ttw:h-24 ttw:w-full" })
36
+ /* @__PURE__ */ _(n, { className: "ttw:h-40 ttw:w-full" }),
37
+ /* @__PURE__ */ _(n, { className: "ttw:h-32 ttw:w-full" }),
38
+ /* @__PURE__ */ _(n, { className: "ttw:h-24 ttw:w-full" })
38
39
  ]
39
40
  });
40
- let I = D || S.payTo.fields.length > 0 ? void 0 : E;
41
- return /* @__PURE__ */ _("div", {
41
+ let L = O || C.payTo.fields.length > 0 ? void 0 : D;
42
+ return /* @__PURE__ */ v("div", {
42
43
  className: "ttw:flex ttw:flex-col ttw:gap-6",
43
44
  children: [
44
- I ? /* @__PURE__ */ _("div", {
45
+ L ? /* @__PURE__ */ v("div", {
45
46
  className: "ttw:flex ttw:items-center ttw:gap-3 ttw:rounded-md ttw:border ttw:border-amber-200 ttw:bg-amber-50 ttw:px-3 ttw:py-2.5",
46
47
  children: [
47
- /* @__PURE__ */ g(v, { className: "ttw:size-4 ttw:shrink-0 ttw:text-amber-800" }),
48
- /* @__PURE__ */ g("p", {
48
+ /* @__PURE__ */ _(y, { className: "ttw:size-4 ttw:shrink-0 ttw:text-amber-800" }),
49
+ /* @__PURE__ */ _("p", {
49
50
  className: "ttw:flex-1 ttw:text-sm ttw:text-foreground",
50
- children: P.missingPaymentInstructionsBanner
51
+ children: F.missingPaymentInstructionsBanner
51
52
  }),
52
- /* @__PURE__ */ g(t, {
53
+ /* @__PURE__ */ _(t, {
53
54
  type: "button",
54
55
  variant: "outline",
55
56
  size: "sm",
56
- onClick: I.onOpen,
57
- children: P.addPaymentInstructions
57
+ onClick: L.onOpen,
58
+ children: F.addPaymentInstructions
58
59
  })
59
60
  ]
60
61
  }) : null,
61
- /* @__PURE__ */ _("section", {
62
+ /* @__PURE__ */ v("section", {
62
63
  className: "ttw:flex ttw:flex-col ttw:gap-3 ttw:rounded-lg ttw:bg-muted/50 ttw:p-4",
63
64
  children: [
64
- S.paidOnLabel ? /* @__PURE__ */ _("div", {
65
+ C.paidOnLabel ? /* @__PURE__ */ v("div", {
65
66
  className: "ttw:grid ttw:grid-cols-2 ttw:gap-x-6",
66
- children: [/* @__PURE__ */ _("div", {
67
+ children: [/* @__PURE__ */ v("div", {
67
68
  className: "ttw:flex ttw:flex-col ttw:gap-1",
68
- children: [/* @__PURE__ */ g("span", {
69
+ children: [/* @__PURE__ */ _("span", {
69
70
  className: "ttw:text-sm ttw:text-muted-foreground",
70
- children: P.amountDueHeading
71
- }), /* @__PURE__ */ g("span", {
71
+ children: F.amountDueHeading
72
+ }), /* @__PURE__ */ _("span", {
72
73
  className: "ttw:text-3xl ttw:font-semibold",
73
- children: S.amountDue
74
+ children: C.amountDue
74
75
  })]
75
- }), /* @__PURE__ */ _("div", {
76
+ }), /* @__PURE__ */ v("div", {
76
77
  className: "ttw:flex ttw:flex-col ttw:gap-1",
77
- children: [/* @__PURE__ */ g("span", {
78
+ children: [/* @__PURE__ */ _("span", {
78
79
  className: "ttw:text-sm ttw:text-muted-foreground",
79
- children: P.amountPaidHeading
80
- }), /* @__PURE__ */ g("span", {
80
+ children: F.amountPaidHeading
81
+ }), /* @__PURE__ */ _("span", {
81
82
  className: "ttw:text-3xl ttw:font-semibold ttw:text-emerald-600",
82
- children: S.amountPaid
83
+ children: C.amountPaid
83
84
  })]
84
85
  })]
85
- }) : /* @__PURE__ */ _("div", {
86
+ }) : /* @__PURE__ */ v("div", {
86
87
  className: "ttw:flex ttw:flex-col ttw:gap-1",
87
- children: [/* @__PURE__ */ g("span", {
88
+ children: [/* @__PURE__ */ _("span", {
88
89
  className: "ttw:text-sm ttw:text-muted-foreground",
89
- children: P.amountDueHeading
90
- }), /* @__PURE__ */ g("span", {
90
+ children: F.amountDueHeading
91
+ }), /* @__PURE__ */ _("span", {
91
92
  className: "ttw:text-3xl ttw:font-semibold",
92
- children: S.amountDue
93
+ children: C.amountDue
93
94
  })]
94
95
  }),
95
- /* @__PURE__ */ g("div", { children: S.paidOnLabel ? /* @__PURE__ */ g(e, {
96
+ /* @__PURE__ */ _("div", { children: C.paidOnLabel ? /* @__PURE__ */ _(e, {
96
97
  variant: "outline",
97
98
  className: "ttw:border-emerald-200 ttw:bg-emerald-50 ttw:text-emerald-700",
98
- children: S.paidOnLabel
99
- }) : /* @__PURE__ */ g(c, {
100
- status: S.status,
101
- tone: S.statusTone,
102
- labels: P.statusBadge
99
+ children: C.paidOnLabel
100
+ }) : T ? /* @__PURE__ */ _(e, {
101
+ variant: "outline",
102
+ className: c.committed,
103
+ children: T
104
+ }) : /* @__PURE__ */ _(l, {
105
+ status: C.status,
106
+ tone: C.statusTone,
107
+ labels: F.statusBadge
103
108
  }) }),
104
- /* @__PURE__ */ _("div", {
109
+ /* @__PURE__ */ v("div", {
105
110
  className: "ttw:grid ttw:grid-cols-2 ttw:gap-x-6",
106
- children: [/* @__PURE__ */ _("div", {
111
+ children: [/* @__PURE__ */ v("div", {
107
112
  className: "ttw:flex ttw:flex-col",
108
- children: [/* @__PURE__ */ g("span", {
113
+ children: [/* @__PURE__ */ _("span", {
109
114
  className: "ttw:text-xs ttw:text-muted-foreground",
110
- children: P.invoiceDateLabel
111
- }), /* @__PURE__ */ g("span", {
115
+ children: F.invoiceDateLabel
116
+ }), /* @__PURE__ */ _("span", {
112
117
  className: "ttw:text-sm ttw:font-medium",
113
- children: S.invoiceDateLabel
118
+ children: C.invoiceDateLabel
114
119
  })]
115
- }), /* @__PURE__ */ _("div", {
120
+ }), /* @__PURE__ */ v("div", {
116
121
  className: "ttw:flex ttw:flex-col",
117
- children: [/* @__PURE__ */ g("span", {
122
+ children: [/* @__PURE__ */ _("span", {
118
123
  className: "ttw:text-xs ttw:text-muted-foreground",
119
- children: P.dueDateLabel
120
- }), /* @__PURE__ */ g(l, {
124
+ children: F.dueDateLabel
125
+ }), /* @__PURE__ */ _(u, {
121
126
  className: "ttw:text-sm ttw:font-medium",
122
- value: S.dueDateLabel,
123
- tone: S.dueDateTone,
124
- labels: P.dueDate
127
+ value: C.dueDateLabel,
128
+ tone: C.dueDateTone,
129
+ labels: F.dueDate
125
130
  })]
126
131
  })]
127
132
  }),
128
- S.rejection ? /* @__PURE__ */ g(s, { ...S.rejection }) : null,
129
- T ? /* @__PURE__ */ g(r, {
133
+ C.rejection ? /* @__PURE__ */ _(s, { ...C.rejection }) : null,
134
+ E ? /* @__PURE__ */ _(r, {
130
135
  variant: "caption",
131
136
  color: "muted",
132
- children: P.approvalOverrideNotice
137
+ children: F.approvalOverrideNotice
133
138
  }) : null,
134
- w ? /* @__PURE__ */ g("div", { children: /* @__PURE__ */ g(e, {
135
- variant: "outline",
136
- className: "ttw:border-emerald-200 ttw:bg-emerald-50 ttw:text-emerald-700",
137
- children: w
138
- }) }) : C.row.length ? /* @__PURE__ */ g("div", {
139
+ !T && w.row.length ? /* @__PURE__ */ _("div", {
139
140
  className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-2",
140
- children: /* @__PURE__ */ g(p, { actions: C.row })
141
+ children: /* @__PURE__ */ _(m, { actions: w.row })
141
142
  }) : null
142
143
  ]
143
144
  }),
144
- /* @__PURE__ */ g(d, {
145
- summary: S.payTo,
146
- onEdit: D ? void 0 : O,
145
+ /* @__PURE__ */ _(f, {
146
+ summary: C.payTo,
147
+ onEdit: O ? void 0 : k,
147
148
  instructionsCollapsed: !0,
148
- paymentInstructions: E && !D ? {
149
- isOpen: E.isOpen,
150
- values: E.values,
151
- errors: E.errors,
152
- isSaving: E.isSaving,
153
- onOpen: E.onOpen,
154
- onChange: E.onChange,
155
- onSave: E.onSave,
156
- onCancel: E.onCancel
149
+ paymentInstructions: D && !O ? {
150
+ isOpen: D.isOpen,
151
+ values: D.values,
152
+ errors: D.errors,
153
+ isSaving: D.isSaving,
154
+ onOpen: D.onOpen,
155
+ onChange: D.onChange,
156
+ onSave: D.onSave,
157
+ onCancel: D.onCancel
157
158
  } : void 0,
158
- labels: F
159
+ labels: I
159
160
  }),
160
- S.paymentHistory.length || k || A ? /* @__PURE__ */ _("section", {
161
+ C.paymentHistory.length || A || j ? /* @__PURE__ */ v("section", {
161
162
  className: "ttw:flex ttw:flex-col ttw:gap-3",
162
- children: [/* @__PURE__ */ g("h3", {
163
- className: y,
164
- children: P.paymentHistoryHeading
165
- }), k ? /* @__PURE__ */ g("p", {
163
+ children: [/* @__PURE__ */ _("h3", {
164
+ className: b,
165
+ children: F.paymentHistoryHeading
166
+ }), A ? /* @__PURE__ */ _("p", {
166
167
  className: "ttw:text-sm ttw:text-muted-foreground",
167
- children: P.paymentHistoryErrorDescription
168
- }) : A ? /* @__PURE__ */ g(n, { className: "ttw:h-9 ttw:w-full" }) : /* @__PURE__ */ g(u, { records: S.paymentHistory })]
168
+ children: F.paymentHistoryErrorDescription
169
+ }) : j ? /* @__PURE__ */ _(n, { className: "ttw:h-9 ttw:w-full" }) : /* @__PURE__ */ _(d, { records: C.paymentHistory })]
169
170
  }) : null,
170
- /* @__PURE__ */ g("dl", {
171
+ /* @__PURE__ */ _("dl", {
171
172
  className: "ttw:flex ttw:flex-col",
172
- children: S.invoiceFields.map((e) => /* @__PURE__ */ _("div", {
173
- className: x,
174
- children: [/* @__PURE__ */ g("dt", {
173
+ children: C.invoiceFields.map((e) => /* @__PURE__ */ v("div", {
174
+ className: S,
175
+ children: [/* @__PURE__ */ _("dt", {
175
176
  className: "ttw:text-sm ttw:text-muted-foreground",
176
177
  children: e.label
177
- }), /* @__PURE__ */ g("dd", {
178
+ }), /* @__PURE__ */ _("dd", {
178
179
  className: "ttw:text-right ttw:text-sm ttw:font-medium",
179
180
  children: e.value
180
181
  })]
181
182
  }, e.label))
182
183
  }),
183
- /* @__PURE__ */ g("section", { children: /* @__PURE__ */ _("table", {
184
+ /* @__PURE__ */ _("section", { children: /* @__PURE__ */ v("table", {
184
185
  className: "ttw:w-full ttw:text-sm",
185
- children: [/* @__PURE__ */ g("thead", { children: /* @__PURE__ */ _("tr", {
186
+ children: [/* @__PURE__ */ _("thead", { children: /* @__PURE__ */ v("tr", {
186
187
  className: "ttw:bg-muted/50 ttw:text-xs ttw:text-muted-foreground",
187
188
  children: [
188
- /* @__PURE__ */ g("th", {
189
- className: i(b, "ttw:text-left ttw:font-normal"),
190
- children: P.descriptionAndGlCodeColumn
189
+ /* @__PURE__ */ _("th", {
190
+ className: i(x, "ttw:text-left ttw:font-normal"),
191
+ children: F.descriptionAndGlCodeColumn
191
192
  }),
192
- /* @__PURE__ */ g("th", {
193
- className: i(b, "ttw:text-right ttw:font-normal"),
194
- children: P.qtyPriceColumn
193
+ /* @__PURE__ */ _("th", {
194
+ className: i(x, "ttw:text-right ttw:font-normal"),
195
+ children: F.qtyPriceColumn
195
196
  }),
196
- /* @__PURE__ */ g("th", {
197
- className: i(b, "ttw:text-right ttw:font-normal"),
198
- children: P.amountColumn
197
+ /* @__PURE__ */ _("th", {
198
+ className: i(x, "ttw:text-right ttw:font-normal"),
199
+ children: F.amountColumn
199
200
  })
200
201
  ]
201
- }) }), /* @__PURE__ */ _("tbody", { children: [S.lineItems.map((e) => /* @__PURE__ */ _("tr", {
202
+ }) }), /* @__PURE__ */ v("tbody", { children: [C.lineItems.map((e) => /* @__PURE__ */ v("tr", {
202
203
  className: "ttw:border-b ttw:border-border",
203
204
  children: [
204
- /* @__PURE__ */ g("td", {
205
- className: b,
206
- children: /* @__PURE__ */ _("div", {
205
+ /* @__PURE__ */ _("td", {
206
+ className: x,
207
+ children: /* @__PURE__ */ v("div", {
207
208
  className: "ttw:flex ttw:flex-col",
208
- children: [/* @__PURE__ */ g("span", { children: e.description }), /* @__PURE__ */ g("span", {
209
+ children: [/* @__PURE__ */ _("span", { children: e.description }), /* @__PURE__ */ _("span", {
209
210
  className: "ttw:text-xs ttw:text-muted-foreground",
210
211
  children: e.glCodeLabel
211
212
  })]
212
213
  })
213
214
  }),
214
- /* @__PURE__ */ g("td", {
215
- className: i(b, "ttw:text-right ttw:whitespace-nowrap ttw:text-muted-foreground"),
215
+ /* @__PURE__ */ _("td", {
216
+ className: i(x, "ttw:text-right ttw:whitespace-nowrap ttw:text-muted-foreground"),
216
217
  children: e.qtyPriceLabel
217
218
  }),
218
- /* @__PURE__ */ g("td", {
219
- className: i(b, "ttw:text-right ttw:whitespace-nowrap"),
219
+ /* @__PURE__ */ _("td", {
220
+ className: i(x, "ttw:text-right ttw:whitespace-nowrap"),
220
221
  children: e.amount
221
222
  })
222
223
  ]
223
- }, e.id)), S.amountRows.map((e) => /* @__PURE__ */ _("tr", {
224
+ }, e.id)), C.amountRows.map((e) => /* @__PURE__ */ v("tr", {
224
225
  className: i(e.emphasis ? "ttw:font-semibold" : "ttw:text-muted-foreground"),
225
- children: [/* @__PURE__ */ g("td", {
226
+ children: [/* @__PURE__ */ _("td", {
226
227
  colSpan: 2,
227
- className: b,
228
+ className: x,
228
229
  children: e.label
229
- }), /* @__PURE__ */ g("td", {
230
- className: i(b, "ttw:text-right ttw:whitespace-nowrap", e.emphasis && "ttw:text-foreground"),
230
+ }), /* @__PURE__ */ _("td", {
231
+ className: i(x, "ttw:text-right ttw:whitespace-nowrap", e.emphasis && "ttw:text-foreground"),
231
232
  children: e.value
232
233
  })]
233
234
  }, e.label))] })]
234
235
  }) }),
235
- S.approvalPolicy ? /* @__PURE__ */ g(o, {
236
- view: S.approvalPolicy,
237
- labels: P.approvalPolicy
236
+ C.approvalPolicy ? /* @__PURE__ */ _(o, {
237
+ view: C.approvalPolicy,
238
+ labels: F.approvalPolicy
238
239
  }) : null,
239
- S.history.length ? /* @__PURE__ */ _("section", {
240
+ C.history.length ? /* @__PURE__ */ v("section", {
240
241
  className: "ttw:flex ttw:flex-col ttw:gap-3",
241
- children: [/* @__PURE__ */ g("h3", {
242
- className: y,
243
- children: P.historyHeading
244
- }), /* @__PURE__ */ g("ul", {
242
+ children: [/* @__PURE__ */ _("h3", {
243
+ className: b,
244
+ children: F.historyHeading
245
+ }), /* @__PURE__ */ _("ul", {
245
246
  className: "ttw:flex ttw:flex-col",
246
- children: S.history.map((e) => /* @__PURE__ */ _("li", {
247
+ children: C.history.map((e) => /* @__PURE__ */ v("li", {
247
248
  className: "ttw:flex ttw:gap-6 ttw:border-b ttw:border-border ttw:py-3 ttw:text-sm ttw:last:border-b-0",
248
- children: [/* @__PURE__ */ g("span", {
249
+ children: [/* @__PURE__ */ _("span", {
249
250
  className: "ttw:w-28 ttw:shrink-0 ttw:text-muted-foreground",
250
251
  children: e.dateLabel
251
- }), /* @__PURE__ */ g("span", { children: e.description })]
252
+ }), /* @__PURE__ */ _("span", { children: e.description })]
252
253
  }, e.id))
253
254
  })]
254
255
  }) : null
@@ -256,4 +257,4 @@ function S({ view: S, actions: C = m, scheduledSummary: w, showApprovalOverrideN
256
257
  });
257
258
  }
258
259
  //#endregion
259
- export { S as BillDetailBody, S as default };
260
+ export { C as BillDetailBody, C as default };
@@ -3,7 +3,7 @@ import { ADD_BILL_PANEL_LABELS_EN as t } from "./index6.js";
3
3
  import "./index8.js";
4
4
  import { APPROVAL_POLICY_CARD_LABELS_EN as n } from "./index12.js";
5
5
  import "./index14.js";
6
- import { BILL_STATUS_BADGE_LABELS_EN as r } from "./index17.js";
6
+ import { BILL_STATUS_BADGE_LABELS_EN as r } from "./index18.js";
7
7
  import "./index20.js";
8
8
  import { DUE_DATE_VALUE_LABELS_EN as i } from "./index21.js";
9
9
  import "./index23.js";