@homefile/components-v2 2.14.31 → 2.14.32

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 (26) hide show
  1. package/dist/components/forms/dynamicForm/fields/TileBodyFields.js +5 -1
  2. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyDescription.d.ts +3 -0
  3. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyDescription.js +5 -0
  4. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyDescription.tsx +16 -0
  5. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyPartnerImage.d.ts +2 -0
  6. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyPartnerImage.js +6 -0
  7. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyPartnerImage.tsx +11 -0
  8. package/dist/components/forms/dynamicForm/fields/uiFields/index.d.ts +2 -0
  9. package/dist/components/forms/dynamicForm/fields/uiFields/index.js +2 -0
  10. package/dist/components/forms/dynamicForm/fields/uiFields/index.ts +3 -1
  11. package/dist/interfaces/forms/dynamicForm/DynamicForm.interface.d.ts +1 -1
  12. package/dist/mocks/partner/dynamicTileForm.mock.d.ts +2 -0
  13. package/dist/mocks/partner/dynamicTileForm.mock.js +65 -0
  14. package/dist/mocks/partner/index.d.ts +1 -0
  15. package/dist/mocks/partner/index.js +1 -0
  16. package/dist/stories/partner/DynamicTile.stories.d.ts +5 -0
  17. package/dist/stories/partner/DynamicTile.stories.js +26 -0
  18. package/package.json +1 -1
  19. package/src/components/forms/dynamicForm/fields/TileBodyFields.tsx +5 -2
  20. package/src/components/forms/dynamicForm/fields/uiFields/TileBodyDescription.tsx +16 -0
  21. package/src/components/forms/dynamicForm/fields/uiFields/TileBodyPartnerImage.tsx +11 -0
  22. package/src/components/forms/dynamicForm/fields/uiFields/index.ts +3 -1
  23. package/src/interfaces/forms/dynamicForm/DynamicForm.interface.ts +2 -0
  24. package/src/mocks/partner/dynamicTileForm.mock.ts +67 -0
  25. package/src/mocks/partner/index.ts +1 -0
  26. package/src/stories/partner/DynamicTile.stories.tsx +33 -0
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { fieldIcons } from '../../../../helpers';
3
- import { VerticalIcon, TileBodySectionGrid } from '../../..';
3
+ import { VerticalIcon, TileBodySectionGrid, TileBodyDescription, TileBodyPartnerImage } from '../../..';
4
4
  export const TileBodyFields = ({ fields }) => {
5
5
  return (_jsx(_Fragment, { children: fields === null || fields === void 0 ? void 0 : fields.map(({ children, id, name, type, value, icon }) => {
6
6
  const baseProps = {
@@ -13,6 +13,10 @@ export const TileBodyFields = ({ fields }) => {
13
13
  switch (type) {
14
14
  case 'tile-body-section-grid':
15
15
  return _jsx(TileBodySectionGrid, { fields: children }, id);
16
+ case 'tile-body-description':
17
+ return _jsx(TileBodyDescription, { description: String(baseProps.value) });
18
+ case 'tile-body-partner-image':
19
+ return _jsx(TileBodyPartnerImage, { imageUrl: String(baseProps.value), partnerName: name });
16
20
  case 'vertical-icon':
17
21
  return (_jsx(VerticalIcon, { icon: baseProps.icon, value: String(baseProps.value) }, id));
18
22
  default:
@@ -0,0 +1,3 @@
1
+ export declare const TileBodyDescription: ({ description }: {
2
+ description: string;
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 TileBodyDescription = ({ description }) => {
4
+ return (_jsx(Box, { px: "base", py: "4", pb: "0", bg: "lightBlue.1", children: _jsx(Text, { fontSize: "sm", fontWeight: "light", lineHeight: "18px", textAlign: "center", children: description }) }));
5
+ };
@@ -0,0 +1,16 @@
1
+ import { Box, Text } from '@chakra-ui/react'
2
+
3
+ export const TileBodyDescription = ({description}: {description: string}) => {
4
+ return (
5
+ <Box px="base" py="4" pb="0" bg="lightBlue.1">
6
+ <Text
7
+ fontSize="sm"
8
+ fontWeight="light"
9
+ lineHeight="18px"
10
+ textAlign="center"
11
+ >
12
+ {description}
13
+ </Text>
14
+ </Box>
15
+ )
16
+ }
@@ -0,0 +1,2 @@
1
+ import { PartnerImageI } from '../../../../../interfaces';
2
+ export declare const TileBodyPartnerImage: ({ imageUrl, partnerName }: PartnerImageI) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Box } from '@chakra-ui/react';
3
+ import { PartnerImage } from '../../../..';
4
+ export const TileBodyPartnerImage = ({ imageUrl, partnerName }) => {
5
+ return (_jsx(Box, { h: "240px", children: _jsx(PartnerImage, { imageUrl: imageUrl, partnerName: partnerName }) }));
6
+ };
@@ -0,0 +1,11 @@
1
+ import { Box, Flex, Stack, Text } from '@chakra-ui/react'
2
+ import { PartnerImage } from '@/components'
3
+ import { PartnerImageI } from '@/interfaces'
4
+
5
+ export const TileBodyPartnerImage = ({ imageUrl, partnerName }: PartnerImageI) => {
6
+ return (
7
+ <Box h="240px">
8
+ <PartnerImage imageUrl={imageUrl} partnerName={partnerName} />
9
+ </Box>
10
+ )
11
+ }
@@ -4,4 +4,6 @@ export * from './TileBodyHeader';
4
4
  export * from './TileBodyLogo';
5
5
  export * from './TileBodySectionGrid';
6
6
  export * from './TileCta';
7
+ export * from './TileBodyDescription';
8
+ export * from './TileBodyPartnerImage';
7
9
  export * from './VerticalIcon';
@@ -4,4 +4,6 @@ export * from './TileBodyHeader';
4
4
  export * from './TileBodyLogo';
5
5
  export * from './TileBodySectionGrid';
6
6
  export * from './TileCta';
7
+ export * from './TileBodyDescription';
8
+ export * from './TileBodyPartnerImage';
7
9
  export * from './VerticalIcon';
@@ -4,4 +4,6 @@ export * from './TileBodyHeader'
4
4
  export * from './TileBodyLogo'
5
5
  export * from './TileBodySectionGrid'
6
6
  export * from './TileCta'
7
- export * from './VerticalIcon'
7
+ export * from './TileBodyDescription'
8
+ export * from './TileBodyPartnerImage'
9
+ export * from './VerticalIcon'
@@ -1,6 +1,6 @@
1
1
  import { AIGridFieldI, FolderFileI, MenuItemI, PartnerFooterI, TileCtaI } from '../..';
2
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' | UIKindTypes | HomeItemTypes;
3
- export 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';
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' | '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' | 'pressure-washer' | 'house' | 'target' | 'title' | 'company' | UIIconTypes;
6
6
  export type UIIconTypes = 'sh-pressure' | 'sh-window' | 'sh-roof' | 'sh-lights' | 'sh-gutter' | 'sh-home' | 'sh-house';
@@ -0,0 +1,2 @@
1
+ import { ReportI } from "../../interfaces";
2
+ export declare const dynamicTileFormMock: ReportI[];
@@ -0,0 +1,65 @@
1
+ export const dynamicTileFormMock = [
2
+ {
3
+ "id": "stile1p",
4
+ "name": "",
5
+ "description": "",
6
+ "comments": "",
7
+ "value": "",
8
+ "type": "tile-body",
9
+ "visible": true,
10
+ "children": [
11
+ {
12
+ "id": "stilec01",
13
+ "name": "Shine",
14
+ "description": "",
15
+ "comments": "",
16
+ "value": "https://storage.googleapis.com/homefile-images/shine_logo_updated.png",
17
+ "type": "tile-body-logo"
18
+ },
19
+ {
20
+ "id": "stilec01test",
21
+ "name": "Partner Name Here",
22
+ "description": "",
23
+ "comments": "",
24
+ "value": "https://storage.googleapis.com/homefile-images/audreybackgroundimage-update.jpg",
25
+ "type": "tile-body-partner-image"
26
+ },
27
+ {
28
+ "id": "stilec02test",
29
+ "name": "Shine",
30
+ "description": "",
31
+ "comments": "",
32
+ "value": "Test description will go here. Test.",
33
+ "type": "tile-body-description"
34
+ },
35
+ {
36
+ "id": "stile2p",
37
+ "name": "",
38
+ "description": "",
39
+ "comments": "",
40
+ "value": "",
41
+ "type": "tile-body-action",
42
+ "children": [
43
+ {
44
+ "id": "stilecta1",
45
+ "name": "drawer-link",
46
+ "description": "",
47
+ "comments": "",
48
+ "value": "Schedule Service",
49
+ "type": "primary-cta",
50
+ "link": "stiledf01"
51
+ },
52
+ {
53
+ "id": "stilecta2",
54
+ "name": "drawer-link",
55
+ "description": "",
56
+ "comments": "",
57
+ "value": "Request Support",
58
+ "type": "secondary-cta",
59
+ "link": "stiledf02"
60
+ }
61
+ ]
62
+ }
63
+ ]
64
+ }
65
+ ];
@@ -4,3 +4,4 @@ export * from './details.mock';
4
4
  export * from './partnerCatalog.mock';
5
5
  export * from './partnerOptions.mock';
6
6
  export * from './socialLinks.mock';
7
+ export * from './dynamicTileForm.mock';
@@ -4,3 +4,4 @@ export * from './details.mock';
4
4
  export * from './partnerCatalog.mock';
5
5
  export * from './partnerOptions.mock';
6
6
  export * from './socialLinks.mock';
7
+ export * from './dynamicTileForm.mock';
@@ -0,0 +1,5 @@
1
+ import { DynamicFormI } from '../../interfaces';
2
+ import { Meta } from '@storybook/react';
3
+ declare const _default: Meta;
4
+ export default _default;
5
+ export declare const DynamicFormTileComponent: (args: DynamicFormI) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { DynamicForm as DynamicFormTile } from '../../components';
3
+ import { dynamicTileFormMock, socialLinksMock, menuMock } from '../../mocks';
4
+ import { Flex } from '@chakra-ui/react';
5
+ export default {
6
+ title: 'Components/Partner',
7
+ component: DynamicFormTile,
8
+ args: {
9
+ _id: '12',
10
+ form: dynamicTileFormMock,
11
+ websiteUrl: 'http://www.homefile.com',
12
+ socialLinks: socialLinksMock,
13
+ partnerName: 'Homefile Dynamic',
14
+ menuItems: menuMock,
15
+ minimized: false,
16
+ showTitle: false,
17
+ },
18
+ argTypes: {
19
+ menuItems: {
20
+ control: { disable: true },
21
+ },
22
+ },
23
+ };
24
+ export const DynamicFormTileComponent = (args) => {
25
+ return (_jsx(Flex, { maxW: '380px', children: _jsx(DynamicFormTile, Object.assign({}, args)) }));
26
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.14.31",
3
+ "version": "2.14.32",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",
@@ -1,6 +1,6 @@
1
1
  import { fieldIcons } from '@/helpers'
2
2
  import { FieldTypesI } from '@/interfaces'
3
- import { VerticalIcon, TileBodySectionGrid } from '@/components'
3
+ import { VerticalIcon, TileBodySectionGrid, TileBodyDescription, TileBodyPartnerImage } from '@/components'
4
4
 
5
5
  export const TileBodyFields = ({ fields }: FieldTypesI) => {
6
6
  return (
@@ -16,6 +16,10 @@ export const TileBodyFields = ({ fields }: FieldTypesI) => {
16
16
  switch (type) {
17
17
  case 'tile-body-section-grid':
18
18
  return <TileBodySectionGrid key={id} fields={children} />
19
+ case 'tile-body-description':
20
+ return <TileBodyDescription description={String(baseProps.value)}/>
21
+ case 'tile-body-partner-image':
22
+ return <TileBodyPartnerImage imageUrl={String(baseProps.value)} partnerName={name}/>
19
23
  case 'vertical-icon':
20
24
  return (
21
25
  <VerticalIcon
@@ -24,7 +28,6 @@ export const TileBodyFields = ({ fields }: FieldTypesI) => {
24
28
  value={String(baseProps.value)}
25
29
  />
26
30
  )
27
-
28
31
  default:
29
32
  return null
30
33
  }
@@ -0,0 +1,16 @@
1
+ import { Box, Text } from '@chakra-ui/react'
2
+
3
+ export const TileBodyDescription = ({description}: {description: string}) => {
4
+ return (
5
+ <Box px="base" py="4" pb="0" bg="lightBlue.1">
6
+ <Text
7
+ fontSize="sm"
8
+ fontWeight="light"
9
+ lineHeight="18px"
10
+ textAlign="center"
11
+ >
12
+ {description}
13
+ </Text>
14
+ </Box>
15
+ )
16
+ }
@@ -0,0 +1,11 @@
1
+ import { Box, Flex, Stack, Text } from '@chakra-ui/react'
2
+ import { PartnerImage } from '@/components'
3
+ import { PartnerImageI } from '@/interfaces'
4
+
5
+ export const TileBodyPartnerImage = ({ imageUrl, partnerName }: PartnerImageI) => {
6
+ return (
7
+ <Box h="240px">
8
+ <PartnerImage imageUrl={imageUrl} partnerName={partnerName} />
9
+ </Box>
10
+ )
11
+ }
@@ -4,4 +4,6 @@ export * from './TileBodyHeader'
4
4
  export * from './TileBodyLogo'
5
5
  export * from './TileBodySectionGrid'
6
6
  export * from './TileCta'
7
- export * from './VerticalIcon'
7
+ export * from './TileBodyDescription'
8
+ export * from './TileBodyPartnerImage'
9
+ export * from './VerticalIcon'
@@ -39,6 +39,8 @@ export type UIKindTypes =
39
39
  | 'tile-body-header'
40
40
  | 'tile-body-section'
41
41
  | 'tile-body-section-grid'
42
+ | 'tile-body-partner-image'
43
+ | 'tile-body-description'
42
44
  | 'tile-form'
43
45
  | 'tile-body-action'
44
46
  | 'vertical-icon'
@@ -0,0 +1,67 @@
1
+ import { ReportI } from "@/interfaces";
2
+
3
+ export const dynamicTileFormMock: ReportI[] = [
4
+ {
5
+ "id": "stile1p",
6
+ "name": "",
7
+ "description": "",
8
+ "comments": "",
9
+ "value": "",
10
+ "type": "tile-body",
11
+ "visible": true,
12
+ "children": [
13
+ {
14
+ "id": "stilec01",
15
+ "name": "Shine",
16
+ "description": "",
17
+ "comments": "",
18
+ "value": "https://storage.googleapis.com/homefile-images/shine_logo_updated.png",
19
+ "type": "tile-body-logo"
20
+ },
21
+ {
22
+ "id": "stilec01test",
23
+ "name": "Partner Name Here",
24
+ "description": "",
25
+ "comments": "",
26
+ "value": "https://storage.googleapis.com/homefile-images/audreybackgroundimage-update.jpg",
27
+ "type": "tile-body-partner-image"
28
+ },
29
+ {
30
+ "id": "stilec02test",
31
+ "name": "Shine",
32
+ "description": "",
33
+ "comments": "",
34
+ "value": "Test description will go here. Test.",
35
+ "type": "tile-body-description"
36
+ },
37
+ {
38
+ "id": "stile2p",
39
+ "name": "",
40
+ "description": "",
41
+ "comments": "",
42
+ "value": "",
43
+ "type": "tile-body-action",
44
+ "children": [
45
+ {
46
+ "id": "stilecta1",
47
+ "name": "drawer-link",
48
+ "description": "",
49
+ "comments": "",
50
+ "value": "Schedule Service",
51
+ "type": "primary-cta",
52
+ "link": "stiledf01"
53
+ },
54
+ {
55
+ "id": "stilecta2",
56
+ "name": "drawer-link",
57
+ "description": "",
58
+ "comments": "",
59
+ "value": "Request Support",
60
+ "type": "secondary-cta",
61
+ "link": "stiledf02"
62
+ }
63
+ ]
64
+ }
65
+ ]
66
+ }
67
+ ]
@@ -4,3 +4,4 @@ export * from './details.mock'
4
4
  export * from './partnerCatalog.mock'
5
5
  export * from './partnerOptions.mock'
6
6
  export * from './socialLinks.mock'
7
+ export * from './dynamicTileForm.mock'
@@ -0,0 +1,33 @@
1
+ import { DynamicForm as DynamicFormTile } from '@/components'
2
+ import { DynamicFormI } from '@/interfaces'
3
+ import { dynamicTileFormMock, socialLinksMock, menuMock } from '@/mocks'
4
+ import { Meta } from '@storybook/react'
5
+ import { Flex } from '@chakra-ui/react'
6
+
7
+ export default {
8
+ title: 'Components/Partner',
9
+ component: DynamicFormTile,
10
+ args: {
11
+ _id: '12',
12
+ form: dynamicTileFormMock,
13
+ websiteUrl: 'http://www.homefile.com',
14
+ socialLinks: socialLinksMock,
15
+ partnerName: 'Homefile Dynamic',
16
+ menuItems: menuMock,
17
+ minimized: false,
18
+ showTitle: false,
19
+ },
20
+ argTypes: {
21
+ menuItems: {
22
+ control: { disable: true },
23
+ },
24
+ },
25
+ } as Meta
26
+
27
+ export const DynamicFormTileComponent = (args: DynamicFormI) => {
28
+ return (
29
+ <Flex maxW={'380px'}>
30
+ <DynamicFormTile {...args} />
31
+ </Flex>
32
+ )
33
+ }