@tesouro/embedded-components-react 0.5.283 → 0.5.285

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 (20) hide show
  1. package/README.md +27 -28
  2. package/dist/index.d.ts +6 -19
  3. package/dist/lib/ReceivablesWidget.d.ts +6 -19
  4. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +268 -285
  5. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +35 -60
  6. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +4 -6
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +124 -147
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActionsModal.js +6 -2
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableIssuePreflight.js +10 -9
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableRecurrence.js +1 -1
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +54 -48
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +3 -4
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +2 -12
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +54 -87
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +185 -51
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index58.js +38 -187
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +33 -33
  18. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  19. package/package.json +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index59.js +0 -45
@@ -1,60 +1,194 @@
1
- import { Skeleton as e, cn as t } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { RECEIVABLE_STATUS_CARDS_LABELS_EN as n } from "./index14.js";
3
- import { ReceivableStatusBadge as r } from "./index25.js";
4
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
1
+ import { Button as e, DataTable as t, Skeleton as n, Tooltip as r, TooltipContent as i, TooltipProvider as a, TooltipTrigger as o } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { EmptyState as s } from "../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
3
+ import { ErrorState as c } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
4
+ import "../../../shared/ui/dist/index.js";
5
+ import { RECEIVABLES_SCREEN_LABELS_EN as l } from "./index14.js";
6
+ import { ReceivableStatusBadge as u } from "./index25.js";
7
+ import { ReceivableStatusCards as d } from "./index56.js";
8
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
9
+ import { ArrowDownIcon as m, ArrowUpDownIcon as h, ArrowUpIcon as g, CogIcon as _, LockKeyholeIcon as v } from "lucide-react";
5
10
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js
6
- var o = 6;
7
- function s({ selected: e, onClick: n, children: r }) {
8
- return /* @__PURE__ */ i("button", {
9
- type: "button",
10
- "aria-pressed": e,
11
- onClick: n,
12
- className: t("ttw:flex ttw:w-42 ttw:shrink-0 ttw:cursor-pointer ttw:flex-col ttw:gap-2 ttw:rounded-xl ttw:border ttw:bg-card ttw:px-4 ttw:py-2 ttw:text-left ttw:transition-colors", e ? "ttw:border-primary" : "ttw:border-card ttw:hover:border-primary"),
13
- children: r
11
+ var y = [
12
+ 10,
13
+ 25,
14
+ 50,
15
+ 100
16
+ ];
17
+ function b({ label: t, ariaLabel: n, column: r }) {
18
+ let i = r.getIsSorted();
19
+ return /* @__PURE__ */ p("div", {
20
+ className: "ttw:flex ttw:items-center ttw:gap-2 ttw:text-inherit",
21
+ children: [t, /* @__PURE__ */ f(e, {
22
+ variant: "ghost",
23
+ size: "icon-sm",
24
+ "aria-label": n,
25
+ onClick: () => r.toggleSorting(i === "asc"),
26
+ children: f(i === "asc" ? g : i === "desc" ? m : h, { className: "ttw:size-4" })
27
+ })]
14
28
  });
15
29
  }
16
- function c({ view: t, onSelect: c, labels: l }) {
17
- let u = {
18
- ...n,
19
- ...l
20
- };
21
- return t.kind === "loading" ? /* @__PURE__ */ i("div", {
22
- className: "ttw:flex ttw:gap-2",
23
- children: Array.from({ length: o }).map((t, n) => /* @__PURE__ */ i(e, { className: "ttw:h-16.5 ttw:w-42 ttw:rounded-xl" }, n))
24
- }) : /* @__PURE__ */ a("div", {
25
- className: "ttw:mb-6 ttw:flex ttw:gap-2 ttw:overflow-x-auto ttw:[scrollbar-width:none] ttw:[&::-webkit-scrollbar]:hidden",
26
- children: [/* @__PURE__ */ a(s, {
27
- selected: t.all.selected,
28
- onClick: () => c(t.all.value),
29
- children: [/* @__PURE__ */ i("span", {
30
- className: "ttw:text-xs ttw:font-medium ttw:text-foreground",
31
- children: u.all
32
- }), /* @__PURE__ */ i("span", {
33
- className: "ttw:text-2xl ttw:font-medium ttw:leading-8 ttw:tabular-nums ttw:text-foreground",
34
- children: t.all.countLabel
35
- })]
36
- }), t.statuses.map((e) => /* @__PURE__ */ i(s, {
37
- selected: e.selected,
38
- onClick: () => c(e.value),
39
- children: /* @__PURE__ */ a("div", {
40
- className: "ttw:flex ttw:flex-col",
41
- children: [/* @__PURE__ */ a("div", {
42
- className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-2",
43
- children: [/* @__PURE__ */ i(r, {
44
- label: e.statusLabel,
45
- status: e.value,
46
- variant: "filled"
47
- }), /* @__PURE__ */ i("span", {
48
- className: "ttw:text-xs ttw:font-medium ttw:leading-4.5 ttw:tabular-nums ttw:text-foreground",
49
- children: e.countLabel
30
+ function x({ row: e }) {
31
+ return e.customerState === "resolving" ? /* @__PURE__ */ f(n, { className: "ttw:h-4 ttw:w-full" }) : e.customerState === "missing" ? /* @__PURE__ */ f("span", {
32
+ className: "ttw:opacity-40",
33
+ children: e.customerLabel
34
+ }) : /* @__PURE__ */ f("span", { children: e.customerLabel });
35
+ }
36
+ function S({ rows: n, isLoading: m, isError: h, isAccessRestricted: g, sorting: S, onSortingChange: C, pageSize: w, onPageSizeChange: T, pageSizeOptions: E = y, pageInfo: D, hasNextPage: O, hasPrevPage: k, onNextPage: A, onPrevPage: j, statusCards: M, onStatusCardSelect: N, filterBar: P, isFiltering: F, headerStart: I, bankAttribution: L, onCreateClick: R, onSettingsClick: z, onRowClick: B, onRetry: V, labels: H }) {
37
+ let U = {
38
+ ...l,
39
+ ...H,
40
+ statusBadge: {
41
+ ...l.statusBadge,
42
+ ...H?.statusBadge
43
+ }
44
+ }, W = [
45
+ {
46
+ accessorKey: "dueDateLabel",
47
+ enableSorting: !0,
48
+ header: ({ column: e }) => /* @__PURE__ */ f(b, {
49
+ column: e,
50
+ label: U.columnDueDate,
51
+ ariaLabel: U.sortByDueDate
52
+ })
53
+ },
54
+ {
55
+ accessorKey: "status",
56
+ enableSorting: !0,
57
+ header: ({ column: e }) => /* @__PURE__ */ f(b, {
58
+ column: e,
59
+ label: U.columnStatus,
60
+ ariaLabel: U.sortByStatus
61
+ }),
62
+ cell: ({ row: e }) => /* @__PURE__ */ f(u, {
63
+ status: e.original.status,
64
+ variant: "filled",
65
+ labels: U.statusBadge
66
+ })
67
+ },
68
+ {
69
+ accessorKey: "documentLabel",
70
+ enableSorting: !0,
71
+ header: ({ column: e }) => /* @__PURE__ */ f(b, {
72
+ column: e,
73
+ label: U.columnNumber,
74
+ ariaLabel: U.sortByNumber
75
+ })
76
+ },
77
+ {
78
+ accessorKey: "customerLabel",
79
+ header: U.columnCustomer,
80
+ cell: ({ row: e }) => /* @__PURE__ */ f(x, { row: e.original }),
81
+ minSize: 180
82
+ },
83
+ {
84
+ accessorKey: "issueDateLabel",
85
+ enableSorting: !0,
86
+ header: ({ column: e }) => /* @__PURE__ */ f(b, {
87
+ column: e,
88
+ label: U.columnIssueDate,
89
+ ariaLabel: U.sortByIssueDate
90
+ })
91
+ },
92
+ {
93
+ accessorKey: "totalLabel",
94
+ enableSorting: !0,
95
+ header: ({ column: e }) => /* @__PURE__ */ f("div", {
96
+ className: "ttw:flex ttw:justify-end",
97
+ children: /* @__PURE__ */ f(b, {
98
+ column: e,
99
+ label: U.columnAmount,
100
+ ariaLabel: U.sortByAmount
101
+ })
102
+ }),
103
+ cell: ({ row: e }) => /* @__PURE__ */ f("div", {
104
+ className: "ttw:text-right",
105
+ children: e.original.totalLabel
106
+ })
107
+ }
108
+ ];
109
+ return /* @__PURE__ */ p("div", {
110
+ className: "ttw:flex ttw:flex-col ttw:gap-4",
111
+ children: [
112
+ /* @__PURE__ */ p("div", {
113
+ className: "ttw:flex ttw:justify-between ttw:gap-4",
114
+ children: [/* @__PURE__ */ p("div", {
115
+ className: "ttw:flex ttw:flex-col ttw:gap-2",
116
+ children: [I, L && /* @__PURE__ */ p("div", {
117
+ className: "ttw:flex ttw:items-center ttw:gap-2",
118
+ children: [/* @__PURE__ */ f("span", {
119
+ className: "ttw:text-muted-foreground",
120
+ children: U.bankAttributionPrefix
121
+ }), /* @__PURE__ */ f("img", {
122
+ width: 120,
123
+ src: L.logoSrc,
124
+ alt: L.logoAlt
125
+ })]
126
+ })]
127
+ }), /* @__PURE__ */ p("div", {
128
+ className: "ttw:flex ttw:items-center ttw:gap-2",
129
+ children: [z && /* @__PURE__ */ f(a, { children: /* @__PURE__ */ p(r, { children: [/* @__PURE__ */ f(o, {
130
+ asChild: !0,
131
+ children: /* @__PURE__ */ f(e, {
132
+ type: "button",
133
+ variant: "outline",
134
+ size: "lg",
135
+ "aria-label": U.settingsButton,
136
+ onClick: z,
137
+ children: /* @__PURE__ */ f(_, {
138
+ className: "ttw:size-4.5",
139
+ "aria-hidden": !0
140
+ })
141
+ })
142
+ }), /* @__PURE__ */ f(i, {
143
+ sideOffset: 4,
144
+ children: U.settingsButton
145
+ })] }) }), R && /* @__PURE__ */ f(e, {
146
+ size: "lg",
147
+ onClick: R,
148
+ children: U.createInvoiceButton
50
149
  })]
51
- }), /* @__PURE__ */ i("span", {
52
- className: "ttw:overflow-hidden ttw:text-ellipsis ttw:whitespace-nowrap ttw:text-2xl ttw:font-medium ttw:leading-8 ttw:tabular-nums ttw:text-foreground",
53
- children: e.amountLabel
54
150
  })]
151
+ }),
152
+ !g && M && N && /* @__PURE__ */ f(d, {
153
+ view: M,
154
+ onSelect: N,
155
+ labels: { all: U.statusCardsAll }
156
+ }),
157
+ g ? /* @__PURE__ */ f(c, {
158
+ icon: /* @__PURE__ */ f(v, { className: "ttw:size-8 ttw:text-primary" }),
159
+ title: U.accessRestrictedTitle,
160
+ description: U.accessRestrictedDescription
161
+ }) : h ? /* @__PURE__ */ f(c, {
162
+ title: U.errorTitle,
163
+ description: U.errorDescription,
164
+ retryLabel: V ? U.errorRetry : void 0,
165
+ onRetry: V
166
+ }) : /* @__PURE__ */ f(t, {
167
+ columns: W,
168
+ data: n,
169
+ isLoading: m,
170
+ sorting: S,
171
+ onSortingChange: C,
172
+ pageSize: w,
173
+ onPageSizeChange: T,
174
+ pageSizeOptions: E,
175
+ pageInfo: D,
176
+ hasNextPage: O,
177
+ hasPrevPage: k,
178
+ onNextPage: A,
179
+ onPrevPage: j,
180
+ onRowClick: B,
181
+ rowAriaLabel: (e) => U.openRow(e.documentLabel),
182
+ filterComponent: P,
183
+ children: /* @__PURE__ */ f(s, {
184
+ title: F ? U.filterEmptyTitle : U.emptyTitle,
185
+ description: F ? void 0 : U.emptyDescription,
186
+ actionLabel: F ? void 0 : U.createInvoiceButton,
187
+ onAction: F ? void 0 : R
188
+ })
55
189
  })
56
- }, e.value))]
190
+ ]
57
191
  });
58
192
  }
59
193
  //#endregion
60
- export { c as ReceivableStatusCards, c as default };
194
+ export { S as ReceivablesScreen, S as default };
@@ -1,194 +1,45 @@
1
- import { Button as e, DataTable as t, Skeleton as n, Tooltip as r, TooltipContent as i, TooltipProvider as a, TooltipTrigger as o } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { EmptyState as s } from "../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
3
- import { ErrorState as c } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
4
- import "../../../shared/ui/dist/index.js";
5
- import { RECEIVABLES_SCREEN_LABELS_EN as l } from "./index14.js";
6
- import { ReceivableStatusBadge as u } from "./index25.js";
7
- import { ReceivableStatusCards as d } from "./index57.js";
8
- import { jsx as f, jsxs as p } from "react/jsx-runtime";
9
- import { ArrowDownIcon as m, ArrowUpDownIcon as h, ArrowUpIcon as g, CogIcon as _, LockKeyholeIcon as v } from "lucide-react";
1
+ import { AlertDialog as e, AlertDialogContent as t, AlertDialogDescription as n, AlertDialogFooter as r, AlertDialogHeader as i, AlertDialogTitle as a, Button as o } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { UNSAVED_INVOICE_DIALOG_LABELS_EN as s } from "./index14.js";
3
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
4
+ import { XIcon as u } from "lucide-react";
10
5
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index58.js
11
- var y = [
12
- 10,
13
- 25,
14
- 50,
15
- 100
16
- ];
17
- function b({ label: t, ariaLabel: n, column: r }) {
18
- let i = r.getIsSorted();
19
- return /* @__PURE__ */ p("div", {
20
- className: "ttw:flex ttw:items-center ttw:gap-2 ttw:text-inherit",
21
- children: [t, /* @__PURE__ */ f(e, {
22
- variant: "ghost",
23
- size: "icon-sm",
24
- "aria-label": n,
25
- onClick: () => r.toggleSorting(i === "asc"),
26
- children: f(i === "asc" ? g : i === "desc" ? m : h, { className: "ttw:size-4" })
27
- })]
28
- });
29
- }
30
- function x({ row: e }) {
31
- return e.customerState === "resolving" ? /* @__PURE__ */ f(n, { className: "ttw:h-4 ttw:w-full" }) : e.customerState === "missing" ? /* @__PURE__ */ f("span", {
32
- className: "ttw:opacity-40",
33
- children: e.customerLabel
34
- }) : /* @__PURE__ */ f("span", { children: e.customerLabel });
35
- }
36
- function S({ rows: n, isLoading: m, isError: h, isAccessRestricted: g, sorting: S, onSortingChange: C, pageSize: w, onPageSizeChange: T, pageSizeOptions: E = y, pageInfo: D, hasNextPage: O, hasPrevPage: k, onNextPage: A, onPrevPage: j, statusCards: M, onStatusCardSelect: N, filterBar: P, isFiltering: F, headerStart: I, bankAttribution: L, onCreateClick: R, onSettingsClick: z, onRowClick: B, onRetry: V, labels: H }) {
37
- let U = {
38
- ...l,
39
- ...H,
40
- statusBadge: {
41
- ...l.statusBadge,
42
- ...H?.statusBadge
43
- }
44
- }, W = [
45
- {
46
- accessorKey: "dueDateLabel",
47
- enableSorting: !0,
48
- header: ({ column: e }) => /* @__PURE__ */ f(b, {
49
- column: e,
50
- label: U.columnDueDate,
51
- ariaLabel: U.sortByDueDate
52
- })
53
- },
54
- {
55
- accessorKey: "status",
56
- enableSorting: !0,
57
- header: ({ column: e }) => /* @__PURE__ */ f(b, {
58
- column: e,
59
- label: U.columnStatus,
60
- ariaLabel: U.sortByStatus
61
- }),
62
- cell: ({ row: e }) => /* @__PURE__ */ f(u, {
63
- status: e.original.status,
64
- variant: "filled",
65
- labels: U.statusBadge
66
- })
6
+ function d({ open: d, onSaveDraft: f, onDiscard: p, onCancel: m, isSaving: h, isSaveDraftDisabled: g, labels: _ }) {
7
+ let v = {
8
+ ...s,
9
+ ..._
10
+ };
11
+ return /* @__PURE__ */ c(e, {
12
+ open: d,
13
+ onOpenChange: (e) => {
14
+ !e && !h && m();
67
15
  },
68
- {
69
- accessorKey: "documentLabel",
70
- enableSorting: !0,
71
- header: ({ column: e }) => /* @__PURE__ */ f(b, {
72
- column: e,
73
- label: U.columnNumber,
74
- ariaLabel: U.sortByNumber
75
- })
76
- },
77
- {
78
- accessorKey: "customerLabel",
79
- header: U.columnCustomer,
80
- cell: ({ row: e }) => /* @__PURE__ */ f(x, { row: e.original }),
81
- minSize: 180
82
- },
83
- {
84
- accessorKey: "issueDateLabel",
85
- enableSorting: !0,
86
- header: ({ column: e }) => /* @__PURE__ */ f(b, {
87
- column: e,
88
- label: U.columnIssueDate,
89
- ariaLabel: U.sortByIssueDate
90
- })
91
- },
92
- {
93
- accessorKey: "totalLabel",
94
- enableSorting: !0,
95
- header: ({ column: e }) => /* @__PURE__ */ f("div", {
96
- className: "ttw:flex ttw:justify-end",
97
- children: /* @__PURE__ */ f(b, {
98
- column: e,
99
- label: U.columnAmount,
100
- ariaLabel: U.sortByAmount
101
- })
102
- }),
103
- cell: ({ row: e }) => /* @__PURE__ */ f("div", {
104
- className: "ttw:text-right",
105
- children: e.original.totalLabel
106
- })
107
- }
108
- ];
109
- return /* @__PURE__ */ p("div", {
110
- className: "ttw:flex ttw:flex-col ttw:gap-4",
111
- children: [
112
- /* @__PURE__ */ p("div", {
113
- className: "ttw:flex ttw:justify-between ttw:gap-4",
114
- children: [/* @__PURE__ */ p("div", {
115
- className: "ttw:flex ttw:flex-col ttw:gap-2",
116
- children: [I, L && /* @__PURE__ */ p("div", {
117
- className: "ttw:flex ttw:items-center ttw:gap-2",
118
- children: [/* @__PURE__ */ f("span", {
119
- className: "ttw:text-muted-foreground",
120
- children: U.bankAttributionPrefix
121
- }), /* @__PURE__ */ f("img", {
122
- width: 120,
123
- src: L.logoSrc,
124
- alt: L.logoAlt
125
- })]
126
- })]
127
- }), /* @__PURE__ */ p("div", {
128
- className: "ttw:flex ttw:items-center ttw:gap-2",
129
- children: [z && /* @__PURE__ */ f(a, { children: /* @__PURE__ */ p(r, { children: [/* @__PURE__ */ f(o, {
130
- asChild: !0,
131
- children: /* @__PURE__ */ f(e, {
132
- type: "button",
133
- variant: "outline",
134
- size: "lg",
135
- "aria-label": U.settingsButton,
136
- onClick: z,
137
- children: /* @__PURE__ */ f(_, {
138
- className: "ttw:size-4.5",
139
- "aria-hidden": !0
140
- })
141
- })
142
- }), /* @__PURE__ */ f(i, {
143
- sideOffset: 4,
144
- children: U.settingsButton
145
- })] }) }), R && /* @__PURE__ */ f(e, {
146
- size: "lg",
147
- onClick: R,
148
- children: U.createInvoiceButton
149
- })]
16
+ children: /* @__PURE__ */ l(t, { children: [
17
+ /* @__PURE__ */ l("button", {
18
+ type: "button",
19
+ onClick: m,
20
+ disabled: h,
21
+ className: "ttw:absolute ttw:right-4 ttw:top-4 ttw:cursor-pointer ttw:rounded-sm ttw:opacity-70 ttw:ring-offset-background ttw:transition-opacity ttw:hover:opacity-100 ttw:focus:outline-hidden ttw:focus:ring-2 ttw:focus:ring-ring ttw:focus:ring-offset-2 ttw:disabled:pointer-events-none",
22
+ children: [/* @__PURE__ */ c(u, { className: "ttw:size-4" }), /* @__PURE__ */ c("span", {
23
+ className: "ttw:sr-only",
24
+ children: v.unsavedCloseButton
150
25
  })]
151
26
  }),
152
- !g && M && N && /* @__PURE__ */ f(d, {
153
- view: M,
154
- onSelect: N,
155
- labels: { all: U.statusCardsAll }
156
- }),
157
- g ? /* @__PURE__ */ f(c, {
158
- icon: /* @__PURE__ */ f(v, { className: "ttw:size-8 ttw:text-primary" }),
159
- title: U.accessRestrictedTitle,
160
- description: U.accessRestrictedDescription
161
- }) : h ? /* @__PURE__ */ f(c, {
162
- title: U.errorTitle,
163
- description: U.errorDescription,
164
- retryLabel: V ? U.errorRetry : void 0,
165
- onRetry: V
166
- }) : /* @__PURE__ */ f(t, {
167
- columns: W,
168
- data: n,
169
- isLoading: m,
170
- sorting: S,
171
- onSortingChange: C,
172
- pageSize: w,
173
- onPageSizeChange: T,
174
- pageSizeOptions: E,
175
- pageInfo: D,
176
- hasNextPage: O,
177
- hasPrevPage: k,
178
- onNextPage: A,
179
- onPrevPage: j,
180
- onRowClick: B,
181
- rowAriaLabel: (e) => U.openRow(e.documentLabel),
182
- filterComponent: P,
183
- children: /* @__PURE__ */ f(s, {
184
- title: F ? U.filterEmptyTitle : U.emptyTitle,
185
- description: F ? void 0 : U.emptyDescription,
186
- actionLabel: F ? void 0 : U.createInvoiceButton,
187
- onAction: F ? void 0 : R
188
- })
189
- })
190
- ]
27
+ /* @__PURE__ */ l(i, { children: [/* @__PURE__ */ c(a, { children: v.unsavedTitle }), /* @__PURE__ */ c(n, { children: v.unsavedDescription })] }),
28
+ /* @__PURE__ */ l(r, { children: [/* @__PURE__ */ c(o, {
29
+ type: "button",
30
+ variant: "outline",
31
+ onClick: p,
32
+ disabled: h,
33
+ children: v.unsavedDiscardButton
34
+ }), /* @__PURE__ */ c(o, {
35
+ type: "button",
36
+ loading: h,
37
+ disabled: h || g,
38
+ onClick: f,
39
+ children: v.unsavedSaveDraftButton
40
+ })] })
41
+ ] })
191
42
  });
192
43
  }
193
44
  //#endregion
194
- export { S as ReceivablesScreen, S as default };
45
+ export { d as UnsavedInvoiceDialog, d as default };
@@ -1,9 +1,9 @@
1
1
  import { Button as e, DialogDescription as t, DialogFooter as n, DialogHeader as r, DialogTitle as i, Input as a, Label as o, Textarea as s, Typography as c } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
2
  import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
3
- import { Check as f } from "lucide-react";
3
+ import { Check as f, Send as p } from "lucide-react";
4
4
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js
5
- function p({ idPrefix: p, view: m, onSubjectChange: h, onMessageChange: g, onSkip: _, onSend: v, labels: y }) {
6
- let b = `${p}-subject`, x = `${p}-message`;
5
+ function m({ idPrefix: m, view: h, onSubjectChange: g, onMessageChange: _, onSkip: v, onSend: y, labels: b }) {
6
+ let x = `${m}-subject`, S = `${m}-message`;
7
7
  return /* @__PURE__ */ d(l, { children: [
8
8
  /* @__PURE__ */ u(r, {
9
9
  className: "ttw:border-b ttw:border-border ttw:p-6",
@@ -11,12 +11,12 @@ function p({ idPrefix: p, view: m, onSubjectChange: h, onMessageChange: g, onSki
11
11
  className: "ttw:flex ttw:items-center ttw:gap-4",
12
12
  children: [/* @__PURE__ */ u("span", {
13
13
  className: "ttw:flex ttw:size-10 ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-full ttw:border ttw:border-emerald-200 ttw:bg-emerald-50",
14
- children: /* @__PURE__ */ u(f, { className: "ttw:size-6 ttw:text-green-700" })
14
+ children: h.icon === "send" ? /* @__PURE__ */ u(p, { className: "ttw:size-6 ttw:text-green-700" }) : /* @__PURE__ */ u(f, { className: "ttw:size-6 ttw:text-green-700" })
15
15
  }), /* @__PURE__ */ d("div", {
16
16
  className: "ttw:flex ttw:flex-col ttw:gap-1",
17
- children: [/* @__PURE__ */ u(i, { children: m.title }), /* @__PURE__ */ u(t, {
17
+ children: [/* @__PURE__ */ u(i, { children: h.title }), /* @__PURE__ */ u(t, {
18
18
  className: "ttw:text-xs",
19
- children: y.issueDescription
19
+ children: b.issueDescription
20
20
  })]
21
21
  })]
22
22
  })
@@ -30,57 +30,57 @@ function p({ idPrefix: p, view: m, onSubjectChange: h, onMessageChange: g, onSki
30
30
  variant: "body2",
31
31
  color: "muted",
32
32
  className: "ttw:w-16 ttw:shrink-0",
33
- children: y.toLabel
33
+ children: b.toLabel
34
34
  }), /* @__PURE__ */ u(c, {
35
35
  variant: "body2",
36
- children: m.recipient
36
+ children: h.recipient
37
37
  })]
38
38
  }),
39
39
  /* @__PURE__ */ d("div", {
40
40
  className: "ttw:flex ttw:items-center ttw:gap-4",
41
41
  children: [/* @__PURE__ */ u(o, {
42
- htmlFor: b,
42
+ htmlFor: x,
43
43
  className: "ttw:w-16 ttw:shrink-0 ttw:font-normal ttw:text-muted-foreground",
44
- children: y.subjectLabel
44
+ children: b.subjectLabel
45
45
  }), /* @__PURE__ */ u(a, {
46
- id: b,
46
+ id: x,
47
47
  className: "ttw:flex-1",
48
- value: m.subject,
49
- onChange: (e) => h(e.target.value),
50
- disabled: m.inProgress
48
+ value: h.subject,
49
+ onChange: (e) => g(e.target.value),
50
+ disabled: h.inProgress
51
51
  })]
52
52
  }),
53
53
  /* @__PURE__ */ d("div", {
54
54
  className: "ttw:flex ttw:items-start ttw:gap-4",
55
55
  children: [/* @__PURE__ */ u(o, {
56
- htmlFor: x,
56
+ htmlFor: S,
57
57
  className: "ttw:w-16 ttw:shrink-0 ttw:pt-2 ttw:font-normal ttw:text-muted-foreground",
58
- children: y.messageLabel
58
+ children: b.messageLabel
59
59
  }), /* @__PURE__ */ u(s, {
60
- id: x,
60
+ id: S,
61
61
  className: "ttw:flex-1",
62
- value: m.message,
63
- onChange: (e) => g(e.target.value),
64
- placeholder: y.messagePlaceholder,
65
- disabled: m.inProgress
62
+ value: h.message,
63
+ onChange: (e) => _(e.target.value),
64
+ placeholder: b.messagePlaceholder,
65
+ disabled: h.inProgress
66
66
  })]
67
67
  }),
68
- m.attachments.length > 0 && /* @__PURE__ */ d("div", {
68
+ h.attachments.length > 0 && /* @__PURE__ */ d("div", {
69
69
  className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:pl-20",
70
70
  children: [/* @__PURE__ */ d("div", {
71
71
  className: "ttw:flex ttw:flex-col",
72
72
  children: [/* @__PURE__ */ u(c, {
73
73
  variant: "body2",
74
74
  color: "muted",
75
- children: y.attachmentsLabel
75
+ children: b.attachmentsLabel
76
76
  }), /* @__PURE__ */ u(c, {
77
77
  variant: "caption",
78
78
  color: "muted",
79
- children: y.attachmentsCaption
79
+ children: b.attachmentsCaption
80
80
  })]
81
81
  }), /* @__PURE__ */ u("ul", {
82
82
  className: "ttw:flex ttw:flex-col ttw:gap-2.5",
83
- children: m.attachments.map((e) => /* @__PURE__ */ d("li", {
83
+ children: h.attachments.map((e) => /* @__PURE__ */ d("li", {
84
84
  className: "ttw:rounded-lg ttw:bg-muted ttw:px-2 ttw:py-1 ttw:text-sm ttw:font-medium",
85
85
  children: [
86
86
  e.name,
@@ -105,19 +105,19 @@ function p({ idPrefix: p, view: m, onSubjectChange: h, onMessageChange: g, onSki
105
105
  type: "button",
106
106
  variant: "outline",
107
107
  className: "ttw:flex-1 ttw:border-border",
108
- disabled: m.inProgress,
109
- onClick: _,
110
- children: y.skipButton
108
+ disabled: h.inProgress,
109
+ onClick: v,
110
+ children: h.dismissLabel
111
111
  }), /* @__PURE__ */ u(e, {
112
112
  type: "button",
113
113
  className: "ttw:flex-1",
114
- disabled: m.sendDisabled,
115
- loading: m.inProgress,
116
- onClick: v,
117
- children: y.sendButton
114
+ disabled: h.sendDisabled,
115
+ loading: h.inProgress,
116
+ onClick: y,
117
+ children: b.sendButton
118
118
  })]
119
119
  })
120
120
  ] });
121
121
  }
122
122
  //#endregion
123
- export { p as ReceivableActionsModalIssueStep };
123
+ export { m as ReceivableActionsModalIssueStep };
@@ -1,5 +1,5 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
2
- var e = "@tesouro/embedded-components-react", t = "0.5.283", n = "9e75a9f4e3a114037b008e73ec793cd3bfc769ff", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.5.285", n = "6c57ba7c49f7b2708027f35c7b9568b9c81a80b7", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.5.283",
3
+ "version": "0.5.285",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "packageDepSync": {