@homefile/components-v2 2.40.27 → 2.40.29

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.
@@ -1031,6 +1031,7 @@
1031
1031
  "editDetails": "Edit details",
1032
1032
  "editPhoto": "Edit photo",
1033
1033
  "editValue": "Edit value",
1034
+ "editMortgage": "Edit Mortgage",
1034
1035
  "folders": "Folders",
1035
1036
  "deleted": "Scheduled to be deleted",
1036
1037
  "help": "Help info",
@@ -5,5 +5,5 @@ import { Edit, EstRoi, Plus, TileCard, TileTooltip, TrendingLineChart, TrendingV
5
5
  import { ComputerReport } from '../../../assets/images';
6
6
  import { colors } from '../../../theme/colors';
7
7
  export const TrendingValue = ({ chartData, marketValue = 0, menuItems, mortgageBalance = 0, onMortgageClick, purchasePrice = 0, roi, showHelp }) => {
8
- return (_jsx(TileTooltip, { label: "trendingValue", children: _jsx(Box, { children: _jsxs(TileCard, { bg: "lightGreen.8", menuItems: menuItems, title: t('propertyTiles.trending.title'), icon: ComputerReport, fontWeight: "normal", showHelp: showHelp, children: [_jsxs(Flex, { gap: "base", p: "base", bg: "lightBlue.1", children: [_jsx(TrendingValueCard, { bg: "lightBlue.2", label: t('propertyTiles.trending.purchase'), value: purchasePrice }), (mortgageBalance > 0) ? (_jsx(TrendingValueCard, { bg: "lightBlue.4", editButton: Boolean(mortgageBalance) && (_jsx(Tooltip, { label: t('tooltips.editValue'), children: _jsx(IconButton, { variant: "menuIconWithShadow", maxW: "fit-content", "aria-label": t('ariaLabels.edit'), p: "1", icon: _jsx(Edit, { size: 16 }), onClick: onMortgageClick }) })), label: t('propertyTiles.trending.mortgage'), value: mortgageBalance })) : (_jsxs(Stack, { spacing: "1", flex: "auto", children: [_jsx(Flex, { align: "center", justify: "space-between", h: "20px", children: _jsx(Text, { fontSize: "xs", textTransform: "uppercase", children: t('propertyTiles.trending.mortgage') }) }), _jsxs(Button, { variant: "tertiary", h: "full", onClick: onMortgageClick, w: "full", px: "1", children: [_jsx(Plus, { stroke: colors.blue[3], size: 20 }), _jsx(Text, { color: colors.blue[3], as: "span", pl: '.25rem', children: t('propertyTiles.trending.addMortgage') })] })] }))] }), _jsxs(Stack, { spacing: "base", p: "base", children: [_jsxs(Flex, { children: [_jsx(TrendingValueCard, { bg: "lightGreen.6", fontSize: "3xl", label: t('propertyTiles.trending.estimated'), value: marketValue }), roi && _jsx(EstRoi, { value: roi })] }), chartData && _jsx(TrendingLineChart, { data: chartData }), !chartData && (_jsx(Box, { h: "220px", border: "1px solid", borderColor: "lightGreen.6" })), _jsx(Text, { fontFamily: "secondary", fontSize: "xs", children: t('propertyTiles.trending.public') })] })] }) }) }));
8
+ return (_jsx(TileTooltip, { label: "trendingValue", children: _jsx(Box, { children: _jsxs(TileCard, { bg: "lightGreen.8", menuItems: menuItems, title: t('propertyTiles.trending.title'), icon: ComputerReport, fontWeight: "normal", showHelp: showHelp, children: [_jsxs(Flex, { gap: "base", p: "base", bg: "lightBlue.1", children: [_jsx(TrendingValueCard, { bg: "lightBlue.2", label: t('propertyTiles.trending.purchase'), value: purchasePrice }), (mortgageBalance > 0) ? (_jsx(TrendingValueCard, { bg: "lightBlue.4", editButton: Boolean(mortgageBalance) && (_jsx(Tooltip, { label: t('tooltips.editMortgage'), children: _jsx(IconButton, { variant: "menuIconWithShadow", maxW: "fit-content", "aria-label": t('ariaLabels.edit'), p: "1", icon: _jsx(Edit, { size: 16 }), onClick: onMortgageClick }) })), label: t('propertyTiles.trending.mortgage'), value: mortgageBalance })) : (_jsxs(Stack, { spacing: "1", flex: "auto", children: [_jsx(Flex, { align: "center", justify: "space-between", h: "20px", children: _jsx(Text, { fontSize: "xs", textTransform: "uppercase", children: t('propertyTiles.trending.mortgage') }) }), _jsxs(Button, { variant: "tertiary", h: "full", onClick: onMortgageClick, w: "full", px: "1", children: [_jsx(Plus, { stroke: colors.blue[3], size: 20 }), _jsx(Text, { color: colors.blue[3], as: "span", pl: '.25rem', children: t('propertyTiles.trending.addMortgage') })] })] }))] }), _jsxs(Stack, { spacing: "base", p: "base", children: [_jsxs(Flex, { children: [_jsx(TrendingValueCard, { bg: "lightGreen.6", fontSize: "3xl", label: t('propertyTiles.trending.estimated'), value: marketValue }), roi && _jsx(EstRoi, { value: roi })] }), chartData && _jsx(TrendingLineChart, { data: chartData }), !chartData && (_jsx(Box, { h: "220px", border: "1px solid", borderColor: "lightGreen.6" })), _jsx(Text, { fontFamily: "secondary", fontSize: "xs", children: t('propertyTiles.trending.public') })] })] }) }) }));
9
9
  };
@@ -1,5 +1,4 @@
1
1
  import { ControlledWizardI } from '../../interfaces';
2
- export declare function ControlledWizard({ bodyWidth, step, setStep, steps, height, headerBlink, footerBlink, }: ControlledWizardI): import("react/jsx-runtime").JSX.Element;
3
- export declare const WizardBodyPadding: ({ children, }: {
4
- children: React.ReactNode;
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({ bodyWidth = '80%', step, setStep, steps, height = '700px', headerBlink, footerBlink, }) {
6
- const current = steps[step];
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
- 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", children: _jsx(Flex, { justify: "center", h: "full", w: "full", 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}`) }))] }));
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
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
- export interface ControlledWizardI {
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 {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.40.27",
3
+ "version": "2.40.29",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",