@tesouro/embedded-components-react 0.8.1 → 0.8.5

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 (98) hide show
  1. package/dist/index.css +21 -120
  2. package/dist/index.d.ts +1 -3
  3. package/dist/lib/ProductsWidget.d.ts +1 -3
  4. package/dist/lib/ReceivablesWidget.d.ts +1 -3
  5. package/dist/lib/monite-sdk.d.ts +6 -59
  6. package/dist/lib/monite-sdk.js +9 -13
  7. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index.js +10 -14
  8. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index112.js +2 -12
  9. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index113.js +19 -26
  10. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index151.js +4 -78
  11. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index17.js +4 -23
  12. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index187.js +24 -1
  13. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index188.js +73 -35
  14. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index189.js +19 -1
  15. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index190.js +19 -16
  16. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index191.js +5 -17
  17. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index192.js +8 -4
  18. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index193.js +11 -16
  19. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index194.js +129 -20
  20. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index195.js +5 -21
  21. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index196.js +2 -2
  22. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index197.js +5 -8
  23. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index198.js +218 -13
  24. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index199.js +31 -17
  25. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index200.js +14 -9
  26. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index201.js +33 -24
  27. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index202.js +19 -12
  28. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index203.js +73 -8
  29. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index204.js +180 -23
  30. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index205.js +13 -13
  31. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index206.js +203 -80
  32. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index207.js +100 -14
  33. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index208.js +61 -97
  34. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index209.js +53 -42
  35. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index210.js +89 -25
  36. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index211.js +43 -1
  37. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index212.js +75 -102
  38. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index213.js +82 -34
  39. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index214.js +12 -171
  40. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index215.js +24 -12
  41. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index216.js +17 -4
  42. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index217.js +4 -69
  43. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index218.js +20 -23
  44. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index219.js +1 -212
  45. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index220.js +17 -92
  46. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index221.js +30 -20
  47. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index222.js +4 -1
  48. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index223.js +21 -17
  49. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index224.js +15 -157
  50. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index225.js +28 -99
  51. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index226.js +28 -43
  52. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index227.js +2 -4
  53. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  54. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index2.js +1 -2
  55. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/ui/dist/index6.js +1 -1
  56. package/dist/packages/shared-ui-shadcn/dist/index.js +19 -21
  57. package/package.json +1 -3
  58. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index228.js +0 -24
  59. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index229.js +0 -77
  60. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index230.js +0 -19
  61. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index231.js +0 -22
  62. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index232.js +0 -8
  63. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index233.js +0 -12
  64. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index234.js +0 -13
  65. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index235.js +0 -133
  66. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index236.js +0 -8
  67. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index237.js +0 -8
  68. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index238.js +0 -5
  69. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index239.js +0 -222
  70. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index240.js +0 -34
  71. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index241.js +0 -14
  72. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index242.js +0 -36
  73. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index243.js +0 -22
  74. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index244.js +0 -76
  75. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index245.js +0 -184
  76. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index246.js +0 -16
  77. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index247.js +0 -206
  78. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index248.js +0 -102
  79. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index249.js +0 -66
  80. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index250.js +0 -57
  81. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index251.js +0 -94
  82. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index252.js +0 -43
  83. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index253.js +0 -79
  84. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index254.js +0 -87
  85. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index255.js +0 -14
  86. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index256.js +0 -26
  87. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index257.js +0 -17
  88. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index258.js +0 -5
  89. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index259.js +0 -24
  90. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index260.js +0 -1
  91. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index261.js +0 -22
  92. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index262.js +0 -32
  93. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index263.js +0 -4
  94. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index264.js +0 -23
  95. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index265.js +0 -18
  96. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index266.js +0 -33
  97. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index267.js +0 -31
  98. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index268.js +0 -2
@@ -1,76 +0,0 @@
1
- import { cn as e } from "./index49.js";
2
- import { Badge as t } from "./index56.js";
3
- import { getCommonStatusLabel as n } from "./index243.js";
4
- import { jsxs as r } from "@emotion/react/jsx-runtime";
5
- import { useLingui as i } from "@lingui/react";
6
- import { cva as a } from "class-variance-authority";
7
- //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index244.js
8
- var o = a("", { variants: {
9
- variant: {
10
- draft: "ttw:bg-zinc-100 ttw:text-zinc-700",
11
- issuing: "ttw:bg-cyan-100 ttw:text-cyan-700",
12
- issued: "ttw:bg-cyan-100 ttw:text-cyan-700",
13
- failed: "ttw:bg-red-100 ttw:text-red-700",
14
- accepted: "ttw:bg-green-100 ttw:text-green-700",
15
- partially_paid: "ttw:bg-purple-100 ttw:text-purple-700",
16
- paid: "ttw:bg-green-100 ttw:text-green-700",
17
- expired: "ttw:bg-red-100 ttw:text-red-700",
18
- uncollectible: "ttw:bg-red-100 ttw:text-red-700",
19
- canceled: "ttw:bg-red-100 ttw:text-red-700",
20
- recurring: "ttw:bg-zinc-100 ttw:text-zinc-700",
21
- declined: "ttw:bg-red-100 ttw:text-red-700",
22
- overdue: "ttw:bg-orange-100 ttw:text-orange-700",
23
- deleted: "ttw:bg-red-100 ttw:text-red-700"
24
- },
25
- dotVariant: {
26
- draft: "ttw:border-zinc-100 ttw:bg-zinc-700",
27
- issuing: "ttw:border-cyan-100 ttw:bg-cyan-700",
28
- issued: "ttw:border-cyan-100 ttw:bg-cyan-700",
29
- failed: "ttw:border-red-100 ttw:bg-red-700",
30
- accepted: "ttw:border-green-100 ttw:bg-green-700",
31
- partially_paid: "ttw:border-purple-100 ttw:bg-purple-700",
32
- paid: "ttw:border-green-100 ttw:bg-green-700",
33
- expired: "ttw:border-red-100 ttw:bg-red-700",
34
- uncollectible: "ttw:border-red-100 ttw:bg-red-700",
35
- canceled: "ttw:border-red-100 ttw:bg-red-700",
36
- recurring: "ttw:border-zinc-100 ttw:bg-zinc-700",
37
- declined: "ttw:border-red-100 ttw:bg-red-700",
38
- overdue: "ttw:border-orange-100 ttw:bg-orange-700",
39
- deleted: "ttw:border-red-100 ttw:bg-red-700"
40
- },
41
- outlineVariant: {
42
- draft: "ttw:border-zinc-200 ttw:bg-zinc-50 ttw:text-zinc-700 ttw:hover:bg-zinc-50",
43
- issuing: "ttw:border-blue-200 ttw:bg-blue-50 ttw:text-blue-700 ttw:hover:bg-blue-50",
44
- issued: "ttw:border-blue-200 ttw:bg-blue-50 ttw:text-blue-700 ttw:hover:bg-blue-50",
45
- failed: "ttw:border-red-200 ttw:bg-red-50 ttw:text-red-700 ttw:hover:bg-red-50",
46
- accepted: "ttw:border-emerald-200 ttw:bg-emerald-50 ttw:text-emerald-700 ttw:hover:bg-emerald-50",
47
- partially_paid: "ttw:border-blue-200 ttw:bg-blue-50 ttw:text-blue-700 ttw:hover:bg-blue-50",
48
- paid: "ttw:border-emerald-200 ttw:bg-emerald-50 ttw:text-emerald-700 ttw:hover:bg-emerald-50",
49
- expired: "ttw:border-red-200 ttw:bg-red-50 ttw:text-red-700 ttw:hover:bg-red-50",
50
- uncollectible: "ttw:border-zinc-200 ttw:bg-zinc-50 ttw:text-zinc-700 ttw:hover:bg-zinc-50",
51
- canceled: "ttw:border-zinc-200 ttw:bg-zinc-50 ttw:text-zinc-700 ttw:hover:bg-zinc-50",
52
- recurring: "ttw:border-zinc-200 ttw:bg-zinc-50 ttw:text-zinc-700 ttw:hover:bg-zinc-50",
53
- declined: "ttw:border-red-200 ttw:bg-red-50 ttw:text-red-700 ttw:hover:bg-red-50",
54
- overdue: "ttw:border-red-200 ttw:bg-red-50 ttw:text-red-700 ttw:hover:bg-red-50",
55
- deleted: "ttw:border-zinc-200 ttw:bg-zinc-50 ttw:text-zinc-700 ttw:hover:bg-zinc-50"
56
- }
57
- } }), s = ({ status: a, variant: s = "filled", label: c, icon: l, className: u, showBadgeBackground: d = !0, dotSize: f, ref: p }) => {
58
- let { i18n: m } = i();
59
- return s === "outline" ? /* @__PURE__ */ r(t, {
60
- ref: p,
61
- variant: "outline",
62
- className: e(o({ outlineVariant: a }), u),
63
- children: [l, c ?? n(m, a)]
64
- }) : /* @__PURE__ */ r(t, {
65
- ref: p,
66
- className: e("ttw:inline-flex ttw:items-center ttw:gap-1", o({ variant: a }), !d && "ttw:text-zinc-950!", u),
67
- dotClassName: o({ dotVariant: a }),
68
- showBadgeBackground: d,
69
- showDotBorder: !d,
70
- dotSize: f,
71
- showDot: !1,
72
- children: [l, c ?? n(m, a)]
73
- });
74
- };
75
- //#endregion
76
- export { s as InvoiceStatusChip };
@@ -1,184 +0,0 @@
1
- import { useMoniteContext as e } from "./index36.js";
2
- import { useCurrencies as t } from "./index62.js";
3
- import "./index73.js";
4
- import { useKanmonContext as n } from "./index234.js";
5
- import { FinancedInvoiceStatusChip as r } from "./index242.js";
6
- import { InvoiceStatusChip as i } from "./index244.js";
7
- import { Fragment as a, jsx as o, jsxs as s } from "@emotion/react/jsx-runtime";
8
- import { Box as c, Button as l, Divider as u, Typography as d, darken as f, useTheme as p } from "@mui/material";
9
- import { useLingui as m } from "@lingui/react";
10
- //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index245.js
11
- var h = ({ invoice: h, offers: g, financedInvoice: _, enableNavigate: v = !1, handleNavigate: y }) => {
12
- let { i18n: b } = m(), { locale: x } = e(), { startFinanceSession: S } = n(), { formatCurrencyToDisplay: C } = t(), w = p(), T = x.dateFormat, E = _ ? b.date(_.issue_date, T) : "—", D = _ ? C(_.total_amount, _.currency) : "-", O = g?.[0]?.pricing_plans?.reduce((e, t, n) => (t?.fee_percentage === _?.fee_percentage && t?.advance_rate_percentage === _?.advance_rate_percentage && (e = {
13
- pricingPlanIndex: n,
14
- data: t
15
- }), e), null), k = _?.repayment_schedule?.repayment_date ? b.date(_.repayment_schedule.repayment_date, T) : "—", A = _?.advance_amount ? C(_.advance_amount, _.currency) : "-", j = _?.fee_amount ? C(_.fee_amount, _.currency) : "-", M = _?.repayment_amount ? C(_.repayment_amount, _.currency) : "-", N = _?.status === "REJECTED" || _?.status === "NEW", P = _?.status === "FUNDED" || _?.status === "LATE";
16
- return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ s(c, {
17
- sx: {
18
- p: 4,
19
- display: "flex",
20
- flexDirection: "column",
21
- gap: 4
22
- },
23
- children: [
24
- /* @__PURE__ */ o(d, {
25
- variant: "h3",
26
- children: b._("Funding details")
27
- }),
28
- /* @__PURE__ */ s(c, { children: [/* @__PURE__ */ o(d, {
29
- variant: "h2",
30
- fontWeight: 600,
31
- fontSize: 32,
32
- children: D
33
- }), /* @__PURE__ */ o(d, {
34
- fontWeight: 500,
35
- variant: "body1",
36
- children: b._("{issueDate}", { issueDate: E })
37
- })] }),
38
- /* @__PURE__ */ s(c, {
39
- sx: {
40
- display: "flex",
41
- gap: 3
42
- },
43
- children: [
44
- /* @__PURE__ */ s(c, {
45
- width: "100%",
46
- children: [/* @__PURE__ */ o(d, {
47
- variant: "body1",
48
- color: f(w.palette.grey[50], .4),
49
- mb: .5,
50
- fontWeight: 400,
51
- children: b._("Financing plan {value}", { value: (O?.pricingPlanIndex ?? 0) + 1 })
52
- }), /* @__PURE__ */ o(d, {
53
- variant: "body1",
54
- fontWeight: 400,
55
- children: b._("{value}% advance rate, Pay in {pricingPlan} days, {value1}% fee", {
56
- value: (O?.data?.advance_rate_percentage ?? 0) / 100,
57
- pricingPlan: O?.data?.repayment_duration_days,
58
- value1: (O?.data?.fee_percentage ?? 0) / 100
59
- })
60
- })]
61
- }),
62
- /* @__PURE__ */ s(c, {
63
- width: "100%",
64
- children: [/* @__PURE__ */ o(d, {
65
- variant: "body1",
66
- color: f(w.palette.grey[50], .4),
67
- mb: .5,
68
- fontWeight: 400,
69
- children: b._("Repayment on")
70
- }), /* @__PURE__ */ o(d, {
71
- variant: "body1",
72
- fontWeight: 400,
73
- children: b._("{repaymentDate}", { repaymentDate: k })
74
- })]
75
- }),
76
- /* @__PURE__ */ s(c, {
77
- width: "100%",
78
- children: [/* @__PURE__ */ o(d, {
79
- variant: "body1",
80
- color: f(w.palette.grey[50], .4),
81
- mb: .5,
82
- fontWeight: 400,
83
- children: b._("Status")
84
- }), /* @__PURE__ */ o(r, {
85
- icon: !0,
86
- status: _?.status ?? "DEFAULTED"
87
- })]
88
- })
89
- ]
90
- }),
91
- /* @__PURE__ */ o(u, {}),
92
- /* @__PURE__ */ s(c, {
93
- sx: {
94
- display: "grid",
95
- gridTemplateColumns: "minmax(140px, auto) 1fr",
96
- flexDirection: "column",
97
- rowGap: 1,
98
- columnGap: 2
99
- },
100
- children: [
101
- /* @__PURE__ */ o(d, {
102
- variant: "body1",
103
- color: f(w.palette.grey[50], .4),
104
- children: b._("{isRequestedSum}", { isRequestedSum: N ? "Requested sum" : "Received sum" })
105
- }),
106
- /* @__PURE__ */ o(d, {
107
- variant: "body1",
108
- children: A
109
- }),
110
- /* @__PURE__ */ o(d, {
111
- variant: "body1",
112
- color: f(w.palette.grey[50], .4),
113
- children: b._("Service Fee")
114
- }),
115
- /* @__PURE__ */ o(d, {
116
- variant: "body1",
117
- children: j
118
- }),
119
- /* @__PURE__ */ o(d, {
120
- variant: "body1",
121
- color: f(w.palette.grey[50], .4),
122
- children: b._("Repayment sum")
123
- }),
124
- /* @__PURE__ */ o(d, {
125
- variant: "body1",
126
- children: M
127
- })
128
- ]
129
- }),
130
- /* @__PURE__ */ o(u, {}),
131
- /* @__PURE__ */ s(c, {
132
- sx: {
133
- borderRadius: "16px",
134
- px: 3,
135
- py: 2.5,
136
- border: `1px solid ${w.palette.divider}`,
137
- display: "flex",
138
- gap: 2,
139
- justifyContent: "space-between",
140
- alignItems: "center",
141
- cursor: v ? "pointer" : "default"
142
- },
143
- ...v && y && { onClick: () => y(h.id) },
144
- children: [/* @__PURE__ */ s(c, { children: [/* @__PURE__ */ o(d, {
145
- variant: "body1",
146
- fontWeight: 500,
147
- children: b._("Invoice {invoiceDocument_id}", { invoiceDocument_id: h.document_id || b._("Pending") })
148
- }), /* @__PURE__ */ o(d, {
149
- color: w.palette.text.secondary,
150
- variant: "body2",
151
- children: b._("For {invoiceAmount} | Issued {issueDate}", {
152
- invoiceAmount: D,
153
- issueDate: E
154
- })
155
- })] }), /* @__PURE__ */ o(c, { children: /* @__PURE__ */ o(i, { status: h.status }) })]
156
- })
157
- ]
158
- }), P && /* @__PURE__ */ o(c, {
159
- sx: {
160
- mt: "auto",
161
- borderTop: `1px solid ${w.palette.divider}`,
162
- px: 4,
163
- py: 2,
164
- display: "flex",
165
- alignItems: "center",
166
- justifyContent: "flex-end"
167
- },
168
- children: /* @__PURE__ */ o(l, {
169
- variant: "contained",
170
- color: "primary",
171
- onClick: () => S({ component: "PAY_NOW" }),
172
- sx: {
173
- py: 1.25,
174
- px: 1.5,
175
- height: 32,
176
- fontSize: 14,
177
- ml: "auto"
178
- },
179
- children: b._("Repay now")
180
- })
181
- })] });
182
- };
183
- //#endregion
184
- export { h as FinanceDetails };
@@ -1,16 +0,0 @@
1
- //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index246.js
2
- var e = Object.values({
3
- counterpart_name: "counterpart_name",
4
- counterpart_id: "counterpart_id",
5
- amount: "amount",
6
- status: "status",
7
- due_date: "due_date",
8
- issue_date: "issue_date",
9
- document_id: "document_id",
10
- created_at: "created_at",
11
- project_id: "project_id",
12
- total_amount: "total_amount",
13
- discounted_subtotal: "discounted_subtotal"
14
- });
15
- //#endregion
16
- export { e as ReceivableCursorFields };
@@ -1,206 +0,0 @@
1
- import { ScopedCssBaselineContainerClassName as e } from "./index21.js";
2
- import { useMoniteContext as t } from "./index36.js";
3
- import { useGetReceivableById as n } from "./index47.js";
4
- import { useCurrencies as r } from "./index62.js";
5
- import { useAutosizeGridColumns as i } from "./index66.js";
6
- import { Dialog as a } from "./index117.js";
7
- import "./index118.js";
8
- import { MoniteScopedProviders as o } from "./index143.js";
9
- import { GetNoRowsOverlay as s } from "./index149.js";
10
- import { TablePagination as c } from "./index171.js";
11
- import { classNames as l } from "./index173.js";
12
- import { useKanmonContext as u } from "./index234.js";
13
- import { useGetFinancedInvoices as d } from "./index237.js";
14
- import "./index238.js";
15
- import { FinancedInvoiceStatusChip as f } from "./index242.js";
16
- import { FinanceDetails as p } from "./index245.js";
17
- import { ReceivableCursorFields as m } from "./index246.js";
18
- import { useMemo as h, useState as g } from "react";
19
- import { jsx as _, jsxs as v } from "@emotion/react/jsx-runtime";
20
- import { Box as y, Button as b, Typography as x } from "@mui/material";
21
- import { useLingui as S } from "@lingui/react";
22
- import { DataGrid as C } from "@mui/x-data-grid";
23
- //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index247.js
24
- var w = (e) => /* @__PURE__ */ _(o, { children: /* @__PURE__ */ _(T, { ...e }) }), T = ({ onRowClick: o, query: w, offers: T }) => {
25
- let { i18n: E } = S(), { locale: D, componentSettings: O } = t(), { startFinanceSession: k } = u(), [A, j] = g(!1), [M, N] = g(null), { data: P } = n(M?.invoice_id ?? "", !!M?.invoice_id), [F, I] = g(void 0), [L, R] = g(O.receivables.pageSizeOptions?.[0] ?? 10), [z, B] = g({
26
- field: w?.sort ?? "created_at",
27
- sort: w?.order ?? "desc"
28
- }), { formatCurrencyToDisplay: V } = r(), { data: H, isLoading: U, isError: W, refetch: G } = d({
29
- order: z?.sort,
30
- limit: L,
31
- pagination_token: F
32
- }), K = H?.data, q = (e) => {
33
- B(e[0]), I(void 0);
34
- }, J = D.dateFormat, Y = h(() => [
35
- {
36
- field: "document_id",
37
- headerName: E._("Number"),
38
- sortable: !1,
39
- width: 140,
40
- renderCell: ({ value: e }) => e ? /* @__PURE__ */ _("span", {
41
- className: "Monite-TextOverflowContainer",
42
- children: e
43
- }) : /* @__PURE__ */ _("span", {
44
- className: "Monite-TextOverflowContainer",
45
- children: /* @__PURE__ */ _(x, {
46
- color: "text.secondary",
47
- component: "span",
48
- fontSize: "inherit",
49
- children: E._("Pending")
50
- })
51
- })
52
- },
53
- {
54
- field: "payer_type",
55
- headerName: E._("Customer"),
56
- display: "flex",
57
- width: 250,
58
- renderCell: (e) => /* @__PURE__ */ _(x, { children: e.row.payer_type == "BUSINESS" ? e.row.payer_business_name : `${e.row.payer_first_name} ${e.row.payer_last_name}` })
59
- },
60
- {
61
- field: "status",
62
- headerName: E._("Status"),
63
- sortable: m.includes("status"),
64
- width: 160,
65
- renderCell: ({ value: e }) => /* @__PURE__ */ _(f, {
66
- icon: !0,
67
- status: e
68
- })
69
- },
70
- {
71
- field: "total_amount",
72
- headerName: E._("Amount due"),
73
- headerAlign: "right",
74
- align: "right",
75
- width: 120,
76
- valueGetter: (e, t) => {
77
- let n = t.repayment_schedule?.repayment_amount;
78
- return n ? V(n, t.currency) : "-";
79
- }
80
- },
81
- {
82
- field: "repayment_schedule",
83
- headerName: E._("Loan sum"),
84
- headerAlign: "right",
85
- align: "right",
86
- width: 120,
87
- valueGetter: (e, t) => {
88
- let n = t.repayment_schedule?.repayment_principal_amount;
89
- return n ? V(n, t.currency) : "-";
90
- }
91
- },
92
- {
93
- field: "issue_date",
94
- headerName: E._("Financing date"),
95
- sortable: !1,
96
- width: 140,
97
- valueFormatter: (e) => e ? E.date(e, J) : "—"
98
- },
99
- {
100
- field: "repayment_date",
101
- headerName: E._("Repayment date"),
102
- sortable: !1,
103
- width: 120,
104
- valueGetter: (e, t) => {
105
- let n = t.repayment_schedule?.repayment_date;
106
- return n ? E.date(n, J) : "-";
107
- }
108
- },
109
- {
110
- field: "",
111
- headerName: E._("Payment"),
112
- sortable: !1,
113
- width: 120,
114
- renderCell: (e) => e.row.status === "FUNDED" || e.row.status === "LATE" ? /* @__PURE__ */ _(b, {
115
- variant: "contained",
116
- color: "primary",
117
- onClick: (e) => {
118
- e.stopPropagation(), k({ component: "PAY_NOW" });
119
- },
120
- sx: {
121
- py: 1.25,
122
- px: 1.5,
123
- height: 32,
124
- fontSize: 14
125
- },
126
- children: E._("Repay now")
127
- }) : null
128
- }
129
- ], [
130
- V,
131
- E,
132
- J,
133
- k
134
- ]), X = i(K, Y, !1, "FinancedInvoicesTable");
135
- return /* @__PURE__ */ v(y, {
136
- className: l(e, "Monite-FinancedInvoicesTable"),
137
- sx: {
138
- display: "flex",
139
- flexDirection: "column",
140
- overflow: "hidden",
141
- height: "inherit",
142
- minHeight: "500px"
143
- },
144
- children: [
145
- /* @__PURE__ */ _(x, {
146
- mb: 2,
147
- variant: "subtitle1",
148
- children: E._("Financed invoices")
149
- }),
150
- /* @__PURE__ */ _(C, {
151
- apiRef: X,
152
- rowSelection: !1,
153
- disableColumnFilter: !0,
154
- loading: U,
155
- onSortModelChange: q,
156
- onRowClick: (e) => {
157
- j(!0), N?.(e.row);
158
- },
159
- slots: {
160
- pagination: () => /* @__PURE__ */ _(c, {
161
- pageSizeOptions: O.receivables.pageSizeOptions,
162
- nextPage: H?.next_pagination_token,
163
- prevPage: H?.prev_pagination_token,
164
- paginationModel: {
165
- pageSize: L,
166
- page: F
167
- },
168
- onPaginationModelChange: ({ page: e, pageSize: t }) => {
169
- R(t), I(e ?? void 0);
170
- }
171
- }),
172
- noRowsOverlay: () => /* @__PURE__ */ _(s, {
173
- isLoading: U,
174
- dataLength: K?.length || 0,
175
- isFiltering: !1,
176
- isSearching: !1,
177
- isError: W,
178
- refetch: G,
179
- entityName: E._("Financed Invoices"),
180
- actionOptions: [E._("Invoice")],
181
- type: "no-data"
182
- })
183
- },
184
- columns: Y,
185
- getRowId: (e) => e.document_id,
186
- rows: K ?? []
187
- }),
188
- P && M && /* @__PURE__ */ _(a, {
189
- open: A,
190
- onClose: () => {
191
- j(!1), N(null);
192
- },
193
- alignDialog: "right",
194
- children: /* @__PURE__ */ _(p, {
195
- invoice: P,
196
- offers: T ?? [],
197
- financedInvoice: M,
198
- enableNavigate: !0,
199
- handleNavigate: o
200
- })
201
- })
202
- ]
203
- });
204
- };
205
- //#endregion
206
- export { w as FinancedInvoicesTable };
@@ -1,102 +0,0 @@
1
- import { useMoniteContext as e } from "./index36.js";
2
- import { jsx as t, jsxs as n } from "@emotion/react/jsx-runtime";
3
- import { Box as r, List as i, ListItem as a, Typography as o } from "@mui/material";
4
- import { useLingui as s } from "@lingui/react";
5
- //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index248.js
6
- var c = () => {
7
- let { i18n: c } = s(), { componentSettings: l } = e(), u = [
8
- {
9
- id: 1,
10
- title: c._("Create an invoice:"),
11
- description: c._("If you applied for accounts receivable financing, issue an invoice and deliver it to your customer via email or any other channel."),
12
- description2: c._("Or if you applied for accounts payable financing, upload/select the uploaded invoice you've received from your vendor."),
13
- list: {
14
- listTitle: c._("Invoices cannot be financed if:"),
15
- listItems: [
16
- {
17
- id: "listItem-1",
18
- text: c._("- they are due within 7 days.")
19
- },
20
- {
21
- id: "listItem-2",
22
- text: c._("- they are already overdue.")
23
- },
24
- {
25
- id: "listItem-3",
26
- text: c._("- the loan sum exceeds your remaining limit.")
27
- }
28
- ]
29
- }
30
- },
31
- {
32
- id: 2,
33
- title: c._("Select 'Get Paid Now':"),
34
- description: c._("Access funding through the invoice list, within the invoice details, or the 'My Financing' tab. If approved, you will receive the invoice amount instantly, minus the fee associated with the payment offer chosen.")
35
- },
36
- {
37
- id: 3,
38
- title: c._("Pay out the financed sum:"),
39
- description: c._("The full sum will be withdrawn from your bank account automatically on the date specified in the selected offer. You can also pay out the sum earlier via the 'Pay out' button.")
40
- }
41
- ], d = l?.financing?.financeSteps ?? u;
42
- return /* @__PURE__ */ n(r, {
43
- px: 4,
44
- py: 5,
45
- children: [/* @__PURE__ */ t(r, { children: /* @__PURE__ */ t(o, {
46
- variant: "h3",
47
- children: c._("How does invoice financing work?")
48
- }) }), /* @__PURE__ */ t(i, {
49
- sx: {
50
- mt: 4,
51
- display: "flex",
52
- flexDirection: "column",
53
- gap: 3,
54
- p: 0,
55
- pl: 2
56
- },
57
- component: "ul",
58
- children: d.map((e) => /* @__PURE__ */ n(a, {
59
- component: "li",
60
- sx: {
61
- p: 0,
62
- display: "list-item",
63
- listStyleType: "disc",
64
- maxWidth: 472,
65
- mx: "auto"
66
- },
67
- children: [
68
- /* @__PURE__ */ n(o, {
69
- variant: "body1",
70
- fontWeight: 400,
71
- mb: e.list || e.description2 ? 3 : 0,
72
- children: [/* @__PURE__ */ n(o, {
73
- component: "span",
74
- variant: "body1",
75
- fontWeight: 600,
76
- children: [e.title, " "]
77
- }), e.description]
78
- }),
79
- e.description2 && /* @__PURE__ */ t(o, {
80
- variant: "body1",
81
- fontWeight: 400,
82
- mb: e.list ? 3 : 0,
83
- children: e.description2
84
- }),
85
- e.list && /* @__PURE__ */ n(o, {
86
- variant: "body1",
87
- fontWeight: 600,
88
- children: [e.list.listTitle, e.list.listItems.map((e) => /* @__PURE__ */ t(o, {
89
- variant: "body1",
90
- component: "span",
91
- display: "block",
92
- fontWeight: 400,
93
- children: e.text
94
- }, e.id))]
95
- })
96
- ]
97
- }, e.id))
98
- })]
99
- });
100
- };
101
- //#endregion
102
- export { c as FinanceHowItWorks };
@@ -1,66 +0,0 @@
1
- import { FinanceFaqWrapper as e } from "./index230.js";
2
- import { useKanmonContext as t } from "./index234.js";
3
- import { useFinancing as n } from "./index235.js";
4
- import "./index238.js";
5
- import { jsx as r, jsxs as i } from "@emotion/react/jsx-runtime";
6
- import { Box as a, Button as o, Stack as s, Typography as c, lighten as l, useTheme as u } from "@mui/material";
7
- import { useLingui as d } from "@lingui/react";
8
- import f from "@mui/icons-material/Money";
9
- //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index249.js
10
- var p = () => {
11
- let { i18n: p } = d(), { startFinanceSession: m } = t(), h = u(), { isLoading: g, isEnabled: _ } = n();
12
- return _ ? /* @__PURE__ */ i(s, {
13
- gap: 4,
14
- sx: { border: `1px solid ${h.palette.divider}` },
15
- borderRadius: "16px",
16
- p: 3,
17
- children: [
18
- /* @__PURE__ */ r(a, { children: /* @__PURE__ */ r(a, {
19
- sx: {
20
- backgroundColor: l(h.palette.primary.main, .9),
21
- borderRadius: "100%",
22
- width: "40px",
23
- height: "40px",
24
- display: "flex",
25
- justifyContent: "center",
26
- alignItems: "center",
27
- p: 2
28
- },
29
- children: /* @__PURE__ */ r(f, { sx: {
30
- color: h.palette.primary.main,
31
- width: 20,
32
- height: 20
33
- } })
34
- }) }),
35
- /* @__PURE__ */ i(s, {
36
- gap: 1,
37
- children: [/* @__PURE__ */ r(c, {
38
- variant: "subtitle1",
39
- children: p._("Invoice financing")
40
- }), /* @__PURE__ */ r(c, {
41
- variant: "body1",
42
- fontWeight: 400,
43
- children: p._("Apply for a monthly plan loans to manage your business more efficiently")
44
- })]
45
- }),
46
- /* @__PURE__ */ i(s, {
47
- direction: "row",
48
- gap: 1,
49
- alignItems: "center",
50
- children: [/* @__PURE__ */ r(o, {
51
- disabled: g,
52
- onClick: () => m(),
53
- variant: "outlined",
54
- sx: { px: 2 },
55
- children: p._("Apply for loans")
56
- }), /* @__PURE__ */ r(e, { children: ({ openModal: e }) => /* @__PURE__ */ r(o, {
57
- onClick: e,
58
- variant: "text",
59
- children: p._("Read more")
60
- }) })]
61
- })
62
- ]
63
- }) : null;
64
- };
65
- //#endregion
66
- export { p as FinanceIntegrationCard };