@homefile/components-v2 2.21.2 → 2.22.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.
- package/dist/assets/locales/en/index.json +2 -0
- package/dist/components/homeAssistant/monitorAlerts/BackendAlert.d.ts +1 -1
- package/dist/components/homeAssistant/monitorAlerts/BackendAlert.js +2 -2
- package/dist/components/homeAssistant/monitorAlerts/BackendAlertCard.d.ts +1 -1
- package/dist/components/homeAssistant/monitorAlerts/BackendAlertCard.js +2 -2
- package/dist/components/homeAssistant/monitorAlerts/HomeMonitorPanel.d.ts +2 -0
- package/dist/components/homeAssistant/monitorAlerts/HomeMonitorPanel.js +11 -0
- package/dist/components/homeAssistant/monitorAlerts/index.d.ts +1 -0
- package/dist/components/homeAssistant/monitorAlerts/index.js +1 -0
- package/dist/helpers/forms/dynamicForm.helper.js +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/interfaces/homeAssistant/BackendAlert.interface.d.ts +3 -1
- package/dist/interfaces/homeAssistant/BackendAlertCard.interface.d.ts +2 -0
- package/dist/interfaces/homeAssistant/HomeMonitorPanel.interface.d.ts +5 -0
- package/dist/interfaces/homeAssistant/HomeMonitorPanel.interface.js +1 -0
- package/dist/interfaces/homeAssistant/index.d.ts +1 -0
- package/dist/interfaces/homeAssistant/index.js +1 -0
- package/dist/mocks/forms/dynamicForm.mock.d.ts +2 -0
- package/dist/mocks/forms/dynamicForm.mock.js +26 -4
- package/dist/stories/homeAssistant/HomeMonitorPanel.stories.d.ts +5 -0
- package/dist/stories/homeAssistant/HomeMonitorPanel.stories.js +41 -0
- package/package.json +1 -1
- package/src/assets/locales/en/index.json +2 -0
- package/src/components/homeAssistant/monitorAlerts/BackendAlert.tsx +9 -1
- package/src/components/homeAssistant/monitorAlerts/BackendAlertCard.tsx +23 -2
- package/src/components/homeAssistant/monitorAlerts/HomeMonitorPanel.tsx +28 -0
- package/src/components/homeAssistant/monitorAlerts/index.ts +1 -0
- package/src/helpers/forms/dynamicForm.helper.ts +2 -0
- package/src/index.ts +1 -0
- package/src/interfaces/homeAssistant/BackendAlert.interface.ts +3 -1
- package/src/interfaces/homeAssistant/BackendAlertCard.interface.ts +2 -0
- package/src/interfaces/homeAssistant/HomeMonitorPanel.interface.ts +6 -0
- package/src/interfaces/homeAssistant/index.ts +1 -0
- package/src/mocks/forms/dynamicForm.mock.ts +30 -4
- package/src/stories/homeAssistant/HomeMonitor.stories.tsx +0 -1
- package/src/stories/homeAssistant/HomeMonitorPanel.stories.tsx +52 -0
|
@@ -414,10 +414,12 @@
|
|
|
414
414
|
},
|
|
415
415
|
"details": "Provide details about your home’s",
|
|
416
416
|
"homeMonitor": "Homie",
|
|
417
|
+
"HomieMessages": "Homie Messages ({{ count }})",
|
|
417
418
|
"homeMonitoring": "I’m learning about your home…",
|
|
418
419
|
"homeMonitoringAlerts": "I have {{ count }} new messages for you.",
|
|
419
420
|
"monitorAlerts": {
|
|
420
421
|
"collapse": "Collapse Alert",
|
|
422
|
+
"completed": "Mark as Completed",
|
|
421
423
|
"homeAction": "Home Action",
|
|
422
424
|
"maintenance": "Maintenance Monitor",
|
|
423
425
|
"protection": "Protection Monitor",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { BackendAlertI } from '../../../interfaces';
|
|
2
|
-
export declare const BackendAlert: ({ category, form, callback }: BackendAlertI) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const BackendAlert: ({ id, category, form, callback, onComplete, }: BackendAlertI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { AlertFields, BackendAlertCard, TabsHeader } from '../..';
|
|
3
3
|
import { getCategoryStyles } from '../../../utils/Alerts.utils';
|
|
4
4
|
import { Divider } from '@chakra-ui/react';
|
|
5
|
-
export const BackendAlert = ({ category, form, callback }) => {
|
|
5
|
+
export const BackendAlert = ({ id, category, form, callback, onComplete, }) => {
|
|
6
6
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
7
7
|
const { headerBg, alertIcon, alertIconBg, alertTitle } = getCategoryStyles(category);
|
|
8
8
|
const alert = form === null || form === void 0 ? void 0 : form.find((item) => item.type === 'alert');
|
|
@@ -15,5 +15,5 @@ export const BackendAlert = ({ category, form, callback }) => {
|
|
|
15
15
|
component: (_jsx(AlertFields, { fields: (_a = tab.children) !== null && _a !== void 0 ? _a : [], callback: callback })),
|
|
16
16
|
});
|
|
17
17
|
})) !== null && _d !== void 0 ? _d : [];
|
|
18
|
-
return (_jsxs(BackendAlertCard, { alertBg: headerBg, alertIcon: alertIcon, alertTitle: alertTitle, bg: alertIconBg, icon: (_e = alert === null || alert === void 0 ? void 0 : alert.icon) !== null && _e !== void 0 ? _e : '', title: (_f = alert === null || alert === void 0 ? void 0 : alert.label) !== null && _f !== void 0 ? _f : '', description: (_g = alert === null || alert === void 0 ? void 0 : alert.description) !== null && _g !== void 0 ? _g : '', children: [_jsx(Divider, {}), hasChildren && !isSingleTab && _jsx(TabsHeader, { tabList: tabs }), hasChildren && isSingleTab && (_jsx(AlertFields, { fields: (_k = (_j = (_h = alert === null || alert === void 0 ? void 0 : alert.children) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.children) !== null && _k !== void 0 ? _k : [], callback: callback }))] }));
|
|
18
|
+
return (_jsxs(BackendAlertCard, { alertBg: headerBg, alertIcon: alertIcon, alertTitle: alertTitle, bg: alertIconBg, icon: (_e = alert === null || alert === void 0 ? void 0 : alert.icon) !== null && _e !== void 0 ? _e : '', title: (_f = alert === null || alert === void 0 ? void 0 : alert.label) !== null && _f !== void 0 ? _f : '', description: (_g = alert === null || alert === void 0 ? void 0 : alert.description) !== null && _g !== void 0 ? _g : '', onComplete: onComplete, id: id, children: [_jsx(Divider, {}), hasChildren && !isSingleTab && _jsx(TabsHeader, { tabList: tabs }), hasChildren && isSingleTab && (_jsx(AlertFields, { fields: (_k = (_j = (_h = alert === null || alert === void 0 ? void 0 : alert.children) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.children) !== null && _k !== void 0 ? _k : [], callback: callback }))] }));
|
|
19
19
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { BackendAlertCardI } from '../../../interfaces';
|
|
3
|
-
export declare const BackendAlertCard: ({ alertBg, alertIcon, alertTitle, children, icon, ...props }: PropsWithChildren<BackendAlertCardI>) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const BackendAlertCard: ({ alertBg, alertIcon, alertTitle, children, icon, id, onComplete, ...props }: PropsWithChildren<BackendAlertCardI>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,7 +16,7 @@ import { AlertHeader, AlertTemplate, AlertTitle } from '../..';
|
|
|
16
16
|
import { Warranty } from '../../../assets/images';
|
|
17
17
|
import { fieldIcons } from '../../../helpers';
|
|
18
18
|
export const BackendAlertCard = (_a) => {
|
|
19
|
-
var { alertBg = 'error.2', alertIcon = Warranty, alertTitle = t('homeAssistant.monitorAlerts.protection'), children, icon = 'warning' } = _a, props = __rest(_a, ["alertBg", "alertIcon", "alertTitle", "children", "icon"]);
|
|
19
|
+
var { alertBg = 'error.2', alertIcon = Warranty, alertTitle = t('homeAssistant.monitorAlerts.protection'), children, icon = 'warning', id, onComplete } = _a, props = __rest(_a, ["alertBg", "alertIcon", "alertTitle", "children", "icon", "id", "onComplete"]);
|
|
20
20
|
const { isOpen, onToggle } = useDisclosure();
|
|
21
|
-
return (_jsxs(Box, { display: "flex", flexDir: "column", bg: "neutral.white", boxShadow: "lg", borderRadius: "lg", overflow: "hidden",
|
|
21
|
+
return (_jsxs(Box, { display: "flex", flexDir: "column", bg: "neutral.white", boxShadow: "lg", borderRadius: "lg", overflow: "hidden", minW: "400px", children: [_jsx(AlertHeader, { bg: alertBg }), _jsx(AlertTitle, { alertIcon: alertIcon, alertTitle: alertTitle }), _jsx(AlertTemplate, Object.assign({}, props, { icon: fieldIcons[icon] })), _jsx(Collapse, { in: isOpen, animateOpacity: true, children: _jsx(Box, { bg: "lightBlue.1", children: children }) }), _jsxs(Flex, { py: "base", bg: "lightBlue.1", justify: id ? 'space-between' : 'end', gap: "4", children: [id && (_jsx(Button, { variant: "unstyled", w: "fit-content", px: "base", fontSize: "sm", color: "blue.3", onClick: () => onComplete === null || onComplete === void 0 ? void 0 : onComplete(id), transition: "color 0.2s", _hover: { color: 'blue.8' }, children: t('homeAssistant.monitorAlerts.completed') })), _jsx(Button, { variant: "leftRounded", w: "fit-content", px: "8", fontSize: "sm", fontWeight: "medium", onClick: onToggle, bg: isOpen ? 'blue.8' : 'blue.2', children: t(`homeAssistant.monitorAlerts.${isOpen ? 'collapse' : 'review'}`) })] })] }));
|
|
22
22
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { t } from 'i18next';
|
|
3
|
+
import { DrawerBody, DrawerHeader, Stack } from '@chakra-ui/react';
|
|
4
|
+
import { IA } from '../../../assets/images';
|
|
5
|
+
import { BackendAlert, PanelHeader } from '../..';
|
|
6
|
+
export const HomeMonitorPanel = ({ onClose, alerts }) => {
|
|
7
|
+
var _a;
|
|
8
|
+
return (_jsx(_Fragment, { children: _jsxs(DrawerHeader, { p: "0", children: [_jsx(PanelHeader, { handleCloseButton: onClose, title: t('homeAssistant.HomieMessages', {
|
|
9
|
+
count: (_a = alerts === null || alerts === void 0 ? void 0 : alerts.length) !== null && _a !== void 0 ? _a : 0,
|
|
10
|
+
}), icon: IA }), _jsx(DrawerBody, { p: "0", children: _jsx(Stack, { spacing: "base", p: "base", children: alerts === null || alerts === void 0 ? void 0 : alerts.map((alert) => (_jsx(BackendAlert, Object.assign({}, alert), alert.id))) }) })] }) }));
|
|
11
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Paint, Receipt, Barcode, GoldenBars, Heart, Rating, Notes, Book, ImgIcon, Registry, ShareWith, Calendar, Contacts, Tools2, Billing, Calc, CheckPen, GenericField, Price, Battery2, Co2, Detector, Electricity, Sprinkler, SixtyEight, DropCalendar, MobileDrop, SolarPanel, Calendar2, Drop, Wind, Foundation, Heater, Light, Plate, Pool2, Closet, Structure, GlassWater, Roof2, Target, CircleFace, Pressure, WindowCleaning, RoofCleaning, HolidayLights, GutterCleaning, HomeCleaning, HouseWashing, PressureWasher, BookOpened, Company2, AADisease, AADressing, AALawn, AAMowing, AAWeed, AApest, FilterSize, Wallet, } from '../../assets/images';
|
|
1
|
+
import { Paint, Receipt, Barcode, GoldenBars, Heart, Rating, Notes, Book, ImgIcon, Registry, ShareWith, Calendar, Contacts, Tools2, Billing, Calc, CheckPen, GenericField, Price, Battery2, Co2, Detector, Electricity, Sprinkler, SixtyEight, DropCalendar, MobileDrop, SolarPanel, Calendar2, Drop, Wind, Foundation, Heater, Light, Plate, Pool2, Closet, Structure, GlassWater, Roof2, Target, CircleFace, Pressure, WindowCleaning, RoofCleaning, HolidayLights, GutterCleaning, HomeCleaning, HouseWashing, PressureWasher, BookOpened, Company2, AADisease, AADressing, AALawn, AAMowing, AAWeed, AApest, FilterSize, Wallet, Fire, } from '../../assets/images';
|
|
2
2
|
export const fieldIcons = {
|
|
3
3
|
barcode: Barcode,
|
|
4
4
|
billing: Billing,
|
|
@@ -32,6 +32,7 @@ export const fieldIcons = {
|
|
|
32
32
|
'solar-panel': SolarPanel,
|
|
33
33
|
calendar2: Calendar2,
|
|
34
34
|
drop: Drop,
|
|
35
|
+
fire: Fire,
|
|
35
36
|
wind: Wind,
|
|
36
37
|
foundation: Foundation,
|
|
37
38
|
heater: Heater,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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, 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, HomeMonitor, HomeMonitorSteps, HomeSharedWith, InboxForwardBanner, InboxTile, ItemFormPanel, ItemFormTabs, ItemNameHeader, ItemsReviewBanner, ItemSubTypeSelect, Launchpad, LaunchpadAutofilerBanner, LaunchpadReceiptAutofiler, LaunchpadReceiptPanel, LaunchpadTour, LeftPanel, Loading, MediaDetailsStep, MessagePanel, MessageChatPanel, MonitorAlerts, 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, 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, CreateDocumentHeader, CreateHouseholdItemHeader, CreditCardContainer, CreditCardError, CustomerTile, DeleteBanner, Dialog, DisplayFiles, DisplayFilesDetail, DisplayOptions, DisplayReceipts, DocumentMenu, DocumentNameHeader, DocumentPreview, DynamicForm, EditAccountType, EditHomeBody, EditHomeFooter, EditHomeHeader, EditHomePanel, 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, HomeMonitor, HomeMonitorPanel, HomeMonitorSteps, HomeSharedWith, InboxForwardBanner, InboxTile, ItemFormPanel, ItemFormTabs, ItemNameHeader, ItemsReviewBanner, ItemSubTypeSelect, Launchpad, LaunchpadAutofilerBanner, LaunchpadReceiptAutofiler, LaunchpadReceiptPanel, LaunchpadTour, LeftPanel, Loading, MediaDetailsStep, MessagePanel, MessageChatPanel, MonitorAlerts, 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, 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';
|
|
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';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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, 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, HomeMonitor, HomeMonitorSteps, HomeSharedWith, InboxForwardBanner, InboxTile, ItemFormPanel, ItemFormTabs, ItemNameHeader, ItemsReviewBanner, ItemSubTypeSelect, Launchpad, LaunchpadAutofilerBanner, LaunchpadReceiptAutofiler, LaunchpadReceiptPanel, LaunchpadTour, LeftPanel, Loading, MediaDetailsStep, MessagePanel, MessageChatPanel, MonitorAlerts, 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, 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, CreateDocumentHeader, CreateHouseholdItemHeader, CreditCardContainer, CreditCardError, CustomerTile, DeleteBanner, Dialog, DisplayFiles, DisplayFilesDetail, DisplayOptions, DisplayReceipts, DocumentMenu, DocumentNameHeader, DocumentPreview, DynamicForm, EditAccountType, EditHomeBody, EditHomeFooter, EditHomeHeader, EditHomePanel, 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, HomeMonitor, HomeMonitorPanel, HomeMonitorSteps, HomeSharedWith, InboxForwardBanner, InboxTile, ItemFormPanel, ItemFormTabs, ItemNameHeader, ItemsReviewBanner, ItemSubTypeSelect, Launchpad, LaunchpadAutofilerBanner, LaunchpadReceiptAutofiler, LaunchpadReceiptPanel, LaunchpadTour, LeftPanel, Loading, MediaDetailsStep, MessagePanel, MessageChatPanel, MonitorAlerts, 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, 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';
|
|
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';
|
|
@@ -2,6 +2,8 @@ import { DynamicFormI } from '..';
|
|
|
2
2
|
export type AlertCategory = 'safeguard' | 'maintain' | 'budget' | 'improve';
|
|
3
3
|
export type AlertTabType = 'details' | 'filter-size' | 'purchase' | 'hire-out';
|
|
4
4
|
export type AlertFieldType = 'alert' | 'search' | 'purchase-product' | 'hire-info' | 'hire-service' | 'hire-service-cta';
|
|
5
|
-
export interface BackendAlertI extends DynamicFormI {
|
|
5
|
+
export interface BackendAlertI extends Pick<DynamicFormI, 'form' | 'callback'> {
|
|
6
|
+
id: string;
|
|
6
7
|
category: AlertCategory;
|
|
8
|
+
onComplete?: (id?: string) => void;
|
|
7
9
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,6 +8,7 @@ export * from './HomeAssistantPanel.interface';
|
|
|
8
8
|
export * from './HomeAssistantStepper.interface';
|
|
9
9
|
export * from './HomeAssistantSteps.interface';
|
|
10
10
|
export * from './HomeAssistantTutorial.interface';
|
|
11
|
+
export * from './HomeMonitorPanel.interface';
|
|
11
12
|
export * from './HomeMonitorSteps.interface';
|
|
12
13
|
export * from './MonitorAlerts.interface';
|
|
13
14
|
export * from './WeatherWidget.interface';
|
|
@@ -8,6 +8,7 @@ export * from './HomeAssistantPanel.interface';
|
|
|
8
8
|
export * from './HomeAssistantStepper.interface';
|
|
9
9
|
export * from './HomeAssistantSteps.interface';
|
|
10
10
|
export * from './HomeAssistantTutorial.interface';
|
|
11
|
+
export * from './HomeMonitorPanel.interface';
|
|
11
12
|
export * from './HomeMonitorSteps.interface';
|
|
12
13
|
export * from './MonitorAlerts.interface';
|
|
13
14
|
export * from './WeatherWidget.interface';
|
|
@@ -5,3 +5,5 @@ export declare const tileUIMock: ReportI[];
|
|
|
5
5
|
export declare const viewingHomeItemMock: ReportI[];
|
|
6
6
|
export declare const unknownFormMock: Record<string, any>;
|
|
7
7
|
export declare const alertFieldsMock: ReportI[];
|
|
8
|
+
export declare const alertFieldsMock2: ReportI[];
|
|
9
|
+
export declare const alertFieldsMock3: ReportI[];
|
|
@@ -842,10 +842,10 @@ export const unknownFormMock = {
|
|
|
842
842
|
export const alertFieldsMock = [
|
|
843
843
|
{
|
|
844
844
|
id: faker.database.mongodbObjectId(),
|
|
845
|
-
name: '
|
|
846
|
-
label: '
|
|
847
|
-
description: '
|
|
848
|
-
icon: '
|
|
845
|
+
name: 'Batteries',
|
|
846
|
+
label: 'Check the batteries in your Smoke detectors.',
|
|
847
|
+
description: 'Regularly checking and replacing batteries ensures they function properly, especially during emergencies. Neglecting this simple task can lead to malfunctioning detectors, increasing the risk of undetected fires and potential harm to your family and property.',
|
|
848
|
+
icon: 'fire',
|
|
849
849
|
value: false,
|
|
850
850
|
type: 'alert',
|
|
851
851
|
children: [
|
|
@@ -1101,3 +1101,25 @@ export const alertFieldsMock = [
|
|
|
1101
1101
|
],
|
|
1102
1102
|
},
|
|
1103
1103
|
];
|
|
1104
|
+
export const alertFieldsMock2 = [
|
|
1105
|
+
{
|
|
1106
|
+
id: faker.database.mongodbObjectId(),
|
|
1107
|
+
name: 'Smoke Detectors',
|
|
1108
|
+
label: 'Your smoke detectors could be expired.',
|
|
1109
|
+
description: 'Smoke detectors are essential for home safety, alerting you to smoke and fire hazards. Regularly checking and replacing them ensures they function properly, providing peace of mind and protection for your family.',
|
|
1110
|
+
icon: 'fire',
|
|
1111
|
+
value: false,
|
|
1112
|
+
type: 'alert',
|
|
1113
|
+
},
|
|
1114
|
+
];
|
|
1115
|
+
export const alertFieldsMock3 = [
|
|
1116
|
+
{
|
|
1117
|
+
id: faker.database.mongodbObjectId(),
|
|
1118
|
+
name: 'Air Filter',
|
|
1119
|
+
label: 'Time to change your heating & cooling air filter.',
|
|
1120
|
+
description: 'Changing your air filter is critical for maintaining your home’s HVAC system efficiency and ensuring good air quality. A clogged filter forces your system to work harder, leading to higher energy bills and potential damage to components. Neglecting this simple maintenance can result in costly repairs or even a full system replacement, which can run into thousands of dollars. Regularly replacing your air filter not only saves money but also extends the lifespan of your HVAC system, keeping your home comfortable and your expenses in check.',
|
|
1121
|
+
icon: 'wind',
|
|
1122
|
+
value: false,
|
|
1123
|
+
type: 'alert',
|
|
1124
|
+
},
|
|
1125
|
+
];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import { HomeMonitorPanelI } from '../../interfaces';
|
|
3
|
+
declare const _default: Meta<HomeMonitorPanelI>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const HomeMonitorPanelComponent: (args: HomeMonitorPanelI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DrawerContent } from '@chakra-ui/react';
|
|
3
|
+
import { action } from '@storybook/addon-actions';
|
|
4
|
+
import { HomeMonitorPanel, RightPanel } from '../../components';
|
|
5
|
+
import { alertFieldsMock, alertFieldsMock2, alertFieldsMock3 } from '../../mocks';
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Components/HomeAssistant',
|
|
8
|
+
component: HomeMonitorPanel,
|
|
9
|
+
args: {
|
|
10
|
+
onClose: action('onClose'),
|
|
11
|
+
alerts: [
|
|
12
|
+
{
|
|
13
|
+
category: 'safeguard',
|
|
14
|
+
id: 'alert-1',
|
|
15
|
+
form: alertFieldsMock,
|
|
16
|
+
callback: action('callback'),
|
|
17
|
+
onComplete: action('onComplete'),
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
category: 'safeguard',
|
|
21
|
+
id: 'alert-2',
|
|
22
|
+
form: alertFieldsMock2,
|
|
23
|
+
callback: action('callback'),
|
|
24
|
+
onComplete: action('onComplete'),
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
category: 'maintain',
|
|
28
|
+
id: 'alert-3',
|
|
29
|
+
form: alertFieldsMock3,
|
|
30
|
+
callback: action('callback'),
|
|
31
|
+
onComplete: action('onComplete'),
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
decorators: [
|
|
36
|
+
(Story) => (_jsx(RightPanel, { isOpen: true, onClose: action('onClose'), children: _jsx(Story, {}) })),
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
export const HomeMonitorPanelComponent = (args) => {
|
|
40
|
+
return (_jsx(DrawerContent, { bg: "lightBlue.1", overflowY: "auto", children: _jsx(HomeMonitorPanel, Object.assign({}, args)) }));
|
|
41
|
+
};
|
package/package.json
CHANGED
|
@@ -414,10 +414,12 @@
|
|
|
414
414
|
},
|
|
415
415
|
"details": "Provide details about your home’s",
|
|
416
416
|
"homeMonitor": "Homie",
|
|
417
|
+
"HomieMessages": "Homie Messages ({{ count }})",
|
|
417
418
|
"homeMonitoring": "I’m learning about your home…",
|
|
418
419
|
"homeMonitoringAlerts": "I have {{ count }} new messages for you.",
|
|
419
420
|
"monitorAlerts": {
|
|
420
421
|
"collapse": "Collapse Alert",
|
|
422
|
+
"completed": "Mark as Completed",
|
|
421
423
|
"homeAction": "Home Action",
|
|
422
424
|
"maintenance": "Maintenance Monitor",
|
|
423
425
|
"protection": "Protection Monitor",
|
|
@@ -3,7 +3,13 @@ import { BackendAlertI, TabI } from '@/interfaces'
|
|
|
3
3
|
import { getCategoryStyles } from '@/utils/Alerts.utils'
|
|
4
4
|
import { Divider } from '@chakra-ui/react'
|
|
5
5
|
|
|
6
|
-
export const BackendAlert = ({
|
|
6
|
+
export const BackendAlert = ({
|
|
7
|
+
id,
|
|
8
|
+
category,
|
|
9
|
+
form,
|
|
10
|
+
callback,
|
|
11
|
+
onComplete,
|
|
12
|
+
}: BackendAlertI) => {
|
|
7
13
|
const { headerBg, alertIcon, alertIconBg, alertTitle } =
|
|
8
14
|
getCategoryStyles(category)
|
|
9
15
|
const alert = form?.find((item) => item.type === 'alert')
|
|
@@ -30,6 +36,8 @@ export const BackendAlert = ({ category, form, callback }: BackendAlertI) => {
|
|
|
30
36
|
icon={alert?.icon ?? ''}
|
|
31
37
|
title={alert?.label ?? ''}
|
|
32
38
|
description={alert?.description ?? ''}
|
|
39
|
+
onComplete={onComplete}
|
|
40
|
+
id={id}
|
|
33
41
|
>
|
|
34
42
|
<Divider />
|
|
35
43
|
{hasChildren && !isSingleTab && <TabsHeader tabList={tabs} />}
|
|
@@ -12,6 +12,8 @@ export const BackendAlertCard = ({
|
|
|
12
12
|
alertTitle = t('homeAssistant.monitorAlerts.protection'),
|
|
13
13
|
children,
|
|
14
14
|
icon = 'warning',
|
|
15
|
+
id,
|
|
16
|
+
onComplete,
|
|
15
17
|
...props
|
|
16
18
|
}: PropsWithChildren<BackendAlertCardI>) => {
|
|
17
19
|
const { isOpen, onToggle } = useDisclosure()
|
|
@@ -23,7 +25,7 @@ export const BackendAlertCard = ({
|
|
|
23
25
|
boxShadow="lg"
|
|
24
26
|
borderRadius="lg"
|
|
25
27
|
overflow="hidden"
|
|
26
|
-
|
|
28
|
+
minW="400px"
|
|
27
29
|
>
|
|
28
30
|
<AlertHeader bg={alertBg} />
|
|
29
31
|
<AlertTitle alertIcon={alertIcon} alertTitle={alertTitle} />
|
|
@@ -31,7 +33,26 @@ export const BackendAlertCard = ({
|
|
|
31
33
|
<Collapse in={isOpen} animateOpacity>
|
|
32
34
|
<Box bg="lightBlue.1">{children}</Box>
|
|
33
35
|
</Collapse>
|
|
34
|
-
<Flex
|
|
36
|
+
<Flex
|
|
37
|
+
py="base"
|
|
38
|
+
bg="lightBlue.1"
|
|
39
|
+
justify={id ? 'space-between' : 'end'}
|
|
40
|
+
gap="4"
|
|
41
|
+
>
|
|
42
|
+
{id && (
|
|
43
|
+
<Button
|
|
44
|
+
variant="unstyled"
|
|
45
|
+
w="fit-content"
|
|
46
|
+
px="base"
|
|
47
|
+
fontSize="sm"
|
|
48
|
+
color="blue.3"
|
|
49
|
+
onClick={() => onComplete?.(id)}
|
|
50
|
+
transition="color 0.2s"
|
|
51
|
+
_hover={{ color: 'blue.8' }}
|
|
52
|
+
>
|
|
53
|
+
{t('homeAssistant.monitorAlerts.completed')}
|
|
54
|
+
</Button>
|
|
55
|
+
)}
|
|
35
56
|
<Button
|
|
36
57
|
variant="leftRounded"
|
|
37
58
|
w="fit-content"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { t } from 'i18next'
|
|
2
|
+
import { DrawerBody, DrawerHeader, Stack } from '@chakra-ui/react'
|
|
3
|
+
import { IA } from '@/assets/images'
|
|
4
|
+
import { BackendAlert, PanelHeader } from '@/components'
|
|
5
|
+
import { HomeMonitorPanelI } from '@/interfaces'
|
|
6
|
+
|
|
7
|
+
export const HomeMonitorPanel = ({ onClose, alerts }: HomeMonitorPanelI) => {
|
|
8
|
+
return (
|
|
9
|
+
<>
|
|
10
|
+
<DrawerHeader p="0">
|
|
11
|
+
<PanelHeader
|
|
12
|
+
handleCloseButton={onClose}
|
|
13
|
+
title={t('homeAssistant.HomieMessages', {
|
|
14
|
+
count: alerts?.length ?? 0,
|
|
15
|
+
})}
|
|
16
|
+
icon={IA}
|
|
17
|
+
/>
|
|
18
|
+
<DrawerBody p="0">
|
|
19
|
+
<Stack spacing="base" p="base">
|
|
20
|
+
{alerts?.map((alert) => (
|
|
21
|
+
<BackendAlert key={alert.id} {...alert} />
|
|
22
|
+
))}
|
|
23
|
+
</Stack>
|
|
24
|
+
</DrawerBody>
|
|
25
|
+
</DrawerHeader>
|
|
26
|
+
</>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
@@ -59,6 +59,7 @@ import {
|
|
|
59
59
|
AApest,
|
|
60
60
|
FilterSize,
|
|
61
61
|
Wallet,
|
|
62
|
+
Fire,
|
|
62
63
|
} from '@/assets/images'
|
|
63
64
|
import { IconTypes } from '@/interfaces'
|
|
64
65
|
|
|
@@ -95,6 +96,7 @@ export const fieldIcons: Record<IconTypes, string> = {
|
|
|
95
96
|
'solar-panel': SolarPanel,
|
|
96
97
|
calendar2: Calendar2,
|
|
97
98
|
drop: Drop,
|
|
99
|
+
fire: Fire,
|
|
98
100
|
wind: Wind,
|
|
99
101
|
foundation: Foundation,
|
|
100
102
|
heater: Heater,
|
package/src/index.ts
CHANGED
|
@@ -12,6 +12,8 @@ export type AlertFieldType =
|
|
|
12
12
|
| 'hire-service'
|
|
13
13
|
| 'hire-service-cta'
|
|
14
14
|
|
|
15
|
-
export interface BackendAlertI extends DynamicFormI {
|
|
15
|
+
export interface BackendAlertI extends Pick<DynamicFormI, 'form' | 'callback'> {
|
|
16
|
+
id: string
|
|
16
17
|
category: AlertCategory
|
|
18
|
+
onComplete?: (id?: string) => void
|
|
17
19
|
}
|
|
@@ -8,6 +8,7 @@ export * from './HomeAssistantPanel.interface'
|
|
|
8
8
|
export * from './HomeAssistantStepper.interface'
|
|
9
9
|
export * from './HomeAssistantSteps.interface'
|
|
10
10
|
export * from './HomeAssistantTutorial.interface'
|
|
11
|
+
export * from './HomeMonitorPanel.interface'
|
|
11
12
|
export * from './HomeMonitorSteps.interface'
|
|
12
13
|
export * from './MonitorAlerts.interface'
|
|
13
14
|
export * from './WeatherWidget.interface'
|
|
@@ -857,11 +857,11 @@ export const unknownFormMock: Record<string, any> = {
|
|
|
857
857
|
export const alertFieldsMock: ReportI[] = [
|
|
858
858
|
{
|
|
859
859
|
id: faker.database.mongodbObjectId(),
|
|
860
|
-
name: '
|
|
861
|
-
label: '
|
|
860
|
+
name: 'Batteries',
|
|
861
|
+
label: 'Check the batteries in your Smoke detectors.',
|
|
862
862
|
description:
|
|
863
|
-
'
|
|
864
|
-
icon: '
|
|
863
|
+
'Regularly checking and replacing batteries ensures they function properly, especially during emergencies. Neglecting this simple task can lead to malfunctioning detectors, increasing the risk of undetected fires and potential harm to your family and property.',
|
|
864
|
+
icon: 'fire',
|
|
865
865
|
value: false,
|
|
866
866
|
type: 'alert',
|
|
867
867
|
children: [
|
|
@@ -1122,3 +1122,29 @@ export const alertFieldsMock: ReportI[] = [
|
|
|
1122
1122
|
],
|
|
1123
1123
|
},
|
|
1124
1124
|
]
|
|
1125
|
+
|
|
1126
|
+
export const alertFieldsMock2: ReportI[] = [
|
|
1127
|
+
{
|
|
1128
|
+
id: faker.database.mongodbObjectId(),
|
|
1129
|
+
name: 'Smoke Detectors',
|
|
1130
|
+
label: 'Your smoke detectors could be expired.',
|
|
1131
|
+
description:
|
|
1132
|
+
'Smoke detectors are essential for home safety, alerting you to smoke and fire hazards. Regularly checking and replacing them ensures they function properly, providing peace of mind and protection for your family.',
|
|
1133
|
+
icon: 'fire',
|
|
1134
|
+
value: false,
|
|
1135
|
+
type: 'alert',
|
|
1136
|
+
},
|
|
1137
|
+
]
|
|
1138
|
+
|
|
1139
|
+
export const alertFieldsMock3: ReportI[] = [
|
|
1140
|
+
{
|
|
1141
|
+
id: faker.database.mongodbObjectId(),
|
|
1142
|
+
name: 'Air Filter',
|
|
1143
|
+
label: 'Time to change your heating & cooling air filter.',
|
|
1144
|
+
description:
|
|
1145
|
+
'Changing your air filter is critical for maintaining your home’s HVAC system efficiency and ensuring good air quality. A clogged filter forces your system to work harder, leading to higher energy bills and potential damage to components. Neglecting this simple maintenance can result in costly repairs or even a full system replacement, which can run into thousands of dollars. Regularly replacing your air filter not only saves money but also extends the lifespan of your HVAC system, keeping your home comfortable and your expenses in check.',
|
|
1146
|
+
icon: 'wind',
|
|
1147
|
+
value: false,
|
|
1148
|
+
type: 'alert',
|
|
1149
|
+
},
|
|
1150
|
+
]
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react'
|
|
2
|
+
import { DrawerContent } from '@chakra-ui/react'
|
|
3
|
+
import { action } from '@storybook/addon-actions'
|
|
4
|
+
import { HomeMonitorPanel, RightPanel } from '@/components'
|
|
5
|
+
import { HomeMonitorPanelI } from '@/interfaces'
|
|
6
|
+
import { alertFieldsMock, alertFieldsMock2, alertFieldsMock3 } from '@/mocks'
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Components/HomeAssistant',
|
|
10
|
+
component: HomeMonitorPanel,
|
|
11
|
+
args: {
|
|
12
|
+
onClose: action('onClose'),
|
|
13
|
+
alerts: [
|
|
14
|
+
{
|
|
15
|
+
category: 'safeguard',
|
|
16
|
+
id: 'alert-1',
|
|
17
|
+
form: alertFieldsMock,
|
|
18
|
+
callback: action('callback'),
|
|
19
|
+
onComplete: action('onComplete'),
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
category: 'safeguard',
|
|
23
|
+
id: 'alert-2',
|
|
24
|
+
form: alertFieldsMock2,
|
|
25
|
+
callback: action('callback'),
|
|
26
|
+
onComplete: action('onComplete'),
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
category: 'maintain',
|
|
30
|
+
id: 'alert-3',
|
|
31
|
+
form: alertFieldsMock3,
|
|
32
|
+
callback: action('callback'),
|
|
33
|
+
onComplete: action('onComplete'),
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
decorators: [
|
|
38
|
+
(Story: any) => (
|
|
39
|
+
<RightPanel isOpen={true} onClose={action('onClose')}>
|
|
40
|
+
<Story />
|
|
41
|
+
</RightPanel>
|
|
42
|
+
),
|
|
43
|
+
],
|
|
44
|
+
} as Meta<HomeMonitorPanelI>
|
|
45
|
+
|
|
46
|
+
export const HomeMonitorPanelComponent = (args: HomeMonitorPanelI) => {
|
|
47
|
+
return (
|
|
48
|
+
<DrawerContent bg="lightBlue.1" overflowY="auto">
|
|
49
|
+
<HomeMonitorPanel {...args} />
|
|
50
|
+
</DrawerContent>
|
|
51
|
+
)
|
|
52
|
+
}
|