@homefile/components-v2 2.29.7 → 2.30.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.
Files changed (53) hide show
  1. package/dist/components/index.d.ts +1 -0
  2. package/dist/components/index.js +1 -0
  3. package/dist/components/myHomes/WrapperWithShadow.d.ts +1 -1
  4. package/dist/components/myHomes/WrapperWithShadow.js +11 -2
  5. package/dist/components/myHomes/steps/ConfirmProperty.d.ts +1 -1
  6. package/dist/components/myHomes/steps/ConfirmProperty.js +4 -1
  7. package/dist/components/myHomes/steps/MyHomeDetails.d.ts +1 -1
  8. package/dist/components/myHomes/steps/MyHomeDetails.js +2 -2
  9. package/dist/components/myHomes/steps/MyHomesStepBody.d.ts +1 -1
  10. package/dist/components/myHomes/steps/MyHomesStepBody.js +4 -1
  11. package/dist/components/myHomes/steps/MyHomesStepWrapper.d.ts +1 -1
  12. package/dist/components/myHomes/steps/MyHomesStepWrapper.js +2 -2
  13. package/dist/components/myHomes/steps/SearchRecords.d.ts +1 -1
  14. package/dist/components/myHomes/steps/SearchRecords.js +2 -2
  15. package/dist/components/wizard/ControlledWizard.d.ts +2 -0
  16. package/dist/components/wizard/ControlledWizard.js +20 -0
  17. package/dist/components/wizard/WizardTextHeader.d.ts +2 -0
  18. package/dist/components/wizard/WizardTextHeader.js +6 -0
  19. package/dist/components/wizard/index.d.ts +2 -0
  20. package/dist/components/wizard/index.js +2 -0
  21. package/dist/index.d.ts +2 -2
  22. package/dist/index.js +2 -2
  23. package/dist/interfaces/index.d.ts +1 -0
  24. package/dist/interfaces/index.js +1 -0
  25. package/dist/interfaces/myHomes/AddHomeContent.interface.d.ts +1 -0
  26. package/dist/interfaces/myHomes/WrapperWithShadow.interface.d.ts +1 -0
  27. package/dist/interfaces/wizard/ControlledWizard.interface.d.ts +14 -0
  28. package/dist/interfaces/wizard/ControlledWizard.interface.js +1 -0
  29. package/dist/interfaces/wizard/WizardTextHeader.interface.d.ts +4 -0
  30. package/dist/interfaces/wizard/WizardTextHeader.interface.js +1 -0
  31. package/dist/interfaces/wizard/index.d.ts +2 -0
  32. package/dist/interfaces/wizard/index.js +2 -0
  33. package/dist/stories/wizard/ControlledWizard.stories.d.ts +5 -0
  34. package/dist/stories/wizard/ControlledWizard.stories.js +48 -0
  35. package/package.json +1 -1
  36. package/src/components/index.ts +1 -0
  37. package/src/components/myHomes/WrapperWithShadow.tsx +12 -6
  38. package/src/components/myHomes/steps/ConfirmProperty.tsx +27 -1
  39. package/src/components/myHomes/steps/MyHomeDetails.tsx +9 -4
  40. package/src/components/myHomes/steps/MyHomesStepBody.tsx +8 -0
  41. package/src/components/myHomes/steps/MyHomesStepWrapper.tsx +3 -2
  42. package/src/components/myHomes/steps/SearchRecords.tsx +5 -3
  43. package/src/components/wizard/ControlledWizard.tsx +64 -0
  44. package/src/components/wizard/WizardTextHeader.tsx +32 -0
  45. package/src/components/wizard/index.ts +2 -0
  46. package/src/index.ts +3 -0
  47. package/src/interfaces/index.ts +1 -0
  48. package/src/interfaces/myHomes/AddHomeContent.interface.ts +1 -0
  49. package/src/interfaces/myHomes/WrapperWithShadow.interface.ts +1 -0
  50. package/src/interfaces/wizard/ControlledWizard.interface.ts +14 -0
  51. package/src/interfaces/wizard/WizardTextHeader.interface.ts +4 -0
  52. package/src/interfaces/wizard/index.ts +2 -0
  53. package/src/stories/wizard/ControlledWizard.stories.tsx +85 -0
@@ -44,3 +44,4 @@ export * from './tour';
44
44
  export * from './householdItems';
45
45
  export * from './valueMonitor';
46
46
  export * from './videoPlayer';
47
+ export * from './wizard';
@@ -44,3 +44,4 @@ export * from './tour';
44
44
  export * from './householdItems';
45
45
  export * from './valueMonitor';
46
46
  export * from './videoPlayer';
47
+ export * from './wizard';
@@ -1,3 +1,3 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  import { WrapperWithShadowI } from '../../interfaces';
3
- export declare const WrapperWithShadow: ({ animation, children, fadeDelay, }: PropsWithChildren<WrapperWithShadowI>) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const WrapperWithShadow: ({ animation, children, fadeDelay, isWizard, }: PropsWithChildren<WrapperWithShadowI>) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,14 @@
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, }) => {
4
- return (_jsx(Stack, { w: "full", spacing: "base", p: "base", borderTopRadius: "xl", bg: "neutral.white", animation: animation, h: "full", overflowY: "scroll", pb: "3rem", children: _jsx(Fade, { delay: fadeDelay, in: true, children: children }) }));
3
+ export const WrapperWithShadow = ({ animation, children, fadeDelay = 0.3, isWizard = false, }) => {
4
+ const styles = isWizard
5
+ ? {}
6
+ : {
7
+ borderTopRadius: 'xl',
8
+ bg: 'neutral.white',
9
+ animation,
10
+ h: 'full',
11
+ overflowY: 'scroll',
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 }) })));
5
14
  };
@@ -1,2 +1,2 @@
1
1
  import { AddHomeContentI } from '../../../interfaces';
2
- export declare const ConfirmProperty: ({ handleAddress, isFirstHome, isLoading, properties, }: Pick<AddHomeContentI, "isFirstHome" | "properties" | "handleAddress" | "isLoading">) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const ConfirmProperty: ({ handleAddress, isFirstHome, isLoading, properties, isWizard, }: Pick<AddHomeContentI, "isFirstHome" | "properties" | "handleAddress" | "isLoading" | "isWizard">) => import("react/jsx-runtime").JSX.Element;
@@ -3,7 +3,7 @@ import { t } from 'i18next';
3
3
  import { useState } from 'react';
4
4
  import { Box, Button, Stack, Text } from '@chakra-ui/react';
5
5
  import { MyHomesStepBody, MyHomesStepWrapper, PropertyCards, } from '../..';
6
- export const ConfirmProperty = ({ handleAddress = () => { }, isFirstHome, isLoading, properties = [], }) => {
6
+ export const ConfirmProperty = ({ handleAddress = () => { }, isFirstHome, isLoading, properties = [], isWizard = false, }) => {
7
7
  var _a, _b;
8
8
  const [currentProperty, setCurrentProperty] = useState((_b = (_a = properties === null || properties === void 0 ? void 0 : properties[0]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : 'none');
9
9
  const footerText = (properties === null || properties === void 0 ? void 0 : properties.length) > 0
@@ -18,5 +18,8 @@ export const ConfirmProperty = ({ handleAddress = () => { }, isFirstHome, isLoad
18
18
  },
19
19
  },
20
20
  ];
21
+ if (isWizard) {
22
+ 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: () => handleAddress === null || handleAddress === void 0 ? void 0 : handleAddress(currentProperty), disabled: isLoading, children: t('buttons.continue') })] }));
23
+ }
21
24
  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: () => handleAddress === null || handleAddress === void 0 ? void 0 : handleAddress(currentProperty), disabled: isLoading, children: t('buttons.continue') })] }) }));
22
25
  };
@@ -1,3 +1,3 @@
1
1
  import { AddHomeContentI } from '../../../interfaces';
2
2
  export declare const up: string;
3
- export declare const MyHomeDetails: ({ handleCreateHomeClick, handleSkipClick, isFirstHome, showExternalLink, userFirstName, values, isLoading, }: AddHomeContentI) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const MyHomeDetails: ({ handleCreateHomeClick, handleSkipClick, isFirstHome, showExternalLink, userFirstName, values, isLoading, isWizard, }: AddHomeContentI) => import("react/jsx-runtime").JSX.Element;
@@ -13,12 +13,12 @@ const upAnimation = keyframes `
13
13
  to { transform: translateY(0); box-shadow: 0 -5px 10px rgba(0, 0, 0, 0.07)}
14
14
  `;
15
15
  export const up = `${upAnimation} 200ms ease forwards`;
16
- export const MyHomeDetails = ({ handleCreateHomeClick, handleSkipClick, isFirstHome = false, showExternalLink, userFirstName = '', values, isLoading, }) => {
16
+ export const MyHomeDetails = ({ handleCreateHomeClick, handleSkipClick, isFirstHome = false, showExternalLink, userFirstName = '', values, isLoading, isWizard = false, }) => {
17
17
  const { handleErrorMessage, handleLinkChange, handleNameChange, handleNameValidation, handleSelectRecords, handleSubmit, isOwner, group, ownRadio, rentRadio, } = useAddHouseContent(values, handleCreateHomeClick);
18
18
  const { externalLink, name, isNameValid, searchRecords } = useSnapshot(firstHomeProxy, { sync: true });
19
19
  const bgColors = {
20
20
  body: isFirstHome ? 'neutral.white' : 'lightBlue.1',
21
21
  input: isFirstHome ? 'lightGreen.1' : 'lightBlue.2',
22
22
  };
23
- return (_jsxs(_Fragment, { children: [isFirstHome && _jsx(FirstHomeHeader, { firstName: userFirstName }), _jsxs(Container, { variant: "ghost", children: [isLoading && (_jsx(Center, { h: "4rem", children: _jsx(BeatLoader, { color: "gray", size: 8 }) })), !isLoading && (_jsx(Box, { bg: bgColors.body, children: _jsxs(Stack, { spacing: "input.sm", p: "base", children: [_jsx(SectionHeader, { title: t('myHomes.section1'), titleIcon: HomeAddress, leftElement: _jsx(Text, { fontSize: "xs", textTransform: "uppercase", children: t('forms.required2') }) }), _jsx(AddressStored, {})] }) })), _jsxs(Stack, { spacing: "base", bg: "lightBlue.1", children: [_jsxs(Flex, Object.assign({}, group, { p: "base", gap: "4", borderY: "2px dashed", borderColor: "lightBlue.2", marginX: "base", children: [_jsx(RadioButton, Object.assign({}, ownRadio, { children: t('myHomes.own') })), _jsx(RadioButton, Object.assign({}, rentRadio, { children: t('myHomes.rent') }))] })), _jsxs(Stack, { spacing: "base", bg: bgColors.input, p: "base", children: [_jsx(SectionHeader, { title: t('myHomes.section2'), titleIcon: RelationshipHome }), _jsx(TextInput, { errorMessage: handleErrorMessage(), hasError: !isNameValid, id: "projectName", placeholder: t('myHomes.form.projectName'), handleChange: handleNameChange, onBlurCapture: handleNameValidation, value: name }), showExternalLink && (_jsx(TextInput, { errorMessage: handleErrorMessage(), id: "externalLink", placeholder: t('myHomes.form.externalLink'), handleChange: handleLinkChange, value: externalLink }))] })] }), _jsx(WrapperWithShadow, { animation: up, fadeDelay: 0.2, children: _jsxs(Flex, { direction: "column", justify: "space-between", gap: "10", h: "100%", children: [_jsxs(Stack, { spacing: "base", children: [isOwner && (_jsxs(_Fragment, { children: [_jsx(SectionHeader, { title: t('myHomes.section3'), titleIcon: MagnifyingGlassReport }), _jsx(IncludePublicRecords, { isChecked: searchRecords, onSelectRecords: handleSelectRecords })] })), _jsx(Button, { onClick: handleSubmit, disabled: isLoading, children: t('buttons.confirm') })] }), isFirstHome && (_jsx(Button, { variant: "text", onClick: handleSkipClick, alignSelf: "center", children: t('buttons.skip') }))] }) })] })] }));
23
+ return (_jsxs(_Fragment, { children: [isFirstHome && _jsx(FirstHomeHeader, { firstName: userFirstName }), _jsxs(Container, { variant: "ghost", children: [isLoading && (_jsx(Center, { h: "4rem", children: _jsx(BeatLoader, { color: "gray", size: 8 }) })), !isLoading && (_jsx(Box, { bg: isWizard ? 'transparent' : bgColors.body, children: _jsxs(Stack, { spacing: "input.sm", p: "base", children: [_jsx(SectionHeader, { title: t('myHomes.section1'), titleIcon: HomeAddress, leftElement: _jsx(Text, { fontSize: "xs", textTransform: "uppercase", children: t('forms.required2') }) }), _jsx(AddressStored, {})] }) })), _jsxs(Stack, { spacing: "base", bg: isWizard ? 'transparent' : 'lightBlue.1', children: [_jsxs(Flex, Object.assign({}, group, { p: "base", gap: "4", borderY: "2px dashed", borderColor: "lightBlue.2", marginX: "base", children: [_jsx(RadioButton, Object.assign({}, ownRadio, { children: t('myHomes.own') })), _jsx(RadioButton, Object.assign({}, rentRadio, { children: t('myHomes.rent') }))] })), _jsxs(Stack, { spacing: "base", bg: isWizard ? 'transparent' : bgColors.input, p: "base", children: [_jsx(SectionHeader, { title: t('myHomes.section2'), titleIcon: RelationshipHome }), _jsx(TextInput, { errorMessage: handleErrorMessage(), hasError: !isNameValid, id: "projectName", placeholder: t('myHomes.form.projectName'), handleChange: handleNameChange, onBlurCapture: handleNameValidation, value: name }), showExternalLink && (_jsx(TextInput, { errorMessage: handleErrorMessage(), id: "externalLink", placeholder: t('myHomes.form.externalLink'), handleChange: handleLinkChange, value: externalLink }))] })] }), _jsx(WrapperWithShadow, { animation: up, fadeDelay: 0.2, isWizard: isWizard, children: _jsxs(Flex, { direction: "column", justify: "space-between", gap: "10", h: "100%", children: [_jsxs(Stack, { spacing: "base", children: [isOwner && (_jsxs(_Fragment, { children: [_jsx(SectionHeader, { title: t('myHomes.section3'), titleIcon: MagnifyingGlassReport }), _jsx(IncludePublicRecords, { isChecked: searchRecords, onSelectRecords: handleSelectRecords })] })), _jsx(Button, { onClick: handleSubmit, disabled: isLoading, children: t('buttons.confirm') })] }), isFirstHome && (_jsx(Button, { variant: "text", onClick: handleSkipClick, alignSelf: "center", children: t('buttons.skip') }))] }) })] })] }));
24
24
  };
@@ -1,3 +1,3 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  import { MyHomesStepBodyI } from '../../../interfaces';
3
- export declare const MyHomesStepBody: ({ animation, children, fadeDelay, subtitle, title, }: PropsWithChildren<MyHomesStepBodyI>) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const MyHomesStepBody: ({ animation, children, fadeDelay, subtitle, title, isWizard, }: PropsWithChildren<MyHomesStepBodyI>) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Stack, Text } from '@chakra-ui/react';
3
3
  import { WrapperWithShadow } from '../..';
4
- export const MyHomesStepBody = ({ animation, children, fadeDelay, subtitle, title, }) => {
4
+ export const MyHomesStepBody = ({ animation, children, fadeDelay, subtitle, title, isWizard, }) => {
5
+ if (isWizard) {
6
+ return (_jsx(WrapperWithShadow, { animation: animation, fadeDelay: fadeDelay, isWizard: true, children: children }));
7
+ }
5
8
  return (_jsx(WrapperWithShadow, { animation: animation, fadeDelay: fadeDelay, children: _jsxs(Stack, { align: "center", spacing: "4", py: "8", children: [_jsx(Text, { fontSize: "xl", textAlign: "center", w: "80%", lineHeight: "1.3", children: title }), _jsx(Text, { fontFamily: "secondary", w: "85%", textAlign: "center", children: subtitle }), children] }) }));
6
9
  };
@@ -1,3 +1,3 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  import { AddHomeContentI } from '../../../interfaces';
3
- export declare const MyHomesStepWrapper: ({ children, isFirstHome, }: PropsWithChildren<Pick<AddHomeContentI, "isFirstHome">>) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const MyHomesStepWrapper: ({ children, isFirstHome, isWizard, }: PropsWithChildren<Pick<AddHomeContentI, "isFirstHome" | "isWizard">>) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box } from '@chakra-ui/react';
3
3
  import { MyHomesStepHeader } from '../..';
4
- export const MyHomesStepWrapper = ({ children, isFirstHome, }) => {
4
+ export const MyHomesStepWrapper = ({ children, isFirstHome, isWizard, }) => {
5
5
  const bg = isFirstHome ? 'lightGreen.1' : 'lightBlue.1';
6
- return (_jsxs(Box, { bg: bg, h: "100%", children: [_jsx(MyHomesStepHeader, { isFirstHome: isFirstHome }), children] }));
6
+ return (_jsxs(Box, { bg: isWizard ? 'transparent' : bg, h: "100%", children: [_jsx(MyHomesStepHeader, { isFirstHome: isFirstHome }), children] }));
7
7
  };
@@ -1,2 +1,2 @@
1
1
  import { AddHomeContentI } from '../../../interfaces';
2
- export declare const SearchRecords: ({ isFirstHome, }: Pick<AddHomeContentI, "isFirstHome">) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const SearchRecords: ({ isFirstHome, isWizard, }: Pick<AddHomeContentI, "isFirstHome" | "isWizard">) => import("react/jsx-runtime").JSX.Element;
@@ -17,7 +17,7 @@ const fadeAnimation = keyframes `
17
17
  to { opacity: 1 }
18
18
  `;
19
19
  const fade = `${fadeAnimation} 50ms ease-in-out backwards`;
20
- export const SearchRecords = ({ isFirstHome, }) => {
20
+ export const SearchRecords = ({ isFirstHome, isWizard = false, }) => {
21
21
  const { fields: { street, city, state }, } = useSnapshot(addressProxy, { sync: true });
22
22
  const [progressValue, setProgressValue] = useState(0);
23
23
  const address = `${street}, ${city} ${state}`;
@@ -28,5 +28,5 @@ export const SearchRecords = ({ isFirstHome, }) => {
28
28
  }, 500);
29
29
  return () => clearInterval(interval);
30
30
  }, []);
31
- return (_jsx(MyHomesStepWrapper, { isFirstHome: isFirstHome, children: _jsx(MyHomesStepBody, { animation: up, title: t('myHomes.search.title'), subtitle: `${t('myHomes.search.subtitle')} ${address}`, children: _jsxs(Stack, { align: "center", bg: "lightViolet.1", borderRadius: "sm", w: "100%", py: "6", children: [_jsxs(Box, { position: "relative", children: [_jsx(CircularProgress, { value: progressValue, isIndeterminate: progressValue === 100, color: "violet.1", thickness: "4px", size: size, zIndex: "1" }), _jsx(Center, { position: "absolute", top: "0", left: "0", h: size, w: size, children: _jsx(Center, { bg: "neutral.white", h: "70px", w: "70px", borderRadius: "50%", children: _jsx(Image, { src: MagnifyingGlassReport, alt: "records", h: "40px", w: "auto" }) }) })] }), _jsxs(Flex, { direction: "column", alignItems: "center", children: [_jsx(AnimatedText, { animation: fade, children: t('myHomes.search.msl') }), _jsx(AnimatedText, { animationDelay: "1.5s", animation: fade, children: t('myHomes.search.tax') }), _jsx(AnimatedText, { animationDelay: "2s", animation: fade, children: t('myHomes.search.google') }), _jsx(AnimatedText, { animationDelay: "2.5s", animation: fade, children: t('myHomes.search.leins') })] })] }) }) }));
31
+ return (_jsx(MyHomesStepWrapper, { isFirstHome: isFirstHome, isWizard: isWizard, children: _jsx(MyHomesStepBody, { isWizard: isWizard, animation: up, title: t('myHomes.search.title'), subtitle: `${t('myHomes.search.subtitle')} ${address}`, children: _jsxs(Stack, { align: "center", bg: isWizard ? 'transparent' : 'lightViolet.1', borderRadius: "sm", w: "100%", py: "6", children: [_jsxs(Box, { position: "relative", children: [_jsx(CircularProgress, { value: progressValue, isIndeterminate: progressValue === 100, color: "violet.1", thickness: "4px", size: size, zIndex: "1" }), _jsx(Center, { position: "absolute", top: "0", left: "0", h: size, w: size, children: _jsx(Center, { bg: "neutral.white", h: "70px", w: "70px", borderRadius: "50%", children: _jsx(Image, { src: MagnifyingGlassReport, alt: "records", h: "40px", w: "auto" }) }) })] }), _jsxs(Flex, { direction: "column", alignItems: "center", children: [_jsx(AnimatedText, { animation: fade, children: t('myHomes.search.msl') }), _jsx(AnimatedText, { animationDelay: "1.5s", animation: fade, children: t('myHomes.search.tax') }), _jsx(AnimatedText, { animationDelay: "2s", animation: fade, children: t('myHomes.search.google') }), _jsx(AnimatedText, { animationDelay: "2.5s", animation: fade, children: t('myHomes.search.leins') })] })] }) }) }));
32
32
  };
@@ -0,0 +1,2 @@
1
+ import { ControlledWizardI } from '../../interfaces';
2
+ export declare function ControlledWizard({ step, setStep, steps, minHeight, headerBlink, }: ControlledWizardI): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Stack } from '@chakra-ui/react';
3
+ import { AnimatePresence, motion } from 'framer-motion';
4
+ const MotionBox = motion(typeof Box);
5
+ export function ControlledWizard({ step, setStep, steps, minHeight = '770px', headerBlink, }) {
6
+ const current = steps[step];
7
+ const headerVariants = {
8
+ initial: { opacity: 0, y: 8 },
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 } },
13
+ };
14
+ const bodyVariants = {
15
+ 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 },
18
+ };
19
+ return (_jsxs(Stack, { spacing: "0", shadow: "md", minH: minHeight, bg: "white", 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", children: _jsx(Box, { w: "full", p: { base: 4, md: 6 }, children: current.body({ setStep }) }) }, `b-${step}`) })] }));
20
+ }
@@ -0,0 +1,2 @@
1
+ import { WizardTextHeaderI } from '../../interfaces';
2
+ export declare const WizardTextHeader: ({ title, subtitle }: WizardTextHeaderI) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Center, Show, Stack, Text, Box } from '@chakra-ui/react';
3
+ import { Logo } from '..';
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" }) })] })] }) }));
6
+ };
@@ -0,0 +1,2 @@
1
+ export * from './ControlledWizard';
2
+ export * from './WizardTextHeader';
@@ -0,0 +1,2 @@
1
+ export * from './ControlledWizard';
2
+ export * from './WizardTextHeader';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
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, 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, } 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, 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';
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';
5
- export { billingProxy, dynamicFormProxy, homeCardProxy, partnerContentProxy, partnerDetailsProxy, paymentMethodProxy, recordsInputsProxy, recordsInputsToDBProxy, userDetailsProxy, confirmAddressProxy, } from './proxies';
5
+ export { billingProxy, dynamicFormProxy, homeCardProxy, partnerContentProxy, partnerDetailsProxy, paymentMethodProxy, recordsInputsProxy, recordsInputsToDBProxy, userDetailsProxy, confirmAddressProxy, addressProxy, } from './proxies';
6
6
  import theme from './theme';
7
7
  export { theme };
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
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, 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, } 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, 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';
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';
5
- export { billingProxy, dynamicFormProxy, homeCardProxy, partnerContentProxy, partnerDetailsProxy, paymentMethodProxy, recordsInputsProxy, recordsInputsToDBProxy, userDetailsProxy, confirmAddressProxy, } from './proxies';
5
+ export { billingProxy, dynamicFormProxy, homeCardProxy, partnerContentProxy, partnerDetailsProxy, paymentMethodProxy, recordsInputsProxy, recordsInputsToDBProxy, userDetailsProxy, confirmAddressProxy, addressProxy, } from './proxies';
6
6
  import theme from './theme';
7
7
  export { theme };
@@ -42,3 +42,4 @@ export * from './householdItems';
42
42
  export * from './valueMonitor';
43
43
  export * from './DrawerHeader.interface';
44
44
  export * from './videoPlayer';
45
+ export * from './wizard';
@@ -42,3 +42,4 @@ export * from './householdItems';
42
42
  export * from './valueMonitor';
43
43
  export * from './DrawerHeader.interface';
44
44
  export * from './videoPlayer';
45
+ export * from './wizard';
@@ -22,4 +22,5 @@ export interface AddHomeContentI {
22
22
  step?: 'initial' | 'loading' | 'properties';
23
23
  userFirstName?: string;
24
24
  values?: HomeFormI;
25
+ isWizard?: boolean;
25
26
  }
@@ -1,4 +1,5 @@
1
1
  export interface WrapperWithShadowI {
2
2
  animation?: string;
3
3
  fadeDelay?: number;
4
+ isWizard?: boolean;
4
5
  }
@@ -0,0 +1,14 @@
1
+ import { ReactNode } from 'react';
2
+ export type WizardStep = {
3
+ header: ReactNode;
4
+ body: (api: {
5
+ setStep: (i: number) => void;
6
+ }) => ReactNode;
7
+ };
8
+ export interface ControlledWizardI {
9
+ step: number;
10
+ setStep: (i: number) => void;
11
+ steps: WizardStep[];
12
+ minHeight?: string | number;
13
+ headerBlink?: boolean;
14
+ }
@@ -0,0 +1,4 @@
1
+ export interface WizardTextHeaderI {
2
+ title: string;
3
+ subtitle?: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ export * from './ControlledWizard.interface';
2
+ export * from './WizardTextHeader.interface';
@@ -0,0 +1,2 @@
1
+ export * from './ControlledWizard.interface';
2
+ export * from './WizardTextHeader.interface';
@@ -0,0 +1,5 @@
1
+ import { Meta } from '@storybook/react';
2
+ import { ControlledWizardI } from '../../interfaces';
3
+ declare const _default: Meta<ControlledWizardI>;
4
+ export default _default;
5
+ export declare const ControlledWizardComponent: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,48 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ import { ConfirmProperty, ControlledWizard, MyHomeDetails, SearchRecords, WizardTextHeader, } from '../../components';
12
+ import { Box } from '@chakra-ui/react';
13
+ import { useState } from 'react';
14
+ import { formValues } from '../../helpers';
15
+ import { propertiesMock } from '../../mocks';
16
+ export default {
17
+ title: 'Components/Wizard/ControlledWizard',
18
+ component: ControlledWizard,
19
+ decorators: [
20
+ (story) => (_jsx(Box, { maxW: "800px", mx: "auto", children: story() })),
21
+ ],
22
+ };
23
+ function fakeLookup() {
24
+ return new Promise((r) => setTimeout(r, 1500));
25
+ }
26
+ export const ControlledWizardComponent = () => {
27
+ const [step, setStep] = useState(0);
28
+ return (_jsx(ControlledWizard, { step: step, setStep: setStep, steps: [
29
+ {
30
+ header: (_jsx(WizardTextHeader, { title: "Hi John, let\u2019s get your Homefile set up.", subtitle: "Complete this quick setup and we\u2019ll handle the rest." })),
31
+ body: ({ setStep }) => (_jsx(MyHomeDetails, { isWizard: true, userFirstName: "Adam", values: formValues, properties: propertiesMock, handleCreateHomeClick: (values) => __awaiter(void 0, void 0, void 0, function* () {
32
+ setStep(1);
33
+ yield fakeLookup();
34
+ setStep(2);
35
+ }) })),
36
+ },
37
+ {
38
+ header: (_jsx(WizardTextHeader, { title: "One moment while we search public records\u2026" })),
39
+ body: () => _jsx(SearchRecords, { isWizard: true }),
40
+ },
41
+ {
42
+ 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." })),
43
+ body: () => (_jsx(ConfirmProperty, { isWizard: true, properties: propertiesMock, handleAddress: () => {
44
+ setStep(0);
45
+ } })),
46
+ },
47
+ ] }));
48
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.29.7",
3
+ "version": "2.30.0",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",
@@ -44,3 +44,4 @@ export * from './tour'
44
44
  export * from './householdItems'
45
45
  export * from './valueMonitor'
46
46
  export * from './videoPlayer'
47
+ export * from './wizard'
@@ -1,22 +1,28 @@
1
1
  import { PropsWithChildren } from 'react'
2
- import { Stack, Fade } from '@chakra-ui/react'
2
+ import { Stack, Fade, ComponentWithAs, StackProps } from '@chakra-ui/react'
3
3
  import { WrapperWithShadowI } from '@/interfaces'
4
4
 
5
5
  export const WrapperWithShadow = ({
6
6
  animation,
7
7
  children,
8
8
  fadeDelay = 0.3,
9
+ isWizard = false,
9
10
  }: PropsWithChildren<WrapperWithShadowI>) => {
11
+ const styles = isWizard
12
+ ? {}
13
+ : {
14
+ borderTopRadius: 'xl',
15
+ bg: 'neutral.white',
16
+ animation,
17
+ h: 'full',
18
+ overflowY: 'scroll',
19
+ }
10
20
  return (
11
21
  <Stack
22
+ {...(styles as ComponentWithAs<'div', StackProps>)}
12
23
  w="full"
13
24
  spacing="base"
14
25
  p="base"
15
- borderTopRadius="xl"
16
- bg="neutral.white"
17
- animation={animation}
18
- h="full"
19
- overflowY="scroll"
20
26
  pb="3rem"
21
27
  >
22
28
  <Fade delay={fadeDelay} in>
@@ -13,9 +13,10 @@ export const ConfirmProperty = ({
13
13
  isFirstHome,
14
14
  isLoading,
15
15
  properties = [],
16
+ isWizard = false,
16
17
  }: Pick<
17
18
  AddHomeContentI,
18
- 'isFirstHome' | 'properties' | 'handleAddress' | 'isLoading'
19
+ 'isFirstHome' | 'properties' | 'handleAddress' | 'isLoading' | 'isWizard'
19
20
  >) => {
20
21
  const [currentProperty, setCurrentProperty] = useState(
21
22
  properties?.[0]?.id ?? 'none'
@@ -35,6 +36,31 @@ export const ConfirmProperty = ({
35
36
  },
36
37
  ]
37
38
 
39
+ if (isWizard) {
40
+ return (
41
+ <Stack>
42
+ <Stack align="center" borderRadius="sm" w="100%" py="4">
43
+ <PropertyCards
44
+ properties={propertiesWithNoneOfTheAbove}
45
+ currentProperty={currentProperty}
46
+ onChange={setCurrentProperty}
47
+ />
48
+ <Box px="6">
49
+ <Text variant="home" textAlign="center">
50
+ {footerText}
51
+ </Text>
52
+ </Box>
53
+ </Stack>
54
+ <Button
55
+ onClick={() => handleAddress?.(currentProperty)}
56
+ disabled={isLoading}
57
+ >
58
+ {t('buttons.continue')}
59
+ </Button>
60
+ </Stack>
61
+ )
62
+ }
63
+
38
64
  return (
39
65
  <MyHomesStepWrapper isFirstHome={isFirstHome}>
40
66
  <MyHomesStepBody
@@ -44,6 +44,7 @@ export const MyHomeDetails = ({
44
44
  userFirstName = '',
45
45
  values,
46
46
  isLoading,
47
+ isWizard = false,
47
48
  }: AddHomeContentI) => {
48
49
  const {
49
50
  handleErrorMessage,
@@ -76,7 +77,7 @@ export const MyHomeDetails = ({
76
77
  </Center>
77
78
  )}
78
79
  {!isLoading && (
79
- <Box bg={bgColors.body}>
80
+ <Box bg={isWizard ? 'transparent' : bgColors.body}>
80
81
  <Stack spacing="input.sm" p="base">
81
82
  <SectionHeader
82
83
  title={t('myHomes.section1')}
@@ -91,7 +92,7 @@ export const MyHomeDetails = ({
91
92
  </Stack>
92
93
  </Box>
93
94
  )}
94
- <Stack spacing="base" bg="lightBlue.1">
95
+ <Stack spacing="base" bg={isWizard ? 'transparent' : 'lightBlue.1'}>
95
96
  <Flex
96
97
  {...group}
97
98
  p="base"
@@ -103,7 +104,11 @@ export const MyHomeDetails = ({
103
104
  <RadioButton {...ownRadio}>{t('myHomes.own')}</RadioButton>
104
105
  <RadioButton {...rentRadio}>{t('myHomes.rent')}</RadioButton>
105
106
  </Flex>
106
- <Stack spacing="base" bg={bgColors.input} p="base">
107
+ <Stack
108
+ spacing="base"
109
+ bg={isWizard ? 'transparent' : bgColors.input}
110
+ p="base"
111
+ >
107
112
  <SectionHeader
108
113
  title={t('myHomes.section2')}
109
114
  titleIcon={RelationshipHome}
@@ -129,7 +134,7 @@ export const MyHomeDetails = ({
129
134
  </Stack>
130
135
  </Stack>
131
136
 
132
- <WrapperWithShadow animation={up} fadeDelay={0.2}>
137
+ <WrapperWithShadow animation={up} fadeDelay={0.2} isWizard={isWizard}>
133
138
  <Flex direction="column" justify="space-between" gap="10" h="100%">
134
139
  <Stack spacing="base">
135
140
  {isOwner && (
@@ -9,7 +9,15 @@ export const MyHomesStepBody = ({
9
9
  fadeDelay,
10
10
  subtitle,
11
11
  title,
12
+ isWizard,
12
13
  }: PropsWithChildren<MyHomesStepBodyI>) => {
14
+ if (isWizard) {
15
+ return (
16
+ <WrapperWithShadow animation={animation} fadeDelay={fadeDelay} isWizard>
17
+ {children}
18
+ </WrapperWithShadow>
19
+ )
20
+ }
13
21
  return (
14
22
  <WrapperWithShadow animation={animation} fadeDelay={fadeDelay}>
15
23
  <Stack align="center" spacing="4" py="8">
@@ -6,10 +6,11 @@ import { AddHomeContentI } from '@/interfaces'
6
6
  export const MyHomesStepWrapper = ({
7
7
  children,
8
8
  isFirstHome,
9
- }: PropsWithChildren<Pick<AddHomeContentI, 'isFirstHome'>>) => {
9
+ isWizard,
10
+ }: PropsWithChildren<Pick<AddHomeContentI, 'isFirstHome' | 'isWizard'>>) => {
10
11
  const bg = isFirstHome ? 'lightGreen.1' : 'lightBlue.1'
11
12
  return (
12
- <Box bg={bg} h="100%">
13
+ <Box bg={isWizard ? 'transparent' : bg} h="100%">
13
14
  <MyHomesStepHeader isFirstHome={isFirstHome} />
14
15
  {children}
15
16
  </Box>
@@ -30,7 +30,8 @@ const fade = `${fadeAnimation} 50ms ease-in-out backwards`
30
30
 
31
31
  export const SearchRecords = ({
32
32
  isFirstHome,
33
- }: Pick<AddHomeContentI, 'isFirstHome'>) => {
33
+ isWizard = false,
34
+ }: Pick<AddHomeContentI, 'isFirstHome' | 'isWizard'>) => {
34
35
  const {
35
36
  fields: { street, city, state },
36
37
  } = useSnapshot(addressProxy, { sync: true })
@@ -46,15 +47,16 @@ export const SearchRecords = ({
46
47
  }, [])
47
48
 
48
49
  return (
49
- <MyHomesStepWrapper isFirstHome={isFirstHome}>
50
+ <MyHomesStepWrapper isFirstHome={isFirstHome} isWizard={isWizard}>
50
51
  <MyHomesStepBody
52
+ isWizard={isWizard}
51
53
  animation={up}
52
54
  title={t('myHomes.search.title')}
53
55
  subtitle={`${t('myHomes.search.subtitle')} ${address}`}
54
56
  >
55
57
  <Stack
56
58
  align="center"
57
- bg="lightViolet.1"
59
+ bg={isWizard ? 'transparent' : 'lightViolet.1'}
58
60
  borderRadius="sm"
59
61
  w="100%"
60
62
  py="6"
@@ -0,0 +1,64 @@
1
+ import { Box, Stack } from '@chakra-ui/react'
2
+ import { AnimatePresence, motion } from 'framer-motion'
3
+ import { ControlledWizardI } from '@/interfaces'
4
+
5
+ const MotionBox = motion(typeof Box)
6
+
7
+ export function ControlledWizard({
8
+ step,
9
+ setStep,
10
+ steps,
11
+ minHeight = '770px',
12
+ headerBlink,
13
+ }: ControlledWizardI) {
14
+ const current = steps[step]
15
+ const headerVariants = {
16
+ initial: { opacity: 0, y: 8 },
17
+ animate: headerBlink
18
+ ? { opacity: [1, 0.55, 1], y: 0, transition: { duration: 0.28 } }
19
+ : { opacity: 1, y: 0, transition: { duration: 0.28 } },
20
+ exit: { opacity: 0, y: -8, transition: { duration: 0.18 } },
21
+ }
22
+ const bodyVariants = {
23
+ initial: { opacity: 0, y: 12, scale: 0.98 },
24
+ animate: { opacity: 1, y: 0, scale: 1 },
25
+ exit: { opacity: 0, y: -8, scale: 0.98 },
26
+ }
27
+
28
+ return (
29
+ <Stack spacing="0" shadow="md" minH={minHeight} bg="white">
30
+ {/* header */}
31
+ <AnimatePresence mode="wait">
32
+ <Box
33
+ as={MotionBox}
34
+ key={`h-${step}`}
35
+ variants={headerVariants}
36
+ initial="initial"
37
+ animate="animate"
38
+ exit="exit"
39
+ w="full"
40
+ >
41
+ {current.header}
42
+ </Box>
43
+ </AnimatePresence>
44
+
45
+ {/* body */}
46
+ <AnimatePresence mode="wait">
47
+ <Box
48
+ as={MotionBox}
49
+ key={`b-${step}`}
50
+ variants={bodyVariants}
51
+ initial="initial"
52
+ animate="animate"
53
+ exit="exit"
54
+ flex="1"
55
+ display="flex"
56
+ >
57
+ <Box w="full" p={{ base: 4, md: 6 }}>
58
+ {current.body({ setStep })}
59
+ </Box>
60
+ </Box>
61
+ </AnimatePresence>
62
+ </Stack>
63
+ )
64
+ }
@@ -0,0 +1,32 @@
1
+ import { Center, Show, Stack, Text, Box } from '@chakra-ui/react'
2
+ import { Logo } from '@/components'
3
+ import { WizardTextHeaderI } from '@/interfaces'
4
+
5
+ export const WizardTextHeader = ({ title, subtitle }: WizardTextHeaderI) => {
6
+ return (
7
+ <Center w="full" bg="lightGreen.1" minH="212px">
8
+ <Stack w="full" spacing="0" align="center">
9
+ <Show below="md">
10
+ <Logo />
11
+ </Show>
12
+ <Stack spacing="6" w="80%">
13
+ <Text
14
+ fontSize={{ base: '2xl', md: '3xl' }}
15
+ lineHeight={{ base: 'shorter', md: 'base' }}
16
+ textAlign="center"
17
+ >
18
+ {title}
19
+ </Text>
20
+ {subtitle && (
21
+ <Text fontFamily="secondary" textAlign="center">
22
+ {subtitle}
23
+ </Text>
24
+ )}
25
+ <Show below="md">
26
+ <Box h="6" />
27
+ </Show>
28
+ </Stack>
29
+ </Stack>
30
+ </Center>
31
+ )
32
+ }
@@ -0,0 +1,2 @@
1
+ export * from './ControlledWizard'
2
+ export * from './WizardTextHeader'
package/src/index.ts CHANGED
@@ -26,6 +26,7 @@ export {
26
26
  ContactList,
27
27
  ContactsContent,
28
28
  ContainerHeader,
29
+ ControlledWizard,
29
30
  CreateDocumentHeader,
30
31
  CreateHouseholdItemHeader,
31
32
  CreditCardContainer,
@@ -217,6 +218,7 @@ export {
217
218
  WeatherWidget,
218
219
  WellDone,
219
220
  YtdTile,
221
+ WizardTextHeader,
220
222
  } from './components'
221
223
 
222
224
  export { useCustomToast } from './hooks'
@@ -251,6 +253,7 @@ export {
251
253
  recordsInputsToDBProxy,
252
254
  userDetailsProxy,
253
255
  confirmAddressProxy,
256
+ addressProxy,
254
257
  } from './proxies'
255
258
 
256
259
  import theme from './theme'
@@ -42,3 +42,4 @@ export * from './householdItems'
42
42
  export * from './valueMonitor'
43
43
  export * from './DrawerHeader.interface'
44
44
  export * from './videoPlayer'
45
+ export * from './wizard'
@@ -25,4 +25,5 @@ export interface AddHomeContentI {
25
25
  step?: 'initial' | 'loading' | 'properties'
26
26
  userFirstName?: string
27
27
  values?: HomeFormI
28
+ isWizard?: boolean
28
29
  }
@@ -1,4 +1,5 @@
1
1
  export interface WrapperWithShadowI {
2
2
  animation?: string
3
3
  fadeDelay?: number
4
+ isWizard?: boolean
4
5
  }
@@ -0,0 +1,14 @@
1
+ import { ReactNode } from 'react'
2
+
3
+ export type WizardStep = {
4
+ header: ReactNode
5
+ body: (api: { setStep: (i: number) => void }) => ReactNode
6
+ }
7
+
8
+ export interface ControlledWizardI {
9
+ step: number
10
+ setStep: (i: number) => void
11
+ steps: WizardStep[]
12
+ minHeight?: string | number
13
+ headerBlink?: boolean
14
+ }
@@ -0,0 +1,4 @@
1
+ export interface WizardTextHeaderI {
2
+ title: string
3
+ subtitle?: string
4
+ }
@@ -0,0 +1,2 @@
1
+ export * from './ControlledWizard.interface'
2
+ export * from './WizardTextHeader.interface'
@@ -0,0 +1,85 @@
1
+ import { Meta } from '@storybook/react'
2
+ import {
3
+ ConfirmProperty,
4
+ ControlledWizard,
5
+ MyHomeDetails,
6
+ SearchRecords,
7
+ WizardTextHeader,
8
+ } from '@/components'
9
+ import { Box } from '@chakra-ui/react'
10
+ import { useState } from 'react'
11
+ import { formValues } from '@/helpers'
12
+ import { propertiesMock } from '@/mocks'
13
+ import { ControlledWizardI, HomeFormI } from '@/interfaces'
14
+
15
+ export default {
16
+ title: 'Components/Wizard/ControlledWizard',
17
+ component: ControlledWizard,
18
+ decorators: [
19
+ (story) => (
20
+ <Box maxW="800px" mx="auto">
21
+ {story()}
22
+ </Box>
23
+ ),
24
+ ],
25
+ } as Meta<ControlledWizardI>
26
+
27
+ function fakeLookup() {
28
+ return new Promise((r) => setTimeout(r, 1500))
29
+ }
30
+
31
+ export const ControlledWizardComponent = () => {
32
+ const [step, setStep] = useState(0)
33
+ return (
34
+ <ControlledWizard
35
+ step={step}
36
+ setStep={setStep}
37
+ steps={[
38
+ {
39
+ header: (
40
+ <WizardTextHeader
41
+ title="Hi John, let’s get your Homefile set up."
42
+ subtitle="Complete this quick setup and we’ll handle the rest."
43
+ />
44
+ ),
45
+ body: ({ setStep }) => (
46
+ <MyHomeDetails
47
+ isWizard
48
+ userFirstName="Adam"
49
+ values={formValues}
50
+ properties={propertiesMock}
51
+ handleCreateHomeClick={async (values: HomeFormI) => {
52
+ setStep(1)
53
+ await fakeLookup()
54
+ setStep(2)
55
+ }}
56
+ />
57
+ ),
58
+ },
59
+ {
60
+ header: (
61
+ <WizardTextHeader title="One moment while we search public records…" />
62
+ ),
63
+ body: () => <SearchRecords isWizard />,
64
+ },
65
+ {
66
+ header: (
67
+ <WizardTextHeader
68
+ title="This is the data we found in public records."
69
+ subtitle="Details may not represent the most up-to-date info about your home."
70
+ />
71
+ ),
72
+ body: () => (
73
+ <ConfirmProperty
74
+ isWizard
75
+ properties={propertiesMock}
76
+ handleAddress={() => {
77
+ setStep(0)
78
+ }}
79
+ />
80
+ ),
81
+ },
82
+ ]}
83
+ />
84
+ )
85
+ }