@mx-cartographer/experiences 9.7.24 → 9.7.26

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 +8 -0
  2. package/dist/common/components/MiniWidgetContainer.es.js +35 -45
  3. package/dist/common/components/MiniWidgetContainer.es.js.map +1 -1
  4. package/dist/common/components/charts/LineChart.es.js +86 -85
  5. package/dist/common/components/charts/LineChart.es.js.map +1 -1
  6. package/dist/common/constants/Styles.d.ts +2 -0
  7. package/dist/common/constants/Styles.es.js +17 -0
  8. package/dist/common/constants/Styles.es.js.map +1 -0
  9. package/dist/common/constants/index.d.ts +1 -0
  10. package/dist/common/hooks/useAriaLive.es.js +12 -22
  11. package/dist/common/hooks/useAriaLive.es.js.map +1 -1
  12. package/dist/common/index.es.js +111 -109
  13. package/dist/core/stores/TrendsStore.d.ts +5 -0
  14. package/dist/core/utils/DateUtil.d.ts +2 -0
  15. package/dist/core/utils/DateUtil.es.js +37 -35
  16. package/dist/core/utils/DateUtil.es.js.map +1 -1
  17. package/dist/core/utils/NumberFormatting.d.ts +1 -0
  18. package/dist/core/utils/NumberFormatting.es.js +14 -13
  19. package/dist/core/utils/NumberFormatting.es.js.map +1 -1
  20. package/dist/core/utils/TrendsUtil.d.ts +5 -0
  21. package/dist/core/utils/TrendsUtil.es.js +67 -59
  22. package/dist/core/utils/TrendsUtil.es.js.map +1 -1
  23. package/dist/insights-v2/components/BaseLayout.es.js +47 -48
  24. package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
  25. package/dist/transactions/components/shared/TransactionList.d.ts +4 -0
  26. package/dist/transactions/components/shared/TransactionList.es.js +138 -84
  27. package/dist/transactions/components/shared/TransactionList.es.js.map +1 -1
  28. package/dist/trends/components/CategoryDetailChart.d.ts +2 -1
  29. package/dist/trends/components/CategoryDetailChart.es.js +55 -35
  30. package/dist/trends/components/CategoryDetailChart.es.js.map +1 -1
  31. package/dist/trends/components/CategoryDetails.es.js +68 -71
  32. package/dist/trends/components/CategoryDetails.es.js.map +1 -1
  33. package/dist/trends/utils/TrendsTable.es.js +25 -25
  34. package/dist/trends/utils/TrendsTable.es.js.map +1 -1
  35. package/package.json +1 -1
@@ -1,34 +1,24 @@
1
+ import { VISUALLY_HIDDEN_SX as u } from "../constants/Styles.es.js";
1
2
  import e from "react";
2
- import { jsx as n } from "react/jsx-runtime";
3
- import l from "@mui/material/Box";
4
- var d = (r = "polite") => {
5
- const [i, s] = e.useState(""), [t, o] = e.useState(r);
3
+ import { jsx as l } from "react/jsx-runtime";
4
+ import c from "@mui/material/Box";
5
+ var L = (a = "polite") => {
6
+ const [r, o] = e.useState(""), [t, i] = e.useState(a);
6
7
  return {
7
- announce: e.useCallback((p, a) => {
8
- a && o(a), s(p);
8
+ announce: e.useCallback((m, s) => {
9
+ s && i(s), o(m);
9
10
  }, []),
10
- ariaLive: e.useMemo(() => /* @__PURE__ */ n(l, {
11
+ ariaLive: e.useMemo(() => /* @__PURE__ */ l(c, {
11
12
  "aria-atomic": "true",
12
13
  "aria-live": t,
13
14
  role: t === "assertive" ? "alert" : "status",
14
- sx: {
15
- position: "absolute",
16
- width: "1px",
17
- height: "1px",
18
- padding: 0,
19
- margin: "-1px",
20
- overflow: "hidden",
21
- clip: "rect(0 0 0 0)",
22
- clipPath: "inset(50%)",
23
- whiteSpace: "nowrap",
24
- border: 0
25
- },
26
- children: i
27
- }), [i, t])
15
+ sx: u,
16
+ children: r
17
+ }), [r, t])
28
18
  };
29
19
  };
30
20
  export {
31
- d as useAriaLive
21
+ L as useAriaLive
32
22
  };
33
23
 
34
24
  //# sourceMappingURL=useAriaLive.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAriaLive.es.js","names":[],"sources":["../../../src/common/hooks/useAriaLive.tsx"],"sourcesContent":["import React from 'react'\nimport Box from '@mui/material/Box'\n\nexport type AriaLivePoliteness = 'polite' | 'assertive'\n\ninterface UseAriaLiveResult {\n announce: (message: string, politeness?: AriaLivePoliteness) => void\n ariaLive: React.ReactElement | null\n}\n\nexport const useAriaLive = (\n initialPoliteness: AriaLivePoliteness = 'polite',\n): UseAriaLiveResult => {\n const [message, setMessage] = React.useState('')\n const [politeness, setPoliteness] = React.useState<AriaLivePoliteness>(initialPoliteness)\n\n const announce = React.useCallback((next: string, nextPoliteness?: AriaLivePoliteness) => {\n if (nextPoliteness) setPoliteness(nextPoliteness)\n setMessage(next)\n }, [])\n\n const ariaLive = React.useMemo(\n () => (\n <Box\n aria-atomic=\"true\"\n aria-live={politeness}\n role={politeness === 'assertive' ? 'alert' : 'status'}\n sx={{\n position: 'absolute',\n width: '1px',\n height: '1px',\n padding: 0,\n margin: '-1px',\n overflow: 'hidden',\n clip: 'rect(0 0 0 0)',\n clipPath: 'inset(50%)',\n whiteSpace: 'nowrap',\n border: 0,\n }}\n >\n {message}\n </Box>\n ),\n [message, politeness],\n )\n\n return { announce, ariaLive }\n}\n"],"mappings":";;;AAUA,IAAa,IAAA,CACX,IAAwC,aAClB;AACtB,QAAM,CAAC,GAAS,CAAA,IAAc,EAAM,SAAS,EAAE,GACzC,CAAC,GAAY,CAAA,IAAiB,EAAM,SAA6B,CAAiB;AAgCxF,SAAO;AAAA,IAAE,UA9BQ,EAAM,YAAA,CAAa,GAAc,MAAwC;AACxF,MAAI,KAAgB,EAAc,CAAc,GAChD,EAAW,CAAI;AAAA,IACjB,GAAG,CAAC,CA2BK;AAAA,IAAU,UAzBF,EAAM,QAAA,MAEnB,gBAAA,EAAC,GAAD;AAAA,MACE,eAAY;AAAA,MACZ,aAAW;AAAA,MACX,MAAM,MAAe,cAAc,UAAU;AAAA,MAC7C,IAAI;AAAA,QACF,UAAU;AAAA,QACV,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,SAAS;AAAA,QACT,QAAQ;AAAA,QACR,UAAU;AAAA,QACV,MAAM;AAAA,QACN,UAAU;AAAA,QACV,YAAY;AAAA,QACZ,QAAQ;AAAA,MACV;AAAA,MAEC,UAAA;AAAA,IACE,CAAA,GAEP,CAAC,GAAS,CAAU,CAGH;AAAA,EAAS;AAC9B"}
1
+ {"version":3,"file":"useAriaLive.es.js","names":[],"sources":["../../../src/common/hooks/useAriaLive.tsx"],"sourcesContent":["import React from 'react'\nimport Box from '@mui/material/Box'\n\nimport { VISUALLY_HIDDEN_SX } from '../constants/Styles'\n\nexport type AriaLivePoliteness = 'polite' | 'assertive'\n\ninterface UseAriaLiveResult {\n announce: (message: string, politeness?: AriaLivePoliteness) => void\n ariaLive: React.ReactElement | null\n}\n\nexport const useAriaLive = (\n initialPoliteness: AriaLivePoliteness = 'polite',\n): UseAriaLiveResult => {\n const [message, setMessage] = React.useState('')\n const [politeness, setPoliteness] = React.useState<AriaLivePoliteness>(initialPoliteness)\n\n const announce = React.useCallback((next: string, nextPoliteness?: AriaLivePoliteness) => {\n if (nextPoliteness) setPoliteness(nextPoliteness)\n setMessage(next)\n }, [])\n\n const ariaLive = React.useMemo(\n () => (\n <Box\n aria-atomic=\"true\"\n aria-live={politeness}\n role={politeness === 'assertive' ? 'alert' : 'status'}\n sx={VISUALLY_HIDDEN_SX}\n >\n {message}\n </Box>\n ),\n [message, politeness],\n )\n\n return { announce, ariaLive }\n}\n"],"mappings":";;;;AAYA,IAAa,IAAA,CACX,IAAwC,aAClB;AACtB,QAAM,CAAC,GAAS,CAAA,IAAc,EAAM,SAAS,EAAE,GACzC,CAAC,GAAY,CAAA,IAAiB,EAAM,SAA6B,CAAiB;AAqBxF,SAAO;AAAA,IAAE,UAnBQ,EAAM,YAAA,CAAa,GAAc,MAAwC;AACxF,MAAI,KAAgB,EAAc,CAAc,GAChD,EAAW,CAAI;AAAA,IACjB,GAAG,CAAC,CAgBK;AAAA,IAAU,UAdF,EAAM,QAAA,MAEnB,gBAAA,EAAC,GAAD;AAAA,MACE,eAAY;AAAA,MACZ,aAAW;AAAA,MACX,MAAM,MAAe,cAAc,UAAU;AAAA,MAC7C,IAAI;AAAA,MAEH,UAAA;AAAA,IACE,CAAA,GAEP,CAAC,GAAS,CAAU,CAGH;AAAA,EAAS;AAC9B"}
@@ -2,133 +2,135 @@ import { buildDynamicCopy as r, buildPluralCopy as t } from "../core/utils/Local
2
2
  import i, { CalendarSelectionTypes as m } from "./components/calendar/Calendar.es.js";
3
3
  import a from "./components/charts/StatusBar.es.js";
4
4
  import p from "./components/charts/Donut.es.js";
5
- import f from "./hooks/useAccountDisplayName.es.js";
5
+ import u from "./hooks/useAccountDisplayName.es.js";
6
6
  import { useCombineEvents as C, useCombinePageviews as S } from "./hooks/useCombineEvents.es.js";
7
7
  import { GlobalDataContext as c, GlobalDataProvider as T } from "./context/GlobalDataProvider.es.js";
8
8
  import { WidgetContainerContext as d, WidgetContainerProvider as D } from "./context/WidgetContainerProvider.es.js";
9
- import { useAccountStore as I, useActionContext as N, useAgreementStore as P, useAppConfig as A, useBudgetsStore as y, useCashflowStore as O, useCategoryStore as b, useDebtStore as W, useError as G, useEvent as L, useFinstrongStore as R, useGlobalCopyStore as U, useGlobalStore as v, useGlobalUiStore as B, useGoalStore as h, useHelpStore as w, useHoldingStore as x, useHostMessage as M, useInsightsV2Store as Y, useLoad as H, useMerchantStore as F, useNetWorthStore as z, useNotificationStore as V, usePageView as Z, useRecurringTransactionsStore as K, useSettingsStore as k, useTransactionStore as q, useTrendsStore as j, useUserStore as J, useWidgetContainerProvider as Q } from "./context/hooks.es.js";
9
+ import { useAccountStore as I, useActionContext as N, useAgreementStore as P, useAppConfig as A, useBudgetsStore as y, useCashflowStore as O, useCategoryStore as b, useDebtStore as W, useError as L, useEvent as G, useFinstrongStore as R, useGlobalCopyStore as U, useGlobalStore as v, useGlobalUiStore as B, useGoalStore as h, useHelpStore as w, useHoldingStore as x, useHostMessage as M, useInsightsV2Store as Y, useLoad as H, useMerchantStore as F, useNetWorthStore as V, useNotificationStore as z, usePageView as Z, useRecurringTransactionsStore as K, useSettingsStore as k, useTransactionStore as q, useTrendsStore as X, useUserStore as j, useWidgetContainerProvider as J } from "./context/hooks.es.js";
10
10
  import { useInsightsEnabled as $ } from "./hooks/useInsightsEnabled.es.js";
11
11
  import { useScreenSize as ro } from "./hooks/useScreenSize.es.js";
12
12
  import eo from "./hooks/usePrevious.es.js";
13
- import { formatCurrency as mo, formatOrdinal as no, formatPercentage as ao, generateEqualIntervals as so, getCurrencyCodes as po, getPluralRules as uo } from "../core/utils/NumberFormatting.es.js";
13
+ import { formatCurrency as mo, formatOrdinal as no, formatPercentage as ao, generateEqualIntervals as so, getCurrencyCodes as po, getPluralRules as fo } from "../core/utils/NumberFormatting.es.js";
14
14
  import { useRepeatingTransactionEligibility as lo } from "./hooks/useRepeatingTransactionEligibility.es.js";
15
15
  import { useWidgetHeaderStyles as So } from "./hooks/useWidgetHeaderStyles.es.js";
16
16
  import { useWidgetLoadTimer as co } from "./hooks/useWidgetLoadTimer.es.js";
17
- import Eo from "./components/dialog/Dialog.es.js";
18
- import _o from "./components/drawer/Drawer.es.js";
19
- import No from "./components/daterangeselector/DateRangeSelector.es.js";
20
- import { ANALYTICS_EVENTS as Ao } from "./constants/Analytics.es.js";
21
- import { CONNECTIONS_WIDGET_ID as Oo, CONNECT_WIDGET_ID as bo, CONNECT_WIDGET_SOURCES as Wo, DEEP_LINK_TYPE as Go, MemberConnectionStatus as Lo } from "./constants/Connect.es.js";
22
- import { GlobalStore as Uo } from "../core/stores/GlobalStore.es.js";
23
- import { INCOME_ACCOUNT_TYPES as Bo, PAYMENT_ACCOUNT_TYPES as ho, SPENDING_ACCOUNT_TYPES as wo } from "./constants/Account.es.js";
24
- import { RECURRENCE_COPY as Mo } from "./constants/ScheduledPayment.es.js";
25
- import { LOADING_STATUS as Ho } from "./constants/SpendingPlan.es.js";
26
- import { DEFAULT_DONUT_SIZE as zo, DEFAULT_STROKE_WIDTH as Vo } from "./constants/Donut.es.js";
27
- import { Sizes as Ko, TOUCH_TARGET as ko } from "./constants/Sizes.es.js";
28
- import jo from "./components/donuts/MultiSegmentDonut.es.js";
29
- import Qo from "./components/donuts/SingleSegmentDonut.es.js";
30
- import $o from "./components/ErrorBoundary.es.js";
31
- import rr from "./components/Error.es.js";
32
- import er from "./components/MicroWidgetContainer.es.js";
33
- import mr from "./components/MiniWidgetContainer.es.js";
34
- import { GlobalAccountFilter as ar } from "./components/GlobalAccountFilter.es.js";
35
- import pr from "./components/Loader.es.js";
36
- import { WidgetContainer as fr } from "./components/WidgetContainer.es.js";
37
- import Cr from "./components/ConnectWidgetPanel.es.js";
38
- import gr from "./components/ConnectDrawer.es.js";
39
- import Tr from "./components/CurrencyDialog.es.js";
40
- import dr from "./components/CurrencyInput.es.js";
41
- import _r from "./components/ResponsiveButton.es.js";
42
- import Nr from "./components/SearchBox.es.js";
43
- import Ar from "./components/SelectionBox.es.js";
44
- import Or from "./components/TabContentContainer.es.js";
45
- import Wr from "./components/IconBacking.es.js";
46
- import Lr from "./components/DataRow.es.js";
47
- import Ur from "./components/ZeroState.es.js";
48
- import Br from "./components/InformationTooltip.es.js";
49
- import { ConnectCard as wr } from "./components/ConnectCard.es.js";
50
- import { CurrencyText as Mr } from "./components/CurrencyText.es.js";
51
- import { EmptyState as Hr } from "./components/EmptyState.es.js";
52
- import { ListItemAction as zr } from "./components/ListItemAction.es.js";
53
- import { ListItemRow as Zr } from "./components/ListItemRow.es.js";
54
- import { ListItemWrapper as kr } from "./components/ListItemWrapper.es.js";
55
- import { Select as jr } from "./components/Select.es.js";
56
- import { ToggleButtonListItem as Qr } from "./components/listitems/ToggleButtonListItem.es.js";
57
- import { ToggleListItem as $r } from "./components/listitems/ToggleListItem.es.js";
58
- import { analyticsSession as rt } from "./utils/Analytics.es.js";
59
- import { getClientComponentOverrides as et, getClientCustomizations as it, getClientPaletteOptions as mt, getClientTheme as nt } from "./utils/Theme.es.js";
17
+ import { VISUALLY_HIDDEN_SX as Eo } from "./constants/Styles.es.js";
18
+ import _o from "./components/dialog/Dialog.es.js";
19
+ import No from "./components/drawer/Drawer.es.js";
20
+ import Ao from "./components/daterangeselector/DateRangeSelector.es.js";
21
+ import { ANALYTICS_EVENTS as Oo } from "./constants/Analytics.es.js";
22
+ import { CONNECTIONS_WIDGET_ID as Wo, CONNECT_WIDGET_ID as Lo, CONNECT_WIDGET_SOURCES as Go, DEEP_LINK_TYPE as Ro, MemberConnectionStatus as Uo } from "./constants/Connect.es.js";
23
+ import { GlobalStore as Bo } from "../core/stores/GlobalStore.es.js";
24
+ import { INCOME_ACCOUNT_TYPES as wo, PAYMENT_ACCOUNT_TYPES as xo, SPENDING_ACCOUNT_TYPES as Mo } from "./constants/Account.es.js";
25
+ import { RECURRENCE_COPY as Ho } from "./constants/ScheduledPayment.es.js";
26
+ import { LOADING_STATUS as Vo } from "./constants/SpendingPlan.es.js";
27
+ import { DEFAULT_DONUT_SIZE as Zo, DEFAULT_STROKE_WIDTH as Ko } from "./constants/Donut.es.js";
28
+ import { Sizes as qo, TOUCH_TARGET as Xo } from "./constants/Sizes.es.js";
29
+ import Jo from "./components/donuts/MultiSegmentDonut.es.js";
30
+ import $o from "./components/donuts/SingleSegmentDonut.es.js";
31
+ import rr from "./components/ErrorBoundary.es.js";
32
+ import er from "./components/Error.es.js";
33
+ import mr from "./components/MicroWidgetContainer.es.js";
34
+ import ar from "./components/MiniWidgetContainer.es.js";
35
+ import { GlobalAccountFilter as pr } from "./components/GlobalAccountFilter.es.js";
36
+ import ur from "./components/Loader.es.js";
37
+ import { WidgetContainer as Cr } from "./components/WidgetContainer.es.js";
38
+ import gr from "./components/ConnectWidgetPanel.es.js";
39
+ import Tr from "./components/ConnectDrawer.es.js";
40
+ import dr from "./components/CurrencyDialog.es.js";
41
+ import _r from "./components/CurrencyInput.es.js";
42
+ import Nr from "./components/ResponsiveButton.es.js";
43
+ import Ar from "./components/SearchBox.es.js";
44
+ import Or from "./components/SelectionBox.es.js";
45
+ import Wr from "./components/TabContentContainer.es.js";
46
+ import Gr from "./components/IconBacking.es.js";
47
+ import Ur from "./components/DataRow.es.js";
48
+ import Br from "./components/ZeroState.es.js";
49
+ import wr from "./components/InformationTooltip.es.js";
50
+ import { ConnectCard as Mr } from "./components/ConnectCard.es.js";
51
+ import { CurrencyText as Hr } from "./components/CurrencyText.es.js";
52
+ import { EmptyState as Vr } from "./components/EmptyState.es.js";
53
+ import { ListItemAction as Zr } from "./components/ListItemAction.es.js";
54
+ import { ListItemRow as kr } from "./components/ListItemRow.es.js";
55
+ import { ListItemWrapper as Xr } from "./components/ListItemWrapper.es.js";
56
+ import { Select as Jr } from "./components/Select.es.js";
57
+ import { ToggleButtonListItem as $r } from "./components/listitems/ToggleButtonListItem.es.js";
58
+ import { ToggleListItem as rt } from "./components/listitems/ToggleListItem.es.js";
59
+ import { analyticsSession as et } from "./utils/Analytics.es.js";
60
+ import { getClientComponentOverrides as mt, getClientCustomizations as nt, getClientPaletteOptions as at, getClientTheme as st } from "./utils/Theme.es.js";
60
61
  export {
61
- Ao as ANALYTICS_EVENTS,
62
- Oo as CONNECTIONS_WIDGET_ID,
63
- bo as CONNECT_WIDGET_ID,
64
- Wo as CONNECT_WIDGET_SOURCES,
62
+ Oo as ANALYTICS_EVENTS,
63
+ Wo as CONNECTIONS_WIDGET_ID,
64
+ Lo as CONNECT_WIDGET_ID,
65
+ Go as CONNECT_WIDGET_SOURCES,
65
66
  i as Calendar,
66
67
  m as CalendarSelectionTypes,
67
- wr as ConnectCard,
68
- gr as ConnectDrawer,
69
- Cr as ConnectWidgetPanel,
70
- Tr as CurrencyDialog,
71
- dr as CurrencyInput,
72
- Mr as CurrencyText,
73
- Go as DEEP_LINK_TYPE,
74
- zo as DEFAULT_DONUT_SIZE,
75
- Vo as DEFAULT_STROKE_WIDTH,
76
- Lr as DataRow,
77
- No as DateRangeSelector,
78
- Eo as Dialog,
68
+ Mr as ConnectCard,
69
+ Tr as ConnectDrawer,
70
+ gr as ConnectWidgetPanel,
71
+ dr as CurrencyDialog,
72
+ _r as CurrencyInput,
73
+ Hr as CurrencyText,
74
+ Ro as DEEP_LINK_TYPE,
75
+ Zo as DEFAULT_DONUT_SIZE,
76
+ Ko as DEFAULT_STROKE_WIDTH,
77
+ Ur as DataRow,
78
+ Ao as DateRangeSelector,
79
+ _o as Dialog,
79
80
  p as Donut,
80
- _o as Drawer,
81
- Hr as EmptyState,
82
- rr as Error,
83
- $o as ErrorBoundary,
84
- ar as GlobalAccountFilter,
81
+ No as Drawer,
82
+ Vr as EmptyState,
83
+ er as Error,
84
+ rr as ErrorBoundary,
85
+ pr as GlobalAccountFilter,
85
86
  c as GlobalDataContext,
86
87
  T as GlobalDataProvider,
87
- Uo as GlobalStore,
88
- Bo as INCOME_ACCOUNT_TYPES,
89
- Wr as IconBacking,
90
- Br as InformationTooltip,
91
- Ho as LOADING_STATUS,
92
- zr as ListItemAction,
93
- Zr as ListItemRow,
94
- kr as ListItemWrapper,
95
- pr as Loader,
96
- Lo as MemberConnectionStatus,
97
- er as MicroWidgetContainer,
98
- mr as MiniWidgetContainer,
99
- jo as MultiSegmentDonut,
100
- ho as PAYMENT_ACCOUNT_TYPES,
101
- Mo as RECURRENCE_COPY,
102
- _r as ResponsiveButton,
103
- wo as SPENDING_ACCOUNT_TYPES,
104
- Nr as SearchBox,
105
- jr as Select,
106
- Ar as SelectionBox,
107
- Qo as SingleSegmentDonut,
108
- Ko as Sizes,
88
+ Bo as GlobalStore,
89
+ wo as INCOME_ACCOUNT_TYPES,
90
+ Gr as IconBacking,
91
+ wr as InformationTooltip,
92
+ Vo as LOADING_STATUS,
93
+ Zr as ListItemAction,
94
+ kr as ListItemRow,
95
+ Xr as ListItemWrapper,
96
+ ur as Loader,
97
+ Uo as MemberConnectionStatus,
98
+ mr as MicroWidgetContainer,
99
+ ar as MiniWidgetContainer,
100
+ Jo as MultiSegmentDonut,
101
+ xo as PAYMENT_ACCOUNT_TYPES,
102
+ Ho as RECURRENCE_COPY,
103
+ Nr as ResponsiveButton,
104
+ Mo as SPENDING_ACCOUNT_TYPES,
105
+ Ar as SearchBox,
106
+ Jr as Select,
107
+ Or as SelectionBox,
108
+ $o as SingleSegmentDonut,
109
+ qo as Sizes,
109
110
  a as StatusBar,
110
- ko as TOUCH_TARGET,
111
- Or as TabContentContainer,
112
- Qr as ToggleButtonListItem,
113
- $r as ToggleListItem,
114
- fr as WidgetContainer,
111
+ Xo as TOUCH_TARGET,
112
+ Wr as TabContentContainer,
113
+ $r as ToggleButtonListItem,
114
+ rt as ToggleListItem,
115
+ Eo as VISUALLY_HIDDEN_SX,
116
+ Cr as WidgetContainer,
115
117
  d as WidgetContainerContext,
116
118
  D as WidgetContainerProvider,
117
- Ur as ZeroState,
118
- rt as analyticsSession,
119
+ Br as ZeroState,
120
+ et as analyticsSession,
119
121
  r as buildDynamicCopy,
120
122
  t as buildPluralCopy,
121
123
  mo as formatCurrency,
122
124
  no as formatOrdinal,
123
125
  ao as formatPercentage,
124
126
  so as generateEqualIntervals,
125
- et as getClientComponentOverrides,
126
- it as getClientCustomizations,
127
- mt as getClientPaletteOptions,
128
- nt as getClientTheme,
127
+ mt as getClientComponentOverrides,
128
+ nt as getClientCustomizations,
129
+ at as getClientPaletteOptions,
130
+ st as getClientTheme,
129
131
  po as getCurrencyCodes,
130
- uo as getPluralRules,
131
- f as useAccountDisplayName,
132
+ fo as getPluralRules,
133
+ u as useAccountDisplayName,
132
134
  I as useAccountStore,
133
135
  N as useActionContext,
134
136
  P as useAgreementStore,
@@ -139,8 +141,8 @@ export {
139
141
  C as useCombineEvents,
140
142
  S as useCombinePageviews,
141
143
  W as useDebtStore,
142
- G as useError,
143
- L as useEvent,
144
+ L as useError,
145
+ G as useEvent,
144
146
  R as useFinstrongStore,
145
147
  U as useGlobalCopyStore,
146
148
  v as useGlobalStore,
@@ -153,8 +155,8 @@ export {
153
155
  Y as useInsightsV2Store,
154
156
  H as useLoad,
155
157
  F as useMerchantStore,
156
- z as useNetWorthStore,
157
- V as useNotificationStore,
158
+ V as useNetWorthStore,
159
+ z as useNotificationStore,
158
160
  Z as usePageView,
159
161
  eo as usePrevious,
160
162
  K as useRecurringTransactionsStore,
@@ -162,9 +164,9 @@ export {
162
164
  ro as useScreenSize,
163
165
  k as useSettingsStore,
164
166
  q as useTransactionStore,
165
- j as useTrendsStore,
166
- J as useUserStore,
167
- Q as useWidgetContainerProvider,
167
+ X as useTrendsStore,
168
+ j as useUserStore,
169
+ J as useWidgetContainerProvider,
168
170
  So as useWidgetHeaderStyles,
169
171
  co as useWidgetLoadTimer
170
172
  };
@@ -31,10 +31,15 @@ export declare class TrendsStore {
31
31
  get visibleCategories(): DetailedCategoryWithTransactions[];
32
32
  get collapsedCategories(): DetailedCategoryWithTransactions[];
33
33
  get categoryDetailsChartData(): {
34
+ average: number;
34
35
  monthlyAmounts: {
35
36
  x: string;
36
37
  y: number;
37
38
  }[];
39
+ monthlyTotals: {
40
+ label: string;
41
+ amount: number;
42
+ }[];
38
43
  tooltipLabels: {
39
44
  label: string;
40
45
  amount: number;
@@ -1,3 +1,4 @@
1
+ import { formatDate } from '../constants';
1
2
  export declare const getNextWeeklyDate: (date: Date) => Date;
2
3
  export declare const getNextBiWeeklyDate: (date: Date) => Date;
3
4
  export declare const getTwiceMonthlyDates: (day1: number, day2: number) => Date[];
@@ -14,3 +15,4 @@ export declare const endOfUtcDay: (date: Date) => number;
14
15
  export declare const fromUnixToDayOfWeekAndDate: (date: number) => string;
15
16
  export declare const fromUnixUTCToDayOfWeekAndDate: (date: number) => string;
16
17
  export declare const fromTimestampToMonthYear: (timestamp?: number) => string;
18
+ export declare const formatIsoDate: (isoDate: string, dFormat: Parameters<typeof formatDate>[1]) => string;
@@ -1,37 +1,38 @@
1
- import { DATE_FORMATS_INTL as s, formatDate as T } from "../constants/DateFormats.es.js";
1
+ import { DATE_FORMATS_INTL as T, formatDate as g } from "../constants/DateFormats.es.js";
2
2
  import { addMonths as i } from "date-fns/addMonths";
3
3
  import { endOfMonth as h } from "date-fns/endOfMonth";
4
4
  import { isBefore as n } from "date-fns/isBefore";
5
5
  import { startOfToday as a } from "date-fns/startOfToday";
6
- import { addYears as M } from "date-fns/addYears";
7
- import { addQuarters as g } from "date-fns/addQuarters";
6
+ import { addYears as v } from "date-fns/addYears";
7
+ import { addQuarters as s } from "date-fns/addQuarters";
8
8
  import { addWeeks as y } from "date-fns/addWeeks";
9
9
  import { fromUnixTime as x } from "date-fns/fromUnixTime";
10
- import { nextDay as v } from "date-fns/nextDay";
10
+ import { nextDay as M } from "date-fns/nextDay";
11
+ import { parseISO as U } from "date-fns/parseISO";
11
12
  import { setDate as u } from "date-fns/setDate";
12
- import { getDay as U } from "date-fns/getDay";
13
- var B = (t) => {
14
- const e = U(t);
15
- let r = v(t, e);
13
+ import { getDay as p } from "date-fns/getDay";
14
+ var I = (t) => {
15
+ const e = p(t);
16
+ let r = M(t, e);
16
17
  for (; n(r, a()); ) r = y(r, 1);
17
18
  return r;
18
- }, H = (t) => {
19
+ }, Q = (t) => {
19
20
  let e = t;
20
21
  for (; n(e, a()); ) e = y(e, 2);
21
22
  return e;
22
23
  }, c = (t, e) => {
23
- const r = a(), [o, l] = [t, e].sort((m, f) => m - f), D = (m, f) => f >= 28 ? h(m) : u(m, f);
24
+ const r = a(), [o, m] = [t, e].sort((f, l) => f - l), D = (f, l) => l >= 28 ? h(f) : u(f, l);
24
25
  return [
25
26
  D(r, o),
26
- D(r, l),
27
+ D(r, m),
27
28
  D(i(r, 1), o),
28
- D(i(r, 1), l),
29
+ D(i(r, 1), m),
29
30
  D(i(r, 2), o),
30
- D(i(r, 2), l)
31
+ D(i(r, 2), m)
31
32
  ];
32
- }, Q = (t, e) => {
33
+ }, S = (t, e) => {
33
34
  const r = a(), o = c(t, e);
34
- return o.find((l) => !n(l, r)) ?? o[o.length - 1];
35
+ return o.find((m) => !n(m, r)) ?? o[o.length - 1];
35
36
  }, K = (t) => {
36
37
  let e = u(a(), t.getDate());
37
38
  for (; n(e, a()); ) e = i(e, 1);
@@ -40,35 +41,36 @@ var B = (t) => {
40
41
  let e = t;
41
42
  for (; n(e, a()); ) e = i(e, 2);
42
43
  return e;
43
- }, S = (t) => {
44
- let e = g(t, 1);
45
- for (; n(e, a()); ) e = g(e, 1);
44
+ }, L = (t) => {
45
+ let e = s(t, 1);
46
+ for (; n(e, a()); ) e = s(e, 1);
46
47
  return e;
47
- }, I = (t) => {
48
+ }, b = (t) => {
48
49
  let e = t;
49
- for (; n(e, a()); ) e = g(e, 2);
50
+ for (; n(e, a()); ) e = s(e, 2);
50
51
  return e;
51
- }, L = (t) => M(t, 1), p = (t) => {
52
+ }, j = (t) => v(t, 1), O = (t) => {
52
53
  const e = x(t);
53
54
  return new Date(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate());
54
- }, b = (t) => Math.floor(Date.UTC(t.getFullYear(), t.getMonth(), t.getDate(), t.getHours(), t.getMinutes(), t.getSeconds()) / 1e3), j = (t) => Date.UTC(t.getFullYear(), t.getMonth(), t.getDate()) / 1e3, q = (t) => Date.UTC(t.getFullYear(), t.getMonth(), t.getDate(), 23, 59, 59) / 1e3, z = (t) => T(x(t), s.DAY_OF_WEEK_MONTH_DAY), G = (t) => T(p(t), s.DAY_OF_WEEK_MONTH_DAY), J = (t) => t ? T(x(t), s.MONTH_YEAR) : "";
55
+ }, q = (t) => Math.floor(Date.UTC(t.getFullYear(), t.getMonth(), t.getDate(), t.getHours(), t.getMinutes(), t.getSeconds()) / 1e3), z = (t) => Date.UTC(t.getFullYear(), t.getMonth(), t.getDate()) / 1e3, G = (t) => Date.UTC(t.getFullYear(), t.getMonth(), t.getDate(), 23, 59, 59) / 1e3, J = (t) => g(x(t), T.DAY_OF_WEEK_MONTH_DAY), P = (t) => g(O(t), T.DAY_OF_WEEK_MONTH_DAY), V = (t) => t ? g(x(t), T.MONTH_YEAR) : "", X = (t, e) => g(U(t), e);
55
56
  export {
56
- q as endOfUtcDay,
57
- J as fromTimestampToMonthYear,
58
- z as fromUnixToDayOfWeekAndDate,
59
- p as fromUnixUTC,
60
- G as fromUnixUTCToDayOfWeekAndDate,
57
+ G as endOfUtcDay,
58
+ X as formatIsoDate,
59
+ V as fromTimestampToMonthYear,
60
+ J as fromUnixToDayOfWeekAndDate,
61
+ O as fromUnixUTC,
62
+ P as fromUnixUTCToDayOfWeekAndDate,
61
63
  R as getNextBiMonthlyDate,
62
- I as getNextBiQuarterlyDate,
63
- H as getNextBiWeeklyDate,
64
+ b as getNextBiQuarterlyDate,
65
+ Q as getNextBiWeeklyDate,
64
66
  K as getNextMonthlyDate,
65
- S as getNextQuarterlyDate,
66
- Q as getNextTwiceMonthlyDate,
67
- B as getNextWeeklyDate,
68
- L as getNextYearlyDate,
67
+ L as getNextQuarterlyDate,
68
+ S as getNextTwiceMonthlyDate,
69
+ I as getNextWeeklyDate,
70
+ j as getNextYearlyDate,
69
71
  c as getTwiceMonthlyDates,
70
- j as startOfUtcDay,
71
- b as toUnixUTC
72
+ z as startOfUtcDay,
73
+ q as toUnixUTC
72
74
  };
73
75
 
74
76
  //# sourceMappingURL=DateUtil.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateUtil.es.js","names":[],"sources":["../../../src/core/utils/DateUtil.ts"],"sourcesContent":["import { addMonths } from 'date-fns/addMonths'\nimport { addQuarters } from 'date-fns/addQuarters'\nimport { addWeeks } from 'date-fns/addWeeks'\nimport { addYears } from 'date-fns/addYears'\nimport { endOfMonth } from 'date-fns/endOfMonth'\nimport { getDay } from 'date-fns/getDay'\nimport { isBefore } from 'date-fns/isBefore'\nimport { nextDay } from 'date-fns/nextDay'\nimport { setDate } from 'date-fns/setDate'\nimport { startOfToday } from 'date-fns/startOfToday'\nimport { fromUnixTime } from 'date-fns/fromUnixTime'\nimport { type Day } from 'date-fns'\n\nimport { DATE_FORMATS_INTL, formatDate } from '../constants'\n\nexport const getNextWeeklyDate = (date: Date): Date => {\n const dayOfWeek = getDay(date)\n let nextDate = nextDay(date, dayOfWeek as Day)\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addWeeks(nextDate, 1)\n }\n return nextDate\n}\n\nexport const getNextBiWeeklyDate = (date: Date): Date => {\n let nextDate = date\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addWeeks(nextDate, 2)\n }\n return nextDate\n}\n\nexport const getTwiceMonthlyDates = (day1: number, day2: number): Date[] => {\n const today = startOfToday()\n const [firstDay, secondDay] = [day1, day2].sort((a, b) => a - b)\n const makeDateForDay = (month: Date, day: number) =>\n day >= 28 ? endOfMonth(month) : setDate(month, day)\n\n return [\n makeDateForDay(today, firstDay),\n makeDateForDay(today, secondDay),\n makeDateForDay(addMonths(today, 1), firstDay),\n makeDateForDay(addMonths(today, 1), secondDay),\n makeDateForDay(addMonths(today, 2), firstDay),\n makeDateForDay(addMonths(today, 2), secondDay),\n ]\n}\n\nexport const getNextTwiceMonthlyDate = (day1: number, day2: number): Date => {\n const today = startOfToday()\n const candidates = getTwiceMonthlyDates(day1, day2)\n return candidates.find((c) => !isBefore(c, today)) ?? candidates[candidates.length - 1]\n}\n\nexport const getNextMonthlyDate = (date: Date): Date => {\n let nextDate = setDate(startOfToday(), date.getDate())\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addMonths(nextDate, 1)\n }\n return nextDate\n}\n\nexport const getNextBiMonthlyDate = (date: Date): Date => {\n let nextDate = date\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addMonths(nextDate, 2)\n }\n return nextDate\n}\n\nexport const getNextQuarterlyDate = (date: Date): Date => {\n let nextDate = addQuarters(date, 1)\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addQuarters(nextDate, 1)\n }\n return nextDate\n}\n\nexport const getNextBiQuarterlyDate = (date: Date): Date => {\n let nextDate = date\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addQuarters(nextDate, 2)\n }\n return nextDate\n}\n\nexport const getNextYearlyDate = (date: Date): Date => {\n return addYears(date, 1)\n}\n\nexport const fromUnixUTC = (utcTime: number) => {\n const date = fromUnixTime(utcTime)\n return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate())\n}\n\n// Inverse of fromUnixUTC: emits unix seconds for the Date's wall-clock time read\n// at UTC, so a local-midnight boundary serializes to UTC midnight instead of\n// being shifted by the viewer's timezone offset.\nexport const toUnixUTC = (date: Date) =>\n Math.floor(\n Date.UTC(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n ) / 1000,\n )\n\n// Unix-second bounds of the Date's calendar day read as a UTC day. Ignores the\n// wall-clock time, so a DST zone whose local midnight does not exist (startOfDay\n// returns 01:00) still yields the UTC-midnight bound. (MEW-4191)\nexport const startOfUtcDay = (date: Date) =>\n Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) / 1000\n\nexport const endOfUtcDay = (date: Date) =>\n Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59) / 1000\n\nexport const fromUnixToDayOfWeekAndDate = (date: number) =>\n formatDate(fromUnixTime(date), DATE_FORMATS_INTL.DAY_OF_WEEK_MONTH_DAY)\n\n// UTC variant for post dates, which are absolute calendar dates that must not\n// shift across the day boundary when localized.\nexport const fromUnixUTCToDayOfWeekAndDate = (date: number) =>\n formatDate(fromUnixUTC(date), DATE_FORMATS_INTL.DAY_OF_WEEK_MONTH_DAY)\n\nexport const fromTimestampToMonthYear = (timestamp?: number) =>\n timestamp ? formatDate(fromUnixTime(timestamp), DATE_FORMATS_INTL.MONTH_YEAR) : ''\n"],"mappings":";;;;;;;;;;;;AAeA,IAAa,IAAA,CAAqB,MAAqB;AACrD,QAAM,IAAY,EAAO,CAAI;AAC7B,MAAI,IAAW,EAAQ,GAAM,CAAgB;AAC7C,SAAO,EAAS,GAAU,EAAa,CAAC,IACtC,CAAA,IAAW,EAAS,GAAU,CAAC;AAEjC,SAAO;AACT,GAEa,IAAA,CAAuB,MAAqB;AACvD,MAAI,IAAW;AACf,SAAO,EAAS,GAAU,EAAa,CAAC,IACtC,CAAA,IAAW,EAAS,GAAU,CAAC;AAEjC,SAAO;AACT,GAEa,IAAA,CAAwB,GAAc,MAAyB;AAC1E,QAAM,IAAQ,EAAa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AEpC,SAAO;AACT,GAEa,IAAA,CAAqB,MACzB,EAAS,GAAM,CAAC,GAGZ,IAAA,CAAe,MAAoB;AAC9C,QAAM,IAAO,EAAa,CAAO;AACjC,SAAO,IAAI,KAAK,EAAK,eAAe,GAAG,EAAK,YAAY,GAAG,EAAK,WAAW,CAAC;AAC9E,GAKa,IAAA,CAAa,MACxB,KAAK,MACH,KAAK,IACH,EAAK,YAAY,GACjB,EAAK,SAAS,GACd,EAAK,QAAQ,GACb,EAAK,SAAS,GACd,EAAK,WAAW,GAChB,EAAK,WAAW,CAClB,IAAI,GACN,GAKW,IAAA,CAAiB,MAC5B,KAAK,IAAI,EAAK,YAAY,GAAG,EAAK,SAAS,GAAG,EAAK,QAAQ,CAAC,IAAI,KAErD,IAAA,CAAe,MAC1B,KAAK,IAAI,EAAK,YAAY,GAAG,EAAK,SAAS,GAAG,EAAK,QAAQ,GAAG,IAAI,IAAI,EAAE,IAAI,KAEjE,IAAA,CAA8B,MACzC,EAAW,EAAa,CAAI,GAAG,EAAkB,qBAAqB,GAI3D,IAAA,CAAiC,MAC5C,EAAW,EAAY,CAAI,GAAG,EAAkB,qBAAqB,GAE1D,IAAA,CAA4B,MACvC,IAAY,EAAW,EAAa,CAAS,GAAG,EAAkB,UAAU,IAAI"}
1
+ {"version":3,"file":"DateUtil.es.js","names":[],"sources":["../../../src/core/utils/DateUtil.ts"],"sourcesContent":["import { addMonths } from 'date-fns/addMonths'\nimport { addQuarters } from 'date-fns/addQuarters'\nimport { addWeeks } from 'date-fns/addWeeks'\nimport { addYears } from 'date-fns/addYears'\nimport { endOfMonth } from 'date-fns/endOfMonth'\nimport { getDay } from 'date-fns/getDay'\nimport { isBefore } from 'date-fns/isBefore'\nimport { nextDay } from 'date-fns/nextDay'\nimport { setDate } from 'date-fns/setDate'\nimport { startOfToday } from 'date-fns/startOfToday'\nimport { fromUnixTime } from 'date-fns/fromUnixTime'\nimport { parseISO } from 'date-fns/parseISO'\nimport { type Day } from 'date-fns'\n\nimport { DATE_FORMATS_INTL, formatDate } from '../constants'\n\nexport const getNextWeeklyDate = (date: Date): Date => {\n const dayOfWeek = getDay(date)\n let nextDate = nextDay(date, dayOfWeek as Day)\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addWeeks(nextDate, 1)\n }\n return nextDate\n}\n\nexport const getNextBiWeeklyDate = (date: Date): Date => {\n let nextDate = date\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addWeeks(nextDate, 2)\n }\n return nextDate\n}\n\nexport const getTwiceMonthlyDates = (day1: number, day2: number): Date[] => {\n const today = startOfToday()\n const [firstDay, secondDay] = [day1, day2].sort((a, b) => a - b)\n const makeDateForDay = (month: Date, day: number) =>\n day >= 28 ? endOfMonth(month) : setDate(month, day)\n\n return [\n makeDateForDay(today, firstDay),\n makeDateForDay(today, secondDay),\n makeDateForDay(addMonths(today, 1), firstDay),\n makeDateForDay(addMonths(today, 1), secondDay),\n makeDateForDay(addMonths(today, 2), firstDay),\n makeDateForDay(addMonths(today, 2), secondDay),\n ]\n}\n\nexport const getNextTwiceMonthlyDate = (day1: number, day2: number): Date => {\n const today = startOfToday()\n const candidates = getTwiceMonthlyDates(day1, day2)\n return candidates.find((c) => !isBefore(c, today)) ?? candidates[candidates.length - 1]\n}\n\nexport const getNextMonthlyDate = (date: Date): Date => {\n let nextDate = setDate(startOfToday(), date.getDate())\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addMonths(nextDate, 1)\n }\n return nextDate\n}\n\nexport const getNextBiMonthlyDate = (date: Date): Date => {\n let nextDate = date\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addMonths(nextDate, 2)\n }\n return nextDate\n}\n\nexport const getNextQuarterlyDate = (date: Date): Date => {\n let nextDate = addQuarters(date, 1)\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addQuarters(nextDate, 1)\n }\n return nextDate\n}\n\nexport const getNextBiQuarterlyDate = (date: Date): Date => {\n let nextDate = date\n while (isBefore(nextDate, startOfToday())) {\n nextDate = addQuarters(nextDate, 2)\n }\n return nextDate\n}\n\nexport const getNextYearlyDate = (date: Date): Date => {\n return addYears(date, 1)\n}\n\nexport const fromUnixUTC = (utcTime: number) => {\n const date = fromUnixTime(utcTime)\n return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate())\n}\n\n// Inverse of fromUnixUTC: emits unix seconds for the Date's wall-clock time read\n// at UTC, so a local-midnight boundary serializes to UTC midnight instead of\n// being shifted by the viewer's timezone offset.\nexport const toUnixUTC = (date: Date) =>\n Math.floor(\n Date.UTC(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n ) / 1000,\n )\n\n// Unix-second bounds of the Date's calendar day read as a UTC day. Ignores the\n// wall-clock time, so a DST zone whose local midnight does not exist (startOfDay\n// returns 01:00) still yields the UTC-midnight bound. (MEW-4191)\nexport const startOfUtcDay = (date: Date) =>\n Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) / 1000\n\nexport const endOfUtcDay = (date: Date) =>\n Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59) / 1000\n\nexport const fromUnixToDayOfWeekAndDate = (date: number) =>\n formatDate(fromUnixTime(date), DATE_FORMATS_INTL.DAY_OF_WEEK_MONTH_DAY)\n\n// UTC variant for post dates, which are absolute calendar dates that must not\n// shift across the day boundary when localized.\nexport const fromUnixUTCToDayOfWeekAndDate = (date: number) =>\n formatDate(fromUnixUTC(date), DATE_FORMATS_INTL.DAY_OF_WEEK_MONTH_DAY)\n\nexport const fromTimestampToMonthYear = (timestamp?: number) =>\n timestamp ? formatDate(fromUnixTime(timestamp), DATE_FORMATS_INTL.MONTH_YEAR) : ''\n\n// Use parseISO, not new Date(): new Date(\"2026-10-01\") is UTC midnight, which is still Sept 30\n// in US time zones, so October would be labeled September.\nexport const formatIsoDate = (isoDate: string, dFormat: Parameters<typeof formatDate>[1]) =>\n formatDate(parseISO(isoDate), dFormat)\n"],"mappings":";;;;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AS,CAAO,GAAG,CAAO"}
@@ -1,6 +1,7 @@
1
1
  import { RoundingFunction } from 'numeral';
2
2
  import { CurrencyCodes } from '../constants/Numbers';
3
3
  export declare const generateEqualIntervals: (minValue: number, maxValue: number, tickCount: number) => number[];
4
+ export declare const roundedAverage: (values: number[]) => number;
4
5
  export declare const formatCurrency: (amount: number | undefined, formatting: string, roundingFunction?: RoundingFunction) => string;
5
6
  export declare const getCurrencyCodes: () => CurrencyCodes;
6
7
  export declare const isValidNumber: (value: any) => boolean;
@@ -1,31 +1,32 @@
1
1
  import { getLocale as a } from "./Localization.es.js";
2
2
  import { CurrencyCodes as l } from "../constants/Numbers.es.js";
3
- import n from "numeral";
4
- var h = (r, e, t) => {
5
- const s = [], i = (e - r) / (t - 1);
3
+ import s from "numeral";
4
+ var g = (r, e, t) => {
5
+ const n = [], c = (e - r) / (t - 1);
6
6
  for (let o = 0; o < t; o++) {
7
- const c = r + o * i;
8
- s.push(c);
7
+ const i = r + o * c;
8
+ n.push(i);
9
9
  }
10
- return s[t - 1] = e, s.map(Math.round);
11
- }, w = (r, e, t) => a() === "fr-ca" ? n(r).format(`${e} $`, t) : n(r).format(`$${e}`, t), y = () => a() === "fr-ca" ? l.CAD : l.USD, m = (r) => r != null && r !== "" && isFinite(r), f = {
10
+ return n[t - 1] = e, n.map(Math.round);
11
+ }, v = (r) => r.length ? Math.round(r.reduce((e, t) => e + t, 0) / r.length) : 0, w = (r, e, t) => a() === "fr-ca" ? s(r).format(`${e} $`, t) : s(r).format(`$${e}`, t), y = () => a() === "fr-ca" ? l.CAD : l.USD, m = (r) => r != null && r !== "" && isFinite(r), d = {
12
12
  style: "percent",
13
13
  minimumFractionDigits: 2,
14
14
  maximumFractionDigits: 2
15
- }, $ = (r, e = f) => m(r) ? new Intl.NumberFormat(a(), e).format(Number(r)) : r, u = (r) => new Intl.PluralRules(a(), r), g = (r, e = { type: "ordinal" }, t = {
15
+ }, $ = (r, e = d) => m(r) ? new Intl.NumberFormat(a(), e).format(Number(r)) : r, f = (r) => new Intl.PluralRules(a(), r), C = (r, e = { type: "ordinal" }, t = {
16
16
  one: "st",
17
17
  two: "nd",
18
18
  few: "rd",
19
19
  other: "th"
20
- }) => `${r}${t[u(e).select(r)]}`;
20
+ }) => `${r}${t[f(e).select(r)]}`;
21
21
  export {
22
22
  w as formatCurrency,
23
- g as formatOrdinal,
23
+ C as formatOrdinal,
24
24
  $ as formatPercentage,
25
- h as generateEqualIntervals,
25
+ g as generateEqualIntervals,
26
26
  y as getCurrencyCodes,
27
- u as getPluralRules,
28
- m as isValidNumber
27
+ f as getPluralRules,
28
+ m as isValidNumber,
29
+ v as roundedAverage
29
30
  };
30
31
 
31
32
  //# sourceMappingURL=NumberFormatting.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NumberFormatting.es.js","names":[],"sources":["../../../src/core/utils/NumberFormatting.ts"],"sourcesContent":["import numeral from 'numeral'\nimport type { RoundingFunction } from 'numeral'\n\nimport { CurrencyCodes } from '../constants/Numbers'\nimport { getLocale } from './Localization'\n\nexport const generateEqualIntervals = (\n minValue: number,\n maxValue: number,\n tickCount: number,\n): number[] => {\n const ticks: number[] = []\n const range = maxValue - minValue\n const step = range / (tickCount - 1) // The space between each tick\n\n for (let i = 0; i < tickCount; i++) {\n const tickValue = minValue + i * step\n ticks.push(tickValue)\n }\n\n ticks[tickCount - 1] = maxValue\n\n return ticks.map(Math.round)\n}\n\n// enhances numeral's localization functionality by puting the $ in the correct place\nexport const formatCurrency = (\n amount: number | undefined,\n formatting: string,\n roundingFunction?: RoundingFunction,\n) => {\n switch (getLocale()) {\n case 'fr-ca': {\n return numeral(amount).format(`${formatting} $`, roundingFunction)\n }\n default: {\n return numeral(amount).format(`$${formatting}`, roundingFunction)\n }\n }\n}\n\nexport const getCurrencyCodes = () => {\n switch (getLocale()) {\n case 'fr-ca':\n return CurrencyCodes.CAD\n default:\n return CurrencyCodes.USD\n }\n}\n\n// will return `true` if value is a string number, like '99', which matches Serenity logic\nexport const isValidNumber = (value: any) =>\n value !== undefined && value !== null && value !== '' && isFinite(value)\n\nconst defaultPercentStyle = {\n style: 'percent',\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n} as Intl.NumberFormatOptions\n\nexport const formatPercentage = (\n amount: number | string | undefined,\n options: Intl.NumberFormatOptions = defaultPercentStyle,\n) =>\n isValidNumber(amount)\n ? new Intl.NumberFormat(getLocale(), options).format(Number(amount))\n : amount\n\nexport const getPluralRules = (options: Intl.PluralRulesOptions) =>\n new Intl.PluralRules(getLocale(), options)\n\nexport const formatOrdinal = (\n number: number,\n options: Intl.PluralRulesOptions = { type: 'ordinal' },\n copy = {\n one: 'st',\n two: 'nd',\n few: 'rd',\n other: 'th',\n } as const,\n) => {\n const rule = getPluralRules(options).select(number)\n\n return `${number}${copy[rule as keyof typeof copy]}`\n}\n"],"mappings":";;;AAMA,IAAa,IAAA,CACX,GACA,GACA,MACa;AACb,QAAM,IAAkB,CAAC,GAEnB,KADQ,IAAW,MACH,IAAY;AAElC,WAAS,IAAI,GAAG,IAAI,GAAW,KAAK;AAClC,UAAM,IAAY,IAAW,IAAI;AACjC,IAAA,EAAM,KAAK,CAAS;AAAA,EACtB;AAEA,SAAA,EAAM,IAAY,CAAA,IAAK,GAEhB,EAAM,IAAI,KAAK,KAAK;AAC7B,GAGa,IAAA,CACX,GACA,GACA,MAEQ,EAAU,MACX,UACI,EAAQ,CAAM,EAAE,OAAO,GAAG,CAAA,MAAgB,CAAgB,IAG1D,EAAQ,CAAM,EAAE,OAAO,IAAI,CAAA,IAAc,CAAgB,GAKzD,IAAA,MACH,EAAU,MACX,UACI,EAAc,MAEd,EAAc,KAKd,IAAA,CAAiB,MACL,KAAU,QAAQ,MAAU,MAAM,SAAS,CAAK,GAEnE,IAAsB;AAAA,EAC1B,OAAO;AAAA,EACP,uBAAuB;AAAA,EACvB,uBAAuB;AACzB,GAEa,IAAA,CACX,GACA,IAAoC,MAEpC,EAAc,CAAM,IAChB,IAAI,KAAK,aAAa,EAAU,GAAG,CAAO,EAAE,OAAO,OAAO,CAAM,CAAC,IACjE,GAEO,IAAA,CAAkB,MAC7B,IAAI,KAAK,YAAY,EAAU,GAAG,CAAO,GAE9B,IAAA,CACX,GACA,IAAmC,EAAE,MAAM,UAAU,GACrD,IAAO;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,OAAO;AACT,MAIO,GAAG,CAAA,GAAS,EAFN,EAAe,CAAO,EAAE,OAAO,CAEpB,CAAA,CAAA"}
1
+ {"version":3,"file":"NumberFormatting.es.js","names":[],"sources":["../../../src/core/utils/NumberFormatting.ts"],"sourcesContent":["import numeral from 'numeral'\nimport type { RoundingFunction } from 'numeral'\n\nimport { CurrencyCodes } from '../constants/Numbers'\nimport { getLocale } from './Localization'\n\nexport const generateEqualIntervals = (\n minValue: number,\n maxValue: number,\n tickCount: number,\n): number[] => {\n const ticks: number[] = []\n const range = maxValue - minValue\n const step = range / (tickCount - 1) // The space between each tick\n\n for (let i = 0; i < tickCount; i++) {\n const tickValue = minValue + i * step\n ticks.push(tickValue)\n }\n\n ticks[tickCount - 1] = maxValue\n\n return ticks.map(Math.round)\n}\n\nexport const roundedAverage = (values: number[]) =>\n values.length ? Math.round(values.reduce((sum, value) => sum + value, 0) / values.length) : 0\n\n// enhances numeral's localization functionality by puting the $ in the correct place\nexport const formatCurrency = (\n amount: number | undefined,\n formatting: string,\n roundingFunction?: RoundingFunction,\n) => {\n switch (getLocale()) {\n case 'fr-ca': {\n return numeral(amount).format(`${formatting} $`, roundingFunction)\n }\n default: {\n return numeral(amount).format(`$${formatting}`, roundingFunction)\n }\n }\n}\n\nexport const getCurrencyCodes = () => {\n switch (getLocale()) {\n case 'fr-ca':\n return CurrencyCodes.CAD\n default:\n return CurrencyCodes.USD\n }\n}\n\n// will return `true` if value is a string number, like '99', which matches Serenity logic\nexport const isValidNumber = (value: any) =>\n value !== undefined && value !== null && value !== '' && isFinite(value)\n\nconst defaultPercentStyle = {\n style: 'percent',\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n} as Intl.NumberFormatOptions\n\nexport const formatPercentage = (\n amount: number | string | undefined,\n options: Intl.NumberFormatOptions = defaultPercentStyle,\n) =>\n isValidNumber(amount)\n ? new Intl.NumberFormat(getLocale(), options).format(Number(amount))\n : amount\n\nexport const getPluralRules = (options: Intl.PluralRulesOptions) =>\n new Intl.PluralRules(getLocale(), options)\n\nexport const formatOrdinal = (\n number: number,\n options: Intl.PluralRulesOptions = { type: 'ordinal' },\n copy = {\n one: 'st',\n two: 'nd',\n few: 'rd',\n other: 'th',\n } as const,\n) => {\n const rule = getPluralRules(options).select(number)\n\n return `${number}${copy[rule as keyof typeof copy]}`\n}\n"],"mappings":";;;AAMA,IAAa,IAAA,CACX,GACA,GACA,MACa;AACb,QAAM,IAAkB,CAAC,GAEnB,KADQ,IAAW,MACH,IAAY;AAElC,WAAS,IAAI,GAAG,IAAI,GAAW,KAAK;AAClC,UAAM,IAAY,IAAW,IAAI;AACjC,IAAA,EAAM,KAAK,CAAS;AAAA,EACtB;AAEA,SAAA,EAAM,IAAY,CAAA,IAAK,GAEhB,EAAM,IAAI,KAAK,KAAK;AAC7B,GAEa,IAAA,CAAkB,MAC7B,EAAO,SAAS,KAAK,MAAM,EAAO,OAAA,CAAQ,GAAK,MAAU,IAAM,GAAO,CAAC,IAAI,EAAO,MAAM,IAAI,GAGjF,IAAA,CACX,GACA,GACA,MAEQ,EAAU,MACX,UACI,EAAQ,CAAM,EAAE,OAAO,GAAG,CAAA,MAAgB,CAAgB,IAG1D,EAAQ,CAAM,EAAE,OAAO,IAAI,CAAA,IAAc,CAAgB,GAKzD,IAAA,MACH,EAAU,MACX,UACI,EAAc,MAEd,EAAc,KAKd,IAAA,CAAiB,MACL,KAAU,QAAQ,MAAU,MAAM,SAAS,CAAK,GAEnE,IAAsB;AAAA,EAC1B,OAAO;AAAA,EACP,uBAAuB;AAAA,EACvB,uBAAuB;AACzB,GAEa,IAAA,CACX,GACA,IAAoC,MAEpC,EAAc,CAAM,IAChB,IAAI,KAAK,aAAa,EAAU,GAAG,CAAO,EAAE,OAAO,OAAO,CAAM,CAAC,IACjE,GAEO,IAAA,CAAkB,MAC7B,IAAI,KAAK,YAAY,EAAU,GAAG,CAAO,GAE9B,IAAA,CACX,GACA,IAAmC,EAAE,MAAM,UAAU,GACrD,IAAO;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,OAAO;AACT,MAIO,GAAG,CAAA,GAAS,EAFN,EAAe,CAAO,EAAE,OAAO,CAEpB,CAAA,CAAA"}
@@ -16,10 +16,15 @@ export declare const getStackedLineChartData: (totals: MonthlyCategoryTotals[],
16
16
  export declare const amountComparator: GridComparatorFn<string | number>;
17
17
  export declare const categoryComparator: GridComparatorFn<string>;
18
18
  export declare const buildCategoryDetailsChartData: (data: DetailedCategoryWithTransactions | null, monthsCount: number) => {
19
+ average: number;
19
20
  monthlyAmounts: {
20
21
  x: string;
21
22
  y: number;
22
23
  }[];
24
+ monthlyTotals: {
25
+ label: string;
26
+ amount: number;
27
+ }[];
23
28
  tooltipLabels: {
24
29
  label: string;
25
30
  amount: number;