@tesouro/embedded-components-react 0.4.19 → 0.4.21

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 (25) hide show
  1. package/dist/index.css +11 -0
  2. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +23 -14
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +49 -50
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +0 -1
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +73 -67
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +265 -259
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +71 -65
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +5 -9
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +3 -4
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +11 -11
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +4 -4
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +1 -2
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +1 -6
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +3 -4
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +3 -2
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index29.js +1 -0
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +142 -137
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +0 -1
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index42.js +2 -5
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +2 -2
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +1 -0
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +52 -47
  24. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  25. package/package.json +1 -1
@@ -19,14 +19,15 @@ import { MarkAsPaidDialog as l } from "../../ui/dist/index92.js";
19
19
  import "../../ui/dist/index.js";
20
20
  import { usePayableDuplicateReview as u } from "./index12.js";
21
21
  import "./index13.js";
22
+ import { canOverrideApprovalPolicy as te } from "./index18.js";
22
23
  import { resolveAmountDueMinorUnits as d } from "./index19.js";
23
24
  import { PayBillFlow as f } from "./index25.js";
24
25
  import "./index26.js";
25
26
  import { mapPayableToBillDetails as p } from "./index38.js";
26
- import { mergeMarkAsPaidFlowLabels as te } from "./index14.js";
27
- import { useMarkAsPaidFlow as m } from "./index16.js";
27
+ import { mergeMarkAsPaidFlowLabels as m } from "./index14.js";
28
+ import { useMarkAsPaidFlow as h } from "./index16.js";
28
29
  import "./index17.js";
29
- import { mergeDecisionDialogCopy as h, mergePaymentHistoryMethodLabels as g } from "./index41.js";
30
+ import { mergeDecisionDialogCopy as g, mergePaymentHistoryMethodLabels as ne } from "./index41.js";
30
31
  import { buildPaymentHistory as _ } from "./index3.js";
31
32
  import { useApprovalPolicyCardView as v } from "./index32.js";
32
33
  import { useCurrentApprovalRequestId as y } from "./index33.js";
@@ -56,47 +57,51 @@ function O({ open: O, onOpenChange: k, payableId: A, onClose: j, onExpand: M, te
56
57
  ...P?.sheet?.dueDate
57
58
  }
58
59
  },
59
- decisionDialog: h(S.decisionDialog, P?.decisionDialog),
60
+ decisionDialog: g(S.decisionDialog, P?.decisionDialog),
60
61
  approvalPolicyCopy: {
61
62
  ...S.approvalPolicyCopy,
62
63
  ...P?.approvalPolicyCopy
63
64
  },
64
- markAsPaid: te(P?.markAsPaid),
65
+ markAsPaid: m(P?.markAsPaid),
65
66
  actionSuccess: {
66
67
  ...S.actionSuccess,
67
68
  ...P?.actionSuccess
68
69
  },
69
- paymentHistoryMethodLabels: g(P?.paymentHistoryMethodLabels)
70
- }), [P]), L = a(A), R = i(A), z = n(), B = L.data, V = w(null), H = y({
70
+ paymentHistoryMethodLabels: ne(P?.paymentHistoryMethodLabels)
71
+ }), [P]), L = a(A), R = i(A), z = n(), { initResponse: B } = ee(), V = L.data, H = w(null), U = y({
71
72
  payableId: A,
72
- status: B?.status
73
- }), U = v({
73
+ status: V?.status
74
+ }), W = v({
74
75
  payableId: A,
75
- approvalPolicyId: B?.approval_policy_id,
76
+ approvalPolicyId: V?.approval_policy_id,
76
77
  copy: I.approvalPolicyCopy
77
- }), W = x({
78
+ }), G = te({
79
+ status: V?.status,
80
+ scopes: B?.scopes,
81
+ hasWaitingRequest: U.hasWaitingRequest,
82
+ arePendingApproversUnknown: W.isLoading
83
+ }), K = x({
78
84
  payableId: A,
79
- scheduledPaymentDate: B?.scheduled_payment_date
80
- }), G = m({
85
+ scheduledPaymentDate: V?.scheduled_payment_date
86
+ }), q = h({
81
87
  payableId: A,
82
- amountDueMinorUnits: d(B) ?? 0,
83
- amountToPayMinorUnits: B?.amount_to_pay ?? void 0,
84
- currencyCode: B?.currency ?? void 0,
85
- dueDate: B?.due_date,
86
- hasScheduledPayment: W.hasScheduledPayment,
88
+ amountDueMinorUnits: d(V) ?? 0,
89
+ amountToPayMinorUnits: V?.amount_to_pay ?? void 0,
90
+ currencyCode: V?.currency ?? void 0,
91
+ dueDate: V?.due_date,
92
+ hasScheduledPayment: K.hasScheduledPayment,
87
93
  testId: N,
88
94
  labels: I.markAsPaid
89
- }), { actions: K, decisionDialog: q } = b({
90
- payableId: B ? A : void 0,
91
- status: B?.status,
92
- currentApprovalRequestId: H.id,
93
- isPolicyApprover: H.isPolicyApprover,
94
- hasWaitingRequest: H.hasWaitingRequest,
95
- hasScheduledPayment: W.hasScheduledPayment,
96
- scheduledPaymentIntentId: W.scheduledPaymentIntentId,
97
- isScheduledPaymentUnknown: W.isResolving,
98
- pendingApprovers: U.pendingApprovers,
99
- arePendingApproversUnknown: U.isLoading,
95
+ }), { actions: J, decisionDialog: Y } = b({
96
+ payableId: V ? A : void 0,
97
+ status: V?.status,
98
+ currentApprovalRequestId: U.id,
99
+ hasWaitingRequest: U.hasWaitingRequest,
100
+ hasScheduledPayment: K.hasScheduledPayment,
101
+ scheduledPaymentIntentId: K.scheduledPaymentIntentId,
102
+ isScheduledPaymentUnknown: K.isResolving,
103
+ pendingApprovers: W.pendingApprovers,
104
+ arePendingApproversUnknown: W.isLoading,
100
105
  labels: {
101
106
  payBill: I.sheet.payButton,
102
107
  markAsPaid: I.sheet.markAsPaidButton,
@@ -112,71 +117,72 @@ function O({ open: O, onOpenChange: k, payableId: A, onClose: j, onExpand: M, te
112
117
  actionError: I.actionError,
113
118
  actionSuccess: I.actionSuccess
114
119
  },
115
- isMarkAsPaidPending: G.isPending,
116
- onMarkAsPaidSelect: G.open,
117
- onPayBillSelect: () => V.current?.open()
118
- }), J = W.hasScheduledPayment && W.scheduledDateLabel ? /* @__PURE__ */ E("p", {
120
+ isMarkAsPaidPending: q.isPending,
121
+ onMarkAsPaidSelect: q.open,
122
+ onPayBillSelect: () => H.current?.open()
123
+ }), X = K.hasScheduledPayment && K.scheduledDateLabel ? /* @__PURE__ */ E("p", {
119
124
  className: "ttw:text-sm ttw:text-muted-foreground",
120
- children: I.scheduledSummary(W.scheduledDateLabel)
121
- }) : void 0, { initResponse: Y } = ee(), X = u({
122
- payable: B,
123
- canManage: e(Y?.scopes, [t.PayableWriteOrg])
124
- }), Z = X.isPossibleDuplicate ? /* @__PURE__ */ E(c, {
125
- onNotADuplicate: X.onNotADuplicate,
126
- isActionDisabled: X.isBusy
127
- }) : void 0, Q = Z || J ? /* @__PURE__ */ D(T, { children: [Z, J] }) : void 0, $ = r(A), ne = C(() => _({
128
- records: W.paymentRecords,
125
+ children: I.scheduledSummary(K.scheduledDateLabel)
126
+ }) : void 0, Z = u({
127
+ payable: V,
128
+ canManage: e(B?.scopes, [t.PayableWriteOrg])
129
+ }), Q = Z.isPossibleDuplicate ? /* @__PURE__ */ E(c, {
130
+ onNotADuplicate: Z.onNotADuplicate,
131
+ isActionDisabled: Z.isBusy
132
+ }) : void 0, re = Q || X ? /* @__PURE__ */ D(T, { children: [Q, X] }) : void 0, $ = r(A), ie = C(() => _({
133
+ records: K.paymentRecords,
129
134
  events: $.data?.data ?? [],
130
- currencyCode: B?.currency,
135
+ currencyCode: V?.currency,
131
136
  labels: I
132
137
  }), [
133
- W.paymentRecords,
138
+ K.paymentRecords,
134
139
  $.data,
135
- B?.currency,
140
+ V?.currency,
136
141
  I
137
- ]), re = C(() => B ? p({
138
- payable: B,
142
+ ]), ae = C(() => V ? p({
143
+ payable: V,
139
144
  lineItems: R.lineItems,
140
145
  ledgerAccounts: z.data?.data ?? [],
141
146
  labels: I,
142
- hasScheduledPayment: W.hasScheduledPayment
147
+ hasScheduledPayment: K.hasScheduledPayment
143
148
  }) : void 0, [
144
- B,
149
+ V,
145
150
  R.lineItems,
146
151
  z.data,
147
152
  I,
148
- W.hasScheduledPayment
149
- ]), ie = L.isLoading || R.isResolving || z.isResolving, ae = L.isError || R.isError || z.isError;
153
+ K.hasScheduledPayment
154
+ ]), oe = L.isLoading || R.isResolving || z.isResolving, se = L.isError || R.isError || z.isError;
150
155
  return /* @__PURE__ */ D(T, { children: [
151
156
  /* @__PURE__ */ E(s, {
152
157
  open: O,
153
158
  onOpenChange: k,
154
- details: re,
155
- actions: K,
156
- approvalPolicy: U.view,
157
- paymentHistory: ne,
158
- paymentHistoryError: W.isError || $.isError,
159
- paymentHistoryLoading: W.isResolving || $.isLoading,
160
- isLoading: ie,
161
- isError: ae,
162
- notice: Q,
159
+ details: ae,
160
+ actions: J,
161
+ approvalPolicy: W.view,
162
+ showApprovalOverrideNotice: G,
163
+ paymentHistory: ie,
164
+ paymentHistoryError: K.isError || $.isError,
165
+ paymentHistoryLoading: K.isResolving || $.isLoading,
166
+ isLoading: oe,
167
+ isError: se,
168
+ notice: re,
163
169
  onClose: j,
164
170
  onExpand: M,
165
171
  testId: N,
166
172
  labels: I.sheet
167
173
  }),
168
174
  /* @__PURE__ */ E(o, {
169
- ...q,
175
+ ...Y,
170
176
  labels: { cancelButton: I.decisionDialog.cancelButton },
171
177
  testId: N ? `${N}-decision-dialog` : void 0,
172
178
  confirmTestId: N ? `${N}-decision-confirm` : void 0,
173
179
  reasonTestId: N ? `${N}-decision-reason` : void 0,
174
180
  reasonFieldId: N ? `${N}-decision-reason-field` : void 0
175
181
  }),
176
- /* @__PURE__ */ E(l, { ...G.dialogProps }),
177
- B ? /* @__PURE__ */ E(f, {
178
- ref: V,
179
- payable: B,
182
+ /* @__PURE__ */ E(l, { ...q.dialogProps }),
183
+ V ? /* @__PURE__ */ E(f, {
184
+ ref: H,
185
+ payable: V,
180
186
  onMissingAchInstructions: M,
181
187
  poweredByBankName: F
182
188
  }) : null
@@ -15,7 +15,7 @@ function n(e, t) {
15
15
  function r({ apiStatus: t, dueDate: r, scheduledPaymentDate: i, hasScheduledPayment: a = !!i, now: o = /* @__PURE__ */ new Date() }) {
16
16
  if (e.has(t) && a) return {
17
17
  status: "scheduled",
18
- tone: "accent",
18
+ tone: "committed",
19
19
  isOverdue: !1
20
20
  };
21
21
  let s = !!(e.has(t) && r && n(r, o));
@@ -26,7 +26,7 @@ function r({ apiStatus: t, dueDate: r, scheduledPaymentDate: i, hasScheduledPaym
26
26
  isOverdue: s
27
27
  };
28
28
  case "new": return {
29
- status: "new",
29
+ status: "ready_to_submit",
30
30
  tone: "accent",
31
31
  isOverdue: s
32
32
  };
@@ -35,19 +35,15 @@ function r({ apiStatus: t, dueDate: r, scheduledPaymentDate: i, hasScheduledPaym
35
35
  tone: "info",
36
36
  isOverdue: s
37
37
  };
38
- case "waiting_to_be_paid": return {
39
- status: "ready_to_pay",
40
- tone: "success",
41
- isOverdue: s
42
- };
38
+ case "waiting_to_be_paid":
43
39
  case "partially_paid": return {
44
- status: "partially_paid",
40
+ status: "ready_to_pay",
45
41
  tone: "success",
46
42
  isOverdue: s
47
43
  };
48
44
  case "paid": return {
49
45
  status: "paid",
50
- tone: "complete",
46
+ tone: "settled",
51
47
  isOverdue: s
52
48
  };
53
49
  case "canceled": return {
@@ -8,9 +8,8 @@ var t = {
8
8
  Paid: "paid",
9
9
  All: "all"
10
10
  }, n = {
11
- [t.Drafts]: ["draft"],
11
+ [t.Drafts]: ["draft", "new"],
12
12
  [t.Pending]: [
13
- "new",
14
13
  "approve_in_progress",
15
14
  "waiting_to_be_paid",
16
15
  "partially_paid"
@@ -33,9 +32,9 @@ var t = {
33
32
  function i(e) {
34
33
  return e === t.Pending || e === t.Drafts;
35
34
  }
36
- var a = t.Pending, o = [
37
- t.Pending,
35
+ var a = t.Drafts, o = [
38
36
  t.Drafts,
37
+ t.Pending,
39
38
  t.Scheduled,
40
39
  t.Paid,
41
40
  t.All
@@ -1,28 +1,28 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js
2
2
  var e = {
3
3
  Draft: "draft",
4
+ ReadyToSubmit: "ready_to_submit",
4
5
  PendingApproval: "pending_approval",
5
6
  ReadyToPay: "ready_to_pay",
6
- PartiallyPaid: "partially_paid",
7
7
  Paid: "paid",
8
- Rejected: "rejected",
9
- Canceled: "canceled"
8
+ Canceled: "canceled",
9
+ Rejected: "rejected"
10
10
  }, t = [
11
11
  e.Draft,
12
+ e.ReadyToSubmit,
12
13
  e.PendingApproval,
13
14
  e.ReadyToPay,
14
- e.PartiallyPaid,
15
15
  e.Paid,
16
- e.Rejected,
17
- e.Canceled
16
+ e.Canceled,
17
+ e.Rejected
18
18
  ], n = {
19
- [e.Draft]: ["draft", "new"],
19
+ [e.Draft]: ["draft"],
20
+ [e.ReadyToSubmit]: ["new"],
20
21
  [e.PendingApproval]: ["approve_in_progress"],
21
- [e.ReadyToPay]: ["waiting_to_be_paid"],
22
- [e.PartiallyPaid]: ["partially_paid"],
22
+ [e.ReadyToPay]: ["waiting_to_be_paid", "partially_paid"],
23
23
  [e.Paid]: ["paid"],
24
- [e.Rejected]: ["rejected"],
25
- [e.Canceled]: ["canceled"]
24
+ [e.Canceled]: ["canceled"],
25
+ [e.Rejected]: ["rejected"]
26
26
  };
27
27
  function r(e) {
28
28
  return e.flatMap((e) => n[e] ?? [e]);
@@ -20,12 +20,12 @@ var n = {
20
20
  presetGroupPast: "Past",
21
21
  statuses: {
22
22
  [e.Draft]: "Draft",
23
- [e.PendingApproval]: "Pending approval",
23
+ [e.ReadyToSubmit]: "Ready to submit",
24
+ [e.PendingApproval]: "Pending review",
24
25
  [e.ReadyToPay]: "Ready to pay",
25
- [e.PartiallyPaid]: "Partially paid",
26
26
  [e.Paid]: "Paid",
27
- [e.Rejected]: "Rejected",
28
- [e.Canceled]: "Canceled"
27
+ [e.Canceled]: "Cancelled",
28
+ [e.Rejected]: "Rejected"
29
29
  },
30
30
  dateFieldNames: {
31
31
  issueDate: "Issue date",
@@ -3,8 +3,7 @@ var e = {
3
3
  heading: "Approval policy",
4
4
  stepConnector: "And",
5
5
  chipConnector: "or",
6
- approvedIndicator: "Approved",
7
- footnote: "If the listed approvers are unavailable, a company admin can approve this bill on their behalf."
6
+ approvedIndicator: "Approved"
8
7
  };
9
8
  function t(t) {
10
9
  return {
@@ -46,12 +46,7 @@ function c({ view: c, labels: l }) {
46
46
  className: "ttw:size-3.5 ttw:text-emerald-600"
47
47
  }) : null]
48
48
  })] }, n.id))
49
- })] }, n.id)),
50
- /* @__PURE__ */ i(t, {
51
- variant: "caption",
52
- color: "muted",
53
- children: u.footnote
54
- })
49
+ })] }, n.id))
55
50
  ]
56
51
  })]
57
52
  });
@@ -1,13 +1,12 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js
2
2
  var e = {
3
3
  draft: "Draft",
4
- new: "Draft",
5
- pending_approval: "Pending approval",
4
+ ready_to_submit: "Ready to submit",
5
+ pending_approval: "Pending review",
6
6
  ready_to_pay: "Ready to pay",
7
7
  scheduled: "Scheduled",
8
- partially_paid: "Partially paid",
9
8
  paid: "Paid",
10
- canceled: "Canceled",
9
+ canceled: "Cancelled",
11
10
  rejected: "Rejected",
12
11
  unknown: "Unknown"
13
12
  };
@@ -1,10 +1,11 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js
2
2
  var e = {
3
3
  accent: "ttw:border-violet-100 ttw:bg-violet-100 ttw:text-violet-700 ttw:hover:bg-violet-100",
4
- complete: "ttw:border-background ttw:bg-background ttw:text-green-900 ttw:hover:bg-background",
4
+ committed: "ttw:border-cyan-200 ttw:bg-cyan-50 ttw:text-cyan-700 ttw:hover:bg-cyan-50",
5
5
  danger: "ttw:border-destructive/20 ttw:bg-destructive/20 ttw:text-destructive ttw:hover:bg-destructive/20",
6
6
  info: "ttw:border-blue-100 ttw:bg-blue-100 ttw:text-blue-700 ttw:hover:bg-blue-100",
7
- neutral: "ttw:border-muted ttw:bg-muted ttw:text-foreground ttw:hover:bg-muted",
7
+ neutral: "ttw:border-border ttw:bg-muted ttw:text-foreground ttw:hover:bg-muted",
8
+ settled: "ttw:border-border ttw:bg-background ttw:text-green-900 ttw:hover:bg-background",
8
9
  success: "ttw:border-green-100 ttw:bg-green-100 ttw:text-green-700 ttw:hover:bg-green-100",
9
10
  warning: "ttw:border-amber-100 ttw:bg-amber-100 ttw:text-amber-700 ttw:hover:bg-amber-100"
10
11
  };
@@ -14,6 +14,7 @@ var i = {
14
14
  amountPaidHeading: "Amount paid",
15
15
  invoiceDateLabel: "Invoice date",
16
16
  dueDateLabel: "Due date",
17
+ approvalOverrideNotice: "If approvers are unavailable, you can override the approval policy from the overflow menu.",
17
18
  payToHeading: "Pay to",
18
19
  payToHeadingPaid: "Paid to",
19
20
  vendorRow: "Vendor",