@mx-cartographer/experiences 8.1.1 → 8.1.3

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