@homefile/components-v2 2.7.9 → 2.7.10

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') })] }) }));
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.10",
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"