@homefile/components-v2 2.24.26 → 2.25.1

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.
Files changed (73) hide show
  1. package/dist/assets/images/shine/gutter-cleaning.png +0 -0
  2. package/dist/assets/images/shine/holiday-lights.png +0 -0
  3. package/dist/assets/images/shine/home-cleaning.png +0 -0
  4. package/dist/assets/images/shine/pressure.png +0 -0
  5. package/dist/assets/images/shine/roof-cleaning.png +0 -0
  6. package/dist/assets/images/shine/window.png +0 -0
  7. package/dist/components/forms/Collapsible.d.ts +1 -1
  8. package/dist/components/forms/Collapsible.js +3 -3
  9. package/dist/components/forms/dynamicForm/fields/uiFields/TileBody.js +1 -1
  10. package/dist/components/forms/dynamicForm/fields/uiFields/TileBody.tsx +1 -1
  11. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyHeader.js +1 -1
  12. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyHeader.tsx +3 -1
  13. package/dist/components/forms/dynamicForm/fields/uiFields/TileCta.js +1 -1
  14. package/dist/components/forms/dynamicForm/fields/uiFields/TileCta.tsx +1 -1
  15. package/dist/components/forms/dynamicForm/fields/uiFields/VerticalIcon.js +1 -1
  16. package/dist/components/forms/dynamicForm/fields/uiFields/VerticalIcon.tsx +8 -2
  17. package/dist/components/forms/readOnly/ReadOnlyDynamicForm.js +4 -2
  18. package/dist/components/forms/readOnly/fields/homeItem/ReadOnlyAppliances.js +16 -15
  19. package/dist/components/forms/readOnly/fields/homeItem/ReadOnlyAppliances.tsx +40 -35
  20. package/dist/components/forms/readOnly/fields/homeItem/ReadOnlyCollapsible.d.ts +2 -0
  21. package/dist/components/forms/readOnly/fields/homeItem/ReadOnlyCollapsible.js +19 -0
  22. package/dist/components/forms/readOnly/fields/homeItem/ReadOnlyCollapsible.tsx +34 -0
  23. package/dist/components/forms/readOnly/fields/homeItem/ReadOnlyGuidelines.js +1 -1
  24. package/dist/components/forms/readOnly/fields/homeItem/ReadOnlyGuidelines.tsx +2 -2
  25. package/dist/components/forms/readOnly/fields/homeItem/ReadOnlyHomeItemText.js +1 -1
  26. package/dist/components/forms/readOnly/fields/homeItem/ReadOnlyHomeItemText.tsx +1 -1
  27. package/dist/components/forms/readOnly/fields/homeItem/index.d.ts +1 -0
  28. package/dist/components/forms/readOnly/fields/homeItem/index.js +1 -0
  29. package/dist/components/forms/readOnly/fields/homeItem/index.ts +1 -0
  30. package/dist/components/headers/CollapsibleHeader.js +1 -1
  31. package/dist/components/partner/PartnerFooter.js +1 -1
  32. package/dist/components/partner/PartnerImage.js +2 -2
  33. package/dist/components/partner/ShortPartnerTile.d.ts +1 -1
  34. package/dist/components/partner/ShortPartnerTile.js +4 -5
  35. package/dist/interfaces/forms/Collapsible.interface.d.ts +2 -1
  36. package/dist/interfaces/forms/dynamicForm/DynamicForm.interface.d.ts +1 -1
  37. package/dist/interfaces/forms/readOnly/homeItem/ReadOnlyAppliances.interface.d.ts +1 -1
  38. package/dist/mocks/forms/dynamicForm.mock.js +36 -16
  39. package/dist/mocks/partner/dynamicTileForm.mock.d.ts +330 -1
  40. package/dist/mocks/partner/dynamicTileForm.mock.js +1210 -62
  41. package/dist/stories/forms/readOnly/ReadOnlyDynamicForm.stories.d.ts +1 -0
  42. package/dist/stories/forms/readOnly/ReadOnlyDynamicForm.stories.js +5 -1
  43. package/dist/stories/partner/DynamicTile.stories.d.ts +1 -2
  44. package/dist/stories/partner/DynamicTile.stories.js +9 -20
  45. package/package.json +1 -1
  46. package/src/assets/images/shine/gutter-cleaning.png +0 -0
  47. package/src/assets/images/shine/holiday-lights.png +0 -0
  48. package/src/assets/images/shine/home-cleaning.png +0 -0
  49. package/src/assets/images/shine/pressure.png +0 -0
  50. package/src/assets/images/shine/roof-cleaning.png +0 -0
  51. package/src/assets/images/shine/window.png +0 -0
  52. package/src/components/forms/Collapsible.tsx +3 -2
  53. package/src/components/forms/dynamicForm/fields/uiFields/TileBody.tsx +1 -1
  54. package/src/components/forms/dynamicForm/fields/uiFields/TileBodyHeader.tsx +3 -1
  55. package/src/components/forms/dynamicForm/fields/uiFields/TileCta.tsx +1 -1
  56. package/src/components/forms/dynamicForm/fields/uiFields/VerticalIcon.tsx +8 -2
  57. package/src/components/forms/readOnly/ReadOnlyDynamicForm.tsx +4 -1
  58. package/src/components/forms/readOnly/fields/homeItem/ReadOnlyAppliances.tsx +40 -35
  59. package/src/components/forms/readOnly/fields/homeItem/ReadOnlyCollapsible.tsx +34 -0
  60. package/src/components/forms/readOnly/fields/homeItem/ReadOnlyGuidelines.tsx +2 -2
  61. package/src/components/forms/readOnly/fields/homeItem/ReadOnlyHomeItemText.tsx +1 -1
  62. package/src/components/forms/readOnly/fields/homeItem/index.ts +1 -0
  63. package/src/components/headers/CollapsibleHeader.tsx +1 -1
  64. package/src/components/partner/PartnerFooter.tsx +2 -2
  65. package/src/components/partner/PartnerImage.tsx +2 -1
  66. package/src/components/partner/ShortPartnerTile.tsx +18 -12
  67. package/src/interfaces/forms/Collapsible.interface.ts +2 -1
  68. package/src/interfaces/forms/dynamicForm/DynamicForm.interface.ts +1 -0
  69. package/src/interfaces/forms/readOnly/homeItem/ReadOnlyAppliances.interface.ts +1 -1
  70. package/src/mocks/forms/dynamicForm.mock.ts +36 -16
  71. package/src/mocks/partner/dynamicTileForm.mock.ts +1221 -64
  72. package/src/stories/forms/readOnly/ReadOnlyDynamicForm.stories.tsx +13 -1
  73. package/src/stories/partner/DynamicTile.stories.tsx +24 -24
Binary file
@@ -1,3 +1,3 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  import { CollapsibleI } from '../../interfaces';
3
- export declare const Collapsible: ({ children, icon, title, }: PropsWithChildren<CollapsibleI>) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const Collapsible: ({ children, icon, title, showShadow, }: PropsWithChildren<CollapsibleI>) => import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { Accordion, AccordionButton, AccordionItem, AccordionPanel, Box, Flex, } from '@chakra-ui/react';
3
3
  import { ChevronRight, CollapsibleHeader } from '..';
4
- export const Collapsible = ({ children, icon, title, }) => {
5
- return (_jsx(Accordion, { flex: "1", allowMultiple: true, boxShadow: "md", children: _jsx(AccordionItem, { border: "none", children: ({ isExpanded }) => (_jsxs(_Fragment, { children: [_jsx(AccordionButton, { w: "100%", p: "base", bg: "neutral.white", transition: "all .2s ease-in-out", borderBottom: "1px solid", borderColor: isExpanded ? 'lightBlue.2' : 'transparent', _hover: {
6
- boxShadow: 'lg',
4
+ export const Collapsible = ({ children, icon, title, showShadow = true, }) => {
5
+ return (_jsx(Accordion, { flex: "1", allowMultiple: true, boxShadow: showShadow ? 'md' : 'none', children: _jsx(AccordionItem, { border: "none", children: ({ isExpanded }) => (_jsxs(_Fragment, { children: [_jsx(AccordionButton, { w: "100%", p: "base", bg: "neutral.white", transition: "all .2s ease-in-out", borderBottom: "1px solid", borderColor: isExpanded ? 'lightBlue.2' : 'transparent', _hover: {
6
+ boxShadow: showShadow ? 'lg' : 'none',
7
7
  }, _focus: {
8
8
  outline: 'none',
9
9
  }, children: _jsxs(Flex, { align: "center", justify: "space-between", flex: "1", children: [_jsx(CollapsibleHeader, { icon: icon, title: title }), _jsx(Box, { rounded: "full", border: "1px solid", padding: "1", borderColor: "blue.3", transition: "all .2s ease-in-out", transform: isExpanded ? 'rotate(-90deg)' : 'rotate(0)', children: _jsx(ChevronRight, {}) })] }) }), _jsx(AccordionPanel, { p: "base", bg: "neutral.white", children: children })] })) }) }));
@@ -14,5 +14,5 @@ import { Box, Stack } from '@chakra-ui/react';
14
14
  import { PartnerFooter, TileBodyFields, TileFooterFields, TileHeaderFields, } from '../../../..';
15
15
  export const TileBody = (_a) => {
16
16
  var { callback, fields, websiteUrl = '', menuItems } = _a, props = __rest(_a, ["callback", "fields", "websiteUrl", "menuItems"]);
17
- return (_jsx(Box, { display: "flex", flexGrow: 1, flexDir: "column", bg: "neutral.white", boxShadow: "lg", children: _jsxs(Stack, { spacing: "0", flex: "1", justify: "space-between", children: [_jsx(Box, { children: _jsx(TileHeaderFields, { fields: fields, menuItems: menuItems }) }), _jsx(TileBodyFields, { fields: fields }), _jsxs(Stack, { spacing: "0", bg: "lightBlue.1", pt: "base", children: [_jsx(TileFooterFields, { callback: callback, fields: fields }), _jsx(PartnerFooter, Object.assign({}, props, { websiteUrl: websiteUrl }))] })] }) }));
17
+ return (_jsx(Box, { display: "flex", flexGrow: 1, flexDir: "column", bg: "neutral.white", boxShadow: "lg", children: _jsxs(Stack, { spacing: "0", flex: "1", justify: "space-between", children: [_jsx(Box, { children: _jsx(TileHeaderFields, { fields: fields, menuItems: menuItems }) }), _jsx(TileBodyFields, { fields: fields }), _jsxs(Stack, { spacing: "0", bg: "lightBlue.1", children: [_jsx(TileFooterFields, { callback: callback, fields: fields }), _jsx(PartnerFooter, Object.assign({}, props, { websiteUrl: websiteUrl }))] })] }) }));
18
18
  };
@@ -27,7 +27,7 @@ export const TileBody = ({
27
27
  <TileHeaderFields fields={fields} menuItems={menuItems} />
28
28
  </Box>
29
29
  <TileBodyFields fields={fields} />
30
- <Stack spacing="0" bg="lightBlue.1" pt="base">
30
+ <Stack spacing="0" bg="lightBlue.1">
31
31
  <TileFooterFields callback={callback} fields={fields} />
32
32
  <PartnerFooter {...props} websiteUrl={websiteUrl} />
33
33
  </Stack>
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Box, Text } from '@chakra-ui/react';
3
3
  export const TileBodyHeader = ({ value = '' }) => {
4
- return (_jsx(Box, { p: "base", children: _jsx(Text, { fontWeight: "semibold", children: value }) }));
4
+ return (_jsx(Box, { p: "base", children: _jsx(Text, { fontWeight: "semibold", textAlign: "center", children: value }) }));
5
5
  };
@@ -3,7 +3,9 @@ import { Box, Text } from '@chakra-ui/react'
3
3
  export const TileBodyHeader = ({ value = '' }) => {
4
4
  return (
5
5
  <Box p="base">
6
- <Text fontWeight="semibold">{value}</Text>
6
+ <Text fontWeight="semibold" textAlign="center">
7
+ {value}
8
+ </Text>
7
9
  </Box>
8
10
  )
9
11
  }
@@ -14,5 +14,5 @@ import { Button } from '@chakra-ui/react';
14
14
  export const TileCta = (_a) => {
15
15
  var { callback } = _a, props = __rest(_a, ["callback"]);
16
16
  const { type, value } = props;
17
- return (_jsx(Button, { onClick: () => callback === null || callback === void 0 ? void 0 : callback(Object.assign({}, props)), variant: type === 'primary-cta' ? 'primary' : 'secondary', fontSize: "sm", textTransform: "capitalize", px: "none", bg: type === 'primary-cta' ? '' : 'neutral.white', children: value }));
17
+ return (_jsx(Button, { onClick: () => callback === null || callback === void 0 ? void 0 : callback(Object.assign({}, props)), variant: type === 'primary-cta' ? 'primary' : 'secondary', textTransform: "capitalize", fontWeight: type === 'primary-cta' ? 'semibold' : 'regular', px: "none", bg: type === 'primary-cta' ? '' : 'neutral.white', children: value }));
18
18
  };
@@ -7,8 +7,8 @@ export const TileCta = ({ callback, ...props }: TileCtaI) => {
7
7
  <Button
8
8
  onClick={() => callback?.({ ...props })}
9
9
  variant={type === 'primary-cta' ? 'primary' : 'secondary'}
10
- fontSize="sm"
11
10
  textTransform="capitalize"
11
+ fontWeight={type === 'primary-cta' ? 'semibold' : 'regular'}
12
12
  px="none"
13
13
  bg={type === 'primary-cta' ? '' : 'neutral.white'}
14
14
  >
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box, Center, Image, Text } from '@chakra-ui/react';
3
3
  export const VerticalIcon = ({ icon, value }) => {
4
- return (_jsxs(Box, { bg: "neutral.white", borderRadius: "md", border: "1px solid", borderColor: "lightBlue.6", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", minH: "110px", children: [_jsx(Box, { h: "46px", display: "flex", alignItems: "center", children: _jsx(Image, { src: icon, alt: value, w: "auto", h: "80%" }) }), _jsx(Center, { pb: "2", children: _jsx(Text, { fontWeight: "semibold", textAlign: "center", fontSize: "13px", lineHeight: "14px", w: "85%", children: value }) })] }));
4
+ return (_jsxs(Box, { bg: "neutral.white", borderRadius: "md", border: "1px solid", borderColor: "lightBlue.6", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", minH: "110px", children: [_jsx(Box, { h: "46px", w: "46px", display: "flex", alignItems: "center", justifyContent: "center", children: _jsx(Image, { src: icon, alt: value, w: "34px", h: "34px", objectFit: "contain" }) }), _jsx(Center, { pb: "2", children: _jsx(Text, { fontWeight: "semibold", textAlign: "center", fontSize: "13px", lineHeight: "14px", w: "85%", children: value }) })] }));
5
5
  };
@@ -14,8 +14,14 @@ export const VerticalIcon = ({ icon, value }: VerticalIconI) => {
14
14
  justifyContent="center"
15
15
  minH="110px"
16
16
  >
17
- <Box h="46px" display="flex" alignItems="center">
18
- <Image src={icon} alt={value} w="auto" h="80%" />
17
+ <Box
18
+ h="46px"
19
+ w="46px"
20
+ display="flex"
21
+ alignItems="center"
22
+ justifyContent="center"
23
+ >
24
+ <Image src={icon} alt={value} w="34px" h="34px" objectFit="contain" />
19
25
  </Box>
20
26
  <Center pb="2">
21
27
  <Text
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { createElement as _createElement } from "react";
3
3
  import { Box } from '@chakra-ui/react';
4
- import { ReadOnlyAppliances, ReadOnlyDate, ReadOnlyGrid, ReadOnlyGroup, ReadOnlyInput, ReadOnlyNotes, ReadOnlyRating, ReadOnlyTextArea, } from '../..';
4
+ import { ReadOnlyAppliances, ReadOnlyCollapsible, ReadOnlyDate, ReadOnlyGrid, ReadOnlyGroup, ReadOnlyInput, ReadOnlyNotes, ReadOnlyRating, ReadOnlyTextArea, } from '../..';
5
5
  import { fieldIcons } from '../../../helpers';
6
- export const ReadOnlyDynamicForm = ({ form: fields, onClick, onEdit = () => { }, }) => {
6
+ export const ReadOnlyDynamicForm = ({ form: fields, onClick, onEdit, }) => {
7
7
  return (_jsx(Box, { bg: "lightBlue.1", overflow: "scroll", children: fields === null || fields === void 0 ? void 0 : fields.map((field) => {
8
8
  const { children = [], icon, id, name, type, value } = field;
9
9
  const baseProps = {
@@ -33,6 +33,8 @@ export const ReadOnlyDynamicForm = ({ form: fields, onClick, onEdit = () => { },
33
33
  return _jsx(ReadOnlyGroup, { children: children }, id);
34
34
  case 'appliances':
35
35
  return _createElement(ReadOnlyAppliances, Object.assign({}, field, { key: id, onEdit: onEdit }));
36
+ case 'collapsible':
37
+ return _createElement(ReadOnlyCollapsible, Object.assign({}, field, { key: id }));
36
38
  case 'notes':
37
39
  return _createElement(ReadOnlyNotes, Object.assign({}, field, { key: id }));
38
40
  default:
@@ -5,19 +5,20 @@ import { colors } from '../../../../../theme/colors';
5
5
  export const ReadOnlyAppliances = ({ description, id, name, children, onEdit, value, }) => {
6
6
  const rating = children === null || children === void 0 ? void 0 : children.find(({ type }) => type === 'rating');
7
7
  const images = children === null || children === void 0 ? void 0 : children.find(({ type }) => type === 'images');
8
- return (_jsxs(Stack, { spacing: "base", p: "base", bg: "neutral.white", mt: "2px", children: [_jsxs(Flex, { justify: "space-between", children: [_jsx(Text, { fontSize: "xs", textTransform: "uppercase", children: name }), _jsx(IconButton, { "aria-label": "Edit appliance", variant: "ghost", w: "fit-content", icon: _jsx(Edit, { size: 18, stroke: colors.blue[3] }), onClick: () => onEdit(id) })] }), _jsxs(Flex, { gap: "base", children: [_jsx(ReadOnlyHomeItemImages, Object.assign({}, images)), _jsxs(Stack, { spacing: "4", flex: "1", children: [_jsx(ReadOnlyHomeItemRating, Object.assign({}, rating)), _jsxs(Stack, { spacing: "base", children: [_jsx(Text, { fontSize: "22px", fontWeight: "semibold", children: value }), _jsx(Text, { fontFamily: "secondary", fontSize: "sm", children: description })] }), _jsx(Box, { flex: "1", borderBottom: "1px dashed", borderColor: "lightBlue.6", h: "1px" }), _jsx(Box, { children: children === null || children === void 0 ? void 0 : children.map(({ id, name, value, type }) => {
9
- const baseProps = {
10
- key: `${id}-${name}-${value}-${type}`,
11
- id,
12
- value,
13
- type,
14
- name,
15
- };
16
- switch (type) {
17
- case 'text':
18
- return _jsx(ReadOnlyHomeItemText, Object.assign({}, baseProps));
19
- default:
20
- return null;
21
- }
22
- }) })] })] })] }));
8
+ return (_jsxs(Stack, { spacing: "base", p: "base", bg: "neutral.white", mt: "2px", children: [name ||
9
+ (onEdit && (_jsxs(Flex, { justify: "space-between", children: [_jsx(Text, { fontSize: "xs", textTransform: "uppercase", children: name }), onEdit && (_jsx(IconButton, { "aria-label": "Edit appliance", variant: "ghost", w: "fit-content", icon: _jsx(Edit, { size: 18, stroke: colors.blue[3] }), onClick: () => onEdit(id) }))] }))), _jsxs(Flex, { gap: "base", children: [_jsx(ReadOnlyHomeItemImages, Object.assign({}, images)), _jsxs(Stack, { spacing: "4", flex: "1", children: [_jsx(ReadOnlyHomeItemRating, Object.assign({}, rating)), _jsxs(Stack, { spacing: "base", children: [_jsx(Text, { fontSize: "22px", fontWeight: "semibold", children: value }), _jsx(Box, { children: children === null || children === void 0 ? void 0 : children.map(({ id, name, value, type }) => {
10
+ const baseProps = {
11
+ key: `${id}-${name}-${value}-${type}`,
12
+ id,
13
+ value,
14
+ type,
15
+ name,
16
+ };
17
+ switch (type) {
18
+ case 'text':
19
+ return _jsx(ReadOnlyHomeItemText, Object.assign({}, baseProps));
20
+ default:
21
+ return null;
22
+ }
23
+ }) }), _jsx(Box, { flex: "1", borderBottom: "1px dashed", borderColor: "lightBlue.6", h: "1px" }), _jsx(Text, { fontFamily: "secondary", fontSize: "sm", children: description })] })] })] })] }));
23
24
  };
@@ -20,18 +20,23 @@ export const ReadOnlyAppliances = ({
20
20
  const images = children?.find(({ type }) => type === 'images')
21
21
  return (
22
22
  <Stack spacing="base" p="base" bg="neutral.white" mt="2px">
23
- <Flex justify="space-between">
24
- <Text fontSize="xs" textTransform="uppercase">
25
- {name}
26
- </Text>
27
- <IconButton
28
- aria-label="Edit appliance"
29
- variant="ghost"
30
- w="fit-content"
31
- icon={<Edit size={18} stroke={colors.blue[3]} />}
32
- onClick={() => onEdit(id)}
33
- />
34
- </Flex>
23
+ {name ||
24
+ (onEdit && (
25
+ <Flex justify="space-between">
26
+ <Text fontSize="xs" textTransform="uppercase">
27
+ {name}
28
+ </Text>
29
+ {onEdit && (
30
+ <IconButton
31
+ aria-label="Edit appliance"
32
+ variant="ghost"
33
+ w="fit-content"
34
+ icon={<Edit size={18} stroke={colors.blue[3]} />}
35
+ onClick={() => onEdit(id)}
36
+ />
37
+ )}
38
+ </Flex>
39
+ ))}
35
40
  <Flex gap="base">
36
41
  <ReadOnlyHomeItemImages {...images} />
37
42
  <Stack spacing="4" flex="1">
@@ -40,33 +45,33 @@ export const ReadOnlyAppliances = ({
40
45
  <Text fontSize="22px" fontWeight="semibold">
41
46
  {value}
42
47
  </Text>
48
+ <Box>
49
+ {children?.map(({ id, name, value, type }) => {
50
+ const baseProps = {
51
+ key: `${id}-${name}-${value}-${type}`,
52
+ id,
53
+ value,
54
+ type,
55
+ name,
56
+ }
57
+ switch (type) {
58
+ case 'text':
59
+ return <ReadOnlyHomeItemText {...baseProps} />
60
+ default:
61
+ return null
62
+ }
63
+ })}
64
+ </Box>
65
+ <Box
66
+ flex="1"
67
+ borderBottom="1px dashed"
68
+ borderColor="lightBlue.6"
69
+ h="1px"
70
+ />
43
71
  <Text fontFamily="secondary" fontSize="sm">
44
72
  {description}
45
73
  </Text>
46
74
  </Stack>
47
- <Box
48
- flex="1"
49
- borderBottom="1px dashed"
50
- borderColor="lightBlue.6"
51
- h="1px"
52
- />
53
- <Box>
54
- {children?.map(({ id, name, value, type }) => {
55
- const baseProps = {
56
- key: `${id}-${name}-${value}-${type}`,
57
- id,
58
- value,
59
- type,
60
- name,
61
- }
62
- switch (type) {
63
- case 'text':
64
- return <ReadOnlyHomeItemText {...baseProps} />
65
- default:
66
- return null
67
- }
68
- })}
69
- </Box>
70
75
  </Stack>
71
76
  </Flex>
72
77
  </Stack>
@@ -0,0 +1,2 @@
1
+ import { ReportI } from '../../../../../interfaces';
2
+ export declare const ReadOnlyCollapsible: ({ children, }: Pick<ReportI, "children">) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Stack } from '@chakra-ui/react';
3
+ import { Collapsible, ReadOnlyTextArea } from '../../../..';
4
+ export const ReadOnlyCollapsible = ({ children, }) => {
5
+ return (_jsx(Stack, { bg: "lightBlue.2", spacing: "2px", children: children === null || children === void 0 ? void 0 : children.map(({ id, name = '', value, type }) => {
6
+ const baseProps = {
7
+ id,
8
+ value,
9
+ type,
10
+ name,
11
+ };
12
+ switch (type) {
13
+ case 'text':
14
+ return (_jsx(Collapsible, { title: name, showShadow: false, children: _jsx(ReadOnlyTextArea, Object.assign({}, baseProps)) }, `${id}-${name}-${value}-${type}`));
15
+ default:
16
+ return null;
17
+ }
18
+ }) }));
19
+ };
@@ -0,0 +1,34 @@
1
+ import { Stack } from '@chakra-ui/react'
2
+ import { Collapsible, ReadOnlyTextArea } from '@/components'
3
+ import { ReportI } from '@/interfaces'
4
+
5
+ export const ReadOnlyCollapsible = ({
6
+ children,
7
+ }: Pick<ReportI, 'children'>) => {
8
+ return (
9
+ <Stack bg="lightBlue.2" spacing="2px">
10
+ {children?.map(({ id, name = '', value, type }) => {
11
+ const baseProps = {
12
+ id,
13
+ value,
14
+ type,
15
+ name,
16
+ }
17
+ switch (type) {
18
+ case 'text':
19
+ return (
20
+ <Collapsible
21
+ title={name}
22
+ showShadow={false}
23
+ key={`${id}-${name}-${value}-${type}`}
24
+ >
25
+ <ReadOnlyTextArea {...baseProps} />
26
+ </Collapsible>
27
+ )
28
+ default:
29
+ return null
30
+ }
31
+ })}
32
+ </Stack>
33
+ )
34
+ }
@@ -3,7 +3,7 @@ import { Text, Stack, Grid } from '@chakra-ui/react';
3
3
  import { HiddenField } from '../../../..';
4
4
  import { fieldIcons } from '../../../../../helpers';
5
5
  export const ReadOnlyGuidelines = ({ name, children, onClick, }) => {
6
- return (_jsxs(Stack, { spacing: "base", children: [_jsx(Text, { fontSize: "xs", textTransform: "uppercase", children: name }), _jsx(Grid, { templateColumns: "repeat(2, minmax(80px, 1fr))", gap: "base", children: children === null || children === void 0 ? void 0 : children.map((child) => {
6
+ return (_jsxs(Stack, { spacing: "base", flex: "1", width: "100%", children: [_jsx(Text, { fontSize: "xs", textTransform: "uppercase", children: name }), _jsx(Grid, { templateColumns: "repeat(auto-fit, minmax(0, 75px))", gap: "base", children: children === null || children === void 0 ? void 0 : children.map((child) => {
7
7
  const { id, icon, value } = child;
8
8
  const btnIcon = icon ? fieldIcons[icon] : '';
9
9
  return (_jsx(HiddenField, { id: id, icon: btnIcon, name: value, onClick: () => onClick === null || onClick === void 0 ? void 0 : onClick(id) }, id));
@@ -9,11 +9,11 @@ export const ReadOnlyGuidelines = ({
9
9
  onClick,
10
10
  }: ReadOnlyGuidelinesI) => {
11
11
  return (
12
- <Stack spacing="base">
12
+ <Stack spacing="base" flex="1" width="100%">
13
13
  <Text fontSize="xs" textTransform="uppercase">
14
14
  {name}
15
15
  </Text>
16
- <Grid templateColumns="repeat(2, minmax(80px, 1fr))" gap="base">
16
+ <Grid templateColumns="repeat(auto-fit, minmax(0, 75px))" gap="base">
17
17
  {children?.map((child) => {
18
18
  const { id, icon, value } = child
19
19
  const btnIcon = icon ? fieldIcons[icon] : ''
@@ -3,7 +3,7 @@ import { Box, Flex, Text } from '@chakra-ui/react';
3
3
  export const ReadOnlyHomeItemText = ({ name, value }) => {
4
4
  if (!name)
5
5
  return null;
6
- return (_jsxs(Flex, { gap: "base", children: [_jsx(Box, { w: "20%", children: _jsx(CustomText, { children: `${name}:` }) }), _jsx(CustomText, { children: String(value) })] }));
6
+ return (_jsxs(Flex, { gap: "base", children: [_jsx(Box, { w: "30%", children: _jsx(CustomText, { children: `${name}:` }) }), _jsx(CustomText, { children: String(value) })] }));
7
7
  };
8
8
  const CustomText = ({ children = '' }) => {
9
9
  return (_jsx(Text, { fontSize: "sm", fontFamily: "secondary", children: children }));
@@ -5,7 +5,7 @@ export const ReadOnlyHomeItemText = ({ name, value }: Partial<ReportI>) => {
5
5
  if (!name) return null
6
6
  return (
7
7
  <Flex gap="base">
8
- <Box w="20%">
8
+ <Box w="30%">
9
9
  <CustomText>{`${name}:`}</CustomText>
10
10
  </Box>
11
11
  <CustomText>{String(value)}</CustomText>
@@ -1,4 +1,5 @@
1
1
  export * from './ReadOnlyAppliances';
2
+ export * from './ReadOnlyCollapsible';
2
3
  export * from './ReadOnlyGuidelines';
3
4
  export * from './ReadOnlyHomeItemImages';
4
5
  export * from './ReadOnlyHomeItemRating';
@@ -1,4 +1,5 @@
1
1
  export * from './ReadOnlyAppliances';
2
+ export * from './ReadOnlyCollapsible';
2
3
  export * from './ReadOnlyGuidelines';
3
4
  export * from './ReadOnlyHomeItemImages';
4
5
  export * from './ReadOnlyHomeItemRating';
@@ -1,4 +1,5 @@
1
1
  export * from './ReadOnlyAppliances'
2
+ export * from './ReadOnlyCollapsible'
2
3
  export * from './ReadOnlyGuidelines'
3
4
  export * from './ReadOnlyHomeItemImages'
4
5
  export * from './ReadOnlyHomeItemRating'
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Flex, Image, Text } from '@chakra-ui/react';
3
3
  export const CollapsibleHeader = ({ icon, title, }) => {
4
- return (_jsxs(Flex, { align: "center", gap: "base", children: [_jsx(Image, { h: "auto", w: "icon.md", src: icon }), _jsx(Text, { fontSize: "sm", textTransform: "uppercase", children: title })] }));
4
+ return (_jsxs(Flex, { align: "center", gap: "base", children: [icon && _jsx(Image, { h: "auto", w: "icon.md", src: icon }), _jsx(Text, { fontSize: "sm", textTransform: "uppercase", children: title })] }));
5
5
  };
@@ -10,5 +10,5 @@ export const PartnerFooter = ({ socialLinks = [], websiteUrl, urlText, }) => {
10
10
  return;
11
11
  window.open(url, '_blank');
12
12
  };
13
- return (_jsxs(Flex, { align: "center", justify: "space-between", p: "base", children: [_jsx(Link, { href: websiteUrl, isExternal: true, children: _jsx(Text, { fontSize: "xs", color: "blue.3", children: urlText !== null && urlText !== void 0 ? urlText : cleanedWebsiteUrl }) }), hasSocialLinks && (_jsx(Flex, { align: "center", gap: "1", children: socialLinks === null || socialLinks === void 0 ? void 0 : socialLinks.map(({ name, link }) => (_jsx(IconButton, { variant: "unstyled", w: "fit-content", "aria-label": "Instagram", icon: SocialIcons({ size: 20, name }), onClick: () => handleSocialClick(link) }, name))) }))] }));
13
+ return (_jsxs(Flex, { align: "center", justify: "space-between", px: "base", minH: "46px", children: [_jsx(Link, { href: websiteUrl, isExternal: true, children: _jsx(Text, { fontSize: "xs", color: "blue.3", fontFamily: "primary", children: urlText !== null && urlText !== void 0 ? urlText : cleanedWebsiteUrl }) }), hasSocialLinks && (_jsx(Flex, { align: "center", gap: "1", children: socialLinks === null || socialLinks === void 0 ? void 0 : socialLinks.map(({ name, link }) => (_jsx(IconButton, { variant: "unstyled", w: "fit-content", "aria-label": "Instagram", icon: SocialIcons({ size: 20, name }), onClick: () => handleSocialClick(link) }, name))) }))] }));
14
14
  };
@@ -3,6 +3,6 @@ import { t } from 'i18next';
3
3
  import { Center, Image, Text } from '@chakra-ui/react';
4
4
  export const PartnerImage = ({ imageUrl, partnerName }) => {
5
5
  if (imageUrl)
6
- return (_jsx(Image, { src: imageUrl, minH: "154px", h: "full", w: "full", objectFit: "cover", alt: partnerName }));
7
- return (_jsx(Center, { bg: "gray.3", minH: "154px", h: "full", children: _jsx(Text, { color: "neutral.white", fontSize: "xxs", children: t('partner.needImage') }) }));
6
+ return (_jsx(Image, { src: imageUrl, minH: "154px", maxH: "300px", h: "full", w: "full", objectFit: "cover", alt: partnerName }));
7
+ return (_jsx(Center, { bg: "gray.3", w: "full", minH: "154px", children: _jsx(Text, { color: "neutral.white", fontSize: "xxs", children: t('partner.needImage') }) }));
8
8
  };
@@ -1,2 +1,2 @@
1
1
  import { ShortPartnerTileI } from '../../interfaces';
2
- export declare const ShortPartnerTile: ({ buttonText, description, imageUrl, logo, menuItems, minimized, onClick, socialLinks, partnerName, websiteUrl, urlText }: ShortPartnerTileI) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const ShortPartnerTile: ({ buttonText, description, imageUrl, logo, menuItems, minimized, onClick, socialLinks, partnerName, websiteUrl, urlText, }: ShortPartnerTileI) => import("react/jsx-runtime").JSX.Element;
@@ -1,10 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Flex } from '@chakra-ui/react';
3
- import { Fader, PartnerCallToAction, PartnerFooter, PartnerHeader, PartnerImage, PartnerTileWrapper, } from '..';
4
- export const ShortPartnerTile = ({ buttonText, description, imageUrl, logo, menuItems, minimized, onClick, socialLinks, partnerName, websiteUrl, urlText }) => {
5
- const callToAction = { description, buttonText, onClick };
2
+ import { Box, Flex, Stack } from '@chakra-ui/react';
3
+ import { PartnerFooter, PartnerHeader, PartnerImage, PartnerTileWrapper, TileCta, } from '..';
4
+ export const ShortPartnerTile = ({ buttonText, description, imageUrl, logo, menuItems, minimized, onClick, socialLinks, partnerName, websiteUrl, urlText, }) => {
6
5
  const header = { logo, menuItems, partnerName };
7
6
  const image = { imageUrl, partnerName };
8
7
  const footer = { socialLinks, websiteUrl, urlText };
9
- return (_jsxs(PartnerTileWrapper, { children: [_jsx(PartnerHeader, Object.assign({}, header)), !minimized && (_jsx(Fader, { children: _jsxs(Flex, { flexDir: "column", h: "400px", justifyContent: "space-between", children: [_jsx(PartnerImage, Object.assign({}, image)), _jsxs(Box, { children: [_jsx(PartnerCallToAction, Object.assign({}, callToAction)), _jsx(PartnerFooter, Object.assign({}, footer))] })] }) }))] }));
8
+ return (_jsxs(PartnerTileWrapper, { children: [_jsx(PartnerHeader, Object.assign({}, header)), !minimized && (_jsxs(Stack, { spacing: "0", justify: "space-between", h: "full", children: [_jsx(Flex, { w: "full", h: "full", children: _jsx(PartnerImage, Object.assign({}, image)) }), _jsxs(Box, { children: [_jsx(Box, { p: "base", children: _jsx(TileCta, { id: `tile-cta-${partnerName}`, callback: onClick, description: description, type: "primary-cta", value: buttonText }) }), _jsx(PartnerFooter, Object.assign({}, footer))] })] }))] }));
10
9
  };
@@ -1,4 +1,5 @@
1
1
  export interface CollapsibleI {
2
- icon: string;
2
+ icon?: string;
3
3
  title: string;
4
+ showShadow?: boolean;
4
5
  }
@@ -1,5 +1,5 @@
1
1
  import { AIGridFieldI, AlertFieldType, AlertTabType, FolderFileI, MenuItemI, PartnerFooterI, TileCtaI } from '../..';
2
- export type KindTypes = 'ai-image' | 'ai-grid' | 'checkbox' | 'checkbox-agreement' | 'checkbox-group' | 'currency' | 'date' | 'email' | 'file' | 'grid' | 'group' | 'hidden' | 'notes' | 'number' | 'radio' | 'rating' | 'select' | 'string' | 'switch' | 'telephone' | 'text' | 'textarea' | 'default' | 'video' | UIKindTypes | HomeItemTypes | AlertTabType | AlertFieldType;
2
+ export type KindTypes = 'ai-image' | 'ai-grid' | 'checkbox' | 'checkbox-agreement' | 'checkbox-group' | 'collapsible' | 'currency' | 'date' | 'email' | 'file' | 'grid' | 'group' | 'hidden' | 'notes' | 'number' | 'radio' | 'rating' | 'select' | 'string' | 'switch' | 'telephone' | 'text' | 'textarea' | 'default' | 'video' | UIKindTypes | HomeItemTypes | AlertTabType | AlertFieldType;
3
3
  export type UIKindTypes = 'tile-body' | 'tile-body-logo' | 'tile-body-header' | 'tile-body-section' | 'tile-body-section-grid' | 'tile-body-partner-image' | 'tile-body-description' | 'tile-form' | 'tile-body-action' | 'vertical-icon' | 'primary-cta' | 'secondary-cta';
4
4
  export type HomeItemTypes = 'appliances' | 'images' | 'guidelines' | 'item-related' | 'item-icon-btn';
5
5
  export type IconTypes = 'barcode' | 'battery' | 'billing' | 'book' | 'book-opened' | 'calc' | 'calendar' | 'check' | 'co2' | 'contact' | 'date' | 'default' | 'detector' | 'electricity' | 'fire' | 'goldbars' | 'heart' | 'image' | 'life-preserver' | 'notes' | 'palette' | 'plant' | 'people' | 'price' | 'rating' | 'receipt' | 'registry' | 'sprinkler' | 'tools' | 'wind' | '68' | 'calendar2' | 'water' | 'calendar-drop' | 'umbrella' | 'heater' | 'roof' | 'foundation' | 'solar-panel' | 'pool' | 'drop' | 'mobile-drop' | 'light' | 'plate' | 'pressure-washer' | 'house' | 'target' | 'title' | 'company' | 'wallet' | UIIconTypes;
@@ -1,4 +1,4 @@
1
1
  import { ReportI } from '../../..';
2
2
  export interface ReadOnlyAppliancesI extends ReportI {
3
- onEdit: (id: string) => void;
3
+ onEdit?: (id: string) => void;
4
4
  }
@@ -673,7 +673,7 @@ export const tileUIMock = [
673
673
  export const viewingHomeItemMock = [
674
674
  {
675
675
  id: faker.database.mongodbObjectId(),
676
- name: 'Appliances',
676
+ name: '',
677
677
  description: 'KitchenAid Counter-depth 20-cu ft French Door Refrigerator with Ice Maker and Water dispenser (Stainless Steel) ENERGY STAR',
678
678
  comments: faker.lorem.sentence(),
679
679
  value: 'Refrigerator',
@@ -687,21 +687,13 @@ export const viewingHomeItemMock = [
687
687
  description: '',
688
688
  comments: '',
689
689
  value: [
690
- faker.image.urlLoremFlickr(),
691
- faker.image.urlLoremFlickr(),
692
- faker.image.urlLoremFlickr(),
693
- faker.image.urlLoremFlickr(),
690
+ faker.image.urlPicsumPhotos(),
691
+ faker.image.urlPicsumPhotos(),
692
+ faker.image.urlPicsumPhotos(),
693
+ faker.image.urlPicsumPhotos(),
694
694
  ],
695
695
  type: 'images',
696
696
  },
697
- {
698
- id: faker.database.mongodbObjectId(),
699
- name: '',
700
- description: '',
701
- comments: '',
702
- value: 4,
703
- type: 'rating',
704
- },
705
697
  {
706
698
  id: faker.database.mongodbObjectId(),
707
699
  name: 'Brand',
@@ -772,13 +764,41 @@ export const viewingHomeItemMock = [
772
764
  },
773
765
  {
774
766
  id: faker.database.mongodbObjectId(),
775
- name: 'Notes',
767
+ name: 'Collapsible',
776
768
  description: '',
777
769
  comments: faker.lorem.sentence(),
778
770
  value: faker.lorem.paragraphs(),
779
- type: 'notes',
771
+ type: 'collapsible',
780
772
  visible: true,
781
- options: [],
773
+ children: [
774
+ {
775
+ id: faker.database.mongodbObjectId(),
776
+ name: 'Care Instructions',
777
+ description: faker.lorem.sentence(),
778
+ comments: faker.lorem.sentence(),
779
+ value: faker.lorem.paragraphs(),
780
+ type: 'text',
781
+ visible: true,
782
+ },
783
+ {
784
+ id: faker.database.mongodbObjectId(),
785
+ name: 'OVERVIEW',
786
+ description: faker.lorem.sentence(),
787
+ comments: faker.lorem.sentence(),
788
+ value: faker.lorem.paragraphs(),
789
+ type: 'text',
790
+ visible: true,
791
+ },
792
+ {
793
+ id: faker.database.mongodbObjectId(),
794
+ name: 'Dimensions',
795
+ description: faker.lorem.sentence(),
796
+ comments: faker.lorem.sentence(),
797
+ value: faker.lorem.paragraphs(),
798
+ type: 'text',
799
+ visible: true,
800
+ },
801
+ ],
782
802
  },
783
803
  ];
784
804
  export const unknownFormMock = {