@homefile/components-v2 2.34.3 → 2.36.0
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/assets/locales/en/index.json +8 -0
- package/dist/components/forms/dynamicForm/fields/HomeInitialSetup.d.ts +1 -1
- package/dist/components/forms/dynamicForm/fields/HomeInitialSetup.js +6 -5
- package/dist/components/homeAssistant/panel/HomeAssistantPanel.d.ts +1 -0
- package/dist/components/homeAssistant/panel/HomeAssistantPanel.js +28 -3
- package/dist/components/inputs/RadioCard.js +1 -1
- package/dist/components/wizard/WizardInitialOptions.d.ts +1 -1
- package/dist/components/wizard/WizardInitialOptions.js +4 -3
- package/dist/components/wizard/WizardStepOptions.d.ts +1 -1
- package/dist/components/wizard/WizardStepOptions.js +3 -2
- package/dist/components/wizard/WizardTextBody.d.ts +1 -1
- package/dist/components/wizard/WizardTextBody.js +7 -3
- package/dist/components/wizard/WizardValueSummary.d.ts +2 -0
- package/dist/components/wizard/WizardValueSummary.js +8 -0
- package/dist/components/wizard/index.d.ts +1 -0
- package/dist/components/wizard/index.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/interfaces/forms/dynamicForm/DynamicForm.interface.d.ts +1 -0
- package/dist/interfaces/forms/dynamicForm/fields/GroupField.interface.d.ts +1 -0
- package/dist/interfaces/homeAssistant/HomeAssistantPanel.interface.d.ts +2 -2
- package/dist/interfaces/wizard/WizardTextHeader.interface.d.ts +1 -0
- package/dist/interfaces/wizard/WizardValueSummary.interface.d.ts +12 -0
- package/dist/interfaces/wizard/WizardValueSummary.interface.js +1 -0
- package/dist/interfaces/wizard/index.d.ts +1 -0
- package/dist/interfaces/wizard/index.js +1 -0
- package/dist/stories/homeAssistant/panel/HomeAssistantPanel.stories.d.ts +1 -0
- package/dist/stories/homeAssistant/panel/HomeAssistantPanel.stories.js +17 -2
- package/dist/stories/wizard/ControlledWizard.stories.js +8 -5
- package/package.json +1 -1
- package/src/assets/locales/en/index.json +8 -0
- package/src/components/forms/dynamicForm/fields/HomeInitialSetup.tsx +14 -3
- package/src/components/homeAssistant/panel/HomeAssistantPanel.tsx +68 -3
- package/src/components/homeAssistant/wizard/HomeAssistantWizardButton.tsx +1 -1
- package/src/components/inputs/RadioCard.tsx +2 -1
- package/src/components/wizard/WizardInitialOptions.tsx +7 -1
- package/src/components/wizard/WizardStepOptions.tsx +8 -2
- package/src/components/wizard/WizardTextBody.tsx +36 -11
- package/src/components/wizard/WizardValueSummary.tsx +80 -0
- package/src/components/wizard/index.ts +1 -0
- package/src/index.ts +2 -0
- package/src/interfaces/forms/dynamicForm/DynamicForm.interface.ts +1 -0
- package/src/interfaces/forms/dynamicForm/fields/GroupField.interface.ts +1 -0
- package/src/interfaces/homeAssistant/HomeAssistantPanel.interface.ts +2 -2
- package/src/interfaces/wizard/WizardTextHeader.interface.ts +1 -0
- package/src/interfaces/wizard/WizardValueSummary.interface.ts +12 -0
- package/src/interfaces/wizard/index.ts +1 -0
- package/src/stories/homeAssistant/panel/HomeAssistantPanel.stories.tsx +36 -1
- package/src/stories/wizard/ControlledWizard.stories.tsx +33 -4
|
@@ -100,6 +100,7 @@
|
|
|
100
100
|
"title": "One moment, we’re building your homefile."
|
|
101
101
|
},
|
|
102
102
|
"buttons": {
|
|
103
|
+
"accurate": "Accurate",
|
|
103
104
|
"back": "Back",
|
|
104
105
|
"cancel": "Cancel",
|
|
105
106
|
"confirm": "Confirm",
|
|
@@ -111,6 +112,7 @@
|
|
|
111
112
|
"edit": "Edit",
|
|
112
113
|
"forward": "Forward",
|
|
113
114
|
"next": "Next",
|
|
115
|
+
"notAccurate": "Not Accurate",
|
|
114
116
|
"previous": "Previous",
|
|
115
117
|
"save": "Save",
|
|
116
118
|
"send": "Send",
|
|
@@ -1293,5 +1295,11 @@
|
|
|
1293
1295
|
"description": "Est Value of Property Added to Homefile",
|
|
1294
1296
|
"label": "Value added in",
|
|
1295
1297
|
"title": "Value Monitor"
|
|
1298
|
+
},
|
|
1299
|
+
"wizardValueSummary": {
|
|
1300
|
+
"assessedValue": "[Year] Assessed Value",
|
|
1301
|
+
"estimatedValue": "Estimated Value",
|
|
1302
|
+
"info": "You can edit this record within your Homefile. Your information remains private and is never shared or sold.",
|
|
1303
|
+
"purchasePrice": "Purchase Price"
|
|
1296
1304
|
}
|
|
1297
1305
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FieldTypesI } from '@/interfaces';
|
|
2
|
-
export declare const HomeInitialSetup: ({ fields, callback }: FieldTypesI) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const HomeInitialSetup: ({ fields, callback, style }: FieldTypesI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Stack } from '@chakra-ui/react';
|
|
3
3
|
import { WizardTextBody, WizardInitialOptions, WizardStepOptions, } from '@/components';
|
|
4
|
-
export const HomeInitialSetup = ({ fields, callback }) => {
|
|
5
|
-
|
|
4
|
+
export const HomeInitialSetup = ({ fields, callback, style }) => {
|
|
5
|
+
const isWizard = style === 'wizard';
|
|
6
|
+
return (_jsx(Stack, { bg: "neutral.white", spacing: { base: '6', md: isWizard ? '10' : '0' }, children: fields === null || fields === void 0 ? void 0 : fields.map(({ children = [], id, label = '', type, value, description }) => {
|
|
6
7
|
switch (type) {
|
|
7
8
|
case 'home-wizard-header':
|
|
8
|
-
return (_jsx(WizardTextBody, { title: label, subtitle: description }, id));
|
|
9
|
+
return (_jsx(WizardTextBody, { title: label, subtitle: description, style: style }, id));
|
|
9
10
|
case 'home-wizard-initial-setup':
|
|
10
|
-
return (_jsx(WizardInitialOptions, { form: children, title: String(value), callback: callback }, id));
|
|
11
|
+
return (_jsx(WizardInitialOptions, { form: children, title: String(value), callback: callback, style: style }, id));
|
|
11
12
|
case 'home-wizard-step-options':
|
|
12
|
-
return (_jsx(WizardStepOptions, { form: children, title: String(value), callback: callback }, id));
|
|
13
|
+
return (_jsx(WizardStepOptions, { form: children, title: String(value), callback: callback, style: style }, id));
|
|
13
14
|
default:
|
|
14
15
|
return null;
|
|
15
16
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { HomeAssistantPanelI } from '@/interfaces';
|
|
3
3
|
export declare const HomeAssistantPanel: ({ children, currentForm, currentStep, onApplianceClick, onBack, onClose, onNext, onSave, backDisabled, nextDisabled, hasCompleted, isLoading, }: PropsWithChildren<HomeAssistantPanelI>) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const HomeAssistantWizardPanel: ({ currentForm, currentStep, onBack, onClose, onNext, onSave, backDisabled, nextDisabled, hasCompleted, isLoading, }: PropsWithChildren<HomeAssistantPanelI>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,11 +4,11 @@ import { FormProvider } from 'react-hook-form';
|
|
|
4
4
|
import { t } from 'i18next';
|
|
5
5
|
import { DrawerHeader, DrawerBody, Stack, Text, DrawerFooter, } from '@chakra-ui/react';
|
|
6
6
|
import { IA } from '@/assets/images';
|
|
7
|
-
import { ApplianceSteps, SimpleDynamicForm, FooterButtons, HomeAssistantPanelStep, PanelHeader, Loading, } from '@/components';
|
|
7
|
+
import { ApplianceSteps, SimpleDynamicForm, FooterButtons, HomeAssistantPanelStep, PanelHeader, Loading, HomeAssistantWizardSteps, DynamicForm, } from '@/components';
|
|
8
8
|
import { homeAssistantSteps } from '@/helpers';
|
|
9
9
|
import { useSimpleDynamicForm } from '@/hooks';
|
|
10
10
|
import { homeAssistantProxy } from '@/proxies';
|
|
11
|
-
export const HomeAssistantPanel = ({ children, currentForm, currentStep, onApplianceClick, onBack, onClose, onNext, onSave, backDisabled, nextDisabled, hasCompleted, isLoading, }) => {
|
|
11
|
+
export const HomeAssistantPanel = ({ children, currentForm, currentStep, onApplianceClick = () => { }, onBack, onClose, onNext, onSave, backDisabled, nextDisabled, hasCompleted, isLoading, }) => {
|
|
12
12
|
var _a, _b;
|
|
13
13
|
const [addedAppliances, updateAddedAppliances] = useState([]);
|
|
14
14
|
const title = (_b = (_a = homeAssistantSteps === null || homeAssistantSteps === void 0 ? void 0 : homeAssistantSteps[currentStep - 1]) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : '';
|
|
@@ -49,7 +49,7 @@ export const HomeAssistantPanel = ({ children, currentForm, currentStep, onAppli
|
|
|
49
49
|
label: !hasCompleted && currentStep === 6
|
|
50
50
|
? t('buttons.finish')
|
|
51
51
|
: t('buttons.saveStep'),
|
|
52
|
-
onClick: () => onSave(updatedFields),
|
|
52
|
+
onClick: () => onSave === null || onSave === void 0 ? void 0 : onSave(updatedFields),
|
|
53
53
|
}, button3: !hasCompleted && currentStep === 6
|
|
54
54
|
? undefined
|
|
55
55
|
: {
|
|
@@ -59,3 +59,28 @@ export const HomeAssistantPanel = ({ children, currentForm, currentStep, onAppli
|
|
|
59
59
|
isDisabled: nextDisabled,
|
|
60
60
|
} }) })] }));
|
|
61
61
|
};
|
|
62
|
+
export const HomeAssistantWizardPanel = ({ currentForm, currentStep, onBack, onClose, onNext, onSave, backDisabled, nextDisabled, hasCompleted, isLoading, }) => {
|
|
63
|
+
if (isLoading)
|
|
64
|
+
return _jsx(Loading, {});
|
|
65
|
+
return (_jsxs(_Fragment, { children: [_jsx(DrawerHeader, { p: "0", children: _jsx(PanelHeader, { handleCloseButton: onClose, title: t('homeAssistant.title'), icon: IA }) }), _jsxs(DrawerBody, { p: "0", children: [_jsx(HomeAssistantWizardSteps, { currentStep: currentStep }), _jsx(DynamicForm, { form: currentForm, showTitle: false, style: "panel" })] }), _jsx(DrawerFooter, { px: "0", py: "6", bg: "neutral.white", children: _jsx(FooterButtons, { button1: currentStep === 1
|
|
66
|
+
? undefined
|
|
67
|
+
: {
|
|
68
|
+
buttonStyle: 'secondaryFooter',
|
|
69
|
+
label: t('buttons.back'),
|
|
70
|
+
onClick: onBack,
|
|
71
|
+
isDisabled: backDisabled,
|
|
72
|
+
}, button2: {
|
|
73
|
+
buttonStyle: 'primaryFooter',
|
|
74
|
+
label: !hasCompleted && currentStep === 5
|
|
75
|
+
? t('buttons.finish')
|
|
76
|
+
: t('buttons.saveStep'),
|
|
77
|
+
onClick: () => onSave === null || onSave === void 0 ? void 0 : onSave(),
|
|
78
|
+
}, button3: !hasCompleted && currentStep === 5
|
|
79
|
+
? undefined
|
|
80
|
+
: {
|
|
81
|
+
buttonStyle: 'primaryFooter',
|
|
82
|
+
label: t('buttons.next'),
|
|
83
|
+
onClick: onNext,
|
|
84
|
+
isDisabled: nextDisabled,
|
|
85
|
+
} }) })] }));
|
|
86
|
+
};
|
|
@@ -10,7 +10,7 @@ export const RadioCard = (props) => {
|
|
|
10
10
|
borderLeft: '6px solid',
|
|
11
11
|
borderLeftColor: 'blue.6',
|
|
12
12
|
boxShadow: 'md',
|
|
13
|
-
}, px: 5, py: 3, children: _jsxs(Flex, { align: "center", gap: "base", minH: "40px", children: [_jsx(Box, Object.assign({}, checkbox, { height: "18px", width: "18px", rounded: isSafari() ? 'sm' : 'full', border: "1px", borderColor: "lightBlue.5", _checked: {
|
|
13
|
+
}, px: 5, py: 3, children: _jsxs(Flex, { align: "center", gap: "base", minH: "40px", children: [_jsx(Box, Object.assign({}, checkbox, { height: "18px", width: "18px", rounded: isSafari() ? 'sm' : 'full', border: "1px", borderColor: "lightBlue.5", flexShrink: 0, _checked: {
|
|
14
14
|
bg: 'blue.2',
|
|
15
15
|
outline: '2px solid white',
|
|
16
16
|
outlineOffset: '-3px',
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DynamicFormI } from '@/interfaces';
|
|
2
|
-
export declare const WizardInitialOptions: ({ form, title, callback, }: DynamicFormI) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const WizardInitialOptions: ({ form, title, callback, style, }: DynamicFormI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,15 +3,16 @@ import { Container, SimpleGrid, Stack, Text, Image, Flex, } from '@chakra-ui/rea
|
|
|
3
3
|
import { Controller, useFormContext } from 'react-hook-form';
|
|
4
4
|
import { CheckInCircle } from '@/assets/images';
|
|
5
5
|
import { fieldIcons, setOptionButtonStyles } from '@/helpers';
|
|
6
|
-
export const WizardInitialOptions = ({ form, title, callback, }) => {
|
|
6
|
+
export const WizardInitialOptions = ({ form, title, callback, style = 'wizard', }) => {
|
|
7
7
|
const { control } = useFormContext();
|
|
8
|
-
|
|
8
|
+
const isWizard = style === 'wizard';
|
|
9
|
+
return (_jsxs(Stack, { spacing: "base", bg: "lightBlue.1", p: "base", children: [_jsx(Text, { fontFamily: "secondary", fontSize: "sm", children: title }), _jsx(SimpleGrid, { columns: { base: 1, md: isWizard ? 2 : 1 }, spacing: { base: 1, md: isWizard ? 'base' : 1 }, children: form.map((field) => {
|
|
9
10
|
const { id, value, label, icon, description } = field;
|
|
10
11
|
return (_jsx(Controller, { control: control, name: id, defaultValue: value, render: ({ field: { value, onChange } }) => {
|
|
11
12
|
const iconSrc = icon
|
|
12
13
|
? fieldIcons[icon]
|
|
13
14
|
: undefined;
|
|
14
|
-
return (_jsxs(Container, { position: "relative", children: [value && (_jsx(Image, { src: CheckInCircle, alt: "check", w: "22px", h: "auto", position: "absolute", top: "-4px", left: "-2px", boxShadow: "lg", borderRadius: "full" })), _jsxs(Stack, Object.assign({ as: "button", p: "base", onClick: () => {
|
|
15
|
+
return (_jsxs(Container, { position: "relative", children: [value && (_jsx(Image, { src: CheckInCircle, alt: "check", w: "22px", h: "auto", position: "absolute", top: "-4px", left: "-2px", boxShadow: "lg", borderRadius: "full" })), _jsxs(Stack, Object.assign({ as: "button", p: "base", w: "full", onClick: () => {
|
|
15
16
|
onChange(!value);
|
|
16
17
|
callback === null || callback === void 0 ? void 0 : callback(Object.assign(Object.assign({}, field), { value: !value }));
|
|
17
18
|
} }, setOptionButtonStyles(value), { children: [_jsxs(Flex, { gap: "2", w: "full", align: "center", children: [_jsx(Image, { src: iconSrc, alt: "icon", h: "16px", w: "auto" }), label && (_jsx(Text, { fontWeight: "bold", fontSize: "xs", textTransform: "capitalize", fontFamily: "secondary", children: label }))] }), _jsx(Text, { fontFamily: "secondary", textAlign: "left", children: description })] }))] }));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DynamicFormI } from '@/interfaces';
|
|
2
|
-
export declare const WizardStepOptions: ({ form, title, callback }: DynamicFormI) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const WizardStepOptions: ({ form, title, callback, style, }: DynamicFormI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,9 +3,10 @@ import { Container, SimpleGrid, Stack, Text, Image, Center, } from '@chakra-ui/r
|
|
|
3
3
|
import { Controller, useFormContext } from 'react-hook-form';
|
|
4
4
|
import { CheckInCircle } from '@/assets/images';
|
|
5
5
|
import { fieldIcons, setOptionButtonStyles } from '@/helpers';
|
|
6
|
-
export const WizardStepOptions = ({ form, title, callback }) => {
|
|
6
|
+
export const WizardStepOptions = ({ form, title, callback, style = 'wizard', }) => {
|
|
7
7
|
const { control } = useFormContext();
|
|
8
|
-
|
|
8
|
+
const isWizard = style === 'wizard';
|
|
9
|
+
return (_jsxs(Stack, { spacing: "base", bg: "lightBlue.1", p: "base", children: [_jsx(Text, { fontFamily: "secondary", fontSize: "sm", children: title }), _jsx(SimpleGrid, { columns: { base: 3, md: isWizard ? 6 : 5 }, spacing: "base", gridAutoRows: "1fr", alignItems: "stretch", children: form.map((field) => {
|
|
9
10
|
const { id, value, label, icon } = field;
|
|
10
11
|
return (_jsx(Controller, { control: control, name: id, defaultValue: value, render: ({ field: { value, onChange } }) => {
|
|
11
12
|
const iconSrc = icon
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { WizardTextHeaderI } from '@/interfaces';
|
|
2
|
-
export declare const WizardTextBody: ({ title, subtitle }: WizardTextHeaderI) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const WizardTextBody: ({ title, subtitle, style, }: WizardTextHeaderI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Center, Stack, Text } from '@chakra-ui/react';
|
|
3
|
-
export const WizardTextBody = ({ title, subtitle }) => {
|
|
4
|
-
|
|
2
|
+
import { Box, Center, Stack, Text } from '@chakra-ui/react';
|
|
3
|
+
export const WizardTextBody = ({ title, subtitle, style, }) => {
|
|
4
|
+
const isWizard = style === 'wizard';
|
|
5
|
+
if (isWizard) {
|
|
6
|
+
return (_jsx(Center, { w: "full", minH: { md: '100px' }, children: _jsxs(Stack, { spacing: "4", w: { base: 'full', md: '80%' }, children: [_jsx(Text, { fontSize: { base: 'xl', md: '2xl' }, lineHeight: { base: 'shorter', md: 'base' }, textAlign: { base: 'left', md: 'center' }, children: title }), subtitle && (_jsx(Text, { fontFamily: "secondary", textAlign: { base: 'left', md: 'center' }, children: subtitle }))] }) }));
|
|
7
|
+
}
|
|
8
|
+
return (_jsx(Box, { p: "base", children: _jsxs(Stack, { spacing: "4", w: "full", children: [_jsx(Text, { fontSize: "2xl", lineHeight: "base", textAlign: "left", children: title }), subtitle && (_jsx(Text, { fontFamily: "secondary", textAlign: "left", children: subtitle }))] }) }));
|
|
5
9
|
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { WizardValueSummaryProps } from '@/interfaces';
|
|
2
|
+
export declare const WizardValueSummary: ({ title, subtitle, address, estimatedValue, purchasePrice, assessedValue, purchasePriceDetails, assessedValueDetails, onAccurate, onNotAccurate, }: WizardValueSummaryProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { t } from 'i18next';
|
|
3
|
+
import { Stack, Text, Flex, Divider, Button } from '@chakra-ui/react';
|
|
4
|
+
import { TrendingValueCard, RecordsSession } from '@/components';
|
|
5
|
+
export const WizardValueSummary = ({ title, subtitle, address, estimatedValue, purchasePrice, assessedValue, purchasePriceDetails, assessedValueDetails, onAccurate, onNotAccurate, }) => {
|
|
6
|
+
const estimatedValueFormatted = `$${estimatedValue.toLocaleString('en-US')}.`;
|
|
7
|
+
return (_jsxs(Stack, { w: { base: 'full', md: '70%' }, m: "auto", spacing: "6", children: [_jsxs(Stack, { spacing: "1", align: "center", children: [_jsx(Text, { fontSize: "2xl", textTransform: "capitalize", children: title }), _jsx(Text, { fontFamily: "secondary", children: address }), subtitle && _jsx(Text, { fontFamily: "secondary", children: subtitle })] }), _jsxs(Stack, { bg: "lightGreen.3", spacing: "base", pt: "base", pb: "6", align: "center", children: [_jsx(Text, { fontSize: "xs", textTransform: "uppercase", children: t('wizardValueSummary.estimatedValue') }), _jsx(Text, { fontSize: "3xl", children: estimatedValueFormatted })] }), _jsxs(Flex, { gap: "base", direction: { base: 'column', md: 'row' }, children: [_jsxs(Stack, { flex: "1", spacing: "6", children: [_jsx(TrendingValueCard, { bg: "lightBlue.1", label: t('wizardValueSummary.purchasePrice'), value: purchasePrice }), _jsx(RecordsSession, { details: purchasePriceDetails, showLine: false, gap: "1", textAlign: "right", p: "0" })] }), _jsxs(Stack, { flex: "1", spacing: "6", children: [_jsx(TrendingValueCard, { bg: "lightBlue.1", label: t('wizardValueSummary.assessedValue'), value: assessedValue }), _jsx(RecordsSession, { details: assessedValueDetails, showLine: false, gap: "1", textAlign: "right", p: "0" })] })] }), _jsx(Divider, { borderStyle: "dotted", borderColor: "lightBlue.11" }), _jsxs(Flex, { gap: "base", children: [_jsx(Button, { onClick: onNotAccurate, children: t('buttons.notAccurate') }), _jsx(Button, { onClick: onAccurate, children: t('buttons.accurate') })] }), _jsx(Text, { fontFamily: "secondary", fontSize: "sm", textAlign: "center", color: "gray.2", lineHeight: "shorter", children: t('wizardValueSummary.info') })] }));
|
|
8
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ActivateAccount, ActiveSubscription, AddCardBanner, AddEditContactPanel, AddFolder, AddHomeContent, AddHomeItem, AddHomeItemHeader, AddMedia, AddPropertyRecords, Address, AddPopup, AddTile, AddToHomefile, AlertBanner, AphwTile, AppBar, AssignableReceipts, BackHeader, BackendAlert, BarDivider, CancelAccount, CatalogPopup, CloudsAnimation, ContactList, ContactsContent, ContainerHeader, ControlledWizard, CreateDocumentHeader, CreateHouseholdItemHeader, CreditCardContainer, CreditCardError, CustomerTile, DeleteBanner, Dialog, DisplayFiles, DisplayFilesDetail, DisplayOptions, DisplayReceipts, DocumentMenu, DocumentNameHeader, DocumentPreview, DynamicForm, EditAccountType, EditHomeBody, EditHomeFooter, EditHomeHeader, EditHomePanel, EditItemName, EmailPermissions, EmailValidation, Feedback, FileDetail, FilesUploader, FlowStep, FolderDetail, FolderDetailBody, FolderDetailContent, FolderDetailFooter, FolderDetailHeader, FolderInfo, FolderSharing, FolderTypeSelection, FooterButtons, FooterDrawer, GenericBackHeader, GroupCard, GroupsContainer, GroupsHeader, Header, HelpContent, HomeAssistant, HomeAssistantPanel, HomeBoardGrid, HomeBoardTour, HomeCard, HomeCardWithRecipent, HomeDetailsContent, HomefileMonitoring, HomeHeader, HomeItemList, HomeItemManualInfo, HomeMonitor, HomeMonitorPanel, HomeMonitorSteps, HomeSharedWith, HomieAddItems, InboxForwardBanner, InboxTile, ItemFormPanel, ItemFormTabs, ItemNameHeader, ItemsReviewBanner, ItemSubTypeSelect, Launchpad, LaunchpadAutofilerBanner, LaunchpadReceiptAutofiler, LaunchpadReceiptPanel, LaunchpadTour, LeftPanel, Loading, MediaDetailsStep, MessagePanel, MessageChatPanel, MinimizedTiles, MonthlyCharge, MortgageInfo, MoveModal, MyHomes, MyProfileBody, MyProfileContent, MyProfileFooter, MyProfileHeader, MyProfilePanel, NewCreditCard, NewCreditCardHeader, NewPassword, NotBeChargedBanner, Notifications, NotificationsReminder, NotificationsPanel, NotificationCard, Overlay, PanelHeader, PartnerActiveSubscription, PartnerCatalogPanel, PartnerContent, PartnerCustomerCode, PartnerDetails, PartnerImages, PartnerPanel, PasswordInput, PaymentReceipts, PdfButton, PeopleConnected, ProfileDetailsTab, ProfilePaymentTab, ProjectList, PropertyRecords, PropertyTaxes, ReadOnlyDynamicForm, ReadOnlyImage, ReadOnlyToggle, ReceiptAutofiler, ReceiptBody, ReceiptContent, ReceiptDetails, ReceiptFilters, ReceiptFooter, ReceiptHeader, ReceiptInfos, ReceiptItem, ReceiptItems, ReceiptPDF, ReceiptsDisplayOptions, ReceiptsFiled, ReceiptsHeader, ReceiptsInfo, ReceiptsReceivedContent, RecipientForm, RecipientsToShare, RecipientTab, RecordsInputs, ResendResetPassword, ResetPassword, ReviewBanner, RightPanel, RolePermissionsTab, RoomHeader, RoomsBoardTour, RoomsMenu, RoomsMenuMobile, RoomStep, RoomVideo, SalesTax, SatisfactionTile, SectionHeader, SendCommunication, SearchItemLoader, ShareContactsContent, SharedAccounts, SharedHomeContent, SharedHomeHeader, ShareHome, ShareHomeConnections, ShareHomeForm, ShineTile, ShortPartnerTile, SignIn, SignUp, SkeletonBox, StepHeader, StorageUsed, Subscription, SubscriptionCard, SubscriptionTable, Summary, TabsHeader, TextInput, ToBeDeletedBody, ToBeDeletedContent, ToBeDeletedFooter, ToBeDeletedHeader, TourButton, Trash, TrendingValue, TrialBanner, TutorialsButton, TwoFactor, TwoFactorSetting, UpdateList, UserDetails, ValueMonitor, ViewContactPanel, VideoPlayer, VideoPlayerModal, WeatherWidget, WellDone, YtdTile, WizardTextHeader, } from './components';
|
|
1
|
+
export { ActivateAccount, ActiveSubscription, AddCardBanner, AddEditContactPanel, AddFolder, AddHomeContent, AddHomeItem, AddHomeItemHeader, AddMedia, AddPropertyRecords, Address, AddPopup, AddTile, AddToHomefile, AlertBanner, AphwTile, AppBar, AssignableReceipts, BackHeader, BackendAlert, BarDivider, CancelAccount, CatalogPopup, CloudsAnimation, ContactList, ContactsContent, ContainerHeader, ControlledWizard, CreateDocumentHeader, CreateHouseholdItemHeader, CreditCardContainer, CreditCardError, CustomerTile, DeleteBanner, Dialog, DisplayFiles, DisplayFilesDetail, DisplayOptions, DisplayReceipts, DocumentMenu, DocumentNameHeader, DocumentPreview, DynamicForm, EditAccountType, EditHomeBody, EditHomeFooter, EditHomeHeader, EditHomePanel, EditItemName, EmailPermissions, EmailValidation, Feedback, FileDetail, FilesUploader, FlowStep, FolderDetail, FolderDetailBody, FolderDetailContent, FolderDetailFooter, FolderDetailHeader, FolderInfo, FolderSharing, FolderTypeSelection, FooterButtons, FooterDrawer, GenericBackHeader, GroupCard, GroupsContainer, GroupsHeader, Header, HelpContent, HomeAssistant, HomeAssistantPanel, HomeAssistantWizardPanel, HomeBoardGrid, HomeBoardTour, HomeCard, HomeCardWithRecipent, HomeDetailsContent, HomefileMonitoring, HomeHeader, HomeItemList, HomeItemManualInfo, HomeMonitor, HomeMonitorPanel, HomeMonitorSteps, HomeSharedWith, HomieAddItems, InboxForwardBanner, InboxTile, ItemFormPanel, ItemFormTabs, ItemNameHeader, ItemsReviewBanner, ItemSubTypeSelect, Launchpad, LaunchpadAutofilerBanner, LaunchpadReceiptAutofiler, LaunchpadReceiptPanel, LaunchpadTour, LeftPanel, Loading, MediaDetailsStep, MessagePanel, MessageChatPanel, MinimizedTiles, MonthlyCharge, MortgageInfo, MoveModal, MyHomes, MyProfileBody, MyProfileContent, MyProfileFooter, MyProfileHeader, MyProfilePanel, NewCreditCard, NewCreditCardHeader, NewPassword, NotBeChargedBanner, Notifications, NotificationsReminder, NotificationsPanel, NotificationCard, Overlay, PanelHeader, PartnerActiveSubscription, PartnerCatalogPanel, PartnerContent, PartnerCustomerCode, PartnerDetails, PartnerImages, PartnerPanel, PasswordInput, PaymentReceipts, PdfButton, PeopleConnected, ProfileDetailsTab, ProfilePaymentTab, ProjectList, PropertyRecords, PropertyTaxes, ReadOnlyDynamicForm, ReadOnlyImage, ReadOnlyToggle, ReceiptAutofiler, ReceiptBody, ReceiptContent, ReceiptDetails, ReceiptFilters, ReceiptFooter, ReceiptHeader, ReceiptInfos, ReceiptItem, ReceiptItems, ReceiptPDF, ReceiptsDisplayOptions, ReceiptsFiled, ReceiptsHeader, ReceiptsInfo, ReceiptsReceivedContent, RecipientForm, RecipientsToShare, RecipientTab, RecordsInputs, ResendResetPassword, ResetPassword, ReviewBanner, RightPanel, RolePermissionsTab, RoomHeader, RoomsBoardTour, RoomsMenu, RoomsMenuMobile, RoomStep, RoomVideo, SalesTax, SatisfactionTile, SectionHeader, SendCommunication, SearchItemLoader, ShareContactsContent, SharedAccounts, SharedHomeContent, SharedHomeHeader, ShareHome, ShareHomeConnections, ShareHomeForm, ShineTile, ShortPartnerTile, SignIn, SignUp, SkeletonBox, StepHeader, StorageUsed, Subscription, SubscriptionCard, SubscriptionTable, Summary, TabsHeader, TextInput, ToBeDeletedBody, ToBeDeletedContent, ToBeDeletedFooter, ToBeDeletedHeader, TourButton, Trash, TrendingValue, TrialBanner, TutorialsButton, TwoFactor, TwoFactorSetting, UpdateList, UserDetails, ValueMonitor, ViewContactPanel, VideoPlayer, VideoPlayerModal, WeatherWidget, WellDone, YtdTile, WizardTextHeader, WizardValueSummary, } from './components';
|
|
2
2
|
export { useCustomToast } from './hooks';
|
|
3
3
|
export { randomColor, mapApiObjectToFormFields, mapForecastToWidget, } from './utils';
|
|
4
4
|
export { Contacts, MagnifyingGlassReport, Message, Register, Receipts, Price, BlueFolderShared, Calendar, Create, Notes, } from './assets/images';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ActivateAccount, ActiveSubscription, AddCardBanner, AddEditContactPanel, AddFolder, AddHomeContent, AddHomeItem, AddHomeItemHeader, AddMedia, AddPropertyRecords, Address, AddPopup, AddTile, AddToHomefile, AlertBanner, AphwTile, AppBar, AssignableReceipts, BackHeader, BackendAlert, BarDivider, CancelAccount, CatalogPopup, CloudsAnimation, ContactList, ContactsContent, ContainerHeader, ControlledWizard, CreateDocumentHeader, CreateHouseholdItemHeader, CreditCardContainer, CreditCardError, CustomerTile, DeleteBanner, Dialog, DisplayFiles, DisplayFilesDetail, DisplayOptions, DisplayReceipts, DocumentMenu, DocumentNameHeader, DocumentPreview, DynamicForm, EditAccountType, EditHomeBody, EditHomeFooter, EditHomeHeader, EditHomePanel, EditItemName, EmailPermissions, EmailValidation, Feedback, FileDetail, FilesUploader, FlowStep, FolderDetail, FolderDetailBody, FolderDetailContent, FolderDetailFooter, FolderDetailHeader, FolderInfo, FolderSharing, FolderTypeSelection, FooterButtons, FooterDrawer, GenericBackHeader, GroupCard, GroupsContainer, GroupsHeader, Header, HelpContent, HomeAssistant, HomeAssistantPanel, HomeBoardGrid, HomeBoardTour, HomeCard, HomeCardWithRecipent, HomeDetailsContent, HomefileMonitoring, HomeHeader, HomeItemList, HomeItemManualInfo, HomeMonitor, HomeMonitorPanel, HomeMonitorSteps, HomeSharedWith, HomieAddItems, InboxForwardBanner, InboxTile, ItemFormPanel, ItemFormTabs, ItemNameHeader, ItemsReviewBanner, ItemSubTypeSelect, Launchpad, LaunchpadAutofilerBanner, LaunchpadReceiptAutofiler, LaunchpadReceiptPanel, LaunchpadTour, LeftPanel, Loading, MediaDetailsStep, MessagePanel, MessageChatPanel, MinimizedTiles, MonthlyCharge, MortgageInfo, MoveModal, MyHomes, MyProfileBody, MyProfileContent, MyProfileFooter, MyProfileHeader, MyProfilePanel, NewCreditCard, NewCreditCardHeader, NewPassword, NotBeChargedBanner, Notifications, NotificationsReminder, NotificationsPanel, NotificationCard, Overlay, PanelHeader, PartnerActiveSubscription, PartnerCatalogPanel, PartnerContent, PartnerCustomerCode, PartnerDetails, PartnerImages, PartnerPanel, PasswordInput, PaymentReceipts, PdfButton, PeopleConnected, ProfileDetailsTab, ProfilePaymentTab, ProjectList, PropertyRecords, PropertyTaxes, ReadOnlyDynamicForm, ReadOnlyImage, ReadOnlyToggle, ReceiptAutofiler, ReceiptBody, ReceiptContent, ReceiptDetails, ReceiptFilters, ReceiptFooter, ReceiptHeader, ReceiptInfos, ReceiptItem, ReceiptItems, ReceiptPDF, ReceiptsDisplayOptions, ReceiptsFiled, ReceiptsHeader, ReceiptsInfo, ReceiptsReceivedContent, RecipientForm, RecipientsToShare, RecipientTab, RecordsInputs, ResendResetPassword, ResetPassword, ReviewBanner, RightPanel, RolePermissionsTab, RoomHeader, RoomsBoardTour, RoomsMenu, RoomsMenuMobile, RoomStep, RoomVideo, SalesTax, SatisfactionTile, SectionHeader, SendCommunication, SearchItemLoader, ShareContactsContent, SharedAccounts, SharedHomeContent, SharedHomeHeader, ShareHome, ShareHomeConnections, ShareHomeForm, ShineTile, ShortPartnerTile, SignIn, SignUp, SkeletonBox, StepHeader, StorageUsed, Subscription, SubscriptionCard, SubscriptionTable, Summary, TabsHeader, TextInput, ToBeDeletedBody, ToBeDeletedContent, ToBeDeletedFooter, ToBeDeletedHeader, TourButton, Trash, TrendingValue, TrialBanner, TutorialsButton, TwoFactor, TwoFactorSetting, UpdateList, UserDetails, ValueMonitor, ViewContactPanel, VideoPlayer, VideoPlayerModal, WeatherWidget, WellDone, YtdTile, WizardTextHeader, } from './components';
|
|
1
|
+
export { ActivateAccount, ActiveSubscription, AddCardBanner, AddEditContactPanel, AddFolder, AddHomeContent, AddHomeItem, AddHomeItemHeader, AddMedia, AddPropertyRecords, Address, AddPopup, AddTile, AddToHomefile, AlertBanner, AphwTile, AppBar, AssignableReceipts, BackHeader, BackendAlert, BarDivider, CancelAccount, CatalogPopup, CloudsAnimation, ContactList, ContactsContent, ContainerHeader, ControlledWizard, CreateDocumentHeader, CreateHouseholdItemHeader, CreditCardContainer, CreditCardError, CustomerTile, DeleteBanner, Dialog, DisplayFiles, DisplayFilesDetail, DisplayOptions, DisplayReceipts, DocumentMenu, DocumentNameHeader, DocumentPreview, DynamicForm, EditAccountType, EditHomeBody, EditHomeFooter, EditHomeHeader, EditHomePanel, EditItemName, EmailPermissions, EmailValidation, Feedback, FileDetail, FilesUploader, FlowStep, FolderDetail, FolderDetailBody, FolderDetailContent, FolderDetailFooter, FolderDetailHeader, FolderInfo, FolderSharing, FolderTypeSelection, FooterButtons, FooterDrawer, GenericBackHeader, GroupCard, GroupsContainer, GroupsHeader, Header, HelpContent, HomeAssistant, HomeAssistantPanel, HomeAssistantWizardPanel, HomeBoardGrid, HomeBoardTour, HomeCard, HomeCardWithRecipent, HomeDetailsContent, HomefileMonitoring, HomeHeader, HomeItemList, HomeItemManualInfo, HomeMonitor, HomeMonitorPanel, HomeMonitorSteps, HomeSharedWith, HomieAddItems, InboxForwardBanner, InboxTile, ItemFormPanel, ItemFormTabs, ItemNameHeader, ItemsReviewBanner, ItemSubTypeSelect, Launchpad, LaunchpadAutofilerBanner, LaunchpadReceiptAutofiler, LaunchpadReceiptPanel, LaunchpadTour, LeftPanel, Loading, MediaDetailsStep, MessagePanel, MessageChatPanel, MinimizedTiles, MonthlyCharge, MortgageInfo, MoveModal, MyHomes, MyProfileBody, MyProfileContent, MyProfileFooter, MyProfileHeader, MyProfilePanel, NewCreditCard, NewCreditCardHeader, NewPassword, NotBeChargedBanner, Notifications, NotificationsReminder, NotificationsPanel, NotificationCard, Overlay, PanelHeader, PartnerActiveSubscription, PartnerCatalogPanel, PartnerContent, PartnerCustomerCode, PartnerDetails, PartnerImages, PartnerPanel, PasswordInput, PaymentReceipts, PdfButton, PeopleConnected, ProfileDetailsTab, ProfilePaymentTab, ProjectList, PropertyRecords, PropertyTaxes, ReadOnlyDynamicForm, ReadOnlyImage, ReadOnlyToggle, ReceiptAutofiler, ReceiptBody, ReceiptContent, ReceiptDetails, ReceiptFilters, ReceiptFooter, ReceiptHeader, ReceiptInfos, ReceiptItem, ReceiptItems, ReceiptPDF, ReceiptsDisplayOptions, ReceiptsFiled, ReceiptsHeader, ReceiptsInfo, ReceiptsReceivedContent, RecipientForm, RecipientsToShare, RecipientTab, RecordsInputs, ResendResetPassword, ResetPassword, ReviewBanner, RightPanel, RolePermissionsTab, RoomHeader, RoomsBoardTour, RoomsMenu, RoomsMenuMobile, RoomStep, RoomVideo, SalesTax, SatisfactionTile, SectionHeader, SendCommunication, SearchItemLoader, ShareContactsContent, SharedAccounts, SharedHomeContent, SharedHomeHeader, ShareHome, ShareHomeConnections, ShareHomeForm, ShineTile, ShortPartnerTile, SignIn, SignUp, SkeletonBox, StepHeader, StorageUsed, Subscription, SubscriptionCard, SubscriptionTable, Summary, TabsHeader, TextInput, ToBeDeletedBody, ToBeDeletedContent, ToBeDeletedFooter, ToBeDeletedHeader, TourButton, Trash, TrendingValue, TrialBanner, TutorialsButton, TwoFactor, TwoFactorSetting, UpdateList, UserDetails, ValueMonitor, ViewContactPanel, VideoPlayer, VideoPlayerModal, WeatherWidget, WellDone, YtdTile, WizardTextHeader, WizardValueSummary, } from './components';
|
|
2
2
|
export { useCustomToast } from './hooks';
|
|
3
3
|
export { randomColor, mapApiObjectToFormFields, mapForecastToWidget, } from './utils';
|
|
4
4
|
export { Contacts, MagnifyingGlassReport, Message, Register, Receipts, Price, BlueFolderShared, Calendar, Create, Notes, } from './assets/images';
|
|
@@ -2,11 +2,11 @@ import { DynamicFormI, ReportI } from '@/interfaces';
|
|
|
2
2
|
export interface HomeAssistantPanelI {
|
|
3
3
|
currentForm: DynamicFormI['form'];
|
|
4
4
|
currentStep: number;
|
|
5
|
-
onApplianceClick
|
|
5
|
+
onApplianceClick?: (selected: string[]) => void;
|
|
6
6
|
onBack: () => void;
|
|
7
7
|
onClose: () => void;
|
|
8
8
|
onNext: () => void;
|
|
9
|
-
onSave
|
|
9
|
+
onSave?: (form?: ReportI[]) => void;
|
|
10
10
|
backDisabled: boolean;
|
|
11
11
|
nextDisabled: boolean;
|
|
12
12
|
hasCompleted: boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface WizardValueSummaryProps {
|
|
2
|
+
title: string;
|
|
3
|
+
subtitle?: string;
|
|
4
|
+
address: string;
|
|
5
|
+
estimatedValue: number;
|
|
6
|
+
purchasePrice: number;
|
|
7
|
+
assessedValue: number;
|
|
8
|
+
purchasePriceDetails: Record<string, string | undefined>;
|
|
9
|
+
assessedValueDetails: Record<string, string | undefined>;
|
|
10
|
+
onAccurate: () => void;
|
|
11
|
+
onNotAccurate: () => void;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,3 +3,4 @@ import { HomeAssistantPanelI } from '@/interfaces';
|
|
|
3
3
|
declare const _default: Meta;
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const HomeAssistantPanelComponent: (args: HomeAssistantPanelI) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const NewHomeAssistantPanelComponent: (args: HomeAssistantPanelI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { DrawerContent } from '@chakra-ui/react';
|
|
3
3
|
import { action } from '@storybook/addon-actions';
|
|
4
|
-
import { HomeAssistantPanel, RightPanel } from '@/components';
|
|
5
|
-
import { homeAssitantStep1FormMock, homeAssitantStep2FormMock, homeAssitantStep3FormMock, homeAssitantStep4FormMock, homeAssitantStep5FormMock, homeAssitantStep6FormMock, } from '@/mocks';
|
|
4
|
+
import { HomeAssistantPanel, HomeAssistantWizardPanel, RightPanel, } from '@/components';
|
|
5
|
+
import { homeAssitantStep1FormMock, homeAssitantStep2FormMock, homeAssitantStep3FormMock, homeAssitantStep4FormMock, homeAssitantStep5FormMock, homeAssitantStep6FormMock, homeWizardForm, } from '@/mocks';
|
|
6
6
|
import { useState } from 'react';
|
|
7
7
|
export default {
|
|
8
8
|
title: 'Components/HomeAssistant',
|
|
@@ -39,3 +39,18 @@ export const HomeAssistantPanelComponent = (args) => {
|
|
|
39
39
|
const currentForm = forms[currentStep];
|
|
40
40
|
return (_jsx(DrawerContent, { bg: "lightBlue.1", children: _jsx(HomeAssistantPanel, Object.assign({}, args, { currentStep: currentStep, currentForm: currentForm, onNext: handleFormChange, onBack: handleBack, onSave: action('onSave'), isLoading: false })) }));
|
|
41
41
|
};
|
|
42
|
+
export const NewHomeAssistantPanelComponent = (args) => {
|
|
43
|
+
const [currentStep, setCurrentStep] = useState(0);
|
|
44
|
+
const handleFormChange = () => setCurrentStep((prev) => {
|
|
45
|
+
if (prev === 5)
|
|
46
|
+
return 1;
|
|
47
|
+
return prev + 1;
|
|
48
|
+
});
|
|
49
|
+
const handleBack = () => setCurrentStep((prev) => {
|
|
50
|
+
if (prev === 0)
|
|
51
|
+
return 5;
|
|
52
|
+
return prev - 1;
|
|
53
|
+
});
|
|
54
|
+
const currentForm = homeWizardForm[currentStep];
|
|
55
|
+
return (_jsx(DrawerContent, { bg: "lightBlue.1", children: _jsx(HomeAssistantWizardPanel, Object.assign({}, args, { currentStep: currentStep + 1, currentForm: [currentForm], onNext: handleFormChange, onBack: handleBack, onSave: action('onSave'), isLoading: false })) }));
|
|
56
|
+
};
|
|
@@ -9,12 +9,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { useState } from 'react';
|
|
12
|
-
import { ConfirmProperty, ControlledWizard, DynamicForm, FooterButtons, HomeAssistantTutorial, HomeAssistantWizardSteps, MyHomeDetails, SearchRecords, WizardTextHeader, } from '@/components';
|
|
12
|
+
import { ConfirmProperty, ControlledWizard, DynamicForm, FooterButtons, HomeAssistantTutorial, HomeAssistantWizardSteps, MyHomeDetails, SearchRecords, WizardTextHeader, WizardSuccessHeader, WizardValueSummary, } from '@/components';
|
|
13
13
|
import { Box, Center, Stack } from '@chakra-ui/react';
|
|
14
14
|
import { action } from '@storybook/addon-actions';
|
|
15
15
|
import { formValues } from '@/helpers';
|
|
16
|
-
import { homeWizardForm, propertiesMock } from '@/mocks';
|
|
17
|
-
import { WizardSuccessHeader } from '@/components/wizard/WizardSuccessHeader';
|
|
16
|
+
import { assessedValueMock, homeWizardForm, propertiesMock, purchasePriceMock, } from '@/mocks';
|
|
18
17
|
export default {
|
|
19
18
|
title: 'Components/Wizard/ControlledWizard',
|
|
20
19
|
component: ControlledWizard,
|
|
@@ -40,7 +39,6 @@ export const ControlledWizardComponent = () => {
|
|
|
40
39
|
} }) })] })),
|
|
41
40
|
}));
|
|
42
41
|
return (_jsx(ControlledWizard, { minHeight: "700px", step: step, setStep: setStep, steps: [
|
|
43
|
-
...homeAssistantSteps,
|
|
44
42
|
{
|
|
45
43
|
header: (_jsx(WizardTextHeader, { title: "Hi John, let\u2019s get your Homefile set up.", subtitle: "Complete this quick setup and we\u2019ll handle the rest." })),
|
|
46
44
|
body: ({ setStep }) => (_jsx(MyHomeDetails, { isWizard: true, userFirstName: "Adam", values: formValues, properties: propertiesMock, handleCreateHomeClick: (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -59,6 +57,10 @@ export const ControlledWizardComponent = () => {
|
|
|
59
57
|
setStep(3);
|
|
60
58
|
} })),
|
|
61
59
|
},
|
|
60
|
+
{
|
|
61
|
+
header: (_jsx(WizardTextHeader, { title: "This is the data we found in public records.", subtitle: "The details linked to your address come from public data sources and may not \nrepresent the most up-to-date information about your home." })),
|
|
62
|
+
body: ({ setStep }) => (_jsx(WizardValueSummary, { title: "The Edmunds", address: "113 South First Street, Austin TX 89853", estimatedValue: 894000, purchasePrice: 456432, assessedValue: 726678, purchasePriceDetails: purchasePriceMock, assessedValueDetails: assessedValueMock, onAccurate: () => setStep(step + 1), onNotAccurate: () => setStep(step + 1) })),
|
|
63
|
+
},
|
|
62
64
|
{
|
|
63
65
|
header: (_jsx(WizardSuccessHeader, { title: "Your homefile has been created.", subtitle: "Your Homefile is created. You will be able to edit and update your home details once setup is complete.", address: {
|
|
64
66
|
city: 'Austin',
|
|
@@ -67,7 +69,8 @@ export const ControlledWizardComponent = () => {
|
|
|
67
69
|
number: '123',
|
|
68
70
|
zip: '80123',
|
|
69
71
|
}, name: "your home" })),
|
|
70
|
-
body: () => (_jsx(Center, { w: "full", h: "full", children: _jsx(HomeAssistantTutorial, { onStart: () => setStep(
|
|
72
|
+
body: () => (_jsx(Center, { w: "full", h: "full", children: _jsx(HomeAssistantTutorial, { onStart: () => setStep(step + 1) }) })),
|
|
71
73
|
},
|
|
74
|
+
...homeAssistantSteps,
|
|
72
75
|
] }));
|
|
73
76
|
};
|
package/package.json
CHANGED
|
@@ -100,6 +100,7 @@
|
|
|
100
100
|
"title": "One moment, we’re building your homefile."
|
|
101
101
|
},
|
|
102
102
|
"buttons": {
|
|
103
|
+
"accurate": "Accurate",
|
|
103
104
|
"back": "Back",
|
|
104
105
|
"cancel": "Cancel",
|
|
105
106
|
"confirm": "Confirm",
|
|
@@ -111,6 +112,7 @@
|
|
|
111
112
|
"edit": "Edit",
|
|
112
113
|
"forward": "Forward",
|
|
113
114
|
"next": "Next",
|
|
115
|
+
"notAccurate": "Not Accurate",
|
|
114
116
|
"previous": "Previous",
|
|
115
117
|
"save": "Save",
|
|
116
118
|
"send": "Send",
|
|
@@ -1293,5 +1295,11 @@
|
|
|
1293
1295
|
"description": "Est Value of Property Added to Homefile",
|
|
1294
1296
|
"label": "Value added in",
|
|
1295
1297
|
"title": "Value Monitor"
|
|
1298
|
+
},
|
|
1299
|
+
"wizardValueSummary": {
|
|
1300
|
+
"assessedValue": "[Year] Assessed Value",
|
|
1301
|
+
"estimatedValue": "Estimated Value",
|
|
1302
|
+
"info": "You can edit this record within your Homefile. Your information remains private and is never shared or sold.",
|
|
1303
|
+
"purchasePrice": "Purchase Price"
|
|
1296
1304
|
}
|
|
1297
1305
|
}
|
|
@@ -6,15 +6,24 @@ import {
|
|
|
6
6
|
WizardStepOptions,
|
|
7
7
|
} from '@/components'
|
|
8
8
|
|
|
9
|
-
export const HomeInitialSetup = ({ fields, callback }: FieldTypesI) => {
|
|
9
|
+
export const HomeInitialSetup = ({ fields, callback, style }: FieldTypesI) => {
|
|
10
|
+
const isWizard = style === 'wizard'
|
|
10
11
|
return (
|
|
11
|
-
<Stack
|
|
12
|
+
<Stack
|
|
13
|
+
bg="neutral.white"
|
|
14
|
+
spacing={{ base: '6', md: isWizard ? '10' : '0' }}
|
|
15
|
+
>
|
|
12
16
|
{fields?.map(
|
|
13
17
|
({ children = [], id, label = '', type, value, description }) => {
|
|
14
18
|
switch (type) {
|
|
15
19
|
case 'home-wizard-header':
|
|
16
20
|
return (
|
|
17
|
-
<WizardTextBody
|
|
21
|
+
<WizardTextBody
|
|
22
|
+
key={id}
|
|
23
|
+
title={label}
|
|
24
|
+
subtitle={description}
|
|
25
|
+
style={style}
|
|
26
|
+
/>
|
|
18
27
|
)
|
|
19
28
|
case 'home-wizard-initial-setup':
|
|
20
29
|
return (
|
|
@@ -23,6 +32,7 @@ export const HomeInitialSetup = ({ fields, callback }: FieldTypesI) => {
|
|
|
23
32
|
form={children}
|
|
24
33
|
title={String(value)}
|
|
25
34
|
callback={callback}
|
|
35
|
+
style={style}
|
|
26
36
|
/>
|
|
27
37
|
)
|
|
28
38
|
case 'home-wizard-step-options':
|
|
@@ -32,6 +42,7 @@ export const HomeInitialSetup = ({ fields, callback }: FieldTypesI) => {
|
|
|
32
42
|
form={children}
|
|
33
43
|
title={String(value)}
|
|
34
44
|
callback={callback}
|
|
45
|
+
style={style}
|
|
35
46
|
/>
|
|
36
47
|
)
|
|
37
48
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropsWithChildren, useState, useEffect
|
|
1
|
+
import { PropsWithChildren, useState, useEffect } from 'react'
|
|
2
2
|
import { FormProvider } from 'react-hook-form'
|
|
3
3
|
import { t } from 'i18next'
|
|
4
4
|
import {
|
|
@@ -16,6 +16,8 @@ import {
|
|
|
16
16
|
HomeAssistantPanelStep,
|
|
17
17
|
PanelHeader,
|
|
18
18
|
Loading,
|
|
19
|
+
HomeAssistantWizardSteps,
|
|
20
|
+
DynamicForm,
|
|
19
21
|
} from '@/components'
|
|
20
22
|
import { AppliancesType, HomeAssistantPanelI } from '@/interfaces'
|
|
21
23
|
import { homeAssistantSteps } from '@/helpers'
|
|
@@ -26,7 +28,7 @@ export const HomeAssistantPanel = ({
|
|
|
26
28
|
children,
|
|
27
29
|
currentForm,
|
|
28
30
|
currentStep,
|
|
29
|
-
onApplianceClick,
|
|
31
|
+
onApplianceClick = () => {},
|
|
30
32
|
onBack,
|
|
31
33
|
onClose,
|
|
32
34
|
onNext,
|
|
@@ -112,7 +114,7 @@ export const HomeAssistantPanel = ({
|
|
|
112
114
|
!hasCompleted && currentStep === 6
|
|
113
115
|
? t('buttons.finish')
|
|
114
116
|
: t('buttons.saveStep'),
|
|
115
|
-
onClick: () => onSave(updatedFields),
|
|
117
|
+
onClick: () => onSave?.(updatedFields),
|
|
116
118
|
}}
|
|
117
119
|
button3={
|
|
118
120
|
!hasCompleted && currentStep === 6
|
|
@@ -129,3 +131,66 @@ export const HomeAssistantPanel = ({
|
|
|
129
131
|
</>
|
|
130
132
|
)
|
|
131
133
|
}
|
|
134
|
+
|
|
135
|
+
export const HomeAssistantWizardPanel = ({
|
|
136
|
+
currentForm,
|
|
137
|
+
currentStep,
|
|
138
|
+
onBack,
|
|
139
|
+
onClose,
|
|
140
|
+
onNext,
|
|
141
|
+
onSave,
|
|
142
|
+
backDisabled,
|
|
143
|
+
nextDisabled,
|
|
144
|
+
hasCompleted,
|
|
145
|
+
isLoading,
|
|
146
|
+
}: PropsWithChildren<HomeAssistantPanelI>) => {
|
|
147
|
+
if (isLoading) return <Loading />
|
|
148
|
+
|
|
149
|
+
return (
|
|
150
|
+
<>
|
|
151
|
+
<DrawerHeader p="0">
|
|
152
|
+
<PanelHeader
|
|
153
|
+
handleCloseButton={onClose}
|
|
154
|
+
title={t('homeAssistant.title')}
|
|
155
|
+
icon={IA}
|
|
156
|
+
/>
|
|
157
|
+
</DrawerHeader>
|
|
158
|
+
<DrawerBody p="0">
|
|
159
|
+
<HomeAssistantWizardSteps currentStep={currentStep} />
|
|
160
|
+
<DynamicForm form={currentForm} showTitle={false} style="panel" />
|
|
161
|
+
</DrawerBody>
|
|
162
|
+
<DrawerFooter px="0" py="6" bg="neutral.white">
|
|
163
|
+
<FooterButtons
|
|
164
|
+
button1={
|
|
165
|
+
currentStep === 1
|
|
166
|
+
? undefined
|
|
167
|
+
: {
|
|
168
|
+
buttonStyle: 'secondaryFooter',
|
|
169
|
+
label: t('buttons.back'),
|
|
170
|
+
onClick: onBack,
|
|
171
|
+
isDisabled: backDisabled,
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
button2={{
|
|
175
|
+
buttonStyle: 'primaryFooter',
|
|
176
|
+
label:
|
|
177
|
+
!hasCompleted && currentStep === 5
|
|
178
|
+
? t('buttons.finish')
|
|
179
|
+
: t('buttons.saveStep'),
|
|
180
|
+
onClick: () => onSave?.(),
|
|
181
|
+
}}
|
|
182
|
+
button3={
|
|
183
|
+
!hasCompleted && currentStep === 5
|
|
184
|
+
? undefined
|
|
185
|
+
: {
|
|
186
|
+
buttonStyle: 'primaryFooter',
|
|
187
|
+
label: t('buttons.next'),
|
|
188
|
+
onClick: onNext,
|
|
189
|
+
isDisabled: nextDisabled,
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
/>
|
|
193
|
+
</DrawerFooter>
|
|
194
|
+
</>
|
|
195
|
+
)
|
|
196
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Box, Center, Image, Stack, Text } from '@chakra-ui/react'
|
|
2
2
|
import { CheckInCircle } from '@/assets/images'
|
|
3
3
|
import { HomeAssistantButtonI } from '@/interfaces'
|
|
4
4
|
import { getIconAltText } from '@/utils'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PropsWithChildren } from 'react'
|
|
2
2
|
import { Box, Flex, useRadio, UseRadioProps } from '@chakra-ui/react'
|
|
3
3
|
import { isSafari } from '@/utils'
|
|
4
4
|
|
|
@@ -33,6 +33,7 @@ export const RadioCard = (props: PropsWithChildren<UseRadioProps>) => {
|
|
|
33
33
|
rounded={isSafari() ? 'sm' : 'full'}
|
|
34
34
|
border="1px"
|
|
35
35
|
borderColor="lightBlue.5"
|
|
36
|
+
flexShrink={0}
|
|
36
37
|
_checked={{
|
|
37
38
|
bg: 'blue.2',
|
|
38
39
|
outline: '2px solid white',
|
|
@@ -15,14 +15,19 @@ export const WizardInitialOptions = ({
|
|
|
15
15
|
form,
|
|
16
16
|
title,
|
|
17
17
|
callback,
|
|
18
|
+
style = 'wizard',
|
|
18
19
|
}: DynamicFormI) => {
|
|
19
20
|
const { control } = useFormContext()
|
|
21
|
+
const isWizard = style === 'wizard'
|
|
20
22
|
return (
|
|
21
23
|
<Stack spacing="base" bg="lightBlue.1" p="base">
|
|
22
24
|
<Text fontFamily="secondary" fontSize="sm">
|
|
23
25
|
{title}
|
|
24
26
|
</Text>
|
|
25
|
-
<SimpleGrid
|
|
27
|
+
<SimpleGrid
|
|
28
|
+
columns={{ base: 1, md: isWizard ? 2 : 1 }}
|
|
29
|
+
spacing={{ base: 1, md: isWizard ? 'base' : 1 }}
|
|
30
|
+
>
|
|
26
31
|
{form.map((field) => {
|
|
27
32
|
const { id, value, label, icon, description } = field
|
|
28
33
|
return (
|
|
@@ -54,6 +59,7 @@ export const WizardInitialOptions = ({
|
|
|
54
59
|
<Stack
|
|
55
60
|
as="button"
|
|
56
61
|
p="base"
|
|
62
|
+
w="full"
|
|
57
63
|
onClick={() => {
|
|
58
64
|
onChange(!value)
|
|
59
65
|
callback?.({ ...field, value: !value })
|
|
@@ -12,15 +12,21 @@ import { Controller, useFormContext } from 'react-hook-form'
|
|
|
12
12
|
import { CheckInCircle } from '@/assets/images'
|
|
13
13
|
import { fieldIcons, setOptionButtonStyles } from '@/helpers'
|
|
14
14
|
|
|
15
|
-
export const WizardStepOptions = ({
|
|
15
|
+
export const WizardStepOptions = ({
|
|
16
|
+
form,
|
|
17
|
+
title,
|
|
18
|
+
callback,
|
|
19
|
+
style = 'wizard',
|
|
20
|
+
}: DynamicFormI) => {
|
|
16
21
|
const { control } = useFormContext()
|
|
22
|
+
const isWizard = style === 'wizard'
|
|
17
23
|
return (
|
|
18
24
|
<Stack spacing="base" bg="lightBlue.1" p="base">
|
|
19
25
|
<Text fontFamily="secondary" fontSize="sm">
|
|
20
26
|
{title}
|
|
21
27
|
</Text>
|
|
22
28
|
<SimpleGrid
|
|
23
|
-
columns={6}
|
|
29
|
+
columns={{ base: 3, md: isWizard ? 6 : 5 }}
|
|
24
30
|
spacing="base"
|
|
25
31
|
gridAutoRows="1fr"
|
|
26
32
|
alignItems="stretch"
|
|
@@ -1,23 +1,48 @@
|
|
|
1
|
-
import { Center, Stack, Text } from '@chakra-ui/react'
|
|
1
|
+
import { Box, Center, Stack, Text } from '@chakra-ui/react'
|
|
2
2
|
import { WizardTextHeaderI } from '@/interfaces'
|
|
3
3
|
|
|
4
|
-
export const WizardTextBody = ({
|
|
4
|
+
export const WizardTextBody = ({
|
|
5
|
+
title,
|
|
6
|
+
subtitle,
|
|
7
|
+
style,
|
|
8
|
+
}: WizardTextHeaderI) => {
|
|
9
|
+
const isWizard = style === 'wizard'
|
|
10
|
+
|
|
11
|
+
if (isWizard) {
|
|
12
|
+
return (
|
|
13
|
+
<Center w="full" minH={{ md: '100px' }}>
|
|
14
|
+
<Stack spacing="4" w={{ base: 'full', md: '80%' }}>
|
|
15
|
+
<Text
|
|
16
|
+
fontSize={{ base: 'xl', md: '2xl' }}
|
|
17
|
+
lineHeight={{ base: 'shorter', md: 'base' }}
|
|
18
|
+
textAlign={{ base: 'left', md: 'center' }}
|
|
19
|
+
>
|
|
20
|
+
{title}
|
|
21
|
+
</Text>
|
|
22
|
+
{subtitle && (
|
|
23
|
+
<Text
|
|
24
|
+
fontFamily="secondary"
|
|
25
|
+
textAlign={{ base: 'left', md: 'center' }}
|
|
26
|
+
>
|
|
27
|
+
{subtitle}
|
|
28
|
+
</Text>
|
|
29
|
+
)}
|
|
30
|
+
</Stack>
|
|
31
|
+
</Center>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
5
34
|
return (
|
|
6
|
-
<
|
|
7
|
-
<Stack spacing="4" w="
|
|
8
|
-
<Text
|
|
9
|
-
fontSize={{ base: 'xl', md: '2xl' }}
|
|
10
|
-
lineHeight={{ base: 'shorter', md: 'base' }}
|
|
11
|
-
textAlign="center"
|
|
12
|
-
>
|
|
35
|
+
<Box p="base">
|
|
36
|
+
<Stack spacing="4" w="full">
|
|
37
|
+
<Text fontSize="2xl" lineHeight="base" textAlign="left">
|
|
13
38
|
{title}
|
|
14
39
|
</Text>
|
|
15
40
|
{subtitle && (
|
|
16
|
-
<Text fontFamily="secondary" textAlign="
|
|
41
|
+
<Text fontFamily="secondary" textAlign="left">
|
|
17
42
|
{subtitle}
|
|
18
43
|
</Text>
|
|
19
44
|
)}
|
|
20
45
|
</Stack>
|
|
21
|
-
</
|
|
46
|
+
</Box>
|
|
22
47
|
)
|
|
23
48
|
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { t } from 'i18next'
|
|
2
|
+
import { Stack, Text, Flex, Divider, Button } from '@chakra-ui/react'
|
|
3
|
+
import { TrendingValueCard, RecordsSession } from '@/components'
|
|
4
|
+
import { WizardValueSummaryProps } from '@/interfaces'
|
|
5
|
+
|
|
6
|
+
export const WizardValueSummary = ({
|
|
7
|
+
title,
|
|
8
|
+
subtitle,
|
|
9
|
+
address,
|
|
10
|
+
estimatedValue,
|
|
11
|
+
purchasePrice,
|
|
12
|
+
assessedValue,
|
|
13
|
+
purchasePriceDetails,
|
|
14
|
+
assessedValueDetails,
|
|
15
|
+
onAccurate,
|
|
16
|
+
onNotAccurate,
|
|
17
|
+
}: WizardValueSummaryProps) => {
|
|
18
|
+
const estimatedValueFormatted = `$${estimatedValue.toLocaleString('en-US')}.`
|
|
19
|
+
return (
|
|
20
|
+
<Stack w={{ base: 'full', md: '70%' }} m="auto" spacing="6">
|
|
21
|
+
<Stack spacing="1" align="center">
|
|
22
|
+
<Text fontSize="2xl" textTransform="capitalize">
|
|
23
|
+
{title}
|
|
24
|
+
</Text>
|
|
25
|
+
<Text fontFamily="secondary">{address}</Text>
|
|
26
|
+
{subtitle && <Text fontFamily="secondary">{subtitle}</Text>}
|
|
27
|
+
</Stack>
|
|
28
|
+
<Stack bg="lightGreen.3" spacing="base" pt="base" pb="6" align="center">
|
|
29
|
+
<Text fontSize="xs" textTransform="uppercase">
|
|
30
|
+
{t('wizardValueSummary.estimatedValue')}
|
|
31
|
+
</Text>
|
|
32
|
+
<Text fontSize="3xl">{estimatedValueFormatted}</Text>
|
|
33
|
+
</Stack>
|
|
34
|
+
<Flex gap="base" direction={{ base: 'column', md: 'row' }}>
|
|
35
|
+
<Stack flex="1" spacing="6">
|
|
36
|
+
<TrendingValueCard
|
|
37
|
+
bg="lightBlue.1"
|
|
38
|
+
label={t('wizardValueSummary.purchasePrice')}
|
|
39
|
+
value={purchasePrice}
|
|
40
|
+
/>
|
|
41
|
+
<RecordsSession
|
|
42
|
+
details={purchasePriceDetails}
|
|
43
|
+
showLine={false}
|
|
44
|
+
gap="1"
|
|
45
|
+
textAlign="right"
|
|
46
|
+
p="0"
|
|
47
|
+
/>
|
|
48
|
+
</Stack>
|
|
49
|
+
<Stack flex="1" spacing="6">
|
|
50
|
+
<TrendingValueCard
|
|
51
|
+
bg="lightBlue.1"
|
|
52
|
+
label={t('wizardValueSummary.assessedValue')}
|
|
53
|
+
value={assessedValue}
|
|
54
|
+
/>
|
|
55
|
+
<RecordsSession
|
|
56
|
+
details={assessedValueDetails}
|
|
57
|
+
showLine={false}
|
|
58
|
+
gap="1"
|
|
59
|
+
textAlign="right"
|
|
60
|
+
p="0"
|
|
61
|
+
/>
|
|
62
|
+
</Stack>
|
|
63
|
+
</Flex>
|
|
64
|
+
<Divider borderStyle="dotted" borderColor="lightBlue.11" />
|
|
65
|
+
<Flex gap="base">
|
|
66
|
+
<Button onClick={onNotAccurate}>{t('buttons.notAccurate')}</Button>
|
|
67
|
+
<Button onClick={onAccurate}>{t('buttons.accurate')}</Button>
|
|
68
|
+
</Flex>
|
|
69
|
+
<Text
|
|
70
|
+
fontFamily="secondary"
|
|
71
|
+
fontSize="sm"
|
|
72
|
+
textAlign="center"
|
|
73
|
+
color="gray.2"
|
|
74
|
+
lineHeight="shorter"
|
|
75
|
+
>
|
|
76
|
+
{t('wizardValueSummary.info')}
|
|
77
|
+
</Text>
|
|
78
|
+
</Stack>
|
|
79
|
+
)
|
|
80
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -72,6 +72,7 @@ export {
|
|
|
72
72
|
HelpContent,
|
|
73
73
|
HomeAssistant,
|
|
74
74
|
HomeAssistantPanel,
|
|
75
|
+
HomeAssistantWizardPanel,
|
|
75
76
|
HomeBoardGrid,
|
|
76
77
|
HomeBoardTour,
|
|
77
78
|
HomeCard,
|
|
@@ -219,6 +220,7 @@ export {
|
|
|
219
220
|
WellDone,
|
|
220
221
|
YtdTile,
|
|
221
222
|
WizardTextHeader,
|
|
223
|
+
WizardValueSummary,
|
|
222
224
|
} from './components'
|
|
223
225
|
|
|
224
226
|
export { useCustomToast } from './hooks'
|
|
@@ -3,11 +3,11 @@ import { DynamicFormI, ReportI } from '@/interfaces'
|
|
|
3
3
|
export interface HomeAssistantPanelI {
|
|
4
4
|
currentForm: DynamicFormI['form']
|
|
5
5
|
currentStep: number
|
|
6
|
-
onApplianceClick
|
|
6
|
+
onApplianceClick?: (selected: string[]) => void
|
|
7
7
|
onBack: () => void
|
|
8
8
|
onClose: () => void
|
|
9
9
|
onNext: () => void
|
|
10
|
-
onSave
|
|
10
|
+
onSave?: (form?: ReportI[]) => void
|
|
11
11
|
backDisabled: boolean
|
|
12
12
|
nextDisabled: boolean
|
|
13
13
|
hasCompleted: boolean
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface WizardValueSummaryProps {
|
|
2
|
+
title: string
|
|
3
|
+
subtitle?: string
|
|
4
|
+
address: string
|
|
5
|
+
estimatedValue: number
|
|
6
|
+
purchasePrice: number
|
|
7
|
+
assessedValue: number
|
|
8
|
+
purchasePriceDetails: Record<string, string | undefined>
|
|
9
|
+
assessedValueDetails: Record<string, string | undefined>
|
|
10
|
+
onAccurate: () => void
|
|
11
|
+
onNotAccurate: () => void
|
|
12
|
+
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { Meta } from '@storybook/react'
|
|
2
2
|
import { DrawerContent } from '@chakra-ui/react'
|
|
3
3
|
import { action } from '@storybook/addon-actions'
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
HomeAssistantPanel,
|
|
6
|
+
HomeAssistantWizardPanel,
|
|
7
|
+
RightPanel,
|
|
8
|
+
} from '@/components'
|
|
5
9
|
import { HomeAssistantPanelI, ReportI } from '@/interfaces'
|
|
6
10
|
import {
|
|
7
11
|
homeAssitantStep1FormMock,
|
|
@@ -10,6 +14,7 @@ import {
|
|
|
10
14
|
homeAssitantStep4FormMock,
|
|
11
15
|
homeAssitantStep5FormMock,
|
|
12
16
|
homeAssitantStep6FormMock,
|
|
17
|
+
homeWizardForm,
|
|
13
18
|
} from '@/mocks'
|
|
14
19
|
import { useState } from 'react'
|
|
15
20
|
|
|
@@ -67,3 +72,33 @@ export const HomeAssistantPanelComponent = (args: HomeAssistantPanelI) => {
|
|
|
67
72
|
</DrawerContent>
|
|
68
73
|
)
|
|
69
74
|
}
|
|
75
|
+
|
|
76
|
+
export const NewHomeAssistantPanelComponent = (args: HomeAssistantPanelI) => {
|
|
77
|
+
const [currentStep, setCurrentStep] = useState<number>(0)
|
|
78
|
+
const handleFormChange = () =>
|
|
79
|
+
setCurrentStep((prev) => {
|
|
80
|
+
if (prev === 5) return 1
|
|
81
|
+
return prev + 1
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
const handleBack = () =>
|
|
85
|
+
setCurrentStep((prev) => {
|
|
86
|
+
if (prev === 0) return 5
|
|
87
|
+
return prev - 1
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
const currentForm = homeWizardForm[currentStep]
|
|
91
|
+
return (
|
|
92
|
+
<DrawerContent bg="lightBlue.1">
|
|
93
|
+
<HomeAssistantWizardPanel
|
|
94
|
+
{...args}
|
|
95
|
+
currentStep={currentStep + 1}
|
|
96
|
+
currentForm={[currentForm]}
|
|
97
|
+
onNext={handleFormChange}
|
|
98
|
+
onBack={handleBack}
|
|
99
|
+
onSave={action('onSave')}
|
|
100
|
+
isLoading={false}
|
|
101
|
+
/>
|
|
102
|
+
</DrawerContent>
|
|
103
|
+
)
|
|
104
|
+
}
|
|
@@ -10,13 +10,19 @@ import {
|
|
|
10
10
|
MyHomeDetails,
|
|
11
11
|
SearchRecords,
|
|
12
12
|
WizardTextHeader,
|
|
13
|
+
WizardSuccessHeader,
|
|
14
|
+
WizardValueSummary,
|
|
13
15
|
} from '@/components'
|
|
14
16
|
import { Box, Center, Stack } from '@chakra-ui/react'
|
|
15
17
|
import { action } from '@storybook/addon-actions'
|
|
16
18
|
import { formValues } from '@/helpers'
|
|
17
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
assessedValueMock,
|
|
21
|
+
homeWizardForm,
|
|
22
|
+
propertiesMock,
|
|
23
|
+
purchasePriceMock,
|
|
24
|
+
} from '@/mocks'
|
|
18
25
|
import { ControlledWizardI, HomeFormI } from '@/interfaces'
|
|
19
|
-
import { WizardSuccessHeader } from '@/components/wizard/WizardSuccessHeader'
|
|
20
26
|
|
|
21
27
|
export default {
|
|
22
28
|
title: 'Components/Wizard/ControlledWizard',
|
|
@@ -74,7 +80,6 @@ export const ControlledWizardComponent = () => {
|
|
|
74
80
|
step={step}
|
|
75
81
|
setStep={setStep}
|
|
76
82
|
steps={[
|
|
77
|
-
...homeAssistantSteps,
|
|
78
83
|
{
|
|
79
84
|
header: (
|
|
80
85
|
<WizardTextHeader
|
|
@@ -119,6 +124,28 @@ export const ControlledWizardComponent = () => {
|
|
|
119
124
|
/>
|
|
120
125
|
),
|
|
121
126
|
},
|
|
127
|
+
{
|
|
128
|
+
header: (
|
|
129
|
+
<WizardTextHeader
|
|
130
|
+
title="This is the data we found in public records."
|
|
131
|
+
subtitle="The details linked to your address come from public data sources and may not
|
|
132
|
+
represent the most up-to-date information about your home."
|
|
133
|
+
/>
|
|
134
|
+
),
|
|
135
|
+
body: ({ setStep }) => (
|
|
136
|
+
<WizardValueSummary
|
|
137
|
+
title="The Edmunds"
|
|
138
|
+
address="113 South First Street, Austin TX 89853"
|
|
139
|
+
estimatedValue={894000}
|
|
140
|
+
purchasePrice={456432}
|
|
141
|
+
assessedValue={726678}
|
|
142
|
+
purchasePriceDetails={purchasePriceMock}
|
|
143
|
+
assessedValueDetails={assessedValueMock}
|
|
144
|
+
onAccurate={() => setStep(step + 1)}
|
|
145
|
+
onNotAccurate={() => setStep(step + 1)}
|
|
146
|
+
/>
|
|
147
|
+
),
|
|
148
|
+
},
|
|
122
149
|
{
|
|
123
150
|
header: (
|
|
124
151
|
<WizardSuccessHeader
|
|
@@ -136,10 +163,12 @@ export const ControlledWizardComponent = () => {
|
|
|
136
163
|
),
|
|
137
164
|
body: () => (
|
|
138
165
|
<Center w="full" h="full">
|
|
139
|
-
<HomeAssistantTutorial onStart={() => setStep(
|
|
166
|
+
<HomeAssistantTutorial onStart={() => setStep(step + 1)} />
|
|
140
167
|
</Center>
|
|
141
168
|
),
|
|
142
169
|
},
|
|
170
|
+
|
|
171
|
+
...homeAssistantSteps,
|
|
143
172
|
]}
|
|
144
173
|
/>
|
|
145
174
|
)
|