@homefile/components-v2 1.4.2 → 1.6.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/images/alerts/index.d.ts +2 -0
- package/dist/assets/images/alerts/index.js +2 -0
- package/dist/assets/images/alerts/index.ts +3 -0
- package/dist/assets/images/alerts/smoke-detector-expired.jpg +0 -0
- package/dist/assets/images/battery.svg +9 -0
- package/dist/assets/images/index.d.ts +4 -1
- package/dist/assets/images/index.js +4 -1
- package/dist/assets/images/index.ts +5 -0
- package/dist/assets/images/wind-white.svg +7 -0
- package/dist/assets/locales/en/index.json +68 -1
- package/dist/components/animations/HomieAnimation.d.ts +1 -0
- package/dist/components/animations/HomieAnimation.js +11 -0
- package/dist/components/animations/index.d.ts +1 -0
- package/dist/components/animations/index.js +1 -0
- package/dist/components/badge/CustomBadge.d.ts +5 -0
- package/dist/components/badge/CustomBadge.js +5 -0
- package/dist/components/badge/index.d.ts +5 -4
- package/dist/components/badge/index.js +5 -4
- package/dist/components/contacts/ContactCard.d.ts +1 -1
- package/dist/components/contacts/ContactCard.js +5 -5
- package/dist/components/contacts/ContactCardHeader.d.ts +1 -1
- package/dist/components/contacts/ContactCardHeader.js +4 -4
- package/dist/components/contacts/ContactCardInfo.d.ts +1 -1
- package/dist/components/contacts/ContactCardInfo.js +2 -2
- package/dist/components/contacts/ContactHeaderMenu.js +3 -3
- package/dist/components/contacts/ContactsContent.d.ts +1 -1
- package/dist/components/contacts/ContactsContent.js +31 -6
- package/dist/components/contacts/LetterDivider.d.ts +3 -0
- package/dist/components/contacts/LetterDivider.js +5 -0
- package/dist/components/contacts/ShareContactSection.d.ts +2 -0
- package/dist/components/contacts/ShareContactSection.js +26 -0
- package/dist/components/contacts/index.d.ts +3 -1
- package/dist/components/contacts/index.js +3 -1
- package/dist/components/contacts/shareContactForms/AddReceiverButton.d.ts +2 -0
- package/dist/components/contacts/shareContactForms/AddReceiverButton.js +7 -0
- package/dist/components/contacts/shareContactForms/SendToList.d.ts +2 -0
- package/dist/components/contacts/shareContactForms/SendToList.js +11 -0
- package/dist/components/contacts/shareContactForms/ShareContactByEmail.d.ts +2 -2
- package/dist/components/contacts/shareContactForms/ShareContactByEmail.js +7 -17
- package/dist/components/contacts/shareContactForms/ShareContactByHomefile.d.ts +2 -0
- package/dist/components/contacts/shareContactForms/ShareContactByHomefile.js +17 -0
- package/dist/components/contacts/shareContactForms/ShareContactBySMS.d.ts +2 -0
- package/dist/components/contacts/shareContactForms/ShareContactBySMS.js +11 -0
- package/dist/components/contacts/shareContactForms/index.d.ts +4 -0
- package/dist/components/contacts/shareContactForms/index.js +4 -0
- package/dist/components/contacts/sharePanel/SelectedContacts.d.ts +2 -0
- package/dist/components/contacts/sharePanel/SelectedContacts.js +8 -0
- package/dist/components/contacts/sharePanel/ShareContactsContent.d.ts +2 -0
- package/dist/components/contacts/sharePanel/ShareContactsContent.js +28 -0
- package/dist/components/contacts/sharePanel/index.d.ts +2 -0
- package/dist/components/contacts/sharePanel/index.js +2 -0
- package/dist/components/homeAssistant/HomeAssistant.js +2 -1
- package/dist/components/homeAssistant/HomeAssistantWrapper.d.ts +2 -1
- package/dist/components/homeAssistant/HomeAssistantWrapper.js +2 -3
- package/dist/components/homeAssistant/HomeMonitor.d.ts +2 -0
- package/dist/components/homeAssistant/HomeMonitor.js +6 -0
- package/dist/components/homeAssistant/HomeMonitorButton.d.ts +2 -0
- package/dist/components/homeAssistant/HomeMonitorButton.js +31 -0
- package/dist/components/homeAssistant/HomeMonitorSteps.d.ts +2 -0
- package/dist/components/homeAssistant/HomeMonitorSteps.js +11 -0
- package/dist/components/homeAssistant/index.d.ts +4 -0
- package/dist/components/homeAssistant/index.js +4 -0
- package/dist/components/homeAssistant/monitorAlerts/AlertHeader.d.ts +1 -0
- package/dist/components/homeAssistant/monitorAlerts/AlertHeader.js +7 -0
- package/dist/components/homeAssistant/monitorAlerts/AlertTemplate.d.ts +2 -0
- package/dist/components/homeAssistant/monitorAlerts/AlertTemplate.js +5 -0
- package/dist/components/homeAssistant/monitorAlerts/AlertTitle.d.ts +2 -0
- package/dist/components/homeAssistant/monitorAlerts/AlertTitle.js +5 -0
- package/dist/components/homeAssistant/monitorAlerts/BaseAlertCard.d.ts +3 -0
- package/dist/components/homeAssistant/monitorAlerts/BaseAlertCard.js +21 -0
- package/dist/components/homeAssistant/monitorAlerts/MonitorAlerts.d.ts +2 -0
- package/dist/components/homeAssistant/monitorAlerts/MonitorAlerts.js +32 -0
- package/dist/components/homeAssistant/monitorAlerts/Notifications.d.ts +4 -0
- package/dist/components/homeAssistant/monitorAlerts/Notifications.js +9 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/ChangeAirFilter.d.ts +1 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/ChangeAirFilter.js +11 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/CustomDivider.d.ts +1 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/CustomDivider.js +5 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/SmokeDetectorBattery.d.ts +1 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/SmokeDetectorBattery.js +11 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/SmokeDetectorExpired.d.ts +1 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/SmokeDetectorExpired.js +11 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/index.d.ts +4 -0
- package/dist/components/homeAssistant/monitorAlerts/alertDetails/index.js +4 -0
- package/dist/components/homeAssistant/monitorAlerts/index.d.ts +7 -0
- package/dist/components/homeAssistant/monitorAlerts/index.js +7 -0
- package/dist/components/homeAssistant/panel/HomeAssistantPanel.js +1 -1
- package/dist/components/homeBoard/HomeBoard.js +1 -1
- package/dist/components/inputs/TextInput.d.ts +1 -1
- package/dist/components/inputs/TextInput.js +2 -2
- package/dist/components/partner/PartnerFooter.d.ts +1 -1
- package/dist/components/partner/PartnerFooter.js +2 -2
- package/dist/components/partner/ShortPartnerTile.d.ts +1 -1
- package/dist/components/partner/ShortPartnerTile.js +2 -2
- package/dist/helpers/homeAssistant/HomeAssistant.helper.js +4 -4
- package/dist/hooks/contacts/index.d.ts +3 -0
- package/dist/hooks/contacts/index.js +3 -0
- package/dist/hooks/contacts/useContactsContent.d.ts +2 -1
- package/dist/hooks/contacts/useContactsContent.js +28 -2
- package/dist/hooks/contacts/useShareContactBy.d.ts +15 -0
- package/dist/hooks/contacts/useShareContactBy.js +33 -0
- package/dist/hooks/contacts/useShareContactByHomefile.d.ts +16 -0
- package/dist/hooks/contacts/useShareContactByHomefile.js +25 -0
- package/dist/hooks/contacts/useShareContactsContent.d.ts +8 -0
- package/dist/hooks/contacts/useShareContactsContent.js +26 -0
- package/dist/hooks/useAssignableList.d.ts +2 -0
- package/dist/hooks/useAssignableList.js +10 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/interfaces/contacts/ContactCard.interface.d.ts +4 -3
- package/dist/interfaces/contacts/ContactCardHeader.interface.d.ts +3 -3
- package/dist/interfaces/contacts/ContactCardInfo.interface.d.ts +1 -0
- package/dist/interfaces/contacts/ContactsContent.interface.d.ts +12 -2
- package/dist/interfaces/contacts/SelectedContacts.interface.d.ts +5 -0
- package/dist/interfaces/contacts/ShareContactBy.interface.d.ts +21 -0
- package/dist/interfaces/contacts/ShareContactSection.interface.d.ts +4 -0
- package/dist/interfaces/contacts/ShareContactSection.interface.js +1 -0
- package/dist/interfaces/contacts/ShareContactsContent.interface.d.ts +17 -0
- package/dist/interfaces/contacts/ShareContactsContent.interface.js +1 -0
- package/dist/interfaces/contacts/ViewContactPanel.interface.d.ts +2 -2
- package/dist/interfaces/contacts/index.d.ts +4 -2
- package/dist/interfaces/contacts/index.js +4 -2
- package/dist/interfaces/homeAssistant/BaseAlertCard.interface.d.ts +8 -0
- package/dist/interfaces/homeAssistant/BaseAlertCard.interface.js +1 -0
- package/dist/interfaces/homeAssistant/HomeMonitorSteps.interface.d.ts +11 -0
- package/dist/interfaces/homeAssistant/HomeMonitorSteps.interface.js +1 -0
- package/dist/interfaces/homeAssistant/MonitorAlerts.interface.d.ts +4 -0
- package/dist/interfaces/homeAssistant/MonitorAlerts.interface.js +1 -0
- package/dist/interfaces/homeAssistant/index.d.ts +3 -0
- package/dist/interfaces/homeAssistant/index.js +3 -0
- package/dist/interfaces/partner/PartnerFooter.interface.d.ts +1 -0
- package/dist/mocks/contacts/contacts.mock.d.ts +1 -0
- package/dist/mocks/contacts/contacts.mock.js +86 -2
- package/dist/stories/animations/HomieAnimation.stories.d.ts +4 -0
- package/dist/stories/animations/HomieAnimation.stories.js +11 -0
- package/dist/stories/assets/Illustrations.stories.js +2 -2
- package/dist/stories/contacts/ContactsContent.stories.d.ts +1 -10
- package/dist/stories/contacts/ContactsContent.stories.js +40 -13
- package/dist/stories/homeAssistant/HomeMonitor.stories.d.ts +4 -0
- package/dist/stories/homeAssistant/HomeMonitor.stories.js +25 -0
- package/dist/stories/homeAssistant/monitorAlerts/HomeAssistant.stories.d.ts +5 -0
- package/dist/stories/homeAssistant/monitorAlerts/HomeAssistant.stories.js +22 -0
- package/dist/theme/colors.d.ts +4 -0
- package/dist/theme/colors.js +4 -0
- package/package.json +2 -1
- package/src/assets/images/alerts/index.ts +3 -0
- package/src/assets/images/alerts/smoke-detector-expired.jpg +0 -0
- package/src/assets/images/battery.svg +9 -0
- package/src/assets/images/index.ts +5 -0
- package/src/assets/images/wind-white.svg +7 -0
- package/src/assets/locales/en/index.json +68 -1
- package/src/components/animations/HomieAnimation.tsx +12 -0
- package/src/components/animations/index.ts +1 -0
- package/src/components/badge/CustomBadge.tsx +22 -0
- package/src/components/badge/index.ts +5 -4
- package/src/components/contacts/ContactCard.tsx +10 -11
- package/src/components/contacts/ContactCardHeader.tsx +12 -4
- package/src/components/contacts/ContactCardInfo.tsx +11 -8
- package/src/components/contacts/ContactHeaderMenu.tsx +3 -15
- package/src/components/contacts/ContactsContent.tsx +143 -17
- package/src/components/contacts/LetterDivider.tsx +15 -0
- package/src/components/contacts/ShareContactSection.tsx +58 -0
- package/src/components/contacts/index.ts +3 -1
- package/src/components/contacts/shareContactForms/AddReceiverButton.tsx +20 -0
- package/src/components/contacts/shareContactForms/SendToList.tsx +47 -0
- package/src/components/contacts/shareContactForms/ShareContactByEmail.tsx +40 -41
- package/src/components/contacts/shareContactForms/ShareContactByHomefile.tsx +88 -0
- package/src/components/contacts/shareContactForms/ShareContactBySMS.tsx +49 -0
- package/src/components/contacts/shareContactForms/index.ts +4 -0
- package/src/components/contacts/sharePanel/SelectedContacts.tsx +37 -0
- package/src/components/contacts/sharePanel/ShareContactsContent.tsx +68 -0
- package/src/components/contacts/sharePanel/index.ts +2 -0
- package/src/components/homeAssistant/HomeAssistant.tsx +5 -1
- package/src/components/homeAssistant/HomeAssistantWrapper.tsx +3 -1
- package/src/components/homeAssistant/HomeMonitor.tsx +11 -0
- package/src/components/homeAssistant/HomeMonitorButton.tsx +69 -0
- package/src/components/homeAssistant/HomeMonitorSteps.tsx +29 -0
- package/src/components/homeAssistant/index.ts +4 -0
- package/src/components/homeAssistant/monitorAlerts/AlertHeader.tsx +30 -0
- package/src/components/homeAssistant/monitorAlerts/AlertTemplate.tsx +25 -0
- package/src/components/homeAssistant/monitorAlerts/AlertTitle.tsx +16 -0
- package/src/components/homeAssistant/monitorAlerts/BaseAlertCard.tsx +60 -0
- package/src/components/homeAssistant/monitorAlerts/MonitorAlerts.tsx +47 -0
- package/src/components/homeAssistant/monitorAlerts/Notifications.tsx +32 -0
- package/src/components/homeAssistant/monitorAlerts/alertDetails/ChangeAirFilter.tsx +54 -0
- package/src/components/homeAssistant/monitorAlerts/alertDetails/CustomDivider.tsx +5 -0
- package/src/components/homeAssistant/monitorAlerts/alertDetails/SmokeDetectorBattery.tsx +54 -0
- package/src/components/homeAssistant/monitorAlerts/alertDetails/SmokeDetectorExpired.tsx +43 -0
- package/src/components/homeAssistant/monitorAlerts/alertDetails/index.ts +4 -0
- package/src/components/homeAssistant/monitorAlerts/index.ts +7 -0
- package/src/components/homeAssistant/panel/HomeAssistantPanel.tsx +1 -1
- package/src/components/homeBoard/HomeBoard.tsx +2 -1
- package/src/components/inputs/TextInput.tsx +2 -1
- package/src/components/partner/PartnerFooter.tsx +2 -2
- package/src/components/partner/ShortPartnerTile.tsx +2 -1
- package/src/helpers/homeAssistant/HomeAssistant.helper.tsx +4 -4
- package/src/hooks/contacts/index.ts +4 -1
- package/src/hooks/contacts/useContactsContent.ts +38 -4
- package/src/hooks/contacts/useShareContactBy.ts +45 -0
- package/src/hooks/contacts/useShareContactByHomefile.ts +46 -0
- package/src/hooks/contacts/useShareContactsContent.ts +38 -0
- package/src/hooks/useAssignableList.ts +11 -1
- package/src/index.ts +8 -1
- package/src/interfaces/contacts/ContactCard.interface.ts +4 -7
- package/src/interfaces/contacts/ContactCardHeader.interface.ts +3 -3
- package/src/interfaces/contacts/ContactCardInfo.interface.ts +1 -0
- package/src/interfaces/contacts/ContactsContent.interface.ts +13 -2
- package/src/interfaces/contacts/SelectedContacts.interface.ts +6 -0
- package/src/interfaces/contacts/ShareContactBy.interface.ts +25 -0
- package/src/interfaces/contacts/ShareContactSection.interface.ts +6 -0
- package/src/interfaces/contacts/ShareContactsContent.interface.ts +24 -0
- package/src/interfaces/contacts/ViewContactPanel.interface.ts +2 -2
- package/src/interfaces/contacts/index.ts +4 -2
- package/src/interfaces/homeAssistant/BaseAlertCard.interface.ts +8 -0
- package/src/interfaces/homeAssistant/HomeMonitorSteps.interface.ts +13 -0
- package/src/interfaces/homeAssistant/MonitorAlerts.interface.ts +8 -0
- package/src/interfaces/homeAssistant/index.ts +3 -0
- package/src/interfaces/partner/PartnerFooter.interface.ts +1 -0
- package/src/mocks/contacts/contacts.mock.ts +87 -2
- package/src/stories/animations/HomieAnimation.stories.tsx +17 -0
- package/src/stories/assets/Illustrations.stories.tsx +2 -0
- package/src/stories/contacts/ContactsContent.stories.tsx +73 -16
- package/src/stories/homeAssistant/HomeMonitor.stories.tsx +54 -0
- package/src/stories/homeAssistant/monitorAlerts/HomeAssistant.stories.tsx +30 -0
- package/src/theme/colors.ts +4 -0
- package/dist/components/contacts/ShareContactPopover.d.ts +0 -2
- package/dist/components/contacts/ShareContactPopover.js +0 -32
- package/dist/interfaces/contacts/ShareContactByEmail.interface.d.ts +0 -11
- package/dist/interfaces/contacts/ShareContactPopover.interface.d.ts +0 -8
- package/src/components/contacts/ShareContactPopover.tsx +0 -106
- package/src/interfaces/contacts/ShareContactByEmail.interface.ts +0 -12
- package/src/interfaces/contacts/ShareContactPopover.interface.ts +0 -9
- /package/dist/interfaces/contacts/{ShareContactByEmail.interface.js → SelectedContacts.interface.js} +0 -0
- /package/dist/interfaces/contacts/{ShareContactPopover.interface.js → ShareContactBy.interface.js} +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { t } from 'i18next';
|
|
3
|
+
import { Box, Flex, Stack, Text } from '@chakra-ui/react';
|
|
4
|
+
import { AddReceiverButton, Loader, SendToList, ShareWithButton, TextInput, } from '../..';
|
|
5
|
+
import { isValidEmail } from '../../../utils';
|
|
6
|
+
import { useShareContactByHomefile } from '../../../hooks';
|
|
7
|
+
import { ShareHomeContactList } from '../../sharedHomePanel/ShareHomeContactList';
|
|
8
|
+
export const ShareContactByHomefile = ({ apiErrorMessage, homefileContacts, isLoading, onShare, onDropdownSelect, onContactSearch, onRemoveContact, shareWithList, }) => {
|
|
9
|
+
const { handleChangeValue, handleSetIsDirtyToTrue, handleToggleDropdown, isDirty, openDropdown, sendTo, value, } = useShareContactByHomefile({ onShare, shareWithList, sendBy: 'homefile' });
|
|
10
|
+
const errorMessage = apiErrorMessage !== null && apiErrorMessage !== void 0 ? apiErrorMessage : `${t('forms.email')} ${t('forms.required')}`;
|
|
11
|
+
return (_jsxs(Box, { w: "100%", children: [_jsxs(Stack, { p: "base", w: "100%", spacing: "base", children: [_jsx(Text, { fontFamily: "secondary", fontSize: "sm", children: t('contacts.shareWithHomefile') }), _jsxs(Flex, { gap: "base", children: [_jsxs(Flex, { position: "relative", flex: 1, children: [_jsx(ShareWithButton, { marginRight: "-1px", onClick: handleToggleDropdown }), _jsx(TextInput, { autoCapitalize: "none", autoCorrect: "off", id: "shareContactByHomefile", errorMessage: errorMessage, hasError: !isValidEmail(value) && isDirty, handleChange: handleChangeValue, placeholder: t('contacts.placeholders.searchContact'), value: value, onBlur: handleSetIsDirtyToTrue, type: "email" }), openDropdown && (_jsx(ShareHomeContactList, { contacts: homefileContacts, onClick: (contact) => {
|
|
12
|
+
onDropdownSelect(contact);
|
|
13
|
+
handleToggleDropdown();
|
|
14
|
+
}, onDone: handleToggleDropdown, onChange: () => null, onSave: () => null, selectedContact: {
|
|
15
|
+
email: '',
|
|
16
|
+
} }))] }), _jsx(AddReceiverButton, { onClick: () => onContactSearch(value), isDisabled: !isValidEmail(value) })] })] }), !isLoading && _jsx(SendToList, { sendTo: sendTo, onDelete: onRemoveContact }), isLoading && _jsx(Loader, { height: "100px" })] }));
|
|
17
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { t } from 'i18next';
|
|
3
|
+
import { Box, Flex, Stack, Text } from '@chakra-ui/react';
|
|
4
|
+
import { AddReceiverButton, SendToList, TextInput } from '../..';
|
|
5
|
+
import { isEmptyField } from '../../../utils';
|
|
6
|
+
import { useShareContactBy } from '../../../hooks';
|
|
7
|
+
export const ShareContactBySMS = ({ apiErrorMessage, onShare, }) => {
|
|
8
|
+
const { sendTo, handleAdd, handleChangeValue, handleDelete, handleSetIsDirtyToTrue, isDirty, value, } = useShareContactBy({ onShare, sendBy: 'sms' });
|
|
9
|
+
const errorMessage = apiErrorMessage !== null && apiErrorMessage !== void 0 ? apiErrorMessage : `${t('forms.phone')} ${t('forms.required')}`;
|
|
10
|
+
return (_jsxs(Box, { w: "100%", children: [_jsxs(Stack, { p: "base", w: "100%", spacing: "base", children: [_jsx(Text, { fontFamily: "secondary", fontSize: "sm", children: t('contacts.shareWithSMS') }), _jsxs(Flex, { gap: "base", children: [_jsx(TextInput, { errorMessage: errorMessage, hasError: isEmptyField(value) && isDirty, id: "shareContactBySMS", handleChange: handleChangeValue, placeholder: t('contacts.placeholders.sms'), value: value, type: "number", onBlur: handleSetIsDirtyToTrue }), _jsx(AddReceiverButton, { onClick: handleAdd, isDisabled: isEmptyField(value) })] })] }), _jsx(SendToList, { sendTo: sendTo, onDelete: handleDelete })] }));
|
|
11
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Stack, Flex, IconButton } from '@chakra-ui/react';
|
|
3
|
+
import { TrashIcon, ContactCard } from '../..';
|
|
4
|
+
export const SelectedContacts = ({ contacts, onDeleteSelected, }) => {
|
|
5
|
+
return (_jsx(Stack, { spacing: "1", p: "4", bg: "lightBlue.5", maxH: "300px", overflowY: "scroll", children: contacts.map((contact, index) => (_jsxs(Flex, { align: "center", children: [_jsx(ContactCard, { contact: contact, index: index, showHeader: false, showAvatar: false }, contact._id), _jsx(IconButton, { "aria-label": "Remove field", variant: "unstyled", icon: _jsx(TrashIcon, {}), size: "md", position: "relative", right: "-16px", transition: "all 0.2s ease-in-out", _hover: {
|
|
6
|
+
filter: 'brightness(0.7)',
|
|
7
|
+
}, onClick: () => onDeleteSelected(contact._id) })] }, contact._id))) }));
|
|
8
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { t } from 'i18next';
|
|
14
|
+
import { DrawerContent, DrawerHeader, DrawerBody, Stack, DrawerFooter, } from '@chakra-ui/react';
|
|
15
|
+
import { Contacts } from '../../../assets/images';
|
|
16
|
+
import { FooterButtons, FooterDrawer, PanelHeader, SelectedContacts, ShareContactSection, } from '../..';
|
|
17
|
+
import { useShareContactsContent } from '../../../hooks';
|
|
18
|
+
export const ShareContactsContent = (_a) => {
|
|
19
|
+
var { contacts, onClose, onShare } = _a, props = __rest(_a, ["contacts", "onClose", "onShare"]);
|
|
20
|
+
const { contactsSelected, recipientsToSend, handleAddRecipient, handleDeleteSelectedContact, handleShareContacts, } = useShareContactsContent({ contacts, onShare });
|
|
21
|
+
const numberOfContacts = Number(contacts.length);
|
|
22
|
+
return (_jsxs(DrawerContent, { bg: "lightBlue.1", children: [_jsx(DrawerHeader, { p: "0", children: _jsx(PanelHeader, { handleCloseButton: onClose, icon: Contacts, title: `${t('contacts.shareContact')} (${numberOfContacts})` }) }), _jsx(DrawerBody, { p: "0", overflowX: "hidden", overflowY: "scroll", bg: "lightBlue.2", children: _jsxs(Stack, { pb: "120px", spacing: "0", children: [_jsx(SelectedContacts, { contacts: contactsSelected, onDeleteSelected: handleDeleteSelectedContact }), _jsx(ShareContactSection, Object.assign({}, props, { onShare: handleAddRecipient }))] }) }), _jsx(DrawerFooter, { p: "0", children: _jsx(FooterDrawer, { isOpen: true, children: _jsx(FooterButtons, { button1: {
|
|
23
|
+
buttonStyle: 'primaryFooter',
|
|
24
|
+
label: t('buttons.send'),
|
|
25
|
+
isDisabled: Number(recipientsToSend.length) === 0,
|
|
26
|
+
onClick: handleShareContacts,
|
|
27
|
+
} }) }) })] }));
|
|
28
|
+
};
|
|
@@ -11,10 +11,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { useState } from 'react';
|
|
14
|
+
import { t } from 'i18next';
|
|
14
15
|
import { HomeAssistantSteps, HomeAssistantTutorial, HomeAssistantWrapper, } from '..';
|
|
15
16
|
export const HomeAssistant = (_a) => {
|
|
16
17
|
var { showTutorial = false, tutorialUrl = '' } = _a, props = __rest(_a, ["showTutorial", "tutorialUrl"]);
|
|
17
18
|
const [startSetup, setStartSetup] = useState(false);
|
|
18
19
|
const showAirplane = props.currentStep === 6 && (!showTutorial || startSetup);
|
|
19
|
-
return (_jsxs(HomeAssistantWrapper, { showAirplane: showAirplane, children: [!startSetup && showTutorial && (_jsx(HomeAssistantTutorial, { onStart: () => setStartSetup(true), videoUrl: tutorialUrl })), (startSetup || !showTutorial) && _jsx(HomeAssistantSteps, Object.assign({}, props))] }));
|
|
20
|
+
return (_jsxs(HomeAssistantWrapper, { showAirplane: showAirplane, title: t('homeAssistant.title'), children: [!startSetup && showTutorial && (_jsx(HomeAssistantTutorial, { onStart: () => setStartSetup(true), videoUrl: tutorialUrl })), (startSetup || !showTutorial) && _jsx(HomeAssistantSteps, Object.assign({}, props))] }));
|
|
20
21
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
export declare const HomeAssistantWrapper: ({ children, showAirplane, }: PropsWithChildren<{
|
|
2
|
+
export declare const HomeAssistantWrapper: ({ children, showAirplane, title, }: PropsWithChildren<{
|
|
3
3
|
showAirplane?: boolean;
|
|
4
|
+
title: string;
|
|
4
5
|
}>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { t } from 'i18next';
|
|
3
2
|
import { Box, Center, GridItem, Image } from '@chakra-ui/react';
|
|
4
3
|
import { ContainerHeader, TileTooltip, moveRightToLeftWithFade, moveRightToLeft, moveLeftToRightAirplane, } from '..';
|
|
5
4
|
import { Airplane, Cloud1, Cloud2, Cloud3, IA, TreesCrop, } from '../../assets/images';
|
|
6
5
|
import { getImageAltText } from '../../utils';
|
|
7
6
|
import { colors } from '../../theme/colors';
|
|
8
|
-
export const HomeAssistantWrapper = ({ children, showAirplane, }) => {
|
|
7
|
+
export const HomeAssistantWrapper = ({ children, showAirplane, title, }) => {
|
|
9
8
|
const treesAlt = getImageAltText(TreesCrop);
|
|
10
|
-
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:
|
|
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`, zIndex: "1" }), _jsx(Image, { src: Cloud2, position: "absolute", w: "auto", h: "112px", top: "150px", animation: `${moveRightToLeft} 200s linear infinite`, zIndex: "1" }), _jsx(Image, { src: Cloud3, position: "absolute", w: "auto", h: "160px", top: "200px", animation: `${moveRightToLeft} 130s linear infinite`, zIndex: "1" }), showAirplane && (_jsx(Image, { src: Airplane, position: "absolute", w: "auto", h: "40px", top: "85px", animation: `${moveLeftToRightAirplane} 500s cubic-bezier(1, 1, 1, 500) infinite`, zIndex: "1" })), _jsx(Image, { src: TreesCrop, alt: treesAlt, position: "absolute", bottom: "0", right: "2", w: "auto", h: "70px", zIndex: "1" })] }) }) }));
|
|
11
10
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { t } from 'i18next';
|
|
3
|
+
import { HomeAssistantWrapper } from '..';
|
|
4
|
+
export const HomeMonitor = ({ children }) => {
|
|
5
|
+
return (_jsx(HomeAssistantWrapper, { showAirplane: true, title: t('homeAssistant.homeMonitor'), children: children }));
|
|
6
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Center, Image, Stack, Text } from '@chakra-ui/react';
|
|
3
|
+
import { getIconAltText } from '../../utils';
|
|
4
|
+
export const HomeMonitorButton = ({ currentStep, onStepClick, status, step, }) => {
|
|
5
|
+
const iconAltText = getIconAltText(step.icon);
|
|
6
|
+
const handleClick = () => {
|
|
7
|
+
console.log({ status });
|
|
8
|
+
if (status !== 'ok')
|
|
9
|
+
onStepClick(currentStep);
|
|
10
|
+
};
|
|
11
|
+
return (_jsx(Box, { children: _jsxs(Stack, Object.assign({ as: "button", spacing: "2", borderRadius: "lg", boxShadow: "lg", border: "1px solid transparent", w: "90px", align: "center", h: "96px", py: "base", bg: "neutral.white" }, setStyles(status), { onClick: handleClick, children: [_jsx(Center, { h: "60%", 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 }) })] })) }));
|
|
12
|
+
};
|
|
13
|
+
const setStyles = (status) => {
|
|
14
|
+
switch (status) {
|
|
15
|
+
case 'alert':
|
|
16
|
+
return {
|
|
17
|
+
cursor: 'pointer',
|
|
18
|
+
border: '1px solid',
|
|
19
|
+
borderColor: 'error.2',
|
|
20
|
+
transition: 'all 0.3s',
|
|
21
|
+
_hover: {
|
|
22
|
+
bg: 'lightGreen.7',
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
case 'ok':
|
|
26
|
+
return {
|
|
27
|
+
cursor: 'not-allowed',
|
|
28
|
+
filter: 'grayscale(1) opacity(0.6)',
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Flex } from '@chakra-ui/react';
|
|
3
|
+
import { HomeMonitorButton } from '..';
|
|
4
|
+
import { homeAssistantSteps } from '../../helpers';
|
|
5
|
+
export const HomeMonitorSteps = ({ onStepClick, stepsWithAlerts, }) => {
|
|
6
|
+
return (_jsx(Flex, { gap: "base", children: homeAssistantSteps.map((step, index) => (_jsx(Box, { flex: "auto", children: _jsx(HomeMonitorButton, { currentStep: index + 1, onStepClick: onStepClick, status: getStatus(index + 1, stepsWithAlerts), step: step }) }, step.title))) }));
|
|
7
|
+
};
|
|
8
|
+
const getStatus = (index, stepsWithAlerts) => {
|
|
9
|
+
const hasAlert = stepsWithAlerts.includes(index);
|
|
10
|
+
return hasAlert ? 'alert' : 'ok';
|
|
11
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './monitorAlerts';
|
|
1
2
|
export * from './panel';
|
|
2
3
|
export * from './HomeAssistant';
|
|
3
4
|
export * from './HomeAssistantButton';
|
|
@@ -5,3 +6,6 @@ export * from './HomeAssistantStepper';
|
|
|
5
6
|
export * from './HomeAssistantSteps';
|
|
6
7
|
export * from './HomeAssistantTutorial';
|
|
7
8
|
export * from './HomeAssistantWrapper';
|
|
9
|
+
export * from './HomeMonitor';
|
|
10
|
+
export * from './HomeMonitorButton';
|
|
11
|
+
export * from './HomeMonitorSteps';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './monitorAlerts';
|
|
1
2
|
export * from './panel';
|
|
2
3
|
export * from './HomeAssistant';
|
|
3
4
|
export * from './HomeAssistantButton';
|
|
@@ -5,3 +6,6 @@ export * from './HomeAssistantStepper';
|
|
|
5
6
|
export * from './HomeAssistantSteps';
|
|
6
7
|
export * from './HomeAssistantTutorial';
|
|
7
8
|
export * from './HomeAssistantWrapper';
|
|
9
|
+
export * from './HomeMonitor';
|
|
10
|
+
export * from './HomeMonitorButton';
|
|
11
|
+
export * from './HomeMonitorSteps';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AlertHeader: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { t } from 'i18next';
|
|
3
|
+
import { Flex, Center, Image, Text } from '@chakra-ui/react';
|
|
4
|
+
import { Exclamation } from '../../../assets/images';
|
|
5
|
+
export const AlertHeader = () => {
|
|
6
|
+
return (_jsx(Flex, { justifyContent: "space-between", px: "base", py: "1", bg: "error.2", borderTopRadius: "lg", align: "center", children: _jsxs(Flex, { align: "center", gap: "2", children: [_jsx(Center, { p: "1", borderRadius: "full", bg: "pink.1", h: "18px", w: "18px", children: _jsx(Image, { src: Exclamation, h: "100%", w: "auto" }) }), _jsx(Text, { color: "white", fontSize: "sm", fontWeight: "medium", textTransform: "uppercase", children: t('homeAssistant.monitorAlerts.homeAction') })] }) }));
|
|
7
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Center, Flex, Image, Stack, Text } from '@chakra-ui/react';
|
|
3
|
+
export const AlertTemplate = ({ bg = 'error.1', description, icon, title, }) => {
|
|
4
|
+
return (_jsxs(Flex, { gap: "base", px: "base", pt: "1", pb: "4", children: [_jsx(Center, { minW: "60px", h: "60px", bg: bg, borderRadius: "md", children: _jsx(Image, { src: icon, maxH: "36px", w: "auto" }) }), _jsxs(Stack, { children: [_jsx(Text, { fontWeight: "semibold", fontSize: "xl", lineHeight: "1.2", children: title }), _jsx(Text, { fontFamily: "secondary", fontSize: "sm", lineHeight: "1.2", children: description })] })] }));
|
|
5
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Flex, Image, Text } from '@chakra-ui/react';
|
|
3
|
+
export const AlertTitle = ({ alertIcon, alertTitle, }) => {
|
|
4
|
+
return (_jsxs(Flex, { align: "center", gap: "1", p: "base", children: [_jsx(Image, { src: alertIcon, h: "20px", w: "20px" }), _jsx(Text, { fontSize: "xs", textTransform: "uppercase", children: alertTitle })] }));
|
|
5
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
import { t } from 'i18next';
|
|
14
|
+
import { Box, Button, Collapse, Flex, useDisclosure } from '@chakra-ui/react';
|
|
15
|
+
import { AlertHeader, AlertTemplate, AlertTitle, Overlay } from '../..';
|
|
16
|
+
import { Warranty } from '../../../assets/images';
|
|
17
|
+
export const BaseAlertCard = (_a) => {
|
|
18
|
+
var { alertIcon = Warranty, alertTitle = t('homeAssistant.monitorAlerts.protection'), children } = _a, props = __rest(_a, ["alertIcon", "alertTitle", "children"]);
|
|
19
|
+
const { isOpen, onToggle } = useDisclosure();
|
|
20
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Box, { display: "flex", flexDir: "column", bg: "neutral.white", boxShadow: "lg", borderRadius: "lg", overflow: "hidden", maxW: "420px", position: isOpen ? 'absolute' : 'relative', top: isOpen ? '4' : 'auto', left: isOpen ? 'calc(50% - 218px)' : 'auto', zIndex: "popover", children: [_jsx(AlertHeader, {}), _jsx(AlertTitle, { alertIcon: alertIcon, alertTitle: alertTitle }), _jsx(AlertTemplate, Object.assign({}, props)), _jsx(Collapse, { in: isOpen, animateOpacity: true, children: _jsx(Box, { p: "base", bg: "lightBlue.1", children: children }) }), _jsx(Flex, { py: "base", bg: "lightBlue.1", justify: "flex-end", children: _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'}`) }) })] }), _jsx(Overlay, { bg: "overlayWhite", showOverlay: isOpen, position: "absolute", zIndex: "modal" })] }));
|
|
21
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { t } from 'i18next';
|
|
3
|
+
import { BaseAlertCard, ChangeAirFilter, SmokeDetectorBattery, SmokeDetectorExpired, } from '../..';
|
|
4
|
+
import { Battery, Fire, GearTime, WindWhite } from '../../../assets/images';
|
|
5
|
+
export const MonitorAlerts = ({ alertId }) => {
|
|
6
|
+
const alertChildren = {
|
|
7
|
+
'smoke-detector-battery': _jsx(SmokeDetectorBattery, {}),
|
|
8
|
+
'smoke-detector-expired': _jsx(SmokeDetectorExpired, {}),
|
|
9
|
+
'change-air-filter': _jsx(ChangeAirFilter, {}),
|
|
10
|
+
};
|
|
11
|
+
const alerts = {
|
|
12
|
+
'change-air-filter': {
|
|
13
|
+
bg: 'lightBlue.8',
|
|
14
|
+
alertIcon: GearTime,
|
|
15
|
+
alertTitle: t('homeAssistant.monitorAlerts.maintenance'),
|
|
16
|
+
icon: WindWhite,
|
|
17
|
+
title: t('homeAssistant.alerts.airFilter.main.title'),
|
|
18
|
+
description: t('homeAssistant.alerts.airFilter.main.description'),
|
|
19
|
+
},
|
|
20
|
+
'smoke-detector-battery': {
|
|
21
|
+
icon: Battery,
|
|
22
|
+
title: t('homeAssistant.alerts.smokeDetectorBattery.main.title'),
|
|
23
|
+
description: t('homeAssistant.alerts.smokeDetectorBattery.main.description'),
|
|
24
|
+
},
|
|
25
|
+
'smoke-detector-expired': {
|
|
26
|
+
icon: Fire,
|
|
27
|
+
title: t('homeAssistant.alerts.smokeDetectorExpired.main.title'),
|
|
28
|
+
description: t('homeAssistant.alerts.smokeDetectorExpired.main.description'),
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
return (_jsx(BaseAlertCard, Object.assign({}, alerts[alertId], { children: alertChildren[alertId] })));
|
|
32
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Stack, Flex, Center, Text } from '@chakra-ui/react';
|
|
3
|
+
import { t } from 'i18next';
|
|
4
|
+
export const Notifications = ({ date = '', local = '' }) => {
|
|
5
|
+
return (_jsxs(Stack, { spacing: "base", minH: "full", zIndex: "2", children: [_jsxs(Flex, { justify: "space-between", children: [_jsx(CustomText, { children: date }), _jsx(CustomText, { children: local })] }), _jsx(Center, { w: "188px", h: "full", border: "1px dashed", borderColor: "blue.1", borderRadius: "sm", children: _jsx(Text, { fontSize: "sm", fontFamily: "secondary", children: t('homeAssistant.notifications') }) })] }));
|
|
6
|
+
};
|
|
7
|
+
const CustomText = ({ children = '' }) => {
|
|
8
|
+
return (_jsx(Text, { fontSize: "sm", fontFamily: "secondary", textTransform: "uppercase", children: children }));
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ChangeAirFilter: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { t } from 'i18next';
|
|
3
|
+
import { Box, Flex, Stack, Text } from '@chakra-ui/react';
|
|
4
|
+
import { CustomBadge } from '../../../badge';
|
|
5
|
+
import { CustomDivider } from '../../..';
|
|
6
|
+
export const ChangeAirFilter = () => {
|
|
7
|
+
return (_jsxs(Stack, { spacing: "base", children: [_jsx(Text, { fontSize: "sm", fontFamily: "secondary", lineHeight: "1.2", children: t('homeAssistant.alerts.airFilter.description') }), _jsx(CustomDivider, {}), _jsx(Text, { fontWeight: "semibold", children: t('homeAssistant.alerts.airFilter.title') }), _jsx(CustomDivider, {}), _jsx(FilterType, { badgeText: t('homeAssistant.alerts.airFilter.bestBadge'), title: t('homeAssistant.alerts.airFilter.best.title'), description: t('homeAssistant.alerts.airFilter.best.description') }), _jsx(CustomDivider, {}), _jsx(FilterType, { badgeText: t('homeAssistant.alerts.airFilter.betterBadge'), title: t('homeAssistant.alerts.airFilter.better.title'), description: t('homeAssistant.alerts.airFilter.better.description'), bg: "blue.11" })] }));
|
|
8
|
+
};
|
|
9
|
+
const FilterType = ({ badgeText = '', title = '', description = '', bg = 'blue.10', }) => {
|
|
10
|
+
return (_jsxs(Flex, { gap: "base", children: [_jsx(Box, { h: "fit-content", minW: "48px", children: _jsx(CustomBadge, { label: badgeText, bg: bg }) }), _jsxs(Stack, { spacing: "1", children: [_jsx(Text, { fontSize: "sm", fontWeight: "semibold", lineHeight: "1.2", children: title }), _jsx(Text, { fontSize: "sm", fontFamily: "secondary", lineHeight: "1.2", children: description })] })] }));
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CustomDivider: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SmokeDetectorBattery: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { t } from 'i18next';
|
|
3
|
+
import { Box, Flex, Stack, Text } from '@chakra-ui/react';
|
|
4
|
+
import { CustomBadge } from '../../../badge';
|
|
5
|
+
import { CustomDivider } from '../../..';
|
|
6
|
+
export const SmokeDetectorBattery = () => {
|
|
7
|
+
return (_jsxs(Stack, { spacing: "base", children: [_jsx(Text, { fontWeight: "semibold", children: t('homeAssistant.alerts.smokeDetectorBattery.title') }), _jsx(CustomDivider, {}), _jsx(BatteryType, { badgeText: t('homeAssistant.alerts.smokeDetectorBattery.bestBadge'), title: t('homeAssistant.alerts.smokeDetectorBattery.best.title'), description: t('homeAssistant.alerts.smokeDetectorBattery.best.description') }), _jsx(CustomDivider, {}), _jsx(BatteryType, { badgeText: t('homeAssistant.alerts.smokeDetectorBattery.betterBadge'), title: t('homeAssistant.alerts.smokeDetectorBattery.better.title'), description: t('homeAssistant.alerts.smokeDetectorBattery.better.description'), bg: "blue.11" })] }));
|
|
8
|
+
};
|
|
9
|
+
const BatteryType = ({ badgeText = '', title = '', description = '', bg = 'blue.10', }) => {
|
|
10
|
+
return (_jsxs(Flex, { gap: "base", children: [_jsx(Box, { h: "fit-content", minW: "48px", children: _jsx(CustomBadge, { label: badgeText, bg: bg }) }), _jsxs(Stack, { spacing: "1", children: [_jsx(Text, { fontSize: "sm", fontWeight: "semibold", lineHeight: "1.2", children: title }), _jsx(Text, { fontSize: "sm", fontFamily: "secondary", lineHeight: "1.2", children: description })] })] }));
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SmokeDetectorExpired: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { t } from 'i18next';
|
|
3
|
+
import { Box, Flex, Image, Stack, Text } from '@chakra-ui/react';
|
|
4
|
+
import { CustomDivider } from '../../..';
|
|
5
|
+
import { SmokeDetectroExpiredImage } from '../../../../assets/images';
|
|
6
|
+
export const SmokeDetectorExpired = () => {
|
|
7
|
+
return (_jsxs(Stack, { spacing: "base", children: [_jsx(Text, { fontSize: "sm", fontFamily: "secondary", lineHeight: "1.2", children: t('homeAssistant.alerts.smokeDetectorExpired.description') }), _jsx(CustomDivider, {}), _jsx(Text, { fontWeight: "semibold", children: t('homeAssistant.alerts.smokeDetectorExpired.title') }), _jsxs(Flex, { gap: "base", children: [_jsx(Image, { src: SmokeDetectroExpiredImage, boxSize: "84px" }), _jsxs(Stack, { spacing: "1", children: [_jsx(CheckItem, { text: t('homeAssistant.alerts.smokeDetectorExpired.check1') }), _jsx(CheckItem, { text: t('homeAssistant.alerts.smokeDetectorExpired.check2') }), _jsx(CheckItem, { text: t('homeAssistant.alerts.smokeDetectorExpired.check3') })] })] })] }));
|
|
8
|
+
};
|
|
9
|
+
const CheckItem = ({ text = '' }) => {
|
|
10
|
+
return (_jsxs(Flex, { align: "center", gap: "base", children: [_jsx(Box, { boxSize: "6px", borderRadius: "full", bg: "gray.3" }), _jsx(Text, { fontSize: "sm", fontFamily: "secondary", children: text })] }));
|
|
11
|
+
};
|
|
@@ -9,7 +9,7 @@ import { useSimpleDynamicForm } from '../../../hooks';
|
|
|
9
9
|
export const HomeAssistantPanel = ({ children, currentForm, currentStep, onApplianceClick, onBack, onClose, onNext, onSave, backDisabled, nextDisabled, }) => {
|
|
10
10
|
const { title } = homeAssistantSteps[currentStep - 1];
|
|
11
11
|
const text = `${t('homeAssistant.details')} ${title.toLowerCase()}:`;
|
|
12
|
-
const isAppliances = currentStep ===
|
|
12
|
+
const isAppliances = currentStep === 4;
|
|
13
13
|
const { form, updatedFields } = useSimpleDynamicForm({
|
|
14
14
|
fields: currentForm,
|
|
15
15
|
});
|
|
@@ -45,7 +45,7 @@ export const HomeBoard = () => {
|
|
|
45
45
|
label: 'Edit Contact',
|
|
46
46
|
handleClick: () => null,
|
|
47
47
|
},
|
|
48
|
-
],
|
|
48
|
+
], onShareContacts: () => null, onDeleteContacts: () => null })),
|
|
49
49
|
PartnerCatalog: (_jsx(PartnerCatalogPanel, { onClose: onRightClose, onPartnerAdd: () => null, partners: partnerCatalogMock })),
|
|
50
50
|
AddHouseholdItem: (_jsxs(DrawerContent, { bg: "lightBlue.1", children: [_jsx(DrawerHeader, { p: "0", children: _jsx(PanelHeader, { handleCloseButton: handleClose, icon: Painting, title: "Add Household Item" }) }), _jsx(DrawerBody, { children: _jsx(DynamicForm, { form: formFieldsMock }) })] })),
|
|
51
51
|
HomeAssistant: (_jsx(HomeAssistantPanel, { currentStep: homeAssistantCurrentStep, currentForm: currentHomeAssistantForm, onNext: handleHomeAssistantFormChange, onBack: handleHomeAssistantBack, onApplianceClick: () => null, onClose: onRightClose, onSave: () => { }, backDisabled: false, nextDisabled: false })),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { InputI } from '../../interfaces';
|
|
2
|
-
export declare const TextInput: ({ autoCapitalize, autoCorrect, errorMessage, handleChange, hasError, id, isDisabled, placeholder, value, ...props }: InputI) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const TextInput: ({ autoCapitalize, autoCorrect, errorMessage, handleChange, hasError, id, isDisabled, placeholder, value, type, ...props }: InputI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { FormControl, Text, Input, Tooltip } from '@chakra-ui/react';
|
|
14
14
|
export const TextInput = (_a) => {
|
|
15
|
-
var { autoCapitalize = 'on', autoCorrect = 'on', errorMessage, handleChange, hasError, id, isDisabled, placeholder, value = '' } = _a, props = __rest(_a, ["autoCapitalize", "autoCorrect", "errorMessage", "handleChange", "hasError", "id", "isDisabled", "placeholder", "value"]);
|
|
15
|
+
var { autoCapitalize = 'on', autoCorrect = 'on', errorMessage, handleChange, hasError, id, isDisabled, placeholder, value = '', type = 'text' } = _a, props = __rest(_a, ["autoCapitalize", "autoCorrect", "errorMessage", "handleChange", "hasError", "id", "isDisabled", "placeholder", "value", "type"]);
|
|
16
16
|
const error = hasError && !isDisabled;
|
|
17
|
-
return (_jsxs(FormControl, { isInvalid: error, children: [_jsx(Tooltip, { label: placeholder, children: _jsx(Input, Object.assign({}, props, { autoCapitalize: autoCapitalize, autoCorrect: autoCorrect, id: id, placeholder: placeholder,
|
|
17
|
+
return (_jsxs(FormControl, { isInvalid: error, children: [_jsx(Tooltip, { label: placeholder, children: _jsx(Input, Object.assign({}, props, { autoCapitalize: autoCapitalize, autoCorrect: autoCorrect, id: id, placeholder: placeholder, value: value, type: type, onChange: handleChange, isInvalid: error, isDisabled: isDisabled, _placeholder: { color: 'gray.2' } })) }), error && _jsx(Text, { variant: "error", children: errorMessage })] }));
|
|
18
18
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { PartnerFooterI } from '../../interfaces';
|
|
2
|
-
export declare const PartnerFooter: ({ socialLinks, websiteUrl, }: PartnerFooterI) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const PartnerFooter: ({ socialLinks, websiteUrl, urlText, }: PartnerFooterI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Flex, IconButton, Link, Text } from '@chakra-ui/react';
|
|
3
3
|
import { SocialIcons } from '..';
|
|
4
|
-
export const PartnerFooter = ({ socialLinks = [], websiteUrl, }) => {
|
|
4
|
+
export const PartnerFooter = ({ socialLinks = [], websiteUrl, urlText, }) => {
|
|
5
5
|
var _a;
|
|
6
6
|
const hasSocialLinks = (socialLinks === null || socialLinks === void 0 ? void 0 : socialLinks.length) > 0;
|
|
7
7
|
const cleanedWebsiteUrl = (_a = websiteUrl === null || websiteUrl === void 0 ? void 0 : websiteUrl.replace(/(^\w+:)/, '')) === null || _a === void 0 ? void 0 : _a.replace(/\//g, '');
|
|
@@ -10,5 +10,5 @@ export const PartnerFooter = ({ socialLinks = [], websiteUrl, }) => {
|
|
|
10
10
|
return;
|
|
11
11
|
window.open(url, '_blank');
|
|
12
12
|
};
|
|
13
|
-
return (_jsxs(Flex, { align: "center", justify: "space-between", p: "base", children: [_jsx(Link, { href: websiteUrl, isExternal: true, children: _jsx(Text, { fontSize: "xs", color: "blue.3", children: cleanedWebsiteUrl }) }), hasSocialLinks && (_jsx(Flex, { align: "center", gap: "1", children: socialLinks === null || socialLinks === void 0 ? void 0 : socialLinks.map(({ name, link }) => (_jsx(IconButton, { variant: "unstyled", w: "fit-content", "aria-label": "Instagram", icon: SocialIcons({ size: 20, name }), onClick: () => handleSocialClick(link) }, name))) }))] }));
|
|
13
|
+
return (_jsxs(Flex, { align: "center", justify: "space-between", p: "base", children: [_jsx(Link, { href: websiteUrl, isExternal: true, children: _jsx(Text, { fontSize: "xs", color: "blue.3", children: urlText !== null && urlText !== void 0 ? urlText : cleanedWebsiteUrl }) }), hasSocialLinks && (_jsx(Flex, { align: "center", gap: "1", children: socialLinks === null || socialLinks === void 0 ? void 0 : socialLinks.map(({ name, link }) => (_jsx(IconButton, { variant: "unstyled", w: "fit-content", "aria-label": "Instagram", icon: SocialIcons({ size: 20, name }), onClick: () => handleSocialClick(link) }, name))) }))] }));
|
|
14
14
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ShortPartnerTileI } from '../../interfaces';
|
|
2
|
-
export declare const ShortPartnerTile: ({ buttonText, description, imageUrl, logo, menuItems, minimized, onClick, socialLinks, partnerName, websiteUrl, }: ShortPartnerTileI) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const ShortPartnerTile: ({ buttonText, description, imageUrl, logo, menuItems, minimized, onClick, socialLinks, partnerName, websiteUrl, urlText }: ShortPartnerTileI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Flex } from '@chakra-ui/react';
|
|
3
3
|
import { Fader, PartnerCallToAction, PartnerFooter, PartnerHeader, PartnerImage, PartnerTileWrapper, } from '..';
|
|
4
|
-
export const ShortPartnerTile = ({ buttonText, description, imageUrl, logo, menuItems, minimized, onClick, socialLinks, partnerName, websiteUrl, }) => {
|
|
4
|
+
export const ShortPartnerTile = ({ buttonText, description, imageUrl, logo, menuItems, minimized, onClick, socialLinks, partnerName, websiteUrl, urlText }) => {
|
|
5
5
|
const callToAction = { description, buttonText, onClick };
|
|
6
6
|
const header = { logo, menuItems, partnerName };
|
|
7
7
|
const image = { imageUrl, partnerName };
|
|
8
|
-
const footer = { socialLinks, websiteUrl };
|
|
8
|
+
const footer = { socialLinks, websiteUrl, urlText };
|
|
9
9
|
return (_jsxs(PartnerTileWrapper, { children: [_jsx(PartnerHeader, Object.assign({}, header)), !minimized && (_jsx(Fader, { children: _jsxs(Flex, { flexDir: "column", h: "400px", justifyContent: "space-between", children: [_jsx(PartnerImage, Object.assign({}, image)), _jsxs(Box, { children: [_jsx(PartnerCallToAction, Object.assign({}, callToAction)), _jsx(PartnerFooter, Object.assign({}, footer))] })] }) }))] }));
|
|
10
10
|
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Fire, House, LargeAppliances, Target, Temperature, Water, } from '../../assets/images';
|
|
2
2
|
export const homeAssistantSteps = [
|
|
3
|
+
{
|
|
4
|
+
title: 'Goals',
|
|
5
|
+
icon: Target,
|
|
6
|
+
},
|
|
3
7
|
{
|
|
4
8
|
title: 'Smoke & CO2 detectors',
|
|
5
9
|
icon: Fire,
|
|
@@ -20,8 +24,4 @@ export const homeAssistantSteps = [
|
|
|
20
24
|
title: 'Landscape',
|
|
21
25
|
icon: Water,
|
|
22
26
|
},
|
|
23
|
-
{
|
|
24
|
-
title: 'Goals',
|
|
25
|
-
icon: Target,
|
|
26
|
-
},
|
|
27
27
|
];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ChangeEvent } from 'react';
|
|
2
2
|
import { InfoContactCardI } from '../../interfaces';
|
|
3
3
|
export declare const useContactsContent: (contacts: InfoContactCardI[]) => {
|
|
4
|
-
|
|
4
|
+
contactsWithoutFirstOrLastName: InfoContactCardI[];
|
|
5
5
|
handleChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
6
6
|
search: string;
|
|
7
|
+
splittedContacts: Record<string, InfoContactCardI[]>;
|
|
7
8
|
};
|