@homefile/components-v2 2.0.0 → 2.1.0

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 (68) hide show
  1. package/dist/components/customToast/CustomToast.js +1 -1
  2. package/dist/components/customToast/StatusIllustration.js +3 -3
  3. package/dist/components/forms/dynamicForm/DynamicForm.d.ts +1 -1
  4. package/dist/components/forms/dynamicForm/DynamicForm.js +16 -2
  5. package/dist/components/forms/dynamicForm/fields/SingleFields.d.ts +2 -5
  6. package/dist/components/forms/dynamicForm/fields/SingleFields.js +16 -2
  7. package/dist/components/forms/dynamicForm/fields/index.d.ts +1 -0
  8. package/dist/components/forms/dynamicForm/fields/index.js +1 -0
  9. package/dist/components/forms/dynamicForm/fields/uiFields/TileBody.d.ts +2 -0
  10. package/dist/components/forms/dynamicForm/fields/uiFields/TileBody.js +18 -0
  11. package/dist/components/forms/dynamicForm/fields/uiFields/TileBody.tsx +24 -0
  12. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyAction.d.ts +2 -0
  13. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyAction.js +6 -0
  14. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyAction.tsx +11 -0
  15. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyHeader.d.ts +3 -0
  16. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyHeader.js +5 -0
  17. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyHeader.tsx +9 -0
  18. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyLogo.d.ts +2 -0
  19. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyLogo.js +5 -0
  20. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyLogo.tsx +10 -0
  21. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodySectionGrid.d.ts +2 -0
  22. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodySectionGrid.js +6 -0
  23. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodySectionGrid.tsx +11 -0
  24. package/dist/components/forms/dynamicForm/fields/uiFields/TileCta.d.ts +2 -0
  25. package/dist/components/forms/dynamicForm/fields/uiFields/TileCta.js +5 -0
  26. package/dist/components/forms/dynamicForm/fields/uiFields/TileCta.tsx +14 -0
  27. package/dist/components/forms/dynamicForm/fields/uiFields/VerticalIcon.d.ts +2 -0
  28. package/dist/components/forms/dynamicForm/fields/uiFields/VerticalIcon.js +5 -0
  29. package/dist/components/forms/dynamicForm/fields/uiFields/VerticalIcon.tsx +31 -0
  30. package/dist/components/forms/dynamicForm/fields/uiFields/index.d.ts +7 -0
  31. package/dist/components/forms/dynamicForm/fields/uiFields/index.js +7 -0
  32. package/dist/components/forms/dynamicForm/fields/uiFields/index.ts +7 -0
  33. package/dist/components/sendDocument/RecipientContent.js +3 -1
  34. package/dist/helpers/forms/dynamicForm.helper.js +7 -1
  35. package/dist/interfaces/forms/dynamicForm/DynamicForm.interface.d.ts +9 -4
  36. package/dist/interfaces/forms/dynamicForm/fields/GroupField.interface.d.ts +6 -1
  37. package/dist/interfaces/forms/dynamicForm/fields/UIFields.interface.d.ts +20 -0
  38. package/dist/interfaces/forms/dynamicForm/fields/UIFields.interface.js +1 -0
  39. package/dist/interfaces/forms/dynamicForm/fields/index.d.ts +1 -0
  40. package/dist/interfaces/forms/dynamicForm/fields/index.js +1 -0
  41. package/dist/interfaces/partner/PartnerFooter.interface.d.ts +0 -1
  42. package/dist/mocks/forms/dynamicForm.mock.d.ts +1 -0
  43. package/dist/mocks/forms/dynamicForm.mock.js +159 -0
  44. package/dist/stories/forms/dynamicForm/DynamicForm.stories.d.ts +1 -0
  45. package/dist/stories/forms/dynamicForm/DynamicForm.stories.js +9 -3
  46. package/package.json +1 -1
  47. package/src/components/customToast/CustomToast.tsx +4 -3
  48. package/src/components/customToast/StatusIllustration.tsx +3 -3
  49. package/src/components/forms/dynamicForm/DynamicForm.tsx +14 -0
  50. package/src/components/forms/dynamicForm/fields/SingleFields.tsx +62 -6
  51. package/src/components/forms/dynamicForm/fields/index.ts +1 -0
  52. package/src/components/forms/dynamicForm/fields/uiFields/TileBody.tsx +24 -0
  53. package/src/components/forms/dynamicForm/fields/uiFields/TileBodyAction.tsx +11 -0
  54. package/src/components/forms/dynamicForm/fields/uiFields/TileBodyHeader.tsx +9 -0
  55. package/src/components/forms/dynamicForm/fields/uiFields/TileBodyLogo.tsx +10 -0
  56. package/src/components/forms/dynamicForm/fields/uiFields/TileBodySectionGrid.tsx +11 -0
  57. package/src/components/forms/dynamicForm/fields/uiFields/TileCta.tsx +14 -0
  58. package/src/components/forms/dynamicForm/fields/uiFields/VerticalIcon.tsx +31 -0
  59. package/src/components/forms/dynamicForm/fields/uiFields/index.ts +7 -0
  60. package/src/components/sendDocument/RecipientContent.tsx +15 -7
  61. package/src/helpers/forms/dynamicForm.helper.ts +12 -0
  62. package/src/interfaces/forms/dynamicForm/DynamicForm.interface.ts +27 -2
  63. package/src/interfaces/forms/dynamicForm/fields/GroupField.interface.ts +7 -1
  64. package/src/interfaces/forms/dynamicForm/fields/UIFields.interface.ts +24 -0
  65. package/src/interfaces/forms/dynamicForm/fields/index.ts +1 -0
  66. package/src/interfaces/partner/PartnerFooter.interface.ts +0 -1
  67. package/src/mocks/forms/dynamicForm.mock.ts +162 -0
  68. package/src/stories/forms/dynamicForm/DynamicForm.stories.tsx +14 -3
@@ -8,5 +8,5 @@ export const CustomToast = ({ description, onClose, status = 'success', title, }
8
8
  success: '#5E42B2',
9
9
  error: '#CF3593',
10
10
  };
11
- return (_jsxs(Box, { bg: bgColors[status], borderRadius: "lg", boxShadow: "lg", position: "relative", py: "base", children: [_jsxs(Flex, { gap: "base", p: "base", align: "center", children: [_jsx(StatusIllustration, { status: status }), _jsxs(Box, { children: [_jsx(Text, { fontSize: "25px", fontWeight: "medium", color: "neutral.white", lineHeight: "1.1", children: title }), _jsx(Text, { color: "neutral.white", children: description })] })] }), _jsx(Box, { as: "button", "aria-label": t('ariaLabels.close'), onClick: onClose, position: "absolute", top: "8px", right: "8px", children: _jsx(Close, { stroke: colors.neutral.white, size: 20 }) })] }));
11
+ return (_jsxs(Box, { paddingTop: 0, paddingBottom: 0, bg: bgColors[status], borderRadius: "lg", boxShadow: "lg", position: "relative", children: [_jsxs(Flex, { gap: "base", p: "base", align: "center", position: "relative", left: "-26px", children: [_jsx(StatusIllustration, { status: status }), _jsxs(Box, { children: [_jsx(Text, { fontSize: "22px", fontWeight: "medium", color: "neutral.white", lineHeight: "1.1", children: title }), _jsx(Text, { color: "neutral.white", children: description })] })] }), _jsx(Box, { as: "button", "aria-label": t('ariaLabels.close'), onClick: onClose, position: "absolute", top: "8px", right: "8px", children: _jsx(Close, { stroke: colors.neutral.white, size: 20 }) })] }));
12
12
  };
@@ -8,15 +8,15 @@ export const StatusIllustration = ({ status = 'success', }) => {
8
8
  src: Check,
9
9
  alt: t('ariaLabels.success'),
10
10
  bg: '#28B5A8',
11
- height: '26px',
11
+ height: '21px',
12
12
  },
13
13
  error: {
14
14
  src: Exclamation,
15
15
  alt: t('ariaLabels.error'),
16
16
  bg: '#991365',
17
- height: '33px',
17
+ height: '28px',
18
18
  },
19
19
  };
20
20
  const { alt, bg, height, src } = props[status];
21
- return (_jsx(Center, { borderRadius: "full", bg: bg, boxShadow: "xl", w: "60px", h: "60px", children: _jsx(Image, { src: src, alt: alt, h: height, w: "auto" }) }));
21
+ return (_jsx(Center, { borderRadius: "full", bg: bg, boxShadow: "xl", w: "43px", h: "43px", children: _jsx(Image, { src: src, alt: alt, h: height, w: "auto" }) }));
22
22
  };
@@ -1,2 +1,2 @@
1
1
  import { DynamicFormI } from '../../../interfaces';
2
- export declare const DynamicForm: ({ form: fields, onUpload, showTitle, uploadingFieldId, }: DynamicFormI) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const DynamicForm: ({ callback, form: fields, menuItems, onUpload, showTitle, uploadingFieldId, ...props }: DynamicFormI) => import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,23 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
13
  import { FormProvider } from 'react-hook-form';
3
14
  import { t } from 'i18next';
4
15
  import { Stack, Text } from '@chakra-ui/react';
5
- import { HiddenFieldSection, GroupField, TextField, TextAreaField, SelectField, RatingField, GridField, FieldWithDelete, FileField, SwitchField, DateField, NumberField, CurrencyField, } from '../..';
16
+ import { HiddenFieldSection, GroupField, TextField, TextAreaField, SelectField, RatingField, GridField, FieldWithDelete, FileField, SwitchField, DateField, NumberField, CurrencyField, TileBody, } from '../..';
6
17
  import { useDynamicForm } from '../../../hooks';
7
18
  import { fieldIcons } from '../../../helpers';
8
- export const DynamicForm = ({ form: fields, onUpload, showTitle = true, uploadingFieldId, }) => {
19
+ export const DynamicForm = (_a) => {
20
+ var { callback, form: fields, menuItems, onUpload, showTitle = true, uploadingFieldId } = _a, props = __rest(_a, ["callback", "form", "menuItems", "onUpload", "showTitle", "uploadingFieldId"]);
9
21
  const { form, visibleFields, hiddenFields, handleAddAll, handleAdd, handleFilesUpload, handleRemove, } = useDynamicForm({ fields, onUpload });
10
22
  return (_jsxs(Stack, { bg: "lightBlue.1", spacing: "0", h: "full", children: [showTitle && (_jsx(Text, { fontFamily: "secondary", px: "base", pt: "4", pb: "2", children: t('forms.itemDetails') })), _jsx(FormProvider, Object.assign({}, form, { children: _jsx(_Fragment, { children: visibleFields === null || visibleFields === void 0 ? void 0 : visibleFields.map((field) => {
11
23
  const { canBeHidden, children, description, icon, id, name, options, type, value, } = field;
@@ -49,6 +61,8 @@ export const DynamicForm = ({ form: fields, onUpload, showTitle = true, uploadin
49
61
  return (_jsx(FieldWithDelete, Object.assign({}, fieldWithDeleteBaseProps, { children: _jsx(FileField, { icon: baseProps.icon, description: description, onUpload: (files) => handleFilesUpload({ id, files }), uploading: uploadingFieldId === id }) })));
50
62
  case 'group':
51
63
  return (_jsx(GroupField, { id: id, fields: children, onRemove: handleRemove, canBeHidden: canBeHidden }, id));
64
+ case 'tile-body':
65
+ return (_jsx(TileBody, Object.assign({ callback: callback, fields: children, menuItems: menuItems }, props), id));
52
66
  default:
53
67
  return null;
54
68
  }
@@ -1,5 +1,2 @@
1
- import { DynamicFormI } from '../../../../interfaces';
2
- export interface FieldTypesI {
3
- fields?: DynamicFormI['form'];
4
- }
5
- export declare const SingleFields: ({ fields }: FieldTypesI) => import("react/jsx-runtime").JSX.Element;
1
+ import { FieldTypesI } from '../../../../interfaces';
2
+ export declare const SingleFields: ({ callback, fields, menuItems }: FieldTypesI) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { fieldIcons } from '../../../../helpers';
3
- import { GridField, RatingField, TextAreaField, TextField, SelectField, SwitchField, NumberField, DateField, CurrencyField, } from '../../..';
4
- export const SingleFields = ({ fields }) => {
3
+ import { GridField, RatingField, TextAreaField, TextField, SelectField, SwitchField, NumberField, DateField, CurrencyField, TileBodyHeader, TileBodyLogo, VerticalIcon, TileBodySectionGrid, TileBodyAction, TileCta, } from '../../..';
4
+ export const SingleFields = ({ callback, fields, menuItems }) => {
5
5
  return (_jsx(_Fragment, { children: fields === null || fields === void 0 ? void 0 : fields.map(({ children, description, id, name, type, value, icon, options = [], }) => {
6
6
  const baseProps = {
7
7
  key: id,
@@ -34,6 +34,20 @@ export const SingleFields = ({ fields }) => {
34
34
  return _jsx(TextField, Object.assign({}, baseProps, { type: "tel" }));
35
35
  case 'textarea':
36
36
  return _jsx(TextAreaField, Object.assign({}, baseProps));
37
+ case 'tile-body-section-grid':
38
+ return _jsx(TileBodySectionGrid, { fields: children }, id);
39
+ case 'tile-body-header':
40
+ return (_jsx(TileBodyHeader, { value: String(baseProps.value) }, baseProps.key));
41
+ case 'tile-body-logo':
42
+ return (_jsx(TileBodyLogo, { name: name, value: String(baseProps.value), menuItems: menuItems }, baseProps.key));
43
+ case 'vertical-icon':
44
+ return (_jsx(VerticalIcon, { icon: baseProps.icon, value: String(baseProps.value) }, id));
45
+ case 'tile-body-action':
46
+ return (_jsx(TileBodyAction, { fields: children, callback: callback }, id));
47
+ case 'primary-cta':
48
+ return (_jsx(TileCta, { type: type, value: String(baseProps.value), callback: callback }, id));
49
+ case 'secondary-cta':
50
+ return (_jsx(TileCta, { type: type, value: String(baseProps.value), callback: callback }, id));
37
51
  default:
38
52
  return null;
39
53
  }
@@ -13,3 +13,4 @@ export * from './SelectField';
13
13
  export * from './SingleFields';
14
14
  export * from './TextAreaField';
15
15
  export * from './TextField';
16
+ export * from './uiFields';
@@ -13,3 +13,4 @@ export * from './SelectField';
13
13
  export * from './SingleFields';
14
14
  export * from './TextAreaField';
15
15
  export * from './TextField';
16
+ export * from './uiFields';
@@ -0,0 +1,2 @@
1
+ import { TileBodyI } from '../../../../../interfaces';
2
+ export declare const TileBody: ({ callback, fields, websiteUrl, menuItems, ...props }: TileBodyI) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { Box, Stack } from '@chakra-ui/react';
14
+ import { PartnerFooter, SingleFields } from '../../../..';
15
+ export const TileBody = (_a) => {
16
+ var { callback, fields, websiteUrl = '', menuItems } = _a, props = __rest(_a, ["callback", "fields", "websiteUrl", "menuItems"]);
17
+ return (_jsx(Box, { display: "flex", flexDir: "column", bg: "neutral.white", boxShadow: "lg", children: _jsxs(Stack, { spacing: "0", flex: "1", children: [_jsx(SingleFields, { callback: callback, fields: fields, menuItems: menuItems }), _jsx(PartnerFooter, Object.assign({}, props, { websiteUrl: websiteUrl }))] }) }));
18
+ };
@@ -0,0 +1,24 @@
1
+ import { Box, Stack } from '@chakra-ui/react'
2
+ import { TileBodyI } from '@/interfaces'
3
+ import { PartnerFooter, SingleFields } from '@/components'
4
+
5
+ export const TileBody = ({
6
+ callback,
7
+ fields,
8
+ websiteUrl = '',
9
+ menuItems,
10
+ ...props
11
+ }: TileBodyI) => {
12
+ return (
13
+ <Box display="flex" flexDir="column" bg="neutral.white" boxShadow="lg">
14
+ <Stack spacing="0" flex="1">
15
+ <SingleFields
16
+ callback={callback}
17
+ fields={fields}
18
+ menuItems={menuItems}
19
+ />
20
+ <PartnerFooter {...props} websiteUrl={websiteUrl} />
21
+ </Stack>
22
+ </Box>
23
+ )
24
+ }
@@ -0,0 +1,2 @@
1
+ import { TileBodyI } from '../../../../../interfaces';
2
+ export declare const TileBodyAction: ({ fields }: TileBodyI) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Flex } from '@chakra-ui/react';
3
+ import { SingleFields } from '../../../..';
4
+ export const TileBodyAction = ({ fields }) => {
5
+ return (_jsx(Flex, { p: "base", align: "center", gap: "base", children: _jsx(SingleFields, { fields: fields }) }));
6
+ };
@@ -0,0 +1,11 @@
1
+ import { Flex } from '@chakra-ui/react'
2
+ import { SingleFields } from '@/components'
3
+ import { TileBodyI } from '@/interfaces'
4
+
5
+ export const TileBodyAction = ({ fields }: TileBodyI) => {
6
+ return (
7
+ <Flex p="base" align="center" gap="base">
8
+ <SingleFields fields={fields} />
9
+ </Flex>
10
+ )
11
+ }
@@ -0,0 +1,3 @@
1
+ export declare const TileBodyHeader: ({ value }: {
2
+ value?: string | undefined;
3
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Box, Text } from '@chakra-ui/react';
3
+ export const TileBodyHeader = ({ value = '' }) => {
4
+ return (_jsx(Box, { p: "base", children: _jsx(Text, { fontWeight: "semibold", children: value }) }));
5
+ };
@@ -0,0 +1,9 @@
1
+ import { Box, Text } from '@chakra-ui/react'
2
+
3
+ export const TileBodyHeader = ({ value = '' }) => {
4
+ return (
5
+ <Box p="base">
6
+ <Text fontWeight="semibold">{value}</Text>
7
+ </Box>
8
+ )
9
+ }
@@ -0,0 +1,2 @@
1
+ import { TileBodyLogoI } from '../../../../../interfaces';
2
+ export declare const TileBodyLogo: ({ menuItems, name, value, }: TileBodyLogoI) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { PartnerHeader } from '../../../..';
3
+ export const TileBodyLogo = ({ menuItems, name = '', value, }) => {
4
+ return _jsx(PartnerHeader, { logo: value, partnerName: name, menuItems: menuItems });
5
+ };
@@ -0,0 +1,10 @@
1
+ import { PartnerHeader } from '@/components'
2
+ import { TileBodyLogoI } from '@/interfaces'
3
+
4
+ export const TileBodyLogo = ({
5
+ menuItems,
6
+ name = '',
7
+ value,
8
+ }: TileBodyLogoI) => {
9
+ return <PartnerHeader logo={value} partnerName={name} menuItems={menuItems} />
10
+ }
@@ -0,0 +1,2 @@
1
+ import { TileBodyI } from '../../../../../interfaces';
2
+ export declare const TileBodySectionGrid: ({ fields }: TileBodyI) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { SimpleGrid } from '@chakra-ui/react';
3
+ import { SingleFields } from '../../../..';
4
+ export const TileBodySectionGrid = ({ fields }) => {
5
+ return (_jsx(SimpleGrid, { columns: 3, spacing: "base", p: "base", children: _jsx(SingleFields, { fields: fields }) }));
6
+ };
@@ -0,0 +1,11 @@
1
+ import { SimpleGrid } from '@chakra-ui/react'
2
+ import { SingleFields } from '@/components'
3
+ import { TileBodyI } from '@/interfaces'
4
+
5
+ export const TileBodySectionGrid = ({ fields }: TileBodyI) => {
6
+ return (
7
+ <SimpleGrid columns={3} spacing="base" p="base">
8
+ <SingleFields fields={fields} />
9
+ </SimpleGrid>
10
+ )
11
+ }
@@ -0,0 +1,2 @@
1
+ import { TileCtaI } from '../../../../../interfaces';
2
+ export declare const TileCta: ({ callback, type, value }: TileCtaI) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Button } from '@chakra-ui/react';
3
+ export const TileCta = ({ callback, type, value }) => {
4
+ return (_jsx(Button, { onClick: () => callback === null || callback === void 0 ? void 0 : callback(value), variant: type === 'primary-cta' ? 'tertiaryFooter' : 'secondaryFooter', fontSize: "sm", children: value }));
5
+ };
@@ -0,0 +1,14 @@
1
+ import { Button } from '@chakra-ui/react'
2
+ import { TileCtaI } from '@/interfaces'
3
+
4
+ export const TileCta = ({ callback, type, value }: TileCtaI) => {
5
+ return (
6
+ <Button
7
+ onClick={() => callback?.(value)}
8
+ variant={type === 'primary-cta' ? 'tertiaryFooter' : 'secondaryFooter'}
9
+ fontSize="sm"
10
+ >
11
+ {value}
12
+ </Button>
13
+ )
14
+ }
@@ -0,0 +1,2 @@
1
+ import { VerticalIconI } from '../../../../../interfaces';
2
+ export declare const VerticalIcon: ({ icon, value }: VerticalIconI) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Image, Text } from '@chakra-ui/react';
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", children: [_jsx(Box, { h: "46px", display: "flex", alignItems: "center", children: _jsx(Image, { src: icon, alt: value, w: "auto", h: "80%" }) }), _jsx(Box, { pb: "2", children: _jsx(Text, { fontWeight: "semibold", textAlign: "center", fontSize: "13px", lineHeight: "14px", children: value }) })] }));
5
+ };
@@ -0,0 +1,31 @@
1
+ import { Box, Image, Text } from '@chakra-ui/react'
2
+ import { VerticalIconI } from '@/interfaces'
3
+
4
+ export const VerticalIcon = ({ icon, value }: VerticalIconI) => {
5
+ return (
6
+ <Box
7
+ bg="neutral.white"
8
+ borderRadius="md"
9
+ border="1px solid"
10
+ borderColor="lightBlue.6"
11
+ display="flex"
12
+ flexDirection="column"
13
+ alignItems="center"
14
+ justifyContent="center"
15
+ >
16
+ <Box h="46px" display="flex" alignItems="center">
17
+ <Image src={icon} alt={value} w="auto" h="80%" />
18
+ </Box>
19
+ <Box pb="2">
20
+ <Text
21
+ fontWeight="semibold"
22
+ textAlign="center"
23
+ fontSize="13px"
24
+ lineHeight="14px"
25
+ >
26
+ {value}
27
+ </Text>
28
+ </Box>
29
+ </Box>
30
+ )
31
+ }
@@ -0,0 +1,7 @@
1
+ export * from './TileBody';
2
+ export * from './TileBodyAction';
3
+ export * from './TileBodyHeader';
4
+ export * from './TileBodyLogo';
5
+ export * from './TileBodySectionGrid';
6
+ export * from './TileCta';
7
+ export * from './VerticalIcon';
@@ -0,0 +1,7 @@
1
+ export * from './TileBody';
2
+ export * from './TileBodyAction';
3
+ export * from './TileBodyHeader';
4
+ export * from './TileBodyLogo';
5
+ export * from './TileBodySectionGrid';
6
+ export * from './TileCta';
7
+ export * from './VerticalIcon';
@@ -0,0 +1,7 @@
1
+ export * from './TileBody'
2
+ export * from './TileBodyAction'
3
+ export * from './TileBodyHeader'
4
+ export * from './TileBodyLogo'
5
+ export * from './TileBodySectionGrid'
6
+ export * from './TileCta'
7
+ export * from './VerticalIcon'
@@ -1,6 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Flex, Avatar, Stack, Box, Text } from '@chakra-ui/react';
3
3
  import { randomColor } from '../../utils';
4
+ import MoonLoader from 'react-spinners/MoonLoader';
4
5
  export const RecipientContent = ({ bgColor, firstName = '', index = 0, lastName = '', phone = '', email = '', }) => {
5
- return (_jsxs(Flex, { gap: "2", align: firstName ? 'start' : 'center', children: [_jsx(Avatar, { size: "sm", bg: bgColor !== null && bgColor !== void 0 ? bgColor : randomColor(index), fontWeight: "bold", color: "neutral.white", name: firstName ? `${firstName} ${lastName}` : '' }), _jsxs(Stack, { w: "full", spacing: "-2", minH: "3rem", justify: "space-between", children: [_jsxs(Box, { children: [firstName && (_jsx(Text, { fontWeight: "medium", textTransform: "capitalize", children: `${firstName} ${lastName}` })), _jsx(Text, { fontSize: "xxs", children: phone })] }), _jsx(Text, { variant: "email", alignSelf: "flex-end", children: email })] })] }));
6
+ const isPending = firstName === 'Account' && lastName === 'Pending';
7
+ return (_jsxs(Flex, { gap: "2", align: firstName ? 'start' : 'center', children: [isPending && (_jsx(MoonLoader, { color: "#2d2d2d", size: 20, speedMultiplier: 0.5 })), !isPending && (_jsx(Avatar, { size: "sm", bg: bgColor !== null && bgColor !== void 0 ? bgColor : randomColor(index), fontWeight: "bold", color: "neutral.white", name: firstName ? `${firstName} ${lastName}` : '' })), _jsxs(Stack, { w: "full", spacing: "-2", minH: "3rem", justify: "space-between", children: [_jsxs(Box, { children: [firstName && (_jsx(Text, { fontWeight: "medium", textTransform: "capitalize", children: `${firstName} ${lastName}` })), _jsx(Text, { fontSize: "xxs", children: phone })] }), _jsx(Text, { variant: "email", alignSelf: "flex-end", children: email })] })] }));
6
8
  };
@@ -1,4 +1,4 @@
1
- import { Paint, Receipt, Barcode, GoldenBars, Heart, Rating, Notes, Book, ImgIcon, Registry, ShareWith, Calendar, Tools2, Billing, Calc, CheckPen, GenericField, Price, Battery2, Co2, Detector, Electricity, Sprinkler, SixtyEight, DropCalendar, MobileDrop, SolarPanel, Calendar2, Drop, Wind, Foundation, Heater, Light, Plate, Pool2, Closet, Structure, GlassWater, Roof2, Target, CircleFace, Company, } from '../../assets/images';
1
+ import { Paint, Receipt, Barcode, GoldenBars, Heart, Rating, Notes, Book, ImgIcon, Registry, ShareWith, Calendar, Tools2, Billing, Calc, CheckPen, GenericField, Price, Battery2, Co2, Detector, Electricity, Sprinkler, SixtyEight, DropCalendar, MobileDrop, SolarPanel, Calendar2, Drop, Wind, Foundation, Heater, Light, Plate, Pool2, Closet, Structure, GlassWater, Roof2, Target, CircleFace, Company, Pressure, WindowCleaning, RoofCleaning, HolidayLights, GutterCleaning, HomeCleaning, } from '../../assets/images';
2
2
  export const fieldIcons = {
3
3
  barcode: Barcode,
4
4
  billing: Billing,
@@ -43,4 +43,10 @@ export const fieldIcons = {
43
43
  target: Target,
44
44
  title: CircleFace,
45
45
  company: Company,
46
+ 'sh-gutter': GutterCleaning,
47
+ 'sh-home': HomeCleaning,
48
+ 'sh-lights': HolidayLights,
49
+ 'sh-pressure': Pressure,
50
+ 'sh-roof': RoofCleaning,
51
+ 'sh-window': WindowCleaning,
46
52
  };
@@ -1,6 +1,8 @@
1
- import { FolderFileI } from '../..';
2
- type KindTypes = 'checkbox' | 'currency' | 'date' | 'email' | 'file' | 'grid' | 'group' | 'number' | 'radio' | 'rating' | 'select' | 'string' | 'switch' | 'telephone' | 'text' | 'textarea' | 'default';
3
- export type IconTypes = 'barcode' | 'battery' | 'billing' | 'book' | 'calc' | 'calendar' | 'check' | 'co2' | 'date' | 'default' | 'detector' | 'electricity' | 'goldbars' | 'heart' | 'image' | 'notes' | 'palette' | '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' | 'house' | 'target' | 'title' | 'company';
1
+ import { FolderFileI, MenuItemI, PartnerFooterI, TileCtaI } from '../..';
2
+ type KindTypes = 'checkbox' | 'currency' | 'date' | 'email' | 'file' | 'grid' | 'group' | 'number' | 'radio' | 'rating' | 'select' | 'string' | 'switch' | 'telephone' | 'text' | 'textarea' | 'default' | UIKindTypes;
3
+ type UIKindTypes = 'tile-body' | 'tile-body-logo' | 'tile-body-header' | 'tile-body-section' | 'tile-body-section-grid' | 'tile-form' | 'tile-body-action' | 'vertical-icon' | 'primary-cta' | 'secondary-cta';
4
+ export type IconTypes = 'barcode' | 'battery' | 'billing' | 'book' | 'calc' | 'calendar' | 'check' | 'co2' | 'date' | 'default' | 'detector' | 'electricity' | 'goldbars' | 'heart' | 'image' | 'notes' | 'palette' | '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' | 'house' | 'target' | 'title' | 'company' | UIIconTypes;
5
+ export type UIIconTypes = 'sh-pressure' | 'sh-window' | 'sh-roof' | 'sh-lights' | 'sh-gutter' | 'sh-home';
4
6
  export type ValueTypes = string | string[] | number | boolean;
5
7
  export type OptionsTypes = string[] | number[] | null;
6
8
  export interface ReportI {
@@ -10,14 +12,17 @@ export interface ReportI {
10
12
  description?: string;
11
13
  icon?: IconTypes;
12
14
  id: string;
15
+ link?: string;
13
16
  name?: string;
14
17
  options?: OptionsTypes;
15
18
  type: KindTypes;
16
19
  value: ValueTypes;
17
20
  visible?: boolean;
18
21
  }
19
- export interface DynamicFormI {
22
+ export interface DynamicFormI extends Partial<PartnerFooterI> {
23
+ callback?: TileCtaI['callback'];
20
24
  form: ReportI[];
25
+ menuItems?: MenuItemI[];
21
26
  onUpload?: (filesByFieldId: Record<string, FolderFileI[]>) => void;
22
27
  showTitle?: boolean;
23
28
  uploadingFieldId?: string;
@@ -1,7 +1,12 @@
1
- import { DynamicFormI } from '../../..';
1
+ import { DynamicFormI, MenuItemI, TileCtaI } from '../../..';
2
2
  export interface GroupFieldI {
3
3
  id: string;
4
4
  canBeHidden?: boolean;
5
5
  fields?: DynamicFormI['form'];
6
6
  onRemove: (id: string) => void;
7
7
  }
8
+ export interface FieldTypesI {
9
+ callback?: TileCtaI['callback'];
10
+ fields?: DynamicFormI['form'];
11
+ menuItems?: MenuItemI[];
12
+ }
@@ -0,0 +1,20 @@
1
+ import { DynamicFormI, MenuItemI, PartnerFooterI } from '../../..';
2
+ export interface TileBodyLogoI {
3
+ menuItems?: MenuItemI[];
4
+ name?: string;
5
+ value: string;
6
+ }
7
+ export interface TileBodyI extends Partial<PartnerFooterI> {
8
+ callback?: TileCtaI['callback'];
9
+ fields?: DynamicFormI['form'];
10
+ menuItems?: MenuItemI[];
11
+ }
12
+ export interface VerticalIconI {
13
+ icon?: string;
14
+ value: string;
15
+ }
16
+ export interface TileCtaI {
17
+ callback?: (value: string) => void;
18
+ type: 'primary-cta' | 'secondary-cta';
19
+ value: string;
20
+ }
@@ -8,3 +8,4 @@ export * from './SelectField.interface';
8
8
  export * from './SwitchField.interface';
9
9
  export * from './TextAreaField.interface';
10
10
  export * from './TextField.interface';
11
+ export * from './UIFields.interface';
@@ -8,3 +8,4 @@ export * from './SelectField.interface';
8
8
  export * from './SwitchField.interface';
9
9
  export * from './TextAreaField.interface';
10
10
  export * from './TextField.interface';
11
+ export * from './UIFields.interface';
@@ -4,7 +4,6 @@ export interface SocialLinkI {
4
4
  link: string;
5
5
  }
6
6
  export interface PartnerFooterI {
7
- iconSize?: number;
8
7
  socialLinks?: SocialLinkI[];
9
8
  websiteUrl: string;
10
9
  urlText?: string;
@@ -1,3 +1,4 @@
1
1
  import { ReportI } from '../../interfaces';
2
2
  export declare const formFieldsMock: ReportI[];
3
3
  export declare const contactFieldsMock: ReportI[];
4
+ export declare const tileUIMock: ReportI[];