@homefile/components-v2 2.39.21 → 2.39.23

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.
Files changed (25) hide show
  1. package/dist/components/myHomes/WrapperWithShadow.d.ts +1 -1
  2. package/dist/components/myHomes/WrapperWithShadow.js +2 -2
  3. package/dist/components/myHomes/steps/ConfirmHomeDetails.d.ts +2 -0
  4. package/dist/components/myHomes/steps/ConfirmHomeDetails.js +8 -0
  5. package/dist/components/myHomes/steps/ConfirmProperty.js +1 -1
  6. package/dist/components/myHomes/steps/NewHomeDetails.d.ts +1 -1
  7. package/dist/components/myHomes/steps/NewHomeDetails.js +4 -4
  8. package/dist/components/myHomes/steps/PropertyCards.js +2 -2
  9. package/dist/components/myHomes/steps/index.d.ts +1 -0
  10. package/dist/components/myHomes/steps/index.js +1 -0
  11. package/dist/components/wizard/ControlledWizard.d.ts +1 -1
  12. package/dist/components/wizard/ControlledWizard.js +46 -9
  13. package/dist/components/wizard/WizardTextHeader.d.ts +1 -1
  14. package/dist/components/wizard/WizardTextHeader.js +2 -2
  15. package/dist/components/wizard/WizardValueSummary.js +1 -1
  16. package/dist/hooks/myHomes/useAddHomeContent.d.ts +1 -1
  17. package/dist/hooks/myHomes/useAddHomeContent.js +1 -1
  18. package/dist/interfaces/myHomes/AddHomeContent.interface.d.ts +1 -1
  19. package/dist/interfaces/myHomes/WrapperWithShadow.interface.d.ts +2 -0
  20. package/dist/interfaces/wizard/ControlledWizard.interface.d.ts +12 -10
  21. package/dist/interfaces/wizard/WizardTextHeader.interface.d.ts +1 -0
  22. package/dist/stories/wizard/ControlledWizard.stories.js +11 -8
  23. package/dist/theme/components/ButtonStyles.d.ts +22 -0
  24. package/dist/theme/components/ButtonStyles.js +22 -0
  25. 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: "base", pb: "3rem", children: _jsx(Fade, { delay: fadeDelay, in: true, children: children }) })));
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
  };
@@ -0,0 +1,2 @@
1
+ import { AddHomeContentI } from '../../../interfaces';
2
+ export declare const ConfirmHomeDetails: ({ isLoading, handleCreateHomeClick, }: Pick<AddHomeContentI, "isLoading" | "handleCreateHomeClick">) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { t } from 'i18next';
3
+ import { Button } from '@chakra-ui/react';
4
+ import { useAddHouseContent } from '../../../hooks';
5
+ export const ConfirmHomeDetails = ({ isLoading, handleCreateHomeClick, }) => {
6
+ const { handleSubmit } = useAddHouseContent(undefined, handleCreateHomeClick);
7
+ return (_jsx(Button, { onClick: handleSubmit, variant: "wizard", disabled: isLoading, children: t('buttons.confirm') }));
8
+ };
@@ -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", borderRadius: "sm", w: "100%", py: "4", 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') })] }));
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,2 +1,2 @@
1
1
  import { AddHomeContentI } from '../../../interfaces';
2
- export declare const NewHomeDetails: ({ handleCreateHomeClick, values, isLoading, }: AddHomeContentI) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const NewHomeDetails: ({ values, isLoading }: AddHomeContentI) => import("react/jsx-runtime").JSX.Element;
@@ -1,16 +1,16 @@
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 { Container, Stack, Center, Flex, Button, Divider, } from '@chakra-ui/react';
4
+ import { Stack, Center, 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';
8
8
  import { BeatLoader } from 'react-spinners';
9
9
  import { up } from './MyHomeDetails';
10
- export const NewHomeDetails = ({ handleCreateHomeClick, values, isLoading, }) => {
11
- const { handleErrorMessage, handleNameChange, handleNameValidation, handleSelectRecords, handleSubmit, } = useAddHouseContent(values, handleCreateHomeClick);
10
+ export const NewHomeDetails = ({ values, isLoading }) => {
11
+ const { handleErrorMessage, handleNameChange, handleNameValidation, handleSelectRecords, } = useAddHouseContent(values);
12
12
  const { name, isNameValid, searchRecords } = useSnapshot(firstHomeProxy, {
13
13
  sync: true,
14
14
  });
15
- return (_jsxs(Container, { variant: "ghost", px: "6", children: [isLoading && (_jsx(Center, { h: "4rem", children: _jsx(BeatLoader, { color: "gray", size: 8 }) })), !isLoading && (_jsxs(Stack, { spacing: "base", p: "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, children: _jsx(Flex, { direction: "column", justify: "space-between", gap: "10", h: "100%", children: _jsxs(Stack, { spacing: "base", children: [_jsx(IncludePublicRecords, { isChecked: searchRecords, onSelectRecords: handleSelectRecords }), _jsx(Button, { onClick: handleSubmit, disabled: isLoading, children: t('buttons.confirm') })] }) }) })] }));
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(IncludePublicRecords, { isChecked: searchRecords, onSelectRecords: handleSelectRecords }) })] }));
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: "base", p: "6", w: "100%", children: properties === null || properties === void 0 ? void 0 : properties.map(({ id, address: { address } }) => {
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, { fontSize: "sm", children: address }) }), id));
17
+ return (_jsx(RadioCard, Object.assign({}, radio, { children: _jsx(Text, { children: address }) }), id));
18
18
  }) })));
19
19
  };
@@ -1,3 +1,4 @@
1
+ export * from './ConfirmHomeDetails';
1
2
  export * from './ConfirmProperty';
2
3
  export * from './MyHomeDetails';
3
4
  export * from './MyHomesStepBody';
@@ -1,3 +1,4 @@
1
+ export * from './ConfirmHomeDetails';
1
2
  export * from './ConfirmProperty';
2
3
  export * from './MyHomeDetails';
3
4
  export * from './MyHomesStepBody';
@@ -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, footerBlink, }: ControlledWizardI): import("react/jsx-runtime").JSX.Element;
@@ -1,20 +1,57 @@
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, footerBlink, }) {
6
6
  const current = steps[step];
7
7
  const headerVariants = {
8
- initial: { opacity: 0, y: 8 },
8
+ initial: { opacity: 0, y: 8, filter: 'blur(6px)' },
9
9
  animate: headerBlink
10
- ? { opacity: [1, 0.55, 1], y: 0, transition: { duration: 0.28 } }
11
- : { opacity: 1, y: 0, transition: { duration: 0.28 } },
12
- exit: { opacity: 0, y: -8, transition: { duration: 0.18 } },
10
+ ? {
11
+ opacity: [1, 0.55, 1],
12
+ y: 0,
13
+ filter: 'blur(0px)',
14
+ transition: { duration: 0.28 },
15
+ }
16
+ : {
17
+ opacity: 1,
18
+ y: 0,
19
+ filter: 'blur(0px)',
20
+ transition: { duration: 0.24 },
21
+ },
22
+ exit: {
23
+ opacity: 0,
24
+ y: -8,
25
+ filter: 'blur(6px)',
26
+ transition: { duration: 0.18 },
27
+ },
13
28
  };
14
29
  const bodyVariants = {
15
30
  initial: { opacity: 0, y: 12, scale: 0.98 },
16
- animate: { opacity: 1, y: 0, scale: 1 },
17
- exit: { opacity: 0, y: -8, scale: 0.98 },
31
+ animate: { opacity: 1, y: 0, scale: 1, transition: { duration: 0.22 } },
32
+ exit: { opacity: 0, y: -8, scale: 0.98, transition: { duration: 0.18 } },
18
33
  };
19
- return (_jsxs(Stack, { spacing: "0", shadow: "md", h: height, bg: "white", overflowY: "hidden", 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(Box, { w: "full", flex: "1", p: { base: 4, md: 6 }, overflowY: "auto", minH: "0", children: current.body({ setStep }) }) }, `b-${step}`) })] }));
34
+ const footerVariants = {
35
+ initial: { opacity: 0, y: 12, filter: 'blur(6px)' },
36
+ animate: footerBlink
37
+ ? {
38
+ opacity: [1, 0.6, 1],
39
+ y: 0,
40
+ filter: 'blur(0px)',
41
+ transition: { duration: 0.28 },
42
+ }
43
+ : {
44
+ opacity: 1,
45
+ y: 0,
46
+ filter: 'blur(0px)',
47
+ transition: { duration: 0.24 },
48
+ },
49
+ exit: {
50
+ opacity: 0,
51
+ y: 12,
52
+ filter: 'blur(6px)',
53
+ transition: { duration: 0.18 },
54
+ },
55
+ };
56
+ return (_jsxs(Stack, { shadow: "md", h: height, bg: "white", overflow: "hidden", spacing: "0", children: [_jsx(AnimatePresence, { mode: "wait", children: _jsx(Box, { as: MotionBox, variants: headerVariants, initial: "initial", animate: "animate", exit: "exit", w: "full", flexShrink: 0, 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: "auto", overflowY: "auto", minH: "0", align: "center", py: { base: '4', md: '8' }, children: _jsx(Box, { w: bodyWidth, children: current.body({ setStep }) }) }) }, `b-${step}`) }), current.footer && (_jsx(AnimatePresence, { mode: "wait", children: _jsx(Box, { as: MotionBox, variants: footerVariants, initial: "initial", animate: "animate", exit: "exit", w: "full", flexShrink: 0, bg: "white", borderTopWidth: "1px", borderColor: "lightBlue.3", children: _jsx(Flex, { justify: "center", py: { base: '4', md: '5' }, children: _jsx(Box, { w: bodyWidth, children: current.footer }) }) }, `f-${step}`) }))] }));
20
57
  }
@@ -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: "80%", children: [_jsx(Text, { fontSize: { base: '2xl', md: '3xl' }, lineHeight: { base: 'shorter', md: 'base' }, textAlign: "center", children: title }), subtitle && (_jsx(Text, { fontFamily: "secondary", textAlign: "center", children: subtitle })), _jsx(Show, { below: "md", children: _jsx(Box, { h: "6" }) })] })] }) }));
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, { 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: "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, children: t('buttons.complete') })] }), _jsx(Text, { fontFamily: "secondary", fontSize: "sm", textAlign: "center", color: "gray.2", lineHeight: "shorter", whiteSpace: "pre-line", children: t('wizardValueSummary.info') })] }));
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
  };
@@ -1,6 +1,6 @@
1
1
  import { ChangeEvent } from 'react';
2
2
  import { HandleInputType, HomeFormI } from '../../interfaces';
3
- export declare const useAddHouseContent: (values: HomeFormI | undefined, callback: (form: HomeFormI) => void) => {
3
+ export declare const useAddHouseContent: (values?: HomeFormI | undefined, callback?: (form: HomeFormI) => void) => {
4
4
  handleErrorMessage: () => string;
5
5
  handleLinkChange: HandleInputType;
6
6
  handleNameChange: HandleInputType;
@@ -53,7 +53,7 @@ export const useAddHouseContent = (values, callback) => {
53
53
  handleValidation('number');
54
54
  handleValidation('zip');
55
55
  if (!hasError && firstHome.isNameValid) {
56
- callback(Object.assign(Object.assign({}, fields), { externalLink: firstHome.externalLink, name: firstHome.name, isOwner: firstHome.isOwner, searchRecords: firstHome.searchRecords }));
56
+ callback === null || callback === void 0 ? void 0 : callback(Object.assign(Object.assign({}, fields), { externalLink: firstHome.externalLink, name: firstHome.name, isOwner: firstHome.isOwner, searchRecords: firstHome.searchRecords }));
57
57
  cleanStores();
58
58
  resetValidations();
59
59
  }
@@ -13,7 +13,7 @@ export interface HomeAddressDataI {
13
13
  }
14
14
  export interface AddHomeContentI {
15
15
  handleAddress?: (id: string) => void;
16
- handleCreateHomeClick: (form: HomeFormI) => void;
16
+ handleCreateHomeClick?: (form: HomeFormI) => void;
17
17
  handleSkipClick?: () => void;
18
18
  isFirstHome?: boolean;
19
19
  isLoading?: boolean;
@@ -2,4 +2,6 @@ export interface WrapperWithShadowI {
2
2
  animation?: string;
3
3
  fadeDelay?: number;
4
4
  isWizard?: boolean;
5
+ padding?: string;
6
+ pb?: string;
5
7
  }
@@ -1,14 +1,16 @@
1
- import { ReactNode } from 'react';
2
- export type WizardStep = {
3
- header: ReactNode;
4
- body: (api: {
5
- setStep: (i: number) => void;
6
- }) => ReactNode;
7
- };
1
+ export interface ControlledWizardStepI {
2
+ header: React.ReactNode;
3
+ body: (args: {
4
+ setStep: (n: number) => void;
5
+ }) => React.ReactNode;
6
+ footer?: React.ReactNode;
7
+ }
8
8
  export interface ControlledWizardI {
9
+ bodyWidth?: string;
9
10
  step: number;
10
- setStep: (i: number) => void;
11
- steps: WizardStep[];
12
- height?: string | number;
11
+ setStep: (n: number) => void;
12
+ steps: ControlledWizardStepI[];
13
+ height?: string;
13
14
  headerBlink?: boolean;
15
+ footerBlink?: boolean;
14
16
  }
@@ -2,4 +2,5 @@ export interface WizardTextHeaderI {
2
2
  title: string;
3
3
  subtitle?: string;
4
4
  style?: 'wizard' | 'panel';
5
+ width?: string;
5
6
  }
@@ -9,15 +9,16 @@ 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, SearchRecords, WizardTextHeader, WizardSuccessHeader, WizardValueSummary, NewHomeDetails, } from '../../components';
12
+ import { ConfirmProperty, ControlledWizard, DynamicForm, FooterButtons, HomeAssistantTutorial, HomeAssistantWizardSteps, SearchRecords, WizardTextHeader, WizardSuccessHeader, WizardValueSummary, NewHomeDetails, ConfirmHomeDetails, } from '../../components';
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: "800px", mx: "auto", children: story() })),
21
+ (story) => (_jsx(Box, { maxW: "600px", mx: "auto", children: story() })),
21
22
  ],
22
23
  };
23
24
  function fakeLookup() {
@@ -37,13 +38,15 @@ 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: "Hi John, let\u2019s get your Homefile set up.", subtitle: "Complete this quick setup and we\u2019ll handle the rest." })),
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 }),
45
+ footer: (_jsx(ConfirmHomeDetails, { handleCreateHomeClick: (values) => __awaiter(void 0, void 0, void 0, function* () {
44
46
  setStep(1);
45
47
  yield fakeLookup();
46
48
  setStep(2);
49
+ action('Create Home Click')(values);
47
50
  }) })),
48
51
  },
49
52
  {
@@ -51,13 +54,13 @@ export const ControlledWizardComponent = () => {
51
54
  body: () => _jsx(SearchRecords, { isWizard: true }),
52
55
  },
53
56
  {
54
- header: (_jsx(WizardTextHeader, { title: "This is the data we found in public records.", subtitle: "Details may not represent the most up-to-date info about your home." })),
55
- body: () => (_jsx(ConfirmProperty, { isWizard: true, properties: [propertiesMock[0]], handleAddress: () => {
57
+ 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." })),
58
+ body: () => (_jsx(ConfirmProperty, { isWizard: true, properties: propertiesMock, handleAddress: () => {
56
59
  setStep(3);
57
60
  } })),
58
61
  },
59
62
  {
60
- 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." })),
63
+ 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
64
  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
65
  },
63
66
  {
@@ -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',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.39.21",
3
+ "version": "2.39.23",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",