@tesouro/embedded-components-react 0.5.190 → 0.5.192

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.
package/dist/index.css CHANGED
@@ -6526,6 +6526,9 @@
6526
6526
  .ttw\:\[\&\[data-state\=open\]\>svg\]\:rotate-180[data-state=open] > svg {
6527
6527
  rotate: 180deg;
6528
6528
  }
6529
+ .dark .ttw\:\[\.dark_\&\]\:bg-background {
6530
+ background-color: var(--ttw-background);
6531
+ }
6529
6532
  @media (resolution>192dpi) {
6530
6533
  .ttw\:\[\@media\(resolution\>192dpi\)\]\:min-h-\[1828px\] {
6531
6534
  min-height: 1828px;
package/dist/index.d.ts CHANGED
@@ -2031,7 +2031,6 @@ interface Labels$3 {
2031
2031
  statementsNextPageButton: string;
2032
2032
  statementsLoadingLabel: string;
2033
2033
  statementsErrorTitle: string;
2034
- statementsErrorDescription: string;
2035
2034
  statementsErrorRetry: string;
2036
2035
  editAccountMenuItem: string;
2037
2036
  editDialogTitle: string;
@@ -698,7 +698,6 @@ interface Labels {
698
698
  statementsNextPageButton: string;
699
699
  statementsLoadingLabel: string;
700
700
  statementsErrorTitle: string;
701
- statementsErrorDescription: string;
702
701
  statementsErrorRetry: string;
703
702
  editAccountMenuItem: string;
704
703
  editDialogTitle: string;
@@ -1231,7 +1231,6 @@ interface Labels$3 {
1231
1231
  statementsNextPageButton: string;
1232
1232
  statementsLoadingLabel: string;
1233
1233
  statementsErrorTitle: string;
1234
- statementsErrorDescription: string;
1235
1234
  statementsErrorRetry: string;
1236
1235
  editAccountMenuItem: string;
1237
1236
  editDialogTitle: string;
@@ -28,7 +28,6 @@ function _({ labels: t, rows: u, isLoading: m = !1, isError: h = !1, onRetry: _,
28
28
  className: "ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card",
29
29
  children: /* @__PURE__ */ d(c, {
30
30
  title: t.statementsErrorTitle,
31
- description: t.statementsErrorDescription,
32
31
  retryLabel: _ ? t.statementsErrorRetry : void 0,
33
32
  onRetry: _
34
33
  })
@@ -31,8 +31,7 @@ var e = {
31
31
  statementsPreviousPageButton: "Previous page",
32
32
  statementsNextPageButton: "Next page",
33
33
  statementsLoadingLabel: "Loading statements",
34
- statementsErrorTitle: "Unable to load statements.",
35
- statementsErrorDescription: "Something went wrong. Please try again.",
34
+ statementsErrorTitle: "No statements available",
36
35
  statementsErrorRetry: "Retry",
37
36
  editAccountMenuItem: "Edit account nickname",
38
37
  editDialogTitle: "Edit account settings",
@@ -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.190", n = "4e88c38e6f48b57fa2502a815aeeb27475b6a369", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.5.192", n = "c40bf1339e86a7e0b4ce30d2858057a4d0127772", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
@@ -13,35 +13,32 @@ import "../../../../../monite-sdk/dist/index.js";
13
13
  import { useEffect as s, useLayoutEffect as c, useMemo as l, useState as u } from "react";
14
14
  import { jsx as d } from "react/jsx-runtime";
15
15
  //#region ../../libs/tesouro-embedded-components-react/shared/monite-wrapper/feature/dist/lib/MoniteWrapper.js
16
- var f = 0, p = "tesouro-embedded-light", m = {
17
- color: "var(--ttw-foreground)",
18
- background: "var(--ttw-background)"
19
- }, h = "position: relative; z-index: calc(var(--tesouro-embedded-overlay-z-index, 2147483000) - 1); color: var(--ttw-foreground);", g = typeof document > "u" ? s : c;
20
- function _() {
16
+ var f = 0, p = "tesouro-embedded-light", m = `${p} ttw:[.dark_&]:bg-background`, h = { color: "var(--ttw-foreground)" }, g = "position: relative; z-index: calc(var(--tesouro-embedded-overlay-z-index, 2147483000) - 1); color: var(--ttw-foreground);", _ = typeof document > "u" ? s : c;
17
+ function v() {
21
18
  let [e] = u(() => {
22
19
  if (typeof document > "u") return;
23
20
  let e = document.createElement("div");
24
- return e.className = `tesouro-embedded ${p}`, e.setAttribute("style", h), e;
21
+ return e.className = `tesouro-embedded ${p}`, e.setAttribute("style", g), e;
25
22
  });
26
- return g(() => {
23
+ return _(() => {
27
24
  if (e) return document.body.appendChild(e), () => e.remove();
28
25
  }, [e]), e;
29
26
  }
30
- function v(e) {
27
+ function y(e) {
31
28
  return e instanceof Error ? e : Error(String(e));
32
29
  }
33
- function y({ finopsThemeColors: s, children: c }) {
34
- let h = _(), { baseUrl: g, organizationId: y, initResponse: b, widgetToken: x } = n(), { client: S } = e(), C = t(), w = C !== null, T = C?.state, E = C?.refresh, D = C?.getState, O = w && T?.status === "ready" ? T.widgetToken : x ?? null, k = w && T?.status === "ready" ? T.exp : void 0, A = i(), [j, M] = u(() => ({
35
- organizationId: y,
30
+ function b({ finopsThemeColors: s, children: c }) {
31
+ let p = v(), { baseUrl: g, organizationId: _, initResponse: b, widgetToken: x } = n(), { client: S } = e(), C = t(), w = C !== null, T = C?.state, E = C?.refresh, D = C?.getState, O = w && T?.status === "ready" ? T.widgetToken : x ?? null, k = w && T?.status === "ready" ? T.exp : void 0, A = i(), [j, M] = u(() => ({
32
+ organizationId: _,
36
33
  widgetToken: O,
37
34
  widgetTokenExp: k
38
35
  }));
39
- !A && (j.organizationId !== y || j.widgetToken !== O || j.widgetTokenExp !== k) && M({
40
- organizationId: y,
36
+ !A && (j.organizationId !== _ || j.widgetToken !== O || j.widgetTokenExp !== k) && M({
37
+ organizationId: _,
41
38
  widgetToken: O,
42
39
  widgetTokenExp: k
43
40
  });
44
- let N = A ? j.organizationId : y, P = A ? j.widgetToken : O, F = A ? j.widgetTokenExp : k, I = r();
41
+ let N = A ? j.organizationId : _, P = A ? j.widgetToken : O, F = A ? j.widgetTokenExp : k, I = r();
45
42
  if (I) throw I;
46
43
  if (T?.status === "error") throw T.error instanceof Error ? T.error : Error(String(T.error));
47
44
  let L = b?.userId ?? null, R = w ? T?.status === "ready" : !!x, z = l(() => {
@@ -84,14 +81,14 @@ function y({ finopsThemeColors: s, children: c }) {
84
81
  if (!E || !D) throw Error("MoniteWrapper.fetchToken: token refresh provider is unavailable");
85
82
  let e = !1, t = () => {
86
83
  let e = D();
87
- if (e.status === "error") throw v(e.error);
84
+ if (e.status === "error") throw y(e.error);
88
85
  return e;
89
86
  }, n = (e) => {
90
87
  if (e.status !== "ready") throw Error("MoniteWrapper.fetchToken: widget token is not ready after refresh()");
91
88
  return e;
92
89
  }, r = D();
93
- if (r.status === "error") throw v(r.error);
94
- if (r.status !== "ready" && (await E(), e = !0, r = t()), r = n(r), r.exp === void 0 && !e && (await E(), r = n(t())), r.exp === void 0 && r.lastError !== void 0) throw v(r.lastError);
90
+ if (r.status === "error") throw y(r.error);
91
+ if (r.status !== "ready" && (await E(), e = !0, r = t()), r = n(r), r.exp === void 0 && !e && (await E(), r = n(t())), r.exp === void 0 && r.lastError !== void 0) throw y(r.lastError);
95
92
  let i = Date.now() / 1e3, a = r.exp === void 0 ? f : Math.max(0, r.exp - i);
96
93
  return {
97
94
  access_token: r.widgetToken,
@@ -116,8 +113,8 @@ function y({ finopsThemeColors: s, children: c }) {
116
113
  return s.primary && (e.primary = s.primary), s.primaryForeground && (e.primaryForeground = s.primaryForeground), Object.keys(e).length > 0 ? { colors: e } : void 0;
117
114
  }, [s]);
118
115
  return !R || !B || !b || !g || !N ? null : /* @__PURE__ */ d(a, {
119
- elements: h ? {
120
- root: h,
116
+ elements: p ? {
117
+ root: p,
121
118
  styles: void 0
122
119
  } : void 0,
123
120
  children: /* @__PURE__ */ d(o, {
@@ -133,12 +130,12 @@ function y({ finopsThemeColors: s, children: c }) {
133
130
  financing: { enableFinanceWidgetButton: !1 }
134
131
  },
135
132
  children: /* @__PURE__ */ d("div", {
136
- className: p,
137
- style: m,
133
+ className: m,
134
+ style: h,
138
135
  children: c
139
136
  })
140
137
  }, L ?? "no-user")
141
138
  });
142
139
  }
143
140
  //#endregion
144
- export { y as MoniteWrapper };
141
+ export { b as MoniteWrapper };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.5.190",
3
+ "version": "0.5.192",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "packageDepSync": {