@layerfi/components 0.1.116-alpha → 0.1.116

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -390,7 +390,7 @@ The full list of variables is listed in the [`variables.css`](https://github.com
390
390
  --text-sm: 12px;
391
391
  --text-md: 14px;
392
392
  --text-lg: 16px;
393
- --text-heading: 24px;
393
+ --text-heading: 24px; // 20px on mobile (max-width: 768px)
394
394
  --text-heading-sm: 16px;
395
395
  --font-weight-normal: 460;
396
396
  --font-weight-bold: 540;
@@ -202,7 +202,7 @@ class ErrorHandlerClass {
202
202
  }
203
203
  const errorHandler = new ErrorHandlerClass();
204
204
  const reportError = (payload) => errorHandler.onError(payload);
205
- const version = "0.1.116-alpha";
205
+ const version = "0.1.116";
206
206
  const pkg = {
207
207
  version
208
208
  };
@@ -5934,7 +5934,16 @@ const OnboardingContent = ({
5934
5934
  }
5935
5935
  ) }) });
5936
5936
  };
5937
- const DATE_FORMAT$1 = "LLL d, yyyy";
5937
+ const MONTH_FORMAT = "MMMM";
5938
+ const MONTH_FORMAT_SHORT = "MMM";
5939
+ const MONTH_FORMAT_ABBREVIATED = "LLL";
5940
+ const MONTH_FORMAT_NARROW = "LLLLL";
5941
+ const MONTH_DAY_FORMAT = "LLL d";
5942
+ const MONTH_DAY_FORMAT_SHORT = "MMM d";
5943
+ const MONTH_YEAR_FORMAT = "MMMM yyyy";
5944
+ const MONTH_YEAR_FORMAT_SHORT = "MMM yyyy";
5945
+ const MONTH_YEAR_FORMAT_FULL = "LLLL, y";
5946
+ const DATE_FORMAT = "LLL d, yyyy";
5938
5947
  const DATE_FORMAT_SHORT = "M/d/yyyy";
5939
5948
  const DATE_FORMAT_WITH_TIME_READABLE = "LLLL do, yyyy 'at' h:mm a";
5940
5949
  const TIME_FORMAT = "p";
@@ -6568,6 +6577,37 @@ function useDebounce(fn) {
6568
6577
  }, []);
6569
6578
  return debouncedCallback;
6570
6579
  }
6580
+ const useWindowSize = () => {
6581
+ const [size, setSize] = react.useState([0, 0]);
6582
+ react.useLayoutEffect(() => {
6583
+ function updateSize() {
6584
+ setSize([window.innerWidth, window.innerHeight]);
6585
+ }
6586
+ window.addEventListener("resize", updateSize);
6587
+ updateSize();
6588
+ return () => window.removeEventListener("resize", updateSize);
6589
+ }, []);
6590
+ return size;
6591
+ };
6592
+ function useSizeClass() {
6593
+ const [width] = useWindowSize();
6594
+ const sizeClass = react.useMemo(() => {
6595
+ switch (true) {
6596
+ case width <= BREAKPOINTS.MOBILE:
6597
+ return "mobile";
6598
+ case width <= BREAKPOINTS.TABLET:
6599
+ return "tablet";
6600
+ default:
6601
+ return "desktop";
6602
+ }
6603
+ }, [width]);
6604
+ return {
6605
+ value: sizeClass,
6606
+ isMobile: sizeClass === "mobile",
6607
+ isTablet: sizeClass === "tablet",
6608
+ isDesktop: sizeClass === "desktop"
6609
+ };
6610
+ }
6571
6611
  const CLASS_NAME$b = "Layer__LoadingSpinner";
6572
6612
  function LoadingSpinner({ size }) {
6573
6613
  return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LoaderCircle, { className: CLASS_NAME$b, size });
@@ -8155,7 +8195,7 @@ const DateTime = ({
8155
8195
  if (format) {
8156
8196
  return /* @__PURE__ */ jsxRuntime.jsx(Text, { className: "Layer__datetime", children: dateFns.format(dateValue, format) });
8157
8197
  }
8158
- const date2 = dateFns.format(dateValue, dateFormat != null ? dateFormat : DATE_FORMAT$1);
8198
+ const date2 = dateFns.format(dateValue, dateFormat != null ? dateFormat : DATE_FORMAT);
8159
8199
  const time = dateFns.format(dateValue, timeFormat != null ? timeFormat : TIME_FORMAT);
8160
8200
  return /* @__PURE__ */ jsxRuntime.jsxs(Text, { className: "Layer__datetime", children: [
8161
8201
  !onlyTime && /* @__PURE__ */ jsxRuntime.jsx(Span, __spreadProps(__spreadValues({}, slotProps.Date), { children: date2 })),
@@ -9179,7 +9219,7 @@ const convertCentsToCurrency = (amount) => {
9179
9219
  return void 0;
9180
9220
  }
9181
9221
  };
9182
- const formatDate = (date2, dateFormat = DATE_FORMAT$1) => {
9222
+ const formatDate = (date2, dateFormat = DATE_FORMAT) => {
9183
9223
  try {
9184
9224
  if (!date2) {
9185
9225
  return "";
@@ -11401,37 +11441,6 @@ const Header$1 = react.forwardRef(
11401
11441
  }
11402
11442
  );
11403
11443
  Header$1.displayName = "Header";
11404
- const useWindowSize = () => {
11405
- const [size, setSize] = react.useState([0, 0]);
11406
- react.useLayoutEffect(() => {
11407
- function updateSize() {
11408
- setSize([window.innerWidth, window.innerHeight]);
11409
- }
11410
- window.addEventListener("resize", updateSize);
11411
- updateSize();
11412
- return () => window.removeEventListener("resize", updateSize);
11413
- }, []);
11414
- return size;
11415
- };
11416
- function useSizeClass() {
11417
- const [width] = useWindowSize();
11418
- const sizeClass = react.useMemo(() => {
11419
- switch (true) {
11420
- case width <= BREAKPOINTS.MOBILE:
11421
- return "mobile";
11422
- case width <= BREAKPOINTS.TABLET:
11423
- return "tablet";
11424
- default:
11425
- return "desktop";
11426
- }
11427
- }, [width]);
11428
- return {
11429
- value: sizeClass,
11430
- isMobile: sizeClass === "mobile",
11431
- isTablet: sizeClass === "tablet",
11432
- isDesktop: sizeClass === "desktop"
11433
- };
11434
- }
11435
11444
  const MONTHS = [
11436
11445
  "January",
11437
11446
  "February",
@@ -11602,23 +11611,33 @@ const MonthPicker = ({
11602
11611
  date: date2,
11603
11612
  onChange,
11604
11613
  minDate = null,
11605
- maxDate = null
11614
+ maxDate = null,
11615
+ truncateMonth = false
11606
11616
  }) => {
11607
11617
  const triggerRef = react.useRef(null);
11608
11618
  const [isPopoverOpen, setPopoverOpen] = react.useState(false);
11609
- const { value } = useSizeClass();
11619
+ const { value, isMobile } = useSizeClass();
11610
11620
  const onChangeMonth = react.useCallback((val) => {
11611
11621
  onChange(val);
11612
11622
  setPopoverOpen(false);
11613
11623
  }, [onChange]);
11614
- const inputValue = dateFns.format(date2.toDate(), "MMMM yyyy");
11624
+ const inputValue = dateFns.format(date2.toDate(), truncateMonth ? MONTH_YEAR_FORMAT_SHORT : MONTH_YEAR_FORMAT);
11615
11625
  const additionalAriaProps = !showLabel && { "aria-label": label };
11616
11626
  return /* @__PURE__ */ jsxRuntime.jsxs(reactAriaComponents.DialogTrigger, { isOpen: isPopoverOpen, onOpenChange: setPopoverOpen, children: [
11617
11627
  showLabel && /* @__PURE__ */ jsxRuntime.jsx(Label, { children: label }),
11618
- /* @__PURE__ */ jsxRuntime.jsxs(InputGroup$1, { ref: triggerRef, slot: "input", className: "Layer__MonthPicker__InputGroup", onClick: () => setPopoverOpen(true), children: [
11619
- /* @__PURE__ */ jsxRuntime.jsx(Input$1, __spreadProps(__spreadValues({ inset: true }, additionalAriaProps), { value: inputValue, readOnly: true })),
11620
- /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "3xs", align: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { icon: true, inset: true, variant: "ghost", children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { size: 20 }) }) })
11621
- ] }),
11628
+ /* @__PURE__ */ jsxRuntime.jsxs(
11629
+ InputGroup$1,
11630
+ {
11631
+ ref: triggerRef,
11632
+ slot: "input",
11633
+ className: classNames("Layer__MonthPicker__InputGroup", { "Layer__MonthPicker__InputGroup--mobile": isMobile }),
11634
+ onClick: () => setPopoverOpen(true),
11635
+ children: [
11636
+ /* @__PURE__ */ jsxRuntime.jsx(Input$1, __spreadProps(__spreadValues({ inset: true }, additionalAriaProps), { value: inputValue, readOnly: true })),
11637
+ /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "3xs", align: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { icon: true, inset: true, variant: "ghost", children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { size: 20 }) }) })
11638
+ ]
11639
+ }
11640
+ ),
11622
11641
  /* @__PURE__ */ jsxRuntime.jsx(ResponsivePopover, { triggerRef, children: /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Dialog, { children: /* @__PURE__ */ jsxRuntime.jsx(
11623
11642
  MonthCalendar,
11624
11643
  {
@@ -11839,6 +11858,7 @@ const BankTransactionsHeader = ({
11839
11858
  filters,
11840
11859
  dateFilterMode
11841
11860
  } = useBankTransactionsFiltersContext();
11861
+ const { value: sizeClass } = useSizeClass();
11842
11862
  const withDatePicker = dateFilterMode === BankTransactionsDateFilterMode.MonthlyView;
11843
11863
  const monthPickerDate = (filters == null ? void 0 : filters.dateRange) ? convertDateToZonedDateTime(filters.dateRange.startDate) : null;
11844
11864
  const setDateRange = react.useCallback((newMonth) => {
@@ -11879,7 +11899,8 @@ const BankTransactionsHeader = ({
11879
11899
  date: monthPickerDate,
11880
11900
  onChange: setDateRange,
11881
11901
  minDate: activationDate ? convertDateToZonedDateTime(activationDate) : null,
11882
- maxDate: convertDateToZonedDateTime(/* @__PURE__ */ new Date())
11902
+ maxDate: convertDateToZonedDateTime(/* @__PURE__ */ new Date()),
11903
+ truncateMonth: sizeClass === "mobile"
11883
11904
  }
11884
11905
  )
11885
11906
  ] }), [
@@ -11890,7 +11911,8 @@ const BankTransactionsHeader = ({
11890
11911
  monthPickerDate,
11891
11912
  setDateRange,
11892
11913
  stringOverrides == null ? void 0 : stringOverrides.header,
11893
- withDatePicker
11914
+ withDatePicker,
11915
+ sizeClass
11894
11916
  ]);
11895
11917
  const onCategorizationDisplayChange = (value) => {
11896
11918
  setFilters({
@@ -15495,7 +15517,7 @@ const Trash = (_Lb) => {
15495
15517
  };
15496
15518
  const readDate = (date2) => {
15497
15519
  if (!date2) return void 0;
15498
- return date2 && dateFns.format(dateFns.parseISO(date2), DATE_FORMAT$1);
15520
+ return date2 && dateFns.format(dateFns.parseISO(date2), DATE_FORMAT);
15499
15521
  };
15500
15522
  const RECEIPT_ALLOWED_UPLOAD_FILE_TYPES = [
15501
15523
  "image/jpeg",
@@ -15578,7 +15600,7 @@ const useReceipts = ({
15578
15600
  url: void 0,
15579
15601
  status: "failed",
15580
15602
  name: file.name,
15581
- date: dateFns.format(dateFns.parseISO((/* @__PURE__ */ new Date()).toISOString()), DATE_FORMAT$1),
15603
+ date: dateFns.format(dateFns.parseISO((/* @__PURE__ */ new Date()).toISOString()), DATE_FORMAT),
15582
15604
  error: "Invalid file type. Please upload an image or PDF."
15583
15605
  }
15584
15606
  ]);
@@ -15598,7 +15620,7 @@ const useReceipts = ({
15598
15620
  url: void 0,
15599
15621
  status: "pending",
15600
15622
  name: renamedFile.name,
15601
- date: dateFns.format(dateFns.parseISO((/* @__PURE__ */ new Date()).toISOString()), DATE_FORMAT$1)
15623
+ date: dateFns.format(dateFns.parseISO((/* @__PURE__ */ new Date()).toISOString()), DATE_FORMAT)
15602
15624
  };
15603
15625
  try {
15604
15626
  setReceiptUrls((prev) => [...prev, newReceipt]);
@@ -16112,7 +16134,7 @@ const MatchForm = ({
16112
16134
  setSelectedMatch(suggestedMatch);
16113
16135
  },
16114
16136
  children: [
16115
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: `Layer__nowrap ${classNamePrefix}__match-table__date`, children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: dateFns.format(dateFns.parseISO(suggestedMatch.details.date), DATE_FORMAT$1) }) }),
16137
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: `Layer__nowrap ${classNamePrefix}__match-table__date`, children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: dateFns.format(dateFns.parseISO(suggestedMatch.details.date), DATE_FORMAT) }) }),
16116
16138
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${classNamePrefix}__match-table__desc`, children: /* @__PURE__ */ jsxRuntime.jsx(
16117
16139
  Text,
16118
16140
  {
@@ -16136,7 +16158,7 @@ const MatchForm = ({
16136
16158
  {
16137
16159
  classNamePrefix,
16138
16160
  bankTransaction,
16139
- dateFormat: DATE_FORMAT$1,
16161
+ dateFormat: DATE_FORMAT,
16140
16162
  text: isTransferMatch(bankTransaction) ? "Transfer" : "Matched"
16141
16163
  }
16142
16164
  )
@@ -18484,7 +18506,7 @@ const BankTransactionsList = ({
18484
18506
  BankTransactionsListItem,
18485
18507
  {
18486
18508
  index: index2,
18487
- dateFormat: DATE_FORMAT$1,
18509
+ dateFormat: DATE_FORMAT,
18488
18510
  bankTransaction,
18489
18511
  editable,
18490
18512
  removeTransaction,
@@ -18558,7 +18580,6 @@ const BankTransactionsMobileBulkActionsHeader = ({
18558
18580
  }
18559
18581
  );
18560
18582
  };
18561
- const DATE_FORMAT = "LLL d";
18562
18583
  const BankTransactionsAmountDate = ({ amount, date: date2, slotProps }) => {
18563
18584
  return /* @__PURE__ */ jsxRuntime.jsxs(
18564
18585
  VStack,
@@ -18577,7 +18598,7 @@ const BankTransactionsAmountDate = ({ amount, date: date2, slotProps }) => {
18577
18598
  DateTime,
18578
18599
  {
18579
18600
  value: date2,
18580
- dateFormat: DATE_FORMAT,
18601
+ dateFormat: MONTH_DAY_FORMAT,
18581
18602
  onlyDate: true,
18582
18603
  slotProps: {
18583
18604
  Date: __spreadValues({
@@ -19868,7 +19889,7 @@ const BankTransactionsTable = ({
19868
19889
  {
19869
19890
  index: index2,
19870
19891
  editable,
19871
- dateFormat: DATE_FORMAT$1,
19892
+ dateFormat: DATE_FORMAT,
19872
19893
  bankTransaction,
19873
19894
  removeTransaction,
19874
19895
  showDescriptions,
@@ -21002,7 +21023,7 @@ const getQuickbooksConnectionSyncUiState = (quickbooksConnectionStatus) => {
21002
21023
  const formatLastSyncedAt = (datetime) => {
21003
21024
  const parsed = new Date(datetime);
21004
21025
  if (!dateFns.isValid(parsed)) return "";
21005
- return `${dateFns.format(parsed, "MMMM d, yyyy")} at ${dateFns.format(parsed, "h:mm a")}`;
21026
+ return `${dateFns.format(parsed, `${MONTH_FORMAT} d, yyyy`)} at ${dateFns.format(parsed, "h:mm a")}`;
21006
21027
  };
21007
21028
  const getFooterConfig = (quickbooksUiState, lastSyncedAt) => {
21008
21029
  switch (quickbooksUiState) {
@@ -23709,7 +23730,7 @@ const ProfitAndLossChart = ({
23709
23730
  }, [hasLoadedData]);
23710
23731
  const getMonthName = react.useCallback((pnl) => pnl ? dateFns.format(
23711
23732
  new Date(pnl.year, pnl.month - 1, 1),
23712
- compactView ? "LLLLL" : "LLL"
23733
+ compactView ? MONTH_FORMAT_NARROW : MONTH_FORMAT_ABBREVIATED
23713
23734
  ) : "", [compactView]);
23714
23735
  const summarizePnL = react.useCallback((pnl) => ({
23715
23736
  name: getMonthName(pnl),
@@ -23733,7 +23754,7 @@ const ProfitAndLossChart = ({
23733
23754
  for (let i = 11; i >= 0; i--) {
23734
23755
  const currentDate = dateFns.sub(today, { months: i });
23735
23756
  loadingData.push({
23736
- name: dateFns.format(currentDate, compactView ? "LLLLL" : "LLL"),
23757
+ name: dateFns.format(currentDate, compactView ? MONTH_FORMAT_NARROW : MONTH_FORMAT_ABBREVIATED),
23737
23758
  revenue: 0,
23738
23759
  revenueUncategorized: 0,
23739
23760
  totalExpensesInverse: 0,
@@ -24265,7 +24286,7 @@ const BackButton = (_Ec) => {
24265
24286
  const baseClassName2 = classNames("Layer__btn", "Layer__back-btn", className);
24266
24287
  return /* @__PURE__ */ jsxRuntime.jsx("button", __spreadProps(__spreadValues({}, props), { className: baseClassName2, children: textOnly ? "Back" : /* @__PURE__ */ jsxRuntime.jsx(BackArrow, { size: 16 }) }));
24267
24288
  };
24268
- const GlobalMonthPicker = () => {
24289
+ const GlobalMonthPicker = ({ truncateMonth }) => {
24269
24290
  const rawActivationDate = useBusinessActivationDate();
24270
24291
  const activationDate = react.useMemo(() => rawActivationDate ? dateFns.startOfDay(rawActivationDate) : null, [rawActivationDate]);
24271
24292
  const { setMonth } = useGlobalDateRangeActions();
@@ -24284,7 +24305,8 @@ const GlobalMonthPicker = () => {
24284
24305
  date: dateZdt,
24285
24306
  onChange,
24286
24307
  minDate: minDateZdt,
24287
- maxDate: maxDateZdt
24308
+ maxDate: maxDateZdt,
24309
+ truncateMonth
24288
24310
  }
24289
24311
  );
24290
24312
  };
@@ -24398,10 +24420,10 @@ const ValueIcon = ({
24398
24420
  width: "3",
24399
24421
  height: "3",
24400
24422
  patternUnits: "userSpaceOnUse",
24401
- children: /* @__PURE__ */ jsxRuntime.jsx("rect", { width: "1", height: "1", opacity: 0.76 })
24423
+ children: /* @__PURE__ */ jsxRuntime.jsx("rect", { width: "1", height: "1", opacity: 0.76, className: "Layer__charts__dots-pattern-legend__dot" })
24402
24424
  }
24403
24425
  ) }),
24404
- /* @__PURE__ */ jsxRuntime.jsx("rect", { width: "12", height: "12", id: "layer-pie-dots-pattern-bg", rx: "2" }),
24426
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { width: "12", height: "12", id: "layer-pie-dots-pattern-bg", rx: "2", className: "Layer__charts__dots-pattern-legend__bg" }),
24405
24427
  /* @__PURE__ */ jsxRuntime.jsx(
24406
24428
  "rect",
24407
24429
  {
@@ -24438,21 +24460,26 @@ const DetailedTable = ({
24438
24460
  stringOverrides,
24439
24461
  onValueClick
24440
24462
  }) => {
24441
- const buildColClass = (column) => {
24442
- var _a, _b, _c;
24443
- return classNames(
24444
- "Layer__sortable-col",
24445
- sidebarScope && ((_a = filters[sidebarScope]) == null ? void 0 : _a.sortBy) === column ? `sort--${(_c = sidebarScope && ((_b = filters[sidebarScope]) == null ? void 0 : _b.sortDirection)) != null ? _c : "desc"}` : ""
24446
- );
24447
- };
24448
24463
  const typeColorMapping = mapTypesToColors(filteredData, chartColorsList);
24449
24464
  const positiveTotal = filteredData.filter((x) => x.value > 0).reduce((sum, x) => sum + x.value, 0);
24465
+ const buildColClass = react.useCallback((column) => {
24466
+ var _a, _b, _c;
24467
+ if (!sidebarScope || !((_a = filters[sidebarScope]) == null ? void 0 : _a.sortDirection)) {
24468
+ return "";
24469
+ }
24470
+ if (((_b = filters[sidebarScope]) == null ? void 0 : _b.sortBy) === column) {
24471
+ return `sort--${(_c = filters[sidebarScope]) == null ? void 0 : _c.sortDirection}`;
24472
+ }
24473
+ return "";
24474
+ }, [sidebarScope, filters]);
24475
+ const { isMobile } = useSizeClass();
24450
24476
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "details-container", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "table", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { children: [
24451
24477
  /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
24478
+ /* @__PURE__ */ jsxRuntime.jsx("th", {}),
24452
24479
  /* @__PURE__ */ jsxRuntime.jsxs(
24453
24480
  "th",
24454
24481
  {
24455
- className: buildColClass("category"),
24482
+ className: classNames("Layer__sortable-col", buildColClass("category")),
24456
24483
  onClick: () => sortBy(sidebarScope != null ? sidebarScope : "expenses", "category"),
24457
24484
  children: [
24458
24485
  (stringOverrides == null ? void 0 : stringOverrides.categoryColumnHeader) || "Category",
@@ -24461,10 +24488,10 @@ const DetailedTable = ({
24461
24488
  ]
24462
24489
  }
24463
24490
  ),
24464
- /* @__PURE__ */ jsxRuntime.jsxs(
24491
+ !isMobile && /* @__PURE__ */ jsxRuntime.jsxs(
24465
24492
  "th",
24466
24493
  {
24467
- className: buildColClass("type"),
24494
+ className: classNames("Layer__sortable-col", buildColClass("type")),
24468
24495
  onClick: () => sortBy(sidebarScope != null ? sidebarScope : "expenses", "type"),
24469
24496
  children: [
24470
24497
  (stringOverrides == null ? void 0 : stringOverrides.typeColumnHeader) || "Type",
@@ -24473,11 +24500,10 @@ const DetailedTable = ({
24473
24500
  ]
24474
24501
  }
24475
24502
  ),
24476
- /* @__PURE__ */ jsxRuntime.jsx("th", {}),
24477
24503
  /* @__PURE__ */ jsxRuntime.jsxs(
24478
24504
  "th",
24479
24505
  {
24480
- className: buildColClass("value"),
24506
+ className: classNames("Layer__sortable-col", buildColClass("value"), "value-col"),
24481
24507
  onClick: () => sortBy(sidebarScope != null ? sidebarScope : "expenses", "value"),
24482
24508
  children: [
24483
24509
  (stringOverrides == null ? void 0 : stringOverrides.valueColumnHeader) || "Value",
@@ -24485,7 +24511,8 @@ const DetailedTable = ({
24485
24511
  /* @__PURE__ */ jsxRuntime.jsx(SortArrows, { className: "Layer__sort-arrows" })
24486
24512
  ]
24487
24513
  }
24488
- )
24514
+ ),
24515
+ /* @__PURE__ */ jsxRuntime.jsx("th", { className: "percent-col" })
24489
24516
  ] }) }),
24490
24517
  /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: filteredData.map((item, idx) => {
24491
24518
  const share = item.value > 0 ? item.value / positiveTotal : 0;
@@ -24499,8 +24526,16 @@ const DetailedTable = ({
24499
24526
  onMouseEnter: () => setHoveredItem(item),
24500
24527
  onMouseLeave: () => setHoveredItem(void 0),
24501
24528
  children: [
24529
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "color-col", children: /* @__PURE__ */ jsxRuntime.jsx(
24530
+ ValueIcon,
24531
+ {
24532
+ item,
24533
+ typeColorMapping,
24534
+ idx
24535
+ }
24536
+ ) }),
24502
24537
  /* @__PURE__ */ jsxRuntime.jsx("td", { className: "category-col", children: item.displayName }),
24503
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "type-col", children: item.type }),
24538
+ !isMobile && /* @__PURE__ */ jsxRuntime.jsx("td", { className: "type-col", children: item.type }),
24504
24539
  /* @__PURE__ */ jsxRuntime.jsx("td", { className: "value-col", children: /* @__PURE__ */ jsxRuntime.jsx(
24505
24540
  Button,
24506
24541
  {
@@ -24510,17 +24545,7 @@ const DetailedTable = ({
24510
24545
  children: /* @__PURE__ */ jsxRuntime.jsx(MoneySpan, { size: "sm", amount: item.value })
24511
24546
  }
24512
24547
  ) }),
24513
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "share-col", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "share-cell-content", children: [
24514
- item.value < 0 ? "-" : `${formatPercent(share)}%`,
24515
- /* @__PURE__ */ jsxRuntime.jsx(
24516
- ValueIcon,
24517
- {
24518
- item,
24519
- typeColorMapping,
24520
- idx
24521
- }
24522
- )
24523
- ] }) })
24548
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "percent-col", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "share-text", children: item.value < 0 ? "-" : `${formatPercent(share)}%` }) })
24524
24549
  ]
24525
24550
  },
24526
24551
  `pl-side-table-item-${idx}`
@@ -25543,8 +25568,8 @@ const ProfitAndLossDetailReport = ({
25543
25568
  return breadcrumbPath || [{ name: lineItemName, display_name: lineItemName }];
25544
25569
  }, [breadcrumbPath, lineItemName]);
25545
25570
  const formatDateRange = (startDate, endDate) => {
25546
- const start = dateFns.format(startDate, "MMM d");
25547
- const end = dateFns.format(endDate, "MMM d");
25571
+ const start = dateFns.format(startDate, MONTH_DAY_FORMAT_SHORT);
25572
+ const end = dateFns.format(endDate, MONTH_DAY_FORMAT_SHORT);
25548
25573
  return `${start} - ${end}`;
25549
25574
  };
25550
25575
  const { data, isLoading, isError } = useProfitAndLossDetailLines({
@@ -25766,6 +25791,13 @@ const ProfitAndLossDetailedCharts = ({
25766
25791
  const theScope = scope ? scope : sidebarScope;
25767
25792
  const data = theScope === "revenue" ? filteredDataRevenue : filteredDataExpenses;
25768
25793
  const total = theScope === "revenue" ? filteredTotalRevenue : filteredTotalExpenses;
25794
+ const isEmpty = react.useMemo(() => {
25795
+ if (isLoading) return false;
25796
+ const chartData = data.map((x) => __spreadProps(__spreadValues({}, x), {
25797
+ value: x.value > 0 ? x.value : 0
25798
+ }));
25799
+ return chartData.length === 0 || !chartData.find((x) => x.value !== 0);
25800
+ }, [data, isLoading]);
25769
25801
  const [hoveredItem, setHoveredItem] = react.useState(void 0);
25770
25802
  const [selectedItem, setSelectedItem] = react.useState(null);
25771
25803
  const [isModalOpen, setIsModalOpen] = react.useState(false);
@@ -25780,7 +25812,7 @@ const ProfitAndLossDetailedCharts = ({
25780
25812
  /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "Layer__profit-and-loss-detailed-charts__header", children: [
25781
25813
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "Layer__profit-and-loss-detailed-charts__head", children: [
25782
25814
  /* @__PURE__ */ jsxRuntime.jsx(Text, { size: TextSize.lg, weight: TextWeight.bold, className: "title", children: humanizeTitle(theScope, stringOverrides == null ? void 0 : stringOverrides.detailedChartStringOverrides) }),
25783
- /* @__PURE__ */ jsxRuntime.jsx(Text, { size: TextSize.sm, className: "date", children: dateFns.format(dateRange.startDate, "LLLL, y") }),
25815
+ /* @__PURE__ */ jsxRuntime.jsx(Text, { size: TextSize.sm, className: "date", children: dateFns.format(dateRange.startDate, MONTH_YEAR_FORMAT_FULL) }),
25784
25816
  showDatePicker && /* @__PURE__ */ jsxRuntime.jsx(GlobalMonthPicker, {})
25785
25817
  ] }),
25786
25818
  !hideClose && /* @__PURE__ */ jsxRuntime.jsx(
@@ -25797,10 +25829,16 @@ const ProfitAndLossDetailedCharts = ({
25797
25829
  !hideClose && /* @__PURE__ */ jsxRuntime.jsx(BackButton, { onClick: () => setSidebarScope(void 0) }),
25798
25830
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "Layer__profit-and-loss-detailed-charts__head", children: [
25799
25831
  /* @__PURE__ */ jsxRuntime.jsx(Text, { size: TextSize.lg, weight: TextWeight.bold, className: "title", children: humanizeTitle(theScope, stringOverrides == null ? void 0 : stringOverrides.detailedChartStringOverrides) }),
25800
- /* @__PURE__ */ jsxRuntime.jsx(Text, { size: TextSize.sm, className: "date", children: dateFns.format(dateRange.startDate, "LLLL, y") })
25832
+ /* @__PURE__ */ jsxRuntime.jsx(Text, { size: TextSize.sm, className: "date", children: dateFns.format(dateRange.startDate, MONTH_YEAR_FORMAT_FULL) })
25801
25833
  ] })
25802
25834
  ] }),
25803
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "Layer__profit-and-loss-detailed-charts__content", children: [
25835
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__profit-and-loss-detailed-charts__content", children: isEmpty ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
25836
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Layer__profit-and-loss-detailed-charts__empty-chart", children: /* @__PURE__ */ jsxRuntime.jsxs(VStack, { align: "center", justify: "center", gap: "md", className: "Layer__profit-and-loss-detailed-charts__empty-chart-content", children: [
25837
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Hourglass, { size: 36, className: "Layer__profit-and-loss-detailed-charts__empty-chart-icon" }),
25838
+ /* @__PURE__ */ jsxRuntime.jsx(Span, { size: TextSize.md, weight: TextWeight.bold, variant: "subtle", children: "No transactions found" })
25839
+ ] }) }),
25840
+ /* @__PURE__ */ jsxRuntime.jsx(HStack, { align: "center", justify: "center", gap: "md", pb: "md", className: "Layer__profit-and-loss-detailed-charts__table-wrapper", children: /* @__PURE__ */ jsxRuntime.jsx(Span, { size: TextSize.md, variant: "subtle", children: "Upload your transactions or wait for transactions to be synced from your bank." }) })
25841
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
25804
25842
  /* @__PURE__ */ jsxRuntime.jsx(
25805
25843
  DetailedChart,
25806
25844
  {
@@ -25829,7 +25867,7 @@ const ProfitAndLossDetailedCharts = ({
25829
25867
  onValueClick: handleValueClick
25830
25868
  }
25831
25869
  ) })
25832
- ] }),
25870
+ ] }) }),
25833
25871
  /* @__PURE__ */ jsxRuntime.jsx(
25834
25872
  DetailReportModal,
25835
25873
  {
@@ -26476,7 +26514,7 @@ const generateComparisonPeriods = (params) => {
26476
26514
  const generateComparisonMonths = (endDate, numberOfMonths) => {
26477
26515
  return Array.from({ length: numberOfMonths }, (_, index2) => {
26478
26516
  const currentMonth = dateFns.subMonths(endDate, numberOfMonths - index2 - 1);
26479
- return { date: currentMonth, label: dateFns.format(currentMonth, "MMM yyyy") };
26517
+ return { date: currentMonth, label: dateFns.format(currentMonth, MONTH_YEAR_FORMAT_SHORT) };
26480
26518
  });
26481
26519
  };
26482
26520
  const generateComparisonYears = (endDate, numberOfYears) => {
@@ -26486,7 +26524,7 @@ const generateComparisonYears = (endDate, numberOfYears) => {
26486
26524
  });
26487
26525
  };
26488
26526
  const generateComparisonDateRange = (startDate, endDate) => {
26489
- const label = `${dateFns.format(startDate, DATE_FORMAT$1)} - ${dateFns.format(endDate, DATE_FORMAT$1)}`;
26527
+ const label = `${dateFns.format(startDate, DATE_FORMAT)} - ${dateFns.format(endDate, DATE_FORMAT)}`;
26490
26528
  return [{ date: startDate, endDate, label }];
26491
26529
  };
26492
26530
  const getComparisonValue = (name, depth, cellData) => {
@@ -27410,7 +27448,7 @@ function Internal_ProfitAndLossSummaries({
27410
27448
  revenuePercentChange: calculatePercentageChange(currentRevenue, previousRevenue),
27411
27449
  expensesPercentChange: calculatePercentageChange(currentExpenses, previousExpenses),
27412
27450
  netProfitPercentChange: calculatePercentageChange(currentNetProfit, previousNetProfit),
27413
- comparisonMonth: dateFns.format(previousMonthStart, "MMM")
27451
+ comparisonMonth: dateFns.format(previousMonthStart, MONTH_FORMAT_SHORT)
27414
27452
  };
27415
27453
  }, [previousData, effectiveData, previousMonthStart]);
27416
27454
  const {
@@ -30232,7 +30270,7 @@ const LedgerAccountRow = ({
30232
30270
  children: [
30233
30271
  /* @__PURE__ */ jsxRuntime.jsx("td", { className: "Layer__table-cell Layer__ledger-account-table__tablet-main-col", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "Layer__table-cell-content", children: [
30234
30272
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "Layer__ledger-account-table__tablet-main-col__date", children: [
30235
- /* @__PURE__ */ jsxRuntime.jsx(Text, { children: row.date && dateFns.format(dateFns.parseISO(row.date), DATE_FORMAT$1) }),
30273
+ /* @__PURE__ */ jsxRuntime.jsx(Text, { children: row.date && dateFns.format(dateFns.parseISO(row.date), DATE_FORMAT) }),
30236
30274
  /* @__PURE__ */ jsxRuntime.jsx(
30237
30275
  Text,
30238
30276
  {
@@ -30270,7 +30308,7 @@ const LedgerAccountRow = ({
30270
30308
  },
30271
30309
  children: /* @__PURE__ */ jsxRuntime.jsx("td", { className: "Layer__table-cell Layer__ledger-account-table__tablet-main-col", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "Layer__table-cell-content", children: [
30272
30310
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "Layer__ledger-account-table__tablet-main-col__date", children: [
30273
- /* @__PURE__ */ jsxRuntime.jsx(Text, { children: row.date && dateFns.format(dateFns.parseISO(row.date), DATE_FORMAT$1) }),
30311
+ /* @__PURE__ */ jsxRuntime.jsx(Text, { children: row.date && dateFns.format(dateFns.parseISO(row.date), DATE_FORMAT) }),
30274
30312
  /* @__PURE__ */ jsxRuntime.jsx(
30275
30313
  Text,
30276
30314
  {
@@ -30319,7 +30357,7 @@ const LedgerAccountRow = ({
30319
30357
  }
30320
30358
  },
30321
30359
  children: [
30322
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "Layer__table-cell", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "Layer__table-cell-content", children: row.date && dateFns.format(dateFns.parseISO(row.date), DATE_FORMAT$1) }) }),
30360
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "Layer__table-cell", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "Layer__table-cell-content", children: row.date && dateFns.format(dateFns.parseISO(row.date), DATE_FORMAT) }) }),
30323
30361
  /* @__PURE__ */ jsxRuntime.jsx("td", { className: "Layer__table-cell", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "Layer__table-cell-content", children: lineEntryNumber(row) }) }),
30324
30362
  /* @__PURE__ */ jsxRuntime.jsx("td", { className: "Layer__table-cell", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "Layer__table-cell-content", children: (_g = ledgerEntrySource == null ? void 0 : ledgerEntrySource.displayDescription) != null ? _g : "" }) }),
30325
30363
  nodeType !== LedgerAccountNodeType.Leaf && /* @__PURE__ */ jsxRuntime.jsx("td", { className: "Layer__table-cell", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "Layer__table-cell-content", children: (_i = (_h = row.account) == null ? void 0 : _h.name) != null ? _i : "" }) }),
@@ -32180,7 +32218,7 @@ const JournalTableContent = ({
32180
32218
  children: entryNumber(row)
32181
32219
  }
32182
32220
  ),
32183
- /* @__PURE__ */ jsxRuntime.jsx(TableCell, { children: row.entry_at && dateFns.format(dateFns.parseISO(row.entry_at), DATE_FORMAT$1) }),
32221
+ /* @__PURE__ */ jsxRuntime.jsx(TableCell, { children: row.entry_at && dateFns.format(dateFns.parseISO(row.entry_at), DATE_FORMAT) }),
32184
32222
  /* @__PURE__ */ jsxRuntime.jsx(TableCell, { children: humanizeEnum(row.entry_type) }),
32185
32223
  enableAccountNumbers && /* @__PURE__ */ jsxRuntime.jsx(TableCell, {}),
32186
32224
  /* @__PURE__ */ jsxRuntime.jsxs(TableCell, { children: [
@@ -33216,7 +33254,7 @@ function TasksMonthSelector() {
33216
33254
  };
33217
33255
  const total = (_b = (_a = taskData.tasks) == null ? void 0 : _a.length) != null ? _b : 0;
33218
33256
  return __spreadValues({
33219
- monthStr: dateFns.format(date22, "MMM"),
33257
+ monthStr: dateFns.format(date22, MONTH_FORMAT_SHORT),
33220
33258
  date: date22,
33221
33259
  completed: getCompletedTasks(taskData.tasks).length,
33222
33260
  total
@@ -33421,7 +33459,7 @@ const TasksPending = () => {
33421
33459
  );
33422
33460
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "Layer__tasks-pending", children: [
33423
33461
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "Layer__tasks-pending-header", children: [
33424
- /* @__PURE__ */ jsxRuntime.jsx(Heading, { size: HeadingSize.secondary, children: dateFns.format(date2, "MMMM yyyy") }),
33462
+ /* @__PURE__ */ jsxRuntime.jsx(Heading, { size: HeadingSize.secondary, children: dateFns.format(date2, MONTH_YEAR_FORMAT) }),
33425
33463
  (activePeriod == null ? void 0 : activePeriod.tasks) && activePeriod.tasks.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "Layer__tasks-pending-bar", children: [
33426
33464
  /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: TextSize.sm, children: [
33427
33465
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: taskStatusClassName, children: completedTaskCount }),
@@ -40129,6 +40167,7 @@ const AccountingOverview = ({
40129
40167
  }) => {
40130
40168
  var _a, _b, _c, _d, _e;
40131
40169
  const [pnlToggle, setPnlToggle] = react.useState("expenses");
40170
+ const { value: sizeClass } = useSizeClass();
40132
40171
  const profitAndLossSummariesVariants = (_b = (_a = slotProps == null ? void 0 : slotProps.profitAndLoss) == null ? void 0 : _a.summaries) == null ? void 0 : _b.variants;
40133
40172
  return /* @__PURE__ */ jsxRuntime.jsx(
40134
40173
  ProfitAndLoss,
@@ -40140,7 +40179,7 @@ const AccountingOverview = ({
40140
40179
  {
40141
40180
  title: (stringOverrides == null ? void 0 : stringOverrides.title) || title,
40142
40181
  showHeader: showTitle,
40143
- header: /* @__PURE__ */ jsxRuntime.jsx(Header, { children: /* @__PURE__ */ jsxRuntime.jsx(HeaderRow, { children: /* @__PURE__ */ jsxRuntime.jsx(HeaderCol, { children: /* @__PURE__ */ jsxRuntime.jsx(GlobalMonthPicker, {}) }) }) }),
40182
+ header: /* @__PURE__ */ jsxRuntime.jsx(Header, { children: /* @__PURE__ */ jsxRuntime.jsx(HeaderRow, { children: /* @__PURE__ */ jsxRuntime.jsx(HeaderCol, { children: /* @__PURE__ */ jsxRuntime.jsx(GlobalMonthPicker, { truncateMonth: sizeClass === "mobile" }) }) }) }),
40144
40183
  children: [
40145
40184
  enableOnboarding && /* @__PURE__ */ jsxRuntime.jsx(
40146
40185
  Onboarding,