@homefile/components-v2 2.40.28 → 2.40.30
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.
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ControlledWizardI } from '../../interfaces';
|
|
2
|
-
|
|
3
|
-
export declare
|
|
4
|
-
|
|
5
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
export declare function ControlledWizard({ bodyWidth, steps, height, headerBlink, footerBlink, ...props }: ControlledWizardI): import("react/jsx-runtime").JSX.Element | null;
|
|
4
|
+
export declare const WizardBodyPadding: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,31 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
1
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
13
|
import { Box, Flex, Stack } from '@chakra-ui/react';
|
|
3
14
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
4
15
|
const MotionBox = motion.create(typeof Box);
|
|
5
|
-
export function ControlledWizard(
|
|
6
|
-
|
|
16
|
+
export function ControlledWizard(_a) {
|
|
17
|
+
var _b, _c;
|
|
18
|
+
var { bodyWidth = '80%', steps, height = '700px', headerBlink, footerBlink } = _a, props = __rest(_a, ["bodyWidth", "steps", "height", "headerBlink", "footerBlink"]);
|
|
19
|
+
const isKeyed = 'stepKey' in props;
|
|
20
|
+
const current = isKeyed
|
|
21
|
+
? (_b = steps.find((s) => s.key === props.stepKey)) !== null && _b !== void 0 ? _b : steps[0]
|
|
22
|
+
: steps[props.step];
|
|
23
|
+
const motionKey = isKeyed ? props.stepKey : (_c = current === null || current === void 0 ? void 0 : current.key) !== null && _c !== void 0 ? _c : String(props.step);
|
|
24
|
+
const setStep = (n) => {
|
|
25
|
+
if (!isKeyed)
|
|
26
|
+
props.setStep(n);
|
|
27
|
+
};
|
|
28
|
+
const setStepKey = isKeyed ? props.setStepKey : undefined;
|
|
7
29
|
const headerVariants = {
|
|
8
30
|
initial: { opacity: 0, y: 8, filter: 'blur(6px)' },
|
|
9
31
|
animate: headerBlink
|
|
@@ -53,8 +75,10 @@ export function ControlledWizard({ bodyWidth = '80%', step, setStep, steps, heig
|
|
|
53
75
|
transition: { duration: 0.18 },
|
|
54
76
|
},
|
|
55
77
|
};
|
|
56
|
-
|
|
78
|
+
if (!current)
|
|
79
|
+
return null;
|
|
80
|
+
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-${motionKey}`) }), _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", children: _jsx(Flex, { justify: "center", h: "full", w: "full", children: _jsx(Box, { w: bodyWidth, children: current.body({ setStep, setStepKey }) }) }) }) }, `b-${motionKey}`) }), 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-${motionKey}`) }))] }));
|
|
57
81
|
}
|
|
58
|
-
export const WizardBodyPadding = ({ children
|
|
82
|
+
export const WizardBodyPadding = ({ children }) => {
|
|
59
83
|
return _jsx(Box, { py: { base: '4', md: '8' }, children: children });
|
|
60
84
|
};
|
|
@@ -1,16 +1,29 @@
|
|
|
1
1
|
export interface ControlledWizardStepI {
|
|
2
|
+
key?: string;
|
|
2
3
|
header: React.ReactNode;
|
|
3
|
-
body: (args
|
|
4
|
+
body: (args?: {
|
|
4
5
|
setStep: (n: number) => void;
|
|
6
|
+
setStepKey?: (key: string) => void;
|
|
5
7
|
}) => React.ReactNode;
|
|
6
8
|
footer?: React.ReactNode;
|
|
7
9
|
}
|
|
8
|
-
|
|
9
|
-
bodyWidth?: string;
|
|
10
|
+
type ControlledWizardLegacyProps = {
|
|
10
11
|
step: number;
|
|
11
12
|
setStep: (n: number) => void;
|
|
13
|
+
stepKey?: never;
|
|
14
|
+
setStepKey?: never;
|
|
15
|
+
};
|
|
16
|
+
type ControlledWizardKeyedProps = {
|
|
17
|
+
step?: never;
|
|
18
|
+
setStep?: never;
|
|
19
|
+
stepKey: string;
|
|
20
|
+
setStepKey: (key: string) => void;
|
|
21
|
+
};
|
|
22
|
+
export type ControlledWizardI = {
|
|
23
|
+
bodyWidth?: string;
|
|
12
24
|
steps: ControlledWizardStepI[];
|
|
13
25
|
height?: string;
|
|
14
26
|
headerBlink?: boolean;
|
|
15
27
|
footerBlink?: boolean;
|
|
16
|
-
}
|
|
28
|
+
} & (ControlledWizardLegacyProps | ControlledWizardKeyedProps);
|
|
29
|
+
export {};
|
|
@@ -86,7 +86,7 @@ export const ControlledWizardComponent = () => {
|
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
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." })),
|
|
89
|
-
body: (
|
|
89
|
+
body: (args) => (_jsx(WizardBodyPadding, { children: _jsx(WizardValueSummaryBody, { title: "The Edmunds", address: "113 South First Street, Austin TX 89853", estimatedValue: 894000, purchasePrice: 456432, assessedValue: 726678, purchasePriceDetails: purchasePriceMock, assessedValueDetails: assessedValueMock }) })),
|
|
90
90
|
footer: (_jsx(WizardValueSummaryFooter, { onAccurate: () => setStep(step + 1), onNotAccurate: () => setStep(step + 1), onComplete: () => setStep(step + 1), accuracyStatus: null })),
|
|
91
91
|
},
|
|
92
92
|
{
|