@homefile/components-v2 2.38.10 → 2.38.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.
@@ -4,9 +4,8 @@ export const TabsHeader = ({ onChange, tabList, tabIndex, defaultIndex, rightBut
4
4
  return (_jsxs(Tabs, { zIndex: "base", variant: "unstyled", onChange: onChange, index: tabIndex, defaultIndex: defaultIndex, h: "100%", children: [_jsx(Box, { bg: "lightBlue.2", children: _jsxs(Flex, { justify: "space-between", children: [_jsx(TabList, { bg: "neutral.white", w: "full", children: tabList === null || tabList === void 0 ? void 0 : tabList.map(({ label }) => (_jsx(CustomTab, { label: label }, label))) }), _jsxs(Flex, { flexShrink: 0, children: [_jsx(TabList, { bg: "neutral.white", w: "full", children: rightTabList === null || rightTabList === void 0 ? void 0 : rightTabList.map(({ label }) => (_jsx(CustomTab, { label: label }, label))) }), rightButton] })] }) }), _jsx(TabPanels, { h: "100%", children: tabList === null || tabList === void 0 ? void 0 : tabList.map(({ label, component }) => (_jsx(TabPanel, { p: "0", h: "100%", children: component }, label))) })] }));
5
5
  };
6
6
  const CustomTab = ({ label = '' }) => {
7
- return (_jsx(Tab, { minW: "1rem", px: "base", py: "0", lineHeight: "10", textTransform: "uppercase", fontWeight: "medium", fontSize: "sm", fontFamily: "primary", color: "blue.3", borderBottom: "3px solid transparent", _hover: { cursor: 'pointer' }, _focus: { outline: 'none' }, _selected: {
7
+ return (_jsx(Tab, { minW: "1rem", px: "base", py: "0", lineHeight: "10", textTransform: "uppercase", fontWeight: "medium", fontSize: "sm", fontFamily: "primary", color: "blue.2", borderBottom: "3px solid transparent", _hover: { cursor: 'pointer' }, _focus: { outline: 'none' }, _selected: {
8
8
  color: 'blue.8',
9
- fontWeight: 'bold',
10
9
  borderColor: 'blue.8',
11
10
  }, children: label }));
12
11
  };
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  };
12
12
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { t } from 'i18next';
14
- import { Box, Center, Image } from '@chakra-ui/react';
14
+ import { Center, Image, Stack } from '@chakra-ui/react';
15
15
  import { BeatLoader } from 'react-spinners';
16
16
  import { EditFileUploader, HomeCardReadOnly, TileTooltip, EditHomeDetails, } from '../../components';
17
17
  import { useHomeCard } from '../../hooks';
@@ -29,5 +29,5 @@ export const HomeCard = (_a) => {
29
29
  };
30
30
  const { imageUrl } = useHomeCard(image);
31
31
  const hasImage = Boolean(imageUrl);
32
- return (_jsx(TileTooltip, { label: "homeCard", children: _jsxs(Box, { children: [_jsxs(Center, { pos: "relative", h: "12rem", bg: "lightBlue.2", overflow: "hidden", children: [loading && (_jsx(Center, { h: "8rem", children: _jsx(BeatLoader, { color: "gray", size: 8 }) })), !loading && (_jsxs(_Fragment, { children: [edit && (_jsx(EditFileUploader, { handleInputChange: addImage, "aria-label": t('ariaLabels.edit'), position: "absolute", right: "2", top: "1" })), _jsx(Image, { src: (hasImage && imageUrl) || randomImages(0), alt: `${name} ${t('images.altImage')}`, w: "full", objectFit: "cover" })] }))] }), !isEditMode && (_jsx(HomeCardReadOnly, Object.assign({ addImage: addImage, name: name, externalLink: externalLink, edit: edit }, props, address))), isEditMode && (_jsx(EditHomeDetails, { address: address, externalLink: externalLink, name: name, setIsDirty: setIsDirty }))] }) }));
32
+ return (_jsx(TileTooltip, { label: "homeCard", children: _jsxs(Stack, { spacing: "base", bg: "white", children: [_jsxs(Center, { pos: "relative", h: "12rem", bg: "lightBlue.2", overflow: "hidden", children: [loading && (_jsx(Center, { h: "8rem", children: _jsx(BeatLoader, { color: "gray", size: 8 }) })), !loading && (_jsxs(_Fragment, { children: [edit && (_jsx(EditFileUploader, { handleInputChange: addImage, "aria-label": t('ariaLabels.edit'), position: "absolute", right: "2", top: "1" })), _jsx(Image, { src: (hasImage && imageUrl) || randomImages(0), alt: `${name} ${t('images.altImage')}`, w: "full", objectFit: "cover" })] }))] }), !isEditMode && (_jsx(HomeCardReadOnly, Object.assign({ addImage: addImage, name: name, externalLink: externalLink, edit: edit }, props, address))), isEditMode && (_jsx(EditHomeDetails, { address: address, externalLink: externalLink, name: name, setIsDirty: setIsDirty }))] }) }));
33
33
  };
@@ -3,5 +3,5 @@ import { t } from 'i18next';
3
3
  import { Box, Stack, Flex, IconButton, Tooltip, Text } from '@chakra-ui/react';
4
4
  import { Edit } from '../../components';
5
5
  export const HomeCardReadOnly = ({ city, edit = true, externalLink, handleEditClick, maxW, mail, name, number, phone, street, state, zip, }) => {
6
- return (_jsx(Box, { w: maxW, children: _jsxs(Stack, { px: "base", pb: "base", pt: "2", bg: "neutral.white", spacing: "1", children: [_jsxs(Flex, { justify: "space-between", align: "center", children: [_jsx(Text, { variant: "heading6", noOfLines: 1, textOverflow: "ellipsis", children: name }), edit && (_jsx(Tooltip, { label: t('tooltips.editDetails'), children: _jsx(IconButton, { variant: "menuIconWithShadow", maxW: "fit-content", "aria-label": t('ariaLabels.edit'), p: "1", icon: _jsx(Edit, {}), onClick: handleEditClick, id: "editHomeIcon" }) }))] }), _jsxs(Box, { children: [_jsxs(Flex, { justify: "space-between", align: "center", children: [_jsx(Text, { variant: "info", children: `${number} ${street}` }), mail && _jsx(Text, { variant: "email", children: mail })] }), _jsx(Text, { variant: "info", lineHeight: "14px", children: `${city} ${state} ${zip}` }), phone && (_jsx(Text, { variant: "info", mt: "-1.5", children: phone }))] }), externalLink && (_jsx(Text, { fontSize: "xs", fontFamily: "secondary", color: "blue.3", textOverflow: "ellipsis", noOfLines: 1, children: externalLink }))] }) }));
6
+ return (_jsx(Box, { w: maxW, children: _jsxs(Stack, { px: "base", pb: "base", pt: "base", bg: "neutral.white", spacing: "1", children: [_jsxs(Flex, { justify: "space-between", align: "center", children: [_jsx(Text, { variant: "heading6", noOfLines: 1, textOverflow: "ellipsis", children: name }), edit && (_jsx(Tooltip, { label: t('tooltips.editDetails'), children: _jsx(IconButton, { variant: "menuIconWithShadow", maxW: "fit-content", "aria-label": t('ariaLabels.edit'), p: "1", icon: _jsx(Edit, {}), onClick: handleEditClick, id: "editHomeIcon" }) }))] }), _jsxs(Box, { children: [_jsxs(Flex, { justify: "space-between", align: "center", children: [_jsx(Text, { variant: "info", children: `${number} ${street}` }), mail && _jsx(Text, { variant: "email", children: mail })] }), _jsx(Text, { variant: "info", children: `${city} ${state} ${zip}` }), phone && (_jsx(Text, { variant: "info", mt: "-1.5", children: phone }))] }), externalLink && (_jsx(Text, { fontSize: "xs", fontFamily: "secondary", color: "blue.3", textOverflow: "ellipsis", noOfLines: 1, children: externalLink }))] }) }));
7
7
  };
@@ -18,8 +18,8 @@ export const HomeCardRecords = ({ records = {}, onAddRecords, onViewDetails, })
18
18
  if (!hasRecords) {
19
19
  return _jsx(AddHomeRecords, { onAddRecords: onAddRecords });
20
20
  }
21
- return (_jsx(Box, { p: "base", children: _jsxs(Container, { children: [_jsx(Box, { children: _jsx(Grid, { templateColumns: "repeat(2, 1fr)", templateRows: "repeat(4, 1fr)", gridGap: "base", rowGap: "1", p: "base", borderBottom: "1px solid", borderColor: "lightBlue.2", autoFlow: "column", children: recordsMapped &&
22
- Object.entries(recordsMapped).map(([label, value = '']) => (_jsx(GridItem, { children: _jsxs(Flex, { children: [_jsx(Text, { fontFamily: "secondary", color: "gray.2", fontSize: "xs", noOfLines: 1, minW: "fit-content", lineHeight: "1.2", children: label }), _jsx(Text, { fontFamily: "secondary", fontWeight: "semibold", textAlign: "right", fontSize: "xs", noOfLines: 1, flex: "auto", lineHeight: "1.2", textTransform: "capitalize", children: value })] }) }, label + value))) }) }), _jsx(Center, { py: "base", children: _jsx(Button, { variant: "text", onClick: onViewDetails, children: t('homeBoard.viewDetails') }) })] }) }));
21
+ return (_jsx(Box, { p: "base", children: _jsxs(Container, { children: [_jsx(Box, { children: _jsx(Grid, { templateColumns: "repeat(2, 1fr)", templateRows: "repeat(4, 1fr)", p: "base", columnGap: "base", borderBottom: "1px solid", borderColor: "lightBlue.2", autoFlow: "column", children: recordsMapped &&
22
+ Object.entries(recordsMapped).map(([label, value = '']) => (_jsx(GridItem, { children: _jsxs(Flex, { children: [_jsx(Text, { fontFamily: "secondary", color: "gray.2", fontSize: "xs", noOfLines: 1, minW: "fit-content", lineHeight: "21px", children: label }), _jsx(Text, { fontFamily: "secondary", fontWeight: "semibold", textAlign: "right", fontSize: "xs", noOfLines: 1, flex: "auto", lineHeight: "21px", textTransform: "capitalize", children: value })] }) }, label + value))) }) }), _jsx(Center, { py: "base", children: _jsx(Button, { variant: "text", onClick: onViewDetails, children: t('homeBoard.viewDetails') }) })] }) }));
23
23
  };
24
24
  const AddHomeRecords = ({ onAddRecords, }) => {
25
25
  return (_jsxs(Stack, { px: "base", py: "6", spacing: "base", children: [_jsx(Text, { variant: "home", textAlign: "center", children: t('homeBoard.publicRecords') }), _jsxs(Button, { variant: "secondary", textTransform: "capitalize", onClick: onAddRecords, gap: "base", bg: "neutral.white", children: [_jsx(Plus, { stroke: colors.blue['2'] }), t('homeBoard.addRecords')] })] }));
@@ -1,2 +1,2 @@
1
1
  import { MyHomesI } from '../../interfaces';
2
- export declare const MyHomes: ({ cardList, cardMenuItems, handleCardClick, handleFilterClick, handleNewHomeClick, headerMenuItems, addImage, loading, loadingId, showLoadMore, handleLoadMore, loadMoreDisabled }: MyHomesI) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const MyHomes: ({ cardList, cardMenuItems, handleCardClick, handleFilterClick, handleNewHomeClick, headerMenuItems, addImage, loading, loadingId, showLoadMore, handleLoadMore, loadMoreDisabled, }: MyHomesI) => import("react/jsx-runtime").JSX.Element;
@@ -4,11 +4,11 @@ import { Box, Container, Wrap, WrapItem, Button, Flex } from '@chakra-ui/react';
4
4
  import { MyHomesHeader, MyHomeCard, ContainerHeader, MoreHorizontal, TileTooltip, InviteRolesStep, BaseStep, } from '../../components';
5
5
  import { House } from '../../assets/images';
6
6
  import { useState } from 'react';
7
- export const MyHomes = ({ cardList = [], cardMenuItems = [], handleCardClick, handleFilterClick, handleNewHomeClick, headerMenuItems, addImage, loading, loadingId, showLoadMore, handleLoadMore, loadMoreDisabled }) => {
7
+ export const MyHomes = ({ cardList = [], cardMenuItems = [], handleCardClick, handleFilterClick, handleNewHomeClick, headerMenuItems, addImage, loading, loadingId, showLoadMore, handleLoadMore, loadMoreDisabled, }) => {
8
8
  const [showChildren, setShowChildren] = useState(false);
9
9
  const handleHelpClick = () => setShowChildren(!showChildren);
10
10
  return (_jsx(TileTooltip, { label: "myHomes", children: _jsxs(Container, { variant: "launchpad", maxW: "none", pb: "3rem", position: "relative", children: [showChildren && (_jsx(BaseStep, { top: "60px", right: "60px", onClose: handleHelpClick, children: _jsx(InviteRolesStep, {}) })), _jsx(ContainerHeader, { disabled: true, menuItems: headerMenuItems, title: t('myHomes.title'), icon: _jsx(MoreHorizontal, { size: 38 }), titleIcon: House, showHelp: true, onHelpClick: handleHelpClick }), _jsx(MyHomesHeader, { onFilterClick: handleFilterClick, onNewHomeClick: handleNewHomeClick }), _jsx(Wrap, { spacing: "base", px: "base", alignItems: "start", children: cardList.length > 0 &&
11
11
  (cardList === null || cardList === void 0 ? void 0 : cardList.map(({ accountType, address, active, _id, image, name }, index) => (_jsx(WrapItem, { children: _jsxs(Container, { w: "179px", position: "relative", transition: "all 0.3s ease-in-out", _hover: {
12
12
  boxShadow: 'xl',
13
- }, id: index === 0 ? 'homeCard' : '', children: [_jsx(ContainerHeader, { menuItems: accountType === "Member" ? [] : cardMenuItems, itemForm: { _id, name }, icon: _jsx(MoreHorizontal, {}), isThin: true, index: index }), _jsx(Box, { w: "179px", textAlign: "left", children: _jsx(MyHomeCard, { accountType: accountType, address: address, image: image, name: name, active: active, _id: _id, index: index, handleCardClick: handleCardClick, addImage: addImage, loading: loading, loadingId: loadingId }) })] }) }, _id)))) }), showLoadMore && (_jsx(Flex, { justifyContent: 'center', mt: '2rem', children: _jsx(Button, { onClick: handleLoadMore, variant: "primaryFooter", disabled: loadMoreDisabled, children: t('buttons.loadMore') }) }))] }) }));
13
+ }, id: index === 0 ? 'homeCard' : '', children: [_jsx(ContainerHeader, { menuItems: accountType === 'Member' ? [] : cardMenuItems, itemForm: { _id, name }, icon: _jsx(MoreHorizontal, { size: 32 }), isThin: true, index: index }), _jsx(Box, { w: "179px", textAlign: "left", children: _jsx(MyHomeCard, { accountType: accountType, address: address, image: image, name: name, active: active, _id: _id, index: index, handleCardClick: handleCardClick, addImage: addImage, loading: loading, loadingId: loadingId }) })] }) }, _id)))) }), showLoadMore && (_jsx(Flex, { justifyContent: 'center', mt: '2rem', children: _jsx(Button, { onClick: handleLoadMore, variant: 'primaryFooter', disabled: loadMoreDisabled, children: t('buttons.loadMore') }) }))] }) }));
14
14
  };
@@ -3,9 +3,11 @@ import { HomeCardWithRecipent } from '../../components';
3
3
  import { HomeCards, recipientsDb } from '../../helpers';
4
4
  import { homeBoardRecorsMock } from '../../mocks';
5
5
  import { action } from '@storybook/addon-actions';
6
+ import { Box } from '@chakra-ui/react';
6
7
  export default {
7
8
  title: 'Components/HomeBoard',
8
9
  component: HomeCardWithRecipent,
10
+ decorators: [(story) => _jsx(Box, { w: "400px", children: story() })],
9
11
  };
10
12
  export const HomeCardWithRecipentComponent = (args) => {
11
13
  return _jsx(HomeCardWithRecipent, Object.assign({}, args));
@@ -35,6 +35,7 @@ export declare const Text: {
35
35
  info: {
36
36
  fontSize: string;
37
37
  fontFamily: string;
38
+ lineHeight: string;
38
39
  };
39
40
  label: {
40
41
  fontSize: string;
@@ -35,6 +35,7 @@ export const Text = {
35
35
  info: {
36
36
  fontSize: 'md',
37
37
  fontFamily: 'secondary',
38
+ lineHeight: '18px',
38
39
  },
39
40
  label: {
40
41
  fontSize: 'xs',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.38.10",
3
+ "version": "2.38.11",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",