@tesouro/embedded-components-react 0.5.205 → 0.5.207

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 (59) hide show
  1. package/README.md +1 -1
  2. package/dist/index.d.ts +51 -4
  3. package/dist/index.js +1 -1
  4. package/dist/lib/ReceivablesWidget.d.ts +51 -4
  5. package/dist/lib/ReceivablesWidget.js +1 -1
  6. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +2 -2
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +84 -2
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index2.js +31 -25
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js +109 -193
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index11.js +154 -37
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +193 -135
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +37 -58
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js +140 -86
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +42 -47
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +58 -313
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +91 -65
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +108 -102
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +48 -249
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index20.js +365 -0
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +75 -0
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js +115 -0
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +285 -0
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +1 -1
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +93 -407
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +430 -86
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +17 -12
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +92 -16
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index11.js +3 -1
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +24 -4
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +0 -10
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +2 -0
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +3 -264
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +16 -70
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +1 -424
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +4 -106
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +12 -93
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +5 -179
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +1 -344
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +264 -0
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +72 -0
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +402 -0
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +106 -0
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +249 -0
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +93 -0
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +344 -0
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index3.js +195 -32
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +29 -202
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index5.js +183 -137
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +157 -20
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +16 -1
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index8.js +25 -3
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +4 -3
  54. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +11 -11
  55. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +38 -38
  56. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +220 -198
  57. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +124 -84
  58. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  59. package/package.json +1 -1
@@ -1,34 +1,197 @@
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 "./index2.js";
3
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
1
+ import { RECEIVABLE_BILLING_SECTION_LABELS_EN as e } from "./index2.js";
4
2
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index3.js
5
- function u({ open: u, onOpenChange: d, title: f, description: p, confirmLabel: m, destructive: h, error: g, inProgress: _, onConfirm: v, onCancel: y, labels: b }) {
6
- let x = {
7
- ...s,
8
- ...b
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, { children: p })] }),
15
- g && /* @__PURE__ */ c("p", {
16
- role: "alert",
17
- className: "ttw:rounded-md ttw:bg-destructive/10 ttw:px-3 ttw:py-2 ttw:text-sm ttw:text-destructive",
18
- children: g
19
- }),
20
- /* @__PURE__ */ l(i, { children: [/* @__PURE__ */ c(e, {
21
- variant: "ghost",
22
- onClick: y,
23
- children: x.cancelButton
24
- }), /* @__PURE__ */ c(e, {
25
- variant: h ? "destructive" : "default",
26
- loading: _,
27
- onClick: v,
28
- children: m ?? x.confirmButton
29
- })] })
30
- ] })
31
- });
32
- }
3
+ var t = {
4
+ draft: "Draft",
5
+ issuing: "Issuing",
6
+ issued: "Issued",
7
+ failed: "Failed",
8
+ accepted: "Accepted",
9
+ expired: "Expired",
10
+ declined: "Declined",
11
+ recurring: "Recurring",
12
+ partially_paid: "Partially paid",
13
+ paid: "Paid",
14
+ overdue: "Overdue",
15
+ uncollectible: "Written off",
16
+ canceled: "Cancelled",
17
+ deleted: "Deleted",
18
+ unknown: "Unknown"
19
+ }, n = {
20
+ createButton: "Create",
21
+ templateSettingsButton: "Template settings",
22
+ searchPlaceholder: "Search by number or customer",
23
+ statusFilterAll: "All statuses",
24
+ tabInvoices: "Invoices",
25
+ tabQuotes: "Quotes",
26
+ tabCreditNotes: "Credit notes",
27
+ columnDocument: "Document",
28
+ columnCustomer: "Customer",
29
+ columnStatus: "Status",
30
+ columnIssueDate: "Issued",
31
+ columnDueDate: "Due",
32
+ columnTotal: "Total",
33
+ columnAmountDue: "Amount due",
34
+ columnActions: "Actions",
35
+ openRow: (e) => `View document — ${e}`,
36
+ sortByDocument: "Sort by document",
37
+ sortByCustomer: "Sort by customer",
38
+ sortByStatus: "Sort by status",
39
+ sortByIssueDate: "Sort by issue date",
40
+ sortByDueDate: "Sort by due date",
41
+ sortByTotal: "Sort by total",
42
+ actionEdit: "Edit",
43
+ actionIssue: "Issue",
44
+ actionSend: "Send",
45
+ actionRecordPayment: "Record payment",
46
+ actionMarkPaid: "Mark as paid",
47
+ actionMarkUncollectible: "Mark uncollectible",
48
+ actionAccept: "Accept",
49
+ actionDecline: "Decline",
50
+ actionCancel: "Cancel",
51
+ actionClone: "Clone",
52
+ actionDelete: "Delete",
53
+ emptyTitle: "No receivables yet",
54
+ emptyDescription: "Create your first invoice or quote.",
55
+ emptyAction: "Create receivable",
56
+ filterEmptyTitle: "No receivables found",
57
+ filterEmptyDescription: "Try adjusting your search or filters.",
58
+ errorTitle: "Failed to load receivables",
59
+ errorDescription: "Something went wrong while fetching receivables. Please try again.",
60
+ errorRetry: "Try again",
61
+ statusBadge: t
62
+ }, r = {
63
+ ...e,
64
+ createTitle: "Create receivable",
65
+ editTitle: "Edit receivable",
66
+ hiddenDescription: "Create an invoice or quote",
67
+ documentTypeLabel: "Document type",
68
+ typeInvoice: "Invoice",
69
+ typeQuote: "Quote",
70
+ customerLabel: "Customer",
71
+ customerHint: "Create a customer first if the list is empty.",
72
+ currencyLabel: "Currency",
73
+ issueDateLabel: "Issue date",
74
+ dueDateLabel: "Due date",
75
+ lineItemsHeading: "Products and services",
76
+ lineItemsDescription: "Add the products and services on this invoice. You'll have the option to save new items to your inventory.",
77
+ productLabel: "Item name",
78
+ quantityLabel: "Quantity",
79
+ unitLabel: "Units",
80
+ unitPlaceholder: "Select",
81
+ unitNone: "None",
82
+ manageUnitsOption: "Manage measure units",
83
+ priceLabel: "Price",
84
+ taxableLabel: "Taxable",
85
+ taxRateLabel: "Tax rate",
86
+ taxRatePlaceholder: "e.g. 6.25",
87
+ taxRateSuffix: "%",
88
+ decreaseQuantityButton: "Decrease quantity",
89
+ increaseQuantityButton: "Increase quantity",
90
+ addLineItemButton: "Add item",
91
+ removeLineItemButton: "Remove line item",
92
+ cancelButton: "Cancel",
93
+ createButton: "Create",
94
+ updateButton: "Update",
95
+ notesHeading: "Notes",
96
+ notesDescription: "Provide additional information for your customer.",
97
+ optionalSuffix: "(optional)",
98
+ openingNoteLabel: "Opening note to the customer",
99
+ openingNotePlaceholder: "e.g., As discussed on our call, please find the attached invoice.",
100
+ openingNoteDescription: "Appears above your line items. Use it to reference a discussion, agreement, or project.",
101
+ closingNoteLabel: "Closing note to the customer",
102
+ closingNotePlaceholder: "e.g., Thank you for your business!",
103
+ closingNoteDescription: "Appears below your line items. Commonly used for thank you messages or payment instructions.",
104
+ bankAccountHeading: "Payment instructions",
105
+ bankAccountDescription: "Tells the customer how they can pay you. We'll include the selected info on the invoice",
106
+ bankAccountLabel: "Bank account",
107
+ bankAccountHint: "Display your bank account number and routing number",
108
+ bankAccountSelectorLabel: "Bank account selector",
109
+ bankAccountPlaceholder: "Select bank account",
110
+ bankAccountAddOption: "Add a new account",
111
+ bankAccountFormHeading: "Add a bank account",
112
+ bankAccountRoutingNumberLabel: "Routing number",
113
+ bankAccountRoutingNumberPlaceholder: "e.g. 123456789",
114
+ bankAccountAccountNumberLabel: "Account number",
115
+ bankAccountAccountNumberPlaceholder: "e.g. 123456789",
116
+ bankAccountHolderNameLabel: "Account holder name",
117
+ bankAccountHolderNamePlaceholder: "e.g. James Smith",
118
+ bankAccountNicknameLabel: "Account nickname",
119
+ bankAccountNicknamePlaceholder: "e.g. Empire Bank Checking",
120
+ bankAccountCancelButton: "Cancel",
121
+ bankAccountSaveButton: "Save account",
122
+ bankAccountRestrictedTitle: "There are no bank accounts on file for this account",
123
+ bankAccountRestrictedDescription: "A bank account is required in order to issue invoices. Contact your company admin to set one up.",
124
+ attachmentsHeading: "Attachments",
125
+ 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.",
126
+ attachmentsDropPrompt: "Drop your files here, or",
127
+ attachmentsBrowseLink: "browse to upload",
128
+ attachmentsFormatsHint: "PDF, DOC, JPG, PNG (max. 3MB)",
129
+ remindersToggleLabel: "Payment reminders",
130
+ remindersDescription: "Send reminders when an invoice is approaching its due date or past due.",
131
+ remindersLibraryNote: "New reminders will be saved to your organization's library and can be managed via Invoice settings",
132
+ reminderNumberOfDays: "Number of days",
133
+ reminderBefore: "BEFORE",
134
+ reminderAfter: "AFTER",
135
+ reminderDueDate: "due date",
136
+ reminderNone: "No reminder",
137
+ reminderBeforeDueInputLabel: "Days before due date",
138
+ reminderPlaceholder: "e.g., 3",
139
+ reminderAddTermButton: "Add",
140
+ reminderClearButton: "Clear",
141
+ reminderSaveButton: "Save"
142
+ }, i = {
143
+ hiddenDescription: "Receivable details",
144
+ loadingTitle: "Loading...",
145
+ errorTitle: "Receivable not found",
146
+ errorDescription: "We could not load this receivable. Please try again.",
147
+ summaryHeading: "Summary",
148
+ lineItemsHeading: "Line items",
149
+ activityHeading: "Activity",
150
+ mailsHeading: "Email history",
151
+ noLineItems: "No line items.",
152
+ noActivity: "No activity yet.",
153
+ noMails: "No emails sent yet.",
154
+ quantityColumn: "Qty",
155
+ unitPriceColumn: "Unit price",
156
+ totalColumn: "Total",
157
+ closeButton: "Close",
158
+ downloadPdfButton: "Download PDF",
159
+ editButton: "Edit",
160
+ issueButton: "Issue",
161
+ sendButton: "Send",
162
+ acceptButton: "Accept",
163
+ declineButton: "Decline",
164
+ recordPaymentButton: "Record payment",
165
+ markPaidButton: "Mark as paid",
166
+ markUncollectibleButton: "Mark uncollectible",
167
+ cancelButton: "Cancel document",
168
+ cloneButton: "Clone",
169
+ deleteButton: "Delete",
170
+ statusBadge: t
171
+ }, a = {
172
+ title: "Send receivable",
173
+ description: "Send this document to the customer by email.",
174
+ toLabel: "To",
175
+ ccLabel: "CC",
176
+ bccLabel: "BCC",
177
+ subjectLabel: "Subject",
178
+ bodyLabel: "Message",
179
+ cancelButton: "Cancel",
180
+ sendButton: "Send"
181
+ }, o = {
182
+ title: "Record payment",
183
+ description: "Record a full or partial invoice payment.",
184
+ modeLabel: "Payment type",
185
+ fullPayment: "Full payment",
186
+ partialPayment: "Partial payment",
187
+ amountPaidLabel: "Amount paid",
188
+ paidAtLabel: "Paid at",
189
+ commentLabel: "Comment",
190
+ cancelButton: "Cancel",
191
+ submitButton: "Record payment"
192
+ }, s = {
193
+ cancelButton: "Cancel",
194
+ confirmButton: "Confirm"
195
+ };
33
196
  //#endregion
34
- export { u as ReceivableActionDialog, u as default };
197
+ export { n as RECEIVABLES_SCREEN_LABELS_EN, s as RECEIVABLE_ACTION_DIALOG_LABELS_EN, i as RECEIVABLE_DETAILS_SHEET_LABELS_EN, r as RECEIVABLE_FORM_SHEET_LABELS_EN, o as RECEIVABLE_PAYMENT_DIALOG_LABELS_EN, a as RECEIVABLE_SEND_DIALOG_LABELS_EN, t as RECEIVABLE_STATUS_BADGE_LABELS_EN };
@@ -1,207 +1,34 @@
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 "./index2.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
+ 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 "./index3.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/index4.js
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, disabled: o, onAccountSelect: s, onAddAccountClick: c, onFormChange: l, onFormSave: T, onFormCancel: D, labels: O }) {
103
- let k = {
104
- ...v,
105
- ...O
106
- }, A = `${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: k.bankAccountHeading
115
- }), /* @__PURE__ */ b(_, {
116
- variant: "body2",
117
- color: "muted",
118
- className: "ttw:font-medium",
119
- children: k.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: [/* @__PURE__ */ x("div", {
125
- className: "ttw:flex ttw:flex-col ttw:gap-1",
126
- children: [/* @__PURE__ */ b(_, {
127
- variant: "body2",
128
- children: k.bankAccountLabel
129
- }), /* @__PURE__ */ b(_, {
130
- variant: "caption",
131
- color: "muted",
132
- children: k.bankAccountHint
133
- })]
134
- }), a.kind === "loading" ? /* @__PURE__ */ b(g, { className: "ttw:h-9 ttw:w-full ttw:rounded-md" }) : /* @__PURE__ */ x(u, {
135
- disabled: o,
136
- value: a.selected?.value ?? "",
137
- onValueChange: (e) => {
138
- if (e === w) {
139
- c();
140
- return;
141
- }
142
- s(e);
143
- },
144
- children: [/* @__PURE__ */ b(m, {
145
- id: A,
146
- className: "ttw:w-full",
147
- "aria-label": k.bankAccountSelectorLabel,
148
- children: /* @__PURE__ */ b(h, {
149
- placeholder: k.bankAccountPlaceholder,
150
- children: a.selected && /* @__PURE__ */ x("span", {
151
- className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:items-center ttw:justify-between ttw:gap-2",
152
- children: [/* @__PURE__ */ b("span", {
153
- className: "ttw:truncate",
154
- children: a.selected.label
155
- }), a.selected.sourceLabel && /* @__PURE__ */ b(r, {
156
- variant: "secondary",
157
- className: "ttw:shrink-0",
158
- children: a.selected.sourceLabel
159
- })]
160
- })
161
- })
162
- }), /* @__PURE__ */ x(d, { children: [a.options.map((e) => /* @__PURE__ */ b(f, {
163
- value: e.value,
164
- children: /* @__PURE__ */ x("span", {
165
- className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:items-center ttw:justify-between ttw:gap-2",
166
- children: [/* @__PURE__ */ b("span", {
167
- className: "ttw:truncate",
168
- children: e.label
169
- }), e.sourceLabel && /* @__PURE__ */ b("span", {
170
- className: "ttw:shrink-0 ttw:text-muted-foreground",
171
- children: e.sourceLabel
172
- })]
173
- })
174
- }, e.value)), a.canAddAccount && /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(p, {}), /* @__PURE__ */ x(f, {
175
- value: w,
176
- className: "ttw:font-semibold ttw:text-primary ttw:hover:text-primary ttw:focus:text-primary",
177
- children: [/* @__PURE__ */ b(S, { className: "ttw:text-primary" }), k.bankAccountAddOption]
178
- })] })] })]
179
- })]
180
- }),
181
- a.kind === "form" && /* @__PURE__ */ b(E, {
182
- idPrefix: i,
183
- values: a.values,
184
- errors: a.errors,
185
- canCancel: a.canCancel,
186
- isSaving: a.isSaving,
187
- labels: k,
188
- onChange: l,
189
- onSave: T,
190
- onCancel: D
5
+ function u({ open: u, onOpenChange: d, title: f, description: p, confirmLabel: m, destructive: h, error: g, inProgress: _, onConfirm: v, onCancel: y, labels: b }) {
6
+ let x = {
7
+ ...s,
8
+ ...b
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, { children: p })] }),
15
+ g && /* @__PURE__ */ c("p", {
16
+ role: "alert",
17
+ className: "ttw:rounded-md ttw:bg-destructive/10 ttw:px-3 ttw:py-2 ttw:text-sm ttw:text-destructive",
18
+ children: g
191
19
  }),
192
- a.kind === "restricted" && /* @__PURE__ */ x(e, {
193
- className: "ttw:border-transparent ttw:bg-yellow-50 ttw:text-yellow-900 ttw:dark:bg-yellow-950 ttw:dark:text-yellow-100",
194
- children: [
195
- /* @__PURE__ */ b(C, {}),
196
- /* @__PURE__ */ b(n, { children: k.bankAccountRestrictedTitle }),
197
- /* @__PURE__ */ b(t, {
198
- className: "ttw:text-current",
199
- children: k.bankAccountRestrictedDescription
200
- })
201
- ]
202
- })
203
- ]
20
+ /* @__PURE__ */ l(i, { children: [/* @__PURE__ */ c(e, {
21
+ variant: "ghost",
22
+ onClick: y,
23
+ children: x.cancelButton
24
+ }), /* @__PURE__ */ c(e, {
25
+ variant: h ? "destructive" : "default",
26
+ loading: _,
27
+ onClick: v,
28
+ children: m ?? x.confirmButton
29
+ })] })
30
+ ] })
204
31
  });
205
32
  }
206
33
  //#endregion
207
- export { D as ReceivableBankAccountSection };
34
+ export { u as ReceivableActionDialog, u as default };