@layerfi/components 0.1.121-alpha → 0.1.121-alpha.1
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/dist/cjs/index.cjs +326 -173
- package/dist/esm/index.mjs +326 -173
- package/dist/index.css +15 -4
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -208,7 +208,7 @@ class ErrorHandlerClass {
|
|
|
208
208
|
}
|
|
209
209
|
const errorHandler = new ErrorHandlerClass();
|
|
210
210
|
const reportError = (payload) => errorHandler.onError(payload);
|
|
211
|
-
const version = "0.1.121-alpha";
|
|
211
|
+
const version = "0.1.121-alpha.1";
|
|
212
212
|
const pkg = {
|
|
213
213
|
version
|
|
214
214
|
};
|
|
@@ -6429,7 +6429,7 @@ function BulkSelectionStoreProvider({
|
|
|
6429
6429
|
const [store] = React.useState(() => buildStore());
|
|
6430
6430
|
return /* @__PURE__ */ jsxRuntime.jsx(BulkSelectionStoreContext.Provider, { value: store, children });
|
|
6431
6431
|
}
|
|
6432
|
-
const CLASS_NAME$
|
|
6432
|
+
const CLASS_NAME$d = "Layer__Stack";
|
|
6433
6433
|
const Stack = React.forwardRef(
|
|
6434
6434
|
function Stack2(_H, ref) {
|
|
6435
6435
|
var _I = _H, {
|
|
@@ -6482,7 +6482,7 @@ const Stack = React.forwardRef(
|
|
|
6482
6482
|
__spreadProps(__spreadValues(__spreadValues({
|
|
6483
6483
|
ref
|
|
6484
6484
|
}, restProps), dataProperties), {
|
|
6485
|
-
className: classNames(CLASS_NAME$
|
|
6485
|
+
className: classNames(CLASS_NAME$d, className),
|
|
6486
6486
|
children
|
|
6487
6487
|
})
|
|
6488
6488
|
);
|
|
@@ -6927,9 +6927,9 @@ const Toggle = ({
|
|
|
6927
6927
|
})
|
|
6928
6928
|
);
|
|
6929
6929
|
};
|
|
6930
|
-
const CLASS_NAME$
|
|
6930
|
+
const CLASS_NAME$c = "Layer__LoadingSpinner";
|
|
6931
6931
|
function LoadingSpinner({ size }) {
|
|
6932
|
-
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LoaderCircle, { className: CLASS_NAME$
|
|
6932
|
+
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LoaderCircle, { className: CLASS_NAME$c, size });
|
|
6933
6933
|
}
|
|
6934
6934
|
function withRenderProp(renderProp, callback) {
|
|
6935
6935
|
if (typeof renderProp === "function") {
|
|
@@ -9656,7 +9656,7 @@ const centsToDollars = (cents = NaN) => isNaN(cents) ? "-.--" : formatter.format
|
|
|
9656
9656
|
function centsToDollarsWithoutCommas(cents = 0) {
|
|
9657
9657
|
return centsToDollars(cents).replaceAll(",", "");
|
|
9658
9658
|
}
|
|
9659
|
-
const CLASS_NAME$
|
|
9659
|
+
const CLASS_NAME$b = "Layer__MoneySpan";
|
|
9660
9660
|
const MoneySpan = React.forwardRef(
|
|
9661
9661
|
(_na, ref) => {
|
|
9662
9662
|
var _oa = _na, { amount, displayPlusSign, className } = _oa, restProps = __objRest(_oa, ["amount", "displayPlusSign", "className"]);
|
|
@@ -9665,7 +9665,7 @@ const MoneySpan = React.forwardRef(
|
|
|
9665
9665
|
"negative": amount < 0,
|
|
9666
9666
|
"display-plus-sign": displayPlusSign
|
|
9667
9667
|
});
|
|
9668
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Span, __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), { className: classNames(CLASS_NAME$
|
|
9668
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Span, __spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), { className: classNames(CLASS_NAME$b, className), ref, children: centsToDollars(Math.abs(amount)) }));
|
|
9669
9669
|
}
|
|
9670
9670
|
);
|
|
9671
9671
|
MoneySpan.displayName = "MoneySpan";
|
|
@@ -10253,7 +10253,7 @@ const InputGroup$1 = React.forwardRef(
|
|
|
10253
10253
|
);
|
|
10254
10254
|
}
|
|
10255
10255
|
);
|
|
10256
|
-
const CLASS_NAME$
|
|
10256
|
+
const CLASS_NAME$a = "Layer__MinimalSearchField";
|
|
10257
10257
|
function MinimalSearchField(_va) {
|
|
10258
10258
|
var _wa = _va, {
|
|
10259
10259
|
placeholder,
|
|
@@ -10262,7 +10262,7 @@ function MinimalSearchField(_va) {
|
|
|
10262
10262
|
"placeholder",
|
|
10263
10263
|
"isDisabled"
|
|
10264
10264
|
]);
|
|
10265
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactAriaComponents.SearchField, __spreadProps(__spreadValues({}, restProps), { isDisabled, className: CLASS_NAME$
|
|
10265
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactAriaComponents.SearchField, __spreadProps(__spreadValues({}, restProps), { isDisabled, className: CLASS_NAME$a, children: [
|
|
10266
10266
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10267
10267
|
reactAriaComponents.Input,
|
|
10268
10268
|
{
|
|
@@ -10273,10 +10273,10 @@ function MinimalSearchField(_va) {
|
|
|
10273
10273
|
/* @__PURE__ */ jsxRuntime.jsx(Button, { slot: "clear-button", inset: true, icon: true, variant: "ghost", "aria-label": "Clear search", children: /* @__PURE__ */ jsxRuntime.jsx(X, {}) })
|
|
10274
10274
|
] }));
|
|
10275
10275
|
}
|
|
10276
|
-
const CLASS_NAME$
|
|
10276
|
+
const CLASS_NAME$9 = "Layer__SearchField";
|
|
10277
10277
|
function SearchField(_xa) {
|
|
10278
10278
|
var _ya = _xa, { slot = "search", className, label, isDisabled } = _ya, restProps = __objRest(_ya, ["slot", "className", "label", "isDisabled"]);
|
|
10279
|
-
const combinedClassName = classNames(CLASS_NAME$
|
|
10279
|
+
const combinedClassName = classNames(CLASS_NAME$9, className);
|
|
10280
10280
|
return /* @__PURE__ */ jsxRuntime.jsxs(InputGroup$1, { slot, className: combinedClassName, children: [
|
|
10281
10281
|
/* @__PURE__ */ jsxRuntime.jsx(VStack, { slot: "icon", align: "center", justify: "center", className: "Layer__SearchField__Icon", "data-disabled": isDisabled || void 0, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { size: 14 }) }),
|
|
10282
10282
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -11736,7 +11736,7 @@ function FormBigDecimalField(_Ja) {
|
|
|
11736
11736
|
(slots == null ? void 0 : slots.badge) && /* @__PURE__ */ jsxRuntime.jsx(HStack, { children: slots.badge })
|
|
11737
11737
|
] }) }));
|
|
11738
11738
|
}
|
|
11739
|
-
const CLASS_NAME$
|
|
11739
|
+
const CLASS_NAME$8 = "Layer__Checkbox";
|
|
11740
11740
|
const CHECK_SIZE = {
|
|
11741
11741
|
sm: 12,
|
|
11742
11742
|
md: 14,
|
|
@@ -11753,7 +11753,7 @@ function Checkbox(_La) {
|
|
|
11753
11753
|
reactAriaComponents.Checkbox,
|
|
11754
11754
|
__spreadProps(__spreadValues(__spreadValues({}, dataProperties), props), {
|
|
11755
11755
|
isIndeterminate,
|
|
11756
|
-
className: classNames(CLASS_NAME$
|
|
11756
|
+
className: classNames(CLASS_NAME$8, className),
|
|
11757
11757
|
children: withRenderProp(children, (node) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11758
11758
|
/* @__PURE__ */ jsxRuntime.jsx("div", { slot: "checkbox", children: isIndeterminate ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Minus, { size: CHECK_SIZE[size] }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { size: CHECK_SIZE[size] }) }),
|
|
11759
11759
|
node
|
|
@@ -11998,25 +11998,17 @@ function RadioGroup(_Xa) {
|
|
|
11998
11998
|
var _Ya = _Xa, {
|
|
11999
11999
|
children,
|
|
12000
12000
|
className,
|
|
12001
|
-
|
|
12002
|
-
|
|
12003
|
-
ref
|
|
12004
|
-
} = _Ya, props = __objRest(_Ya, [
|
|
12001
|
+
onChange
|
|
12002
|
+
} = _Ya, restProps = __objRest(_Ya, [
|
|
12005
12003
|
"children",
|
|
12006
12004
|
"className",
|
|
12007
|
-
"
|
|
12008
|
-
"onChange",
|
|
12009
|
-
"ref"
|
|
12005
|
+
"onChange"
|
|
12010
12006
|
]);
|
|
12011
|
-
const dataProperties = React.useMemo(() => toDataProperties({
|
|
12012
|
-
orientation
|
|
12013
|
-
}), [orientation]);
|
|
12014
12007
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12015
12008
|
reactAriaComponents.RadioGroup,
|
|
12016
|
-
__spreadProps(__spreadValues(
|
|
12009
|
+
__spreadProps(__spreadValues({}, restProps), {
|
|
12017
12010
|
onChange,
|
|
12018
12011
|
className: classNames(RADIO_GROUP_CLASS_NAME, className),
|
|
12019
|
-
ref,
|
|
12020
12012
|
children
|
|
12021
12013
|
})
|
|
12022
12014
|
);
|
|
@@ -12025,13 +12017,11 @@ function Radio(_Za) {
|
|
|
12025
12017
|
var __a = _Za, {
|
|
12026
12018
|
children,
|
|
12027
12019
|
className,
|
|
12028
|
-
size = "sm"
|
|
12029
|
-
|
|
12030
|
-
} = __a, props = __objRest(__a, [
|
|
12020
|
+
size = "sm"
|
|
12021
|
+
} = __a, restProps = __objRest(__a, [
|
|
12031
12022
|
"children",
|
|
12032
12023
|
"className",
|
|
12033
|
-
"size"
|
|
12034
|
-
"ref"
|
|
12024
|
+
"size"
|
|
12035
12025
|
]);
|
|
12036
12026
|
const dataProperties = React.useMemo(() => toDataProperties({
|
|
12037
12027
|
size,
|
|
@@ -12039,9 +12029,8 @@ function Radio(_Za) {
|
|
|
12039
12029
|
}), [children, size]);
|
|
12040
12030
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12041
12031
|
reactAriaComponents.Radio,
|
|
12042
|
-
__spreadProps(__spreadValues(__spreadValues({},
|
|
12032
|
+
__spreadProps(__spreadValues(__spreadValues({}, restProps), dataProperties), {
|
|
12043
12033
|
className: classNames(RADIO_CLASS_NAME, className),
|
|
12044
|
-
ref,
|
|
12045
12034
|
children: withRenderProp(children, (node) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
12046
12035
|
/* @__PURE__ */ jsxRuntime.jsx("div", { slot: "radio", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { size: INDICATOR_SIZE[size] }) }),
|
|
12047
12036
|
node
|
|
@@ -12065,14 +12054,15 @@ function FormRadioGroupField({
|
|
|
12065
12054
|
const { meta, value } = state;
|
|
12066
12055
|
const { errors, isValid } = meta;
|
|
12067
12056
|
const errorMessage = errors.length !== 0 ? errors[0] : void 0;
|
|
12068
|
-
const
|
|
12057
|
+
const labelId = React.useId();
|
|
12058
|
+
const additionalAriaProps = showLabel ? { "aria-labelledby": labelId } : { "aria-label": label };
|
|
12069
12059
|
const radioGroupClassNames = classNames(
|
|
12070
12060
|
FORM_RADIO_GROUP_FIELD_CLASSNAME$1,
|
|
12071
12061
|
inline && `${FORM_RADIO_GROUP_FIELD_CLASSNAME$1}--inline`,
|
|
12072
12062
|
className
|
|
12073
12063
|
);
|
|
12074
12064
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: radioGroupClassNames, children: [
|
|
12075
|
-
showLabel && /* @__PURE__ */ jsxRuntime.jsx(Label, { slot: "label", size: "sm",
|
|
12065
|
+
showLabel && /* @__PURE__ */ jsxRuntime.jsx(Label, { slot: "label", size: "sm", id: labelId, children: label }),
|
|
12076
12066
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12077
12067
|
RadioGroup,
|
|
12078
12068
|
__spreadProps(__spreadValues({
|
|
@@ -12106,7 +12096,8 @@ function FormRadioGroupYesNoField({
|
|
|
12106
12096
|
const { meta, value } = state;
|
|
12107
12097
|
const { errors, isValid } = meta;
|
|
12108
12098
|
const errorMessage = errors.length !== 0 ? errors[0] : void 0;
|
|
12109
|
-
const
|
|
12099
|
+
const labelId = React.useId();
|
|
12100
|
+
const additionalAriaProps = showLabel ? { "aria-labelledby": labelId } : { "aria-label": label };
|
|
12110
12101
|
const radioGroupClassNames = classNames(
|
|
12111
12102
|
FORM_RADIO_GROUP_FIELD_CLASSNAME,
|
|
12112
12103
|
inline && `${FORM_RADIO_GROUP_FIELD_CLASSNAME}--inline`,
|
|
@@ -12117,7 +12108,7 @@ function FormRadioGroupYesNoField({
|
|
|
12117
12108
|
handleChange(newValue === "yes");
|
|
12118
12109
|
};
|
|
12119
12110
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: radioGroupClassNames, children: [
|
|
12120
|
-
showLabel && /* @__PURE__ */ jsxRuntime.jsx(Label, { slot: "label", size: "sm",
|
|
12111
|
+
showLabel && /* @__PURE__ */ jsxRuntime.jsx(Label, { slot: "label", size: "sm", id: labelId, children: label }),
|
|
12121
12112
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
12122
12113
|
RadioGroup,
|
|
12123
12114
|
__spreadProps(__spreadValues({
|
|
@@ -13290,9 +13281,9 @@ const BankTransactionsHeaderMenu = ({ actions, isDisabled }) => {
|
|
|
13290
13281
|
isModalOpen && /* @__PURE__ */ jsxRuntime.jsx(BankTransactionsUploadModal, { isOpen: true, onOpenChange: setIsModalOpen })
|
|
13291
13282
|
] });
|
|
13292
13283
|
};
|
|
13293
|
-
const CLASS_NAME$
|
|
13284
|
+
const CLASS_NAME$7 = "Layer__BankTransactionsActions";
|
|
13294
13285
|
function BankTransactionsActions({ children }) {
|
|
13295
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: CLASS_NAME$
|
|
13286
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: CLASS_NAME$7, children });
|
|
13296
13287
|
}
|
|
13297
13288
|
const BulkActionsModule = ({ showSelectedLabel = true, fullWidth = false, slots }) => {
|
|
13298
13289
|
const { count } = useCountSelectedIds();
|
|
@@ -13697,7 +13688,7 @@ function useInvisibleDownload() {
|
|
|
13697
13688
|
}, []);
|
|
13698
13689
|
return { invisibleDownloadRef, triggerInvisibleDownload };
|
|
13699
13690
|
}
|
|
13700
|
-
const CLASS_NAME$
|
|
13691
|
+
const CLASS_NAME$6 = "Layer__InvisibleDownload";
|
|
13701
13692
|
const InvisibleDownload = React.forwardRef((_props, ref) => {
|
|
13702
13693
|
const internalRef = React.useRef(null);
|
|
13703
13694
|
React.useImperativeHandle(ref, () => ({
|
|
@@ -13716,7 +13707,7 @@ const InvisibleDownload = React.forwardRef((_props, ref) => {
|
|
|
13716
13707
|
const handleContainClick = React.useCallback((event) => {
|
|
13717
13708
|
event.stopPropagation();
|
|
13718
13709
|
}, []);
|
|
13719
|
-
return /* @__PURE__ */ jsxRuntime.jsx("a", { download: true, className: CLASS_NAME$
|
|
13710
|
+
return /* @__PURE__ */ jsxRuntime.jsx("a", { download: true, className: CLASS_NAME$6, ref: internalRef, onClick: handleContainClick });
|
|
13720
13711
|
});
|
|
13721
13712
|
InvisibleDownload.displayName = "InvisibleDownload";
|
|
13722
13713
|
function TransactionsSearch({ slot, isDisabled }) {
|
|
@@ -21878,10 +21869,10 @@ const InstitutionIcon = (_qc) => {
|
|
|
21878
21869
|
})
|
|
21879
21870
|
);
|
|
21880
21871
|
};
|
|
21881
|
-
const CLASS_NAME$
|
|
21872
|
+
const CLASS_NAME$5 = "Layer__BasicLinkedAccountContainer";
|
|
21882
21873
|
function BasicLinkedAccountContainer({ children, isSelected }) {
|
|
21883
21874
|
const dataProperties = toDataProperties({ selected: isSelected });
|
|
21884
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, dataProperties), { className: CLASS_NAME$
|
|
21875
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, dataProperties), { className: CLASS_NAME$5, children }));
|
|
21885
21876
|
}
|
|
21886
21877
|
function BasicLinkedAccountLogo({ account }) {
|
|
21887
21878
|
var _a, _b, _c;
|
|
@@ -22755,7 +22746,7 @@ const useDatePickerState = ({ date: date2, setDate, minDate = null, maxDate = nu
|
|
|
22755
22746
|
maxDateZdt
|
|
22756
22747
|
}), [errorText, isInvalid, localDate, onBlur, onChange, maxDateZdt, minDateZdt]);
|
|
22757
22748
|
};
|
|
22758
|
-
const CLASS_NAME$
|
|
22749
|
+
const CLASS_NAME$4 = "Layer__caobfb";
|
|
22759
22750
|
const AccountFormBox = ({
|
|
22760
22751
|
account,
|
|
22761
22752
|
value,
|
|
@@ -22788,8 +22779,8 @@ const AccountFormBox = ({
|
|
|
22788
22779
|
onChange(__spreadProps(__spreadValues({}, value), { isDateInvalid }));
|
|
22789
22780
|
}
|
|
22790
22781
|
}, [isDateInvalid, onChange, value]);
|
|
22791
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", __spreadProps(__spreadValues({}, dataProps), { className: CLASS_NAME$
|
|
22792
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `${CLASS_NAME$
|
|
22782
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", __spreadProps(__spreadValues({}, dataProps), { className: CLASS_NAME$4, children: [
|
|
22783
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `${CLASS_NAME$4}__icon-col`, children: ((_a = account.institution) == null ? void 0 : _a.logo) != void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
22793
22784
|
"img",
|
|
22794
22785
|
{
|
|
22795
22786
|
width: 32,
|
|
@@ -22798,13 +22789,13 @@ const AccountFormBox = ({
|
|
|
22798
22789
|
alt: ((_b = account.institution) == null ? void 0 : _b.name) ? (_c = account.institution) == null ? void 0 : _c.name : account.external_account_name
|
|
22799
22790
|
}
|
|
22800
22791
|
) : /* @__PURE__ */ jsxRuntime.jsx(InstitutionIcon, {}) }),
|
|
22801
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${CLASS_NAME$
|
|
22802
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${CLASS_NAME$
|
|
22803
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${CLASS_NAME$
|
|
22792
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${CLASS_NAME$4}__details-col`, children: [
|
|
22793
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${CLASS_NAME$4}__details-col__details`, children: [
|
|
22794
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${CLASS_NAME$4}__details-col__name`, children: [
|
|
22804
22795
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22805
22796
|
Text,
|
|
22806
22797
|
{
|
|
22807
|
-
className: `${CLASS_NAME$
|
|
22798
|
+
className: `${CLASS_NAME$4}__details-col__name__institution-name`,
|
|
22808
22799
|
size: TextSize.sm,
|
|
22809
22800
|
children: (_d = account.institution) == null ? void 0 : _d.name
|
|
22810
22801
|
}
|
|
@@ -22812,7 +22803,7 @@ const AccountFormBox = ({
|
|
|
22812
22803
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22813
22804
|
Text,
|
|
22814
22805
|
{
|
|
22815
|
-
className: `${CLASS_NAME$
|
|
22806
|
+
className: `${CLASS_NAME$4}__details-col__name__account-name`,
|
|
22816
22807
|
size: TextSize.sm,
|
|
22817
22808
|
children: account.external_account_name
|
|
22818
22809
|
}
|
|
@@ -22823,7 +22814,7 @@ const AccountFormBox = ({
|
|
|
22823
22814
|
account.mask
|
|
22824
22815
|
] })
|
|
22825
22816
|
] }),
|
|
22826
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${CLASS_NAME$
|
|
22817
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${CLASS_NAME$4}__details-col__inputs`, children: [
|
|
22827
22818
|
/* @__PURE__ */ jsxRuntime.jsx(InputGroup, { label: "Opening date", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
22828
22819
|
DatePicker,
|
|
22829
22820
|
{
|
|
@@ -22852,7 +22843,7 @@ const AccountFormBox = ({
|
|
|
22852
22843
|
] }),
|
|
22853
22844
|
errors.includes("API_ERROR") && /* @__PURE__ */ jsxRuntime.jsx(ErrorText, { children: "An error occurred while saving data. You will have an opportunity to try again later." })
|
|
22854
22845
|
] }),
|
|
22855
|
-
!disableConfirmExclude && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${CLASS_NAME$
|
|
22846
|
+
!disableConfirmExclude && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${CLASS_NAME$4}__confirm-col`, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
22856
22847
|
Checkbox,
|
|
22857
22848
|
{
|
|
22858
22849
|
size: "lg",
|
|
@@ -22861,7 +22852,7 @@ const AccountFormBox = ({
|
|
|
22861
22852
|
"aria-label": "Confirm Account Inclusion"
|
|
22862
22853
|
}
|
|
22863
22854
|
) }),
|
|
22864
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `${CLASS_NAME$
|
|
22855
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `${CLASS_NAME$4}__success-banner`, children: /* @__PURE__ */ jsxRuntime.jsx(CheckCircle, { size: 36 }) })
|
|
22865
22856
|
] }));
|
|
22866
22857
|
};
|
|
22867
22858
|
function buildKey$I({
|
|
@@ -27263,7 +27254,7 @@ function ProfitAndLossSummariesSummary({
|
|
|
27263
27254
|
] })
|
|
27264
27255
|
] });
|
|
27265
27256
|
}
|
|
27266
|
-
const CLASS_NAME$
|
|
27257
|
+
const CLASS_NAME$3 = "Layer__TransactionsToReview";
|
|
27267
27258
|
function TransactionsToReview({
|
|
27268
27259
|
onClick,
|
|
27269
27260
|
tagFilter = void 0,
|
|
@@ -27339,7 +27330,7 @@ function TransactionsToReview({
|
|
|
27339
27330
|
verticalGap = "sm";
|
|
27340
27331
|
break;
|
|
27341
27332
|
}
|
|
27342
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { onClick, className: CLASS_NAME$
|
|
27333
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { onClick, className: CLASS_NAME$3, children: [
|
|
27343
27334
|
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: verticalGap, align: "start", children: [
|
|
27344
27335
|
/* @__PURE__ */ jsxRuntime.jsx(ProfitAndLossSummariesHeading, { variants: variants2, children: "Transactions to review" }),
|
|
27345
27336
|
transactionsToReviewBadge
|
|
@@ -32402,9 +32393,9 @@ const JournalTableView = ({
|
|
|
32402
32393
|
}
|
|
32403
32394
|
) });
|
|
32404
32395
|
};
|
|
32405
|
-
const CLASS_NAME$
|
|
32396
|
+
const CLASS_NAME$2 = "Layer__TasksEmptyContainer";
|
|
32406
32397
|
function TasksEmptyContainer({ children }) {
|
|
32407
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: CLASS_NAME$
|
|
32398
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: CLASS_NAME$2, children });
|
|
32408
32399
|
}
|
|
32409
32400
|
const TasksHeader = ({
|
|
32410
32401
|
tasksHeader = "Bookkeeping Tasks"
|
|
@@ -42904,11 +42895,11 @@ const CallBooking = ({
|
|
|
42904
42895
|
}) => {
|
|
42905
42896
|
return /* @__PURE__ */ jsxRuntime.jsx(Container, { name: "call-booking", children: callBooking ? /* @__PURE__ */ jsxRuntime.jsx(ScheduledCallState, { callBooking }) : /* @__PURE__ */ jsxRuntime.jsx(EmptyState$1, { onBookCall }) });
|
|
42906
42897
|
};
|
|
42907
|
-
const CLASS_NAME = "Layer__BookkeepingProfitAndLossSummariesContainer";
|
|
42898
|
+
const CLASS_NAME$1 = "Layer__BookkeepingProfitAndLossSummariesContainer";
|
|
42908
42899
|
function BookkeepingProfitAndLossSummariesContainer({
|
|
42909
42900
|
children
|
|
42910
42901
|
}) {
|
|
42911
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: CLASS_NAME, children });
|
|
42902
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: CLASS_NAME$1, children });
|
|
42912
42903
|
}
|
|
42913
42904
|
const TASKS_MOBILE_VIEWPORT_WIDTH = 1100;
|
|
42914
42905
|
const useKeepInMobileViewport = () => {
|
|
@@ -43727,28 +43718,29 @@ var TripPurposeFilterValue = ((TripPurposeFilterValue2) => {
|
|
|
43727
43718
|
TripPurposeFilterValue2[TripPurposeFilterValue2["Personal"] = TripPurpose.Personal] = "Personal";
|
|
43728
43719
|
return TripPurposeFilterValue2;
|
|
43729
43720
|
})(TripPurposeFilterValue || {});
|
|
43721
|
+
const TRIP_PURPOSE_OPTIONS = [
|
|
43722
|
+
{
|
|
43723
|
+
label: "All",
|
|
43724
|
+
value: "ALL"
|
|
43725
|
+
/* All */
|
|
43726
|
+
},
|
|
43727
|
+
{ label: "Business", value: TripPurposeFilterValue.Business },
|
|
43728
|
+
{ label: "Personal", value: TripPurposeFilterValue.Personal }
|
|
43729
|
+
];
|
|
43730
43730
|
const TripPurposeToggle = ({
|
|
43731
43731
|
selected,
|
|
43732
43732
|
onChange,
|
|
43733
|
-
|
|
43733
|
+
fullWidth
|
|
43734
43734
|
}) => {
|
|
43735
|
-
const options2 = React.useMemo(() => [
|
|
43736
|
-
{
|
|
43737
|
-
label: "All",
|
|
43738
|
-
value: "ALL"
|
|
43739
|
-
/* All */
|
|
43740
|
-
},
|
|
43741
|
-
{ label: "Business", value: TripPurposeFilterValue.Business },
|
|
43742
|
-
{ label: "Personal", value: TripPurposeFilterValue.Personal }
|
|
43743
|
-
], []);
|
|
43744
43735
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
43745
43736
|
Toggle,
|
|
43746
43737
|
{
|
|
43747
43738
|
ariaLabel: "Trip purpose",
|
|
43748
|
-
options:
|
|
43739
|
+
options: TRIP_PURPOSE_OPTIONS,
|
|
43749
43740
|
selectedKey: selected,
|
|
43750
43741
|
onSelectionChange: (key) => onChange(key),
|
|
43751
|
-
size
|
|
43742
|
+
size: ToggleSize.small,
|
|
43743
|
+
fullWidth
|
|
43752
43744
|
}
|
|
43753
43745
|
);
|
|
43754
43746
|
};
|
|
@@ -43863,16 +43855,18 @@ function useAutoResetPageIndex(filters, data) {
|
|
|
43863
43855
|
}, [data]);
|
|
43864
43856
|
return autoResetPageIndexRef;
|
|
43865
43857
|
}
|
|
43858
|
+
const CLASS_NAME = "Layer__UI__ResponsiveComponent";
|
|
43866
43859
|
const ResponsiveComponent = ({
|
|
43867
43860
|
slots,
|
|
43868
|
-
resolveVariant: resolveVariant2
|
|
43861
|
+
resolveVariant: resolveVariant2,
|
|
43862
|
+
className
|
|
43869
43863
|
}) => {
|
|
43870
43864
|
const [currentVariant, setCurrentVariant] = React.useState(null);
|
|
43871
43865
|
const handleResize = React.useCallback((size) => {
|
|
43872
43866
|
setCurrentVariant(resolveVariant2({ width: size.width }));
|
|
43873
43867
|
}, [resolveVariant2]);
|
|
43874
43868
|
const containerRef = useElementSize(handleResize);
|
|
43875
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: containerRef, className:
|
|
43869
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: containerRef, className: classNames(CLASS_NAME, className), children: currentVariant !== null && slots[currentVariant] });
|
|
43876
43870
|
};
|
|
43877
43871
|
const LIST_TRIPS_TAG_KEY = "#list-trips";
|
|
43878
43872
|
const ListTripsResponseSchema = effect.Schema.Struct({
|
|
@@ -44846,6 +44840,64 @@ const TripsAddressCell = ({ trip }) => {
|
|
|
44846
44840
|
] })
|
|
44847
44841
|
] });
|
|
44848
44842
|
};
|
|
44843
|
+
const TripsTableHeaderMenu = () => {
|
|
44844
|
+
const { toVehicleManagement } = useTripsNavigation();
|
|
44845
|
+
const menuItems = React.useMemo(() => [
|
|
44846
|
+
{
|
|
44847
|
+
key: "ManageVehicles",
|
|
44848
|
+
onClick: toVehicleManagement,
|
|
44849
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Car, { size: 20, strokeWidth: 1.25 }),
|
|
44850
|
+
label: "Manage vehicles"
|
|
44851
|
+
}
|
|
44852
|
+
], [toVehicleManagement]);
|
|
44853
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
44854
|
+
DataTableHeaderMenu,
|
|
44855
|
+
{
|
|
44856
|
+
ariaLabel: "Additional trips actions",
|
|
44857
|
+
items: menuItems
|
|
44858
|
+
}
|
|
44859
|
+
);
|
|
44860
|
+
};
|
|
44861
|
+
const TripsMobileHeader = ({ onRecordTrip }) => {
|
|
44862
|
+
const { tableFilters, setTableFilters } = useTripsTableFilters();
|
|
44863
|
+
const { query, purposeFilter } = tableFilters;
|
|
44864
|
+
const { inputValue, searchQuery, handleInputChange } = useDebouncedSearchInput({ initialInputState: query });
|
|
44865
|
+
React.useEffect(() => {
|
|
44866
|
+
setTableFilters({ query: searchQuery });
|
|
44867
|
+
}, [searchQuery, setTableFilters]);
|
|
44868
|
+
const handlePurposeFilterChange = React.useCallback((newPurposeFilter) => {
|
|
44869
|
+
setTableFilters({ purposeFilter: newPurposeFilter });
|
|
44870
|
+
}, [setTableFilters]);
|
|
44871
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Header$2, { className: "Layer__TripsMobileHeader", children: /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "sm", children: [
|
|
44872
|
+
/* @__PURE__ */ jsxRuntime.jsx(Heading, { size: HeadingSize.secondary, align: "left", children: "Trips" }),
|
|
44873
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { align: "center", gap: "xs", children: [
|
|
44874
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
44875
|
+
TripPurposeToggle,
|
|
44876
|
+
{
|
|
44877
|
+
selected: purposeFilter,
|
|
44878
|
+
onChange: handlePurposeFilterChange,
|
|
44879
|
+
fullWidth: true
|
|
44880
|
+
}
|
|
44881
|
+
),
|
|
44882
|
+
/* @__PURE__ */ jsxRuntime.jsx(TripsTableHeaderMenu, {})
|
|
44883
|
+
] }),
|
|
44884
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", align: "center", pbe: "md", children: [
|
|
44885
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
44886
|
+
SearchField,
|
|
44887
|
+
{
|
|
44888
|
+
label: "Search trips",
|
|
44889
|
+
value: inputValue,
|
|
44890
|
+
onChange: handleInputChange,
|
|
44891
|
+
className: "Layer__TripsMobileHeader__SearchField"
|
|
44892
|
+
}
|
|
44893
|
+
),
|
|
44894
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Button, { onPress: onRecordTrip, children: [
|
|
44895
|
+
"Record Trip",
|
|
44896
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { size: 16 })
|
|
44897
|
+
] })
|
|
44898
|
+
] })
|
|
44899
|
+
] }) });
|
|
44900
|
+
};
|
|
44849
44901
|
const TripsMobileListItem = ({ trip }) => /* @__PURE__ */ jsxRuntime.jsxs(HStack, { justify: "space-between", gap: "sm", className: "Layer__TripsMobileListItem", children: [
|
|
44850
44902
|
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "3xs", className: "Layer__TripsMobileListItem__LeftContent", children: [
|
|
44851
44903
|
/* @__PURE__ */ jsxRuntime.jsx(Span, { weight: "bold", children: formatCalendarDate(trip.tripDate) }),
|
|
@@ -44861,41 +44913,27 @@ const TripsMobileList = ({
|
|
|
44861
44913
|
isLoading,
|
|
44862
44914
|
isError,
|
|
44863
44915
|
onViewOrUpsertTrip,
|
|
44916
|
+
onRecordTrip,
|
|
44864
44917
|
paginationProps,
|
|
44865
44918
|
slots
|
|
44866
44919
|
}) => {
|
|
44867
44920
|
const renderItem = React.useCallback((trip) => /* @__PURE__ */ jsxRuntime.jsx(TripsMobileListItem, { trip }), []);
|
|
44868
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
44869
|
-
|
|
44870
|
-
|
|
44871
|
-
|
|
44872
|
-
|
|
44873
|
-
|
|
44874
|
-
|
|
44875
|
-
|
|
44876
|
-
|
|
44877
|
-
|
|
44878
|
-
|
|
44879
|
-
|
|
44880
|
-
|
|
44881
|
-
}
|
|
44882
|
-
|
|
44883
|
-
|
|
44884
|
-
const menuItems = React.useMemo(() => [
|
|
44885
|
-
{
|
|
44886
|
-
key: "ManageVehicles",
|
|
44887
|
-
onClick: toVehicleManagement,
|
|
44888
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Car, { size: 20, strokeWidth: 1.25 }),
|
|
44889
|
-
label: "Manage vehicles"
|
|
44890
|
-
}
|
|
44891
|
-
], [toVehicleManagement]);
|
|
44892
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
44893
|
-
DataTableHeaderMenu,
|
|
44894
|
-
{
|
|
44895
|
-
ariaLabel: "Additional trips actions",
|
|
44896
|
-
items: menuItems
|
|
44897
|
-
}
|
|
44898
|
-
);
|
|
44921
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "Layer__TripsMobileList", children: [
|
|
44922
|
+
/* @__PURE__ */ jsxRuntime.jsx(TripsMobileHeader, { onRecordTrip }),
|
|
44923
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
44924
|
+
PaginatedMobileList,
|
|
44925
|
+
{
|
|
44926
|
+
ariaLabel: "Trips",
|
|
44927
|
+
data,
|
|
44928
|
+
isLoading,
|
|
44929
|
+
isError,
|
|
44930
|
+
renderItem,
|
|
44931
|
+
paginationProps,
|
|
44932
|
+
onClickItem: onViewOrUpsertTrip,
|
|
44933
|
+
slots
|
|
44934
|
+
}
|
|
44935
|
+
)
|
|
44936
|
+
] });
|
|
44899
44937
|
};
|
|
44900
44938
|
const TripsTableHeader = ({ onRecordTrip }) => {
|
|
44901
44939
|
const { tableFilters, setTableFilters } = useTripsTableFilters();
|
|
@@ -45093,6 +45131,7 @@ const ResponsiveTripsView = () => {
|
|
|
45093
45131
|
}
|
|
45094
45132
|
}
|
|
45095
45133
|
), [trips, isLoading, isError, paginationProps, onViewOrUpsertTrip, onDeleteTrip]);
|
|
45134
|
+
const onRecordTrip = React.useCallback(() => onViewOrUpsertTrip(null), [onViewOrUpsertTrip]);
|
|
45096
45135
|
const MobileView = React.useMemo(() => /* @__PURE__ */ jsxRuntime.jsx(
|
|
45097
45136
|
TripsMobileList,
|
|
45098
45137
|
{
|
|
@@ -45101,12 +45140,13 @@ const ResponsiveTripsView = () => {
|
|
|
45101
45140
|
isError,
|
|
45102
45141
|
paginationProps,
|
|
45103
45142
|
onViewOrUpsertTrip,
|
|
45143
|
+
onRecordTrip,
|
|
45104
45144
|
slots: {
|
|
45105
45145
|
EmptyState: TripsViewEmptyState,
|
|
45106
45146
|
ErrorState: TripsViewErrorState
|
|
45107
45147
|
}
|
|
45108
45148
|
}
|
|
45109
|
-
), [trips, isLoading, isError, onViewOrUpsertTrip, paginationProps]);
|
|
45149
|
+
), [trips, isLoading, isError, onViewOrUpsertTrip, onRecordTrip, paginationProps]);
|
|
45110
45150
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
45111
45151
|
/* @__PURE__ */ jsxRuntime.jsx(ResponsiveComponent, { resolveVariant, slots: { Desktop: DesktopView, Mobile: MobileView } }),
|
|
45112
45152
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -45861,24 +45901,40 @@ const VehicleManagementGrid = ({ onEditVehicle, showArchived }) => {
|
|
|
45861
45901
|
}
|
|
45862
45902
|
return /* @__PURE__ */ jsxRuntime.jsx(HStack, { className: "Layer__VehicleManagementGrid", children: vehicles.map((vehicle) => /* @__PURE__ */ jsxRuntime.jsx(VehicleCard, { vehicle, onEdit: onEditVehicle }, vehicle.id)) });
|
|
45863
45903
|
};
|
|
45864
|
-
const
|
|
45865
|
-
|
|
45866
|
-
|
|
45867
|
-
|
|
45868
|
-
|
|
45869
|
-
] }),
|
|
45904
|
+
const MobileVehicleManagementDetailHeader = ({
|
|
45905
|
+
onAddVehicle
|
|
45906
|
+
}) => {
|
|
45907
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(HStack, { justify: "space-between", align: "center", fluid: true, pie: "md", pb: "md", children: [
|
|
45908
|
+
/* @__PURE__ */ jsxRuntime.jsx(Heading$1, { size: "sm", children: "Manage vehicles" }),
|
|
45870
45909
|
/* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "solid", onPress: onAddVehicle, children: [
|
|
45871
45910
|
"Add Vehicle",
|
|
45872
45911
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { size: 14 })
|
|
45873
45912
|
] })
|
|
45874
45913
|
] });
|
|
45875
45914
|
};
|
|
45915
|
+
const DesktopVehicleManagementDetailHeader = ({
|
|
45916
|
+
onAddVehicle,
|
|
45917
|
+
showArchived,
|
|
45918
|
+
onShowArchivedChange
|
|
45919
|
+
}) => {
|
|
45920
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(HStack, { justify: "space-between", align: "center", fluid: true, pie: "md", gap: "3xl", children: [
|
|
45921
|
+
/* @__PURE__ */ jsxRuntime.jsx(Heading$1, { size: "sm", children: "Manage vehicles" }),
|
|
45922
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "md", align: "center", children: [
|
|
45923
|
+
/* @__PURE__ */ jsxRuntime.jsx(Switch, { isSelected: showArchived, onChange: onShowArchivedChange, children: /* @__PURE__ */ jsxRuntime.jsx(Span, { size: "sm", noWrap: true, children: "Show archived" }) }),
|
|
45924
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "solid", onPress: onAddVehicle, children: [
|
|
45925
|
+
"Add Vehicle",
|
|
45926
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { size: 14 })
|
|
45927
|
+
] })
|
|
45928
|
+
] })
|
|
45929
|
+
] });
|
|
45930
|
+
};
|
|
45876
45931
|
const VehicleManagementDetail = () => {
|
|
45877
45932
|
const { toTripsTable } = useTripsNavigation();
|
|
45878
45933
|
const [isVehicleDrawerOpen, setIsVehicleDrawerOpen] = React.useState(false);
|
|
45879
45934
|
const [selectedVehicle, setSelectedVehicle] = React.useState(void 0);
|
|
45880
45935
|
const [showArchived, setShowArchived] = React.useState(false);
|
|
45881
|
-
const {
|
|
45936
|
+
const { isDesktop } = useSizeClass();
|
|
45937
|
+
const isMobileVariant = !isDesktop;
|
|
45882
45938
|
const handleAddVehicle = React.useCallback(() => {
|
|
45883
45939
|
setSelectedVehicle(void 0);
|
|
45884
45940
|
setIsVehicleDrawerOpen(true);
|
|
@@ -45891,40 +45947,85 @@ const VehicleManagementDetail = () => {
|
|
|
45891
45947
|
setIsVehicleDrawerOpen(false);
|
|
45892
45948
|
setSelectedVehicle(void 0);
|
|
45893
45949
|
}, []);
|
|
45894
|
-
const
|
|
45895
|
-
stateRef
|
|
45950
|
+
const resolveVariant2 = () => isMobileVariant ? "Mobile" : "Desktop";
|
|
45951
|
+
const stateRef = React.useRef({ showArchived, setShowArchived, handleAddVehicle, resolveVariant: resolveVariant2 });
|
|
45952
|
+
stateRef.current = { showArchived, setShowArchived, handleAddVehicle, resolveVariant: resolveVariant2 };
|
|
45896
45953
|
const HeaderRef = React.useRef(() => {
|
|
45897
|
-
const {
|
|
45898
|
-
|
|
45899
|
-
|
|
45954
|
+
const {
|
|
45955
|
+
showArchived: currentShowArchived,
|
|
45956
|
+
setShowArchived: currentSetShowArchived,
|
|
45957
|
+
handleAddVehicle: currentHandleAddVehicle,
|
|
45958
|
+
resolveVariant: currentResolveVariant
|
|
45959
|
+
} = stateRef.current;
|
|
45960
|
+
const DesktopHeader = /* @__PURE__ */ jsxRuntime.jsx(
|
|
45961
|
+
DesktopVehicleManagementDetailHeader,
|
|
45962
|
+
{
|
|
45963
|
+
onAddVehicle: currentHandleAddVehicle,
|
|
45964
|
+
showArchived: currentShowArchived,
|
|
45965
|
+
onShowArchivedChange: currentSetShowArchived
|
|
45966
|
+
}
|
|
45967
|
+
);
|
|
45968
|
+
const MobileHeader = /* @__PURE__ */ jsxRuntime.jsx(
|
|
45969
|
+
MobileVehicleManagementDetailHeader,
|
|
45900
45970
|
{
|
|
45901
45971
|
onAddVehicle: currentHandleAddVehicle,
|
|
45902
45972
|
showArchived: currentShowArchived,
|
|
45903
45973
|
onShowArchivedChange: currentSetShowArchived
|
|
45904
45974
|
}
|
|
45905
45975
|
);
|
|
45976
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
45977
|
+
ResponsiveComponent,
|
|
45978
|
+
{
|
|
45979
|
+
resolveVariant: currentResolveVariant,
|
|
45980
|
+
slots: { Desktop: DesktopHeader, Mobile: MobileHeader },
|
|
45981
|
+
className: "Layer__VehicleManagementDetail__Header"
|
|
45982
|
+
}
|
|
45983
|
+
);
|
|
45906
45984
|
});
|
|
45907
45985
|
const Header3 = HeaderRef.current;
|
|
45908
45986
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
45909
|
-
/* @__PURE__ */ jsxRuntime.
|
|
45987
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
45910
45988
|
BaseDetailView,
|
|
45911
45989
|
{
|
|
45912
45990
|
slots: { Header: Header3, BackIcon: BackArrow },
|
|
45913
45991
|
name: "VehicleManagementDetail",
|
|
45914
45992
|
onGoBack: toTripsTable,
|
|
45915
|
-
children:
|
|
45993
|
+
children: [
|
|
45994
|
+
isMobileVariant && /* @__PURE__ */ jsxRuntime.jsx(
|
|
45995
|
+
HStack,
|
|
45996
|
+
{
|
|
45997
|
+
justify: "end",
|
|
45998
|
+
align: "center",
|
|
45999
|
+
fluid: true,
|
|
46000
|
+
pie: "md",
|
|
46001
|
+
pbs: "md",
|
|
46002
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Switch, { isSelected: showArchived, onChange: setShowArchived, children: /* @__PURE__ */ jsxRuntime.jsx(Span, { size: "sm", noWrap: true, children: "Show archived" }) })
|
|
46003
|
+
}
|
|
46004
|
+
),
|
|
46005
|
+
/* @__PURE__ */ jsxRuntime.jsx(VehicleManagementGrid, { onEditVehicle: handleEditVehicle, showArchived })
|
|
46006
|
+
]
|
|
45916
46007
|
}
|
|
45917
46008
|
),
|
|
45918
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
45919
|
-
|
|
45920
|
-
|
|
45921
|
-
|
|
45922
|
-
|
|
45923
|
-
|
|
45924
|
-
|
|
45925
|
-
|
|
45926
|
-
|
|
45927
|
-
|
|
46009
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
46010
|
+
Drawer,
|
|
46011
|
+
{
|
|
46012
|
+
isOpen: isVehicleDrawerOpen,
|
|
46013
|
+
onOpenChange: setIsVehicleDrawerOpen,
|
|
46014
|
+
"aria-label": selectedVehicle ? "Vehicle details" : "Add vehicle",
|
|
46015
|
+
variant: isMobileVariant ? "mobile-drawer" : "drawer",
|
|
46016
|
+
flexBlock: isMobileVariant,
|
|
46017
|
+
children: ({ close: close2 }) => /* @__PURE__ */ jsxRuntime.jsxs(VStack, { pb: "lg", children: [
|
|
46018
|
+
/* @__PURE__ */ jsxRuntime.jsx(VStack, { pi: "md", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
46019
|
+
ModalTitleWithClose,
|
|
46020
|
+
{
|
|
46021
|
+
heading: /* @__PURE__ */ jsxRuntime.jsx(ModalHeading, { size: "md", children: selectedVehicle ? "Edit vehicle" : "Add vehicle" }),
|
|
46022
|
+
onClose: close2
|
|
46023
|
+
}
|
|
46024
|
+
) }),
|
|
46025
|
+
/* @__PURE__ */ jsxRuntime.jsx(VStack, { pi: "md", children: /* @__PURE__ */ jsxRuntime.jsx(VehicleForm, { vehicle: selectedVehicle, onSuccess: handleVehicleSuccess }) })
|
|
46026
|
+
] })
|
|
46027
|
+
}
|
|
46028
|
+
)
|
|
45928
46029
|
] });
|
|
45929
46030
|
};
|
|
45930
46031
|
const Trips = () => {
|
|
@@ -46299,9 +46400,6 @@ function useTaxProfile() {
|
|
|
46299
46400
|
);
|
|
46300
46401
|
return new TaxProfileSWRResponse(swrResponse);
|
|
46301
46402
|
}
|
|
46302
|
-
function usePreloadTaxProfile() {
|
|
46303
|
-
useTaxProfile();
|
|
46304
|
-
}
|
|
46305
46403
|
function useTaxProfileGlobalCacheActions() {
|
|
46306
46404
|
const { patchCache } = useGlobalCacheActions();
|
|
46307
46405
|
const patchTaxProfile = React.useCallback(
|
|
@@ -46319,6 +46417,13 @@ var TaxEstimatesRoute = /* @__PURE__ */ ((TaxEstimatesRoute2) => {
|
|
|
46319
46417
|
TaxEstimatesRoute2["Profile"] = "Profile";
|
|
46320
46418
|
return TaxEstimatesRoute2;
|
|
46321
46419
|
})(TaxEstimatesRoute || {});
|
|
46420
|
+
var OnboardingStatus = /* @__PURE__ */ ((OnboardingStatus2) => {
|
|
46421
|
+
OnboardingStatus2["Loading"] = "Loading";
|
|
46422
|
+
OnboardingStatus2["Error"] = "Error";
|
|
46423
|
+
OnboardingStatus2["NotOnboarded"] = "NotOnboarded";
|
|
46424
|
+
OnboardingStatus2["Onboarded"] = "Onboarded";
|
|
46425
|
+
return OnboardingStatus2;
|
|
46426
|
+
})(OnboardingStatus || {});
|
|
46322
46427
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
46323
46428
|
const TaxEstimatesRouteStoreContext = React.createContext(
|
|
46324
46429
|
zustand.createStore(() => ({
|
|
@@ -46326,7 +46431,7 @@ const TaxEstimatesRouteStoreContext = React.createContext(
|
|
|
46326
46431
|
route: "Estimates"
|
|
46327
46432
|
/* Estimates */
|
|
46328
46433
|
},
|
|
46329
|
-
|
|
46434
|
+
onboardingStatus: "Loading",
|
|
46330
46435
|
navigate: () => {
|
|
46331
46436
|
},
|
|
46332
46437
|
year: currentYear,
|
|
@@ -46344,10 +46449,9 @@ function useTaxEstimatesNavigation() {
|
|
|
46344
46449
|
const store = React.useContext(TaxEstimatesRouteStoreContext);
|
|
46345
46450
|
return zustand.useStore(store, (state) => state.navigate);
|
|
46346
46451
|
}
|
|
46347
|
-
function
|
|
46452
|
+
function useTaxEstimatesOnboardingStatus() {
|
|
46348
46453
|
const store = React.useContext(TaxEstimatesRouteStoreContext);
|
|
46349
|
-
|
|
46350
|
-
return React.useMemo(() => ({ isOnboarded }), [isOnboarded]);
|
|
46454
|
+
return zustand.useStore(store, (state) => state.onboardingStatus);
|
|
46351
46455
|
}
|
|
46352
46456
|
function useTaxEstimatesYear() {
|
|
46353
46457
|
const store = React.useContext(TaxEstimatesRouteStoreContext);
|
|
@@ -46356,14 +46460,14 @@ function useTaxEstimatesYear() {
|
|
|
46356
46460
|
return React.useMemo(() => ({ year, setYear }), [year, setYear]);
|
|
46357
46461
|
}
|
|
46358
46462
|
function TaxEstimatesRouteStoreProvider(props) {
|
|
46359
|
-
const { data: taxProfile, isLoading } = useTaxProfile();
|
|
46463
|
+
const { data: taxProfile, isLoading, isError } = useTaxProfile();
|
|
46360
46464
|
const [store] = React.useState(
|
|
46361
46465
|
() => zustand.createStore((set) => ({
|
|
46362
46466
|
routeState: {
|
|
46363
46467
|
route: "Estimates"
|
|
46364
46468
|
/* Estimates */
|
|
46365
46469
|
},
|
|
46366
|
-
|
|
46470
|
+
onboardingStatus: "Loading",
|
|
46367
46471
|
navigate: (route) => {
|
|
46368
46472
|
set({ routeState: { route } });
|
|
46369
46473
|
},
|
|
@@ -46376,12 +46480,35 @@ function TaxEstimatesRouteStoreProvider(props) {
|
|
|
46376
46480
|
}))
|
|
46377
46481
|
);
|
|
46378
46482
|
React.useEffect(() => {
|
|
46379
|
-
if (
|
|
46483
|
+
if (isLoading) {
|
|
46380
46484
|
store.setState({
|
|
46381
|
-
|
|
46485
|
+
onboardingStatus: "Loading"
|
|
46486
|
+
/* Loading */
|
|
46382
46487
|
});
|
|
46488
|
+
return;
|
|
46383
46489
|
}
|
|
46384
|
-
|
|
46490
|
+
if (isError) {
|
|
46491
|
+
store.setState({
|
|
46492
|
+
onboardingStatus: "Error"
|
|
46493
|
+
/* Error */
|
|
46494
|
+
});
|
|
46495
|
+
return;
|
|
46496
|
+
}
|
|
46497
|
+
if (taxProfile && !taxProfile.userHasSavedTaxProfile) {
|
|
46498
|
+
store.setState({
|
|
46499
|
+
onboardingStatus: "NotOnboarded"
|
|
46500
|
+
/* NotOnboarded */
|
|
46501
|
+
});
|
|
46502
|
+
return;
|
|
46503
|
+
}
|
|
46504
|
+
if (taxProfile && taxProfile.userHasSavedTaxProfile) {
|
|
46505
|
+
store.setState({
|
|
46506
|
+
onboardingStatus: "Onboarded"
|
|
46507
|
+
/* Onboarded */
|
|
46508
|
+
});
|
|
46509
|
+
return;
|
|
46510
|
+
}
|
|
46511
|
+
}, [store, taxProfile, isLoading, isError]);
|
|
46385
46512
|
return /* @__PURE__ */ jsxRuntime.jsx(TaxEstimatesRouteStoreContext.Provider, { value: store, children: props.children });
|
|
46386
46513
|
}
|
|
46387
46514
|
const VehicleExpenseSchema = effect.Schema.Struct({
|
|
@@ -46813,7 +46940,7 @@ const AdjustedGrossIncomeTable = ({ data }) => {
|
|
|
46813
46940
|
/* @__PURE__ */ jsxRuntime.jsx(Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(Span, { children: `- ${label}` }) }),
|
|
46814
46941
|
/* @__PURE__ */ jsxRuntime.jsx(Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(MoneySpan, { amount: -getAmount(deductions) }) })
|
|
46815
46942
|
] }, key)),
|
|
46816
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Row, { className: "
|
|
46943
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Row, { className: "Layer__AdjustedGrossIncomeTable__TotalRow", children: [
|
|
46817
46944
|
/* @__PURE__ */ jsxRuntime.jsx(Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(Span, { weight: "bold", children: "Adjusted Gross Income" }) }),
|
|
46818
46945
|
/* @__PURE__ */ jsxRuntime.jsx(Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(MoneySpan, { weight: "bold", amount: totalAdjustedGrossIncome }) })
|
|
46819
46946
|
] })
|
|
@@ -47078,7 +47205,7 @@ const TaxDetails = () => {
|
|
|
47078
47205
|
Heading: /* @__PURE__ */ jsxRuntime.jsx(
|
|
47079
47206
|
CardHeading,
|
|
47080
47207
|
{
|
|
47081
|
-
title: `State
|
|
47208
|
+
title: `Estimated State Taxes (${usState.stateName})`,
|
|
47082
47209
|
amount: usState.totalStateTax.totalStateTaxOwed
|
|
47083
47210
|
}
|
|
47084
47211
|
)
|
|
@@ -47227,8 +47354,8 @@ const ErrorState = () => /* @__PURE__ */ jsxRuntime.jsx(
|
|
|
47227
47354
|
{
|
|
47228
47355
|
spacing: true,
|
|
47229
47356
|
status: DataStateStatus.failed,
|
|
47230
|
-
title: "
|
|
47231
|
-
description: "
|
|
47357
|
+
title: "We couldnʼt load your tax payments",
|
|
47358
|
+
description: "An error occurred while loading your tax payments. Please check your connection and try again."
|
|
47232
47359
|
}
|
|
47233
47360
|
);
|
|
47234
47361
|
const EmptyState = () => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -47237,7 +47364,7 @@ const EmptyState = () => /* @__PURE__ */ jsxRuntime.jsx(
|
|
|
47237
47364
|
spacing: true,
|
|
47238
47365
|
status: DataStateStatus.info,
|
|
47239
47366
|
title: "No tax payments found",
|
|
47240
|
-
description: "There are no tax payments to display"
|
|
47367
|
+
description: "There are no tax payments to display."
|
|
47241
47368
|
}
|
|
47242
47369
|
);
|
|
47243
47370
|
const getQuarterLabel = (quarter) => {
|
|
@@ -47745,30 +47872,35 @@ const useTaxProfileForm = ({ taxProfile, onSuccess }) => {
|
|
|
47745
47872
|
const { trigger: upsertProfile } = useUpsertTaxProfile({ mode });
|
|
47746
47873
|
const formDefaults = React.useMemo(() => taxProfileToFormValues(taxProfile), [taxProfile]);
|
|
47747
47874
|
const defaultValuesRef = React.useRef(formDefaults);
|
|
47748
|
-
const
|
|
47875
|
+
const onSubmit = React.useCallback((_0) => __async(null, [_0], function* ({ value }) {
|
|
47876
|
+
try {
|
|
47877
|
+
const taxProfileValue = formValuesToTaxProfile(value);
|
|
47878
|
+
const input = effect.Schema.encodeSync(TaxProfileRequestSchema)(taxProfileValue);
|
|
47879
|
+
const result = yield upsertProfile(input);
|
|
47880
|
+
setSubmitError(void 0);
|
|
47881
|
+
setSubmitSuccess("Tax profile saved");
|
|
47882
|
+
onSuccess == null ? void 0 : onSuccess(result.data);
|
|
47883
|
+
} catch (e) {
|
|
47884
|
+
console.error(e);
|
|
47885
|
+
setSubmitSuccess(void 0);
|
|
47886
|
+
setSubmitError("Something went wrong. Please try again.");
|
|
47887
|
+
}
|
|
47888
|
+
}), [onSuccess, upsertProfile]);
|
|
47749
47889
|
const form = useAppForm({
|
|
47750
|
-
defaultValues,
|
|
47751
|
-
onSubmit
|
|
47752
|
-
try {
|
|
47753
|
-
const taxProfileValue = formValuesToTaxProfile(value);
|
|
47754
|
-
const input = effect.Schema.encodeSync(TaxProfileRequestSchema)(taxProfileValue);
|
|
47755
|
-
const result = yield upsertProfile(input);
|
|
47756
|
-
setSubmitError(void 0);
|
|
47757
|
-
setSubmitSuccess("Tax profile saved");
|
|
47758
|
-
form.reset(value, { keepDefaultValues: false });
|
|
47759
|
-
onSuccess == null ? void 0 : onSuccess(result.data);
|
|
47760
|
-
} catch (e) {
|
|
47761
|
-
console.error(e);
|
|
47762
|
-
setSubmitSuccess(void 0);
|
|
47763
|
-
setSubmitError("Something went wrong. Please try again.");
|
|
47764
|
-
}
|
|
47765
|
-
}),
|
|
47890
|
+
defaultValues: defaultValuesRef.current,
|
|
47891
|
+
onSubmit,
|
|
47766
47892
|
validationLogic: reactForm.revalidateLogic({
|
|
47767
47893
|
mode: "submit",
|
|
47768
47894
|
modeAfterSubmission: "submit"
|
|
47769
47895
|
}),
|
|
47770
47896
|
canSubmitWhenInvalid: true
|
|
47771
47897
|
});
|
|
47898
|
+
React.useEffect(() => {
|
|
47899
|
+
if (formDefaults !== defaultValuesRef.current) {
|
|
47900
|
+
defaultValuesRef.current = formDefaults;
|
|
47901
|
+
form.reset(formDefaults);
|
|
47902
|
+
}
|
|
47903
|
+
}, [form, formDefaults]);
|
|
47772
47904
|
return React.useMemo(() => ({
|
|
47773
47905
|
form,
|
|
47774
47906
|
submitError,
|
|
@@ -47833,7 +47965,7 @@ const TaxProfileForm = ({ taxProfile, onSuccess, isReadOnly }) => {
|
|
|
47833
47965
|
] }) });
|
|
47834
47966
|
};
|
|
47835
47967
|
const TaxProfile = () => {
|
|
47836
|
-
const
|
|
47968
|
+
const onboardingStatus = useTaxEstimatesOnboardingStatus();
|
|
47837
47969
|
const navigate = useTaxEstimatesNavigation();
|
|
47838
47970
|
const { data: taxProfile } = useTaxProfile();
|
|
47839
47971
|
const handleGoBack = React.useCallback(() => {
|
|
@@ -47847,20 +47979,43 @@ const TaxProfile = () => {
|
|
|
47847
47979
|
{
|
|
47848
47980
|
slots: { Header: TaxProfileHeader, BackIcon: BackArrow },
|
|
47849
47981
|
name: "TaxProfile",
|
|
47850
|
-
onGoBack:
|
|
47982
|
+
onGoBack: onboardingStatus === OnboardingStatus.Onboarded ? handleGoBack : void 0,
|
|
47851
47983
|
children: /* @__PURE__ */ jsxRuntime.jsx(TaxProfileForm, { taxProfile })
|
|
47852
47984
|
}
|
|
47853
47985
|
);
|
|
47854
47986
|
};
|
|
47855
47987
|
const TAX_ESTIMATES_MIN_YEAR = 2024;
|
|
47856
47988
|
const TaxEstimatesView = () => {
|
|
47857
|
-
usePreloadTaxProfile();
|
|
47858
47989
|
return /* @__PURE__ */ jsxRuntime.jsx(TaxEstimatesRouteStoreProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(TaxEstimatesViewContent, {}) });
|
|
47859
47990
|
};
|
|
47860
47991
|
const TaxEstimatesViewContent = () => {
|
|
47861
|
-
const
|
|
47862
|
-
const header = React.useMemo(
|
|
47863
|
-
|
|
47992
|
+
const onboardingStatus = useTaxEstimatesOnboardingStatus();
|
|
47993
|
+
const header = React.useMemo(
|
|
47994
|
+
() => onboardingStatus === OnboardingStatus.Onboarded && /* @__PURE__ */ jsxRuntime.jsx(TaxEstimatesViewHeader, {}),
|
|
47995
|
+
[onboardingStatus]
|
|
47996
|
+
);
|
|
47997
|
+
const viewContent = React.useMemo(() => {
|
|
47998
|
+
switch (onboardingStatus) {
|
|
47999
|
+
case OnboardingStatus.Loading:
|
|
48000
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Container, { name: "tax-estimates", children: /* @__PURE__ */ jsxRuntime.jsx(Loader, {}) });
|
|
48001
|
+
case OnboardingStatus.Error:
|
|
48002
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Container, { name: "tax-estimates", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
48003
|
+
DataState,
|
|
48004
|
+
{
|
|
48005
|
+
status: DataStateStatus.failed,
|
|
48006
|
+
title: "Unable to load tax information",
|
|
48007
|
+
description: "We couldn’t retrieve your tax profile. Please check your connection and try again.",
|
|
48008
|
+
spacing: true
|
|
48009
|
+
}
|
|
48010
|
+
) });
|
|
48011
|
+
case OnboardingStatus.Onboarded:
|
|
48012
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TaxEstimatesOnboardedViewContent, {});
|
|
48013
|
+
case OnboardingStatus.NotOnboarded:
|
|
48014
|
+
default:
|
|
48015
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TaxProfile, {});
|
|
48016
|
+
}
|
|
48017
|
+
}, [onboardingStatus]);
|
|
48018
|
+
return /* @__PURE__ */ jsxRuntime.jsx(View, { title: "Taxes", header, children: viewContent });
|
|
47864
48019
|
};
|
|
47865
48020
|
const TaxEstimatesViewHeader = () => {
|
|
47866
48021
|
const navigate = useTaxEstimatesNavigation();
|
|
@@ -47927,10 +48082,8 @@ const TaxEstimatesOnboardedViewContent = () => {
|
|
|
47927
48082
|
onSelectionChange: handleTabChange
|
|
47928
48083
|
}
|
|
47929
48084
|
),
|
|
47930
|
-
/* @__PURE__ */ jsxRuntime.
|
|
47931
|
-
|
|
47932
|
-
route === TaxEstimatesRoute.Payments && /* @__PURE__ */ jsxRuntime.jsx(TaxPayments, {})
|
|
47933
|
-
] })
|
|
48085
|
+
route === TaxEstimatesRoute.Estimates && /* @__PURE__ */ jsxRuntime.jsx(TaxDetails, {}),
|
|
48086
|
+
route === TaxEstimatesRoute.Payments && /* @__PURE__ */ jsxRuntime.jsx(TaxPayments, {})
|
|
47934
48087
|
] });
|
|
47935
48088
|
};
|
|
47936
48089
|
const table = /* @__PURE__ */ new WeakMap();
|