@tesouro/embedded-components-react 0.11.65 → 0.11.68

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 (48) hide show
  1. package/README.md +28 -28
  2. package/dist/index.css +6 -27
  3. package/dist/index.d.ts +29 -41
  4. package/dist/lib/CardDetailsWidget.d.ts +1 -1
  5. package/dist/lib/CounterpartsWidget.d.ts +26 -39
  6. package/dist/lib/CounterpartsWidgetPublic.d.ts +26 -39
  7. package/dist/lib/CreditCardsWidget.d.ts +2 -2
  8. package/dist/lib/CustomersWidget.d.ts +26 -39
  9. package/dist/lib/DebitCardsWidget.d.ts +2 -2
  10. package/dist/lib/ReceivablesWidget.d.ts +14 -4
  11. package/dist/lib/WidgetSuite.d.ts +2 -2
  12. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/CardDetailsWidget.js +0 -4
  13. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/cardDetailsView.js +7 -8
  14. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js +37 -39
  15. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +72 -73
  16. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFace.js +16 -22
  17. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsContainer.js +8 -12
  18. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsPanel.js +93 -110
  19. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +52 -52
  20. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsActions.js +72 -107
  21. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsSheetView.js +27 -27
  22. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsTable.js +112 -145
  23. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js +13 -16
  24. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +3 -122
  25. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/mocks/labels.js +5 -5
  26. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index.js +1 -1
  27. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +44 -65
  28. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +157 -134
  29. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js +18 -14
  30. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index5.js +362 -55
  31. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +11 -11
  32. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +7 -7
  33. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +16 -9
  34. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useAddressForm.js +2 -66
  35. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useDeleteController.js +48 -46
  36. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +5 -5
  37. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index10.js +138 -149
  38. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index11.js +19 -20
  39. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index12.js +1 -0
  40. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index13.js +21 -27
  41. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +1 -1
  42. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index3.js +0 -1
  43. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index8.js +2 -2
  44. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index9.js +30 -63
  45. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  46. package/package.json +1 -1
  47. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index6.js +0 -211
  48. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index7.js +0 -509
@@ -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 };
@@ -1,113 +1,97 @@
1
- import { Button as e, DataTable as t, FilterBar as n, FilterMenuButton as r, FilterTag as i, MultiSelectFilter as a, Popover as o, PopoverContent as s, PopoverTrigger as c, SearchInput as l, Skeleton as u } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { EmptyState as d } from "../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
3
- import { ErrorState as f } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
1
+ import { Alert as e, AlertDescription as t, Button as n, DataTable as r, DataTableSortableHeader as i, FilterTag as a, SearchInput as o, Select as s, SelectContent as c, SelectItem as l, SelectTrigger as u, SelectValue as d, Skeleton as f, TableToolbar as p } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { EmptyState as m } from "../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
3
+ import { ErrorState as h } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
4
+ import { NoAccessState as g } from "../../../shared/ui/dist/lib/StatePanel/NoAccessState.js";
4
5
  import "../../../shared/ui/dist/index.js";
5
- import { COUNTERPARTS_SCREEN_LABELS_EN as p } from "./index2.js";
6
- import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
7
- import { ArrowDownIcon as _, ArrowUpDownIcon as v, ArrowUpIcon as y, ListFilter as b } from "lucide-react";
6
+ import { COUNTERPARTS_SCREEN_LABELS_EN as _ } from "./index2.js";
7
+ import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
8
+ import { TriangleAlertIcon as x } from "lucide-react";
8
9
  // ../../libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js
9
- var x = [
10
+ var S = [
10
11
  10,
11
12
  25,
12
13
  50,
13
14
  100
14
- ];
15
- function S({ labels: e, filters: t, disabled: u }) {
16
- return /* @__PURE__ */ h(n, {
17
- className: "ttw:flex-wrap ttw:px-4",
18
- searchSlot: /* @__PURE__ */ h(l, {
15
+ ], C = "all";
16
+ function w({ labels: e, filters: t, disabled: r, action: i }) {
17
+ return /* @__PURE__ */ y(p, {
18
+ className: "ttw:px-4",
19
+ search: /* @__PURE__ */ y(o, {
19
20
  value: t.searchValue,
20
21
  onChange: (e) => t.onSearchChange(e.target.value),
21
22
  placeholder: e.searchPlaceholder,
22
23
  "aria-label": e.searchLabel,
23
- disabled: u,
24
+ disabled: r,
24
25
  className: "ttw:min-w-64"
25
26
  }),
26
- menuSlot: /* @__PURE__ */ g(o, {
27
- open: t.isPopoverOpen,
28
- onOpenChange: (e) => {
29
- e || t.onPopoverClose();
30
- },
31
- children: [/* @__PURE__ */ h(c, {
32
- asChild: !0,
33
- children: /* @__PURE__ */ h(r, {
34
- activeCount: t.activeFilterCount,
35
- onClick: (e) => {
36
- t.isTypePanelOpen && e.preventDefault(), t.onMenuToggle();
37
- },
38
- disabled: u,
39
- labels: { filters: e.filtersButton }
40
- })
41
- }), /* @__PURE__ */ g(s, {
42
- align: "start",
43
- className: t.isTypePanelOpen ? "ttw:w-56 ttw:p-0" : "ttw:w-52 ttw:p-0",
44
- children: [t.isMenuOpen && /* @__PURE__ */ h("div", {
45
- className: "ttw:p-1",
46
- children: /* @__PURE__ */ g("button", {
47
- type: "button",
48
- className: "ttw:flex ttw:w-full ttw:cursor-pointer ttw:items-center ttw:gap-2 ttw:rounded-md ttw:px-2 ttw:py-1.5 ttw:text-xs ttw:font-medium ttw:transition-colors ttw:hover:bg-accent",
49
- onClick: t.onTypeFieldSelect,
50
- children: [/* @__PURE__ */ h(b, {
51
- className: "ttw:size-4 ttw:shrink-0 ttw:text-muted-foreground",
52
- "aria-hidden": !0
53
- }), e.filterFieldType]
54
- })
55
- }), t.isTypePanelOpen && /* @__PURE__ */ h(a, {
56
- options: [...t.typeOptions],
57
- selectedValues: [...t.selectedTypes],
58
- onSelectionChange: t.onTypeChange
59
- })]
60
- })]
27
+ filters: /* @__PURE__ */ b(s, {
28
+ value: t.selectedType || C,
29
+ onValueChange: (e) => t.onTypeChange(e === C ? "" : e),
30
+ disabled: r,
31
+ children: [/* @__PURE__ */ y(u, {
32
+ size: "sm",
33
+ "aria-label": e.entityFilterLabel,
34
+ children: /* @__PURE__ */ y(d, {})
35
+ }), /* @__PURE__ */ b(c, { children: [/* @__PURE__ */ y(l, {
36
+ value: C,
37
+ children: e.entityFilterAll
38
+ }), t.typeOptions.map((e) => /* @__PURE__ */ y(l, {
39
+ value: e.value,
40
+ children: e.label
41
+ }, e.value))] })]
61
42
  }),
62
- activeChipsSlot: /* @__PURE__ */ g(m, { children: [t.chips.map((n) => /* @__PURE__ */ h(i, {
43
+ action: i,
44
+ tags: t.chips.length > 0 ? /* @__PURE__ */ b(v, { children: [t.chips.map((n) => /* @__PURE__ */ y(a, {
63
45
  label: n.label,
64
- variant: "default",
65
46
  labels: { remove: e.filterChipRemove },
66
47
  onDismiss: () => t.onRemoveChip(n.key)
67
- }, n.key)), t.chips.length > 0 && /* @__PURE__ */ h("button", {
48
+ }, n.key)), /* @__PURE__ */ y(n, {
68
49
  type: "button",
69
- className: "ttw:cursor-pointer ttw:whitespace-nowrap ttw:text-xs ttw:text-muted-foreground ttw:transition-colors ttw:hover:text-foreground",
50
+ variant: "link",
70
51
  onClick: t.onClearAll,
71
52
  children: e.clearAllFilters
72
- })] })
53
+ })] }) : void 0
73
54
  });
74
55
  }
75
- function C({ value: e, isLoading: t, colorClass: n }) {
76
- return /* @__PURE__ */ h("div", {
77
- className: "ttw:flex ttw:justify-end",
78
- children: t ? /* @__PURE__ */ h(u, { className: "ttw:h-4 ttw:w-20" }) : /* @__PURE__ */ h("span", {
79
- className: n,
80
- children: e
81
- })
56
+ function T({ value: e, isLoading: t }) {
57
+ return /* @__PURE__ */ y("div", {
58
+ className: "ttw:flex ttw:justify-end ttw:tabular-nums",
59
+ children: t ? /* @__PURE__ */ y(f, { className: "ttw:h-4 ttw:w-20" }) : e
82
60
  });
83
61
  }
84
- function w({ mode: n, counterparts: r, isLoading: i, isError: a, errorTitle: o, errorDescription: s, sorting: c, onSortingChange: l, pageSize: u, onPageSizeChange: m, pageSizeOptions: b = x, hasNextPage: w, hasPrevPage: T, onNextPage: E, onPrevPage: D, filters: O, isFiltering: k, canCreate: A = !0, isAccessRestricted: j, onCreateClick: M, onRowClick: N, onRetry: P, labels: F, emptyStateTestId: I, accessRestrictedTestId: L }) {
85
- let R = {
86
- ...p,
87
- ...F
88
- }, z = n === "customer", B = z ? R.columnReceivedAmount : R.columnTotalPaidToDate, V = z ? R.columnAmountDue : R.columnBalanceDue, H = [
62
+ function E({ labels: r, onRetry: i }) {
63
+ return /* @__PURE__ */ b(e, {
64
+ variant: "warning",
65
+ children: [/* @__PURE__ */ y(x, {}), /* @__PURE__ */ y(t, { children: /* @__PURE__ */ b("div", {
66
+ className: "ttw:flex ttw:w-full ttw:flex-wrap ttw:items-center ttw:justify-between ttw:gap-2",
67
+ children: [/* @__PURE__ */ y("span", { children: r.amountsUnavailable }), i ? /* @__PURE__ */ y(n, {
68
+ type: "button",
69
+ variant: "link",
70
+ className: "ttw:h-auto ttw:p-0 ttw:text-current",
71
+ onClick: i,
72
+ children: r.amountsRetry
73
+ }) : null]
74
+ }) })]
75
+ });
76
+ }
77
+ function D({ mode: e, counterparts: t, isLoading: a, isError: o, errorTitle: s, errorDescription: c, sorting: l, onSortingChange: u, pageSize: d, onPageSizeChange: f, pageSizeOptions: p = S, hasNextPage: v, hasPrevPage: x, onNextPage: C, onPrevPage: D, filters: O, isFiltering: k, isAmountsError: A, onRetryAmounts: j, canCreate: M = !0, isAccessRestricted: N, onCreateClick: P, onRowClick: F, onRetry: I, labels: L, emptyStateTestId: R, accessRestrictedTestId: z }) {
78
+ let B = {
79
+ ..._,
80
+ ...L
81
+ }, V = e === "customer", H = V ? B.columnInvoicedAmount : B.columnBilledAmount, U = V ? B.columnReceivedAmount : B.columnTotalPaidToDate, W = V ? B.columnAmountDue : B.columnBalanceDue, G = [
89
82
  {
90
83
  accessorKey: "name",
91
84
  enableSorting: !0,
92
- header: ({ column: t }) => {
93
- let n = t.getIsSorted();
94
- return /* @__PURE__ */ g("div", {
95
- className: "ttw:flex ttw:items-center ttw:gap-2 ttw:text-inherit",
96
- children: [R.columnName, /* @__PURE__ */ h(e, {
97
- variant: "ghost",
98
- size: "icon-sm",
99
- "aria-label": R.sortByName,
100
- onClick: () => t.toggleSorting(n === "asc"),
101
- children: h(n === "asc" ? y : n === "desc" ? _ : v, { className: "ttw:size-4" })
102
- })]
103
- });
104
- },
105
- cell: ({ row: e }) => /* @__PURE__ */ g("div", {
85
+ header: ({ column: e }) => /* @__PURE__ */ y(i, {
86
+ column: e,
87
+ title: B.columnName
88
+ }),
89
+ cell: ({ row: e }) => /* @__PURE__ */ b("div", {
106
90
  className: "ttw:flex ttw:flex-col ttw:gap-1",
107
- children: [/* @__PURE__ */ h("span", {
108
- className: "ttw:font-semibold",
91
+ children: [/* @__PURE__ */ y("span", {
92
+ className: "ttw:font-medium",
109
93
  children: e.original.name
110
- }), e.original.locationLabel && /* @__PURE__ */ h("span", {
94
+ }), e.original.locationLabel && /* @__PURE__ */ y("span", {
111
95
  className: "ttw:text-sm ttw:text-muted-foreground",
112
96
  children: e.original.locationLabel
113
97
  })]
@@ -115,84 +99,123 @@ function w({ mode: n, counterparts: r, isLoading: i, isError: a, errorTitle: o,
115
99
  },
116
100
  {
117
101
  accessorKey: "billedAmountLabel",
118
- header: () => /* @__PURE__ */ h("div", {
102
+ header: () => /* @__PURE__ */ y("div", {
119
103
  className: "ttw:text-right",
120
- children: R.columnBilledAmount
104
+ children: H
121
105
  }),
122
- cell: ({ row: e }) => /* @__PURE__ */ h(C, {
106
+ cell: ({ row: e }) => /* @__PURE__ */ y(T, {
123
107
  value: e.original.billedAmountLabel,
124
108
  isLoading: e.original.isBilledAmountLoading
125
109
  })
126
110
  },
127
111
  {
128
112
  accessorKey: "receivedOrPaidAmountLabel",
129
- header: () => /* @__PURE__ */ h("div", {
113
+ header: () => /* @__PURE__ */ y("div", {
130
114
  className: "ttw:text-right",
131
- children: B
115
+ children: U
132
116
  }),
133
- cell: ({ row: e }) => /* @__PURE__ */ h(C, {
117
+ cell: ({ row: e }) => /* @__PURE__ */ y(T, {
134
118
  value: e.original.receivedOrPaidAmountLabel,
135
- isLoading: e.original.isReceivedOrPaidAmountLoading,
136
- colorClass: e.original.isReceivedOrPaidPositive ? "ttw:text-green-700" : void 0
119
+ isLoading: e.original.isReceivedOrPaidAmountLoading
137
120
  })
138
121
  },
139
122
  {
140
123
  accessorKey: "dueOrOwedAmountLabel",
141
- header: () => /* @__PURE__ */ h("div", {
124
+ header: () => /* @__PURE__ */ y("div", {
142
125
  className: "ttw:text-right",
143
- children: V
126
+ children: W
144
127
  }),
145
- cell: ({ row: e }) => /* @__PURE__ */ h(C, {
128
+ cell: ({ row: e }) => /* @__PURE__ */ y(T, {
146
129
  value: e.original.dueOrOwedAmountLabel,
147
130
  isLoading: e.original.isDueOrOwedAmountLoading
148
131
  })
149
132
  }
150
- ], U = z ? R.customersEmptyTitle : R.vendorsEmptyTitle, W = z ? R.customersEmptyDescription : R.vendorsEmptyDescription, G = z ? R.customersEmptyAction : R.vendorsEmptyAction, K = z ? R.customersFilterEmptyTitle : R.vendorsFilterEmptyTitle, q = !k && !O.searchValue && !r.length && !i, J = !(!A || j), Y = !(k || !J), X = !k && !i && !a && !r.length, Z = J && !X, Q = z ? R.createButton : R.vendorsCreateButton;
151
- return /* @__PURE__ */ g("div", {
133
+ ], K = (e) => /* @__PURE__ */ b("div", {
134
+ className: "ttw:flex ttw:flex-col ttw:gap-2",
135
+ children: [/* @__PURE__ */ b("div", {
136
+ className: "ttw:flex ttw:flex-col ttw:gap-1",
137
+ children: [/* @__PURE__ */ y("span", {
138
+ className: "ttw:font-medium",
139
+ children: e.name
140
+ }), e.locationLabel && /* @__PURE__ */ y("span", {
141
+ className: "ttw:text-sm ttw:text-muted-foreground",
142
+ children: e.locationLabel
143
+ })]
144
+ }), [
145
+ {
146
+ label: H,
147
+ value: e.billedAmountLabel,
148
+ isLoading: e.isBilledAmountLoading
149
+ },
150
+ {
151
+ label: U,
152
+ value: e.receivedOrPaidAmountLabel,
153
+ isLoading: e.isReceivedOrPaidAmountLoading
154
+ },
155
+ {
156
+ label: W,
157
+ value: e.dueOrOwedAmountLabel,
158
+ isLoading: e.isDueOrOwedAmountLoading
159
+ }
160
+ ].map((e) => /* @__PURE__ */ b("div", {
161
+ className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-4 ttw:text-sm",
162
+ children: [/* @__PURE__ */ y("span", {
163
+ className: "ttw:text-muted-foreground",
164
+ children: e.label
165
+ }), /* @__PURE__ */ y(T, {
166
+ value: e.value,
167
+ isLoading: e.isLoading
168
+ })]
169
+ }, e.label))]
170
+ }), q = V ? B.customersEmptyTitle : B.vendorsEmptyTitle, J = V ? B.customersEmptyDescription : B.vendorsEmptyDescription, Y = V ? B.customersEmptyAction : B.vendorsEmptyAction, X = V ? B.customersFilterEmptyTitle : B.vendorsFilterEmptyTitle, Z = !k && !O.searchValue && !t.length && !a, Q = !(!M || N), $ = !(k || !Q), ee = !k && !a && !o && !t.length, te = Q && !ee, ne = V ? B.createButton : B.vendorsCreateButton;
171
+ return N ? /* @__PURE__ */ y(g, {
172
+ testId: z,
173
+ title: B.accessRestrictedTitle,
174
+ description: B.accessRestrictedDescription
175
+ }) : o ? /* @__PURE__ */ y(h, {
176
+ title: s,
177
+ description: c,
178
+ retryLabel: I ? B.errorRetry : void 0,
179
+ onRetry: I
180
+ }) : /* @__PURE__ */ b("div", {
152
181
  className: "ttw:flex ttw:flex-col ttw:gap-4",
153
- children: [Z && /* @__PURE__ */ h("div", {
154
- className: "ttw:flex ttw:items-center ttw:justify-end ttw:gap-2",
155
- children: /* @__PURE__ */ h(e, {
156
- onClick: M,
157
- children: Q
158
- })
159
- }), j ? /* @__PURE__ */ h(f, {
160
- testId: L,
161
- title: R.accessRestrictedTitle,
162
- description: R.accessRestrictedDescription
163
- }) : a ? /* @__PURE__ */ h(f, {
164
- title: o,
165
- description: s,
166
- retryLabel: P ? R.errorRetry : void 0,
167
- onRetry: P
168
- }) : /* @__PURE__ */ h(t, {
169
- columns: H,
170
- data: r,
171
- isLoading: i,
172
- sorting: c,
173
- onSortingChange: l,
174
- pageSize: u,
175
- onPageSizeChange: m,
176
- pageSizeOptions: b,
177
- hasNextPage: w,
178
- hasPrevPage: T,
179
- onNextPage: E,
182
+ children: [A && /* @__PURE__ */ y(E, {
183
+ labels: B,
184
+ onRetry: j
185
+ }), /* @__PURE__ */ y(r, {
186
+ columns: G,
187
+ data: t,
188
+ isLoading: a,
189
+ sorting: l,
190
+ onSortingChange: u,
191
+ pageSize: d,
192
+ onPageSizeChange: f,
193
+ pageSizeOptions: p,
194
+ hasNextPage: v,
195
+ hasPrevPage: x,
196
+ onNextPage: C,
180
197
  onPrevPage: D,
181
- onRowClick: N,
182
- rowAriaLabel: (e) => R.openRow(e.name),
183
- filterComponent: /* @__PURE__ */ h(S, {
184
- labels: R,
198
+ showPagination: !!(a || t.length > 0 || x),
199
+ onRowClick: F,
200
+ rowAriaLabel: (e) => B.openRow(e.name),
201
+ renderCard: K,
202
+ filterComponent: /* @__PURE__ */ y(w, {
203
+ labels: B,
185
204
  filters: O,
186
- disabled: q
205
+ disabled: Z,
206
+ action: te ? /* @__PURE__ */ y(n, {
207
+ onClick: P,
208
+ children: ne
209
+ }) : void 0
187
210
  }),
188
- children: /* @__PURE__ */ h(d, {
189
- testId: I,
190
- title: k ? K : U,
191
- description: k ? R.filterEmptyDescription : W,
192
- actionLabel: k ? R.filterEmptyAction : Y ? G : void 0,
193
- onAction: k ? O.onClearAll : Y ? M : void 0
211
+ children: /* @__PURE__ */ y(m, {
212
+ testId: R,
213
+ title: k ? X : q,
214
+ description: k ? B.filterEmptyDescription : J,
215
+ actionLabel: k ? B.filterEmptyAction : $ ? Y : void 0,
216
+ onAction: k ? O.onClearAll : $ ? P : void 0
194
217
  })
195
218
  })]
196
219
  });
197
220
  }
198
- export { w as CounterpartsScreen, w as default };
221
+ export { D as CounterpartsScreen, D as default };
@@ -1,15 +1,19 @@
1
1
  // ../../libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index4.js
2
- function e(e, t) {
3
- return {
4
- line1: e.streetAddressLabel,
5
- line2: e.addressLine2Label,
6
- city: e.cityLabel,
7
- state: e.stateLabel,
8
- statePlaceholder: e.statePlaceholder,
9
- postalCode: e.postalCodeLabel,
10
- country: e.countryLabel,
11
- countryValue: e.countryUnitedStates,
12
- fieldMarkers: t
13
- };
14
- }
15
- export { e as addressFieldLabels };
2
+ var e = {
3
+ neutral: { tone: "neutral" },
4
+ accent: { accent: "violet" },
5
+ info: { tone: "info" },
6
+ committed: { accent: "cyan" },
7
+ success: { tone: "success" },
8
+ settled: { tone: "success" },
9
+ warning: { tone: "warning" },
10
+ danger: { tone: "destructive" }
11
+ }, t = {
12
+ neutral: { tone: "neutral" },
13
+ cyan: { accent: "cyan" },
14
+ success: { tone: "success" },
15
+ purple: { accent: "violet" },
16
+ orange: { tone: "destructive" },
17
+ danger: { tone: "destructive" }
18
+ };
19
+ export { e as BILL_STATUS_BADGE_COLOR, t as INVOICE_STATUS_BADGE_COLOR };