@mx-cartographer/experiences 8.0.19 → 8.0.20

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