@homefile/components-v2 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/images/ia.svg +15 -16
- package/dist/assets/locales/en/index.json +8 -7
- package/dist/components/contacts/ContactsContent.js +1 -1
- package/dist/components/homeAssistant/HomeAssistantTutorial.js +1 -1
- package/dist/components/homeAssistant/HomeAssistantWrapper.js +1 -1
- package/dist/components/homeAssistant/HomeMonitorButton.d.ts +1 -1
- package/dist/components/homeAssistant/HomeMonitorButton.js +3 -8
- package/dist/components/homeAssistant/HomeMonitorSteps.js +22 -4
- package/dist/components/homeAssistant/panel/ApplianceSteps.js +4 -1
- package/dist/components/homeAssistant/panel/HomeAssistantPanel.js +14 -1
- package/dist/components/homeBoard/HomeBoard.js +2 -2
- package/dist/components/inputs/SelectButton.js +1 -1
- package/dist/components/launchpad/IconMenu.d.ts +1 -1
- package/dist/components/launchpad/IconMenu.js +2 -2
- package/dist/interfaces/forms/dynamicForm/DynamicForm.interface.d.ts +1 -1
- package/dist/interfaces/homeAssistant/ApplianceSteps.interface.d.ts +1 -2
- package/dist/interfaces/homeAssistant/HomeMonitorSteps.interface.d.ts +0 -1
- package/dist/interfaces/launchpad/IconMenu.interface.d.ts +2 -0
- package/dist/mocks/homeAssistant/homeAssistantForms.js +6 -0
- package/package.json +1 -1
- package/src/assets/images/ia.svg +15 -16
- package/src/assets/locales/en/index.json +8 -7
- package/src/components/contacts/ContactsContent.tsx +1 -1
- package/src/components/homeAssistant/HomeAssistantTutorial.tsx +3 -0
- package/src/components/homeAssistant/HomeAssistantWrapper.tsx +0 -5
- package/src/components/homeAssistant/HomeMonitorButton.tsx +3 -17
- package/src/components/homeAssistant/HomeMonitorSteps.tsx +40 -10
- package/src/components/homeAssistant/panel/ApplianceSteps.tsx +7 -1
- package/src/components/homeAssistant/panel/HomeAssistantPanel.tsx +21 -3
- package/src/components/homeBoard/HomeBoard.tsx +18 -0
- package/src/components/inputs/SelectButton.tsx +3 -1
- package/src/components/launchpad/IconMenu.tsx +4 -1
- package/src/interfaces/forms/dynamicForm/DynamicForm.interface.ts +1 -0
- package/src/interfaces/homeAssistant/ApplianceSteps.interface.ts +1 -1
- package/src/interfaces/homeAssistant/HomeMonitorSteps.interface.ts +0 -1
- package/src/interfaces/launchpad/IconMenu.interface.ts +2 -0
- package/src/mocks/homeAssistant/homeAssistantForms.ts +6 -0
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="
|
|
2
|
-
<g id="
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<line id="Line_3402" data-name="Line 3402" x2="2.485" transform="translate(14.052 14.039)" fill="none" stroke="#fff" stroke-width="2"/>
|
|
15
|
-
<path id="Path_15024" data-name="Path 15024" d="M-112.806,1761.029a2.621,2.621,0,0,0,2.622,2.231,2.666,2.666,0,0,0,2.618-2.231" transform="translate(122.294 -1742.01)" fill="none" stroke="#fff" stroke-linecap="round" stroke-width="1"/>
|
|
16
|
-
</g>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="30.202" height="30.2" viewBox="0 0 30.202 30.2">
|
|
2
|
+
<g id="Group_21564" data-name="Group 21564" transform="translate(10417.861 8318.462)">
|
|
3
|
+
<circle id="Ellipse_1093" data-name="Ellipse 1093" cx="2.157" cy="2.157" r="2.157" transform="translate(-10404.917 -8318.462)" fill="#bcd1d8"/>
|
|
4
|
+
<line id="Line_3403" data-name="Line 3403" y2="2.725" transform="translate(-10402.761 -8314.146)" fill="none" stroke="#bcd1d8" stroke-width="1"/>
|
|
5
|
+
<rect id="Rectangle_24537" data-name="Rectangle 24537" width="10.786" height="4.314" rx="2.157" transform="translate(-10408.155 -8311.99)" fill="#00a1aa"/>
|
|
6
|
+
<circle id="Ellipse_1090" data-name="Ellipse 1090" cx="3.236" cy="3.236" r="3.236" transform="translate(-10417.861 -8304.439)" fill="#00a1aa"/>
|
|
7
|
+
<ellipse id="Ellipse_1092" data-name="Ellipse 1092" cx="2.696" cy="3.236" rx="2.696" ry="3.236" transform="translate(-10393.053 -8304.439)" fill="#00a1aa"/>
|
|
8
|
+
<circle id="Ellipse_1091" data-name="Ellipse 1091" cx="3.236" cy="3.236" r="3.236" transform="translate(-10397.368 -8304.439)" fill="#00a1aa"/>
|
|
9
|
+
<rect id="Rectangle_24536" data-name="Rectangle 24536" width="23.729" height="21.572" rx="3" transform="translate(-10414.626 -8309.834)" fill="#02c0b7"/>
|
|
10
|
+
<rect id="Rectangle_24476" data-name="Rectangle 24476" width="15.1" height="6.472" rx="3" transform="translate(-10410.311 -8304.439)" fill="#324459"/>
|
|
11
|
+
<line id="Line_3401" data-name="Line 3401" x2="2.725" transform="translate(-10407.915 -8300.908)" fill="none" stroke="#fff" stroke-width="2"/>
|
|
12
|
+
<line id="Line_3402" data-name="Line 3402" x2="2.725" transform="translate(-10399.874 -8300.908)" fill="none" stroke="#fff" stroke-width="2"/>
|
|
13
|
+
<path id="Path_15024" data-name="Path 15024" d="M-112.806,1761.029a2.874,2.874,0,0,0,2.876,2.446,2.924,2.924,0,0,0,2.871-2.446" transform="translate(-10292.654 -10055.396)" fill="none" stroke="#fff" stroke-linecap="round" stroke-width="1"/>
|
|
17
14
|
</g>
|
|
18
15
|
</svg>
|
|
16
|
+
|
|
17
|
+
|
|
@@ -399,8 +399,8 @@
|
|
|
399
399
|
}
|
|
400
400
|
},
|
|
401
401
|
"details": "Provide details about your home’s",
|
|
402
|
-
"homeMonitor": "
|
|
403
|
-
"homeMonitoring": "
|
|
402
|
+
"homeMonitor": "Homie",
|
|
403
|
+
"homeMonitoring": "Homie is monitoring your home.",
|
|
404
404
|
"monitorAlerts": {
|
|
405
405
|
"collapse": "Collapse Alert",
|
|
406
406
|
"homeAction": "Home Action",
|
|
@@ -418,10 +418,11 @@
|
|
|
418
418
|
"smoke": "Smoke & CO2 detectors",
|
|
419
419
|
"structure": "Structure"
|
|
420
420
|
},
|
|
421
|
-
"title": "
|
|
421
|
+
"title": "Set Up Homie",
|
|
422
422
|
"tutorialButton": "Start Quick Setup",
|
|
423
|
-
"tutorialDescription": "
|
|
424
|
-
"tutorialTitle": "Let’s quickly
|
|
423
|
+
"tutorialDescription": "Homie helps you manage every aspect of your home. We've added a short overview to help you learn more about it.",
|
|
424
|
+
"tutorialTitle": "Let’s quickly set up Homie, your friendly AI home assistant.",
|
|
425
|
+
"tutorialNote": "Just a few set-up questions to help Homie get going."
|
|
425
426
|
},
|
|
426
427
|
"homeBoard": {
|
|
427
428
|
"addRecords": "Add Property Records",
|
|
@@ -603,7 +604,7 @@
|
|
|
603
604
|
"newPassword": {
|
|
604
605
|
"confirm": "Confirm Password",
|
|
605
606
|
"create": "Create Password",
|
|
606
|
-
"title": "
|
|
607
|
+
"title": "Please enter your new password."
|
|
607
608
|
},
|
|
608
609
|
"partner": {
|
|
609
610
|
"aphw": {
|
|
@@ -743,7 +744,7 @@
|
|
|
743
744
|
"title": "Property Taxes"
|
|
744
745
|
},
|
|
745
746
|
"trending": {
|
|
746
|
-
"addMortgage": "
|
|
747
|
+
"addMortgage": "Mortgage Info",
|
|
747
748
|
"estimated": "Estimated Market Value",
|
|
748
749
|
"mortgage": "Mortgage Balance*",
|
|
749
750
|
"public": "*Estimated from Public Data",
|
|
@@ -12,7 +12,7 @@ export const ContactsContent = ({ apiError, contacts, menuItems, handleClose, ch
|
|
|
12
12
|
});
|
|
13
13
|
const { windowDimensions: { width }, } = useWindowDimensions();
|
|
14
14
|
const maxW = width > 413 ? '16rem' : '10rem';
|
|
15
|
-
return (_jsxs(DrawerContent, { bg: "lightBlue.1", children: [_jsxs(DrawerHeader, { p: "0", children: [_jsx(PanelHeader, { handleCloseButton: handleClose, icon: Contacts, title: t('contacts.title') }), _jsxs(Flex, { justify: "space-between", pl: "base", my: "base", align: "center", gap: "base", children: [_jsx(SearchInput, { maxW: maxW, value: search, onChange: handleChange }), _jsx(LeftButtonAnimated, { onClick: handleAdd, label: t('contacts.addBtn'), disabled: disabled })] })] }), _jsxs(DrawerBody, { p: "0", overflowX: "hidden", children: [_jsxs(Stack, { spacing: "base", pt: "base", pb: "120px", pr: "base", bg: "lightBlue.
|
|
15
|
+
return (_jsxs(DrawerContent, { bg: "lightBlue.1", children: [_jsxs(DrawerHeader, { p: "0", children: [_jsx(PanelHeader, { handleCloseButton: handleClose, icon: Contacts, title: t('contacts.title') }), _jsxs(Flex, { justify: "space-between", pl: "base", my: "base", align: "center", gap: "base", children: [_jsx(SearchInput, { maxW: maxW, value: search, onChange: handleChange }), _jsx(LeftButtonAnimated, { onClick: handleAdd, label: t('contacts.addBtn'), disabled: disabled })] })] }), _jsxs(DrawerBody, { p: "0", overflowX: "hidden", children: [_jsxs(Stack, { spacing: "base", pt: "base", pb: "120px", pr: "base", bg: "lightBlue.2", minHeight: "full", children: [_jsxs(Flex, { gap: "3", pl: "base", children: [_jsx(Checkbox, { onChange: handleSelectAll }), _jsx(Text, { fontFamily: "secondary", fontSize: "xs", children: t('subscription.select') })] }), _jsx(Box, { children: Object.keys(splittedContacts).map((letter, idx) => {
|
|
16
16
|
const showLetterDivider = idx !== 0;
|
|
17
17
|
return (_jsxs(Stack, { spacing: "0", children: [showLetterDivider && _jsx(LetterDivider, { letter: letter }), _jsx(Stack, { spacing: "2px", children: splittedContacts[letter].map((contact, idx) => {
|
|
18
18
|
const selected = isItemSelected(contact._id);
|
|
@@ -6,5 +6,5 @@ import { ChevronRight, VideoPlayerModal, VideoPlayerTrigger, } from '..';
|
|
|
6
6
|
import { colors } from '../../theme/colors';
|
|
7
7
|
export const HomeAssistantTutorial = ({ onStart, videoUrl, }) => {
|
|
8
8
|
const [url, setUrl] = useState();
|
|
9
|
-
return (_jsxs(Stack, { spacing: "base", align: "center", maxW: "483px", px: ['base', 0], zIndex: "2", children: [_jsx(Text, { fontSize: "30px", lineHeight: "32px", textAlign: "center", children: t('homeAssistant.tutorialTitle') }), _jsx(Text, { fontFamily: "secondary", textAlign: "center", children: t('homeAssistant.tutorialDescription') }), _jsxs(Stack, { spacing: "base", w: "284px", children: [_jsx(Box, { boxShadow: "lg", children: _jsx(VideoPlayerTrigger, { url: videoUrl, value: videoUrl, ratio: 16 / 9, onPlay: (value) => setUrl(value) }) }), _jsx(Button, { onClick: onStart, textTransform: "capitalize", children: _jsxs(Flex, { align: "center", justify: "space-between", w: "100%", px: "base", children: [_jsx(Text, { color: "neutral.white", children: t('homeAssistant.tutorialButton') }), _jsx(Circle, { size: "40px", bg: "blue.1", color: "neutral.white", children: _jsx(ChevronRight, { size: 26, stroke: colors.neutral.white }) })] }) })] }), url && (_jsx(VideoPlayerModal, { url: url, onClose: () => setUrl(undefined), showOverlay: true }))] }));
|
|
9
|
+
return (_jsxs(Stack, { spacing: "base", align: "center", maxW: "483px", px: ['base', 0], zIndex: "2", children: [_jsx(Text, { fontSize: "30px", lineHeight: "32px", textAlign: "center", children: t('homeAssistant.tutorialTitle') }), _jsx(Text, { fontFamily: "secondary", textAlign: "center", children: t('homeAssistant.tutorialDescription') }), _jsxs(Stack, { spacing: "base", w: "284px", children: [_jsx(Box, { boxShadow: "lg", children: _jsx(VideoPlayerTrigger, { url: videoUrl, value: videoUrl, ratio: 16 / 9, onPlay: (value) => setUrl(value) }) }), _jsx(Button, { onClick: onStart, textTransform: "capitalize", children: _jsxs(Flex, { align: "center", justify: "space-between", w: "100%", px: "base", children: [_jsx(Text, { color: "neutral.white", children: t('homeAssistant.tutorialButton') }), _jsx(Circle, { size: "40px", bg: "blue.1", color: "neutral.white", children: _jsx(ChevronRight, { size: 26, stroke: colors.neutral.white }) })] }) })] }), _jsx(Text, { fontFamily: "secondary", textAlign: "center", children: t('homeAssistant.tutorialNote') }), url && (_jsx(VideoPlayerModal, { url: url, onClose: () => setUrl(undefined), showOverlay: true }))] }));
|
|
10
10
|
};
|
|
@@ -6,5 +6,5 @@ import { getImageAltText } from '../../utils';
|
|
|
6
6
|
import { colors } from '../../theme/colors';
|
|
7
7
|
export const HomeAssistantWrapper = ({ children, showAirplane, title, }) => {
|
|
8
8
|
const treesAlt = getImageAltText(TreesCrop);
|
|
9
|
-
return (_jsx(GridItem, { colSpan: [1, 2], children: _jsx(TileTooltip, { label: "homeAssistant", children: _jsxs(Box, { bgGradient: colors.skyGradient, boxShadow: "base", h: "full", position: "relative", overflowX: "hidden", children: [_jsx(ContainerHeader, { title: title, titleIcon: IA }), _jsx(Center, { minH: "477px", children: children }), _jsx(Image, { src: Cloud1, position: "absolute", w: "auto", h: "80px", top: "80px", animation: `${moveRightToLeftWithFade} 400s linear infinite
|
|
9
|
+
return (_jsx(GridItem, { colSpan: [1, 2], children: _jsx(TileTooltip, { label: "homeAssistant", children: _jsxs(Box, { bgGradient: colors.skyGradient, boxShadow: "base", h: "full", position: "relative", overflowX: "hidden", children: [_jsx(ContainerHeader, { title: title, titleIcon: IA }), _jsx(Center, { minH: "477px", children: children }), _jsx(Image, { src: Cloud1, position: "absolute", w: "auto", h: "80px", top: "80px", animation: `${moveRightToLeftWithFade} 400s linear infinite` }), _jsx(Image, { src: Cloud2, position: "absolute", w: "auto", h: "112px", top: "150px", animation: `${moveRightToLeft} 200s linear infinite` }), _jsx(Image, { src: Cloud3, position: "absolute", w: "auto", h: "160px", top: "200px", animation: `${moveRightToLeft} 130s linear infinite` }), showAirplane && (_jsx(Image, { src: Airplane, position: "absolute", w: "auto", h: "40px", top: "85px", animation: `${moveLeftToRightAirplane} 500s cubic-bezier(1, 1, 1, 500) infinite` })), _jsx(Image, { src: TreesCrop, alt: treesAlt, position: "absolute", bottom: "0", right: "2", w: "auto", h: "70px" })] }) }) }));
|
|
10
10
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { HomeMonitorButtonI } from '../../interfaces';
|
|
2
|
-
export declare const HomeMonitorButton: ({ currentStep,
|
|
2
|
+
export declare const HomeMonitorButton: ({ currentStep, onStepClick, status, step, }: HomeMonitorButtonI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Center, Image, Stack, Text } from '@chakra-ui/react';
|
|
3
3
|
import { getIconAltText } from '../../utils';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
export const HomeMonitorButton = ({ currentStep, onStepClick, status = 'ok', step, }) => {
|
|
5
|
+
const buttonId = `homeMonitorButton-${currentStep}`;
|
|
6
6
|
const iconAltText = getIconAltText(step.icon);
|
|
7
|
-
|
|
8
|
-
if (status !== 'ok')
|
|
9
|
-
onStepClick(currentStep);
|
|
10
|
-
};
|
|
11
|
-
const isDisabled = Number(menuItems.length) === 0;
|
|
12
|
-
return (_jsxs(Box, { position: "relative", children: [_jsxs(Box, { position: "relative", bg: "neutral.white", borderRadius: "lg", boxShadow: "lg", zIndex: "2", children: [_jsx(Box, { bg: status === 'alert' ? 'error.2' : 'green.1', boxSize: "10px", borderRadius: "full", position: "absolute", top: "6px", left: "6px", zIndex: "8" }), _jsxs(Stack, Object.assign({ position: "relative", zIndex: "2", as: "button", spacing: "2", border: "1px solid transparent", w: "90px", align: "center", h: "96px", py: "base" }, setStyles(status), { onClick: handleClick, children: [_jsx(Center, { h: "60%", marginTop: "2", children: _jsx(Image, { src: step.icon, alt: iconAltText, w: "auto", h: "28px" }) }), _jsx(Center, { h: "40%", children: _jsx(Text, { fontSize: "xs", textTransform: "uppercase", textAlign: "center", lineHeight: "14px", children: step.title }) })] }))] }), _jsx(Box, { position: "absolute", top: "-2px", right: "4px", zIndex: "4", children: _jsx(IconMenu, { icon: _jsx(MoreHorizontal, { size: 26 }), itemForm: currentStep, menuItems: menuItems, disabled: isDisabled }) })] }));
|
|
7
|
+
return (_jsx(Box, { position: "relative", id: buttonId, children: _jsxs(Box, { position: "relative", bg: "neutral.white", borderRadius: "lg", boxShadow: "lg", zIndex: "2", children: [_jsx(Box, { bg: status === 'alert' ? 'error.2' : 'green.1', boxSize: "10px", borderRadius: "full", position: "absolute", top: "6px", left: "6px", zIndex: "8" }), _jsxs(Stack, Object.assign({ position: "relative", zIndex: "2", as: "button", spacing: "2", border: "1px solid transparent", w: "90px", align: "center", h: "96px", py: "base" }, setStyles(status), { onClick: () => onStepClick(currentStep), children: [_jsx(Center, { h: "60%", marginTop: "2", children: _jsx(Image, { src: step.icon, alt: iconAltText, w: "auto", h: "28px" }) }), _jsx(Center, { h: "40%", children: _jsx(Text, { fontSize: "xs", textTransform: "uppercase", textAlign: "center", lineHeight: "14px", children: step.title }) })] }))] }) }));
|
|
13
8
|
};
|
|
14
9
|
const setStyles = (status) => {
|
|
15
10
|
switch (status) {
|
|
@@ -1,9 +1,27 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Flex } from '@chakra-ui/react';
|
|
3
|
-
import { HomeMonitorButton } from '..';
|
|
3
|
+
import { HomeMonitorButton, IconMenu, MoreHorizontal } from '..';
|
|
4
4
|
import { homeAssistantSteps } from '../../helpers';
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { useComponentStyles } from '../../hooks';
|
|
6
|
+
import { useState } from 'react';
|
|
7
|
+
export const HomeMonitorSteps = ({ menuItems = [], onStepClick, stepsWithAlerts, }) => {
|
|
8
|
+
const ids = [
|
|
9
|
+
'homeMonitorButton-1',
|
|
10
|
+
'homeMonitorButton-2',
|
|
11
|
+
'homeMonitorButton-3',
|
|
12
|
+
'homeMonitorButton-4',
|
|
13
|
+
'homeMonitorButton-5',
|
|
14
|
+
'homeMonitorButton-6',
|
|
15
|
+
'menuItems',
|
|
16
|
+
];
|
|
17
|
+
const [selectedId, setSelectedId] = useState('');
|
|
18
|
+
const isDisabled = menuItems.length === 0;
|
|
19
|
+
useComponentStyles({ ids, selectedId, zIndex: '2' });
|
|
20
|
+
const handleStepClick = (step) => {
|
|
21
|
+
onStepClick(step);
|
|
22
|
+
setSelectedId(`homeMonitorButton-${step}`);
|
|
23
|
+
};
|
|
24
|
+
return (_jsx(Flex, { gap: "base", children: homeAssistantSteps.map((step, index) => (_jsx(Box, { position: "relative", children: _jsxs(Box, { flex: "auto", children: [_jsx(HomeMonitorButton, { currentStep: index + 1, onStepClick: handleStepClick, status: getStatus(index + 1, stepsWithAlerts), step: step }), _jsx(Box, { position: "absolute", top: "-2px", right: "4px", zIndex: "1400", children: _jsx(IconMenu, { zIndex: "2", icon: _jsx(MoreHorizontal, { size: 26 }), itemForm: index + 1, menuItems: menuItems, disabled: isDisabled, onClick: () => setSelectedId('menuItems') }) })] }) }, step === null || step === void 0 ? void 0 : step.title))) }));
|
|
7
25
|
};
|
|
8
26
|
const getStatus = (index, stepsWithAlerts) => {
|
|
9
27
|
const hasAlert = stepsWithAlerts.includes(index);
|
|
@@ -3,9 +3,12 @@ import { t } from 'i18next';
|
|
|
3
3
|
import { Center, SimpleGrid, Stack, Text } from '@chakra-ui/react';
|
|
4
4
|
import { ApplianceButton } from '../..';
|
|
5
5
|
import { Fridge, Freezer, Washer, Dryer, Dishwasher, CookTop, Oven, Hood, Microwave, Range, } from '../../../assets/images';
|
|
6
|
-
import { useState } from 'react';
|
|
6
|
+
import { useState, useEffect } from 'react';
|
|
7
7
|
export const ApplianceSteps = ({ addedAppliances = [], onClick, }) => {
|
|
8
8
|
const [appliances, setAppliances] = useState(addedAppliances);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
setAppliances(addedAppliances);
|
|
11
|
+
}, [addedAppliances]);
|
|
9
12
|
const handleClick = (id) => {
|
|
10
13
|
if (appliances.includes(id)) {
|
|
11
14
|
const newAppliances = appliances.filter((appliance) => appliance !== id);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
2
3
|
import { FormProvider } from 'react-hook-form';
|
|
3
4
|
import { t } from 'i18next';
|
|
4
5
|
import { DrawerContent, DrawerHeader, DrawerBody, Stack, Text, DrawerFooter, } from '@chakra-ui/react';
|
|
@@ -7,13 +8,25 @@ import { ApplianceSteps, SimpleDynamicForm, FooterButtons, HomeAssistantPanelSte
|
|
|
7
8
|
import { homeAssistantSteps } from '../../../helpers';
|
|
8
9
|
import { useSimpleDynamicForm } from '../../../hooks';
|
|
9
10
|
export const HomeAssistantPanel = ({ children, currentForm, currentStep, onApplianceClick, onBack, onClose, onNext, onSave, backDisabled, nextDisabled, }) => {
|
|
11
|
+
const [addedAppliances, updateAddedAppliances] = useState([]);
|
|
10
12
|
const { title } = homeAssistantSteps[currentStep - 1];
|
|
11
13
|
const text = `${t('homeAssistant.details')} ${title.toLowerCase()}:`;
|
|
12
14
|
const isAppliances = currentStep === 4;
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
var _a;
|
|
17
|
+
if (isAppliances) {
|
|
18
|
+
const targetAppliances = (_a = currentForm.find((field) => {
|
|
19
|
+
var _a;
|
|
20
|
+
return ((_a = field.name) === null || _a === void 0 ? void 0 : _a.toLocaleLowerCase()) === 'appliances list' &&
|
|
21
|
+
field.type === 'hidden';
|
|
22
|
+
})) === null || _a === void 0 ? void 0 : _a.value;
|
|
23
|
+
updateAddedAppliances(targetAppliances);
|
|
24
|
+
}
|
|
25
|
+
}, [currentForm, isAppliances]);
|
|
13
26
|
const { form, updatedFields } = useSimpleDynamicForm({
|
|
14
27
|
fields: currentForm,
|
|
15
28
|
});
|
|
16
|
-
return (_jsxs(DrawerContent, { bg: "lightBlue.1", children: [_jsx(DrawerHeader, { p: "0", children: _jsx(PanelHeader, { handleCloseButton: onClose, title: t('homeAssistant.title'), icon: IA }) }), _jsxs(DrawerBody, { p: "0", children: [_jsx(HomeAssistantPanelStep, { currentStep: currentStep }), children, isAppliances && _jsx(ApplianceSteps, { onClick: onApplianceClick }), _jsxs(Stack, { spacing: "base", p: "base", children: [_jsx(Text, { fontFamily: "secondary", fontSize: "sm", children: text }), _jsx(FormProvider, Object.assign({}, form, { children: _jsx(SimpleDynamicForm, { fields: currentForm }) }))] })] }), _jsx(DrawerFooter, { px: "0", py: "6", bg: "neutral.white", children: _jsx(FooterButtons, { button1: {
|
|
29
|
+
return (_jsxs(DrawerContent, { bg: "lightBlue.1", children: [_jsx(DrawerHeader, { p: "0", children: _jsx(PanelHeader, { handleCloseButton: onClose, title: t('homeAssistant.title'), icon: IA }) }), _jsxs(DrawerBody, { p: "0", children: [_jsx(HomeAssistantPanelStep, { currentStep: currentStep }), children, isAppliances && (_jsx(ApplianceSteps, { onClick: onApplianceClick, addedAppliances: addedAppliances })), _jsxs(Stack, { spacing: "base", p: "base", children: [_jsx(Text, { fontFamily: "secondary", fontSize: "sm", children: text }), _jsx(FormProvider, Object.assign({}, form, { children: _jsx(SimpleDynamicForm, { fields: currentForm }) }))] })] }), _jsx(DrawerFooter, { px: "0", py: "6", bg: "neutral.white", children: _jsx(FooterButtons, { button1: {
|
|
17
30
|
buttonStyle: 'secondaryFooter',
|
|
18
31
|
label: t('buttons.back'),
|
|
19
32
|
onClick: onBack,
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
11
|
import { Box, DrawerBody, DrawerContent, DrawerHeader, Flex, Stack, } from '@chakra-ui/react';
|
|
12
|
-
import { HomeHeader, HomeCardWithRecipent, AddFolder, EditAccountType, FolderSharing, RightPanel, HomeBoardTour, RoomsMenu, ContactsContent, AppBar, BarDivider, ContactList, PeopleConnected, StorageUsed, TourButton, Trash, TutorialsButton, FolderTypeSelection, DisplayFiles, DisplayOptions, FilesUploader, FolderDetailBody, FolderDetailContent, FolderDetailFooter, FolderDetailHeader, FolderInfo, SharedAccounts, ReceiptAutofiler, HomeBoardGrid, ShortPartnerTile, ValueMonitor, TrendingValue, ReceiptsFiled, PropertyTaxes, AddHomeItem, SendCommunication, PartnerCatalogPanel, DynamicForm, PanelHeader, EditHomePanel, HomeCard, EditHomeFooter, HomeAssistant, HomeAssistantPanel, } from '..';
|
|
12
|
+
import { HomeHeader, HomeCardWithRecipent, AddFolder, EditAccountType, FolderSharing, RightPanel, HomeBoardTour, RoomsMenu, ContactsContent, AppBar, BarDivider, ContactList, PeopleConnected, StorageUsed, TourButton, Trash, TutorialsButton, FolderTypeSelection, DisplayFiles, DisplayOptions, FilesUploader, FolderDetailBody, FolderDetailContent, FolderDetailFooter, FolderDetailHeader, FolderInfo, SharedAccounts, ReceiptAutofiler, HomeBoardGrid, ShortPartnerTile, ValueMonitor, TrendingValue, ReceiptsFiled, PropertyTaxes, AddHomeItem, SendCommunication, PartnerCatalogPanel, DynamicForm, PanelHeader, EditHomePanel, HomeCard, EditHomeFooter, HomeAssistant, HomeAssistantPanel, HomeMonitor, HomefileMonitoring, Notifications, HomeMonitorSteps, } from '..';
|
|
13
13
|
import { HomeCards, recipientsDb, FoldersDB, selectOptions, RoomsList, RoomsToAdd, } from '../../helpers';
|
|
14
14
|
import { ContactsMock, DisplayFilesMock, formFieldsMock, homeBoardRecorsMock, lineChartData, menuMock, partnerCatalogMock, sharedAccountsMock, socialLinksMock2, taxesMock, userMock, videoMock, homeAssitantStep1FormMock, homeAssitantStep2FormMock, homeAssitantStep3FormMock, homeAssitantStep4FormMock, homeAssitantStep5FormMock, homeAssitantStep6FormMock, } from '../../mocks';
|
|
15
15
|
import { useHomeBoard, useWindowDimensions } from '../../hooks';
|
|
@@ -51,7 +51,7 @@ export const HomeBoard = () => {
|
|
|
51
51
|
HomeAssistant: (_jsx(HomeAssistantPanel, { currentStep: homeAssistantCurrentStep, currentForm: currentHomeAssistantForm, onNext: handleHomeAssistantFormChange, onBack: handleHomeAssistantBack, onApplianceClick: () => null, onClose: onRightClose, onSave: () => { }, backDisabled: false, nextDisabled: false })),
|
|
52
52
|
};
|
|
53
53
|
const panelSize = currentComponent === 'PartnerCatalog' ? 'lg' : 'md';
|
|
54
|
-
return (_jsxs(Box, { overflowX: "hidden", children: [_jsx(RightPanel, { overlay: showOverlay, isOpen: isRightOpen, onClose: onRightClose, size: panelSize, children: rightPanelComponents[currentComponent] }), _jsxs(Flex, { w: "full", minH: "100dvh", children: [_jsx(RoomsMenu, { activeRoom: "homeboard", handleAddRoom: (id) => __awaiter(void 0, void 0, void 0, function* () { return console.log(id); }), handleClick: () => null, handleHomeClick: () => null, rooms: RoomsList, roomsToAdd: RoomsToAdd }), _jsxs(Box, { w: "full", children: [_jsx(AppBarComponent, { setActiveTour: setActiveTour }), _jsxs(Stack, { spacing: "base", p: "base", children: [_jsx(HomeHeader, { buttonLabel: "Partner catalog", onBack: () => null, homeName: homeName, onAdd: () => null }), _jsxs(HomeBoardGrid, { children: [_jsx(HomeCardWithRecipent, { address: HomeCards[0].address, handleEdit: handleEditHomeClick, handleDeleteAccountType: (email) => email, handleSubmitAccountType: (form) => form, _id: HomeCards[0]._id, image: HomeCards[0].image, loading: false, name: HomeCards[0].name, menu: menuMock, addImage: () => null, recipients: recipientsDb, records: homeBoardRecorsMock }), _jsx(HomeAssistant, { currentPanel: homeAssistantCurrentStep, currentStep: 6, onStepClick: handleHomeAssistantClick }), _jsx(PropertyTaxes, { estimatedTaxValue: 1000, menuItems: menuMock, taxes: taxesMock, title: "Travis County Property Taxes" }), _jsxs(Stack, { spacing: "base", children: [_jsx(ReceiptAutofiler, { onClick: () => null, totalReceipts: 36, totalTitle: "Receipts Received", forwardTo: "reciepts@homefile.cloud", onFilter: () => null, children: _jsx(ReceiptsFiled, { incidentalItemsNumber: 0, incidentalSpent: 0, inventoryItemsNumber: 0, inventorySpent: 0, total: 0 }) }), _jsx(ValueMonitor, { menuItems: menuMock, balance: "+3%", totalValue: 323421, year: "2023", yearValue: 5684 })] }), _jsx(ShortPartnerTile, { _id: "1", buttonText: "Contact Audrey Scheck", description: "Full-service design firm focusing on residential remodels, furnishing, and styling.", onClick: () => null, socialLinks: socialLinksMock2, logo: "https://static.wixstatic.com/media/258105_8e04439070694f278e4787a310ea9f4b~mv2.png", partnerName: "Audrey Scheck", websiteUrl: "" }), _jsx(TrendingValue, { chartData: lineChartData, marketValue: 894000, menuItems: menuMock, mortgageBalance: 220532, purchasePrice: 220532, roi: "+234%" }), _jsx(ShortPartnerTile, { _id: "2", buttonText: "Contact Audrey Scheck", description: "Full-service design firm focusing on residential remodels, furnishing, and styling.", onClick: () => null, socialLinks: socialLinksMock2, logo: "https://static.wixstatic.com/media/258105_8e04439070694f278e4787a310ea9f4b~mv2.png", partnerName: "Audrey Scheck", websiteUrl: "" }), _jsx(FolderSharing, { folders: FoldersDB, handleAddNewFolder: handleNewFolder, handleFolderClick: handleFolderClick, handleSelect: () => null, initialSelectItem: selectOptions[0], menuItems: menuMock, selectItems: selectOptions }), _jsxs(Stack, { spacing: "base", children: [_jsx(AddHomeItem, { handleClick: () => null }), _jsx(SendCommunication, { documentList: [] })] }), _jsx(ShortPartnerTile, { _id: "3", buttonText: "Contact Audrey Scheck", description: "Full-service design firm focusing on residential remodels, furnishing, and styling.", onClick: () => null, socialLinks: socialLinksMock2, logo: "https://static.wixstatic.com/media/258105_8e04439070694f278e4787a310ea9f4b~mv2.png", partnerName: "Audrey Scheck", websiteUrl: "" })] })] })] })] }), _jsx(HomeBoardTour, { currentStep: currentStep, handleClose: handleClose, handleStep: handleStep, meetStepUrl: videoMock, isActive: activeTour })] }));
|
|
54
|
+
return (_jsxs(Box, { overflowX: "hidden", children: [_jsx(RightPanel, { overlay: showOverlay, isOpen: isRightOpen, onClose: onRightClose, size: panelSize, children: rightPanelComponents[currentComponent] }), _jsxs(Flex, { w: "full", minH: "100dvh", children: [_jsx(RoomsMenu, { activeRoom: "homeboard", handleAddRoom: (id) => __awaiter(void 0, void 0, void 0, function* () { return console.log(id); }), handleClick: () => null, handleHomeClick: () => null, rooms: RoomsList, roomsToAdd: RoomsToAdd }), _jsxs(Box, { w: "full", children: [_jsx(AppBarComponent, { setActiveTour: setActiveTour }), _jsxs(Stack, { spacing: "base", p: "base", children: [_jsx(HomeHeader, { buttonLabel: "Partner catalog", onBack: () => null, homeName: homeName, onAdd: () => null }), _jsxs(HomeBoardGrid, { children: [_jsx(HomeCardWithRecipent, { address: HomeCards[0].address, handleEdit: handleEditHomeClick, handleDeleteAccountType: (email) => email, handleSubmitAccountType: (form) => form, _id: HomeCards[0]._id, image: HomeCards[0].image, loading: false, name: HomeCards[0].name, menu: menuMock, addImage: () => null, recipients: recipientsDb, records: homeBoardRecorsMock }), _jsx(HomeAssistant, { currentPanel: homeAssistantCurrentStep, currentStep: 6, onStepClick: handleHomeAssistantClick }), _jsx(PropertyTaxes, { estimatedTaxValue: 1000, menuItems: menuMock, taxes: taxesMock, title: "Travis County Property Taxes" }), _jsx(HomeMonitor, { children: _jsxs(Stack, { spacing: "base", children: [_jsxs(Flex, { gap: "base", children: [_jsx(HomefileMonitoring, {}), _jsx(Notifications, { date: "10-10-24", local: "TX - Houston" })] }), _jsx(HomeMonitorSteps, { menuItems: menuMock, stepsWithAlerts: [], onStepClick: handleHomeAssistantClick })] }) }), _jsxs(Stack, { spacing: "base", children: [_jsx(ReceiptAutofiler, { onClick: () => null, totalReceipts: 36, totalTitle: "Receipts Received", forwardTo: "reciepts@homefile.cloud", onFilter: () => null, children: _jsx(ReceiptsFiled, { incidentalItemsNumber: 0, incidentalSpent: 0, inventoryItemsNumber: 0, inventorySpent: 0, total: 0 }) }), _jsx(ValueMonitor, { menuItems: menuMock, balance: "+3%", totalValue: 323421, year: "2023", yearValue: 5684 })] }), _jsx(ShortPartnerTile, { _id: "1", buttonText: "Contact Audrey Scheck", description: "Full-service design firm focusing on residential remodels, furnishing, and styling.", onClick: () => null, socialLinks: socialLinksMock2, logo: "https://static.wixstatic.com/media/258105_8e04439070694f278e4787a310ea9f4b~mv2.png", partnerName: "Audrey Scheck", websiteUrl: "" }), _jsx(TrendingValue, { chartData: lineChartData, marketValue: 894000, menuItems: menuMock, mortgageBalance: 220532, purchasePrice: 220532, roi: "+234%" }), _jsx(ShortPartnerTile, { _id: "2", buttonText: "Contact Audrey Scheck", description: "Full-service design firm focusing on residential remodels, furnishing, and styling.", onClick: () => null, socialLinks: socialLinksMock2, logo: "https://static.wixstatic.com/media/258105_8e04439070694f278e4787a310ea9f4b~mv2.png", partnerName: "Audrey Scheck", websiteUrl: "" }), _jsx(FolderSharing, { folders: FoldersDB, handleAddNewFolder: handleNewFolder, handleFolderClick: handleFolderClick, handleSelect: () => null, initialSelectItem: selectOptions[0], menuItems: menuMock, selectItems: selectOptions }), _jsxs(Stack, { spacing: "base", children: [_jsx(AddHomeItem, { handleClick: () => null }), _jsx(SendCommunication, { documentList: [] })] }), _jsx(ShortPartnerTile, { _id: "3", buttonText: "Contact Audrey Scheck", description: "Full-service design firm focusing on residential remodels, furnishing, and styling.", onClick: () => null, socialLinks: socialLinksMock2, logo: "https://static.wixstatic.com/media/258105_8e04439070694f278e4787a310ea9f4b~mv2.png", partnerName: "Audrey Scheck", websiteUrl: "" })] })] })] })] }), _jsx(HomeBoardTour, { currentStep: currentStep, handleClose: handleClose, handleStep: handleStep, meetStepUrl: videoMock, isActive: activeTour })] }));
|
|
55
55
|
};
|
|
56
56
|
export const AppBarComponent = ({ setActiveTour = (value) => { } }) => {
|
|
57
57
|
const handleTour = () => {
|
|
@@ -16,5 +16,5 @@ export const SelectButton = ({ height = 'sm', isDisabled, variant = 'primary', w
|
|
|
16
16
|
return (_jsx(MenuButton, Object.assign({ disabled: isDisabled }, triggerVariants[variant], { _disabled: {
|
|
17
17
|
bg: 'lightBlue.1',
|
|
18
18
|
cursor: 'not-allowed',
|
|
19
|
-
}, children: _jsxs(Flex, { align: "center", gap: "4", justify: "space-between", children: [_jsx(Text, Object.assign({}, textVariants[variant], { children: selectedValue })), _jsx(ChevronDown, Object.assign({}, iconVariants[variant]))] }) })));
|
|
19
|
+
}, children: _jsxs(Flex, { align: "center", gap: "4", justify: "space-between", children: [_jsx(Text, Object.assign({}, textVariants[variant], { children: selectedValue })), _jsx(Flex, { flexShrink: 0, children: _jsx(ChevronDown, Object.assign({}, iconVariants[variant])) })] }) })));
|
|
20
20
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { IconMenuI } from '../../interfaces';
|
|
2
|
-
export declare const IconMenu: <T extends unknown>({ disabled, icon, itemForm, menuItems, variant, width, }: IconMenuI<T>) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const IconMenu: <T extends unknown>({ disabled, icon, itemForm, menuItems, onClick, variant, width, zIndex, }: IconMenuI<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { MenuButton, IconButton, Menu, MenuItem, MenuList, } from '@chakra-ui/react';
|
|
3
3
|
import { Overlay } from '..';
|
|
4
|
-
export const IconMenu = ({ disabled = false, icon, itemForm, menuItems, variant = 'menuIcon', width = 'fit-content', }) => {
|
|
5
|
-
return (_jsx(Menu, { isLazy: true, children: ({ isOpen }) => (_jsxs(_Fragment, { children: [_jsx(Overlay, { bg: "overlay", showOverlay: isOpen, position: "fixed", zIndex:
|
|
4
|
+
export const IconMenu = ({ disabled = false, icon, itemForm, menuItems, onClick, variant = 'menuIcon', width = 'fit-content', zIndex, }) => {
|
|
5
|
+
return (_jsx(Menu, { isLazy: true, children: ({ isOpen }) => (_jsxs(_Fragment, { children: [_jsx(Overlay, { bg: "overlay", showOverlay: isOpen, position: "fixed", zIndex: zIndex }), _jsx(MenuButton, { as: IconButton, "aria-label": "Options", icon: icon, variant: variant, w: width, disabled: disabled, marginTop: "0 !important", onClick: onClick }), _jsx(MenuList, { zIndex: "5", children: menuItems === null || menuItems === void 0 ? void 0 : menuItems.map(({ handleClick, label }) => (_jsx(MenuItem, { onClick: () => handleClick(itemForm), _hover: {
|
|
6
6
|
bg: 'lightGreen.1',
|
|
7
7
|
}, _focus: {
|
|
8
8
|
bg: 'lightGreen.1',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FolderFileI, MenuItemI, PartnerFooterI, TileCtaI } from '../..';
|
|
2
|
-
type KindTypes = 'checkbox' | 'currency' | 'date' | 'email' | 'file' | 'grid' | 'group' | 'number' | 'radio' | 'rating' | 'select' | 'string' | 'switch' | 'telephone' | 'text' | 'textarea' | 'default' | UIKindTypes;
|
|
2
|
+
type KindTypes = 'checkbox' | 'currency' | 'date' | 'email' | 'file' | 'grid' | 'group' | 'hidden' | 'number' | 'radio' | 'rating' | 'select' | 'string' | 'switch' | 'telephone' | 'text' | 'textarea' | 'default' | UIKindTypes;
|
|
3
3
|
type UIKindTypes = 'tile-body' | 'tile-body-logo' | 'tile-body-header' | 'tile-body-section' | 'tile-body-section-grid' | 'tile-form' | 'tile-body-action' | 'vertical-icon' | 'primary-cta' | 'secondary-cta';
|
|
4
4
|
export type IconTypes = 'barcode' | 'battery' | 'billing' | 'book' | 'calc' | 'calendar' | 'check' | 'co2' | 'date' | 'default' | 'detector' | 'electricity' | 'goldbars' | 'heart' | 'image' | 'notes' | 'palette' | 'people' | 'price' | 'rating' | 'receipt' | 'registry' | 'sprinkler' | 'tools' | 'wind' | '68' | 'calendar2' | 'water' | 'calendar-drop' | 'umbrella' | 'heater' | 'roof' | 'foundation' | 'solar-panel' | 'pool' | 'drop' | 'mobile-drop' | 'light' | 'plate' | 'house' | 'target' | 'title' | 'company' | UIIconTypes;
|
|
5
5
|
export type UIIconTypes = 'sh-pressure' | 'sh-window' | 'sh-roof' | 'sh-lights' | 'sh-gutter' | 'sh-home';
|
|
@@ -2,5 +2,4 @@ export interface ApplianceStepsI {
|
|
|
2
2
|
addedAppliances?: AppliancesType[];
|
|
3
3
|
onClick: (selectedSteps: string[]) => void;
|
|
4
4
|
}
|
|
5
|
-
type AppliancesType = 'fridge' | 'freezer' | 'washer' | 'dryer' | 'dish-washer' | 'cook-top' | 'oven' | 'range' | 'hood' | 'microwave';
|
|
6
|
-
export {};
|
|
5
|
+
export type AppliancesType = 'fridge' | 'freezer' | 'washer' | 'dryer' | 'dish-washer' | 'cook-top' | 'oven' | 'range' | 'hood' | 'microwave';
|
|
@@ -158,6 +158,12 @@ export const homeAssitantStep3FormMock = [
|
|
|
158
158
|
},
|
|
159
159
|
];
|
|
160
160
|
export const homeAssitantStep4FormMock = [
|
|
161
|
+
{
|
|
162
|
+
id: faker.database.mongodbObjectId(),
|
|
163
|
+
name: 'Appliances List',
|
|
164
|
+
value: ['fridge', 'dish-washer', 'hood', 'oven'],
|
|
165
|
+
type: 'hidden',
|
|
166
|
+
},
|
|
161
167
|
{
|
|
162
168
|
id: faker.database.mongodbObjectId(),
|
|
163
169
|
name: 'Heater',
|
package/package.json
CHANGED
package/src/assets/images/ia.svg
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="
|
|
2
|
-
<g id="
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<line id="Line_3402" data-name="Line 3402" x2="2.485" transform="translate(14.052 14.039)" fill="none" stroke="#fff" stroke-width="2"/>
|
|
15
|
-
<path id="Path_15024" data-name="Path 15024" d="M-112.806,1761.029a2.621,2.621,0,0,0,2.622,2.231,2.666,2.666,0,0,0,2.618-2.231" transform="translate(122.294 -1742.01)" fill="none" stroke="#fff" stroke-linecap="round" stroke-width="1"/>
|
|
16
|
-
</g>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="30.202" height="30.2" viewBox="0 0 30.202 30.2">
|
|
2
|
+
<g id="Group_21564" data-name="Group 21564" transform="translate(10417.861 8318.462)">
|
|
3
|
+
<circle id="Ellipse_1093" data-name="Ellipse 1093" cx="2.157" cy="2.157" r="2.157" transform="translate(-10404.917 -8318.462)" fill="#bcd1d8"/>
|
|
4
|
+
<line id="Line_3403" data-name="Line 3403" y2="2.725" transform="translate(-10402.761 -8314.146)" fill="none" stroke="#bcd1d8" stroke-width="1"/>
|
|
5
|
+
<rect id="Rectangle_24537" data-name="Rectangle 24537" width="10.786" height="4.314" rx="2.157" transform="translate(-10408.155 -8311.99)" fill="#00a1aa"/>
|
|
6
|
+
<circle id="Ellipse_1090" data-name="Ellipse 1090" cx="3.236" cy="3.236" r="3.236" transform="translate(-10417.861 -8304.439)" fill="#00a1aa"/>
|
|
7
|
+
<ellipse id="Ellipse_1092" data-name="Ellipse 1092" cx="2.696" cy="3.236" rx="2.696" ry="3.236" transform="translate(-10393.053 -8304.439)" fill="#00a1aa"/>
|
|
8
|
+
<circle id="Ellipse_1091" data-name="Ellipse 1091" cx="3.236" cy="3.236" r="3.236" transform="translate(-10397.368 -8304.439)" fill="#00a1aa"/>
|
|
9
|
+
<rect id="Rectangle_24536" data-name="Rectangle 24536" width="23.729" height="21.572" rx="3" transform="translate(-10414.626 -8309.834)" fill="#02c0b7"/>
|
|
10
|
+
<rect id="Rectangle_24476" data-name="Rectangle 24476" width="15.1" height="6.472" rx="3" transform="translate(-10410.311 -8304.439)" fill="#324459"/>
|
|
11
|
+
<line id="Line_3401" data-name="Line 3401" x2="2.725" transform="translate(-10407.915 -8300.908)" fill="none" stroke="#fff" stroke-width="2"/>
|
|
12
|
+
<line id="Line_3402" data-name="Line 3402" x2="2.725" transform="translate(-10399.874 -8300.908)" fill="none" stroke="#fff" stroke-width="2"/>
|
|
13
|
+
<path id="Path_15024" data-name="Path 15024" d="M-112.806,1761.029a2.874,2.874,0,0,0,2.876,2.446,2.924,2.924,0,0,0,2.871-2.446" transform="translate(-10292.654 -10055.396)" fill="none" stroke="#fff" stroke-linecap="round" stroke-width="1"/>
|
|
17
14
|
</g>
|
|
18
15
|
</svg>
|
|
16
|
+
|
|
17
|
+
|
|
@@ -399,8 +399,8 @@
|
|
|
399
399
|
}
|
|
400
400
|
},
|
|
401
401
|
"details": "Provide details about your home’s",
|
|
402
|
-
"homeMonitor": "
|
|
403
|
-
"homeMonitoring": "
|
|
402
|
+
"homeMonitor": "Homie",
|
|
403
|
+
"homeMonitoring": "Homie is monitoring your home.",
|
|
404
404
|
"monitorAlerts": {
|
|
405
405
|
"collapse": "Collapse Alert",
|
|
406
406
|
"homeAction": "Home Action",
|
|
@@ -418,10 +418,11 @@
|
|
|
418
418
|
"smoke": "Smoke & CO2 detectors",
|
|
419
419
|
"structure": "Structure"
|
|
420
420
|
},
|
|
421
|
-
"title": "
|
|
421
|
+
"title": "Set Up Homie",
|
|
422
422
|
"tutorialButton": "Start Quick Setup",
|
|
423
|
-
"tutorialDescription": "
|
|
424
|
-
"tutorialTitle": "Let’s quickly
|
|
423
|
+
"tutorialDescription": "Homie helps you manage every aspect of your home. We've added a short overview to help you learn more about it.",
|
|
424
|
+
"tutorialTitle": "Let’s quickly set up Homie, your friendly AI home assistant.",
|
|
425
|
+
"tutorialNote": "Just a few set-up questions to help Homie get going."
|
|
425
426
|
},
|
|
426
427
|
"homeBoard": {
|
|
427
428
|
"addRecords": "Add Property Records",
|
|
@@ -603,7 +604,7 @@
|
|
|
603
604
|
"newPassword": {
|
|
604
605
|
"confirm": "Confirm Password",
|
|
605
606
|
"create": "Create Password",
|
|
606
|
-
"title": "
|
|
607
|
+
"title": "Please enter your new password."
|
|
607
608
|
},
|
|
608
609
|
"partner": {
|
|
609
610
|
"aphw": {
|
|
@@ -743,7 +744,7 @@
|
|
|
743
744
|
"title": "Property Taxes"
|
|
744
745
|
},
|
|
745
746
|
"trending": {
|
|
746
|
-
"addMortgage": "
|
|
747
|
+
"addMortgage": "Mortgage Info",
|
|
747
748
|
"estimated": "Estimated Market Value",
|
|
748
749
|
"mortgage": "Mortgage Balance*",
|
|
749
750
|
"public": "*Estimated from Public Data",
|
|
@@ -48,7 +48,6 @@ export const HomeAssistantWrapper = ({
|
|
|
48
48
|
h="80px"
|
|
49
49
|
top="80px"
|
|
50
50
|
animation={`${moveRightToLeftWithFade} 400s linear infinite`}
|
|
51
|
-
zIndex="1"
|
|
52
51
|
/>
|
|
53
52
|
<Image
|
|
54
53
|
src={Cloud2}
|
|
@@ -57,7 +56,6 @@ export const HomeAssistantWrapper = ({
|
|
|
57
56
|
h="112px"
|
|
58
57
|
top="150px"
|
|
59
58
|
animation={`${moveRightToLeft} 200s linear infinite`}
|
|
60
|
-
zIndex="1"
|
|
61
59
|
/>
|
|
62
60
|
<Image
|
|
63
61
|
src={Cloud3}
|
|
@@ -66,7 +64,6 @@ export const HomeAssistantWrapper = ({
|
|
|
66
64
|
h="160px"
|
|
67
65
|
top="200px"
|
|
68
66
|
animation={`${moveRightToLeft} 130s linear infinite`}
|
|
69
|
-
zIndex="1"
|
|
70
67
|
/>
|
|
71
68
|
{showAirplane && (
|
|
72
69
|
<Image
|
|
@@ -76,7 +73,6 @@ export const HomeAssistantWrapper = ({
|
|
|
76
73
|
h="40px"
|
|
77
74
|
top="85px"
|
|
78
75
|
animation={`${moveLeftToRightAirplane} 500s cubic-bezier(1, 1, 1, 500) infinite`}
|
|
79
|
-
zIndex="1"
|
|
80
76
|
/>
|
|
81
77
|
)}
|
|
82
78
|
<Image
|
|
@@ -87,7 +83,6 @@ export const HomeAssistantWrapper = ({
|
|
|
87
83
|
right="2"
|
|
88
84
|
w="auto"
|
|
89
85
|
h="70px"
|
|
90
|
-
zIndex="1"
|
|
91
86
|
/>
|
|
92
87
|
</Box>
|
|
93
88
|
</TileTooltip>
|
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
import { Box, Center, Image, Stack, Text } from '@chakra-ui/react'
|
|
2
2
|
import { HomeMonitorButtonI } from '@/interfaces'
|
|
3
3
|
import { getIconAltText } from '@/utils'
|
|
4
|
-
import { IconMenu, MoreHorizontal } from '@/components'
|
|
5
4
|
|
|
6
5
|
export const HomeMonitorButton = ({
|
|
7
6
|
currentStep,
|
|
8
|
-
menuItems,
|
|
9
7
|
onStepClick,
|
|
10
8
|
status = 'ok',
|
|
11
9
|
step,
|
|
12
10
|
}: HomeMonitorButtonI) => {
|
|
11
|
+
const buttonId = `homeMonitorButton-${currentStep}`
|
|
13
12
|
const iconAltText = getIconAltText(step.icon)
|
|
14
|
-
const handleClick = () => {
|
|
15
|
-
if (status !== 'ok') onStepClick(currentStep)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const isDisabled = Number(menuItems.length) === 0
|
|
19
13
|
|
|
20
14
|
return (
|
|
21
|
-
<Box position="relative">
|
|
15
|
+
<Box position="relative" id={buttonId}>
|
|
22
16
|
<Box
|
|
23
17
|
position="relative"
|
|
24
18
|
bg="neutral.white"
|
|
@@ -47,7 +41,7 @@ export const HomeMonitorButton = ({
|
|
|
47
41
|
h="96px"
|
|
48
42
|
py="base"
|
|
49
43
|
{...setStyles(status)}
|
|
50
|
-
onClick={
|
|
44
|
+
onClick={() => onStepClick(currentStep)}
|
|
51
45
|
>
|
|
52
46
|
<Center h="60%" marginTop="2">
|
|
53
47
|
<Image src={step.icon} alt={iconAltText} w="auto" h="28px" />
|
|
@@ -64,14 +58,6 @@ export const HomeMonitorButton = ({
|
|
|
64
58
|
</Center>
|
|
65
59
|
</Stack>
|
|
66
60
|
</Box>
|
|
67
|
-
<Box position="absolute" top="-2px" right="4px" zIndex="4">
|
|
68
|
-
<IconMenu
|
|
69
|
-
icon={<MoreHorizontal size={26} />}
|
|
70
|
-
itemForm={currentStep}
|
|
71
|
-
menuItems={menuItems}
|
|
72
|
-
disabled={isDisabled}
|
|
73
|
-
/>
|
|
74
|
-
</Box>
|
|
75
61
|
</Box>
|
|
76
62
|
)
|
|
77
63
|
}
|
|
@@ -1,24 +1,54 @@
|
|
|
1
1
|
import { Box, Flex } from '@chakra-ui/react'
|
|
2
2
|
import { HomeMonitortStepsI } from '@/interfaces'
|
|
3
|
-
import { HomeMonitorButton } from '@/components'
|
|
3
|
+
import { HomeMonitorButton, IconMenu, MoreHorizontal } from '@/components'
|
|
4
4
|
import { homeAssistantSteps } from '@/helpers'
|
|
5
|
+
import { useComponentStyles } from '@/hooks'
|
|
6
|
+
import { useState } from 'react'
|
|
5
7
|
|
|
6
8
|
export const HomeMonitorSteps = ({
|
|
7
|
-
menuItems,
|
|
9
|
+
menuItems = [],
|
|
8
10
|
onStepClick,
|
|
9
11
|
stepsWithAlerts,
|
|
10
12
|
}: HomeMonitortStepsI) => {
|
|
13
|
+
const ids = [
|
|
14
|
+
'homeMonitorButton-1',
|
|
15
|
+
'homeMonitorButton-2',
|
|
16
|
+
'homeMonitorButton-3',
|
|
17
|
+
'homeMonitorButton-4',
|
|
18
|
+
'homeMonitorButton-5',
|
|
19
|
+
'homeMonitorButton-6',
|
|
20
|
+
'menuItems',
|
|
21
|
+
]
|
|
22
|
+
const [selectedId, setSelectedId] = useState<string>('')
|
|
23
|
+
const isDisabled = menuItems.length === 0
|
|
24
|
+
|
|
25
|
+
useComponentStyles({ ids, selectedId, zIndex: '2' })
|
|
26
|
+
const handleStepClick = (step: number) => {
|
|
27
|
+
onStepClick(step)
|
|
28
|
+
setSelectedId(`homeMonitorButton-${step}`)
|
|
29
|
+
}
|
|
11
30
|
return (
|
|
12
31
|
<Flex gap="base">
|
|
13
32
|
{homeAssistantSteps.map((step, index) => (
|
|
14
|
-
<Box key={step
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
33
|
+
<Box key={step?.title} position="relative">
|
|
34
|
+
<Box flex="auto">
|
|
35
|
+
<HomeMonitorButton
|
|
36
|
+
currentStep={index + 1}
|
|
37
|
+
onStepClick={handleStepClick}
|
|
38
|
+
status={getStatus(index + 1, stepsWithAlerts)}
|
|
39
|
+
step={step}
|
|
40
|
+
/>
|
|
41
|
+
<Box position="absolute" top="-2px" right="4px" zIndex="1400">
|
|
42
|
+
<IconMenu
|
|
43
|
+
zIndex="2"
|
|
44
|
+
icon={<MoreHorizontal size={26} />}
|
|
45
|
+
itemForm={index + 1}
|
|
46
|
+
menuItems={menuItems}
|
|
47
|
+
disabled={isDisabled}
|
|
48
|
+
onClick={() => setSelectedId('menuItems')}
|
|
49
|
+
/>
|
|
50
|
+
</Box>
|
|
51
|
+
</Box>
|
|
22
52
|
</Box>
|
|
23
53
|
))}
|
|
24
54
|
</Flex>
|
|
@@ -14,13 +14,18 @@ import {
|
|
|
14
14
|
Microwave,
|
|
15
15
|
Range,
|
|
16
16
|
} from '@/assets/images'
|
|
17
|
-
import { useState } from 'react'
|
|
17
|
+
import { useState, useEffect } from 'react'
|
|
18
18
|
|
|
19
19
|
export const ApplianceSteps = ({
|
|
20
20
|
addedAppliances = [],
|
|
21
21
|
onClick,
|
|
22
22
|
}: ApplianceStepsI) => {
|
|
23
23
|
const [appliances, setAppliances] = useState<string[]>(addedAppliances)
|
|
24
|
+
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
setAppliances(addedAppliances)
|
|
27
|
+
}, [addedAppliances])
|
|
28
|
+
|
|
24
29
|
const handleClick = (id: string) => {
|
|
25
30
|
if (appliances.includes(id)) {
|
|
26
31
|
const newAppliances = appliances.filter((appliance) => appliance !== id)
|
|
@@ -31,6 +36,7 @@ export const ApplianceSteps = ({
|
|
|
31
36
|
setAppliances([...appliances, id])
|
|
32
37
|
onClick([...appliances, id])
|
|
33
38
|
}
|
|
39
|
+
|
|
34
40
|
return (
|
|
35
41
|
<Stack spacing="base" bg="lightBlue.2" p="base">
|
|
36
42
|
<Text fontFamily="secondary" fontSize="sm">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react'
|
|
1
|
+
import { PropsWithChildren, useState, useEffect } from 'react'
|
|
2
2
|
import { FormProvider } from 'react-hook-form'
|
|
3
3
|
import { t } from 'i18next'
|
|
4
4
|
import {
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
HomeAssistantPanelStep,
|
|
18
18
|
PanelHeader,
|
|
19
19
|
} from '@/components'
|
|
20
|
-
import { HomeAssistantPanelI } from '@/interfaces'
|
|
20
|
+
import { AppliancesType, HomeAssistantPanelI } from '@/interfaces'
|
|
21
21
|
import { homeAssistantSteps } from '@/helpers'
|
|
22
22
|
import { useSimpleDynamicForm } from '@/hooks'
|
|
23
23
|
|
|
@@ -33,9 +33,22 @@ export const HomeAssistantPanel = ({
|
|
|
33
33
|
backDisabled,
|
|
34
34
|
nextDisabled,
|
|
35
35
|
}: PropsWithChildren<HomeAssistantPanelI>) => {
|
|
36
|
+
const [addedAppliances, updateAddedAppliances] = useState<AppliancesType[]>([])
|
|
36
37
|
const { title } = homeAssistantSteps[currentStep - 1]
|
|
37
38
|
const text = `${t('homeAssistant.details')} ${title.toLowerCase()}:`
|
|
38
39
|
const isAppliances = currentStep === 4
|
|
40
|
+
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (isAppliances) {
|
|
43
|
+
const targetAppliances = currentForm.find(
|
|
44
|
+
(field) =>
|
|
45
|
+
field.name?.toLocaleLowerCase() === 'appliances list' &&
|
|
46
|
+
field.type === 'hidden'
|
|
47
|
+
)?.value as AppliancesType[]
|
|
48
|
+
updateAddedAppliances(targetAppliances)
|
|
49
|
+
}
|
|
50
|
+
}, [currentForm, isAppliances])
|
|
51
|
+
|
|
39
52
|
const { form, updatedFields } = useSimpleDynamicForm({
|
|
40
53
|
fields: currentForm,
|
|
41
54
|
})
|
|
@@ -52,7 +65,12 @@ export const HomeAssistantPanel = ({
|
|
|
52
65
|
<DrawerBody p="0">
|
|
53
66
|
<HomeAssistantPanelStep currentStep={currentStep} />
|
|
54
67
|
{children}
|
|
55
|
-
{isAppliances &&
|
|
68
|
+
{isAppliances && (
|
|
69
|
+
<ApplianceSteps
|
|
70
|
+
onClick={onApplianceClick}
|
|
71
|
+
addedAppliances={addedAppliances}
|
|
72
|
+
/>
|
|
73
|
+
)}
|
|
56
74
|
<Stack spacing="base" p="base">
|
|
57
75
|
<Text fontFamily="secondary" fontSize="sm">
|
|
58
76
|
{text}
|
|
@@ -51,6 +51,10 @@ import {
|
|
|
51
51
|
EditHomeFooter,
|
|
52
52
|
HomeAssistant,
|
|
53
53
|
HomeAssistantPanel,
|
|
54
|
+
HomeMonitor,
|
|
55
|
+
HomefileMonitoring,
|
|
56
|
+
Notifications,
|
|
57
|
+
HomeMonitorSteps,
|
|
54
58
|
} from '@/components'
|
|
55
59
|
import {
|
|
56
60
|
HomeCards,
|
|
@@ -329,6 +333,20 @@ export const HomeBoard = () => {
|
|
|
329
333
|
taxes={taxesMock}
|
|
330
334
|
title="Travis County Property Taxes"
|
|
331
335
|
/>
|
|
336
|
+
<HomeMonitor>
|
|
337
|
+
<Stack spacing="base">
|
|
338
|
+
<Flex gap="base">
|
|
339
|
+
<HomefileMonitoring />
|
|
340
|
+
<Notifications date="10-10-24" local="TX - Houston" />
|
|
341
|
+
</Flex>
|
|
342
|
+
<HomeMonitorSteps
|
|
343
|
+
menuItems={menuMock}
|
|
344
|
+
stepsWithAlerts={[]}
|
|
345
|
+
onStepClick={handleHomeAssistantClick}
|
|
346
|
+
/>
|
|
347
|
+
</Stack>
|
|
348
|
+
</HomeMonitor>
|
|
349
|
+
|
|
332
350
|
<Stack spacing="base">
|
|
333
351
|
<ReceiptAutofiler
|
|
334
352
|
onClick={() => null}
|
|
@@ -64,7 +64,9 @@ export const SelectButton = ({
|
|
|
64
64
|
>
|
|
65
65
|
<Flex align="center" gap="4" justify="space-between">
|
|
66
66
|
<Text {...textVariants[variant]}>{selectedValue}</Text>
|
|
67
|
-
<
|
|
67
|
+
<Flex flexShrink={0}>
|
|
68
|
+
<ChevronDown {...iconVariants[variant]} />
|
|
69
|
+
</Flex>
|
|
68
70
|
</Flex>
|
|
69
71
|
</MenuButton>
|
|
70
72
|
)
|
|
@@ -13,8 +13,10 @@ export const IconMenu = <T extends unknown>({
|
|
|
13
13
|
icon,
|
|
14
14
|
itemForm,
|
|
15
15
|
menuItems,
|
|
16
|
+
onClick,
|
|
16
17
|
variant = 'menuIcon',
|
|
17
18
|
width = 'fit-content',
|
|
19
|
+
zIndex,
|
|
18
20
|
}: IconMenuI<T>) => {
|
|
19
21
|
return (
|
|
20
22
|
<Menu isLazy>
|
|
@@ -24,7 +26,7 @@ export const IconMenu = <T extends unknown>({
|
|
|
24
26
|
bg="overlay"
|
|
25
27
|
showOverlay={isOpen}
|
|
26
28
|
position="fixed"
|
|
27
|
-
zIndex=
|
|
29
|
+
zIndex={zIndex}
|
|
28
30
|
/>
|
|
29
31
|
<MenuButton
|
|
30
32
|
as={IconButton}
|
|
@@ -34,6 +36,7 @@ export const IconMenu = <T extends unknown>({
|
|
|
34
36
|
w={width}
|
|
35
37
|
disabled={disabled}
|
|
36
38
|
marginTop="0 !important"
|
|
39
|
+
onClick={onClick}
|
|
37
40
|
/>
|
|
38
41
|
<MenuList zIndex="5">
|
|
39
42
|
{menuItems?.map(({ handleClick, label }) => (
|
|
@@ -164,6 +164,12 @@ export const homeAssitantStep3FormMock: ReportI[] = [
|
|
|
164
164
|
]
|
|
165
165
|
|
|
166
166
|
export const homeAssitantStep4FormMock: ReportI[] = [
|
|
167
|
+
{
|
|
168
|
+
id: faker.database.mongodbObjectId(),
|
|
169
|
+
name: 'Appliances List',
|
|
170
|
+
value: ['fridge', 'dish-washer', 'hood', 'oven'],
|
|
171
|
+
type: 'hidden',
|
|
172
|
+
},
|
|
167
173
|
{
|
|
168
174
|
id: faker.database.mongodbObjectId(),
|
|
169
175
|
name: 'Heater',
|