@tesouro/embedded-components-react 0.11.65 → 0.11.66

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 (39) hide show
  1. package/README.md +14 -14
  2. package/dist/index.css +6 -24
  3. package/dist/index.d.ts +27 -39
  4. package/dist/lib/CounterpartsWidget.d.ts +26 -39
  5. package/dist/lib/CounterpartsWidgetPublic.d.ts +26 -39
  6. package/dist/lib/CustomersWidget.d.ts +26 -39
  7. package/dist/lib/ReceivablesWidget.d.ts +14 -4
  8. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsContainer.js +8 -12
  9. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsPanel.js +93 -110
  10. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +52 -52
  11. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsActions.js +72 -107
  12. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsSheetView.js +27 -27
  13. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsTable.js +112 -145
  14. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js +13 -16
  15. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +3 -122
  16. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/mocks/labels.js +5 -5
  17. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index.js +1 -1
  18. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +44 -65
  19. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +157 -134
  20. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +18 -14
  21. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index5.js +362 -55
  22. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +11 -11
  23. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +7 -7
  24. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +16 -9
  25. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useAddressForm.js +2 -66
  26. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useDeleteController.js +48 -46
  27. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +5 -5
  28. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index10.js +138 -149
  29. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index11.js +19 -20
  30. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js +1 -0
  31. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index13.js +21 -27
  32. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +1 -1
  33. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index3.js +0 -1
  34. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index8.js +2 -2
  35. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index9.js +30 -63
  36. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  37. package/package.json +1 -1
  38. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index6.js +0 -211
  39. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index7.js +0 -509
@@ -54,7 +54,7 @@ function c(a, o, s, c) {
54
54
  };
55
55
  }
56
56
  var l = new Intl.DateTimeFormat(void 0, {
57
- day: "2-digit",
57
+ day: "numeric",
58
58
  month: "short",
59
59
  year: "numeric"
60
60
  });
@@ -66,6 +66,7 @@ function u(e) {
66
66
  function d(e, t, n) {
67
67
  return (e ?? []).map((e) => ({
68
68
  id: e.id,
69
+ documentNumberLabel: e.document_id ?? void 0,
69
70
  amountLabel: a(e.total_amount ?? 0, e.currency ?? void 0),
70
71
  dateLabel: u(e.issued_at ?? e.issue_date ?? e.created_at),
71
72
  ...c(t, e.status ?? void 0, e.due_date, n)
@@ -85,124 +86,4 @@ function p(e, t) {
85
86
  isIncomplete: !(n.account_holder_name && n.account_number && n.routing_number)
86
87
  };
87
88
  }
88
- function m(e, t) {
89
- if (!t) return e;
90
- let n = t.address;
91
- return {
92
- ...g({
93
- editingAddressHeading: t.title,
94
- addingAddressHeading: t.title,
95
- cancelButton: t.cancelButton,
96
- saveButton: t.saveButton,
97
- streetAddressLabel: n?.line1,
98
- addressLine2Label: n?.line2,
99
- cityLabel: n?.city,
100
- stateLabel: n?.state,
101
- statePlaceholder: n?.statePlaceholder,
102
- postalCodeLabel: n?.postalCode,
103
- countryLabel: n?.country,
104
- countryUnitedStates: n?.countryValue
105
- }),
106
- ...e
107
- };
108
- }
109
- function h(e) {
110
- return e ? {
111
- fieldMarkers: e.fieldMarkers,
112
- addressFieldMarkers: e.address?.fieldMarkers,
113
- requiredFieldsLegend: e.requiredFieldsLegend
114
- } : {};
115
- }
116
- function g(e) {
117
- return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
118
- }
119
- function _(e) {
120
- if (!e) return {};
121
- let t = e.address;
122
- return {
123
- labels: g({
124
- editingCustomerDetailsHeading: e.editTitleCustomer,
125
- editingVendorDetailsHeading: e.editTitleVendor,
126
- firstNameLabel: e.firstNameLabel,
127
- lastNameLabel: e.lastNameLabel,
128
- businessNameLabel: e.businessNameLabel,
129
- rowEmail: e.emailLabel,
130
- rowPhone: e.phoneLabel,
131
- rowTaxIdSsn: e.taxIdSsnLabel ?? e.taxIdLabel,
132
- rowTaxIdEin: e.taxIdEinLabel ?? e.taxIdLabel,
133
- taxIdSsnPlaceholder: e.taxIdSsnPlaceholder,
134
- taxIdEinPlaceholder: e.taxIdEinPlaceholder,
135
- customerTaxIdHelp: e.customerTaxIdHelp,
136
- vendorTaxIdHelp: e.vendorTaxIdHelp,
137
- remindersCheckboxLabel: e.paymentRemindersLabel,
138
- remindersCheckboxDescription: e.paymentRemindersDescription,
139
- streetAddressLabel: t?.line1,
140
- addressLine2Label: t?.line2,
141
- cityLabel: t?.city,
142
- stateLabel: t?.state,
143
- statePlaceholder: t?.statePlaceholder,
144
- postalCodeLabel: t?.postalCode,
145
- countryLabel: t?.country,
146
- countryUnitedStates: t?.countryValue,
147
- cancelButton: e.cancelButton,
148
- saveButton: e.saveButton
149
- }),
150
- fieldMarkers: e.fieldMarkers,
151
- addressFieldMarkers: t?.fieldMarkers,
152
- requiredFieldsLegend: e.requiredFieldsLegend
153
- };
154
- }
155
- var v = {
156
- firstName: "firstName",
157
- lastName: "lastName",
158
- businessName: "legalName",
159
- email: "email",
160
- phone: "phone",
161
- taxId: "taxId"
162
- };
163
- function y(e, t, n, r) {
164
- let i = e === "vendor", a = t.entityType === "individual";
165
- return {
166
- heading: i ? r.editingVendorDetailsHeading : r.editingCustomerDetailsHeading,
167
- formError: n.form,
168
- name: a ? {
169
- kind: "person",
170
- firstName: {
171
- value: t.firstName,
172
- error: n.firstName
173
- },
174
- lastName: {
175
- value: t.lastName,
176
- error: n.lastName
177
- }
178
- } : {
179
- kind: "business",
180
- businessName: {
181
- value: t.legalName,
182
- error: n.legalName
183
- }
184
- },
185
- email: {
186
- value: t.email,
187
- error: n.email
188
- },
189
- phone: {
190
- value: t.phone,
191
- error: n.phone
192
- },
193
- taxId: {
194
- value: t.taxId,
195
- error: n.taxId,
196
- label: a ? r.rowTaxIdSsn : r.rowTaxIdEin,
197
- placeholder: a ? r.taxIdSsnPlaceholder : r.taxIdEinPlaceholder,
198
- description: i ? r.vendorTaxIdHelp : r.customerTaxIdHelp
199
- },
200
- contactLayout: i ? "inline" : "stacked",
201
- reminders: i ? void 0 : { checked: t.remindersEnabled },
202
- address: i ? {
203
- values: t.address,
204
- errors: n.address
205
- } : void 0
206
- };
207
- }
208
- export { v as EDIT_FORM_FIELD_KEYS, h as addressFormLabelOverrides, y as buildCounterpartEditFormView, p as buildPaymentMethodView, d as buildRecentDocumentRows, _ as editFormLabelOverrides, u as formatDetailsDate, s as maskTaxId, m as withAddressLabelOverrides };
89
+ export { p as buildPaymentMethodView, d as buildRecentDocumentRows, u as formatDetailsDate, s as maskTaxId };
@@ -1,11 +1,11 @@
1
1
  // ../../libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/mocks/labels.js
2
2
  var e = {
3
3
  blurbs: {
4
- populated: "Six customers with their billed, received and due totals. Search by name, filter by type, sort by name, or click a row to open the customer. Create new adds a customer, and the sheet edits, deletes and adds an address; changes last until you switch scenario. In vendor mode, three vendors with their bills and bank accounts.",
5
- empty: "The organization has no customers yet. Press Create new, fill in a name and email, and save: the customer opens in its sheet and joins the list.",
4
+ populated: "Six customers with their billed, received and due totals. Search by name, filter by type, sort by name, or click a row to open the customer. Add customer adds one, and the sheet edits and deletes it; changes last until you switch scenario. In vendor mode, three vendors with their bills and bank accounts.",
5
+ empty: "The organization has no customers yet. Press Add customer, fill in a name and email, and save: the customer opens in its sheet and joins the list.",
6
6
  loading: "The customers read is held open, so the table skeleton stays on screen.",
7
- error: "The customers read fails with a 500, so the table shows Failed to load Customer. Reload re-issues the read, which fails again.",
8
- "control-hidden": "The token has counterpart:read:org but not counterpart:write:org. The list and the customer sheet render, but Create new, Edit, the delete menu and Add address are absent.",
7
+ error: "The customers read fails with a 500, so the table shows Couldn't load customers. Try again re-issues the read, which fails again.",
8
+ "control-hidden": "The token has counterpart:read:org but not counterpart:write:org. The list and the customer sheet render, but Add customer, Edit and the delete menu are absent.",
9
9
  paginated: "Fourteen customers at ten a page. The next and previous arrows follow the pagination token; the rows-per-page menu starts again from page one."
10
10
  },
11
11
  scenarios: {
@@ -15,7 +15,7 @@ var e = {
15
15
  },
16
16
  "amounts-unavailable": {
17
17
  label: "Amounts unavailable",
18
- blurb: "The customers load but both totals reads fail, so the money columns show a dash and a toast says the amounts could not be loaded."
18
+ blurb: "The customers load but both totals reads fail, so the money columns show an em dash under a warning that says Couldn't load amounts, with Try again."
19
19
  }
20
20
  }
21
21
  };
@@ -1,4 +1,4 @@
1
1
  import { COUNTERPARTS_SCREEN_LABELS_EN as e, COUNTERPART_DETAILS_SHEET_LABELS_EN as t } from "./index2.js";
2
2
  import { CounterpartsScreen as n } from "./index3.js";
3
- import { CounterpartDetailsSheet as r } from "./index7.js";
3
+ import { CounterpartDetailsSheet as r } from "./index5.js";
4
4
  export { e as COUNTERPARTS_SCREEN_LABELS_EN, t as COUNTERPART_DETAILS_SHEET_LABELS_EN, r as CounterpartDetailsSheet, n as CounterpartsScreen };
@@ -1,71 +1,74 @@
1
- import { FILTER_MENU_BUTTON_LABELS_EN as e, FILTER_TAG_LABELS_EN as t } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { BILL_STATUS_BADGE_LABELS_EN as n } from "../../../shared/document-status/ui/dist/index2.js";
3
- import { RECEIVABLE_STATUS_BADGE_LABELS_EN as r } from "../../../shared/document-status/ui/dist/index6.js";
1
+ import { FILTER_TAG_LABELS_EN as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { BILL_STATUS_BADGE_LABELS_EN as t } from "../../../shared/document-status/ui/dist/index2.js";
3
+ import { RECEIVABLE_STATUS_BADGE_LABELS_EN as n } from "../../../shared/document-status/ui/dist/index6.js";
4
4
  import "../../../shared/document-status/ui/dist/index.js";
5
5
  // ../../libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js
6
- var i = {
6
+ var r = {
7
7
  createButton: "Add customer",
8
8
  vendorsCreateButton: "Add vendor",
9
9
  columnName: "Name",
10
- sortByName: "Sort by name",
11
10
  columnBilledAmount: "Billed amount",
11
+ columnInvoicedAmount: "Invoiced amount",
12
12
  columnReceivedAmount: "Received amount",
13
13
  columnAmountDue: "Amount due",
14
- columnTotalPaidToDate: "Total paid to date",
14
+ columnTotalPaidToDate: "Paid amount",
15
15
  columnBalanceDue: "Balance due",
16
16
  openRow: (e) => `View details — ${e}`,
17
17
  unnamedCounterpart: "Unspecified",
18
18
  searchPlaceholder: "Search by name",
19
19
  searchLabel: "Search by name",
20
- filtersButton: e.filters,
21
- filterFieldType: "Type",
22
- filterChipRemove: t.remove,
20
+ entityFilterLabel: "Type",
21
+ entityFilterAll: "All types",
22
+ entityFilterOrganization: "Companies",
23
+ entityFilterIndividual: "Individuals",
24
+ filterChipRemove: e.remove,
23
25
  typeChip: (e) => `Type: ${e}`,
24
26
  searchChip: (e) => `Search: ${e}`,
25
27
  clearAllFilters: "Clear all",
26
- entityFilterOrganization: "Companies",
27
- entityFilterIndividual: "Individuals",
28
28
  customersEmptyTitle: "No customers yet",
29
- customersEmptyDescription: "You don't have any customers yet.",
30
- customersEmptyAction: "Create new",
31
- vendorsEmptyTitle: "Build your vendors list.",
29
+ customersEmptyDescription: "Add a customer to start sending them invoices.",
30
+ customersEmptyAction: "Add customer",
31
+ vendorsEmptyTitle: "Build your vendors list",
32
32
  vendorsEmptyDescription: "Save the people and businesses you pay so you can send payments when bills come in.",
33
- vendorsEmptyAction: "Add your first vendor",
33
+ vendorsEmptyAction: "Add vendor",
34
34
  customersFilterEmptyTitle: "No customers found",
35
35
  vendorsFilterEmptyTitle: "No vendors found",
36
36
  filterEmptyDescription: "Try adjusting your search or filter criteria.",
37
37
  filterEmptyAction: "Clear filters",
38
- customersErrorTitle: "Failed to load Customer",
39
- customersErrorDescription: "There was an error loading customer.",
40
- vendorsErrorTitle: "Failed to load Vendor",
41
- vendorsErrorDescription: "There was an error loading vendor.",
42
- errorRetry: "Reload",
43
- accessRestrictedTitle: "Access Restricted",
44
- accessRestrictedDescription: "You don’t have permissions to view this page. Contact your system administrator for details."
45
- }, a = {
46
- hiddenDescription: "Counterpart details",
47
- loadingTitle: "Loading...",
48
- notFoundCustomerTitle: "Customer not found",
49
- notFoundVendorTitle: "Vendor not found",
50
- notFoundCustomerDescription: "Something went wrong while fetching this customer",
51
- notFoundVendorDescription: "Something went wrong while fetching this vendor",
52
- openActionsMenu: "Open actions menu",
38
+ customersErrorTitle: "Couldn't load customers",
39
+ customersErrorDescription: "Check your connection, then try again.",
40
+ vendorsErrorTitle: "Couldn't load vendors",
41
+ vendorsErrorDescription: "Check your connection, then try again.",
42
+ errorRetry: "Try again",
43
+ accessRestrictedTitle: "Access restricted",
44
+ accessRestrictedDescription: "Ask a company admin for access.",
45
+ amountsUnavailable: "Couldn't load amounts.",
46
+ amountsRetry: "Try again"
47
+ }, i = {
48
+ loadingTitle: "Loading details",
49
+ notFoundCustomerTitle: "Couldn't load customer",
50
+ notFoundVendorTitle: "Couldn't load vendor",
51
+ notFoundCustomerDescription: "It may have been deleted. Close this panel and try again.",
52
+ notFoundVendorDescription: "It may have been deleted. Close this panel and try again.",
53
+ reloadFailed: "Couldn't load the latest details. Close this form and try again.",
54
+ openActionsMenu: "More actions",
53
55
  closeAction: "Close",
54
56
  deleteCustomerAction: "Delete customer",
55
57
  deleteVendorAction: "Delete vendor",
56
58
  summaryAmountDue: "Amount due",
57
59
  summaryBalanceDue: "Balance due",
58
60
  summaryBilled: "Billed",
61
+ summaryInvoiced: "Invoiced",
59
62
  summaryReceived: "Received",
60
63
  summaryPaid: "Paid",
61
64
  summaryRejected: "Rejected",
62
65
  overdueTag: "Overdue",
63
- sendPaymentAction: "Send a payment",
66
+ sendPaymentAction: "Add a bill",
64
67
  issueInvoiceAction: "Issue an invoice",
65
68
  recentCustomerDocumentsHeading: "Recent invoices",
66
69
  recentVendorDocumentsHeading: "Recent bills",
67
- recentCustomerDocumentsDescription: "Latest activity",
68
- recentVendorDocumentsDescription: "Sorted by issue date",
70
+ recentCustomerDocumentsDescription: "Most recent",
71
+ recentVendorDocumentsDescription: "Most recent",
69
72
  viewAllDocumentsAction: "View all",
70
73
  subtitleTemplate: "{type} · Added {date}",
71
74
  customerSubtitleLabel: "Customer",
@@ -84,49 +87,25 @@ var i = {
84
87
  rowPhone: "Phone",
85
88
  rowTaxIdSsn: "Tax ID / SSN",
86
89
  rowTaxIdEin: "Tax ID / EIN",
87
- showTaxId: "Show",
88
- hideTaxId: "Hide",
90
+ showTaxId: "Show tax ID",
91
+ hideTaxId: "Hide tax ID",
89
92
  customerTaxIdHelp: "Required only if you'll issue a 1099 IRS form at year-end.",
90
93
  vendorTaxIdHelp: "Required only if you'll file a 1099 IRS form for this vendor at year-end.",
91
94
  addressHeading: "Address",
92
- customerAddressHeading: "Address",
93
- addAddressAction: "Add address",
94
- editAddressAction: "Edit address",
95
- noAddress: "No address on file.",
95
+ noAddress: "No address on file",
96
96
  paymentMethodsHeading: "Accepted payment methods",
97
97
  paymentMethodsDescription: "ACH bank transfer details for this vendor.",
98
98
  addPaymentMethodAction: "Add payment method",
99
99
  editPaymentMethodAction: "Edit payment method",
100
- deletePaymentMethodAction: "Delete payment method",
100
+ paymentMethodActionsMenu: "More payment method actions",
101
+ deletePaymentMethodAction: "Remove payment method",
101
102
  incompletePaymentMethod: "Incomplete",
102
103
  accountHolderLabel: "Account holder",
103
104
  accountNumberLabel: "Account number",
104
105
  routingNumberLabel: "Routing number",
105
106
  noPaymentMethods: "No payment methods yet.",
106
107
  editButton: "Edit",
107
- billStatusBadge: n,
108
- invoiceStatusBadge: r,
109
- optionalSuffix: "(optional)",
110
- editingCustomerDetailsHeading: "Editing customer details",
111
- editingVendorDetailsHeading: "Editing vendor details",
112
- firstNameLabel: "First name",
113
- lastNameLabel: "Last name",
114
- businessNameLabel: "Business name",
115
- remindersCheckboxLabel: "Payment reminders",
116
- remindersCheckboxDescription: "Send automatic reminders for unpaid customer invoices.",
117
- taxIdSsnPlaceholder: "e.g., 034-56-7890",
118
- taxIdEinPlaceholder: "e.g., 12-3456789",
119
- editingAddressHeading: "Editing address",
120
- addingAddressHeading: "Adding address",
121
- streetAddressLabel: "Address line 1",
122
- addressLine2Label: "Address line 2",
123
- cityLabel: "City",
124
- stateLabel: "State",
125
- statePlaceholder: "Select a state",
126
- postalCodeLabel: "Postal code",
127
- countryLabel: "Country",
128
- countryUnitedStates: "United States",
129
- cancelButton: "Cancel",
130
- saveButton: "Save"
108
+ billStatusBadge: t,
109
+ invoiceStatusBadge: n
131
110
  };
132
- export { i as COUNTERPARTS_SCREEN_LABELS_EN, a as COUNTERPART_DETAILS_SHEET_LABELS_EN };
111
+ export { r as COUNTERPARTS_SCREEN_LABELS_EN, i as COUNTERPART_DETAILS_SHEET_LABELS_EN };