@tesouro/embedded-components-react 0.5.233 → 0.5.236

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 (87) hide show
  1. package/README.md +19 -14
  2. package/dist/index.d.ts +175 -16
  3. package/dist/index.js +1 -1
  4. package/dist/lib/BankAccountOnboardingWidget.d.ts +39 -1
  5. package/dist/lib/ReceivablesWidget.d.ts +110 -1
  6. package/dist/lib/ReceivablesWidget.js +1 -1
  7. package/dist/lib/WidgetSuite.d.ts +65 -15
  8. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index.js +3 -2
  9. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index12.js +2 -1
  10. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js +6 -0
  11. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index23.js +15 -11
  12. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index26.js +441 -409
  13. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index10.js +18 -14
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js +1 -1
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +1 -1
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +3 -3
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +1 -1
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index31.js +210 -208
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index32.js +98 -40
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index33.js +159 -39
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index34.js +53 -77
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index35.js +99 -132
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index36.js +40 -341
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index37.js +43 -0
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index38.js +92 -0
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index39.js +146 -0
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index40.js +354 -0
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +1 -1
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +1 -1
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +28 -24
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +2 -37
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index11.js +9 -214
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +27 -159
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +233 -14
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +34 -22
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +214 -2
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +153 -87
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +16 -3
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +22 -21
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +2 -51
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +30 -15
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +90 -14
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +3 -10
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +20 -69
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +51 -33
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +16 -17
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +8 -14
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +70 -30
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +33 -14
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +17 -25
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +12 -83
  55. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index3.js +9 -121
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +28 -401
  57. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +16 -2
  58. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +22 -42
  59. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +80 -65
  60. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +383 -473
  61. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +2 -106
  62. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +48 -0
  63. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +72 -2
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +498 -4
  65. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +106 -1
  66. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +141 -93
  67. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +2 -28
  68. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +4 -236
  69. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +0 -2
  70. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +90 -239
  71. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +24 -89
  72. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +231 -54
  73. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +3 -353
  74. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +249 -0
  75. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +93 -0
  76. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index5.js +3 -40
  77. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +59 -0
  78. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +353 -0
  79. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +18 -2
  80. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +121 -9
  81. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index8.js +100 -27
  82. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +38 -233
  83. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  84. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index16.js +123 -92
  85. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index4.js +12 -5
  86. package/package.json +1 -1
  87. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +0 -100
@@ -1,16 +1,235 @@
1
- import { jsx as e, jsxs as t } from "react/jsx-runtime";
1
+ import { RECEIVABLE_BILLING_SECTION_LABELS_EN as e } from "./index11.js";
2
+ import { RECEIVABLE_RECURRENCE_EMAIL_DIALOG_LABELS_EN as t, RECEIVABLE_RECURRENCE_SECTION_LABELS_EN as n } from "./index12.js";
2
3
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js
3
- function n({ option: n }) {
4
- return /* @__PURE__ */ t("span", {
5
- className: "ttw:flex ttw:w-full ttw:min-w-0 ttw:items-center ttw:justify-between ttw:gap-2",
6
- children: [/* @__PURE__ */ e("span", {
7
- className: "ttw:truncate",
8
- children: n.label
9
- }), n.dueDateLabel && /* @__PURE__ */ e("span", {
10
- className: "ttw:shrink-0 ttw:text-xs ttw:text-muted-foreground",
11
- children: n.dueDateLabel
12
- })]
13
- });
14
- }
4
+ var r = {
5
+ draft: "Draft",
6
+ issuing: "Issuing",
7
+ issued: "Issued",
8
+ failed: "Failed",
9
+ accepted: "Accepted",
10
+ expired: "Expired",
11
+ declined: "Declined",
12
+ recurring: "Recurring",
13
+ partially_paid: "Partially paid",
14
+ paid: "Paid",
15
+ overdue: "Overdue",
16
+ uncollectible: "Written off",
17
+ canceled: "Cancelled",
18
+ deleted: "Deleted",
19
+ unknown: "Unknown"
20
+ }, i = { all: "All invoices" }, a = {
21
+ createButton: "Create",
22
+ templateSettingsButton: "Template settings",
23
+ searchPlaceholder: "Search by number or customer",
24
+ statusFilterAll: "All statuses",
25
+ statusCardsAll: i.all,
26
+ tabInvoices: "Invoices",
27
+ tabQuotes: "Quotes",
28
+ tabCreditNotes: "Credit notes",
29
+ columnDocument: "Document",
30
+ columnCustomer: "Customer",
31
+ columnStatus: "Status",
32
+ columnIssueDate: "Issued",
33
+ columnDueDate: "Due",
34
+ columnTotal: "Total",
35
+ columnAmountDue: "Amount due",
36
+ columnActions: "Actions",
37
+ openRow: (e) => `View document — ${e}`,
38
+ sortByDocument: "Sort by document",
39
+ sortByCustomer: "Sort by customer",
40
+ sortByStatus: "Sort by status",
41
+ sortByIssueDate: "Sort by issue date",
42
+ sortByDueDate: "Sort by due date",
43
+ sortByTotal: "Sort by total",
44
+ actionEdit: "Edit",
45
+ actionIssue: "Issue",
46
+ actionSend: "Send",
47
+ actionRecordPayment: "Record payment",
48
+ actionMarkPaid: "Mark as paid",
49
+ actionMarkUncollectible: "Mark uncollectible",
50
+ actionAccept: "Accept",
51
+ actionDecline: "Decline",
52
+ actionCancel: "Cancel",
53
+ actionClone: "Clone",
54
+ actionDelete: "Delete",
55
+ emptyTitle: "No receivables yet",
56
+ emptyDescription: "Create your first invoice or quote.",
57
+ emptyAction: "Create receivable",
58
+ filterEmptyTitle: "No receivables found",
59
+ filterEmptyDescription: "Try adjusting your search or filters.",
60
+ errorTitle: "Failed to load receivables",
61
+ errorDescription: "Something went wrong while fetching receivables. Please try again.",
62
+ errorRetry: "Try again",
63
+ statusBadge: r
64
+ }, o = {
65
+ ...e,
66
+ ...n,
67
+ ...t,
68
+ createTitle: "Create receivable",
69
+ editTitle: "Edit receivable",
70
+ hiddenDescription: "Create an invoice or quote",
71
+ documentTypeLabel: "Document type",
72
+ typeInvoice: "Invoice",
73
+ typeQuote: "Quote",
74
+ customerLabel: "Customer",
75
+ customerHint: "Create a customer first if the list is empty.",
76
+ currencyLabel: "Currency",
77
+ issueDateLabel: "Issue date",
78
+ dueDateLabel: "Due date",
79
+ lineItemsHeading: "Products and services",
80
+ lineItemsDescription: "Add the products and services on this invoice. You'll have the option to save new items to your inventory.",
81
+ productLabel: "Item name",
82
+ quantityLabel: "Quantity",
83
+ unitLabel: "Units",
84
+ unitPlaceholder: "Select",
85
+ unitNone: "None",
86
+ manageUnitsOption: "Manage measure units",
87
+ priceLabel: "Price",
88
+ taxableLabel: "Taxable",
89
+ taxRateLabel: "Tax rate",
90
+ taxRatePlaceholder: "e.g. 6.25",
91
+ taxRateSuffix: "%",
92
+ discountLabel: "Discount",
93
+ discountPercentageOption: "%",
94
+ discountAmountOptionAriaLabel: "Flat discount",
95
+ discountPercentageOptionAriaLabel: "Percentage discount",
96
+ subtotalLabel: "Subtotal",
97
+ discountTotalLabel: "Discount",
98
+ nonTaxableSubtotalLabel: "Non-taxable subtotal",
99
+ taxableSubtotalLabel: "Taxable subtotal",
100
+ taxTotalLabel: "Tax",
101
+ totalLabel: "Total",
102
+ decreaseQuantityButton: "Decrease quantity",
103
+ increaseQuantityButton: "Increase quantity",
104
+ addLineItemButton: "Add item",
105
+ removeLineItemButton: "Remove line item",
106
+ cancelButton: "Cancel",
107
+ notesHeading: "Notes",
108
+ notesDescription: "Provide additional information for your customer.",
109
+ optionalSuffix: "(optional)",
110
+ openingNoteLabel: "Opening note to the customer",
111
+ openingNotePlaceholder: "e.g., As discussed on our call, please find the attached invoice.",
112
+ openingNoteDescription: "Appears above your line items. Use it to reference a discussion, agreement, or project.",
113
+ closingNoteLabel: "Closing note to the customer",
114
+ closingNotePlaceholder: "e.g., Thank you for your business!",
115
+ closingNoteDescription: "Appears below your line items. Commonly used for thank you messages or payment instructions.",
116
+ bankAccountHeading: "Payment instructions",
117
+ bankAccountDescription: "Tells the customer how they can pay you. We'll include the selected info on the invoice",
118
+ bankAccountLabel: "Bank account",
119
+ bankAccountHint: "Display your bank account number and routing number",
120
+ bankAccountSelectorLabel: "Bank account selector",
121
+ bankAccountPlaceholder: "Select bank account",
122
+ bankAccountAddOption: "Add a new account",
123
+ bankAccountFormHeading: "Add a bank account",
124
+ bankAccountRoutingNumberLabel: "Routing number",
125
+ bankAccountRoutingNumberPlaceholder: "e.g. 123456789",
126
+ bankAccountAccountNumberLabel: "Account number",
127
+ bankAccountAccountNumberPlaceholder: "e.g. 123456789",
128
+ bankAccountHolderNameLabel: "Account holder name",
129
+ bankAccountHolderNamePlaceholder: "e.g. James Smith",
130
+ bankAccountNicknameLabel: "Account nickname",
131
+ bankAccountNicknamePlaceholder: "e.g. Empire Bank Checking",
132
+ bankAccountCancelButton: "Cancel",
133
+ bankAccountSaveButton: "Save account",
134
+ bankAccountRestrictedTitle: "There are no bank accounts on file for this account",
135
+ bankAccountRestrictedDescription: "A bank account is required in order to issue invoices. Contact your company admin to set one up.",
136
+ attachmentsHeading: "Attachments",
137
+ attachmentsDescription: "Associate additional documents with this invoice for your own reference or to share with the customer. e.g. contracts, photos, terms and conditions, etc.",
138
+ attachmentsDropPrompt: "Drop your files here, or",
139
+ attachmentsBrowseLink: "browse to upload",
140
+ attachmentsFormatsHint: "PDF, DOC, JPG, PNG (max. 3MB)",
141
+ remindersToggleLabel: "Payment reminders",
142
+ remindersDescription: "Send reminders when an invoice is approaching its due date or past due.",
143
+ remindersLibraryNote: "New reminders will be saved to your organization's library and can be managed via Invoice settings",
144
+ reminderNumberOfDays: "Number of days",
145
+ reminderBefore: "BEFORE",
146
+ reminderAfter: "AFTER",
147
+ reminderDueDate: "due date",
148
+ reminderNone: "No reminder",
149
+ reminderBeforeDueInputLabel: "Days before due date",
150
+ reminderPlaceholder: "e.g., 3",
151
+ reminderAddTermButton: "Add",
152
+ reminderClearButton: "Clear",
153
+ reminderSaveButton: "Save"
154
+ }, s = {
155
+ hiddenDescription: "Invoice details",
156
+ loadingTitle: "Loading...",
157
+ errorTitle: "Invoice not found",
158
+ errorDescription: "We could not load this invoice. Please try again.",
159
+ moreActionsLabel: "More actions",
160
+ viewPdfButton: "View PDF",
161
+ closeButton: "Close",
162
+ invoiceDateCaption: "Invoice date",
163
+ paymentHistoryHeading: "Payment history",
164
+ paymentHistoryEmpty: "You've received no payments yet.",
165
+ paymentHistoryTotalLabel: "Total received",
166
+ paymentHistoryLoading: "Loading payment history",
167
+ customerDetailsHeading: "Customer details",
168
+ recurringAmountCaption: "Recurring amount",
169
+ startsOnCaption: "Starts on",
170
+ endsOnCaption: "Ends on",
171
+ recurringSeriesRowLabel: "Recurring series",
172
+ scheduleIssueDateColumn: "Issue date",
173
+ scheduleAmountColumn: "Amount",
174
+ scheduleStatusColumn: "Status",
175
+ scheduleNumberColumn: "Number",
176
+ scheduleEmpty: "No invoices are scheduled.",
177
+ auditHistoryHeading: "Audit history",
178
+ auditHistoryEmpty: "No history yet.",
179
+ auditHistoryLoading: "Loading history",
180
+ auditHistoryError: "The audit history could not be loaded.",
181
+ auditHistoryNamesError: "Some names could not be loaded.",
182
+ billingHeading: "Billing details",
183
+ lineItemsHeading: "Line items",
184
+ notesHeading: "Notes",
185
+ notesOpeningLabel: "Opening note to customer",
186
+ notesClosingLabel: "Closing note to customer",
187
+ attachmentsHeading: "Attachments",
188
+ attachmentsEmpty: "No attached files",
189
+ attachmentsFileColumn: "File",
190
+ attachmentsEmailedColumn: "Emailed",
191
+ lineItemMultiplier: "x",
192
+ lineItemEaLabel: "ea",
193
+ noLineItems: "No line items.",
194
+ editButton: "Edit",
195
+ issueButton: "Issue",
196
+ recordPaymentButton: "Record payment",
197
+ sendButton: "Resend",
198
+ acceptButton: "Accept",
199
+ declineButton: "Decline",
200
+ markPaidButton: "Mark as paid",
201
+ markUncollectibleButton: "Mark as uncollectible",
202
+ cancelButton: "Cancel invoice",
203
+ cloneButton: "Duplicate",
204
+ deleteButton: "Delete",
205
+ pauseRecurrenceButton: "Pause series",
206
+ resumeRecurrenceButton: "Resume series",
207
+ cancelRecurrenceButton: "Cancel series",
208
+ recurringBadge: "Recurring"
209
+ }, c = {
210
+ title: "Send receivable",
211
+ description: "Send this document to the customer by email.",
212
+ toLabel: "To",
213
+ ccLabel: "CC",
214
+ bccLabel: "BCC",
215
+ subjectLabel: "Subject",
216
+ bodyLabel: "Message",
217
+ cancelButton: "Cancel",
218
+ sendButton: "Send"
219
+ }, l = {
220
+ title: "Record payment",
221
+ description: "Record a full or partial invoice payment.",
222
+ modeLabel: "Payment type",
223
+ fullPayment: "Full payment",
224
+ partialPayment: "Partial payment",
225
+ amountPaidLabel: "Amount paid",
226
+ paidAtLabel: "Paid at",
227
+ commentLabel: "Comment",
228
+ cancelButton: "Cancel",
229
+ submitButton: "Record payment"
230
+ }, u = {
231
+ cancelButton: "Cancel",
232
+ confirmButton: "Confirm"
233
+ };
15
234
  //#endregion
16
- export { n as OptionRow };
235
+ export { a as RECEIVABLES_SCREEN_LABELS_EN, u as RECEIVABLE_ACTION_DIALOG_LABELS_EN, s as RECEIVABLE_DETAILS_PANEL_LABELS_EN, o as RECEIVABLE_FORM_SHEET_LABELS_EN, l as RECEIVABLE_PAYMENT_DIALOG_LABELS_EN, c as RECEIVABLE_SEND_DIALOG_LABELS_EN, r as RECEIVABLE_STATUS_BADGE_LABELS_EN, i as RECEIVABLE_STATUS_CARDS_LABELS_EN };
@@ -1,25 +1,37 @@
1
- import { cn as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { OptionRow as t } from "./index13.js";
3
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
- import { CalendarIcon as i } from "lucide-react";
1
+ import { Button as e, Dialog as t, DialogContent as n, DialogDescription as r, DialogFooter as i, DialogHeader as a, DialogTitle as o } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { RECEIVABLE_ACTION_DIALOG_LABELS_EN as s } from "./index13.js";
3
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
5
4
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js
6
- function a({ selection: a, labels: o }) {
7
- return a?.kind === "receiptDue" ? /* @__PURE__ */ n("span", {
8
- className: "ttw:truncate",
9
- children: o.paymentTermsReceiptDue
10
- }) : a?.kind === "customDate" ? /* @__PURE__ */ r("span", {
11
- className: "ttw:flex ttw:w-full ttw:min-w-0 ttw:items-center ttw:justify-between ttw:gap-2",
12
- children: [/* @__PURE__ */ r("span", {
13
- className: "ttw:flex ttw:min-w-0 ttw:items-center ttw:gap-1.5",
14
- children: [/* @__PURE__ */ n(i, { className: e("ttw:size-4 ttw:shrink-0", !a.hasDate && "ttw:text-muted-foreground") }), /* @__PURE__ */ n("span", {
15
- className: e("ttw:truncate", !a.hasDate && "ttw:text-muted-foreground"),
16
- children: a.dateLabel
17
- })]
18
- }), /* @__PURE__ */ n("span", {
19
- className: "ttw:shrink-0 ttw:text-xs ttw:text-muted-foreground",
20
- children: o.paymentTermsCustomDate
21
- })]
22
- }) : a?.kind === "term" ? /* @__PURE__ */ n(t, { option: a.option }) : null;
5
+ function u({ open: u, onOpenChange: d, title: f, description: p, confirmLabel: m, cancelLabel: h, destructive: g, error: _, inProgress: v, onConfirm: y, onCancel: b, labels: x }) {
6
+ let S = {
7
+ ...s,
8
+ ...x
9
+ };
10
+ return /* @__PURE__ */ c(t, {
11
+ open: u,
12
+ onOpenChange: d,
13
+ children: /* @__PURE__ */ l(n, { children: [
14
+ /* @__PURE__ */ l(a, { children: [/* @__PURE__ */ c(o, { children: f }), /* @__PURE__ */ c(r, {
15
+ className: "ttw:whitespace-pre-line",
16
+ children: p
17
+ })] }),
18
+ _ && /* @__PURE__ */ c("p", {
19
+ role: "alert",
20
+ className: "ttw:rounded-md ttw:bg-destructive/10 ttw:px-3 ttw:py-2 ttw:text-sm ttw:text-destructive",
21
+ children: _
22
+ }),
23
+ /* @__PURE__ */ l(i, { children: [/* @__PURE__ */ c(e, {
24
+ variant: "ghost",
25
+ onClick: b,
26
+ children: h ?? S.cancelButton
27
+ }), /* @__PURE__ */ c(e, {
28
+ variant: g ? "destructive" : "default",
29
+ loading: v,
30
+ onClick: y,
31
+ children: m ?? S.confirmButton
32
+ })] })
33
+ ] })
34
+ });
23
35
  }
24
36
  //#endregion
25
- export { a as SelectionValue };
37
+ export { u as ReceivableActionDialog, u as default };
@@ -1,4 +1,216 @@
1
+ import { Alert as e, AlertDescription as t, AlertTitle as n, Badge as r, Button as i, Field as a, FieldContent as o, FieldError as s, FieldLabel as c, Input as l, Select as u, SelectContent as d, SelectItem as f, SelectSeparator as p, SelectTrigger as m, SelectValue as h, Skeleton as g, Typography as _ } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { RECEIVABLE_FORM_SHEET_LABELS_EN as v } from "./index13.js";
3
+ import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
4
+ import { PlusIcon as S, TriangleAlertIcon as C } from "lucide-react";
1
5
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js
2
- var e = "receipt_due", t = "custom";
6
+ var w = "__add_new__";
7
+ function T({ id: e, label: t, optionalSuffix: n, placeholder: r, value: i, error: u, disabled: d, onChange: f }) {
8
+ return /* @__PURE__ */ b(a, { children: /* @__PURE__ */ x(o, { children: [
9
+ /* @__PURE__ */ x(c, {
10
+ htmlFor: e,
11
+ className: "ttw:gap-1",
12
+ children: [t, n && /* @__PURE__ */ b(_, {
13
+ variant: "body2",
14
+ component: "span",
15
+ color: "muted",
16
+ className: "ttw:leading-snug",
17
+ children: n
18
+ })]
19
+ }),
20
+ /* @__PURE__ */ b(l, {
21
+ id: e,
22
+ placeholder: r,
23
+ value: i,
24
+ disabled: d,
25
+ "aria-invalid": !!u,
26
+ onChange: (e) => f(e.target.value),
27
+ onKeyDown: (e) => {
28
+ e.key === "Enter" && e.preventDefault();
29
+ }
30
+ }),
31
+ /* @__PURE__ */ b(s, { errors: u ? [{ message: u }] : [] })
32
+ ] }) });
33
+ }
34
+ function E({ idPrefix: e, values: t, errors: n, canCancel: r, isSaving: a, labels: o, onChange: s, onSave: c, onCancel: l }) {
35
+ return /* @__PURE__ */ x("div", {
36
+ className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-xl ttw:border ttw:border-border ttw:p-3",
37
+ children: [
38
+ /* @__PURE__ */ b(_, {
39
+ variant: "body2",
40
+ children: o.bankAccountFormHeading
41
+ }),
42
+ /* @__PURE__ */ x("div", {
43
+ className: "ttw:flex ttw:gap-4",
44
+ children: [/* @__PURE__ */ b(T, {
45
+ id: `${e}-routing-number`,
46
+ label: o.bankAccountRoutingNumberLabel,
47
+ placeholder: o.bankAccountRoutingNumberPlaceholder,
48
+ value: t.routingNumber,
49
+ error: n.routingNumber,
50
+ disabled: a,
51
+ onChange: (e) => s({ routingNumber: e })
52
+ }), /* @__PURE__ */ b(T, {
53
+ id: `${e}-account-number`,
54
+ label: o.bankAccountAccountNumberLabel,
55
+ placeholder: o.bankAccountAccountNumberPlaceholder,
56
+ value: t.accountNumber,
57
+ error: n.accountNumber,
58
+ disabled: a,
59
+ onChange: (e) => s({ accountNumber: e })
60
+ })]
61
+ }),
62
+ /* @__PURE__ */ x("div", {
63
+ className: "ttw:flex ttw:gap-4",
64
+ children: [/* @__PURE__ */ b(T, {
65
+ id: `${e}-account-holder-name`,
66
+ label: o.bankAccountHolderNameLabel,
67
+ placeholder: o.bankAccountHolderNamePlaceholder,
68
+ value: t.accountHolderName,
69
+ error: n.accountHolderName,
70
+ disabled: a,
71
+ onChange: (e) => s({ accountHolderName: e })
72
+ }), /* @__PURE__ */ b(T, {
73
+ id: `${e}-account-nickname`,
74
+ label: o.bankAccountNicknameLabel,
75
+ optionalSuffix: o.optionalSuffix,
76
+ placeholder: o.bankAccountNicknamePlaceholder,
77
+ value: t.displayName,
78
+ error: n.displayName,
79
+ disabled: a,
80
+ onChange: (e) => s({ displayName: e })
81
+ })]
82
+ }),
83
+ /* @__PURE__ */ x("div", {
84
+ className: "ttw:flex ttw:gap-4",
85
+ children: [r && /* @__PURE__ */ b(i, {
86
+ type: "button",
87
+ variant: "outline",
88
+ className: "ttw:border-border",
89
+ disabled: a,
90
+ onClick: l,
91
+ children: o.bankAccountCancelButton
92
+ }), /* @__PURE__ */ b(i, {
93
+ type: "button",
94
+ disabled: a,
95
+ onClick: c,
96
+ children: o.bankAccountSaveButton
97
+ })]
98
+ })
99
+ ]
100
+ });
101
+ }
102
+ function D({ idPrefix: i, view: a, error: o, disabled: c, onAccountSelect: l, onAddAccountClick: T, onFormChange: D, onFormSave: O, onFormCancel: k, labels: A }) {
103
+ let j = {
104
+ ...v,
105
+ ...A
106
+ }, M = `${i}-bank-account`;
107
+ return /* @__PURE__ */ x("div", {
108
+ className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:rounded-xl ttw:border ttw:border-border ttw:p-6",
109
+ children: [
110
+ /* @__PURE__ */ x("div", {
111
+ className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:pb-4",
112
+ children: [/* @__PURE__ */ b(_, {
113
+ variant: "h4",
114
+ children: j.bankAccountHeading
115
+ }), /* @__PURE__ */ b(_, {
116
+ variant: "body2",
117
+ color: "muted",
118
+ className: "ttw:font-medium",
119
+ children: j.bankAccountDescription
120
+ })]
121
+ }),
122
+ (a.kind === "loading" || a.kind === "picker") && /* @__PURE__ */ x("div", {
123
+ className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-xl ttw:border ttw:border-border ttw:p-3",
124
+ children: [
125
+ /* @__PURE__ */ x("div", {
126
+ className: "ttw:flex ttw:flex-col ttw:gap-1",
127
+ children: [/* @__PURE__ */ b(_, {
128
+ variant: "body2",
129
+ children: j.bankAccountLabel
130
+ }), /* @__PURE__ */ b(_, {
131
+ variant: "caption",
132
+ color: "muted",
133
+ children: j.bankAccountHint
134
+ })]
135
+ }),
136
+ a.kind === "loading" ? /* @__PURE__ */ b(g, { className: "ttw:h-9 ttw:w-full ttw:rounded-md" }) : /* @__PURE__ */ x(u, {
137
+ disabled: c,
138
+ value: a.selected?.value ?? "",
139
+ onValueChange: (e) => {
140
+ if (e === w) {
141
+ T();
142
+ return;
143
+ }
144
+ l(e);
145
+ },
146
+ children: [/* @__PURE__ */ b(m, {
147
+ id: M,
148
+ className: "ttw:w-full",
149
+ "aria-label": j.bankAccountSelectorLabel,
150
+ "aria-invalid": !!o,
151
+ children: /* @__PURE__ */ b(h, {
152
+ placeholder: j.bankAccountPlaceholder,
153
+ children: a.selected && /* @__PURE__ */ x("span", {
154
+ className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:items-center ttw:justify-between ttw:gap-2",
155
+ children: [/* @__PURE__ */ b("span", {
156
+ className: "ttw:truncate",
157
+ children: a.selected.label
158
+ }), a.selected.sourceLabel && /* @__PURE__ */ b(r, {
159
+ variant: "secondary",
160
+ className: "ttw:shrink-0",
161
+ children: a.selected.sourceLabel
162
+ })]
163
+ })
164
+ })
165
+ }), /* @__PURE__ */ x(d, { children: [a.options.map((e) => /* @__PURE__ */ b(f, {
166
+ value: e.value,
167
+ children: /* @__PURE__ */ x("span", {
168
+ className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:items-center ttw:justify-between ttw:gap-2",
169
+ children: [/* @__PURE__ */ b("span", {
170
+ className: "ttw:truncate",
171
+ children: e.label
172
+ }), e.sourceLabel && /* @__PURE__ */ b("span", {
173
+ className: "ttw:shrink-0 ttw:text-muted-foreground",
174
+ children: e.sourceLabel
175
+ })]
176
+ })
177
+ }, e.value)), a.canAddAccount && /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(p, {}), /* @__PURE__ */ x(f, {
178
+ value: w,
179
+ className: "ttw:font-semibold ttw:text-primary ttw:hover:text-primary ttw:focus:text-primary",
180
+ children: [/* @__PURE__ */ b(S, { className: "ttw:text-primary" }), j.bankAccountAddOption]
181
+ })] })] })]
182
+ }),
183
+ /* @__PURE__ */ b(s, { errors: o ? [{ message: o }] : [] })
184
+ ]
185
+ }),
186
+ a.kind === "form" && /* @__PURE__ */ x("div", {
187
+ className: "ttw:flex ttw:flex-col ttw:gap-2",
188
+ "data-invalid": o ? !0 : void 0,
189
+ children: [/* @__PURE__ */ b(E, {
190
+ idPrefix: i,
191
+ values: a.values,
192
+ errors: a.errors,
193
+ canCancel: a.canCancel,
194
+ isSaving: a.isSaving,
195
+ labels: j,
196
+ onChange: D,
197
+ onSave: O,
198
+ onCancel: k
199
+ }), /* @__PURE__ */ b(s, { errors: o ? [{ message: o }] : [] })]
200
+ }),
201
+ a.kind === "restricted" && /* @__PURE__ */ x(e, {
202
+ className: "ttw:border-transparent ttw:bg-yellow-50 ttw:text-yellow-900 ttw:dark:bg-yellow-950 ttw:dark:text-yellow-100",
203
+ children: [
204
+ /* @__PURE__ */ b(C, {}),
205
+ /* @__PURE__ */ b(n, { children: j.bankAccountRestrictedTitle }),
206
+ /* @__PURE__ */ b(t, {
207
+ className: "ttw:text-current",
208
+ children: j.bankAccountRestrictedDescription
209
+ })
210
+ ]
211
+ })
212
+ ]
213
+ });
214
+ }
3
215
  //#endregion
4
- export { t as RECEIVABLE_PAYMENT_TERMS_CUSTOM_DATE, e as RECEIVABLE_PAYMENT_TERMS_RECEIPT_DUE };
216
+ export { D as ReceivableBankAccountSection };