@homefile/components-v2 2.7.9 → 2.7.11

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.
@@ -5,5 +5,5 @@ import { BackCircleButton, TextInput } from '..';
5
5
  export const ShareHomeAddEmail = ({ contact, onBack, onChange, }) => {
6
6
  const { email, firstName, lastName } = contact;
7
7
  const displayName = `${firstName} ${lastName}`.trim();
8
- return (_jsxs(Box, { children: [_jsx(Box, { bg: "lightBlue.2", py: "2", px: "base", w: "100%", children: _jsxs(Flex, { align: "center", gap: "base", children: [_jsx(BackCircleButton, { onClick: onBack }), _jsx(Box, { bg: "lightBlue.9", w: "1px", h: "21px" }), _jsx(Text, { children: displayName })] }) }), _jsxs(Stack, { spacing: "base", p: "base", h: "230px", bg: "lightBlue.1", children: [_jsx(Text, { variant: "home", children: t('shareHome.notEmail') }), _jsx(TextInput, { autoCapitalize: "none", autoCorrect: "off", errorMessage: t('forms.errorEmail'), handleChange: onChange, id: "email", placeholder: t('shareHome.placeholder'), value: email, noOfLines: 1 })] })] }));
8
+ return (_jsxs(Box, { children: [_jsx(Box, { bg: "lightBlue.2", py: "2", px: "base", w: "100%", children: _jsxs(Flex, { align: "center", gap: "base", children: [_jsx(BackCircleButton, { onClick: onBack }), _jsx(Box, { bg: "lightBlue.9", w: "1px", h: "21px" }), _jsx(Text, { children: displayName })] }) }), _jsxs(Stack, { spacing: "base", p: "base", h: "230px", bg: "lightBlue.1", children: [_jsx(Text, { variant: "home", children: t('shareHome.notEmail') }), _jsx(TextInput, { "data-testid": "share-home-add-email", autoCapitalize: "none", autoCorrect: "off", errorMessage: t('forms.errorEmail'), handleChange: onChange, id: "email", placeholder: t('shareHome.placeholder'), value: email, noOfLines: 1 })] })] }));
9
9
  };
@@ -7,7 +7,7 @@ export const ShareHomeContactCard = ({ contact, index, onAddEmail, onClick, }) =
7
7
  const { firstName, lastName, email } = contact;
8
8
  const name = `${firstName} ${lastName}`.trim();
9
9
  const handleClick = email ? onClick : onAddEmail;
10
- return (_jsxs(Flex, { justify: "space-between", as: "button", w: "100%", py: "base", align: "center", transition: "all 0.2s", onClick: () => handleClick(contact), _hover: {
10
+ return (_jsxs(Flex, { "data-testid": contact._id, justify: "space-between", as: "button", w: "100%", py: "base", align: "center", transition: "all 0.2s", onClick: () => handleClick(contact), _hover: {
11
11
  backgroundColor: 'lightGreen.3',
12
12
  px: 'base',
13
13
  }, children: [_jsxs(Flex, { align: "center", gap: "2", children: [_jsx(Avatar, { size: "sm", name: name, bg: randomColor(index), fontWeight: "bold", color: "neutral.white", id: "profile" }), _jsx(Text, { noOfLines: 1, textOverflow: "ellipsis", textAlign: "left", children: name })] }), _jsx(Plus, { stroke: colors.blue['3'] })] }));
@@ -6,7 +6,7 @@ import { useShareHomeForm } from '../../hooks';
6
6
  import { ShareHomeContactList } from './ShareHomeContactList';
7
7
  export const ShareHomeForm = ({ contacts, loading, onAdd, onEmailSave, }) => {
8
8
  const { accountTypes, contact, handleChange, handleInputSelect, handleOpen, handleSelectContact, handleSubmit, hasError, open, types, } = useShareHomeForm(onAdd);
9
- return (_jsx(Box, { p: "base", w: "100%", children: _jsxs(Flex, { w: "100%", gap: "base", children: [_jsxs(Flex, { position: "relative", flex: 1, children: [_jsx(ShareWithButton, { marginRight: "-1px", onClick: handleOpen }), _jsx(TextInput, { "data-testid": "share-home-form-email", autoCapitalize: "none", autoCorrect: "off", errorMessage: t('forms.errorEmail'), handleChange: handleChange, hasError: hasError, id: "email", placeholder: t('shareHome.placeholder'), value: contact.email, noOfLines: 1 }), open && (_jsx(ShareHomeContactList, { contacts: contacts, onClick: handleSelectContact, onDone: handleOpen, onChange: handleChange, onSave: (contact) => {
9
+ return (_jsx(Box, { p: "base", w: "100%", children: _jsxs(Flex, { w: "100%", gap: "base", children: [_jsxs(Flex, { position: "relative", flex: 1, children: [_jsx(ShareWithButton, { "data-testid": "share-with-button", marginRight: "-1px", onClick: handleOpen }), _jsx(TextInput, { "data-testid": "share-home-form-email", autoCapitalize: "none", autoCorrect: "off", errorMessage: t('forms.errorEmail'), handleChange: handleChange, hasError: hasError, id: "email", placeholder: t('shareHome.placeholder'), value: contact.email, noOfLines: 1 }), open && (_jsx(ShareHomeContactList, { contacts: contacts, onClick: handleSelectContact, onDone: handleOpen, onChange: handleChange, onSave: (contact) => {
10
10
  onEmailSave(contact);
11
11
  handleOpen();
12
12
  }, selectedContact: contact }))] }), _jsx(SelectInputWithBadge, { handleClick: handleInputSelect, initialValue: accountTypes[0], items: types, width: "70px", height: "md" }), _jsx(Button, { "data-testid": "share-home-form-submit", variant: "tertiary", onClick: handleSubmit, disabled: !contact.email, isLoading: loading, h: "48px", children: t('shareHome.btInvite') })] }) }));
@@ -4,9 +4,10 @@ import { Box, chakra, Flex, Stack, Text } from '@chakra-ui/react';
4
4
  import { LetterBadge } from '../..';
5
5
  import { homeRoles } from '../../../helpers';
6
6
  const TypeContent = ({ description, type }) => {
7
+ var _a;
7
8
  const letter = type[0];
8
- return (_jsxs(Box, { p: "base", border: "1px", borderColor: "lightBlue.6", children: [_jsxs(Flex, { gap: "base", mb: "2", align: "center", children: [_jsx(LetterBadge, { bgColor: homeRoles[type.toLowerCase()].bg, letter: letter }), _jsx(Text, { fontSize: "md", fontWeight: "semibold", children: type })] }), _jsx(Text, { fontSize: "sm", textAlign: "left", lineHeight: "1.2", children: description })] }));
9
+ return (_jsxs(Box, { p: "base", border: "1px", borderColor: "lightBlue.6", children: [_jsxs(Flex, { gap: "base", mb: "2", align: "center", children: [_jsx(LetterBadge, { bgColor: (_a = homeRoles[type.toLowerCase()]) === null || _a === void 0 ? void 0 : _a.bg, letter: letter }), _jsx(Text, { fontSize: "md", fontWeight: "semibold", children: type })] }), _jsx(Text, { fontSize: "sm", textAlign: "left", lineHeight: "1.2", children: description })] }));
9
10
  };
10
11
  export const AccountTypeRow = () => {
11
- return (_jsxs(Stack, { spacing: "base", bg: "neutral.white", children: [_jsx(TypeContent, { description: _jsxs(_Fragment, { children: [t('tour.steps.inviteRoles.member.description1'), _jsx(chakra.span, { fontWeight: "semibold", children: t('tour.steps.inviteRoles.member.description2') }), t('tour.steps.inviteRoles.member.description3')] }), type: t('tour.steps.inviteRoles.types.member') }), _jsx(TypeContent, { description: _jsxs(_Fragment, { children: [t('tour.steps.inviteRoles.contributor.description1'), _jsx(chakra.span, { fontWeight: "semibold", fontStyle: "italic", children: t('tour.steps.inviteRoles.contributor.description2') }), _jsx(chakra.span, { fontWeight: "semibold", fontStyle: "italic", children: t('tour.steps.inviteRoles.contributor.description3') }), t('tour.steps.inviteRoles.contributor.description4'), _jsx(chakra.span, { fontWeight: "semibold", fontStyle: "italic", children: t('tour.steps.inviteRoles.contributor.description5') }), t('tour.steps.inviteRoles.contributor.description6'), _jsx(chakra.span, { fontWeight: "semibold", children: t('tour.steps.inviteRoles.contributor.description7') }), t('tour.steps.inviteRoles.contributor.description8')] }), type: t('tour.steps.inviteRoles.types.contributor') }), _jsx(TypeContent, { description: _jsxs(_Fragment, { children: [t('tour.steps.inviteRoles.manager.description1'), _jsx(chakra.span, { fontWeight: "semibold", fontStyle: "italic", children: t('tour.steps.inviteRoles.manager.description2') }), t('tour.steps.inviteRoles.manager.description3'), _jsx(chakra.span, { fontWeight: "semibold", fontStyle: "italic", children: t('tour.steps.inviteRoles.manager.description4') }), t('tour.steps.inviteRoles.manager.description5')] }), type: t('tour.steps.inviteRoles.types.manager') })] }));
12
+ return (_jsxs(Stack, { spacing: "base", bg: "neutral.white", "data-testid": "account-type-row", children: [_jsx(TypeContent, { description: _jsxs(_Fragment, { children: [t('tour.steps.inviteRoles.member.description1'), _jsx(chakra.span, { fontWeight: "semibold", children: t('tour.steps.inviteRoles.member.description2') }), t('tour.steps.inviteRoles.member.description3')] }), type: t('tour.steps.inviteRoles.types.member') }), _jsx(TypeContent, { description: _jsxs(_Fragment, { children: [t('tour.steps.inviteRoles.contributor.description1'), _jsx(chakra.span, { fontWeight: "semibold", fontStyle: "italic", children: t('tour.steps.inviteRoles.contributor.description2') }), _jsx(chakra.span, { fontWeight: "semibold", fontStyle: "italic", children: t('tour.steps.inviteRoles.contributor.description3') }), t('tour.steps.inviteRoles.contributor.description4'), _jsx(chakra.span, { fontWeight: "semibold", fontStyle: "italic", children: t('tour.steps.inviteRoles.contributor.description5') }), t('tour.steps.inviteRoles.contributor.description6'), _jsx(chakra.span, { fontWeight: "semibold", children: t('tour.steps.inviteRoles.contributor.description7') }), t('tour.steps.inviteRoles.contributor.description8')] }), type: t('tour.steps.inviteRoles.types.contributor') }), _jsx(TypeContent, { description: _jsxs(_Fragment, { children: [t('tour.steps.inviteRoles.manager.description1'), _jsx(chakra.span, { fontWeight: "semibold", fontStyle: "italic", children: t('tour.steps.inviteRoles.manager.description2') }), t('tour.steps.inviteRoles.manager.description3'), _jsx(chakra.span, { fontWeight: "semibold", fontStyle: "italic", children: t('tour.steps.inviteRoles.manager.description4') }), t('tour.steps.inviteRoles.manager.description5')] }), type: t('tour.steps.inviteRoles.types.manager') })] }));
12
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.7.9",
3
+ "version": "2.7.11",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",
@@ -22,6 +22,7 @@ export const ShareHomeAddEmail = ({
22
22
  <Stack spacing="base" p="base" h="230px" bg="lightBlue.1">
23
23
  <Text variant="home">{t('shareHome.notEmail')}</Text>
24
24
  <TextInput
25
+ data-testid="share-home-add-email"
25
26
  autoCapitalize="none"
26
27
  autoCorrect="off"
27
28
  errorMessage={t('forms.errorEmail')}
@@ -15,6 +15,7 @@ export const ShareHomeContactCard = ({
15
15
  const handleClick = email ? onClick : onAddEmail
16
16
  return (
17
17
  <Flex
18
+ data-testid={contact._id}
18
19
  justify="space-between"
19
20
  as="button"
20
21
  w="100%"
@@ -27,7 +27,11 @@ export const ShareHomeForm = ({
27
27
  <Box p="base" w="100%">
28
28
  <Flex w="100%" gap="base">
29
29
  <Flex position="relative" flex={1}>
30
- <ShareWithButton marginRight="-1px" onClick={handleOpen} />
30
+ <ShareWithButton
31
+ data-testid="share-with-button"
32
+ marginRight="-1px"
33
+ onClick={handleOpen}
34
+ />
31
35
  <TextInput
32
36
  data-testid="share-home-form-email"
33
37
  autoCapitalize="none"
@@ -10,7 +10,7 @@ const TypeContent = ({ description, type }: TypeContentI) => {
10
10
  <Box p="base" border="1px" borderColor="lightBlue.6">
11
11
  <Flex gap="base" mb="2" align="center">
12
12
  <LetterBadge
13
- bgColor={homeRoles[type.toLowerCase()].bg}
13
+ bgColor={homeRoles[type.toLowerCase()]?.bg}
14
14
  letter={letter}
15
15
  />
16
16
  <Text fontSize="md" fontWeight="semibold">
@@ -26,7 +26,7 @@ const TypeContent = ({ description, type }: TypeContentI) => {
26
26
 
27
27
  export const AccountTypeRow = () => {
28
28
  return (
29
- <Stack spacing="base" bg="neutral.white">
29
+ <Stack spacing="base" bg="neutral.white" data-testid="account-type-row">
30
30
  <TypeContent
31
31
  description={
32
32
  <>