@homefile/components-v2 2.39.21 → 2.39.22
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/components/myHomes/WrapperWithShadow.d.ts +1 -1
- package/dist/components/myHomes/WrapperWithShadow.js +2 -2
- package/dist/components/myHomes/steps/ConfirmProperty.js +1 -1
- package/dist/components/myHomes/steps/NewHomeDetails.js +2 -2
- package/dist/components/myHomes/steps/PropertyCards.js +2 -2
- package/dist/components/wizard/ControlledWizard.d.ts +1 -1
- package/dist/components/wizard/ControlledWizard.js +3 -3
- package/dist/components/wizard/WizardTextHeader.d.ts +1 -1
- package/dist/components/wizard/WizardTextHeader.js +2 -2
- package/dist/components/wizard/WizardValueSummary.js +1 -1
- package/dist/interfaces/myHomes/WrapperWithShadow.interface.d.ts +2 -0
- package/dist/interfaces/wizard/ControlledWizard.interface.d.ts +1 -0
- package/dist/interfaces/wizard/WizardTextHeader.interface.d.ts +1 -0
- package/dist/stories/wizard/ControlledWizard.stories.js +8 -7
- package/dist/theme/components/ButtonStyles.d.ts +22 -0
- package/dist/theme/components/ButtonStyles.js +22 -0
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { WrapperWithShadowI } from '../../interfaces';
|
|
3
|
-
export declare const WrapperWithShadow: ({ animation, children, fadeDelay, isWizard, }: PropsWithChildren<WrapperWithShadowI>) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const WrapperWithShadow: ({ animation, children, fadeDelay, isWizard, padding, pb, }: PropsWithChildren<WrapperWithShadowI>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Stack, Fade } from '@chakra-ui/react';
|
|
3
|
-
export const WrapperWithShadow = ({ animation, children, fadeDelay = 0.3, isWizard = false, }) => {
|
|
3
|
+
export const WrapperWithShadow = ({ animation, children, fadeDelay = 0.3, isWizard = false, padding = 'base', pb = '3rem', }) => {
|
|
4
4
|
const styles = isWizard
|
|
5
5
|
? {}
|
|
6
6
|
: {
|
|
@@ -10,5 +10,5 @@ export const WrapperWithShadow = ({ animation, children, fadeDelay = 0.3, isWiza
|
|
|
10
10
|
h: 'full',
|
|
11
11
|
overflowY: 'scroll',
|
|
12
12
|
};
|
|
13
|
-
return (_jsx(Stack, Object.assign({}, styles, { w: "full", spacing: "base", p:
|
|
13
|
+
return (_jsx(Stack, Object.assign({}, styles, { w: "full", spacing: "base", p: padding, pb: pb, children: _jsx(Fade, { delay: fadeDelay, in: true, children: children }) })));
|
|
14
14
|
};
|
|
@@ -30,7 +30,7 @@ export const ConfirmProperty = ({ handleAddress = () => { }, isFirstHome, isLoad
|
|
|
30
30
|
handleAddress === null || handleAddress === void 0 ? void 0 : handleAddress(currentProperty);
|
|
31
31
|
};
|
|
32
32
|
if (isWizard) {
|
|
33
|
-
return (_jsxs(Stack, { children: [_jsxs(Stack, { align: "center",
|
|
33
|
+
return (_jsxs(Stack, { spacing: "4", children: [_jsxs(Stack, { align: "center", w: "full", spacing: "base", children: [_jsx(PropertyCards, { properties: propertiesWithNoneOfTheAbove, currentProperty: currentProperty, onChange: setCurrentProperty }), _jsx(Box, { children: _jsx(Text, { variant: "home", textAlign: "center", children: footerText }) })] }), _jsx(Button, { onClick: handleContinue, disabled: isLoading, variant: "wizard", children: t('buttons.confirm') })] }));
|
|
34
34
|
}
|
|
35
35
|
return (_jsx(MyHomesStepWrapper, { isFirstHome: isFirstHome, children: _jsxs(MyHomesStepBody, { fadeDelay: 0, title: t('myHomes.properties.title'), subtitle: t('myHomes.properties.subtitle'), children: [_jsxs(Stack, { align: "center", bg: "lightViolet.1", borderRadius: "sm", w: "100%", py: "6", children: [_jsx(PropertyCards, { properties: propertiesWithNoneOfTheAbove, currentProperty: currentProperty, onChange: setCurrentProperty }), _jsx(Box, { px: "6", children: _jsx(Text, { variant: "home", textAlign: "center", children: footerText }) })] }), _jsx(Button, { onClick: handleContinue, disabled: isLoading, children: t('buttons.continue') })] }) }));
|
|
36
36
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useSnapshot } from 'valtio';
|
|
3
3
|
import { t } from 'i18next';
|
|
4
|
-
import {
|
|
4
|
+
import { Stack, Center, Flex, Button, Divider, } from '@chakra-ui/react';
|
|
5
5
|
import { AddressStored, TextInput, IncludePublicRecords, WrapperWithShadow, } from '../../../components';
|
|
6
6
|
import { firstHomeProxy } from '../../../proxies';
|
|
7
7
|
import { useAddHouseContent } from '../../../hooks';
|
|
@@ -12,5 +12,5 @@ export const NewHomeDetails = ({ handleCreateHomeClick, values, isLoading, }) =>
|
|
|
12
12
|
const { name, isNameValid, searchRecords } = useSnapshot(firstHomeProxy, {
|
|
13
13
|
sync: true,
|
|
14
14
|
});
|
|
15
|
-
return (_jsxs(
|
|
15
|
+
return (_jsxs(Stack, { spacing: "base", children: [isLoading && (_jsx(Center, { h: "4rem", children: _jsx(BeatLoader, { color: "gray", size: 8 }) })), !isLoading && (_jsxs(Stack, { spacing: "base", children: [_jsx(TextInput, { errorMessage: handleErrorMessage(), hasError: !isNameValid, id: "homeName", placeholder: t('myHomes.form.homeName'), handleChange: handleNameChange, onBlurCapture: handleNameValidation, value: name }), _jsx(Divider, { borderStyle: "dashed", borderColor: "lightBlue.6" }), _jsx(AddressStored, {})] })), _jsx(WrapperWithShadow, { animation: up, fadeDelay: 0.2, isWizard: true, padding: "0", pb: "0", children: _jsx(Flex, { direction: "column", justify: "space-between", gap: "10", h: "full", children: _jsxs(Stack, { spacing: "4", children: [_jsx(IncludePublicRecords, { isChecked: searchRecords, onSelectRecords: handleSelectRecords }), _jsx(Button, { onClick: handleSubmit, disabled: isLoading, variant: "wizard", children: t('buttons.confirm') })] }) }) })] }));
|
|
16
16
|
};
|
|
@@ -12,8 +12,8 @@ export const PropertyCards = ({ properties, currentProperty, onChange, }) => {
|
|
|
12
12
|
const hasProperties = ((_a = properties === null || properties === void 0 ? void 0 : properties.length) !== null && _a !== void 0 ? _a : 0) > 0;
|
|
13
13
|
if (!hasProperties)
|
|
14
14
|
return null;
|
|
15
|
-
return (_jsx(Stack, Object.assign({}, group, { spacing: "
|
|
15
|
+
return (_jsx(Stack, Object.assign({}, group, { spacing: "1", w: "full", children: properties === null || properties === void 0 ? void 0 : properties.map(({ id, address: { address } }) => {
|
|
16
16
|
const radio = getRadioProps({ value: id });
|
|
17
|
-
return (_jsx(RadioCard, Object.assign({}, radio, { children: _jsx(Text, {
|
|
17
|
+
return (_jsx(RadioCard, Object.assign({}, radio, { children: _jsx(Text, { children: address }) }), id));
|
|
18
18
|
}) })));
|
|
19
19
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ControlledWizardI } from '../../interfaces';
|
|
2
|
-
export declare function ControlledWizard({ step, setStep, steps, height, headerBlink, }: ControlledWizardI): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function ControlledWizard({ bodyWidth, step, setStep, steps, height, headerBlink, }: ControlledWizardI): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Stack } from '@chakra-ui/react';
|
|
2
|
+
import { Box, Flex, Stack } from '@chakra-ui/react';
|
|
3
3
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
4
4
|
const MotionBox = motion.create(typeof Box);
|
|
5
|
-
export function ControlledWizard({ step, setStep, steps, height = '700px', headerBlink, }) {
|
|
5
|
+
export function ControlledWizard({ bodyWidth = '80%', step, setStep, steps, height = '700px', headerBlink, }) {
|
|
6
6
|
const current = steps[step];
|
|
7
7
|
const headerVariants = {
|
|
8
8
|
initial: { opacity: 0, y: 8 },
|
|
@@ -16,5 +16,5 @@ export function ControlledWizard({ step, setStep, steps, height = '700px', heade
|
|
|
16
16
|
animate: { opacity: 1, y: 0, scale: 1 },
|
|
17
17
|
exit: { opacity: 0, y: -8, scale: 0.98 },
|
|
18
18
|
};
|
|
19
|
-
return (_jsxs(Stack, { spacing:
|
|
19
|
+
return (_jsxs(Stack, { spacing: { base: '4', md: '8' }, shadow: "md", h: height, bg: "white", overflowY: "hidden", pb: { base: '8', md: '16' }, children: [_jsx(AnimatePresence, { mode: "wait", children: _jsx(Box, { as: MotionBox, variants: headerVariants, initial: "initial", animate: "animate", exit: "exit", w: "full", children: current.header }, `h-${step}`) }), _jsx(AnimatePresence, { mode: "wait", children: _jsx(Box, { as: MotionBox, variants: bodyVariants, initial: "initial", animate: "animate", exit: "exit", flex: "1", display: "flex", minH: "0", children: _jsx(Flex, { direction: "column", flex: "1", overflowY: "auto", minH: "0", align: "center", children: _jsx(Box, { w: bodyWidth, children: current.body({ setStep }) }) }) }, `b-${step}`) })] }));
|
|
20
20
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { WizardTextHeaderI } from '../../interfaces';
|
|
2
|
-
export declare const WizardTextHeader: ({ title, subtitle }: WizardTextHeaderI) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const WizardTextHeader: ({ title, subtitle, width, }: WizardTextHeaderI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Center, Show, Stack, Text, Box } from '@chakra-ui/react';
|
|
3
3
|
import { Logo } from '../../components';
|
|
4
|
-
export const WizardTextHeader = ({ title, subtitle }) => {
|
|
5
|
-
return (_jsx(Center, { w: "full", bg: "lightGreen.1", minH: "212px", children: _jsxs(Stack, { w: "full", spacing: "0", align: "center", children: [_jsx(Show, { below: "md", children: _jsx(Logo, {}) }), _jsxs(Stack, { spacing: "6", w:
|
|
4
|
+
export const WizardTextHeader = ({ title, subtitle, width = '80%', }) => {
|
|
5
|
+
return (_jsx(Center, { w: "full", bg: "lightGreen.1", minH: "212px", children: _jsxs(Stack, { w: "full", spacing: "0", align: "center", children: [_jsx(Show, { below: "md", children: _jsx(Logo, {}) }), _jsxs(Stack, { spacing: "6", w: width, children: [_jsx(Text, { fontSize: { base: '22px', md: '26px' }, lineHeight: { base: '26px', md: '30px' }, textAlign: "center", whiteSpace: "pre-wrap", children: title }), subtitle && (_jsx(Text, { fontFamily: "secondary", textAlign: "center", whiteSpace: "pre-wrap", children: subtitle })), _jsx(Show, { below: "md", children: _jsx(Box, { h: "6" }) })] })] }) }));
|
|
6
6
|
};
|
|
@@ -4,5 +4,5 @@ import { Stack, Text, Flex, Divider, Button } from '@chakra-ui/react';
|
|
|
4
4
|
import { TrendingValueCard, RecordsSession, ReactionTag } from '../../components';
|
|
5
5
|
export const WizardValueSummary = ({ title, subtitle, address, estimatedValue, purchasePrice, assessedValue, purchasePriceDetails, assessedValueDetails, onAccurate, onNotAccurate, onComplete, accuracyStatus, }) => {
|
|
6
6
|
const estimatedValueFormatted = `$${estimatedValue.toLocaleString('en-US')}.`;
|
|
7
|
-
return (_jsxs(Stack, {
|
|
7
|
+
return (_jsxs(Stack, { 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: "dashed", borderColor: "lightBlue.11" }), _jsxs(Flex, { align: "center", justify: "space-between", children: [_jsxs(Flex, { gap: "base", align: "center", children: [_jsx(Text, { fontFamily: "secondary", fontSize: "xs", color: "gray.2", lineHeight: "shorter", whiteSpace: "pre-line", children: t('wizardValueSummary.accurateData') }), _jsx(ReactionTag, { type: "dislike", ariaLabel: t('buttons.notAccurate'), onClick: onNotAccurate, isSelected: accuracyStatus === 'not-accurate' }), _jsx(ReactionTag, { type: "like", ariaLabel: t('buttons.accurate'), onClick: onAccurate, isSelected: accuracyStatus === 'accurate' })] }), _jsx(Button, { w: "154px", onClick: onComplete, variant: "wizard", children: t('buttons.continue') })] }), _jsx(Text, { fontFamily: "secondary", fontSize: "sm", textAlign: "center", color: "gray.2", lineHeight: "shorter", whiteSpace: "pre-line", children: t('wizardValueSummary.info') })] }));
|
|
8
8
|
};
|
|
@@ -13,11 +13,12 @@ import { ConfirmProperty, ControlledWizard, DynamicForm, FooterButtons, HomeAssi
|
|
|
13
13
|
import { Box, Center, Stack } from '@chakra-ui/react';
|
|
14
14
|
import { action } from '@storybook/addon-actions';
|
|
15
15
|
import { assessedValueMock, homeWizardForm, propertiesMock, purchasePriceMock, } from '../../mocks';
|
|
16
|
+
import { formValues } from '../../helpers';
|
|
16
17
|
export default {
|
|
17
18
|
title: 'Components/Wizard/ControlledWizard',
|
|
18
19
|
component: ControlledWizard,
|
|
19
20
|
decorators: [
|
|
20
|
-
(story) => (_jsx(Box, { maxW: "
|
|
21
|
+
(story) => (_jsx(Box, { maxW: "600px", mx: "auto", children: story() })),
|
|
21
22
|
],
|
|
22
23
|
};
|
|
23
24
|
function fakeLookup() {
|
|
@@ -37,10 +38,10 @@ export const ControlledWizardComponent = () => {
|
|
|
37
38
|
label: 'Next',
|
|
38
39
|
} }) })] })),
|
|
39
40
|
}));
|
|
40
|
-
return (_jsx(ControlledWizard, { step: step, setStep: setStep, steps: [
|
|
41
|
+
return (_jsx(ControlledWizard, { height: "700px", step: step, setStep: setStep, steps: [
|
|
41
42
|
{
|
|
42
|
-
header: (_jsx(WizardTextHeader, { title: "
|
|
43
|
-
body: ({ setStep }) => (_jsx(NewHomeDetails, { handleCreateHomeClick: (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
43
|
+
header: (_jsx(WizardTextHeader, { title: "Welcome to Homefile John.", subtitle: "We\u2019re about to make owning your home dramatically easier. Answer a few quick questions and we\u2019ll handle everything that usually slips through the cracks." })),
|
|
44
|
+
body: ({ setStep }) => (_jsx(NewHomeDetails, { values: formValues, handleCreateHomeClick: (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
45
|
setStep(1);
|
|
45
46
|
yield fakeLookup();
|
|
46
47
|
setStep(2);
|
|
@@ -51,13 +52,13 @@ export const ControlledWizardComponent = () => {
|
|
|
51
52
|
body: () => _jsx(SearchRecords, { isWizard: true }),
|
|
52
53
|
},
|
|
53
54
|
{
|
|
54
|
-
header: (_jsx(WizardTextHeader, { title:
|
|
55
|
-
body: () => (_jsx(ConfirmProperty, { isWizard: true, properties:
|
|
55
|
+
header: (_jsx(WizardTextHeader, { title: `This is the data we found \n in public records.`, subtitle: "Details may not represent the most up-to-date info about your home." })),
|
|
56
|
+
body: () => (_jsx(ConfirmProperty, { isWizard: true, properties: propertiesMock, handleAddress: () => {
|
|
56
57
|
setStep(3);
|
|
57
58
|
} })),
|
|
58
59
|
},
|
|
59
60
|
{
|
|
60
|
-
header: (_jsx(WizardTextHeader, { title:
|
|
61
|
+
header: (_jsx(WizardTextHeader, { title: `This is the data we \n found in public records.`, subtitle: "The details linked to your address come from public data sources and may not represent the most up-to-date information about your home." })),
|
|
61
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) })),
|
|
62
63
|
},
|
|
63
64
|
{
|
|
@@ -393,6 +393,28 @@ export declare const Button: {
|
|
|
393
393
|
backgroundColor: string;
|
|
394
394
|
};
|
|
395
395
|
};
|
|
396
|
+
wizard: {
|
|
397
|
+
fontSize: string;
|
|
398
|
+
h: string;
|
|
399
|
+
fontWeight: string;
|
|
400
|
+
borderRadius: string;
|
|
401
|
+
boxShadow: string;
|
|
402
|
+
color: string;
|
|
403
|
+
backgroundColor: string;
|
|
404
|
+
_disabled: {
|
|
405
|
+
filter: string;
|
|
406
|
+
pointerEvents: string;
|
|
407
|
+
};
|
|
408
|
+
_active: {
|
|
409
|
+
backgroundColor: string;
|
|
410
|
+
borderRadius: string;
|
|
411
|
+
fontWeight: string;
|
|
412
|
+
boxShadow: string;
|
|
413
|
+
};
|
|
414
|
+
_hover: {
|
|
415
|
+
boxShadow: string;
|
|
416
|
+
};
|
|
417
|
+
};
|
|
396
418
|
};
|
|
397
419
|
defaultProps: {
|
|
398
420
|
size: string;
|
|
@@ -393,6 +393,28 @@ export const Button = {
|
|
|
393
393
|
backgroundColor: 'lightGreen.3',
|
|
394
394
|
},
|
|
395
395
|
},
|
|
396
|
+
wizard: {
|
|
397
|
+
fontSize: 'lg',
|
|
398
|
+
h: 'button.xs',
|
|
399
|
+
fontWeight: 'medium',
|
|
400
|
+
borderRadius: 'none',
|
|
401
|
+
boxShadow: 'base',
|
|
402
|
+
color: 'neutral.white',
|
|
403
|
+
backgroundColor: 'blue.2',
|
|
404
|
+
_disabled: {
|
|
405
|
+
filter: 'grayscale(100%)',
|
|
406
|
+
pointerEvents: 'none',
|
|
407
|
+
},
|
|
408
|
+
_active: {
|
|
409
|
+
backgroundColor: 'blue.3',
|
|
410
|
+
borderRadius: 'lg',
|
|
411
|
+
fontWeight: 'medium',
|
|
412
|
+
boxShadow: 'none',
|
|
413
|
+
},
|
|
414
|
+
_hover: {
|
|
415
|
+
boxShadow: 'xl',
|
|
416
|
+
},
|
|
417
|
+
},
|
|
396
418
|
},
|
|
397
419
|
defaultProps: {
|
|
398
420
|
size: 'full',
|