@homefile/components-v2 2.8.11 → 2.8.13

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.
@@ -12,7 +12,7 @@ export const ContactsContent = ({ apiError, contacts, menuItems, handleClose, ch
12
12
  });
13
13
  const { windowDimensions: { width }, } = useWindowDimensions();
14
14
  const maxW = width > 413 ? '16rem' : '10rem';
15
- const isDisabled = Number(itemsSelected.length) === 0;
15
+ const isDisabled = Number(itemsSelected.length) === 0 || disabled;
16
16
  return (_jsxs(DrawerContent, { bg: "lightBlue.1", children: [_jsxs(DrawerHeader, { p: "0", children: [_jsx(PanelHeader, { handleCloseButton: handleClose, icon: Contacts, title: t('contacts.title') }), _jsxs(Flex, { justify: "space-between", pl: "base", my: "base", align: "center", gap: "base", children: [_jsx(SearchInput, { maxW: maxW, value: search, onChange: handleChange }), _jsx(LeftButtonAnimated, { onClick: handleAdd, label: t('contacts.addBtn'), disabled: disabled })] })] }), _jsxs(DrawerBody, { p: "0", overflowX: "hidden", children: [_jsxs(Stack, { spacing: "base", pt: "base", pb: "120px", pr: "base", bg: "lightBlue.2", minHeight: "full", children: [_jsxs(Flex, { gap: "3", pl: "base", children: [_jsx(Checkbox, { onChange: handleSelectAll }), _jsx(Text, { fontFamily: "secondary", fontSize: "xs", children: t('subscription.select') })] }), _jsx(Box, { children: Object.keys(splittedContacts).map((letter, idx) => {
17
17
  const showLetterDivider = idx !== 0;
18
18
  return (_jsxs(Stack, { spacing: "0", children: [showLetterDivider && _jsx(LetterDivider, { letter: letter }), _jsx(Stack, { spacing: "2px", children: splittedContacts[letter].map((contact, idx) => {
@@ -22,15 +22,13 @@ export const ContactsContent = ({ apiError, contacts, menuItems, handleClose, ch
22
22
  }) }), Number(contactsWithoutFirstOrLastName.length) > 0 && (_jsx(LetterDivider, { letter: "Others" })), _jsx(Box, { children: contactsWithoutFirstOrLastName.map((contact, idx) => {
23
23
  const selected = isItemSelected(contact._id);
24
24
  return (_jsx(Card, { apiError: apiError, contact: contact, onClick: onClick, index: idx, menuItems: menuItems, selected: selected, onChange: handleItemSelect }, contact._id));
25
- }) })] }), children] }), _jsx(DrawerFooter, { p: "0", zIndex: "overlay", children: _jsx(FooterDrawer, { isOpen: true, children: _jsx(FooterButtons, { button1: {
25
+ }) })] }), children] }), _jsx(DrawerFooter, { p: "0", zIndex: "overlay", children: _jsx(FooterDrawer, { isOpen: !isDisabled, children: _jsx(FooterButtons, { button1: {
26
26
  buttonStyle: 'primaryFooter',
27
27
  label: t('buttons.share'),
28
- isDisabled,
29
28
  onClick: () => onShareContacts(getContactByIds(itemsSelected)),
30
29
  }, button2: {
31
30
  buttonStyle: 'secondaryFooter',
32
31
  label: t('buttons.delete'),
33
- isDisabled,
34
32
  onClick: () => onDeleteContacts(itemsSelected),
35
33
  } }) }) })] }));
36
34
  };
@@ -1,3 +1,3 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  import { ItemFormPanelI } from '../../../../interfaces';
3
- export declare const ItemFormPanel: ({ children, itemName, onClose, onSaveItemName, onSubmitForm, panelIcon, panelTitle, showFooter, showOverlay, }: PropsWithChildren<ItemFormPanelI>) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const ItemFormPanel: ({ children, itemName, onClose, onSaveItemName, onSubmitForm, panelIcon, panelTitle, showOverlay, }: PropsWithChildren<ItemFormPanelI>) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { DrawerBody, DrawerHeader, DrawerContent, DrawerFooter, Box, } from '@chakra-ui/react';
3
3
  import { PanelHeader, FooterDrawer, ItemNameHeader, ItemFormFooter, Overlay, } from '../../..';
4
- export const ItemFormPanel = ({ children, itemName, onClose, onSaveItemName, onSubmitForm, panelIcon, panelTitle, showFooter = false, showOverlay = false, }) => {
5
- return (_jsxs(DrawerContent, { bg: "lightBlue.1", children: [_jsx(DrawerHeader, { p: "0", children: _jsx(PanelHeader, { handleCloseButton: onClose, icon: panelIcon, title: panelTitle }) }), _jsxs(DrawerBody, { p: "0", pb: "12", overflowX: "hidden", bg: "lightBlue.1", children: [_jsx(ItemNameHeader, { id: "item-name", onSave: onSaveItemName, value: itemName }), _jsxs(Box, { position: "relative", children: [_jsx(Overlay, { showOverlay: showOverlay, position: "absolute", w: "inherit", h: "inherit", zIndex: "9" }), children] })] }), _jsx(FooterDrawer, { isOpen: showFooter, children: _jsx(DrawerFooter, { w: "100%", children: _jsx(ItemFormFooter, { onSave: onSubmitForm, onCancel: onClose }) }) })] }));
4
+ export const ItemFormPanel = ({ children, itemName, onClose, onSaveItemName, onSubmitForm, panelIcon, panelTitle, showOverlay = false, }) => {
5
+ return (_jsxs(DrawerContent, { bg: "lightBlue.1", children: [_jsx(DrawerHeader, { p: "0", children: _jsx(PanelHeader, { handleCloseButton: onClose, icon: panelIcon, title: panelTitle }) }), _jsxs(DrawerBody, { p: "0", overflowX: "hidden", bg: "lightBlue.1", children: [_jsx(ItemNameHeader, { id: "item-name", onSave: onSaveItemName, value: itemName }), _jsxs(Box, { position: "relative", mb: "200px", children: [_jsx(Overlay, { showOverlay: showOverlay, position: "absolute", w: "inherit", h: "inherit", zIndex: "9" }), children] })] }), _jsx(FooterDrawer, { isOpen: !showOverlay, children: _jsx(DrawerFooter, { w: "100%", py: "0", children: _jsx(ItemFormFooter, { onSave: onSubmitForm, onCancel: onClose }) }) })] }));
6
6
  };
@@ -5,6 +5,5 @@ export interface ItemFormPanelI {
5
5
  onSubmitForm: () => void;
6
6
  panelIcon: string;
7
7
  panelTitle: string;
8
- showFooter?: boolean;
9
8
  showOverlay?: boolean;
10
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.8.11",
3
+ "version": "2.8.13",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",
@@ -66,7 +66,7 @@ export const ContactsContent = ({
66
66
  } = useWindowDimensions()
67
67
 
68
68
  const maxW = width > 413 ? '16rem' : '10rem'
69
- const isDisabled = Number(itemsSelected.length) === 0
69
+ const isDisabled = Number(itemsSelected.length) === 0 || disabled
70
70
 
71
71
  return (
72
72
  <DrawerContent bg="lightBlue.1">
@@ -157,18 +157,16 @@ export const ContactsContent = ({
157
157
  {children}
158
158
  </DrawerBody>
159
159
  <DrawerFooter p="0" zIndex="overlay">
160
- <FooterDrawer isOpen>
160
+ <FooterDrawer isOpen={!isDisabled}>
161
161
  <FooterButtons
162
162
  button1={{
163
163
  buttonStyle: 'primaryFooter',
164
164
  label: t('buttons.share'),
165
- isDisabled,
166
165
  onClick: () => onShareContacts(getContactByIds(itemsSelected)),
167
166
  }}
168
167
  button2={{
169
168
  buttonStyle: 'secondaryFooter',
170
169
  label: t('buttons.delete'),
171
- isDisabled,
172
170
  onClick: () => onDeleteContacts(itemsSelected),
173
171
  }}
174
172
  />
@@ -23,7 +23,6 @@ export const ItemFormPanel = ({
23
23
  onSubmitForm,
24
24
  panelIcon,
25
25
  panelTitle,
26
- showFooter = false,
27
26
  showOverlay = false,
28
27
  }: PropsWithChildren<ItemFormPanelI>) => {
29
28
  return (
@@ -36,13 +35,13 @@ export const ItemFormPanel = ({
36
35
  />
37
36
  </DrawerHeader>
38
37
 
39
- <DrawerBody p="0" pb="12" overflowX="hidden" bg="lightBlue.1">
38
+ <DrawerBody p="0" overflowX="hidden" bg="lightBlue.1">
40
39
  <ItemNameHeader
41
40
  id="item-name"
42
41
  onSave={onSaveItemName}
43
42
  value={itemName}
44
43
  />
45
- <Box position="relative">
44
+ <Box position="relative" mb="200px">
46
45
  <Overlay
47
46
  showOverlay={showOverlay}
48
47
  position="absolute"
@@ -53,8 +52,8 @@ export const ItemFormPanel = ({
53
52
  {children}
54
53
  </Box>
55
54
  </DrawerBody>
56
- <FooterDrawer isOpen={showFooter}>
57
- <DrawerFooter w="100%">
55
+ <FooterDrawer isOpen={!showOverlay}>
56
+ <DrawerFooter w="100%" py="0">
58
57
  <ItemFormFooter onSave={onSubmitForm} onCancel={onClose} />
59
58
  </DrawerFooter>
60
59
  </FooterDrawer>
@@ -5,6 +5,5 @@ export interface ItemFormPanelI {
5
5
  onSubmitForm: () => void
6
6
  panelIcon: string
7
7
  panelTitle: string
8
- showFooter?: boolean
9
8
  showOverlay?: boolean
10
9
  }