@layerfi/components 0.1.132-alpha → 0.1.132-alpha.2

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.
@@ -4,7 +4,7 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
4
4
  import { usePlaidLink } from "react-plaid-link";
5
5
  import useSWR, { SWRConfig, unstable_serialize, useSWRConfig } from "swr";
6
6
  import useSWRMutation from "swr/mutation";
7
- import { Breadcrumb, Breadcrumbs, Button, Calendar, CalendarCell, CalendarGrid, CalendarGridBody, CalendarGridHeader, CalendarHeaderCell, Cell, Checkbox, Collection, Column, DateField, DateInput, DatePicker, DateSegment, Dialog, DialogTrigger, FieldError, Form, GridList, GridListHeader, GridListItem, GridListSection, Group, Header, Heading, I18nProvider, Input, Label, Link, Menu, MenuItem, MenuTrigger, Meter, Modal, ModalOverlay, NumberField, Popover, Radio, RadioGroup, Row, SearchField, SelectionIndicator, Switch, Table, TableBody, TableHeader, Text, TextArea, TextField, ToggleButton, ToggleButtonGroup, Tree, TreeItem, TreeItemContent, composeRenderProps } from "react-aria-components";
7
+ import { I18nProvider } from "react-aria-components/I18nProvider";
8
8
  import { I18nextProvider, Trans, useTranslation } from "react-i18next";
9
9
  import { IntlProvider, useIntl } from "react-intl";
10
10
  import i18next from "i18next";
@@ -18,22 +18,56 @@ import { Schema as Schema$1, pipe as pipe$1 } from "effect/index";
18
18
  import { useStoreWithEqualityFn } from "zustand/traditional";
19
19
  import { FloatingPortal, autoUpdate, flip, offset, shift, useDismiss, useFloating, useFocus, useHover, useInteractions, useMergeRefs, useRole, useTransitionStyles } from "@floating-ui/react";
20
20
  import { CalendarDate, ZonedDateTime, fromDate, getLocalTimeZone, parseDate, toCalendarDate, today } from "@internationalized/date";
21
+ import { ToggleButtonGroup } from "react-aria-components/ToggleButtonGroup";
22
+ import { SelectionIndicator } from "react-aria-components/SelectionIndicator";
23
+ import { ToggleButton } from "react-aria-components/ToggleButton";
24
+ import { Header } from "react-aria-components/Header";
25
+ import { Label } from "react-aria-components/Label";
26
+ import { Text } from "react-aria-components/Text";
21
27
  import { mergeRefs } from "react-merge-refs";
22
28
  import useResizeObserver from "@react-hook/resize-observer";
23
- import { AlertCircle, AlertTriangle, Archive, ArchiveRestore, ArrowRight, ArrowUpRight, Briefcase, Car, Check, CheckCircle, CheckIcon, ChevronLeft, ChevronRight, Circle, Clock, Clock3, CopyIcon, Edit, ExternalLink, FileDownIcon, FileSpreadsheet, FileText, HandCoins, Hourglass, Info, Layers2Icon, List, LoaderCircle, Lock, Menu as Menu$1, MenuIcon, Minus, PencilRuler, Play, Plus, RefreshCcw, RotateCcw, Save, Search, SearchX, Trash, Trash2, TriangleAlert, UploadCloud, UserRoundPen, Video, X, XCircle, XIcon } from "lucide-react";
29
+ import { Button } from "react-aria-components/Button";
30
+ import { AlertCircle, AlertTriangle, Archive, ArchiveRestore, ArrowRight, ArrowUpRight, Briefcase, Car, Check, CheckCircle, CheckIcon, ChevronLeft, ChevronRight, Circle, Clock, Clock3, CopyIcon, Edit, ExternalLink, FileDownIcon, FileSpreadsheet, FileText, HandCoins, Hourglass, Info, Layers2Icon, List, LoaderCircle, Lock, Menu, MenuIcon, Minus, PencilRuler, Play, Plus, RefreshCcw, RotateCcw, Save, Search, SearchX, Trash, Trash2, TriangleAlert, UploadCloud, UserRoundPen, Video, X, XCircle, XIcon } from "lucide-react";
24
31
  import { DurationFormat } from "@formatjs/intl-durationformat";
32
+ import { Dialog, DialogTrigger } from "react-aria-components/Dialog";
33
+ import { Modal, ModalOverlay } from "react-aria-components/Modal";
34
+ import { Heading } from "react-aria-components/Heading";
25
35
  import Select, { components } from "react-select";
36
+ import { Group } from "react-aria-components/Group";
37
+ import { Input } from "react-aria-components/Input";
38
+ import { SearchField } from "react-aria-components/SearchField";
39
+ import { GridList, GridListHeader, GridListItem, GridListSection } from "react-aria-components/GridList";
40
+ import { composeRenderProps } from "react-aria-components/composeRenderProps";
41
+ import { Checkbox } from "react-aria-components/Checkbox";
26
42
  import CreatableSelect from "react-select/creatable";
27
43
  import { useDropzone } from "react-dropzone";
28
44
  import { createFormHook, createFormHookContexts, revalidateLogic, useForm, useStore as useStore$1 } from "@tanstack/react-form";
45
+ import { FieldError } from "react-aria-components/FieldError";
46
+ import { Form } from "react-aria-components/Form";
47
+ import { TextField } from "react-aria-components/TextField";
48
+ import { DateField, DateInput, DateSegment } from "react-aria-components/DateField";
49
+ import { DatePicker } from "react-aria-components/DatePicker";
50
+ import { Calendar, CalendarCell, CalendarGrid, CalendarGridBody, CalendarGridHeader, CalendarHeaderCell } from "react-aria-components/Calendar";
51
+ import { Popover } from "react-aria-components/Popover";
52
+ import { NumberField } from "react-aria-components/NumberField";
53
+ import { Radio, RadioGroup } from "react-aria-components/RadioGroup";
54
+ import { Switch } from "react-aria-components/Switch";
55
+ import { TextArea } from "react-aria-components/TextArea";
29
56
  import { createColumnHelper, flexRender, getCoreRowModel, getExpandedRowModel, getPaginationRowModel, getSortedRowModel, useReactTable } from "@tanstack/react-table";
30
57
  import { useVirtualizer } from "@tanstack/react-virtual";
58
+ import { Cell, Column, Row, Table, TableBody, TableHeader } from "react-aria-components/Table";
59
+ import { Menu as Menu$1, MenuItem, MenuTrigger, Popover as Popover$1 } from "react-aria-components/Menu";
31
60
  import { AnimatePresence, motion } from "motion/react";
32
61
  import { v4 } from "uuid";
33
62
  import CurrencyInput from "react-currency-input-field";
34
63
  import { Bar, BarChart, CartesianGrid, Cell as Cell$1, ComposedChart, DefaultZIndexes, Label as Label$1, LabelList, Legend, Line, Pie, PieChart, Rectangle, ReferenceLine, ResponsiveContainer, Text as Text$1, Tooltip, XAxis, YAxis, ZIndexLayer } from "recharts";
35
64
  import { createPortal } from "react-dom";
36
65
  import { PopupModal, useCalendlyEventListener } from "react-calendly";
66
+ import { Meter } from "react-aria-components/Meter";
67
+ import { Collection } from "react-aria-components/Collection";
68
+ import { Tree, TreeItem, TreeItemContent } from "react-aria-components/Tree";
69
+ import { Breadcrumb, Breadcrumbs } from "react-aria-components/Breadcrumbs";
70
+ import { Link } from "react-aria-components/Link";
37
71
  //#region \0rolldown/runtime.js
38
72
  var __defProp = Object.defineProperty;
39
73
  var __exportAll = (all, no_symbols) => {
@@ -216,7 +250,7 @@ var getIntlLocale = (locale) => {
216
250
  };
217
251
  var package_default = {
218
252
  name: "@layerfi/components",
219
- version: "0.1.132-alpha",
253
+ version: "0.1.132-alpha.2",
220
254
  description: "Layer React Components",
221
255
  main: "dist/cjs/index.cjs",
222
256
  module: "dist/esm/index.mjs",
@@ -318,7 +352,7 @@ var package_default = {
318
352
  "lodash-es": "^4.17.21",
319
353
  "lucide-react": "^0.507.0",
320
354
  "motion": "^12.23.11",
321
- "react-aria-components": "^1.13.0",
355
+ "react-aria-components": "^1.17.0",
322
356
  "react-calendly": "^4.4.0",
323
357
  "react-currency-input-field": "^3.10.0",
324
358
  "react-dropzone": "^14.3.8",
@@ -11199,8 +11233,8 @@ var CategorySelectDrawerWithTrigger = ({ selectedValue, onSelectedValueChange, s
11199
11233
  };
11200
11234
  //#endregion
11201
11235
  //#region src/components/TaxCodeSelect/useTaxCodeSelect.ts
11202
- var EMPTY_ARRAY$6 = [];
11203
- var useTaxCodeSelect = ({ options = EMPTY_ARRAY$6, selectedValue, onSelectedValueChange }) => {
11236
+ var EMPTY_ARRAY$7 = [];
11237
+ var useTaxCodeSelect = ({ options = EMPTY_ARRAY$7, selectedValue, onSelectedValueChange }) => {
11204
11238
  const { t } = useTranslation();
11205
11239
  const noTaxCodeOption = useMemo(() => TaxCodeComboBoxOption.noTaxCode(t("bankTransactions:action.no_tax_code", "No tax code")), [t]);
11206
11240
  const optionsWithNoTaxCode = useMemo(() => [noTaxCodeOption, ...options], [noTaxCodeOption, options]);
@@ -11362,7 +11396,7 @@ var MobileListSection = ({ label, items, renderItem, onClickItem }) => /* @__PUR
11362
11396
  });
11363
11397
  //#endregion
11364
11398
  //#region src/components/ui/MobileList/MobileList.tsx
11365
- var EMPTY_ARRAY$5 = [];
11399
+ var EMPTY_ARRAY$6 = [];
11366
11400
  var isSelectionEnabled = (props) => props.selectionMode !== "none" && props.enableSelection;
11367
11401
  var isGrouped = (data) => !!data && !Array.isArray(data);
11368
11402
  var MobileList = ({ ariaLabel, data, slots, renderItem, onClickItem, isLoading, isError, variant = "default", enableSelection = false, selectionMode = "none", selectedKeys, onSelectionChange }) => {
@@ -11396,7 +11430,7 @@ var MobileList = ({ ariaLabel, data, slots, renderItem, onClickItem, isLoading,
11396
11430
  items: group.items,
11397
11431
  renderItem,
11398
11432
  onClickItem
11399
- }, group.label)) : (data !== null && data !== void 0 ? data : EMPTY_ARRAY$5).map(renderRow)
11433
+ }, group.label)) : (data !== null && data !== void 0 ? data : EMPTY_ARRAY$6).map(renderRow)
11400
11434
  });
11401
11435
  };
11402
11436
  //#endregion
@@ -13223,7 +13257,7 @@ var DatePickerInput = ({ errorText, variant, onClick, isReadOnly }) => {
13223
13257
  //#region src/components/ui/Popover/Popover.tsx
13224
13258
  var _excluded$68 = ["flexInline"];
13225
13259
  var POPOVER_CLASS_NAMES = `Layer__Portal Layer__Popover`;
13226
- var Popover$1 = forwardRef(function Popover$2(_ref, ref) {
13260
+ var Popover$2 = forwardRef(function Popover$3(_ref, ref) {
13227
13261
  let { flexInline = false } = _ref, restProps = _objectWithoutProperties(_ref, _excluded$68);
13228
13262
  const dataProperties = toDataProperties({ "flex-inline": flexInline });
13229
13263
  return /* @__PURE__ */ jsx(Popover, _objectSpread2(_objectSpread2(_objectSpread2({}, restProps), dataProperties), {}, {
@@ -13242,7 +13276,7 @@ function ResponsivePopover({ children, triggerRef }) {
13242
13276
  isDismissable: true,
13243
13277
  children
13244
13278
  });
13245
- return /* @__PURE__ */ jsx(Popover$1, {
13279
+ return /* @__PURE__ */ jsx(Popover$2, {
13246
13280
  triggerRef,
13247
13281
  placement: "bottom left",
13248
13282
  flexInline: true,
@@ -14560,7 +14594,7 @@ var DEFAULT_NUM_ROWS = 15;
14560
14594
  var HEADER_HEIGHT = 52;
14561
14595
  var DEFAULT_TABLE_HEIGHT = DEFAULT_ROW_HEIGHT * DEFAULT_NUM_ROWS + HEADER_HEIGHT - 1;
14562
14596
  var CSS_PREFIX = "Layer__UI__VirtualizedTable";
14563
- var EMPTY_ARRAY$4 = [];
14597
+ var EMPTY_ARRAY$5 = [];
14564
14598
  var VirtualizedDataTable = ({ columnConfig, data, isLoading, isError, componentName, ariaLabel, slots, shrinkHeightToFitRows = false, height = DEFAULT_TABLE_HEIGHT, rowHeight = DEFAULT_ROW_HEIGHT, overscan = DEFAULT_OVERSCAN }) => {
14565
14599
  const { EmptyState, ErrorState } = slots;
14566
14600
  const containerRef = useRef(null);
@@ -14576,7 +14610,7 @@ var VirtualizedDataTable = ({ columnConfig, data, isLoading, isError, componentN
14576
14610
  shrinkHeightToFitRows
14577
14611
  ]);
14578
14612
  const table = useReactTable({
14579
- data: data !== null && data !== void 0 ? data : EMPTY_ARRAY$4,
14613
+ data: data !== null && data !== void 0 ? data : EMPTY_ARRAY$5,
14580
14614
  columns: getColumnDefs(columnConfig),
14581
14615
  getCoreRowModel: getCoreRowModel(),
14582
14616
  getSortedRowModel: getSortedRowModel()
@@ -14946,7 +14980,7 @@ var MenuItem$2 = ({ children, onClick, isDisabled }) => {
14946
14980
  };
14947
14981
  var MenuList = ({ children }) => {
14948
14982
  const { variant } = useDropdownMenu();
14949
- return /* @__PURE__ */ jsx(Menu, _objectSpread2(_objectSpread2({ className: "Layer__UI__DropdownMenu__Menu" }, toDataProperties({ variant })), {}, { children }));
14983
+ return /* @__PURE__ */ jsx(Menu$1, _objectSpread2(_objectSpread2({ className: "Layer__UI__DropdownMenu__Menu" }, toDataProperties({ variant })), {}, { children }));
14950
14984
  };
14951
14985
  var DropdownMenu = ({ children, ariaLabel, variant, slots, slotProps }) => {
14952
14986
  var _slotProps$Dialog;
@@ -14954,7 +14988,7 @@ var DropdownMenu = ({ children, ariaLabel, variant, slots, slotProps }) => {
14954
14988
  const { Trigger } = slots;
14955
14989
  const width = slotProps === null || slotProps === void 0 || (_slotProps$Dialog = slotProps.Dialog) === null || _slotProps$Dialog === void 0 ? void 0 : _slotProps$Dialog.width;
14956
14990
  const dataProps = toDataProperties({ variant });
14957
- return /* @__PURE__ */ jsxs(MenuTrigger, { children: [/* @__PURE__ */ jsx(Trigger, { "aria-label": t("ui:label.menu", "Menu") }), /* @__PURE__ */ jsx(Popover, {
14991
+ return /* @__PURE__ */ jsxs(MenuTrigger, { children: [/* @__PURE__ */ jsx(Trigger, { "aria-label": t("ui:label.menu", "Menu") }), /* @__PURE__ */ jsx(Popover$1, {
14958
14992
  placement: "bottom right",
14959
14993
  className: "Layer__UI__DropdownMenu__Popover Layer__variables",
14960
14994
  children: /* @__PURE__ */ jsx(Dialog, _objectSpread2(_objectSpread2({
@@ -20202,13 +20236,13 @@ var Pagination = ({ onPageChange, totalCount, siblingCount = 1, currentPage, pag
20202
20236
  //#endregion
20203
20237
  //#region src/components/ui/MobileList/PaginatedMobileList.tsx
20204
20238
  var _excluded$39 = ["data", "paginationProps"];
20205
- var EMPTY_ARRAY$3 = [];
20239
+ var EMPTY_ARRAY$4 = [];
20206
20240
  var PaginatedMobileList = (props) => {
20207
20241
  var _data$length;
20208
20242
  const { data, paginationProps } = props, listProps = _objectWithoutProperties(props, _excluded$39);
20209
20243
  const { initialPage = 0, onSetPage, pageSize = 20, hasMore, fetchMore, autoResetPageIndexRef } = paginationProps;
20210
20244
  const { pageItems, pageIndex, setPage } = usePaginatedList({
20211
- data: data !== null && data !== void 0 ? data : EMPTY_ARRAY$3,
20245
+ data: data !== null && data !== void 0 ? data : EMPTY_ARRAY$4,
20212
20246
  pageSize,
20213
20247
  initialPage,
20214
20248
  onSetPage
@@ -20434,7 +20468,20 @@ var DataTableSkeleton = ({ numColumns, nonAria }) => {
20434
20468
  }, `loading-${rowIndex}`)) });
20435
20469
  };
20436
20470
  //#endregion
20471
+ //#region src/components/utility/ConditionalList.tsx
20472
+ function ConditionalList({ list, Empty, Container, isLoading, Loading, isError, Error, children }) {
20473
+ if (isError) return Error;
20474
+ if (isLoading) return Loading;
20475
+ if (list.length === 0) return Empty;
20476
+ const listItems = list.map((item, index) => children({
20477
+ item,
20478
+ index
20479
+ }));
20480
+ return Container ? /* @__PURE__ */ jsx(Container, { children: listItems }) : listItems;
20481
+ }
20482
+ //#endregion
20437
20483
  //#region src/components/DataTable/DataTable.tsx
20484
+ var EMPTY_ARRAY$3 = [];
20438
20485
  var DataTable = ({ isLoading, isError, componentName, ariaLabel, slots, dependencies, data, headerGroups, numColumns, withClickableRow }) => {
20439
20486
  const scrollContainerRef = useRef(null);
20440
20487
  const nonAria = headerGroups.length > 1 || numColumns === 0;
@@ -20442,66 +20489,49 @@ var DataTable = ({ isLoading, isError, componentName, ariaLabel, slots, dependen
20442
20489
  const hasHorizontalOverflow = useHorizontalOverflow(scrollContainerRef, { dependencies: [data, numColumns] });
20443
20490
  const showLoadingFallbackHeaders = isLoading && numColumns === 0;
20444
20491
  const { headerRef, pinningStyles } = useColumnPinningStyles(headerGroups);
20445
- const isEmptyTable = (data === null || data === void 0 ? void 0 : data.length) === 0;
20446
- const renderTableBody = useMemo(() => {
20447
- if (isError) return /* @__PURE__ */ jsx(Row$1, {
20448
- className: "Layer__DataTable__EmptyState__Row",
20492
+ const renderHeaderColumn = useCallback((header) => {
20493
+ var _header$column$column, _header$column$column2;
20494
+ return /* @__PURE__ */ jsx(Column$1, {
20495
+ isRowHeader: (_header$column$column = header.column.columnDef.meta) === null || _header$column$column === void 0 ? void 0 : _header$column$column.isRowHeader,
20496
+ className: `Layer__UI__Table-Column__${componentName}--${header.id}`,
20497
+ alignment: (_header$column$column2 = header.column.columnDef.meta) === null || _header$column$column2 === void 0 ? void 0 : _header$column$column2.alignment,
20498
+ pinned: header.column.getIsPinned(),
20499
+ style: pinningStyles.get(header.column.id),
20449
20500
  nonAria,
20450
- children: /* @__PURE__ */ jsx(Cell$2, {
20451
- className: "Layer__DataTable__EmptyState__Cell",
20452
- colSpan: numColumns,
20453
- nonAria,
20454
- children: /* @__PURE__ */ jsx(ErrorState, {})
20455
- })
20456
- });
20457
- if (isLoading) return /* @__PURE__ */ jsx(DataTableSkeleton, {
20458
- numColumns,
20459
- nonAria
20460
- });
20461
- if (isEmptyTable) return /* @__PURE__ */ jsx(Row$1, {
20462
- className: "Layer__DataTable__EmptyState__Row",
20501
+ colSpan: header.colSpan,
20502
+ children: header.isPlaceholder ? null : typeof header.column.columnDef.header === "function" ? header.column.columnDef.header(header.getContext()) : header.column.columnDef.header
20503
+ }, header.id);
20504
+ }, [
20505
+ componentName,
20506
+ nonAria,
20507
+ pinningStyles
20508
+ ]);
20509
+ const renderHeaderContent = useMemo(() => {
20510
+ if (showLoadingFallbackHeaders) return /* @__PURE__ */ jsx(DataTableHeaderSkeleton, {
20463
20511
  nonAria,
20464
- children: /* @__PURE__ */ jsx(Cell$2, {
20465
- className: "Layer__DataTable__EmptyState__Cell",
20466
- colSpan: numColumns,
20467
- nonAria,
20468
- children: /* @__PURE__ */ jsx(EmptyState, {})
20469
- })
20512
+ numColumns: 3
20470
20513
  });
20471
- return /* @__PURE__ */ jsx(Fragment$1, { children: data === null || data === void 0 ? void 0 : data.map((row) => {
20472
- const isClickable = withClickableRow === null || withClickableRow === void 0 ? void 0 : withClickableRow.isRowClickable(row);
20473
- const onAction = isClickable && (withClickableRow === null || withClickableRow === void 0 ? void 0 : withClickableRow.onRowClick) ? () => withClickableRow.onRowClick(row) : void 0;
20474
- return /* @__PURE__ */ jsx(Row$1, {
20475
- depth: row.depth,
20476
- nonAria,
20477
- onAction,
20478
- className: isClickable ? "Layer__DataTable__ClickableRow" : void 0,
20479
- children: row.getVisibleCells().map((cell) => {
20480
- var _cell$column$columnDe;
20481
- return /* @__PURE__ */ jsx(Cell$2, {
20482
- className: `Layer__UI__Table-Cell__${componentName}--${cell.column.id}`,
20483
- alignment: (_cell$column$columnDe = cell.column.columnDef.meta) === null || _cell$column$columnDe === void 0 ? void 0 : _cell$column$columnDe.alignment,
20484
- pinned: cell.column.getIsPinned(),
20485
- style: pinningStyles.get(cell.column.id),
20486
- nonAria,
20487
- children: flexRender(cell.column.columnDef.cell, cell.getContext())
20488
- }, `${row.id}-${cell.id}`);
20489
- })
20490
- }, row.id);
20491
- }) });
20514
+ if (nonAria) return headerGroups.map((headerGroup) => /* @__PURE__ */ jsx(Row$1, {
20515
+ nonAria,
20516
+ children: headerGroup.headers.map((header) => renderHeaderColumn(header))
20517
+ }, headerGroup.id));
20518
+ return headerGroups.flatMap((headerGroup) => headerGroup.headers.map((header) => renderHeaderColumn(header)));
20492
20519
  }, [
20493
- isError,
20494
- isLoading,
20495
- isEmptyTable,
20496
- data,
20520
+ showLoadingFallbackHeaders,
20497
20521
  nonAria,
20498
- numColumns,
20499
- ErrorState,
20500
- EmptyState,
20501
- withClickableRow,
20502
- componentName,
20503
- pinningStyles
20522
+ headerGroups,
20523
+ renderHeaderColumn
20504
20524
  ]);
20525
+ const FullWidthCellRow = useCallback(({ children }) => /* @__PURE__ */ jsx(Row$1, {
20526
+ className: "Layer__DataTable__EmptyState__Row",
20527
+ nonAria,
20528
+ children: /* @__PURE__ */ jsx(Cell$2, {
20529
+ className: "Layer__DataTable__EmptyState__Cell",
20530
+ colSpan: numColumns,
20531
+ nonAria,
20532
+ children
20533
+ })
20534
+ }), [nonAria, numColumns]);
20505
20535
  return /* @__PURE__ */ jsx("div", {
20506
20536
  ref: scrollContainerRef,
20507
20537
  className: classNames("Layer__UI__Table-ScrollContainer", hasHorizontalOverflow && "Layer__UI__Table-ScrollContainer--has-horizontal-overflow"),
@@ -20512,29 +20542,42 @@ var DataTable = ({ isLoading, isError, componentName, ariaLabel, slots, dependen
20512
20542
  children: [/* @__PURE__ */ jsx(TableHeader$1, {
20513
20543
  ref: headerRef,
20514
20544
  nonAria,
20515
- children: showLoadingFallbackHeaders ? /* @__PURE__ */ jsx(DataTableHeaderSkeleton, {
20516
- nonAria,
20517
- numColumns: 3
20518
- }) : headerGroups.map((headerGroup) => /* @__PURE__ */ jsx(Row$1, {
20519
- nonAria,
20520
- children: headerGroup.headers.map((header) => {
20521
- var _header$column$column, _header$column$column2;
20522
- return /* @__PURE__ */ jsx(Column$1, {
20523
- isRowHeader: (_header$column$column = header.column.columnDef.meta) === null || _header$column$column === void 0 ? void 0 : _header$column$column.isRowHeader,
20524
- className: `Layer__UI__Table-Column__${componentName}--${header.id}`,
20525
- alignment: (_header$column$column2 = header.column.columnDef.meta) === null || _header$column$column2 === void 0 ? void 0 : _header$column$column2.alignment,
20526
- pinned: header.column.getIsPinned(),
20527
- style: pinningStyles.get(header.column.id),
20528
- nonAria,
20529
- colSpan: header.colSpan,
20530
- children: header.isPlaceholder ? null : typeof header.column.columnDef.header === "function" ? header.column.columnDef.header(header.getContext()) : header.column.columnDef.header
20531
- }, header.id);
20532
- })
20533
- }, headerGroup.id))
20545
+ children: renderHeaderContent
20534
20546
  }), /* @__PURE__ */ jsx(TableBody$2, {
20535
20547
  dependencies,
20536
20548
  nonAria,
20537
- children: renderTableBody
20549
+ children: /* @__PURE__ */ jsx(ConditionalList, {
20550
+ list: data !== null && data !== void 0 ? data : EMPTY_ARRAY$3,
20551
+ isLoading,
20552
+ isError,
20553
+ Loading: /* @__PURE__ */ jsx(DataTableSkeleton, {
20554
+ numColumns,
20555
+ nonAria
20556
+ }),
20557
+ Error: /* @__PURE__ */ jsx(FullWidthCellRow, { children: /* @__PURE__ */ jsx(ErrorState, {}) }),
20558
+ Empty: /* @__PURE__ */ jsx(FullWidthCellRow, { children: /* @__PURE__ */ jsx(EmptyState, {}) }),
20559
+ children: ({ item: row }) => {
20560
+ const isClickable = withClickableRow === null || withClickableRow === void 0 ? void 0 : withClickableRow.isRowClickable(row);
20561
+ const onAction = isClickable && (withClickableRow === null || withClickableRow === void 0 ? void 0 : withClickableRow.onRowClick) ? () => withClickableRow.onRowClick(row) : void 0;
20562
+ return /* @__PURE__ */ jsx(Row$1, {
20563
+ depth: row.depth,
20564
+ nonAria,
20565
+ onAction,
20566
+ className: isClickable ? "Layer__DataTable__ClickableRow" : void 0,
20567
+ children: row.getVisibleCells().map((cell) => {
20568
+ var _cell$column$columnDe;
20569
+ return /* @__PURE__ */ jsx(Cell$2, {
20570
+ className: `Layer__UI__Table-Cell__${componentName}--${cell.column.id}`,
20571
+ alignment: (_cell$column$columnDe = cell.column.columnDef.meta) === null || _cell$column$columnDe === void 0 ? void 0 : _cell$column$columnDe.alignment,
20572
+ pinned: cell.column.getIsPinned(),
20573
+ style: pinningStyles.get(cell.column.id),
20574
+ nonAria,
20575
+ children: flexRender(cell.column.columnDef.cell, cell.getContext())
20576
+ }, `${row.id}-${cell.id}`);
20577
+ })
20578
+ }, row.id);
20579
+ }
20580
+ })
20538
20581
  })]
20539
20582
  }, `${componentName}-cols-${numColumns}`)
20540
20583
  });
@@ -22466,18 +22509,6 @@ function LinkedAccountToConfirm({ account, isConfirmed, onChangeConfirmed }) {
22466
22509
  });
22467
22510
  }
22468
22511
  //#endregion
22469
- //#region src/components/utility/ConditionalList.tsx
22470
- function ConditionalList({ list, Empty, Container, isLoading, Loading, isError, Error, children }) {
22471
- if (isError) return Error;
22472
- if (isLoading) return Loading;
22473
- if (list.length === 0) return Empty;
22474
- const listItems = list.map((item, index) => children({
22475
- item,
22476
- index
22477
- }));
22478
- return Container ? /* @__PURE__ */ jsx(Container, { children: listItems }) : listItems;
22479
- }
22480
- //#endregion
22481
22512
  //#region src/components/LinkedAccounts/ConfirmationModal/LinkedAccountsConfirmationModal.tsx
22482
22513
  function useLinkedAccountsConfirmationModal() {
22483
22514
  const { data, refetchAccounts } = useLinkedAccounts();
@@ -22653,8 +22684,8 @@ function LinkedAccountsConfirmationModal() {
22653
22684
  //#endregion
22654
22685
  //#region src/components/ui/Menu/Menu.tsx
22655
22686
  var MENU_CLASS_NAME = "Layer__Menu";
22656
- var Menu$2 = forwardRef(function Menu$3({ children }, ref) {
22657
- return /* @__PURE__ */ jsx(Menu, {
22687
+ var Menu$2 = forwardRef(function Menu({ children }, ref) {
22688
+ return /* @__PURE__ */ jsx(Menu$1, {
22658
22689
  className: MENU_CLASS_NAME,
22659
22690
  ref,
22660
22691
  children
@@ -22694,7 +22725,7 @@ function LinkedAccountPill({ label, items }) {
22694
22725
  status: "error",
22695
22726
  onPress: () => setIsOpen(true),
22696
22727
  children: [/* @__PURE__ */ jsx(AlertCircle$1, { size: 14 }), label]
22697
- }), /* @__PURE__ */ jsx(Popover, {
22728
+ }), /* @__PURE__ */ jsx(Popover$1, {
22698
22729
  className: "Layer__Portal",
22699
22730
  placement: "bottom end",
22700
22731
  children: /* @__PURE__ */ jsx(Menu$2, { children: items.map(({ action, name }, index) => /* @__PURE__ */ jsx(MenuItem$1, {
@@ -36916,7 +36947,7 @@ var InvoiceDetailHeaderMenu = ({ onEditInvoice }) => {
36916
36947
  return /* @__PURE__ */ jsx(Button$1, {
36917
36948
  icon: true,
36918
36949
  variant: "outlined",
36919
- children: /* @__PURE__ */ jsx(Menu$1, { size: 14 })
36950
+ children: /* @__PURE__ */ jsx(Menu, { size: 14 })
36920
36951
  });
36921
36952
  }, []);
36922
36953
  if (viewState.mode === UpsertInvoiceMode.Create) return null;
@@ -43476,10 +43507,7 @@ var SummaryCard = ({ slots, children, className }) => {
43476
43507
  children: [legend && /* @__PURE__ */ jsx("div", {
43477
43508
  className: "Layer__SummaryCard__HeaderLegend",
43478
43509
  children: legend
43479
- }), primaryAction && /* @__PURE__ */ jsx("div", {
43480
- className: "Layer__SummaryCard__HeaderPrimaryAction",
43481
- children: primaryAction
43482
- })]
43510
+ }), primaryAction]
43483
43511
  })]
43484
43512
  }), /* @__PURE__ */ jsx("div", {
43485
43513
  className: "Layer__SummaryCard__Content",
@@ -43562,88 +43590,89 @@ var ExpensesSummaryCard = ({ stylingProps, interactionProps, stringOverrides, cl
43562
43590
  };
43563
43591
  //#endregion
43564
43592
  //#region src/components/MileageTrackingSummary/MileageTrackingSummary.tsx
43565
- var MileageTrackingSummary = ({ header: headerOverride } = {}) => {
43593
+ var Content$1 = () => {
43566
43594
  const { t } = useTranslation();
43567
43595
  const { formatDate } = useIntlFormatter();
43568
43596
  const { data, selectedYear, selectedYearData, chartData, isLoading, isError } = useMileageTrackingYearlySummary();
43569
43597
  const { isDesktop, isMobile } = useSizeClass();
43570
43598
  const inYearLabel = t("mileageTracking:label.in_year", "In {{year}}", { year: formatDate(new Date(selectedYear, 0, 1), DateFormat.Year) });
43571
- const title = headerOverride !== null && headerOverride !== void 0 ? headerOverride : t("mileageTracking:label.mileage_tracking", "Mileage Tracking");
43572
43599
  const statsProps = isDesktop ? { direction: "column" } : isMobile ? { direction: "column" } : { direction: "row" };
43573
- return /* @__PURE__ */ jsxs(Container, {
43574
- name: "mileage-tracking-summary",
43575
- children: [/* @__PURE__ */ jsx(VStack, {
43576
- className: "Layer__MileageTrackingSummary__Header",
43577
- gap: "md",
43578
- children: /* @__PURE__ */ jsx(Heading$2, {
43579
- size: isDesktop ? "md" : "sm",
43580
- children: title
43581
- })
43582
- }), /* @__PURE__ */ jsx(ConditionalBlock, {
43583
- data,
43584
- isLoading,
43585
- isError,
43586
- Loading: /* @__PURE__ */ jsx(HStack, {
43600
+ return /* @__PURE__ */ jsx(ConditionalBlock, {
43601
+ data,
43602
+ isLoading,
43603
+ isError,
43604
+ Loading: /* @__PURE__ */ jsx(HStack, {
43605
+ className: "Layer__MileageTrackingSummary__Content",
43606
+ gap: "lg",
43607
+ justify: "center",
43608
+ align: "center",
43609
+ children: /* @__PURE__ */ jsx(Loader, {})
43610
+ }),
43611
+ Error: /* @__PURE__ */ jsx(DataState, {
43612
+ status: DataStateStatus.failed,
43613
+ title: t("mileageTracking:error.load_mileage_summary_data", "Failed to load mileage summary data"),
43614
+ spacing: true
43615
+ }),
43616
+ children: () => {
43617
+ var _selectedYearData$est, _selectedYearData$mil, _selectedYearData$tri;
43618
+ return /* @__PURE__ */ jsxs(Stack, {
43587
43619
  className: "Layer__MileageTrackingSummary__Content",
43620
+ direction: isDesktop ? "row" : "column",
43588
43621
  gap: "lg",
43589
- justify: "center",
43590
- align: "center",
43591
- children: /* @__PURE__ */ jsx(Loader, {})
43592
- }),
43593
- Error: /* @__PURE__ */ jsx(DataState, {
43594
- status: DataStateStatus.failed,
43595
- title: t("mileageTracking:error.load_mileage_summary_data", "Failed to load mileage summary data"),
43596
- spacing: true
43597
- }),
43598
- children: () => {
43599
- var _selectedYearData$est, _selectedYearData$mil, _selectedYearData$tri;
43600
- return /* @__PURE__ */ jsxs(Stack, {
43601
- className: "Layer__MileageTrackingSummary__Content",
43602
- direction: isDesktop ? "row" : "column",
43603
- gap: "lg",
43604
- children: [/* @__PURE__ */ jsxs(Stack, _objectSpread2(_objectSpread2({}, statsProps), {}, {
43605
- className: "Layer__MileageTrackingSummary__Cards",
43606
- gap: "md",
43607
- children: [
43608
- /* @__PURE__ */ jsx("div", {
43609
- className: "Layer__MileageTrackingSummary__StatCardSlot",
43610
- children: /* @__PURE__ */ jsx(MileageTrackingStatsCard, {
43611
- title: t("mileageTracking:label.total_deduction", "Total Deduction"),
43612
- amount: (_selectedYearData$est = selectedYearData === null || selectedYearData === void 0 ? void 0 : selectedYearData.estimatedDeduction) !== null && _selectedYearData$est !== void 0 ? _selectedYearData$est : 0,
43613
- formatAsMoney: true,
43614
- description: inYearLabel
43615
- })
43616
- }),
43617
- /* @__PURE__ */ jsx("div", {
43618
- className: "Layer__MileageTrackingSummary__StatCardSlot",
43619
- children: /* @__PURE__ */ jsx(MileageTrackingStatsCard, {
43620
- title: t("mileageTracking:label.total_miles", "Total Miles"),
43621
- amount: (_selectedYearData$mil = selectedYearData === null || selectedYearData === void 0 ? void 0 : selectedYearData.miles) !== null && _selectedYearData$mil !== void 0 ? _selectedYearData$mil : 0,
43622
- description: inYearLabel
43623
- })
43624
- }),
43625
- /* @__PURE__ */ jsx("div", {
43626
- className: "Layer__MileageTrackingSummary__StatCardSlot",
43627
- children: /* @__PURE__ */ jsx(MileageTrackingStatsCard, {
43628
- title: t("trips:label.trips", "Trips"),
43629
- amount: (_selectedYearData$tri = selectedYearData === null || selectedYearData === void 0 ? void 0 : selectedYearData.trips) !== null && _selectedYearData$tri !== void 0 ? _selectedYearData$tri : 0,
43630
- description: inYearLabel
43631
- })
43622
+ children: [/* @__PURE__ */ jsxs(Stack, _objectSpread2(_objectSpread2({}, statsProps), {}, {
43623
+ className: "Layer__MileageTrackingSummary__Cards",
43624
+ gap: "md",
43625
+ children: [
43626
+ /* @__PURE__ */ jsx("div", {
43627
+ className: "Layer__MileageTrackingSummary__StatCardSlot",
43628
+ children: /* @__PURE__ */ jsx(MileageTrackingStatsCard, {
43629
+ title: t("mileageTracking:label.total_deduction", "Total Deduction"),
43630
+ amount: (_selectedYearData$est = selectedYearData === null || selectedYearData === void 0 ? void 0 : selectedYearData.estimatedDeduction) !== null && _selectedYearData$est !== void 0 ? _selectedYearData$est : 0,
43631
+ formatAsMoney: true,
43632
+ description: inYearLabel
43633
+ })
43634
+ }),
43635
+ /* @__PURE__ */ jsx("div", {
43636
+ className: "Layer__MileageTrackingSummary__StatCardSlot",
43637
+ children: /* @__PURE__ */ jsx(MileageTrackingStatsCard, {
43638
+ title: t("mileageTracking:label.total_miles", "Total Miles"),
43639
+ amount: (_selectedYearData$mil = selectedYearData === null || selectedYearData === void 0 ? void 0 : selectedYearData.miles) !== null && _selectedYearData$mil !== void 0 ? _selectedYearData$mil : 0,
43640
+ description: inYearLabel
43641
+ })
43642
+ }),
43643
+ /* @__PURE__ */ jsx("div", {
43644
+ className: "Layer__MileageTrackingSummary__StatCardSlot",
43645
+ children: /* @__PURE__ */ jsx(MileageTrackingStatsCard, {
43646
+ title: t("trips:label.trips", "Trips"),
43647
+ amount: (_selectedYearData$tri = selectedYearData === null || selectedYearData === void 0 ? void 0 : selectedYearData.trips) !== null && _selectedYearData$tri !== void 0 ? _selectedYearData$tri : 0,
43648
+ description: inYearLabel
43632
43649
  })
43633
- ]
43634
- })), /* @__PURE__ */ jsx(VStack, {
43635
- className: "Layer__MileageTrackingSummary__Chart",
43636
- fluid: true,
43637
- justify: "end",
43638
- children: /* @__PURE__ */ jsx(MileageDeductionChart, {
43639
- data: chartData,
43640
- selectedYear,
43641
- chartHeight: isDesktop ? 250 : 200
43642
43650
  })
43643
- })]
43644
- });
43645
- }
43646
- })]
43651
+ ]
43652
+ })), /* @__PURE__ */ jsx(VStack, {
43653
+ className: "Layer__MileageTrackingSummary__Chart",
43654
+ fluid: true,
43655
+ justify: "end",
43656
+ children: /* @__PURE__ */ jsx(MileageDeductionChart, {
43657
+ data: chartData,
43658
+ selectedYear,
43659
+ chartHeight: isDesktop ? 250 : 200
43660
+ })
43661
+ })]
43662
+ });
43663
+ }
43664
+ });
43665
+ };
43666
+ var MileageTrackingSummary = ({ stringOverrides, interactionProps } = {}) => {
43667
+ const { t } = useTranslation();
43668
+ return /* @__PURE__ */ jsx(SummaryCard, {
43669
+ className: "Layer__MileageTrackingSummary",
43670
+ slots: useSummaryCardSlots({
43671
+ defaultTitle: t("mileageTracking:label.mileage_tracking", "Mileage Tracking"),
43672
+ interactionProps,
43673
+ stringOverrides
43674
+ }),
43675
+ children: /* @__PURE__ */ jsx(Content$1, {})
43647
43676
  });
43648
43677
  };
43649
43678
  //#endregion
@@ -43702,16 +43731,224 @@ var ProfitAndLossSummaryCard = ({ interactionProps, stringOverrides, className }
43702
43731
  interactionProps,
43703
43732
  stringOverrides
43704
43733
  });
43705
- return /* @__PURE__ */ jsx(SummaryCard, {
43706
- className: classNames("Layer__ProfitAndLossSummaryCard", className),
43734
+ return /* @__PURE__ */ jsxs(SummaryCard, {
43735
+ className: classNames("Layer__ProfitAndLossSummaryCard", "Layer__UI__Chart--focusReset", className),
43707
43736
  slots,
43708
- children: /* @__PURE__ */ jsxs(VStack, {
43709
- gap: "sm",
43710
- children: [/* @__PURE__ */ jsx(ProfitAndLossChart, {
43711
- tagFilter,
43712
- hideLegend: true
43713
- }), !isDesktop && legend]
43714
- })
43737
+ children: [/* @__PURE__ */ jsx(ProfitAndLossChart, {
43738
+ tagFilter,
43739
+ hideLegend: true
43740
+ }), !isDesktop && legend]
43741
+ });
43742
+ };
43743
+ //#endregion
43744
+ //#region src/types/location.ts
43745
+ var US_STATES_CONFIG = [
43746
+ _objectSpread2({ value: "AL" }, translationKey("usStates:label.alabama", "Alabama")),
43747
+ _objectSpread2({ value: "AK" }, translationKey("usStates:label.alaska", "Alaska")),
43748
+ _objectSpread2({ value: "AZ" }, translationKey("usStates:label.arizona", "Arizona")),
43749
+ _objectSpread2({ value: "AR" }, translationKey("usStates:label.arkansas", "Arkansas")),
43750
+ _objectSpread2({ value: "CA" }, translationKey("usStates:label.california", "California")),
43751
+ _objectSpread2({ value: "CO" }, translationKey("usStates:label.colorado", "Colorado")),
43752
+ _objectSpread2({ value: "CT" }, translationKey("usStates:label.connecticut", "Connecticut")),
43753
+ _objectSpread2({ value: "DE" }, translationKey("usStates:label.delaware", "Delaware")),
43754
+ _objectSpread2({ value: "DC" }, translationKey("usStates:label.district_columbia", "District of Columbia")),
43755
+ _objectSpread2({ value: "FL" }, translationKey("usStates:label.florida", "Florida")),
43756
+ _objectSpread2({ value: "GA" }, translationKey("usStates:label.georgia", "Georgia")),
43757
+ _objectSpread2({ value: "HI" }, translationKey("usStates:label.hawaii", "Hawaii")),
43758
+ _objectSpread2({ value: "ID" }, translationKey("usStates:label.idaho", "Idaho")),
43759
+ _objectSpread2({ value: "IL" }, translationKey("usStates:label.illinois", "Illinois")),
43760
+ _objectSpread2({ value: "IN" }, translationKey("usStates:label.indiana", "Indiana")),
43761
+ _objectSpread2({ value: "IA" }, translationKey("usStates:label.iowa", "Iowa")),
43762
+ _objectSpread2({ value: "KS" }, translationKey("usStates:label.kansas", "Kansas")),
43763
+ _objectSpread2({ value: "KY" }, translationKey("usStates:label.kentucky", "Kentucky")),
43764
+ _objectSpread2({ value: "LA" }, translationKey("usStates:label.louisiana", "Louisiana")),
43765
+ _objectSpread2({ value: "ME" }, translationKey("usStates:label.maine", "Maine")),
43766
+ _objectSpread2({ value: "MD" }, translationKey("usStates:label.maryland", "Maryland")),
43767
+ _objectSpread2({ value: "MA" }, translationKey("usStates:label.massachusetts", "Massachusetts")),
43768
+ _objectSpread2({ value: "MI" }, translationKey("usStates:label.michigan", "Michigan")),
43769
+ _objectSpread2({ value: "MN" }, translationKey("usStates:label.minnesota", "Minnesota")),
43770
+ _objectSpread2({ value: "MS" }, translationKey("usStates:label.mississippi", "Mississippi")),
43771
+ _objectSpread2({ value: "MO" }, translationKey("usStates:label.missouri", "Missouri")),
43772
+ _objectSpread2({ value: "MT" }, translationKey("usStates:label.montana", "Montana")),
43773
+ _objectSpread2({ value: "NE" }, translationKey("usStates:label.nebraska", "Nebraska")),
43774
+ _objectSpread2({ value: "NV" }, translationKey("usStates:label.nevada", "Nevada")),
43775
+ _objectSpread2({ value: "NH" }, translationKey("usStates:label.new_hampshire", "New Hampshire")),
43776
+ _objectSpread2({ value: "NJ" }, translationKey("usStates:label.new_jersey", "New Jersey")),
43777
+ _objectSpread2({ value: "NM" }, translationKey("usStates:label.new_mexico", "New Mexico")),
43778
+ _objectSpread2({ value: "NY" }, translationKey("usStates:label.new_york", "New York")),
43779
+ _objectSpread2({ value: "NC" }, translationKey("usStates:label.north_carolina", "North Carolina")),
43780
+ _objectSpread2({ value: "ND" }, translationKey("usStates:label.north_dakota", "North Dakota")),
43781
+ _objectSpread2({ value: "OH" }, translationKey("usStates:label.ohio", "Ohio")),
43782
+ _objectSpread2({ value: "OK" }, translationKey("usStates:label.oklahoma", "Oklahoma")),
43783
+ _objectSpread2({ value: "OR" }, translationKey("usStates:label.oregon", "Oregon")),
43784
+ _objectSpread2({ value: "PA" }, translationKey("usStates:label.pennsylvania", "Pennsylvania")),
43785
+ _objectSpread2({ value: "RI" }, translationKey("usStates:label.rhode_island", "Rhode Island")),
43786
+ _objectSpread2({ value: "SC" }, translationKey("usStates:label.south_carolina", "South Carolina")),
43787
+ _objectSpread2({ value: "SD" }, translationKey("usStates:label.south_dakota", "South Dakota")),
43788
+ _objectSpread2({ value: "TN" }, translationKey("usStates:label.tennessee", "Tennessee")),
43789
+ _objectSpread2({ value: "TX" }, translationKey("usStates:label.texas", "Texas")),
43790
+ _objectSpread2({ value: "UT" }, translationKey("usStates:label.utah", "Utah")),
43791
+ _objectSpread2({ value: "VT" }, translationKey("usStates:label.vermont", "Vermont")),
43792
+ _objectSpread2({ value: "VA" }, translationKey("usStates:label.virginia", "Virginia")),
43793
+ _objectSpread2({ value: "WA" }, translationKey("usStates:label.washington", "Washington")),
43794
+ _objectSpread2({ value: "WV" }, translationKey("usStates:label.west_virginia", "West Virginia")),
43795
+ _objectSpread2({ value: "WI" }, translationKey("usStates:label.wisconsin", "Wisconsin")),
43796
+ _objectSpread2({ value: "WY" }, translationKey("usStates:label.wyoming", "Wyoming")),
43797
+ _objectSpread2({ value: "PR" }, translationKey("usStates:label.puerto_rico", "Puerto Rico"))
43798
+ ];
43799
+ var US_STATE_VALUES = US_STATES_CONFIG.map((s) => s.value);
43800
+ //#endregion
43801
+ //#region src/schemas/taxEstimates/filingStatus.ts
43802
+ var FilingStatus = /* @__PURE__ */ function(FilingStatus) {
43803
+ FilingStatus["SINGLE"] = "SINGLE";
43804
+ FilingStatus["MARRIED"] = "MARRIED";
43805
+ FilingStatus["MARRIED_SEPARATELY"] = "MARRIED_SEPARATELY";
43806
+ FilingStatus["HEAD"] = "HEAD";
43807
+ FilingStatus["WIDOWER"] = "WIDOWER";
43808
+ return FilingStatus;
43809
+ }({});
43810
+ var FilingStatusSchema = Schema.Enums(FilingStatus);
43811
+ //#endregion
43812
+ //#region src/schemas/taxEstimates/profile.ts
43813
+ var USStateCodeSchema = Schema.Literal(...US_STATE_VALUES);
43814
+ var WithholdingSchema = Schema.Struct({
43815
+ useCustomWithholding: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Boolean)), Schema.fromKey("use_custom_withholding")),
43816
+ amount: Schema.NullishOr(Schema.Number)
43817
+ });
43818
+ var HomeOfficeDeductionSchema = Schema.Struct({
43819
+ useHomeOfficeDeduction: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Boolean)), Schema.fromKey("use_home_office_deduction")),
43820
+ homeOfficeArea: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Number)), Schema.fromKey("home_office_area"))
43821
+ });
43822
+ var VehicleDeductionSchema = Schema.Struct({ useMileageDeduction: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Boolean)), Schema.fromKey("use_mileage_deduction")) });
43823
+ var DeductionsSchema = Schema.Struct({
43824
+ homeOffice: pipe(Schema.propertySignature(Schema.NullishOr(HomeOfficeDeductionSchema)), Schema.fromKey("home_office")),
43825
+ vehicle: Schema.NullishOr(VehicleDeductionSchema)
43826
+ });
43827
+ var FederalConfigurationSchema = Schema.Struct({
43828
+ filingStatus: pipe(Schema.propertySignature(Schema.NullishOr(FilingStatusSchema)), Schema.fromKey("filing_status")),
43829
+ annualW2Income: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Number)), Schema.fromKey("annual_w2_income")),
43830
+ tipIncome: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Number)), Schema.fromKey("tip_income")),
43831
+ overtimeIncome: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Number)), Schema.fromKey("overtime_income")),
43832
+ withholding: Schema.NullishOr(WithholdingSchema)
43833
+ });
43834
+ var StateConfigurationSchema = Schema.Struct({
43835
+ taxState: pipe(Schema.propertySignature(Schema.NullishOr(USStateCodeSchema)), Schema.fromKey("tax_state")),
43836
+ filingStatus: pipe(Schema.propertySignature(Schema.NullishOr(FilingStatusSchema)), Schema.fromKey("filing_status")),
43837
+ withholding: Schema.NullishOr(WithholdingSchema)
43838
+ });
43839
+ var UsConfigurationSchema = Schema.Struct({
43840
+ federal: Schema.NullishOr(FederalConfigurationSchema),
43841
+ state: Schema.NullishOr(StateConfigurationSchema),
43842
+ deductions: pipe(Schema.propertySignature(Schema.NullishOr(DeductionsSchema)), Schema.fromKey("deductions"))
43843
+ });
43844
+ var TaxProfileSchema = Schema.Struct({
43845
+ taxCountryCode: pipe(Schema.propertySignature(Schema.NullishOr(Schema.String)), Schema.fromKey("tax_country_code")),
43846
+ usConfiguration: pipe(Schema.propertySignature(Schema.NullishOr(UsConfigurationSchema)), Schema.fromKey("us_configuration")),
43847
+ userHasSavedTaxProfile: pipe(Schema.propertySignature(Schema.Boolean), Schema.fromKey("user_has_saved_tax_profile"))
43848
+ });
43849
+ var TaxProfileResponseSchema = Schema.Struct({ data: TaxProfileSchema });
43850
+ var TaxProfileRequestSchema = Schema.Struct({
43851
+ taxCountryCode: pipe(Schema.propertySignature(Schema.NullishOr(Schema.String)), Schema.fromKey("tax_country_code")),
43852
+ usConfiguration: pipe(Schema.propertySignature(Schema.NullishOr(UsConfigurationSchema)), Schema.fromKey("us_configuration"))
43853
+ });
43854
+ //#endregion
43855
+ //#region src/hooks/api/businesses/[business-id]/tax-estimates/profile/useTaxProfile.ts
43856
+ var TAX_PROFILE_TAG_KEY = "#tax-profile";
43857
+ var getTaxProfile = get(({ businessId }) => {
43858
+ return `/v1/businesses/${businessId}/tax-estimates/profile`;
43859
+ });
43860
+ function buildKey$17({ access_token: accessToken, apiUrl, businessId }) {
43861
+ if (accessToken && apiUrl) return {
43862
+ accessToken,
43863
+ apiUrl,
43864
+ businessId,
43865
+ tags: [TAX_PROFILE_TAG_KEY]
43866
+ };
43867
+ }
43868
+ function useTaxProfile() {
43869
+ const withLocale = useLocalizedKey();
43870
+ const { data: auth } = useAuth();
43871
+ const { businessId } = useLayerContext();
43872
+ return new SWRQueryResult(useSWR(() => withLocale(buildKey$17(_objectSpread2(_objectSpread2({}, auth), {}, { businessId }))), function() {
43873
+ var _ref = _asyncToGenerator(function* ({ accessToken, apiUrl, businessId }) {
43874
+ return getTaxProfile(apiUrl, accessToken, { params: { businessId } })().then(Schema.decodeUnknownPromise(TaxProfileResponseSchema)).then(({ data }) => data);
43875
+ });
43876
+ return function(_x) {
43877
+ return _ref.apply(this, arguments);
43878
+ };
43879
+ }()));
43880
+ }
43881
+ function useTaxProfileGlobalCacheActions() {
43882
+ const { patchCache } = useGlobalCacheActions();
43883
+ return { patchTaxProfile: useCallback((updatedProfile) => patchCache(({ tags }) => tags.includes(TAX_PROFILE_TAG_KEY), () => updatedProfile), [patchCache]) };
43884
+ }
43885
+ //#endregion
43886
+ //#region src/components/SolopreneurOnboardingBanner/SolopreneurOnboardingBanner.tsx
43887
+ var OnboardingBannerState = /* @__PURE__ */ function(OnboardingBannerState) {
43888
+ OnboardingBannerState["Loading"] = "Loading";
43889
+ OnboardingBannerState["NoBankAccountsLinked"] = "NoBankAccountsLinked";
43890
+ OnboardingBannerState["NoTaxProfile"] = "NoTaxProfile";
43891
+ OnboardingBannerState["Onboarded"] = "Onboarded";
43892
+ return OnboardingBannerState;
43893
+ }(OnboardingBannerState || {});
43894
+ var getOnboardingBannerState = ({ isLoading, hasLinkedAccounts, hasSavedTaxProfile }) => {
43895
+ if (isLoading) return OnboardingBannerState.Loading;
43896
+ if (!hasLinkedAccounts) return OnboardingBannerState.NoBankAccountsLinked;
43897
+ if (!hasSavedTaxProfile) return OnboardingBannerState.NoTaxProfile;
43898
+ return OnboardingBannerState.Onboarded;
43899
+ };
43900
+ var NoBankAccountsLinkedBanner = () => {
43901
+ const { addConnection } = useContext(LinkedAccountsContext);
43902
+ const { isMobile } = useSizeClass();
43903
+ const handleLinkBankAccounts = useCallback(() => {
43904
+ addConnection("PLAID");
43905
+ }, [addConnection]);
43906
+ return /* @__PURE__ */ jsx(Banner, {
43907
+ title: "Link your bank accounts",
43908
+ description: "Linking your bank accounts allows us to load your bank transactions and automatically categorize them.",
43909
+ slots: {
43910
+ Icon: isMobile ? null : /* @__PURE__ */ jsx(Info, { size: 16 }),
43911
+ Button: /* @__PURE__ */ jsx(Button$1, {
43912
+ onPress: handleLinkBankAccounts,
43913
+ variant: "outlined-light",
43914
+ children: "Link your bank accounts"
43915
+ })
43916
+ }
43917
+ });
43918
+ };
43919
+ var NoTaxProfileBanner = ({ onSetupTaxProfile }) => {
43920
+ const { isMobile } = useSizeClass();
43921
+ return /* @__PURE__ */ jsx(Banner, {
43922
+ title: "Set up your tax profile",
43923
+ description: "Configuring your tax profile allows us to provide you with tax estimates and avoid any surprises come tax time.",
43924
+ slots: {
43925
+ Icon: isMobile ? null : /* @__PURE__ */ jsx(Info, { size: 16 }),
43926
+ Button: onSetupTaxProfile ? /* @__PURE__ */ jsx(Button$1, {
43927
+ onPress: onSetupTaxProfile,
43928
+ variant: "outlined-light",
43929
+ children: "Setup your tax profile"
43930
+ }) : null
43931
+ }
43932
+ });
43933
+ };
43934
+ function SolopreneurOnboardingBannerInternal({ onSetupTaxProfile }) {
43935
+ const state = useSolopreneurOnboardingBannerState();
43936
+ if (state === OnboardingBannerState.Loading || state === OnboardingBannerState.Onboarded) return null;
43937
+ return /* @__PURE__ */ jsxs(HStack, {
43938
+ className: "Layer__SolopreneurLayout__OnboardingBanner",
43939
+ children: [state === OnboardingBannerState.NoBankAccountsLinked && /* @__PURE__ */ jsx(NoBankAccountsLinkedBanner, {}), state === OnboardingBannerState.NoTaxProfile && /* @__PURE__ */ jsx(NoTaxProfileBanner, { onSetupTaxProfile })]
43940
+ });
43941
+ }
43942
+ function SolopreneurOnboardingBanner({ onSetupTaxProfile }) {
43943
+ return /* @__PURE__ */ jsx(LinkedAccountsProvider, { children: /* @__PURE__ */ jsx(SolopreneurOnboardingBannerInternal, { onSetupTaxProfile }) });
43944
+ }
43945
+ var useSolopreneurOnboardingBannerState = () => {
43946
+ const { data: linkedAccounts, isLoading: isLinkedAccountsLoading, loadingStatus: linkedAccountsLoadingStatus } = useContext(LinkedAccountsContext);
43947
+ const { data: taxProfile, isLoading: isTaxProfileLoading } = useTaxProfile();
43948
+ return getOnboardingBannerState({
43949
+ isLoading: isLinkedAccountsLoading || isTaxProfileLoading || linkedAccountsLoadingStatus === "loading" || linkedAccountsLoadingStatus === "initial",
43950
+ hasLinkedAccounts: Array.isArray(linkedAccounts) && linkedAccounts.length > 0,
43951
+ hasSavedTaxProfile: (taxProfile === null || taxProfile === void 0 ? void 0 : taxProfile.userHasSavedTaxProfile) === true
43715
43952
  });
43716
43953
  };
43717
43954
  //#endregion
@@ -43844,11 +44081,18 @@ var CHART_MARGIN$1 = {
43844
44081
  };
43845
44082
  var CHART_BORDER_RADIUS$1 = 8;
43846
44083
  var Y_AXIS_CATEGORY_KEY = "__layer_hbar_category";
44084
+ var SMALL_SEGMENT_THRESHOLD = .25;
44085
+ function determineLabelMode(requestedLabelMode, positiveItems, legendDenominator) {
44086
+ if (legendDenominator <= 0) return LegendLayout.Table;
44087
+ if (positiveItems.some((item) => item.value / legendDenominator < SMALL_SEGMENT_THRESHOLD)) return LegendLayout.Table;
44088
+ return requestedLabelMode;
44089
+ }
43847
44090
  var HorizontalBarChart = ({ data, stylingProps, formatValue, showLegend = true, labelMode = LegendLayout.Table, slots }) => {
43848
44091
  const { data: items, total } = data;
43849
44092
  const positiveItems = useMemo(() => items.filter((item) => item.value > 0), [items]);
43850
44093
  const positiveTotal = positiveItems.reduce((sum, item) => sum + item.value, 0);
43851
44094
  const legendDenominator = positiveTotal > 0 ? positiveTotal : total;
44095
+ const effectiveLabelMode = determineLabelMode(labelMode, positiveItems, legendDenominator);
43852
44096
  const chartData = useMemo(() => {
43853
44097
  return [positiveItems.reduce((acc, item) => {
43854
44098
  acc[item.name] = item.value;
@@ -43861,7 +44105,7 @@ var HorizontalBarChart = ({ data, stylingProps, formatValue, showLegend = true,
43861
44105
  total: legendDenominator,
43862
44106
  colorSelector: stylingProps.colorSelector,
43863
44107
  formatValue,
43864
- layout: labelMode
44108
+ layout: effectiveLabelMode
43865
44109
  });
43866
44110
  return /* @__PURE__ */ jsxs(VStack, {
43867
44111
  className: "Layer__HorizontalBarChart Layer__UI__Chart--focusReset",
@@ -43956,7 +44200,7 @@ var getTaxSummary = get(({ businessId, year, reportingBasis, fullYearProjection
43956
44200
  full_year_projection: fullYearProjection
43957
44201
  })}`;
43958
44202
  });
43959
- function buildKey$17({ access_token: accessToken, apiUrl, businessId, year, reportingBasis, fullYearProjection, enabled = true }) {
44203
+ function buildKey$16({ access_token: accessToken, apiUrl, businessId, year, reportingBasis, fullYearProjection, enabled = true }) {
43960
44204
  if (!enabled) return;
43961
44205
  if (accessToken && apiUrl) return {
43962
44206
  accessToken,
@@ -43972,7 +44216,7 @@ function useTaxSummary({ year, reportingBasis, fullYearProjection, enabled = tru
43972
44216
  const withLocale = useLocalizedKey();
43973
44217
  const { data: auth } = useAuth();
43974
44218
  const { businessId } = useLayerContext();
43975
- return new SWRQueryResult(useSWR(() => withLocale(buildKey$17(_objectSpread2(_objectSpread2({}, auth), {}, {
44219
+ return new SWRQueryResult(useSWR(() => withLocale(buildKey$16(_objectSpread2(_objectSpread2({}, auth), {}, {
43976
44220
  businessId,
43977
44221
  year,
43978
44222
  reportingBasis,
@@ -44184,10 +44428,10 @@ function allTaxSectionsAreEmpty(summary) {
44184
44428
  function TaxEstimatesSummaryCardEmpty() {
44185
44429
  const { t } = useTranslation();
44186
44430
  return /* @__PURE__ */ jsx(DataState, {
44431
+ className: "Layer__TaxEstimatesSummaryCard--empty",
44187
44432
  status: DataStateStatus.info,
44188
44433
  title: t("taxEstimates:empty.no_tax_estimates_summary", "Get started with your tax estimates"),
44189
- description: t("taxEstimates:empty.no_tax_estimates_summary_description", "Start by importing and categorizing your bank transactions"),
44190
- spacing: true
44434
+ description: t("taxEstimates:empty.no_tax_estimates_summary_description", "Start by importing and categorizing your bank transactions")
44191
44435
  });
44192
44436
  }
44193
44437
  var TaxEstimatesSummaryCardMode = /* @__PURE__ */ function(TaxEstimatesSummaryCardMode) {
@@ -44252,11 +44496,9 @@ var PieChartContent = ({ data, commonProps, layout }) => {
44252
44496
  children: [/* @__PURE__ */ jsx(DetailedChart, _objectSpread2({ data }, commonProps)), /* @__PURE__ */ jsx(DetailedTableWithData, _objectSpread2(_objectSpread2({ data }, commonProps), NO_SORT_PROPS))]
44253
44497
  });
44254
44498
  };
44255
- var TaxEstimatesSummaryCard = ({ mode = TaxEstimatesSummaryCardMode.PieChart, title: titleOverride, withHeaderSeparator = false } = {}) => {
44499
+ var TaxEstimatesSummaryCard = ({ mode = TaxEstimatesSummaryCardMode.PieChart, interactionProps, stringOverrides } = {}) => {
44256
44500
  const { detailData, layout, title: defaultTitle, isLoading, isError } = useTaxEstimatesSummaryCard();
44257
- const { isDesktop } = useSizeClass();
44258
44501
  const isSummaryCardLayout = layout === "summaryCard";
44259
- const title = titleOverride !== null && titleOverride !== void 0 ? titleOverride : defaultTitle;
44260
44502
  const commonProps = useMemo(() => {
44261
44503
  var _detailData$data;
44262
44504
  const colorByKey = detailData === null || detailData === void 0 || (_detailData$data = detailData.data) === null || _detailData$data === void 0 ? void 0 : _detailData$data.reduce((acc, item) => {
@@ -44274,82 +44516,69 @@ var TaxEstimatesSummaryCard = ({ mode = TaxEstimatesSummaryCardMode.PieChart, ti
44274
44516
  } }
44275
44517
  };
44276
44518
  }, [detailData === null || detailData === void 0 ? void 0 : detailData.data]);
44277
- return /* @__PURE__ */ jsx(VStack, {
44278
- className: "Layer__TaxEstimatesSummaryCard__Container",
44279
- children: /* @__PURE__ */ jsx(Card, {
44280
- className: classNames("Layer__TaxEstimatesSummaryCard", isSummaryCardLayout && "Layer__TaxEstimatesSummaryCard--summaryCard"),
44281
- children: /* @__PURE__ */ jsxs(VStack, {
44282
- gap: "md",
44283
- className: "Layer__TaxEstimatesSummaryCard__Body",
44284
- children: [/* @__PURE__ */ jsx(HStack, {
44285
- className: classNames("Layer__TaxEstimatesSummaryCard__Header", (isSummaryCardLayout || withHeaderSeparator) && "Layer__SummaryCard__ContainerHeader"),
44286
- justify: "space-between",
44287
- align: isSummaryCardLayout ? "center" : "start",
44288
- gap: "md",
44289
- children: /* @__PURE__ */ jsx(Heading$2, {
44290
- size: !isDesktop ? "sm" : "md",
44291
- children: title
44292
- })
44293
- }), /* @__PURE__ */ jsx(ConditionalBlock, {
44294
- data: detailData,
44295
- isLoading,
44296
- isError,
44297
- Loading: /* @__PURE__ */ jsx(LoadingState$1, { mode }),
44298
- Error: /* @__PURE__ */ jsx(ErrorState$2, {}),
44299
- children: ({ data }) => allTaxSectionsAreEmpty(data) ? /* @__PURE__ */ jsx(TaxEstimatesSummaryCardEmpty, {}) : /* @__PURE__ */ jsx(Content, {
44300
- data,
44301
- mode,
44302
- commonProps,
44303
- layout
44304
- })
44305
- })]
44519
+ const slots = useSummaryCardSlots({
44520
+ defaultTitle,
44521
+ interactionProps,
44522
+ stringOverrides
44523
+ });
44524
+ return /* @__PURE__ */ jsx(SummaryCard, {
44525
+ className: classNames("Layer__TaxEstimatesSummaryCard", isSummaryCardLayout && "Layer__TaxEstimatesSummaryCard--summaryCard"),
44526
+ slots,
44527
+ children: /* @__PURE__ */ jsx(ConditionalBlock, {
44528
+ data: detailData,
44529
+ isLoading,
44530
+ isError,
44531
+ Loading: /* @__PURE__ */ jsx(LoadingState$1, { mode }),
44532
+ Error: /* @__PURE__ */ jsx(ErrorState$2, {}),
44533
+ children: ({ data }) => allTaxSectionsAreEmpty(data) ? /* @__PURE__ */ jsx(TaxEstimatesSummaryCardEmpty, {}) : /* @__PURE__ */ jsx(Content, {
44534
+ data,
44535
+ mode,
44536
+ commonProps,
44537
+ layout
44306
44538
  })
44307
44539
  })
44308
44540
  });
44309
44541
  };
44310
44542
  //#endregion
44311
44543
  //#region src/views/SolopreneurOverview/SolopreneurOverview.tsx
44312
- var SolopreneurOverview = ({ showTitle = true, enableOnboarding = false, onboardingStepOverride = void 0, onTransactionsToReviewClick, middleBanner, chartColorsList, stringOverrides, tagFilter = void 0, slotProps }) => {
44313
- var _slotProps$profitAndL, _stringOverrides$card, _stringOverrides$card2, _stringOverrides$card3, _stringOverrides$card4;
44544
+ var SolopreneurOverview = ({ interactionProps, chartColorsList, stringOverrides }) => {
44545
+ var _interactionProps$ban, _interactionProps$pro, _stringOverrides$summ, _interactionProps$sum, _stringOverrides$summ2, _interactionProps$sum2, _stringOverrides$summ3, _interactionProps$sum3, _interactionProps$sum4, _stringOverrides$summ4;
44314
44546
  const { t } = useTranslation();
44315
44547
  const { value: sizeClass } = useSizeClass();
44316
- const profitAndLossSummariesVariants = slotProps === null || slotProps === void 0 || (_slotProps$profitAndL = slotProps.profitAndLoss) === null || _slotProps$profitAndL === void 0 || (_slotProps$profitAndL = _slotProps$profitAndL.summaries) === null || _slotProps$profitAndL === void 0 ? void 0 : _slotProps$profitAndL.variants;
44317
44548
  return /* @__PURE__ */ jsx(ProfitAndLoss, {
44318
44549
  asContainer: false,
44319
- tagFilter: tagFilter ? {
44320
- key: tagFilter.tagKey,
44321
- values: tagFilter.tagValues
44322
- } : void 0,
44323
44550
  children: /* @__PURE__ */ jsxs(View, {
44324
44551
  title: (stringOverrides === null || stringOverrides === void 0 ? void 0 : stringOverrides.title) || t("common:label.overview", "Overview"),
44325
- showHeader: showTitle,
44552
+ showHeader: true,
44326
44553
  header: /* @__PURE__ */ jsx(Header$2, { children: /* @__PURE__ */ jsx(HeaderRow, { children: /* @__PURE__ */ jsx(HeaderCol, { children: /* @__PURE__ */ jsx(GlobalMonthPicker, { truncateMonth: sizeClass === "mobile" }) }) }) }),
44327
44554
  children: [
44328
- enableOnboarding && /* @__PURE__ */ jsx(Onboarding, {
44329
- onTransactionsToReviewClick,
44330
- onboardingStepOverride
44331
- }),
44555
+ /* @__PURE__ */ jsx(SolopreneurOnboardingBanner, { onSetupTaxProfile: interactionProps === null || interactionProps === void 0 || (_interactionProps$ban = interactionProps.banner) === null || _interactionProps$ban === void 0 ? void 0 : _interactionProps$ban.onSetupTaxProfile }),
44332
44556
  /* @__PURE__ */ jsx(ProfitAndLossSummaries, {
44333
44557
  stringOverrides: stringOverrides === null || stringOverrides === void 0 ? void 0 : stringOverrides.profitAndLossSummaries,
44334
44558
  chartColorsList,
44335
- onTransactionsToReviewClick,
44336
- variants: profitAndLossSummariesVariants
44559
+ onTransactionsToReviewClick: interactionProps === null || interactionProps === void 0 || (_interactionProps$pro = interactionProps.profitAndLossSummaries) === null || _interactionProps$pro === void 0 ? void 0 : _interactionProps$pro.onTransactionsToReviewClick
44337
44560
  }),
44338
- middleBanner,
44339
44561
  /* @__PURE__ */ jsxs("div", {
44340
44562
  className: "Layer__SolopreneurOverview__Grid",
44341
44563
  children: [
44342
- /* @__PURE__ */ jsx(ProfitAndLossSummaryCard, { stringOverrides: { title: stringOverrides === null || stringOverrides === void 0 || (_stringOverrides$card = stringOverrides.cards) === null || _stringOverrides$card === void 0 || (_stringOverrides$card = _stringOverrides$card.profitAndLoss) === null || _stringOverrides$card === void 0 ? void 0 : _stringOverrides$card.header } }),
44564
+ /* @__PURE__ */ jsx(ProfitAndLossSummaryCard, {
44565
+ stringOverrides: stringOverrides === null || stringOverrides === void 0 || (_stringOverrides$summ = stringOverrides.summaryCards) === null || _stringOverrides$summ === void 0 ? void 0 : _stringOverrides$summ.profitAndLoss,
44566
+ interactionProps: interactionProps === null || interactionProps === void 0 || (_interactionProps$sum = interactionProps.summaryCards) === null || _interactionProps$sum === void 0 ? void 0 : _interactionProps$sum.profitAndLoss
44567
+ }),
44343
44568
  /* @__PURE__ */ jsx(ExpensesSummaryCard, {
44344
44569
  stylingProps: { chartColorsList },
44345
- stringOverrides: { title: stringOverrides === null || stringOverrides === void 0 || (_stringOverrides$card2 = stringOverrides.cards) === null || _stringOverrides$card2 === void 0 || (_stringOverrides$card2 = _stringOverrides$card2.expenses) === null || _stringOverrides$card2 === void 0 ? void 0 : _stringOverrides$card2.header }
44570
+ stringOverrides: stringOverrides === null || stringOverrides === void 0 || (_stringOverrides$summ2 = stringOverrides.summaryCards) === null || _stringOverrides$summ2 === void 0 ? void 0 : _stringOverrides$summ2.expenses,
44571
+ interactionProps: interactionProps === null || interactionProps === void 0 || (_interactionProps$sum2 = interactionProps.summaryCards) === null || _interactionProps$sum2 === void 0 ? void 0 : _interactionProps$sum2.expenses
44346
44572
  }),
44347
44573
  /* @__PURE__ */ jsx(TaxEstimatesSummaryCard, {
44348
44574
  mode: TaxEstimatesSummaryCardMode.HorizontalBarChart,
44349
- withHeaderSeparator: true,
44350
- title: stringOverrides === null || stringOverrides === void 0 || (_stringOverrides$card3 = stringOverrides.cards) === null || _stringOverrides$card3 === void 0 || (_stringOverrides$card3 = _stringOverrides$card3.taxEstimates) === null || _stringOverrides$card3 === void 0 ? void 0 : _stringOverrides$card3.header
44575
+ stringOverrides: stringOverrides === null || stringOverrides === void 0 || (_stringOverrides$summ3 = stringOverrides.summaryCards) === null || _stringOverrides$summ3 === void 0 ? void 0 : _stringOverrides$summ3.taxEstimates,
44576
+ interactionProps: interactionProps === null || interactionProps === void 0 || (_interactionProps$sum3 = interactionProps.summaryCards) === null || _interactionProps$sum3 === void 0 ? void 0 : _interactionProps$sum3.taxEstimates
44351
44577
  }),
44352
- /* @__PURE__ */ jsx(MileageTrackingSummary, _objectSpread2({}, stringOverrides === null || stringOverrides === void 0 || (_stringOverrides$card4 = stringOverrides.cards) === null || _stringOverrides$card4 === void 0 ? void 0 : _stringOverrides$card4.mileageTracking))
44578
+ /* @__PURE__ */ jsx(MileageTrackingSummary, {
44579
+ interactionProps: interactionProps === null || interactionProps === void 0 || (_interactionProps$sum4 = interactionProps.summaryCards) === null || _interactionProps$sum4 === void 0 ? void 0 : _interactionProps$sum4.mileageTracking,
44580
+ stringOverrides: stringOverrides === null || stringOverrides === void 0 || (_stringOverrides$summ4 = stringOverrides.summaryCards) === null || _stringOverrides$summ4 === void 0 ? void 0 : _stringOverrides$summ4.mileageTracking
44581
+ })
44353
44582
  ]
44354
44583
  })
44355
44584
  ]
@@ -44357,148 +44586,6 @@ var SolopreneurOverview = ({ showTitle = true, enableOnboarding = false, onboard
44357
44586
  });
44358
44587
  };
44359
44588
  //#endregion
44360
- //#region src/types/location.ts
44361
- var US_STATES_CONFIG = [
44362
- _objectSpread2({ value: "AL" }, translationKey("usStates:label.alabama", "Alabama")),
44363
- _objectSpread2({ value: "AK" }, translationKey("usStates:label.alaska", "Alaska")),
44364
- _objectSpread2({ value: "AZ" }, translationKey("usStates:label.arizona", "Arizona")),
44365
- _objectSpread2({ value: "AR" }, translationKey("usStates:label.arkansas", "Arkansas")),
44366
- _objectSpread2({ value: "CA" }, translationKey("usStates:label.california", "California")),
44367
- _objectSpread2({ value: "CO" }, translationKey("usStates:label.colorado", "Colorado")),
44368
- _objectSpread2({ value: "CT" }, translationKey("usStates:label.connecticut", "Connecticut")),
44369
- _objectSpread2({ value: "DE" }, translationKey("usStates:label.delaware", "Delaware")),
44370
- _objectSpread2({ value: "DC" }, translationKey("usStates:label.district_columbia", "District of Columbia")),
44371
- _objectSpread2({ value: "FL" }, translationKey("usStates:label.florida", "Florida")),
44372
- _objectSpread2({ value: "GA" }, translationKey("usStates:label.georgia", "Georgia")),
44373
- _objectSpread2({ value: "HI" }, translationKey("usStates:label.hawaii", "Hawaii")),
44374
- _objectSpread2({ value: "ID" }, translationKey("usStates:label.idaho", "Idaho")),
44375
- _objectSpread2({ value: "IL" }, translationKey("usStates:label.illinois", "Illinois")),
44376
- _objectSpread2({ value: "IN" }, translationKey("usStates:label.indiana", "Indiana")),
44377
- _objectSpread2({ value: "IA" }, translationKey("usStates:label.iowa", "Iowa")),
44378
- _objectSpread2({ value: "KS" }, translationKey("usStates:label.kansas", "Kansas")),
44379
- _objectSpread2({ value: "KY" }, translationKey("usStates:label.kentucky", "Kentucky")),
44380
- _objectSpread2({ value: "LA" }, translationKey("usStates:label.louisiana", "Louisiana")),
44381
- _objectSpread2({ value: "ME" }, translationKey("usStates:label.maine", "Maine")),
44382
- _objectSpread2({ value: "MD" }, translationKey("usStates:label.maryland", "Maryland")),
44383
- _objectSpread2({ value: "MA" }, translationKey("usStates:label.massachusetts", "Massachusetts")),
44384
- _objectSpread2({ value: "MI" }, translationKey("usStates:label.michigan", "Michigan")),
44385
- _objectSpread2({ value: "MN" }, translationKey("usStates:label.minnesota", "Minnesota")),
44386
- _objectSpread2({ value: "MS" }, translationKey("usStates:label.mississippi", "Mississippi")),
44387
- _objectSpread2({ value: "MO" }, translationKey("usStates:label.missouri", "Missouri")),
44388
- _objectSpread2({ value: "MT" }, translationKey("usStates:label.montana", "Montana")),
44389
- _objectSpread2({ value: "NE" }, translationKey("usStates:label.nebraska", "Nebraska")),
44390
- _objectSpread2({ value: "NV" }, translationKey("usStates:label.nevada", "Nevada")),
44391
- _objectSpread2({ value: "NH" }, translationKey("usStates:label.new_hampshire", "New Hampshire")),
44392
- _objectSpread2({ value: "NJ" }, translationKey("usStates:label.new_jersey", "New Jersey")),
44393
- _objectSpread2({ value: "NM" }, translationKey("usStates:label.new_mexico", "New Mexico")),
44394
- _objectSpread2({ value: "NY" }, translationKey("usStates:label.new_york", "New York")),
44395
- _objectSpread2({ value: "NC" }, translationKey("usStates:label.north_carolina", "North Carolina")),
44396
- _objectSpread2({ value: "ND" }, translationKey("usStates:label.north_dakota", "North Dakota")),
44397
- _objectSpread2({ value: "OH" }, translationKey("usStates:label.ohio", "Ohio")),
44398
- _objectSpread2({ value: "OK" }, translationKey("usStates:label.oklahoma", "Oklahoma")),
44399
- _objectSpread2({ value: "OR" }, translationKey("usStates:label.oregon", "Oregon")),
44400
- _objectSpread2({ value: "PA" }, translationKey("usStates:label.pennsylvania", "Pennsylvania")),
44401
- _objectSpread2({ value: "RI" }, translationKey("usStates:label.rhode_island", "Rhode Island")),
44402
- _objectSpread2({ value: "SC" }, translationKey("usStates:label.south_carolina", "South Carolina")),
44403
- _objectSpread2({ value: "SD" }, translationKey("usStates:label.south_dakota", "South Dakota")),
44404
- _objectSpread2({ value: "TN" }, translationKey("usStates:label.tennessee", "Tennessee")),
44405
- _objectSpread2({ value: "TX" }, translationKey("usStates:label.texas", "Texas")),
44406
- _objectSpread2({ value: "UT" }, translationKey("usStates:label.utah", "Utah")),
44407
- _objectSpread2({ value: "VT" }, translationKey("usStates:label.vermont", "Vermont")),
44408
- _objectSpread2({ value: "VA" }, translationKey("usStates:label.virginia", "Virginia")),
44409
- _objectSpread2({ value: "WA" }, translationKey("usStates:label.washington", "Washington")),
44410
- _objectSpread2({ value: "WV" }, translationKey("usStates:label.west_virginia", "West Virginia")),
44411
- _objectSpread2({ value: "WI" }, translationKey("usStates:label.wisconsin", "Wisconsin")),
44412
- _objectSpread2({ value: "WY" }, translationKey("usStates:label.wyoming", "Wyoming")),
44413
- _objectSpread2({ value: "PR" }, translationKey("usStates:label.puerto_rico", "Puerto Rico"))
44414
- ];
44415
- var US_STATE_VALUES = US_STATES_CONFIG.map((s) => s.value);
44416
- //#endregion
44417
- //#region src/schemas/taxEstimates/filingStatus.ts
44418
- var FilingStatus = /* @__PURE__ */ function(FilingStatus) {
44419
- FilingStatus["SINGLE"] = "SINGLE";
44420
- FilingStatus["MARRIED"] = "MARRIED";
44421
- FilingStatus["MARRIED_SEPARATELY"] = "MARRIED_SEPARATELY";
44422
- FilingStatus["HEAD"] = "HEAD";
44423
- FilingStatus["WIDOWER"] = "WIDOWER";
44424
- return FilingStatus;
44425
- }({});
44426
- var FilingStatusSchema = Schema.Enums(FilingStatus);
44427
- //#endregion
44428
- //#region src/schemas/taxEstimates/profile.ts
44429
- var USStateCodeSchema = Schema.Literal(...US_STATE_VALUES);
44430
- var WithholdingSchema = Schema.Struct({
44431
- useCustomWithholding: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Boolean)), Schema.fromKey("use_custom_withholding")),
44432
- amount: Schema.NullishOr(Schema.Number)
44433
- });
44434
- var HomeOfficeDeductionSchema = Schema.Struct({
44435
- useHomeOfficeDeduction: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Boolean)), Schema.fromKey("use_home_office_deduction")),
44436
- homeOfficeArea: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Number)), Schema.fromKey("home_office_area"))
44437
- });
44438
- var VehicleDeductionSchema = Schema.Struct({ useMileageDeduction: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Boolean)), Schema.fromKey("use_mileage_deduction")) });
44439
- var DeductionsSchema = Schema.Struct({
44440
- homeOffice: pipe(Schema.propertySignature(Schema.NullishOr(HomeOfficeDeductionSchema)), Schema.fromKey("home_office")),
44441
- vehicle: Schema.NullishOr(VehicleDeductionSchema)
44442
- });
44443
- var FederalConfigurationSchema = Schema.Struct({
44444
- filingStatus: pipe(Schema.propertySignature(Schema.NullishOr(FilingStatusSchema)), Schema.fromKey("filing_status")),
44445
- annualW2Income: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Number)), Schema.fromKey("annual_w2_income")),
44446
- tipIncome: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Number)), Schema.fromKey("tip_income")),
44447
- overtimeIncome: pipe(Schema.propertySignature(Schema.NullishOr(Schema.Number)), Schema.fromKey("overtime_income")),
44448
- withholding: Schema.NullishOr(WithholdingSchema)
44449
- });
44450
- var StateConfigurationSchema = Schema.Struct({
44451
- taxState: pipe(Schema.propertySignature(Schema.NullishOr(USStateCodeSchema)), Schema.fromKey("tax_state")),
44452
- filingStatus: pipe(Schema.propertySignature(Schema.NullishOr(FilingStatusSchema)), Schema.fromKey("filing_status")),
44453
- withholding: Schema.NullishOr(WithholdingSchema)
44454
- });
44455
- var UsConfigurationSchema = Schema.Struct({
44456
- federal: Schema.NullishOr(FederalConfigurationSchema),
44457
- state: Schema.NullishOr(StateConfigurationSchema),
44458
- deductions: pipe(Schema.propertySignature(Schema.NullishOr(DeductionsSchema)), Schema.fromKey("deductions"))
44459
- });
44460
- var TaxProfileSchema = Schema.Struct({
44461
- taxCountryCode: pipe(Schema.propertySignature(Schema.NullishOr(Schema.String)), Schema.fromKey("tax_country_code")),
44462
- usConfiguration: pipe(Schema.propertySignature(Schema.NullishOr(UsConfigurationSchema)), Schema.fromKey("us_configuration")),
44463
- userHasSavedTaxProfile: pipe(Schema.propertySignature(Schema.Boolean), Schema.fromKey("user_has_saved_tax_profile"))
44464
- });
44465
- var TaxProfileResponseSchema = Schema.Struct({ data: TaxProfileSchema });
44466
- var TaxProfileRequestSchema = Schema.Struct({
44467
- taxCountryCode: pipe(Schema.propertySignature(Schema.NullishOr(Schema.String)), Schema.fromKey("tax_country_code")),
44468
- usConfiguration: pipe(Schema.propertySignature(Schema.NullishOr(UsConfigurationSchema)), Schema.fromKey("us_configuration"))
44469
- });
44470
- //#endregion
44471
- //#region src/hooks/api/businesses/[business-id]/tax-estimates/profile/useTaxProfile.ts
44472
- var TAX_PROFILE_TAG_KEY = "#tax-profile";
44473
- var getTaxProfile = get(({ businessId }) => {
44474
- return `/v1/businesses/${businessId}/tax-estimates/profile`;
44475
- });
44476
- function buildKey$16({ access_token: accessToken, apiUrl, businessId }) {
44477
- if (accessToken && apiUrl) return {
44478
- accessToken,
44479
- apiUrl,
44480
- businessId,
44481
- tags: [TAX_PROFILE_TAG_KEY]
44482
- };
44483
- }
44484
- function useTaxProfile() {
44485
- const withLocale = useLocalizedKey();
44486
- const { data: auth } = useAuth();
44487
- const { businessId } = useLayerContext();
44488
- return new SWRQueryResult(useSWR(() => withLocale(buildKey$16(_objectSpread2(_objectSpread2({}, auth), {}, { businessId }))), function() {
44489
- var _ref = _asyncToGenerator(function* ({ accessToken, apiUrl, businessId }) {
44490
- return getTaxProfile(apiUrl, accessToken, { params: { businessId } })().then(Schema.decodeUnknownPromise(TaxProfileResponseSchema)).then(({ data }) => data);
44491
- });
44492
- return function(_x) {
44493
- return _ref.apply(this, arguments);
44494
- };
44495
- }()));
44496
- }
44497
- function useTaxProfileGlobalCacheActions() {
44498
- const { patchCache } = useGlobalCacheActions();
44499
- return { patchTaxProfile: useCallback((updatedProfile) => patchCache(({ tags }) => tags.includes(TAX_PROFILE_TAG_KEY), () => updatedProfile), [patchCache]) };
44500
- }
44501
- //#endregion
44502
44589
  //#region src/hooks/features/taxEstimates/useTaxEstimatesOnboardingStatus.ts
44503
44590
  var OnboardingStatus = /* @__PURE__ */ function(OnboardingStatus) {
44504
44591
  OnboardingStatus["Loading"] = "Loading";
@@ -46264,7 +46351,7 @@ var TaxEstimatesViewHeader = () => {
46264
46351
  return /* @__PURE__ */ jsx(Button$1, {
46265
46352
  icon: true,
46266
46353
  variant: "outlined",
46267
- children: /* @__PURE__ */ jsx(Menu$1, { size: 14 })
46354
+ children: /* @__PURE__ */ jsx(Menu, { size: 14 })
46268
46355
  });
46269
46356
  }, []);
46270
46357
  return /* @__PURE__ */ jsxs(HStack, {