@tesouro/embedded-components-react 0.11.119 → 0.11.122

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 (46) hide show
  1. package/dist/index.css +32 -154
  2. package/dist/index.d.ts +11 -2
  3. package/dist/lib/ExpenseManagementWidget.d.ts +11 -2
  4. package/dist/lib/WidgetSuite.d.ts +11 -2
  5. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/ExpenseManagementWidget.js +343 -264
  6. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/labels.js +14 -0
  7. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/permissions.js +6 -3
  8. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/useExpenseTabBadgeCounts.js +34 -19
  9. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/useExpensesTransactions.js +100 -98
  10. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/TransactionDetails/TransactionDetailsActionsFeature.js +27 -24
  11. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/TransactionDetails/TransactionDetailsFeature.js +1 -0
  12. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/expenseStatus.js +2 -2
  13. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index2.js +43 -44
  14. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index4.js +79 -40
  15. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index2.js +10 -0
  16. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index3.js +47 -46
  17. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index4.js +78 -84
  18. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index5.js +165 -158
  19. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index6.js +38 -100
  20. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index7.js +77 -54
  21. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/AccordionItemCard/AccordionItemCard.js +213 -229
  22. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/ExpenseStatusBadge.js +6 -8
  23. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesScreen/ExpensesScreen.js +66 -73
  24. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesTransactionsFilterBar/ExpensesTransactionsFilterBar.js +13 -13
  25. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesTransactionsTable/ExpensesTransactionsTable.js +123 -80
  26. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesTransactionsTable/labels.js +1 -0
  27. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/FileViewer/FileViewer.js +83 -74
  28. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/DeleteReceiptDialog/DeleteReceiptDialog.js +22 -30
  29. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/TransactionDetails.js +176 -259
  30. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/labels.js +4 -2
  31. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetailsActions/BulkProgress.js +1 -0
  32. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetailsActions/TransactionDetailsActions.js +112 -121
  33. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetailsActions/labels.js +1 -0
  34. package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/feature/dist/lib/ExpenseRequirementsWidget.js +41 -32
  35. package/dist/libs/tesouro-embedded-components-react/shared/expense-requirements/ui/dist/index3.js +43 -53
  36. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  37. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +3 -1
  38. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/CopyAddress/CopyAddress.js +55 -0
  39. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/UploadTray/UploadTray.js +84 -0
  40. package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/feature/dist/lib/UploadReceiptWidget.js +126 -73
  41. package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/ui/dist/index2.js +14 -1
  42. package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/ui/dist/index3.js +9 -8
  43. package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/ui/dist/index4.js +75 -128
  44. package/dist/packages/shared-ui-shadcn/dist/index.js +1399 -1302
  45. package/package.json +1 -1
  46. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/badgeTones.js +0 -9
@@ -1,12 +1,10 @@
1
1
  import { Badge as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { EXPENSE_BADGE_TONE_CLASS_NAME as t } from "./badgeTones.js";
3
- import { jsx as n } from "react/jsx-runtime";
2
+ import { jsx as t } from "react/jsx-runtime";
4
3
  // ../../libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/ExpenseStatusBadge.js
5
- function r({ label: r, tone: i }) {
6
- return /* @__PURE__ */ n(e, {
7
- variant: "outline",
8
- className: t[i],
9
- children: r
4
+ function n({ label: n, tone: r }) {
5
+ return /* @__PURE__ */ t(e, {
6
+ tone: r,
7
+ children: n
10
8
  });
11
9
  }
12
- export { r as ExpenseStatusBadge, r as default };
10
+ export { n as ExpenseStatusBadge, n as default };
@@ -2,116 +2,109 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { Badge as e, Button as t, Spinner as n, Tabs as r, TabsContent as i, TabsList as a, TabsTrigger as o } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { EXPENSES_HEADER_LABELS_EN as s } from "../ExpensesHeader/labels.js";
7
- import { ExpensesHeader as c } from "../ExpensesHeader/ExpensesHeader.js";
8
- import { DEFAULT_LABELS as l } from "./labels.js";
9
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
10
- import { SettingsIcon as f } from "lucide-react";
5
+ import { Button as e, Skeleton as t, Tabs as n, TabsContent as r, TabsList as i, TabsTrigger as a, Tooltip as o, TooltipContent as s, TooltipProvider as c, TooltipTrigger as l } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { LoadingRegion as u } from "../../../../../shared/ui/dist/lib/LoadingRegion/LoadingRegion.js";
7
+ import "../../../../../shared/ui/dist/index.js";
8
+ import { EXPENSES_HEADER_LABELS_EN as d } from "../ExpensesHeader/labels.js";
9
+ import { ExpensesHeader as f } from "../ExpensesHeader/ExpensesHeader.js";
10
+ import { DEFAULT_LABELS as p } from "./labels.js";
11
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
12
+ import { SettingsIcon as g } from "lucide-react";
11
13
  // ../../libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesScreen/ExpensesScreen.js
12
- function p({ labels: p, header: m, headerLabels: h, myTransactionsContent: g, teamTransactionsContent: _, myTransactionsCount: v, teamTransactionsCount: y, policiesContent: b, requirementsContent: x, matchingContent: S, activeTab: C, onActiveTabChange: w, isLoading: T = !1 }) {
13
- let E = {
14
- ...l,
15
- ...p
16
- }, D = {
17
- ...s,
18
- ...h
19
- }, { onSettingsClick: O, actions: k, ...A } = m ?? {}, j = !!(O || k), M = _ ? "team-transactions" : "my-transactions";
20
- return /* @__PURE__ */ d("section", {
14
+ function _({ labels: _, header: v, headerLabels: y, myTransactionsContent: b, teamTransactionsContent: x, myTransactionsCount: S, teamTransactionsCount: C, policiesContent: w, requirementsContent: T, matchingContent: E, activeTab: D, onActiveTabChange: O, isLoading: k = !1 }) {
15
+ let A = {
16
+ ...p,
17
+ ..._
18
+ }, j = {
19
+ ...d,
20
+ ...y
21
+ }, { onSettingsClick: M, actions: N, ...P } = v ?? {}, F = !!(M || N), I = x ? "team-transactions" : "my-transactions";
22
+ return /* @__PURE__ */ h("section", {
21
23
  className: "ttw:w-full ttw:space-y-4",
22
- children: [/* @__PURE__ */ u(c, {
23
- ...A,
24
- labels: h
25
- }), T ? /* @__PURE__ */ u("div", {
26
- className: "ttw:flex ttw:justify-center ttw:py-12",
27
- children: /* @__PURE__ */ u(n, {
28
- className: "ttw:size-6",
29
- "aria-label": E.loading
30
- })
31
- }) : /* @__PURE__ */ d(r, {
32
- defaultValue: M,
33
- value: C,
34
- onValueChange: w,
24
+ children: [/* @__PURE__ */ m(f, {
25
+ ...P,
26
+ labels: y
27
+ }), k ? /* @__PURE__ */ h(u, {
28
+ isLoading: !0,
29
+ loadingLabel: A.loading,
30
+ className: "ttw:space-y-4 ttw:py-4",
31
+ children: [/* @__PURE__ */ m(t, { className: "ttw:h-10 ttw:w-full" }), /* @__PURE__ */ m(t, { className: "ttw:h-32 ttw:w-full" })]
32
+ }) : /* @__PURE__ */ h(n, {
33
+ defaultValue: I,
34
+ value: D,
35
+ onValueChange: O,
35
36
  children: [
36
- /* @__PURE__ */ d("div", {
37
+ /* @__PURE__ */ h("div", {
37
38
  className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:justify-between ttw:gap-2",
38
- children: [/* @__PURE__ */ d(a, {
39
+ children: [/* @__PURE__ */ h(i, {
39
40
  variant: "underline",
40
41
  className: "ttw:flex ttw:flex-wrap ttw:justify-start",
41
42
  children: [
42
- _ ? /* @__PURE__ */ d(o, {
43
+ x ? /* @__PURE__ */ m(a, {
43
44
  value: "team-transactions",
44
- className: "ttw:gap-2",
45
- children: [E.teamTransactionsTab, y ? /* @__PURE__ */ u(e, {
46
- variant: "default",
47
- className: "ttw:h-4.5 ttw:min-w-4.5 ttw:rounded-full ttw:px-1.5",
48
- "aria-label": `${y} ${E.tabCountAriaSuffix}`,
49
- children: y
50
- }) : null]
45
+ count: C,
46
+ children: A.teamTransactionsTab
51
47
  }) : null,
52
- /* @__PURE__ */ d(o, {
48
+ /* @__PURE__ */ m(a, {
53
49
  value: "my-transactions",
54
- className: "ttw:gap-2",
55
- children: [E.myTransactionsTab, v ? /* @__PURE__ */ u(e, {
56
- variant: "default",
57
- className: "ttw:h-4.5 ttw:min-w-4.5 ttw:rounded-full ttw:px-1.5",
58
- "aria-label": `${v} ${E.tabCountAriaSuffix}`,
59
- children: v
60
- }) : null]
50
+ count: S,
51
+ children: A.myTransactionsTab
61
52
  }),
62
- b ? /* @__PURE__ */ u(o, {
53
+ w ? /* @__PURE__ */ m(a, {
63
54
  value: "policies",
64
- children: E.policiesTab
55
+ children: A.policiesTab
65
56
  }) : null,
66
- x ? /* @__PURE__ */ u(o, {
57
+ T ? /* @__PURE__ */ m(a, {
67
58
  value: "requirements",
68
- children: E.requirementsTab
59
+ children: A.requirementsTab
69
60
  }) : null,
70
- S ? /* @__PURE__ */ u(o, {
61
+ E ? /* @__PURE__ */ m(a, {
71
62
  value: "matching",
72
- children: E.matchingTab
63
+ children: A.matchingTab
73
64
  }) : null
74
65
  ]
75
- }), j ? /* @__PURE__ */ d("div", {
66
+ }), F ? /* @__PURE__ */ h("div", {
76
67
  className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-2",
77
- children: [O ? /* @__PURE__ */ u(t, {
78
- type: "button",
79
- variant: "outline",
80
- size: "icon",
81
- className: "ttw:h-10 ttw:cursor-pointer ttw:rounded-xl ttw:border-border",
82
- "aria-label": D.settingsButtonAriaLabel,
83
- onClick: O,
84
- children: /* @__PURE__ */ u(f, { className: "ttw:size-4.5" })
85
- }) : null, k]
68
+ children: [M ? /* @__PURE__ */ m(c, { children: /* @__PURE__ */ h(o, { children: [/* @__PURE__ */ m(l, {
69
+ asChild: !0,
70
+ children: /* @__PURE__ */ m(e, {
71
+ type: "button",
72
+ variant: "ghost",
73
+ size: "icon",
74
+ "aria-label": j.settingsButtonAriaLabel,
75
+ onClick: M,
76
+ children: /* @__PURE__ */ m(g, { className: "ttw:size-4" })
77
+ })
78
+ }), /* @__PURE__ */ m(s, { children: j.settingsButtonAriaLabel })] }) }) : null, N]
86
79
  }) : null]
87
80
  }),
88
- /* @__PURE__ */ u(i, {
81
+ /* @__PURE__ */ m(r, {
89
82
  value: "my-transactions",
90
83
  className: "ttw:pt-2",
91
- children: g
84
+ children: b
92
85
  }),
93
- _ ? /* @__PURE__ */ u(i, {
86
+ x ? /* @__PURE__ */ m(r, {
94
87
  value: "team-transactions",
95
88
  className: "ttw:pt-2",
96
- children: _
89
+ children: x
97
90
  }) : null,
98
- b ? /* @__PURE__ */ u(i, {
91
+ w ? /* @__PURE__ */ m(r, {
99
92
  value: "policies",
100
93
  className: "ttw:pt-2",
101
- children: b
94
+ children: w
102
95
  }) : null,
103
- x ? /* @__PURE__ */ u(i, {
96
+ T ? /* @__PURE__ */ m(r, {
104
97
  value: "requirements",
105
98
  className: "ttw:pt-2",
106
- children: x
99
+ children: T
107
100
  }) : null,
108
- S ? /* @__PURE__ */ u(i, {
101
+ E ? /* @__PURE__ */ m(r, {
109
102
  value: "matching",
110
103
  className: "ttw:pt-2",
111
- children: S
104
+ children: E
112
105
  }) : null
113
106
  ]
114
107
  })]
115
108
  });
116
109
  }
117
- export { p as ExpensesScreen, p as default };
110
+ export { _ as ExpensesScreen, _ as default };
@@ -2,7 +2,7 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { AmountFilter as e, DateRangePicker 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, useFilterPanel as u } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
5
+ import { AmountFilter as e, DateRangePicker as t, FilterMenuButton as n, FilterTag as r, MultiSelectFilter as i, Popover as a, PopoverContent as o, PopoverTrigger as s, SearchInput as c, TableToolbar as l, useFilterPanel as u } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
6
  import { EXPENSES_TRANSACTIONS_FILTER_BAR_LABELS_EN as d } from "./labels.js";
7
7
  import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
8
8
  import { ListFilter as h } from "lucide-react";
@@ -57,26 +57,26 @@ function _(_) {
57
57
  }, D = (e) => {
58
58
  e === "card" ? (_.onCardToggle(), x.closeMenu()) : x.openPanel(e);
59
59
  };
60
- return /* @__PURE__ */ p(n, {
60
+ return /* @__PURE__ */ p(l, {
61
61
  className: "ttw:pl-4",
62
- searchSlot: /* @__PURE__ */ p(l, {
62
+ search: /* @__PURE__ */ p(c, {
63
63
  value: _.searchValue,
64
64
  onChange: (e) => _.onSearchChange(e.target.value),
65
65
  placeholder: v.searchPlaceholder,
66
66
  "aria-label": v.searchAriaLabel,
67
67
  className: "ttw:min-w-56"
68
68
  }),
69
- menuSlot: /* @__PURE__ */ m(o, {
69
+ filterButton: /* @__PURE__ */ m(a, {
70
70
  open: C,
71
71
  onOpenChange: E,
72
- children: [/* @__PURE__ */ p(c, {
72
+ children: [/* @__PURE__ */ p(s, {
73
73
  asChild: !0,
74
- children: /* @__PURE__ */ p(r, {
74
+ children: /* @__PURE__ */ p(n, {
75
75
  activeCount: _.activeFilterCount,
76
76
  onClick: x.toggleMenu,
77
77
  "aria-label": v.filtersButtonAriaLabel
78
78
  })
79
- }), /* @__PURE__ */ m(s, {
79
+ }), /* @__PURE__ */ m(o, {
80
80
  align: "start",
81
81
  className: `ttw:p-0 ${w}`,
82
82
  children: [
@@ -90,7 +90,7 @@ function _(_) {
90
90
  /* @__PURE__ */ p(h, { className: "ttw:size-4 ttw:text-muted-foreground ttw:shrink-0" }),
91
91
  e.label,
92
92
  e.id === "card" && _.cardOnly ? /* @__PURE__ */ p("span", {
93
- className: "ttw:ml-auto ttw:text-xs ttw:text-indigo-600 ttw:font-semibold",
93
+ className: "ttw:ml-auto ttw:text-xs ttw:text-primary ttw:font-semibold",
94
94
  children: v.cardOnlyOn
95
95
  }) : null
96
96
  ]
@@ -105,22 +105,22 @@ function _(_) {
105
105
  presets: T,
106
106
  labels: { fieldLabel: v.dateRangeFieldLabel }
107
107
  }) : null,
108
- x.activePanelId === "paymentStatus" ? /* @__PURE__ */ p(a, {
108
+ x.activePanelId === "paymentStatus" ? /* @__PURE__ */ p(i, {
109
109
  options: _.paymentStatusOptions,
110
110
  selectedValues: _.selectedPaymentStatus,
111
111
  onSelectionChange: _.onPaymentStatusChange
112
112
  }) : null,
113
- x.activePanelId === "approvalStatus" ? /* @__PURE__ */ p(a, {
113
+ x.activePanelId === "approvalStatus" ? /* @__PURE__ */ p(i, {
114
114
  options: _.approvalStatusOptions,
115
115
  selectedValues: _.selectedApprovalStatus,
116
116
  onSelectionChange: _.onApprovalStatusChange
117
117
  }) : null,
118
- x.activePanelId === "type" ? /* @__PURE__ */ p(a, {
118
+ x.activePanelId === "type" ? /* @__PURE__ */ p(i, {
119
119
  options: _.typeOptions,
120
120
  selectedValues: _.selectedTypes,
121
121
  onSelectionChange: _.onTypeChange
122
122
  }) : null,
123
- x.activePanelId === "teamMember" ? /* @__PURE__ */ p(a, {
123
+ x.activePanelId === "teamMember" ? /* @__PURE__ */ p(i, {
124
124
  options: _.teamMemberOptions,
125
125
  selectedValues: _.selectedTeamMembers,
126
126
  onSelectionChange: _.onTeamMembersChange,
@@ -141,7 +141,7 @@ function _(_) {
141
141
  ]
142
142
  })]
143
143
  }),
144
- activeChipsSlot: /* @__PURE__ */ m(f, { children: [_.activeChips.map((e) => /* @__PURE__ */ p(i, {
144
+ tags: /* @__PURE__ */ m(f, { children: [_.activeChips.map((e) => /* @__PURE__ */ p(r, {
145
145
  label: e.label,
146
146
  count: e.count,
147
147
  variant: "default",
@@ -2,144 +2,187 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { Button as e, DataTable as t, DataTableSortableHeader as n } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { ExpenseStatusBadge as r } from "../ExpenseStatusBadge/ExpenseStatusBadge.js";
7
- import { EXPENSES_TRANSACTIONS_TABLE_LABELS_EN as i } from "./labels.js";
8
- import { useMemo as a } from "react";
9
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
10
- import { Loader2 as c, Plus as l, ReceiptIcon as u } from "lucide-react";
5
+ import { Badge as e, Button as t, DataTable as n, DataTableSortableHeader as r } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { ExpenseStatusBadge as i } from "../ExpenseStatusBadge/ExpenseStatusBadge.js";
7
+ import { EXPENSES_TRANSACTIONS_TABLE_LABELS_EN as a } from "./labels.js";
8
+ import { useMemo as o } from "react";
9
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
10
+ import { Loader2 as l, Plus as u, ReceiptIcon as d } from "lucide-react";
11
11
  // ../../libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesTransactionsTable/ExpensesTransactionsTable.js
12
- function d({ labels: d, rows: f, isLoading: p, sorting: m, onSortingChange: h, pageSize: g, onPageSizeChange: _, pageSizeOptions: v, hasNextPage: y, hasPrevPage: b, onNextPage: x, onPrevPage: S, pageInfo: C, filterComponent: w, emptyState: T, showCardholderColumn: E = !0, showDepartmentColumn: D = !0, onAddReceiptClick: O, uploadingReceiptId: k, onRowClick: A }) {
13
- let j = {
14
- ...i,
15
- ...d
16
- }, M = A ? {
17
- onRowClick: (e) => A(e.id),
18
- rowAriaLabel: (e) => j.rowAriaLabel(e.merchantLabel, e.amountLabel)
19
- } : {}, N = a(() => {
20
- let t = [
12
+ function f({ labels: f, rows: p, isLoading: m, sorting: h, onSortingChange: g, pageSize: _, onPageSizeChange: v, pageSizeOptions: y, hasNextPage: b, hasPrevPage: x, onNextPage: S, onPrevPage: C, pageInfo: w, filterComponent: T, emptyState: E, showCardholderColumn: D = !0, showDepartmentColumn: O = !0, onAddReceiptClick: k, uploadingReceiptId: A, onRowClick: j }) {
13
+ let M = o(() => ({
14
+ ...a,
15
+ ...f
16
+ }), [f]), N = j ? {
17
+ onRowClick: (e) => j(e.id),
18
+ rowAriaLabel: (e) => M.rowAriaLabel(e.merchantLabel, e.amountLabel)
19
+ } : {}, P = o(() => {
20
+ let n = [
21
21
  {
22
22
  id: "startedAt",
23
- header: ({ column: e }) => /* @__PURE__ */ o(n, {
23
+ meta: { fitContent: !0 },
24
+ header: ({ column: e }) => /* @__PURE__ */ s(r, {
24
25
  column: e,
25
- title: j.dateColumn
26
+ title: M.dateColumn
26
27
  }),
27
28
  enableSorting: !0,
28
- cell: ({ row: e }) => /* @__PURE__ */ o("span", {
29
+ cell: ({ row: e }) => /* @__PURE__ */ s("span", {
29
30
  className: "ttw:whitespace-nowrap",
30
31
  children: e.original.dateLabel
31
32
  })
32
33
  },
33
34
  {
34
35
  id: "status",
35
- header: j.statusColumn,
36
+ meta: { fitContent: !0 },
37
+ header: M.statusColumn,
36
38
  enableSorting: !1,
37
- cell: ({ row: e }) => /* @__PURE__ */ o(r, {
39
+ cell: ({ row: e }) => /* @__PURE__ */ s(i, {
38
40
  label: e.original.statusLabel,
39
41
  tone: e.original.statusTone
40
42
  })
41
43
  },
42
44
  {
43
45
  accessorKey: "merchantLabel",
44
- header: j.merchantColumn,
46
+ header: M.merchantColumn,
45
47
  enableSorting: !1,
46
- cell: ({ row: e }) => /* @__PURE__ */ o("div", {
47
- className: "ttw:truncate",
48
+ cell: ({ row: e }) => /* @__PURE__ */ s("div", {
49
+ className: "ttw:max-w-50 ttw:truncate",
50
+ title: e.original.merchantLabel,
48
51
  children: e.original.merchantLabel
49
52
  })
50
53
  }
51
54
  ];
52
- return E && t.push({
55
+ return D && n.push({
53
56
  accessorKey: "cardholderLabel",
54
- header: j.cardholderColumn,
57
+ header: M.cardholderColumn,
55
58
  enableSorting: !1,
56
- cell: ({ row: e }) => /* @__PURE__ */ o("span", {
57
- className: "ttw:inline-block ttw:w-[95%] ttw:truncate",
59
+ cell: ({ row: e }) => /* @__PURE__ */ s("span", {
60
+ className: "ttw:inline-block ttw:max-w-50 ttw:truncate",
61
+ title: e.original.cardholderLabel,
58
62
  children: e.original.cardholderLabel
59
63
  })
60
- }), t.push({
64
+ }), n.push({
61
65
  accessorKey: "cardLabel",
62
- header: j.cardColumn,
66
+ header: M.cardColumn,
63
67
  enableSorting: !1,
64
- cell: ({ row: e }) => /* @__PURE__ */ s("div", {
68
+ cell: ({ row: t }) => /* @__PURE__ */ c("div", {
65
69
  className: "ttw:flex ttw:items-center ttw:gap-1",
66
- children: [/* @__PURE__ */ o("span", {
67
- className: "ttw:text-zinc-500",
68
- children: e.original.cardLabel
69
- }), e.original.cardFormatLabel ? /* @__PURE__ */ o("span", {
70
- className: "ttw:rounded-sm ttw:bg-zinc-100 ttw:text-[10px] ttw:text-zinc-700 ttw:p-1",
71
- children: e.original.cardFormatLabel
70
+ children: [/* @__PURE__ */ s("span", {
71
+ className: "ttw:max-w-50 ttw:truncate ttw:text-muted-foreground",
72
+ title: t.original.cardLabel,
73
+ children: t.original.cardLabel
74
+ }), t.original.cardFormatLabel ? /* @__PURE__ */ s(e, {
75
+ tone: "neutral",
76
+ children: t.original.cardFormatLabel
72
77
  }) : null]
73
78
  })
74
- }), D && t.push({
79
+ }), O && n.push({
75
80
  accessorKey: "departmentLabel",
76
- header: j.departmentColumn,
81
+ header: M.departmentColumn,
77
82
  enableSorting: !1,
78
- cell: ({ row: e }) => /* @__PURE__ */ o("span", {
83
+ cell: ({ row: e }) => /* @__PURE__ */ s("span", {
79
84
  className: "ttw:whitespace-nowrap",
80
85
  children: e.original.departmentLabel
81
86
  })
82
- }), t.push({
87
+ }), n.push({
83
88
  id: "receipt",
84
- header: j.receiptColumn,
89
+ header: M.receiptColumn,
85
90
  enableSorting: !1,
86
- cell: ({ row: t }) => {
87
- if (t.original.hasReceipt) return /* @__PURE__ */ o(u, {
88
- className: t.original.isReceiptHighlighted ? "ttw:size-4 ttw:text-purple-700" : "ttw:size-4",
91
+ cell: ({ row: e }) => {
92
+ if (e.original.hasReceipt) return /* @__PURE__ */ s(d, {
93
+ className: e.original.isReceiptHighlighted ? "ttw:size-4 ttw:text-violet-foreground" : "ttw:size-4",
89
94
  role: "img",
90
- "aria-label": j.receiptPresentAriaLabel
95
+ "aria-label": M.receiptPresentAriaLabel
91
96
  });
92
- if (!O) return null;
93
- let n = t.original.id === k;
94
- return /* @__PURE__ */ o(e, {
97
+ if (!k) return null;
98
+ let n = e.original.id === A;
99
+ return /* @__PURE__ */ s(t, {
95
100
  type: "button",
96
- variant: "outline",
101
+ variant: "ghost",
97
102
  size: "icon-sm",
98
- "aria-label": n ? j.addingReceiptAriaLabel : j.addReceiptAriaLabel,
103
+ "aria-label": n ? M.addingReceiptAriaLabel : M.addReceiptAriaLabel,
99
104
  disabled: n,
100
- onClick: (e) => {
101
- e.stopPropagation(), O(t.original.id);
105
+ onClick: (t) => {
106
+ t.stopPropagation(), k(e.original.id);
102
107
  },
103
- children: n ? /* @__PURE__ */ o(c, { className: "ttw:size-4 ttw:animate-spin" }) : /* @__PURE__ */ o(l, { className: "ttw:size-4" })
108
+ children: n ? /* @__PURE__ */ s(l, { className: "ttw:size-4 ttw:animate-spin" }) : /* @__PURE__ */ s(u, { className: "ttw:size-4" })
104
109
  });
105
110
  }
106
111
  }, {
107
112
  id: "amount",
108
- header: ({ column: e }) => /* @__PURE__ */ o(n, {
109
- column: e,
110
- title: j.amountColumn
113
+ meta: { fitContent: !0 },
114
+ header: ({ column: e }) => /* @__PURE__ */ s("div", {
115
+ className: "ttw:flex ttw:justify-end",
116
+ children: /* @__PURE__ */ s(r, {
117
+ column: e,
118
+ title: M.amountColumn
119
+ })
111
120
  }),
112
121
  enableSorting: !0,
113
- cell: ({ row: e }) => /* @__PURE__ */ o("span", {
114
- className: "ttw:font-medium ttw:whitespace-nowrap",
122
+ cell: ({ row: e }) => /* @__PURE__ */ s("span", {
123
+ className: "ttw:block ttw:text-right ttw:tabular-nums ttw:font-medium ttw:whitespace-nowrap",
115
124
  children: e.original.amountLabel
116
125
  })
117
- }), t;
126
+ }), n;
118
127
  }, [
119
- j,
120
- E,
128
+ M,
121
129
  D,
122
130
  O,
123
- k
131
+ k,
132
+ A
124
133
  ]);
125
- return /* @__PURE__ */ o(t, {
126
- columns: N,
127
- data: f,
128
- sorting: m,
129
- onSortingChange: h,
130
- pageSize: g,
131
- onPageSizeChange: _,
132
- pageSizeOptions: v,
133
- hasNextPage: y,
134
- hasPrevPage: b,
135
- onNextPage: x,
136
- onPrevPage: S,
137
- pageInfo: C,
138
- filterComponent: w,
139
- isLoading: p,
134
+ return /* @__PURE__ */ s(n, {
135
+ columns: P,
136
+ data: p,
137
+ sorting: h,
138
+ onSortingChange: g,
139
+ pageSize: _,
140
+ onPageSizeChange: v,
141
+ pageSizeOptions: y,
142
+ hasNextPage: b,
143
+ hasPrevPage: x,
144
+ onNextPage: S,
145
+ onPrevPage: C,
146
+ pageInfo: w,
147
+ filterComponent: T,
148
+ isLoading: m,
149
+ labels: { loading: M.loading },
150
+ renderCard: (e) => /* @__PURE__ */ c("div", {
151
+ className: "ttw:flex ttw:flex-col ttw:gap-2",
152
+ children: [
153
+ /* @__PURE__ */ c("div", {
154
+ className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-4",
155
+ children: [/* @__PURE__ */ s("span", {
156
+ className: "ttw:truncate",
157
+ title: e.merchantLabel,
158
+ children: e.merchantLabel
159
+ }), /* @__PURE__ */ s("span", {
160
+ className: "ttw:tabular-nums",
161
+ children: e.amountLabel
162
+ })]
163
+ }),
164
+ /* @__PURE__ */ c("div", {
165
+ className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-4",
166
+ children: [/* @__PURE__ */ s("span", { children: e.dateLabel }), /* @__PURE__ */ s(i, {
167
+ label: e.statusLabel,
168
+ tone: e.statusTone
169
+ })]
170
+ }),
171
+ e.hasReceipt ? /* @__PURE__ */ s("span", { children: M.receiptPresentAriaLabel }) : k ? /* @__PURE__ */ s(t, {
172
+ type: "button",
173
+ variant: "ghost",
174
+ size: "sm",
175
+ disabled: e.id === A,
176
+ onClick: (t) => {
177
+ t.stopPropagation(), k(e.id);
178
+ },
179
+ children: e.id === A ? M.addingReceiptAriaLabel : M.addReceiptAriaLabel
180
+ }) : null
181
+ ]
182
+ }),
140
183
  getRowId: (e) => e.id,
141
- ...M,
142
- children: T
184
+ ...N,
185
+ children: E
143
186
  });
144
187
  }
145
- export { d as ExpensesTransactionsTable, d as default };
188
+ export { f as ExpensesTransactionsTable, f as default };
@@ -1,5 +1,6 @@
1
1
  // ../../libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesTransactionsTable/labels.js
2
2
  var e = {
3
+ loading: "Loading expenses",
3
4
  dateColumn: "Date",
4
5
  statusColumn: "Status",
5
6
  merchantColumn: "Merchant",