@mx-cartographer/experiences 8.0.4 → 9.0.0-alpha.al1

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 (31) hide show
  1. package/dist/{GlobalAccountFilter-B73Pw1hJ.mjs → GlobalAccountFilter-C0oMFGr7.mjs} +1 -1
  2. package/dist/WidgetContainer-BOehD4AH.mjs +453 -0
  3. package/dist/accounts/index.es.js +93 -91
  4. package/dist/budgets/index.es.js +445 -441
  5. package/dist/cashflow/index.es.js +231 -229
  6. package/dist/common/components/WidgetContainer.d.ts +2 -1
  7. package/dist/common/components/WidgetDateRangeSelector.d.ts +12 -0
  8. package/dist/common/hooks/index.d.ts +1 -0
  9. package/dist/common/hooks/useWidgetHeaderStyles.d.ts +12 -0
  10. package/dist/common/index.es.js +131 -130
  11. package/dist/core/types/Widgets.d.ts +1 -0
  12. package/dist/dashboard/index.es.js +2 -2
  13. package/dist/debts/index.es.js +557 -557
  14. package/dist/finstrong/FinstrongWidget.d.ts +1 -1
  15. package/dist/finstrong/index.es.js +734 -742
  16. package/dist/goals/GoalsWidget.d.ts +1 -1
  17. package/dist/goals/index.es.js +439 -438
  18. package/dist/help/HelpWidget.d.ts +1 -1
  19. package/dist/help/index.es.js +21 -12
  20. package/dist/investments/InvestmentsWidget.d.ts +1 -1
  21. package/dist/investments/index.es.js +417 -416
  22. package/dist/networth/index.es.js +264 -277
  23. package/dist/recurringtransactions/RecurringTransactionsWidget.d.ts +1 -1
  24. package/dist/recurringtransactions/index.es.js +232 -229
  25. package/dist/settings/SettingsWidget.d.ts +1 -1
  26. package/dist/settings/index.es.js +280 -279
  27. package/dist/spending/index.es.js +107 -106
  28. package/dist/transactions/index.es.js +289 -286
  29. package/dist/trends/index.es.js +621 -614
  30. package/package.json +1 -1
  31. package/dist/WidgetContainer-B7xDq2bM.mjs +0 -441
@@ -171,7 +171,7 @@ const N = I(
171
171
  }, i = async () => {
172
172
  await m(n), f(null);
173
173
  }, o = c.account_filter, r = !!h, l = p.length === 0;
174
- return /* @__PURE__ */ d(j, { m: 4, sx: { ...u }, children: [
174
+ return /* @__PURE__ */ d(j, { sx: { ...u }, children: [
175
175
  x ? /* @__PURE__ */ e(
176
176
  C,
177
177
  {
@@ -0,0 +1,453 @@
1
+ import { jsxs as h, jsx as e } from "react/jsx-runtime";
2
+ import R from "react";
3
+ import { observer as re } from "mobx-react-lite";
4
+ import z from "@mui/material/Button";
5
+ import se from "@mui/material/Card";
6
+ import le from "@mui/material/CardContent";
7
+ import de from "@mui/material/Divider";
8
+ import K from "@mui/material/IconButton";
9
+ import me from "@mui/material/Paper";
10
+ import E from "@mui/material/Stack";
11
+ import { ChevronLeft as ce } from "@mxenabled/mx-icons";
12
+ import { Icon as D, Text as F, DateRangePicker as J } from "@mxenabled/mxui";
13
+ import { u as ue } from "./useDimensions-CeDR9V8N.mjs";
14
+ import { G as ge } from "./GlobalAccountFilter-C0oMFGr7.mjs";
15
+ import { b as oe, u as ne, g as pe, a as he, W as fe } from "./hooks-BxkfR-Ff.mjs";
16
+ import { addMonths as Q } from "date-fns/addMonths";
17
+ import { addDays as be } from "date-fns/addDays";
18
+ import { addYears as Z } from "date-fns/addYears";
19
+ import { differenceInCalendarDays as Re } from "date-fns/differenceInCalendarDays";
20
+ import { endOfDay as _e } from "date-fns/endOfDay";
21
+ import { endOfMonth as w } from "date-fns/endOfMonth";
22
+ import { endOfToday as ee } from "date-fns/endOfToday";
23
+ import { endOfYear as Ce } from "date-fns/endOfYear";
24
+ import { startOfMonth as De } from "date-fns/startOfMonth";
25
+ import { startOfToday as ke } from "date-fns/startOfToday";
26
+ import { startOfYear as xe } from "date-fns/startOfYear";
27
+ import { subMonths as V } from "date-fns/subMonths";
28
+ import { subDays as ye } from "date-fns/subDays";
29
+ import { subYears as te } from "date-fns/subYears";
30
+ import ae from "@mui/material/Box";
31
+ import Te from "@mui/material/ButtonGroup";
32
+ import ve from "@mui/material/Tab";
33
+ import Pe from "@mui/material/Tabs";
34
+ import Me from "@mui/material/ToggleButton";
35
+ import Se from "@mui/material/ToggleButtonGroup";
36
+ import Le from "@mui/material/styles/useTheme";
37
+ import { u as Ye } from "./useAriaLive-MkYebyUR.mjs";
38
+ import { D as Ee } from "./Dialog-Ck34yr-d.mjs";
39
+ import { D as Ae } from "./Drawer-Bbe4AMB1.mjs";
40
+ import { u as ie } from "./useScreenSize-B6JyS_Lj.mjs";
41
+ import { f as T, D as v } from "./DateFormats-BMpMrZpW.mjs";
42
+ import { L as Oe } from "./Loader-D3rjKx72.mjs";
43
+ import { A as Ne } from "./Analytics-BYItVAe-.mjs";
44
+ const Be = () => {
45
+ const { isDesktop: o, isMobile: l, isSmallTablet: a, isTablet: d } = ie(), r = 24;
46
+ let n = 48, g = 32, m = 0, k = "h1";
47
+ const c = l || a;
48
+ let u = !1;
49
+ return d && !a ? (n = 24, g = 24, k = "h2") : c && (n = 8, g = 10, m = 10, k = "h3", u = !0), {
50
+ actionsFlex: c ? 0 : 1,
51
+ containerSquareCorners: u,
52
+ headerHeadingLevel: k,
53
+ headerPaddingBottom: m,
54
+ headerPaddingTop: g,
55
+ headerPaddingX: n,
56
+ iconSize: r,
57
+ isCompact: c,
58
+ isDesktop: o,
59
+ slotPaddingBottom: c ? 12 : 0
60
+ };
61
+ }, Ie = ({
62
+ calendarActions: o,
63
+ color: l = "primary",
64
+ copy: a,
65
+ range: d = [De(ke()), w(ee())],
66
+ shouldShrinkToIcon: r = !0,
67
+ variant: n = "outlined"
68
+ }) => {
69
+ const g = Le(), { isMobile: m } = ie(), { announce: k, ariaLive: c } = Ye(), [u, L] = R.useState(d), [i, H] = R.useState(a.dateRangePickerCopy.dateRangeThisMonth), [_, A] = R.useState(u), [Y, P] = R.useState(!1), [W, G] = R.useState(!0), [M, j] = R.useState(6), O = {
70
+ buttons: [
71
+ { ariaLabel: "3 Months", label: "3M", value: 3 },
72
+ { ariaLabel: "6 Months", label: "6M", value: 6 },
73
+ { ariaLabel: "9 Months", label: "9M", value: 9 },
74
+ { ariaLabel: "1 Year", label: "1Y", value: 12 }
75
+ ],
76
+ tabs: [
77
+ { label: "3 Months", value: 3 },
78
+ { label: "6 Months", value: 6 },
79
+ { label: "9 Months", value: 9 },
80
+ { label: "1 Year", value: 12 }
81
+ ]
82
+ };
83
+ R.useEffect(() => {
84
+ L(d), A(d);
85
+ }, [d]), R.useEffect(() => {
86
+ (n === "timeframebuttons" || n === "timeframetabs") && o.onRangeChanged($());
87
+ }, [M]);
88
+ const $ = () => {
89
+ const t = w(ee());
90
+ return [w(V(t, M)), t];
91
+ }, N = (t) => {
92
+ const [s, p] = u, f = t === "previous";
93
+ let b;
94
+ if (i === a.dateRangePickerCopy.dateRangeThisMonth || i === a.dateRangePickerCopy.dateRangeLastMonth)
95
+ b = [
96
+ f ? V(s, 1) : Q(s, 1),
97
+ w(f ? V(p, 1) : Q(p, 1))
98
+ ];
99
+ else if (i === a.dateRangePickerCopy.dateRangeYTD || i === a.dateRangePickerCopy.dateRangeLastYear) {
100
+ const y = xe(s), C = Ce(s);
101
+ b = [
102
+ f ? te(y, 1) : Z(y, 1),
103
+ f ? te(C, 1) : Z(C, 1)
104
+ ];
105
+ } else {
106
+ const y = Re(p, s), C = f ? ye : be;
107
+ b = [C(s, y), C(p, y)];
108
+ }
109
+ L(b), o.onRangeChanged(b);
110
+ }, S = () => {
111
+ L(_), G(
112
+ i === a.dateRangePickerCopy.dateRangeThisMonth || i === a.dateRangePickerCopy.dateRangeLastMonth
113
+ ), o.onRangeChanged(_);
114
+ }, x = (t, s) => {
115
+ t[1] = t[1] ?? t[0];
116
+ const p = [t[0], t[1] ? _e(t[1]) : t[1]], f = T(p[0], v.MONTH_DAY_YEAR), b = T(p[1], v.MONTH_DAY_YEAR);
117
+ A(p), H(s), k(`${a.dateRangePickerCopy}: ${f} - ${b}`);
118
+ }, B = (t) => {
119
+ j(t);
120
+ };
121
+ return /* @__PURE__ */ h(ae, { className: "mx-cmn-date-range-selector", m: 4, children: [
122
+ /* @__PURE__ */ h(
123
+ ae,
124
+ {
125
+ sx: {
126
+ [g.breakpoints.down("sm")]: {
127
+ display: r ? "none" : "flex",
128
+ justifyContent: "center"
129
+ },
130
+ [g.breakpoints.up("sm")]: { display: "inline-flex" }
131
+ },
132
+ children: [
133
+ n === "readonly" && /* @__PURE__ */ h(E, { alignItems: "center", direction: "row", gap: 8, children: [
134
+ /* @__PURE__ */ e(D, { name: "calendar_month", size: 24 }),
135
+ /* @__PURE__ */ e(F, { bold: !0, children: T(_[0], v.MONTH_DAY) }),
136
+ /* @__PURE__ */ e(D, { name: "remove" }),
137
+ /* @__PURE__ */ e(F, { bold: !0, children: T(_[1], v.MONTH_DAY_YEAR) })
138
+ ] }),
139
+ n !== "readonly" && n !== "timeframebuttons" && n !== "timeframetabs" && /* @__PURE__ */ h(
140
+ Te,
141
+ {
142
+ color: l,
143
+ sx: {
144
+ "& .MuiButtonGroup-grouped": {
145
+ padding: m ? 0 : 12
146
+ },
147
+ "& .MuiButtonGroup-middleButton": {
148
+ px: 24
149
+ },
150
+ height: 44
151
+ },
152
+ variant: n,
153
+ children: [
154
+ /* @__PURE__ */ e(
155
+ z,
156
+ {
157
+ "aria-disabled": o.shouldDisablePrevious,
158
+ "aria-label": a.dateRangePreviousAria,
159
+ color: o.shouldDisablePrevious ? "secondary" : "primary",
160
+ onClick: () => o.shouldDisablePrevious ? null : N("previous"),
161
+ children: /* @__PURE__ */ e(D, { name: "chevron_left", size: 20 })
162
+ }
163
+ ),
164
+ /* @__PURE__ */ e(
165
+ z,
166
+ {
167
+ "aria-disabled": o.shouldDisablePicker,
168
+ color: l,
169
+ onClick: () => o.shouldDisablePicker ? null : P(!0),
170
+ startIcon: /* @__PURE__ */ e(D, { name: "calendar_month", size: 20 }),
171
+ sx: {
172
+ p: m ? 0 : 8
173
+ },
174
+ children: W ? T(u[0], v.MONTH_YEAR) : /* @__PURE__ */ h("span", { children: [
175
+ T(u[0], v.MONTH_DAY_YEAR),
176
+ " -",
177
+ " ",
178
+ T(u[1], v.MONTH_DAY_YEAR)
179
+ ] })
180
+ }
181
+ ),
182
+ /* @__PURE__ */ e(
183
+ z,
184
+ {
185
+ "aria-disabled": o.shouldDisableNext,
186
+ "aria-label": a.dateRangeNextAria,
187
+ color: o.shouldDisableNext ? "secondary" : "primary",
188
+ onClick: () => o.shouldDisableNext ? null : N("next"),
189
+ children: /* @__PURE__ */ e(D, { name: "chevron_right", size: 20 })
190
+ }
191
+ )
192
+ ]
193
+ }
194
+ ),
195
+ n === "timeframebuttons" && /* @__PURE__ */ e(
196
+ Se,
197
+ {
198
+ "aria-label": a.dateRangeEditTitle,
199
+ color: l,
200
+ exclusive: !0,
201
+ orientation: "horizontal",
202
+ value: M,
203
+ children: O.buttons.map((t) => /* @__PURE__ */ e(
204
+ Me,
205
+ {
206
+ "aria-label": t.ariaLabel,
207
+ onClick: () => B(t.value),
208
+ sx: { width: 56 },
209
+ value: t.value,
210
+ children: t.label
211
+ },
212
+ t.label
213
+ ))
214
+ }
215
+ ),
216
+ n === "timeframetabs" && /* @__PURE__ */ e(
217
+ Pe,
218
+ {
219
+ indicatorColor: "primary",
220
+ onChange: (t, s) => B(s),
221
+ textColor: "primary",
222
+ value: M,
223
+ variant: "fullWidth",
224
+ children: O.tabs.map((t) => /* @__PURE__ */ e(
225
+ ve,
226
+ {
227
+ label: /* @__PURE__ */ e(F, { bold: !0, variant: "body1", children: t.label }),
228
+ sx: { minWidth: 80 },
229
+ value: t.value
230
+ },
231
+ t.label
232
+ ))
233
+ }
234
+ )
235
+ ]
236
+ }
237
+ ),
238
+ Y && m && /* @__PURE__ */ h(
239
+ Ae,
240
+ {
241
+ ariaLabelClose: a.dateRangeCloseAria,
242
+ isOpen: Y,
243
+ onClose: () => P(!1),
244
+ onPrimaryAction: () => {
245
+ S(), P(!1);
246
+ },
247
+ primaryText: a.dateRangeEditApply,
248
+ title: a.dateRangeEditTitle,
249
+ children: [
250
+ c,
251
+ /* @__PURE__ */ e(
252
+ J,
253
+ {
254
+ copy: a.dateRangePickerCopy,
255
+ dateRange: _,
256
+ onRangeChanged: x,
257
+ selectedShortcut: i,
258
+ sx: { p: 0 }
259
+ }
260
+ )
261
+ ]
262
+ }
263
+ ),
264
+ Y && !m && /* @__PURE__ */ h(
265
+ Ee,
266
+ {
267
+ copy: { title: a.dateRangeEditTitle },
268
+ isOpen: !0,
269
+ onClose: () => P(!1),
270
+ onPrimaryAction: () => S(),
271
+ primaryText: a.dateRangeEditApply,
272
+ sx: {
273
+ "& .MuiDialogContent-root": {
274
+ padding: 0
275
+ }
276
+ },
277
+ children: [
278
+ c,
279
+ /* @__PURE__ */ e(
280
+ J,
281
+ {
282
+ copy: a.dateRangePickerCopy,
283
+ dateRange: _,
284
+ onRangeChanged: x,
285
+ selectedShortcut: i,
286
+ sx: {
287
+ pt: 0,
288
+ "& .MuiPickersLayout-toolbar": {
289
+ gridColumn: "1/4"
290
+ }
291
+ }
292
+ }
293
+ )
294
+ ]
295
+ }
296
+ )
297
+ ] });
298
+ }, we = Ie, ze = re(
299
+ ({ calendarActions: o, dateRange: l, dateRangeVariant: a }) => {
300
+ const { displayedDateRange: d } = oe(), { common: r } = ne(), n = {
301
+ dateRangePickerCopy: {
302
+ dateRangeFrom: r.date_range_picker.from,
303
+ dateRangeTo: r.date_range_picker.to,
304
+ dateRangeCustom: r.date_range_picker.custom,
305
+ dateRangeSelectARange: r.date_range_picker.select_range,
306
+ dateRangeThisMonth: r.date_range_picker.this_month,
307
+ dateRangeLastMonth: r.date_range_picker.last_month,
308
+ dateRangeLast30Days: r.date_range_picker.last_30_days,
309
+ dateRangeLast90Days: r.date_range_picker.last_90_days,
310
+ dateRangeYTD: r.date_range_picker.ytd,
311
+ dateRangeLastYear: r.date_range_picker.last_year,
312
+ dateRangeSelect: r.date_range_picker.select
313
+ },
314
+ dateRangeEditApply: r.date_range_picker.edit_apply,
315
+ dateRangeEditTitle: r.date_range_picker.edit_title,
316
+ dateRangeNextAria: r.date_range_picker.next_aria,
317
+ dateRangePreviousAria: r.date_range_picker.previous_aria
318
+ }, g = l ? l.start : d.start, m = l ? l.end : d.end;
319
+ return /* @__PURE__ */ e(
320
+ we,
321
+ {
322
+ calendarActions: o,
323
+ copy: n,
324
+ range: [g, m],
325
+ shouldShrinkToIcon: !1,
326
+ variant: a
327
+ }
328
+ );
329
+ }
330
+ ), St = re(
331
+ ({
332
+ actions: o,
333
+ allowedAccountTypes: l,
334
+ calendarActions: a,
335
+ children: d,
336
+ className: r = "mx-cmn-widget",
337
+ dateRange: n,
338
+ dateRangeVariant: g,
339
+ hasDivider: m = !1,
340
+ onAccountsFilterClick: k,
341
+ onBackClick: c,
342
+ onMenuClick: u,
343
+ showAccountFilter: L = !0,
344
+ slotComponent: i,
345
+ sx: H = {},
346
+ title: _ = ""
347
+ }) => {
348
+ const [A, { height: Y, width: P }] = ue(), { onEvent: W } = pe(), {
349
+ actionsFlex: G,
350
+ containerSquareCorners: M,
351
+ headerHeadingLevel: j,
352
+ headerPaddingBottom: O,
353
+ headerPaddingTop: $,
354
+ headerPaddingX: N,
355
+ iconSize: S,
356
+ isCompact: x,
357
+ isDesktop: B,
358
+ slotPaddingBottom: t
359
+ } = Be(), { isCopyLoaded: s } = oe(), { common: p } = ne(), {
360
+ config: { display_widget_headings: f }
361
+ } = he(), b = () => {
362
+ c && (c(), W(Ne.WIDGET_BACK_CLICK));
363
+ };
364
+ if (!s)
365
+ return /* @__PURE__ */ e(Oe, {});
366
+ const y = () => x && u ? /* @__PURE__ */ e(K, { color: "primary", onClick: u, sx: { p: 10 }, children: /* @__PURE__ */ e(D, { name: "menu_open", size: S, sx: { transform: "rotate(180deg)" } }) }) : c ? /* @__PURE__ */ e(
367
+ K,
368
+ {
369
+ "aria-label": p.back_to_dashboard,
370
+ color: "primary",
371
+ onClick: b,
372
+ sx: { p: 10 },
373
+ children: /* @__PURE__ */ e(ce, { size: 24 })
374
+ }
375
+ ) : null, C = a && /* @__PURE__ */ e(E, { alignItems: "center", sx: { pb: t, flex: 1, flexShrink: 0 }, children: /* @__PURE__ */ e(
376
+ ze,
377
+ {
378
+ calendarActions: a,
379
+ dateRange: n,
380
+ dateRangeVariant: g
381
+ }
382
+ ) });
383
+ return /* @__PURE__ */ e(
384
+ me,
385
+ {
386
+ className: r,
387
+ elevation: 1,
388
+ square: M,
389
+ sx: { borderBottomLeftRadius: 0, borderBottomRightRadius: 0, ...H },
390
+ children: /* @__PURE__ */ h(se, { children: [
391
+ /* @__PURE__ */ h(
392
+ E,
393
+ {
394
+ alignItems: "center",
395
+ alignSelf: "stretch",
396
+ direction: "row",
397
+ justifyContent: "space-between",
398
+ sx: {
399
+ pb: O,
400
+ pt: $,
401
+ px: N
402
+ },
403
+ children: [
404
+ y(),
405
+ /* @__PURE__ */ e(E, { alignItems: "flex-start", minWidth: 0, sx: { flex: 1 }, children: f && /* @__PURE__ */ e(F, { sx: { width: "100%" }, truncate: !0, variant: j, children: _ }) }),
406
+ !x && (i || C),
407
+ /* @__PURE__ */ h(
408
+ E,
409
+ {
410
+ alignItems: "center",
411
+ direction: "row",
412
+ justifyContent: "flex-end",
413
+ sx: { flex: G, flexShrink: 0 },
414
+ children: [
415
+ L && /* @__PURE__ */ e(
416
+ ge,
417
+ {
418
+ allowedAccountTypes: l,
419
+ onAccountFilterClick: k
420
+ }
421
+ ),
422
+ o?.map((q) => {
423
+ if (R.isValidElement(q)) return q;
424
+ const { iconName: I, onClick: X, label: U } = q;
425
+ return B ? /* @__PURE__ */ e(
426
+ z,
427
+ {
428
+ onClick: X,
429
+ startIcon: /* @__PURE__ */ e(D, { name: I, size: S }),
430
+ children: U
431
+ },
432
+ I
433
+ ) : /* @__PURE__ */ e(K, { "aria-label": U, color: "primary", onClick: X, children: /* @__PURE__ */ e(D, { name: I, size: S }) }, I);
434
+ })
435
+ ]
436
+ }
437
+ )
438
+ ]
439
+ }
440
+ ),
441
+ x && (i || C),
442
+ x && m && /* @__PURE__ */ e(de, {}),
443
+ /* @__PURE__ */ e(le, { ref: A, children: /* @__PURE__ */ e(fe, { availableHeight: Y, availableWidth: P, children: d }) })
444
+ ] })
445
+ }
446
+ );
447
+ }
448
+ );
449
+ export {
450
+ we as D,
451
+ St as W,
452
+ Be as u
453
+ };