@homefile/components-v2 1.2.2 → 1.4.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/circle-face.svg +21 -0
- package/dist/assets/images/company.svg +34 -0
- package/dist/assets/images/index.d.ts +5 -1
- package/dist/assets/images/index.js +5 -1
- package/dist/assets/images/index.ts +7 -0
- package/dist/assets/images/location.jpg +0 -0
- package/dist/assets/images/logos/index.d.ts +2 -1
- package/dist/assets/images/logos/index.js +2 -1
- package/dist/assets/images/logos/index.ts +12 -1
- package/dist/assets/images/logos/shine.png +0 -0
- package/dist/assets/images/shine/gutter-cleaning.png +0 -0
- package/dist/assets/images/shine/holiday-lights.png +0 -0
- package/dist/assets/images/shine/home-cleaning.png +0 -0
- package/dist/assets/images/shine/index.d.ts +7 -0
- package/dist/assets/images/shine/index.js +7 -0
- package/dist/assets/images/shine/index.ts +15 -0
- package/dist/assets/images/shine/pressure.png +0 -0
- package/dist/assets/images/shine/roof-cleaning.png +0 -0
- package/dist/assets/images/shine/window.png +0 -0
- package/dist/assets/locales/en/index.json +23 -1
- package/dist/components/animations/CloudsAnimation.js +1 -1
- package/dist/components/contacts/ContactCard.d.ts +1 -1
- package/dist/components/contacts/ContactCard.js +8 -3
- package/dist/components/contacts/ContactCardHeader.d.ts +1 -1
- package/dist/components/contacts/ContactCardHeader.js +5 -6
- package/dist/components/contacts/ContactHeaderMenu.d.ts +2 -0
- package/dist/components/contacts/ContactHeaderMenu.js +7 -0
- package/dist/components/contacts/ContactsContent.d.ts +1 -1
- package/dist/components/contacts/ContactsContent.js +2 -2
- package/dist/components/contacts/addEditPanel/AddEditContactPanel.d.ts +2 -0
- package/dist/components/contacts/addEditPanel/AddEditContactPanel.js +24 -0
- package/dist/components/contacts/addEditPanel/index.d.ts +1 -0
- package/dist/components/contacts/addEditPanel/index.js +1 -0
- package/dist/components/contacts/index.d.ts +3 -0
- package/dist/components/contacts/index.js +3 -0
- package/dist/components/contacts/viewPanel/CompanyInfoCard.d.ts +2 -0
- package/dist/components/contacts/viewPanel/CompanyInfoCard.js +13 -0
- package/dist/components/contacts/viewPanel/CompanyRating.d.ts +3 -0
- package/dist/components/contacts/viewPanel/CompanyRating.js +27 -0
- package/dist/components/contacts/viewPanel/ContactAddressCard.d.ts +2 -0
- package/dist/components/contacts/viewPanel/ContactAddressCard.js +12 -0
- package/dist/components/contacts/viewPanel/ContactNotes.d.ts +3 -0
- package/dist/components/contacts/viewPanel/ContactNotes.js +8 -0
- package/dist/components/contacts/viewPanel/PersonalInfoCard.d.ts +2 -0
- package/dist/components/contacts/viewPanel/PersonalInfoCard.js +8 -0
- package/dist/components/contacts/viewPanel/RoleTag.d.ts +2 -0
- package/dist/components/contacts/viewPanel/RoleTag.js +9 -0
- package/dist/components/contacts/viewPanel/ViewContactHeader.d.ts +2 -0
- package/dist/components/contacts/viewPanel/ViewContactHeader.js +11 -0
- package/dist/components/contacts/viewPanel/ViewContactPanel.d.ts +2 -0
- package/dist/components/contacts/viewPanel/ViewContactPanel.js +9 -0
- package/dist/components/contacts/viewPanel/index.d.ts +8 -0
- package/dist/components/contacts/viewPanel/index.js +8 -0
- package/dist/components/forms/dynamicForm/DynamicForm.d.ts +1 -1
- package/dist/components/forms/dynamicForm/DynamicForm.js +5 -5
- package/dist/components/forms/dynamicForm/SimpleDynamicForm.d.ts +2 -0
- package/dist/components/forms/dynamicForm/SimpleDynamicForm.js +29 -0
- package/dist/components/forms/dynamicForm/fields/FieldWithDelete.d.ts +1 -1
- package/dist/components/forms/dynamicForm/fields/FieldWithDelete.js +2 -3
- package/dist/components/forms/dynamicForm/fields/GroupField.d.ts +1 -1
- package/dist/components/forms/dynamicForm/fields/GroupField.js +2 -2
- package/dist/components/forms/dynamicForm/index.d.ts +1 -1
- package/dist/components/forms/dynamicForm/index.js +1 -1
- package/dist/components/homeAssistant/panel/ApplianceSteps.d.ts +1 -1
- package/dist/components/homeAssistant/panel/ApplianceSteps.js +2 -2
- package/dist/components/homeAssistant/panel/HomeAssistantPanel.d.ts +1 -1
- package/dist/components/homeAssistant/panel/HomeAssistantPanel.js +14 -7
- package/dist/components/homeBoard/HomeBoard.js +1 -1
- package/dist/components/homeBoard/HomeCardWithRecipent.d.ts +1 -1
- package/dist/components/homeBoard/HomeCardWithRecipent.js +8 -2
- package/dist/components/onboarding/pages/ActivateAccount.js +2 -2
- package/dist/components/onboarding/pages/BasePageWrapper.d.ts +2 -0
- package/dist/components/onboarding/pages/BasePageWrapper.js +5 -0
- package/dist/components/onboarding/pages/EmailValidation.js +3 -3
- package/dist/components/onboarding/pages/NewPassword.js +2 -2
- package/dist/components/onboarding/pages/ResendResetPassword.js +3 -3
- package/dist/components/onboarding/pages/ResetPassword.js +2 -2
- package/dist/components/onboarding/pages/SignIn.js +2 -2
- package/dist/components/onboarding/pages/SignUp.js +5 -5
- package/dist/components/onboarding/pages/TwoFactor.js +2 -2
- package/dist/components/onboarding/pages/index.d.ts +10 -9
- package/dist/components/onboarding/pages/index.js +10 -9
- package/dist/components/partner/customPartnerTiles/ShineTile.d.ts +2 -0
- package/dist/components/partner/customPartnerTiles/ShineTile.js +56 -0
- package/dist/components/partner/customPartnerTiles/index.d.ts +1 -0
- package/dist/components/partner/customPartnerTiles/index.js +1 -0
- package/dist/helpers/HomeRoles.helper.d.ts +1 -5
- package/dist/helpers/HomeRoles.helper.js +6 -0
- package/dist/helpers/forms/dynamicForm.helper.js +3 -1
- package/dist/hooks/forms/index.d.ts +1 -0
- package/dist/hooks/forms/index.js +1 -0
- package/dist/hooks/forms/useSimpleDynamicForm.d.ts +11 -0
- package/dist/hooks/forms/useSimpleDynamicForm.js +36 -0
- package/dist/hooks/myHomes/useMyHomeCard.d.ts +1 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/interfaces/contacts/AddEditContactPanel.interface.d.ts +12 -0
- package/dist/interfaces/contacts/ContactCard.interface.d.ts +15 -1
- package/dist/interfaces/contacts/ContactCardInfo.interface.d.ts +2 -1
- package/dist/interfaces/contacts/ContactsContent.interface.d.ts +4 -0
- package/dist/interfaces/contacts/ViewContactPanel.interface.d.ts +9 -0
- package/dist/interfaces/contacts/ViewContactPanel.interface.js +1 -0
- package/dist/interfaces/contacts/index.d.ts +2 -0
- package/dist/interfaces/contacts/index.js +2 -0
- package/dist/interfaces/forms/dynamicForm/DynamicForm.interface.d.ts +9 -7
- package/dist/interfaces/forms/dynamicForm/SimpleDynamicForm.interface.d.ts +4 -0
- package/dist/interfaces/forms/dynamicForm/SimpleDynamicForm.interface.js +1 -0
- package/dist/interfaces/forms/dynamicForm/fields/FieldWithDelete.interface.d.ts +1 -1
- package/dist/interfaces/forms/dynamicForm/fields/GroupField.interface.d.ts +1 -1
- package/dist/interfaces/forms/dynamicForm/index.d.ts +1 -1
- package/dist/interfaces/forms/dynamicForm/index.js +1 -1
- package/dist/interfaces/homeAssistant/ApplianceSteps.interface.d.ts +3 -0
- package/dist/interfaces/homeAssistant/HomeAssistantPanel.interface.d.ts +4 -1
- package/dist/interfaces/homeBoard/HomeCardWithRecipent.interface.d.ts +1 -0
- package/dist/mocks/contacts/contacts.mock.js +17 -5
- package/dist/mocks/forms/dynamicForm.mock.d.ts +1 -0
- package/dist/mocks/forms/dynamicForm.mock.js +155 -0
- package/dist/proxies/contacts/contactForm.proxy.d.ts +2 -0
- package/dist/proxies/contacts/contactForm.proxy.js +7 -0
- package/dist/proxies/contacts/index.d.ts +1 -0
- package/dist/proxies/contacts/index.js +1 -0
- package/dist/proxies/index.d.ts +1 -0
- package/dist/proxies/index.js +1 -0
- package/dist/stories/assets/Illustrations.stories.js +2 -2
- package/dist/stories/contacts/AddEditContactPanel.stories.d.ts +5 -0
- package/dist/stories/contacts/AddEditContactPanel.stories.js +22 -0
- package/dist/stories/contacts/ContactCardAddress.stories.d.ts +2 -0
- package/dist/stories/contacts/ContactCardInfo.stories.d.ts +2 -0
- package/dist/stories/contacts/ViewContactPanel.stories.d.ts +5 -0
- package/dist/stories/contacts/ViewContactPanel.stories.js +28 -0
- package/dist/stories/homeAssistant/panel/ApplianceSteps.stories.d.ts +1 -1
- package/dist/stories/homeAssistant/panel/ApplianceSteps.stories.js +1 -0
- package/dist/stories/homeAssistant/panel/HomeAssistantPanel.stories.js +1 -1
- package/dist/stories/onboarding/pages/NewPassword.stories.js +2 -3
- package/dist/stories/onboarding/pages/ResendResetPassword.stories.js +2 -3
- package/dist/stories/onboarding/pages/ResetPassword.stories.js +2 -3
- package/dist/stories/onboarding/pages/SignIn.stories.js +2 -3
- package/dist/stories/onboarding/pages/SignUp.stories.js +2 -3
- package/dist/stories/partner/customPartnerTiles/ShineTile.stories.d.ts +5 -0
- package/dist/stories/partner/customPartnerTiles/ShineTile.stories.js +19 -0
- package/package.json +1 -1
- package/src/assets/images/circle-face.svg +21 -0
- package/src/assets/images/company.svg +34 -0
- package/src/assets/images/index.ts +7 -0
- package/src/assets/images/location.jpg +0 -0
- package/src/assets/images/logos/index.ts +12 -1
- package/src/assets/images/logos/shine.png +0 -0
- package/src/assets/images/shine/gutter-cleaning.png +0 -0
- package/src/assets/images/shine/holiday-lights.png +0 -0
- package/src/assets/images/shine/home-cleaning.png +0 -0
- package/src/assets/images/shine/index.ts +15 -0
- package/src/assets/images/shine/pressure.png +0 -0
- package/src/assets/images/shine/roof-cleaning.png +0 -0
- package/src/assets/images/shine/window.png +0 -0
- package/src/assets/locales/en/index.json +23 -1
- package/src/components/animations/CloudsAnimation.tsx +8 -7
- package/src/components/contacts/ContactCard.tsx +28 -25
- package/src/components/contacts/ContactCardHeader.tsx +5 -38
- package/src/components/contacts/ContactHeaderMenu.tsx +42 -0
- package/src/components/contacts/ContactsContent.tsx +3 -1
- package/src/components/contacts/addEditPanel/AddEditContactPanel.tsx +63 -0
- package/src/components/contacts/addEditPanel/index.ts +1 -0
- package/src/components/contacts/index.ts +3 -0
- package/src/components/contacts/viewPanel/CompanyInfoCard.tsx +58 -0
- package/src/components/contacts/viewPanel/CompanyRating.tsx +27 -0
- package/src/components/contacts/viewPanel/ContactAddressCard.tsx +39 -0
- package/src/components/contacts/viewPanel/ContactNotes.tsx +16 -0
- package/src/components/contacts/viewPanel/PersonalInfoCard.tsx +41 -0
- package/src/components/contacts/viewPanel/RoleTag.tsx +30 -0
- package/src/components/contacts/viewPanel/ViewContactHeader.tsx +26 -0
- package/src/components/contacts/viewPanel/ViewContactPanel.tsx +70 -0
- package/src/components/contacts/viewPanel/index.ts +8 -0
- package/src/components/forms/dynamicForm/DynamicForm.tsx +9 -6
- package/src/components/forms/dynamicForm/SimpleDynamicForm.tsx +57 -0
- package/src/components/forms/dynamicForm/fields/FieldWithDelete.tsx +2 -3
- package/src/components/forms/dynamicForm/fields/GroupField.tsx +7 -2
- package/src/components/forms/dynamicForm/index.ts +1 -1
- package/src/components/homeAssistant/panel/ApplianceSteps.tsx +5 -2
- package/src/components/homeAssistant/panel/HomeAssistantPanel.tsx +20 -7
- package/src/components/homeBoard/HomeBoard.tsx +3 -0
- package/src/components/homeBoard/HomeCardWithRecipent.tsx +15 -1
- package/src/components/onboarding/pages/ActivateAccount.tsx +8 -3
- package/src/components/onboarding/pages/BasePageWrapper.tsx +10 -0
- package/src/components/onboarding/pages/EmailValidation.tsx +3 -3
- package/src/components/onboarding/pages/NewPassword.tsx +9 -3
- package/src/components/onboarding/pages/ResendResetPassword.tsx +3 -3
- package/src/components/onboarding/pages/ResetPassword.tsx +3 -2
- package/src/components/onboarding/pages/SignIn.tsx +3 -4
- package/src/components/onboarding/pages/SignUp.tsx +9 -8
- package/src/components/onboarding/pages/TwoFactor.tsx +9 -3
- package/src/components/onboarding/pages/index.ts +10 -9
- package/src/components/partner/customPartnerTiles/ShineTile.tsx +148 -0
- package/src/components/partner/customPartnerTiles/index.ts +1 -0
- package/src/helpers/HomeRoles.helper.ts +7 -1
- package/src/helpers/forms/dynamicForm.helper.ts +4 -0
- package/src/hooks/forms/index.ts +1 -0
- package/src/hooks/forms/useSimpleDynamicForm.ts +58 -0
- package/src/index.ts +3 -0
- package/src/interfaces/contacts/AddEditContactPanel.interface.ts +14 -0
- package/src/interfaces/contacts/ContactCard.interface.ts +20 -1
- package/src/interfaces/contacts/ContactCardInfo.interface.ts +3 -2
- package/src/interfaces/contacts/ContactsContent.interface.ts +3 -0
- package/src/interfaces/contacts/ViewContactPanel.interface.ts +10 -0
- package/src/interfaces/contacts/index.ts +2 -0
- package/src/interfaces/forms/dynamicForm/DynamicForm.interface.ts +10 -6
- package/src/interfaces/forms/dynamicForm/SimpleDynamicForm.interface.ts +5 -0
- package/src/interfaces/forms/dynamicForm/fields/FieldWithDelete.interface.ts +1 -1
- package/src/interfaces/forms/dynamicForm/fields/GroupField.interface.ts +1 -1
- package/src/interfaces/forms/dynamicForm/index.ts +1 -1
- package/src/interfaces/homeAssistant/ApplianceSteps.interface.ts +13 -2
- package/src/interfaces/homeAssistant/HomeAssistantPanel.interface.ts +4 -1
- package/src/interfaces/homeBoard/HomeCardWithRecipent.interface.ts +1 -0
- package/src/mocks/contacts/contacts.mock.ts +17 -5
- package/src/mocks/forms/dynamicForm.mock.ts +156 -0
- package/src/proxies/contacts/contactForm.proxy.ts +9 -0
- package/src/proxies/contacts/index.ts +1 -0
- package/src/proxies/index.ts +1 -0
- package/src/stories/assets/Illustrations.stories.tsx +4 -0
- package/src/stories/contacts/AddEditContactPanel.stories.tsx +45 -0
- package/src/stories/contacts/ViewContactPanel.stories.tsx +35 -0
- package/src/stories/homeAssistant/panel/ApplianceSteps.stories.tsx +2 -1
- package/src/stories/homeAssistant/panel/HomeAssistantPanel.stories.tsx +2 -0
- package/src/stories/onboarding/pages/NewPassword.stories.tsx +3 -4
- package/src/stories/onboarding/pages/ResendResetPassword.stories.tsx +3 -4
- package/src/stories/onboarding/pages/ResetPassword.stories.tsx +3 -4
- package/src/stories/onboarding/pages/SignIn.stories.tsx +3 -4
- package/src/stories/onboarding/pages/SignUp.stories.tsx +3 -4
- package/src/stories/partner/customPartnerTiles/ShineTile.stories.tsx +26 -0
- package/dist/components/forms/dynamicForm/DynamicFormSimple.d.ts +0 -2
- package/dist/components/forms/dynamicForm/DynamicFormSimple.js +0 -32
- package/dist/interfaces/forms/dynamicForm/DynamicFormSimple.interface.d.ts +0 -4
- package/src/components/forms/dynamicForm/DynamicFormSimple.tsx +0 -66
- package/src/interfaces/forms/dynamicForm/DynamicFormSimple.interface.ts +0 -5
- /package/dist/interfaces/{forms/dynamicForm/DynamicFormSimple.interface.js → contacts/AddEditContactPanel.interface.js} +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { homeRoles } from '../../../helpers';
|
|
3
|
+
import { Box, Text } from '@chakra-ui/react';
|
|
4
|
+
export const RoleTag = ({ roleType }) => {
|
|
5
|
+
if (!roleType)
|
|
6
|
+
return null;
|
|
7
|
+
const { bg, name } = homeRoles[roleType];
|
|
8
|
+
return (_jsx(Box, { bg: bg, px: "base", pt: "2", pb: "6", position: "absolute", top: "0", left: "0", right: "0", zIndex: "-1", children: _jsx(Text, { color: "neutral.white", fontSize: "sm", fontWeight: "bold", textTransform: "uppercase", children: name }) }));
|
|
9
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Contacts } from '../../../assets/images';
|
|
3
|
+
import { ContactHeaderMenu } from '../..';
|
|
4
|
+
import { partnerCategoriesIcons } from '../../../helpers';
|
|
5
|
+
import { Flex, Image, Text, Stack } from '@chakra-ui/react';
|
|
6
|
+
export const ViewContactHeader = (props) => {
|
|
7
|
+
var _a;
|
|
8
|
+
const { category } = props.contact;
|
|
9
|
+
const icon = (_a = partnerCategoriesIcons[category.toLowerCase()]) !== null && _a !== void 0 ? _a : Contacts;
|
|
10
|
+
return (_jsxs(Flex, { align: "center", justify: "space-between", children: [_jsxs(Flex, { align: "center", gap: "2", children: [_jsx(Image, { src: icon, boxSize: "22px" }), _jsx(Stack, { spacing: "-1", children: _jsx(Text, { fontSize: "xs", noOfLines: 1, textTransform: "uppercase", children: category }) })] }), _jsx(ContactHeaderMenu, Object.assign({}, props))] }));
|
|
11
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { t } from 'i18next';
|
|
3
|
+
import { DrawerContent, DrawerHeader, DrawerBody, Stack, Container, Divider, } from '@chakra-ui/react';
|
|
4
|
+
import { Contacts } from '../../../assets/images';
|
|
5
|
+
import { CompanyInfoCard, ContactAddressCard, ContactNotes, PanelHeader, RoleTag, PersonalInfoCard, ViewContactHeader, } from '../..';
|
|
6
|
+
export const ViewContactPanel = ({ contact, menuItems, handleClose, onShare, roleType, }) => {
|
|
7
|
+
const isHomeowner = roleType === 'homeowner';
|
|
8
|
+
return (_jsxs(DrawerContent, { bg: "lightBlue.1", children: [_jsx(DrawerHeader, { p: "0", children: _jsx(PanelHeader, { handleCloseButton: handleClose, icon: Contacts, title: t('contacts.contactView') }) }), _jsxs(DrawerBody, { p: "0", overflowX: "hidden", position: "relative", children: [_jsx(RoleTag, { roleType: roleType }), _jsx(Stack, { px: "base", spacing: "base", children: _jsx(Container, { mt: "36px", p: "base", borderRadius: "lg", children: _jsxs(Stack, { spacing: "base", children: [_jsx(ViewContactHeader, { contact: contact, menuItems: menuItems, onShare: onShare }), _jsx(PersonalInfoCard, Object.assign({}, contact, { index: 0 })), isHomeowner && (_jsxs(_Fragment, { children: [_jsx(Divider, { borderStyle: "dashed", borderColor: "lightBlue.6" }), _jsx(ContactAddressCard, { contact: contact })] })), !isHomeowner && (_jsxs(_Fragment, { children: [_jsx(Divider, { borderStyle: "dashed", borderColor: "lightBlue.6" }), _jsx(CompanyInfoCard, { contact: contact }), _jsx(Divider, { borderStyle: "dashed", borderColor: "lightBlue.6" }), _jsx(ContactNotes, { notes: contact.notes })] }))] }) }) })] })] }));
|
|
9
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './CompanyInfoCard';
|
|
2
|
+
export * from './CompanyRating';
|
|
3
|
+
export * from './ContactAddressCard';
|
|
4
|
+
export * from './ContactNotes';
|
|
5
|
+
export * from './PersonalInfoCard';
|
|
6
|
+
export * from './RoleTag';
|
|
7
|
+
export * from './ViewContactHeader';
|
|
8
|
+
export * from './ViewContactPanel';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './CompanyInfoCard';
|
|
2
|
+
export * from './CompanyRating';
|
|
3
|
+
export * from './ContactAddressCard';
|
|
4
|
+
export * from './ContactNotes';
|
|
5
|
+
export * from './PersonalInfoCard';
|
|
6
|
+
export * from './RoleTag';
|
|
7
|
+
export * from './ViewContactHeader';
|
|
8
|
+
export * from './ViewContactPanel';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DynamicFormI } from '../../../interfaces';
|
|
2
|
-
export declare const DynamicForm: ({ form: fields, onUpload, uploadingFieldId, }: DynamicFormI) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const DynamicForm: ({ form: fields, onUpload, showTitle, uploadingFieldId, }: DynamicFormI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,10 +5,10 @@ import { Stack, Text } from '@chakra-ui/react';
|
|
|
5
5
|
import { HiddenFieldSection, GroupField, TextField, TextAreaField, SelectField, RatingField, GridField, FieldWithDelete, FileField, SwitchField, DateField, NumberField, CurrencyField, } from '../..';
|
|
6
6
|
import { useDynamicForm } from '../../../hooks';
|
|
7
7
|
import { fieldIcons } from '../../../helpers';
|
|
8
|
-
export const DynamicForm = ({ form: fields, onUpload, uploadingFieldId, }) => {
|
|
8
|
+
export const DynamicForm = ({ form: fields, onUpload, showTitle = true, uploadingFieldId, }) => {
|
|
9
9
|
const { form, visibleFields, hiddenFields, handleAddAll, handleAdd, handleFilesUpload, handleRemove, } = useDynamicForm({ fields, onUpload });
|
|
10
|
-
return (_jsxs(Stack, { bg: "lightBlue.1", spacing: "0", h: "full", children: [_jsx(Text, { fontFamily: "secondary", px: "base", pt: "4", pb: "2", children: t('forms.itemDetails') }), _jsx(FormProvider, Object.assign({}, form, { children: _jsx(_Fragment, { children: visibleFields === null || visibleFields === void 0 ? void 0 : visibleFields.map((field) => {
|
|
11
|
-
const { children, description, icon, id, name, options, type, value,
|
|
10
|
+
return (_jsxs(Stack, { bg: "lightBlue.1", spacing: "0", h: "full", children: [showTitle && (_jsx(Text, { fontFamily: "secondary", px: "base", pt: "4", pb: "2", children: t('forms.itemDetails') })), _jsx(FormProvider, Object.assign({}, form, { children: _jsx(_Fragment, { children: visibleFields === null || visibleFields === void 0 ? void 0 : visibleFields.map((field) => {
|
|
11
|
+
const { canBeHidden, children, description, icon, id, name, options, type, value, } = field;
|
|
12
12
|
const baseProps = {
|
|
13
13
|
id,
|
|
14
14
|
value,
|
|
@@ -19,7 +19,7 @@ export const DynamicForm = ({ form: fields, onUpload, uploadingFieldId, }) => {
|
|
|
19
19
|
key: id,
|
|
20
20
|
id,
|
|
21
21
|
onRemove: handleRemove,
|
|
22
|
-
|
|
22
|
+
canBeHidden,
|
|
23
23
|
};
|
|
24
24
|
switch (type) {
|
|
25
25
|
case 'date':
|
|
@@ -48,7 +48,7 @@ export const DynamicForm = ({ form: fields, onUpload, uploadingFieldId, }) => {
|
|
|
48
48
|
case 'file':
|
|
49
49
|
return (_jsx(FieldWithDelete, Object.assign({}, fieldWithDeleteBaseProps, { children: _jsx(FileField, { icon: baseProps.icon, description: description, onUpload: (files) => handleFilesUpload({ id, files }), uploading: uploadingFieldId === id }) })));
|
|
50
50
|
case 'group':
|
|
51
|
-
return (_jsx(GroupField, { id: id, fields: children, onRemove: handleRemove,
|
|
51
|
+
return (_jsx(GroupField, { id: id, fields: children, onRemove: handleRemove, canBeHidden: canBeHidden }, id));
|
|
52
52
|
default:
|
|
53
53
|
return null;
|
|
54
54
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Stack } from '@chakra-ui/react';
|
|
3
|
+
import { TextField, SelectField, SwitchField, NumberField, FieldDivider, } from '../..';
|
|
4
|
+
import { fieldIcons } from '../../../helpers';
|
|
5
|
+
export const SimpleDynamicForm = ({ fields }) => {
|
|
6
|
+
return (_jsx(Stack, { bg: "neutral.white", spacing: "0", h: "full", boxShadow: "md", children: fields === null || fields === void 0 ? void 0 : fields.map((field) => {
|
|
7
|
+
const { description, icon, id, name, options, type, value } = field;
|
|
8
|
+
const baseProps = {
|
|
9
|
+
description,
|
|
10
|
+
id,
|
|
11
|
+
value,
|
|
12
|
+
icon: icon ? fieldIcons[icon] : undefined,
|
|
13
|
+
placeholder: name !== null && name !== void 0 ? name : description,
|
|
14
|
+
};
|
|
15
|
+
switch (type) {
|
|
16
|
+
case 'number':
|
|
17
|
+
return (_jsx(FieldDivider, { children: _jsx(NumberField, Object.assign({}, baseProps)) }, id));
|
|
18
|
+
case 'text':
|
|
19
|
+
case 'string':
|
|
20
|
+
return (_jsx(FieldDivider, { children: _jsx(TextField, Object.assign({}, baseProps)) }, id));
|
|
21
|
+
case 'select':
|
|
22
|
+
return (_jsx(FieldDivider, { children: _jsx(SelectField, Object.assign({}, baseProps, { options: options })) }, id));
|
|
23
|
+
case 'switch':
|
|
24
|
+
return (_jsx(FieldDivider, { children: _jsx(SwitchField, Object.assign({}, baseProps)) }, id));
|
|
25
|
+
default:
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}) }));
|
|
29
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { FieldWithDeleteI } from '../../../../interfaces';
|
|
3
|
-
export declare const FieldWithDelete: ({ children, id,
|
|
3
|
+
export declare const FieldWithDelete: ({ children, id, canBeHidden, onRemove, }: PropsWithChildren<FieldWithDeleteI>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Flex, IconButton } from '@chakra-ui/react';
|
|
3
3
|
import { TrashIcon } from '../../..';
|
|
4
|
-
export const FieldWithDelete = ({ children, id,
|
|
5
|
-
|
|
6
|
-
return (_jsxs(Flex, { align: "center", borderBottom: "1px dashed", borderColor: "lightBlue.6", p: "base", children: [children, !isUndefined && (_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: {
|
|
4
|
+
export const FieldWithDelete = ({ children, id, canBeHidden = true, onRemove = () => { }, }) => {
|
|
5
|
+
return (_jsxs(Flex, { align: "center", borderBottom: "1px dashed", borderColor: "lightBlue.6", p: "base", children: [children, canBeHidden && (_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: {
|
|
7
6
|
filter: 'brightness(0.7)',
|
|
8
7
|
}, onClick: () => onRemove(id) }))] }));
|
|
9
8
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { GroupFieldI } from '../../../../interfaces';
|
|
2
|
-
export declare const GroupField: ({ id, fields, onRemove,
|
|
2
|
+
export declare const GroupField: ({ id, fields, onRemove, canBeHidden, }: GroupFieldI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,6 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Stack } from '@chakra-ui/react';
|
|
3
3
|
import { FieldWithDelete } from '../../..';
|
|
4
4
|
import { SingleFields } from './SingleFields';
|
|
5
|
-
export const GroupField = ({ id, fields, onRemove,
|
|
6
|
-
return (_jsx(FieldWithDelete, { id: id, onRemove: onRemove,
|
|
5
|
+
export const GroupField = ({ id, fields, onRemove, canBeHidden, }) => {
|
|
6
|
+
return (_jsx(FieldWithDelete, { id: id, onRemove: onRemove, canBeHidden: canBeHidden, children: _jsx(Stack, { spacing: "base", flex: "1", children: _jsx(SingleFields, { fields: fields }) }) }));
|
|
7
7
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ApplianceStepI, ApplianceStepsI } from '../../../interfaces';
|
|
2
|
-
export declare const ApplianceSteps: ({ onClick }: ApplianceStepsI) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const ApplianceSteps: ({ addedAppliances, onClick, }: ApplianceStepsI) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare const steps: ApplianceStepI[];
|
|
@@ -4,8 +4,8 @@ import { Center, SimpleGrid, Stack, Text } from '@chakra-ui/react';
|
|
|
4
4
|
import { ApplianceButton } from '../..';
|
|
5
5
|
import { Fridge, Freezer, Washer, Dryer, Dishwasher, CookTop, Oven, Hood, Microwave, Range, } from '../../../assets/images';
|
|
6
6
|
import { useState } from 'react';
|
|
7
|
-
export const ApplianceSteps = ({ onClick }) => {
|
|
8
|
-
const [appliances, setAppliances] = useState(
|
|
7
|
+
export const ApplianceSteps = ({ addedAppliances = [], onClick, }) => {
|
|
8
|
+
const [appliances, setAppliances] = useState(addedAppliances);
|
|
9
9
|
const handleClick = (id) => {
|
|
10
10
|
if (appliances.includes(id)) {
|
|
11
11
|
const newAppliances = appliances.filter((appliance) => appliance !== id);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { HomeAssistantPanelI } from '../../../interfaces';
|
|
3
|
-
export declare const HomeAssistantPanel: ({ children, currentForm, currentStep, onApplianceClick, onBack, onClose, onNext, }: PropsWithChildren<HomeAssistantPanelI>) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const HomeAssistantPanel: ({ children, currentForm, currentStep, onApplianceClick, onBack, onClose, onNext, onSave, backDisabled, nextDisabled, }: PropsWithChildren<HomeAssistantPanelI>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FormProvider } from 'react-hook-form';
|
|
2
3
|
import { t } from 'i18next';
|
|
3
4
|
import { DrawerContent, DrawerHeader, DrawerBody, Stack, Text, DrawerFooter, } from '@chakra-ui/react';
|
|
4
5
|
import { IA } from '../../../assets/images';
|
|
5
|
-
import { ApplianceSteps,
|
|
6
|
+
import { ApplianceSteps, SimpleDynamicForm, FooterButtons, HomeAssistantPanelStep, PanelHeader, } from '../..';
|
|
6
7
|
import { homeAssistantSteps } from '../../../helpers';
|
|
7
|
-
|
|
8
|
+
import { useSimpleDynamicForm } from '../../../hooks';
|
|
9
|
+
export const HomeAssistantPanel = ({ children, currentForm, currentStep, onApplianceClick, onBack, onClose, onNext, onSave, backDisabled, nextDisabled, }) => {
|
|
8
10
|
const { title } = homeAssistantSteps[currentStep - 1];
|
|
9
11
|
const text = `${t('homeAssistant.details')} ${title.toLowerCase()}:`;
|
|
10
12
|
const isAppliances = currentStep === 3;
|
|
11
|
-
|
|
13
|
+
const { form, updatedFields } = useSimpleDynamicForm({
|
|
14
|
+
fields: currentForm,
|
|
15
|
+
});
|
|
16
|
+
return (_jsxs(DrawerContent, { bg: "lightBlue.1", children: [_jsx(DrawerHeader, { p: "0", children: _jsx(PanelHeader, { handleCloseButton: onClose, title: t('homeAssistant.title'), icon: IA }) }), _jsxs(DrawerBody, { p: "0", children: [_jsx(HomeAssistantPanelStep, { currentStep: currentStep }), children, isAppliances && _jsx(ApplianceSteps, { onClick: onApplianceClick }), _jsxs(Stack, { spacing: "base", p: "base", children: [_jsx(Text, { fontFamily: "secondary", fontSize: "sm", children: text }), _jsx(FormProvider, Object.assign({}, form, { children: _jsx(SimpleDynamicForm, { fields: currentForm }) }))] })] }), _jsx(DrawerFooter, { px: "0", py: "6", bg: "neutral.white", children: _jsx(FooterButtons, { button1: {
|
|
12
17
|
buttonStyle: 'secondaryFooter',
|
|
13
18
|
label: t('buttons.back'),
|
|
14
19
|
onClick: onBack,
|
|
20
|
+
isDisabled: backDisabled,
|
|
15
21
|
}, button2: {
|
|
22
|
+
buttonStyle: 'primaryFooter',
|
|
23
|
+
label: t('buttons.saveStep'),
|
|
24
|
+
onClick: () => onSave(updatedFields),
|
|
25
|
+
}, button3: {
|
|
16
26
|
buttonStyle: 'primaryFooter',
|
|
17
27
|
label: t('buttons.next'),
|
|
18
28
|
onClick: onNext,
|
|
19
|
-
|
|
20
|
-
buttonStyle: 'secondaryFooter',
|
|
21
|
-
label: t('buttons.cancel'),
|
|
22
|
-
onClick: onClose,
|
|
29
|
+
isDisabled: nextDisabled,
|
|
23
30
|
} }) })] }));
|
|
24
31
|
};
|
|
@@ -48,7 +48,7 @@ export const HomeBoard = () => {
|
|
|
48
48
|
], onShare: () => 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
|
-
HomeAssistant: (_jsx(HomeAssistantPanel, { currentStep: homeAssistantCurrentStep, currentForm: currentHomeAssistantForm, onNext: handleHomeAssistantFormChange, onBack: handleHomeAssistantBack, onApplianceClick: () => null, onClose: onRightClose })),
|
|
51
|
+
HomeAssistant: (_jsx(HomeAssistantPanel, { currentStep: homeAssistantCurrentStep, currentForm: currentHomeAssistantForm, onNext: handleHomeAssistantFormChange, onBack: handleHomeAssistantBack, onApplianceClick: () => null, onClose: onRightClose, onSave: () => { }, backDisabled: false, nextDisabled: false })),
|
|
52
52
|
};
|
|
53
53
|
const panelSize = currentComponent === 'PartnerCatalog' ? 'lg' : 'md';
|
|
54
54
|
return (_jsxs(Box, { overflowX: "hidden", children: [_jsx(RightPanel, { overlay: showOverlay, isOpen: isRightOpen, onClose: onRightClose, size: panelSize, children: rightPanelComponents[currentComponent] }), _jsxs(Flex, { w: "full", minH: "100dvh", children: [_jsx(RoomsMenu, { activeRoom: "homeboard", handleAddRoom: (id) => __awaiter(void 0, void 0, void 0, function* () { return console.log(id); }), handleClick: () => null, handleHomeClick: () => null, rooms: RoomsList, roomsToAdd: RoomsToAdd }), _jsxs(Box, { w: "full", children: [_jsx(AppBarComponent, { setActiveTour: setActiveTour }), _jsxs(Stack, { spacing: "base", p: "base", children: [_jsx(HomeHeader, { buttonLabel: "Partner catalog", onBack: () => null, homeName: homeName, onAdd: () => null }), _jsxs(HomeBoardGrid, { children: [_jsx(HomeCardWithRecipent, { address: HomeCards[0].address, handleEdit: handleEditHomeClick, handleDeleteAccountType: (email) => email, handleSubmitAccountType: (form) => form, _id: HomeCards[0]._id, image: HomeCards[0].image, loading: false, name: HomeCards[0].name, menu: menuMock, addImage: () => null, recipients: recipientsDb, records: homeBoardRecorsMock }), _jsx(HomeAssistant, { currentPanel: homeAssistantCurrentStep, currentStep: 6, onStepClick: handleHomeAssistantClick }), _jsx(PropertyTaxes, { estimatedTaxValue: 1000, menuItems: menuMock, taxes: taxesMock, title: "Travis County Property Taxes" }), _jsxs(Stack, { spacing: "base", children: [_jsx(ReceiptAutofiler, { onClick: () => null, totalReceipts: 36, totalTitle: "Receipts Received", forwardTo: "reciepts@homefile.cloud", onFilter: () => null, children: _jsx(ReceiptsFiled, { incidentalItemsNumber: 0, incidentalSpent: 0, inventoryItemsNumber: 0, inventorySpent: 0, total: 0 }) }), _jsx(ValueMonitor, { menuItems: menuMock, balance: "+3%", totalValue: 323421, year: "2023", yearValue: 5684 })] }), _jsx(ShortPartnerTile, { _id: "1", buttonText: "Contact Audrey Scheck", description: "Full-service design firm focusing on residential remodels, furnishing, and styling.", onClick: () => null, socialLinks: socialLinksMock2, logo: "https://static.wixstatic.com/media/258105_8e04439070694f278e4787a310ea9f4b~mv2.png", partnerName: "Audrey Scheck", websiteUrl: "" }), _jsx(TrendingValue, { chartData: lineChartData, marketValue: 894000, menuItems: menuMock, mortgageBalance: 220532, purchasePrice: 220532, roi: "+234%" }), _jsx(ShortPartnerTile, { _id: "2", buttonText: "Contact Audrey Scheck", description: "Full-service design firm focusing on residential remodels, furnishing, and styling.", onClick: () => null, socialLinks: socialLinksMock2, logo: "https://static.wixstatic.com/media/258105_8e04439070694f278e4787a310ea9f4b~mv2.png", partnerName: "Audrey Scheck", websiteUrl: "" }), _jsx(FolderSharing, { folders: FoldersDB, handleAddNewFolder: handleNewFolder, handleFolderClick: handleFolderClick, handleSelect: () => null, initialSelectItem: selectOptions[0], menuItems: menuMock, selectItems: selectOptions }), _jsxs(Stack, { spacing: "base", children: [_jsx(AddHomeItem, { handleClick: () => null }), _jsx(SendCommunication, { documentList: [] })] }), _jsx(ShortPartnerTile, { _id: "3", buttonText: "Contact Audrey Scheck", description: "Full-service design firm focusing on residential remodels, furnishing, and styling.", onClick: () => null, socialLinks: socialLinksMock2, logo: "https://static.wixstatic.com/media/258105_8e04439070694f278e4787a310ea9f4b~mv2.png", partnerName: "Audrey Scheck", websiteUrl: "" })] })] })] })] }), _jsx(HomeBoardTour, { currentStep: currentStep, handleClose: handleClose, handleStep: handleStep, meetStepUrl: videoMock, isActive: activeTour })] }));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { HomeCardWithRecipentI } from '../../interfaces';
|
|
2
|
-
export declare const HomeCardWithRecipent: ({ address: { city, state, street, number, zip }, addImage, externalLink, handleEdit, handleDeleteAccountType, handleSubmitAccountType, image, _id, loading, menu, name, onAddRecords, onViewDetails, panelSize, recipients, records, disabled, }: HomeCardWithRecipentI) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const HomeCardWithRecipent: ({ address: { city, state, street, number, zip }, addImage, externalLink, handleEdit, handleDeleteAccountType, handleSubmitAccountType, image, _id, loading, menu, name, onAddRecords, onViewDetails, panelSize, recipients, records, disabled, propertyDisabled }: HomeCardWithRecipentI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,7 +3,7 @@ import { t } from 'i18next';
|
|
|
3
3
|
import { Container } from '@chakra-ui/react';
|
|
4
4
|
import { HomeCard, EditAccountType, RightPanel, HomeCardRecipients, TabsHeader, HomeCardRecords, } from '..';
|
|
5
5
|
import { useHomeCardWithRecipent } from '../../hooks';
|
|
6
|
-
export const HomeCardWithRecipent = ({ address: { city, state, street, number = '', zip }, addImage, externalLink, handleEdit, handleDeleteAccountType, handleSubmitAccountType, image, _id, loading = false, menu, name, onAddRecords, onViewDetails, panelSize = 'md', recipients, records = {}, disabled, }) => {
|
|
6
|
+
export const HomeCardWithRecipent = ({ address: { city, state, street, number = '', zip }, addImage, externalLink, handleEdit, handleDeleteAccountType, handleSubmitAccountType, image, _id, loading = false, menu, name, onAddRecords, onViewDetails, panelSize = 'md', recipients, records = {}, disabled, propertyDisabled }) => {
|
|
7
7
|
const { isRightOpen, onRightClose, editingAccountType, handleEditAccountType, } = useHomeCardWithRecipent();
|
|
8
8
|
const tabs = [
|
|
9
9
|
{
|
|
@@ -15,5 +15,11 @@ export const HomeCardWithRecipent = ({ address: { city, state, street, number =
|
|
|
15
15
|
component: (_jsx(HomeCardRecipients, { recipients: recipients, menu: menu, onEditClick: handleEditAccountType })),
|
|
16
16
|
},
|
|
17
17
|
];
|
|
18
|
-
|
|
18
|
+
const noPropertyTabs = [
|
|
19
|
+
{
|
|
20
|
+
label: t('homeBoard.tabs.tab2'),
|
|
21
|
+
component: (_jsx(HomeCardRecipients, { recipients: recipients, menu: menu, onEditClick: handleEditAccountType })),
|
|
22
|
+
}
|
|
23
|
+
];
|
|
24
|
+
return (_jsxs(Container, { variant: "launchpad", children: [_jsx(HomeCard, { city: city, externalLink: externalLink, imageUrl: image, name: name, number: number, street: street, state: state, zip: zip, handleEditClick: () => handleEdit(_id), addImage: addImage, loading: loading, edit: !disabled }), _jsx(TabsHeader, { tabList: propertyDisabled ? noPropertyTabs : tabs }), _jsx(RightPanel, { isOpen: isRightOpen, onClose: onRightClose, size: panelSize, children: _jsx(EditAccountType, { associateAccount: editingAccountType, handleClose: onRightClose, handleDelete: handleDeleteAccountType, handleSubmit: handleSubmitAccountType, isLoading: loading }) })] }));
|
|
19
25
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { t } from 'i18next';
|
|
3
3
|
import { Box, Container, Text, Center, Button } from '@chakra-ui/react';
|
|
4
|
-
import { Logo, WelcomeHeader, ButtonLoader } from '../..';
|
|
4
|
+
import { Logo, WelcomeHeader, ButtonLoader, BasePageWrapper, } from '../..';
|
|
5
5
|
import { useWindowDimensions } from '../../../hooks';
|
|
6
6
|
export const ActivateAccount = ({ name, isLoading = false, handleActivateBt, }) => {
|
|
7
7
|
const { windowDimensions: { width }, } = useWindowDimensions();
|
|
8
|
-
return (_jsx(
|
|
8
|
+
return (_jsx(BasePageWrapper, { children: _jsxs(Container, { size: "validation", boxShadow: "lg", children: [_jsx(Container, { variant: "secondary", children: _jsx(Logo, {}) }), _jsxs(Box, { px: ['container.sm', 'container.lg'], children: [_jsx(WelcomeHeader, { description: t('registration.instruction'), greeting: t('welcome.greeting'), name: name }), _jsx(Center, { children: _jsx(Button, { onClick: handleActivateBt, isLoading: isLoading, spinner: _jsx(ButtonLoader, {}), size: "onboarding", children: width < 400
|
|
9
9
|
? t('registration.activateBtShort')
|
|
10
10
|
: t('registration.activateBt') }) }), _jsx(Text, { variant: "info", mt: "8", children: t('welcome.signature') })] }), _jsx(Container, { variant: "tertiary", mt: "8", children: _jsx(Center, { h: "12", px: "4", children: _jsx(Text, { variant: "label", children: t('registration.notReply') }) }) })] }) }));
|
|
11
11
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from '@chakra-ui/react';
|
|
3
|
+
export const BasePageWrapper = ({ children }) => {
|
|
4
|
+
return (_jsx(Box, { w: "container.full", zIndex: "2", position: "relative", mt: "onboarding.top", children: children }));
|
|
5
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { t } from 'i18next';
|
|
3
|
-
import {
|
|
4
|
-
import { Logo, ButtonLoader } from '../..';
|
|
3
|
+
import { chakra, Container, Text, Image, Center, Button, } from '@chakra-ui/react';
|
|
4
|
+
import { Logo, ButtonLoader, BasePageWrapper } from '../..';
|
|
5
5
|
import { Confirmation } from '../../../assets/images';
|
|
6
6
|
export const EmailValidation = ({ email, isLoading = false, handleResendBt, }) => {
|
|
7
|
-
return (_jsx(
|
|
7
|
+
return (_jsx(BasePageWrapper, { children: _jsxs(Container, { size: "validation", boxShadow: "lg", children: [_jsxs(Container, { variant: "secondary", children: [_jsx(Logo, {}), _jsxs(Text, { variant: "title", textAlign: "center", px: ['container.sm', 'container.xl'], pb: 6, minH: "6rem", children: [_jsx(chakra.span, { color: "gray.3", children: t('validation.title1') }), _jsx(chakra.span, { color: "blue.2", children: email }), _jsx(chakra.span, { color: "gray.3", children: t('validation.title2') })] }), _jsx(Center, { children: _jsx(Image, { src: Confirmation, alt: "Activate account", h: ['100px', '145px'], w: "auto" }) })] }), _jsx(Text, { variant: "info", px: ['container.md', 'container.lg'], py: "2rem", textAlign: "center", children: t('validation.alert1') }), _jsx(Center, { children: _jsx(Button, { mb: 10, mx: 4, variant: "secondary", onClick: handleResendBt, isLoading: isLoading, spinner: _jsx(ButtonLoader, { isOutlined: true }), size: "onboarding", children: t('validation.resendBt') }) })] }) }));
|
|
8
8
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { t } from 'i18next';
|
|
3
3
|
import { Box, Button, Text, Container, Stack, chakra } from '@chakra-ui/react';
|
|
4
|
-
import { Logo, Footer, ButtonLoader, PasswordInput } from '../..';
|
|
4
|
+
import { Logo, Footer, ButtonLoader, PasswordInput, BasePageWrapper, } from '../..';
|
|
5
5
|
import { isValidPassword, passwordMatch } from '../../../utils';
|
|
6
6
|
import { useNewPassword } from '../../../hooks';
|
|
7
7
|
export const NewPassword = ({ isLoading, handleReset, userEmail, }) => {
|
|
8
8
|
const { inputs, handleInputChange, handleSubmit, isValidated } = useNewPassword(handleReset);
|
|
9
|
-
return (_jsxs(
|
|
9
|
+
return (_jsxs(BasePageWrapper, { children: [_jsxs(Container, { size: "onboarding", boxShadow: "lg", children: [_jsx(Logo, {}), _jsx(Container, { variant: "ghost", mt: 4, mb: 6, children: _jsxs(Text, { variant: "title", textAlign: "center", px: [10, 0], noOfLines: [2, 1], children: [_jsx(chakra.span, { color: "gray.3", children: t('welcome.greeting2') }), _jsx(chakra.span, { color: "blue.2", children: userEmail }), _jsx(chakra.span, { color: "gray.3", children: "," })] }) }), _jsx(Box, { px: ['container.sm', 'container.md', 'container.lg'], pb: "container.lg", mb: 6, children: _jsxs(Stack, { spacing: 8, children: [_jsx(Text, { textAlign: "center", variant: "info", children: t('newPassword.title') }), _jsxs(Stack, { spacing: 3, children: [_jsx(PasswordInput, { errorMessage: !isValidPassword(inputs.password)
|
|
10
10
|
? t('forms.errorPasswordLength')
|
|
11
11
|
: t('forms.errorPasswordMatch'), hasError: isValidated &&
|
|
12
12
|
(!isValidPassword(inputs.password) ||
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { t } from 'i18next';
|
|
3
|
-
import {
|
|
4
|
-
import { ButtonLoader, Logo } from '../..';
|
|
3
|
+
import { chakra, Container, Text, Image, Center, Button, } from '@chakra-ui/react';
|
|
4
|
+
import { BasePageWrapper, ButtonLoader, Logo } from '../..';
|
|
5
5
|
import { ResendPassword } from '../../../assets/images';
|
|
6
6
|
export const ResendResetPassword = ({ email, isLoading = false, handleResendBt, }) => {
|
|
7
|
-
return (_jsx(
|
|
7
|
+
return (_jsx(BasePageWrapper, { children: _jsxs(Container, { size: "validation", boxShadow: "lg", children: [_jsxs(Container, { variant: "secondary", children: [_jsx(Logo, {}), _jsxs(Text, { variant: "title", textAlign: "center", px: ['container.sm', 'container.xl'], pb: 6, minH: "6rem", children: [_jsx(chakra.span, { color: "gray.3", children: t('validation.title1') }), _jsx(chakra.span, { color: "blue.2", children: email }), _jsx(Text, { variant: "title", children: t('validation.title3') })] }), _jsx(Center, { children: _jsx(Image, { src: ResendPassword, alt: "Activate account", h: ['100px', '145px'], w: "auto" }) })] }), _jsx(Text, { variant: "info", px: ['container.md', 'container.lg'], py: "2rem", textAlign: "center", children: t('validation.alert1') }), _jsx(Center, { children: _jsx(Button, { mb: 10, mx: 4, variant: "secondary", onClick: handleResendBt, isLoading: isLoading, spinner: _jsx(ButtonLoader, { isOutlined: true }), size: "onboarding", children: t('validation.resendResetBt') }) })] }) }));
|
|
8
8
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { t } from 'i18next';
|
|
3
3
|
import { Box, Button, Text, Container, Stack } from '@chakra-ui/react';
|
|
4
|
-
import { Logo, Footer, PageTitle, CardFooter, TextInput, ButtonLoader, } from '../..';
|
|
4
|
+
import { Logo, Footer, PageTitle, CardFooter, TextInput, ButtonLoader, BasePageWrapper, } from '../..';
|
|
5
5
|
import { isEmptyField, isValidEmail } from '../../../utils';
|
|
6
6
|
import { useResetPassword } from '../../../hooks';
|
|
7
7
|
export const ResetPassword = ({ isLoading, handleReset, handleSignIn, resetError, }) => {
|
|
@@ -9,7 +9,7 @@ export const ResetPassword = ({ isLoading, handleReset, handleSignIn, resetError
|
|
|
9
9
|
const resetErrorType = resetError
|
|
10
10
|
? t('forms.errorEmailNotActivated')
|
|
11
11
|
: t('forms.errorEmail');
|
|
12
|
-
return (_jsxs(
|
|
12
|
+
return (_jsxs(BasePageWrapper, { children: [_jsxs(Container, { size: "onboarding", boxShadow: "lg", children: [_jsx(Logo, {}), _jsx(PageTitle, { title: t('reset.title') }), _jsx(Box, { px: ['container.sm', 'container.md', 'container.lg'], mb: 6, children: _jsxs(Stack, { spacing: 8, children: [_jsx(Text, { textAlign: "center", variant: "info", children: t('reset.instruction') }), _jsx(Stack, { spacing: 3, children: _jsx(TextInput, { autoCapitalize: "none", autoCorrect: "off", errorMessage: isEmptyField(inputs.email)
|
|
13
13
|
? t('forms.email') + ' ' + t('forms.required')
|
|
14
14
|
: resetErrorType, hasError: isValidated &&
|
|
15
15
|
(resetError ||
|
|
@@ -10,12 +10,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { t } from 'i18next';
|
|
12
12
|
import { Box, Button, Center, Container, Stack } from '@chakra-ui/react';
|
|
13
|
-
import { Logo, Footer, PageTitle, CardFooter, PasswordInput, TextInput, ButtonLoader, } from '../..';
|
|
13
|
+
import { Logo, Footer, PageTitle, CardFooter, PasswordInput, TextInput, ButtonLoader, BasePageWrapper, } from '../..';
|
|
14
14
|
import { isEmptyField } from '../../../utils';
|
|
15
15
|
import { useSignIn } from '../../../hooks';
|
|
16
16
|
export const SignIn = ({ isLoading, handleForgotPassword, handleSignIn, handleSignUp, loginError, values = { email: '', password: '' }, }) => {
|
|
17
17
|
const { inputs, handleInputChange, isValidated, setIsValidated } = useSignIn(values);
|
|
18
|
-
return (_jsxs(
|
|
18
|
+
return (_jsxs(BasePageWrapper, { children: [_jsxs(Container, { size: "onboarding", boxShadow: "lg", children: [_jsx(Logo, {}), _jsx(PageTitle, { title: t('signin.title') }), _jsx(Box, { px: ['container.sm', 'container.md', 'container.lg'], mb: 6, children: _jsxs(Stack, { spacing: 8, children: [_jsxs(Stack, { spacing: "base", as: "form", children: [_jsx(TextInput, { autoCapitalize: "none", autoCorrect: "off", autoComplete: "username", errorMessage: loginError
|
|
19
19
|
? t('forms.errorLogin')
|
|
20
20
|
: t('forms.email') + ' ' + t('forms.required'), hasError: isValidated && (loginError || isEmptyField(inputs.email)), id: "email", placeholder: t('forms.email'), value: values.email || inputs.email, handleChange: (event) => {
|
|
21
21
|
values.email = event.target.value;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { t } from 'i18next';
|
|
3
3
|
import { Box, Button, Center, Container, Stack, Text } from '@chakra-ui/react';
|
|
4
|
-
import { Logo, Footer, CardFooter, PageTitle, PasswordInput, TextInput, ButtonLoader, } from '../..';
|
|
4
|
+
import { Logo, Footer, CardFooter, PageTitle, PasswordInput, TextInput, ButtonLoader, BasePageWrapper, } from '../..';
|
|
5
5
|
import { isEmptyField, isValidEmail, isValidPassword, passwordMatch, } from '../../../utils';
|
|
6
6
|
import { useSignUp } from '../../../hooks';
|
|
7
7
|
export const SignUp = ({ isLoading, handleCreateAccount, handleSignIn, showPromoCode, signupError, values = {
|
|
@@ -17,10 +17,10 @@ export const SignUp = ({ isLoading, handleCreateAccount, handleSignIn, showPromo
|
|
|
17
17
|
handleCreateAccount,
|
|
18
18
|
values,
|
|
19
19
|
});
|
|
20
|
-
return (_jsxs(
|
|
21
|
-
(isEmptyField(inputs.email) || !isValidEmail(inputs.email)), id: "email", placeholder: t('forms.email'), value: inputs.email, handleChange: handleInputChange, autoComplete:
|
|
20
|
+
return (_jsxs(BasePageWrapper, { children: [_jsxs(Container, { size: "onboarding", boxShadow: "lg", children: [_jsx(Logo, {}), _jsx(PageTitle, { title: t('signup.title') }), _jsx(Box, { px: ['container.sm', 'container.md', 'container.lg'], mb: 6, children: _jsxs(Stack, { spacing: "base", as: "form", children: [_jsx(TextInput, { errorMessage: t('forms.firstName') + ' ' + t('forms.required'), hasError: isValidated && isEmptyField(inputs.firstName), id: "firstName", placeholder: t('forms.firstName'), value: inputs.firstName, handleChange: handleInputChange, autoComplete: "given-name" }), _jsx(TextInput, { errorMessage: t('forms.lastName') + ' ' + t('forms.required'), hasError: isValidated && isEmptyField(inputs.lastName), id: "lastName", placeholder: t('forms.lastName'), value: inputs.lastName, handleChange: handleInputChange, autoComplete: "family-name" }), _jsx(TextInput, { autoCapitalize: "none", autoCorrect: "off", errorMessage: t('forms.email') + ' ' + t('forms.required'), hasError: isValidated &&
|
|
21
|
+
(isEmptyField(inputs.email) || !isValidEmail(inputs.email)), id: "email", placeholder: t('forms.email'), value: inputs.email, handleChange: handleInputChange, autoComplete: "email" }), showPromoCode && (_jsx(TextInput, { autoCapitalize: "none", autoCorrect: "off", id: "promoCode", placeholder: t('forms.promoCode'), value: (_a = inputs.promoCode) !== null && _a !== void 0 ? _a : '', handleChange: handleInputChange, autoComplete: "off" })), _jsx(Text, { textAlign: "center", variant: "caption", children: t('signup.subtitle') }), _jsx(PasswordInput, { errorMessage: passwordErrorMessage(values.password), hasError: isValidated &&
|
|
22
22
|
(!isValidPassword(inputs.password) ||
|
|
23
|
-
!passwordMatch(inputs.password, inputs.confirmPassword)), id: "password", placeholder: t('forms.password'), value: (_b = inputs.password) !== null && _b !== void 0 ? _b : '', handleChange: (event) => handleInputChange(event), autoComplete:
|
|
23
|
+
!passwordMatch(inputs.password, inputs.confirmPassword)), id: "password", placeholder: t('forms.password'), value: (_b = inputs.password) !== null && _b !== void 0 ? _b : '', handleChange: (event) => handleInputChange(event), autoComplete: "new-password" }), _jsx(PasswordInput, { errorMessage: passwordErrorMessage(inputs.confirmPassword), hasError: isValidated &&
|
|
24
24
|
(!isValidPassword(inputs.confirmPassword) ||
|
|
25
|
-
!passwordMatch(inputs.password, inputs.confirmPassword)), id: "confirmPassword", placeholder: t('forms.passwordConfirm'), value: (_c = inputs.confirmPassword) !== null && _c !== void 0 ? _c : '', handleChange: (event) => handleInputChange(event), autoComplete:
|
|
25
|
+
!passwordMatch(inputs.password, inputs.confirmPassword)), id: "confirmPassword", placeholder: t('forms.passwordConfirm'), value: (_c = inputs.confirmPassword) !== null && _c !== void 0 ? _c : '', handleChange: (event) => handleInputChange(event), autoComplete: "new-password" }), _jsx(Center, { px: ['container.sm', 'container.md', 'container.lg'], h: "4rem", children: _jsxs(Text, { textAlign: "center", variant: "info", w: "100%", children: [t('signup.terms'), _jsx("a", { target: "_blank", href: t('footer.termsUrl'), children: t('footer.termsLink') })] }) }), _jsx(Button, { isLoading: isLoading, spinner: _jsx(ButtonLoader, {}), onClick: handleSubmit, children: t('signup.signupBt') })] }) }), _jsx(CardFooter, { title: t('signup.signin'), buttonLabel: t('signup.signinBt'), handleButtonClick: handleSignIn })] }), _jsx(Footer, {})] }));
|
|
26
26
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { t } from 'i18next';
|
|
3
3
|
import { Box, Button, Text, Container, Stack, Center } from '@chakra-ui/react';
|
|
4
|
-
import { Logo, Footer, ButtonLoader, TextInput } from '../..';
|
|
4
|
+
import { Logo, Footer, ButtonLoader, TextInput, BasePageWrapper, } from '../..';
|
|
5
5
|
import { isEmptyField } from '../../../utils';
|
|
6
6
|
import { useTwoFactor } from '../../../hooks';
|
|
7
7
|
export const TwoFactor = ({ handleReset, handleResend, isLoading, twoFactorMethod, }) => {
|
|
8
8
|
const { code, handleInputChange, handleSubmit, isValidated } = useTwoFactor(handleReset);
|
|
9
|
-
return (_jsxs(
|
|
9
|
+
return (_jsxs(BasePageWrapper, { children: [_jsxs(Container, { size: "onboarding", boxShadow: "lg", children: [_jsx(Logo, {}), _jsxs(Stack, { my: "6", children: [_jsx(Text, { variant: "title", textAlign: "center", px: "10", children: t('reset.2FA.title') }), _jsxs(Text, { fontFamily: "secondary", textAlign: "center", px: ['10', '20'], children: [twoFactorMethod === 'email' && t('reset.2FA.subtitleEmail'), twoFactorMethod === 'sms' && t('reset.2FA.subtitleSms')] })] }), _jsx(Box, { px: ['container.sm', 'container.md', 'container.lg'], pb: "container.md", mb: "6", children: _jsxs(Stack, { spacing: "4", children: [_jsx(TextInput, { errorMessage: t('forms.code') + ' ' + t('forms.required'), hasError: isValidated && isEmptyField(code), id: "code", placeholder: t('reset.2FA.placeholder'), value: code, handleChange: handleInputChange }), _jsx(Button, { isLoading: isLoading, spinner: _jsx(ButtonLoader, {}), onClick: handleSubmit, children: t('forms.submit') }), _jsx(Center, { children: _jsx(Button, { onClick: handleResend, variant: "text", children: t('reset.2FA.resend') }) })] }) })] }), _jsx(Footer, {})] }));
|
|
10
10
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
1
|
+
export * from './ActivateAccount';
|
|
2
|
+
export * from './BasePageWrapper';
|
|
3
|
+
export * from './EmailValidation';
|
|
4
|
+
export * from './ResetPassword';
|
|
5
|
+
export * from './SignIn';
|
|
6
|
+
export * from './SignUp';
|
|
7
|
+
export * from './Welcome';
|
|
8
|
+
export * from './NewPassword';
|
|
9
|
+
export * from './ResendResetPassword';
|
|
10
|
+
export * from './TwoFactor';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
1
|
+
export * from './ActivateAccount';
|
|
2
|
+
export * from './BasePageWrapper';
|
|
3
|
+
export * from './EmailValidation';
|
|
4
|
+
export * from './ResetPassword';
|
|
5
|
+
export * from './SignIn';
|
|
6
|
+
export * from './SignUp';
|
|
7
|
+
export * from './Welcome';
|
|
8
|
+
export * from './NewPassword';
|
|
9
|
+
export * from './ResendResetPassword';
|
|
10
|
+
export * from './TwoFactor';
|