@homefile/components-v2 1.2.2 → 1.4.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 (234) hide show
  1. package/dist/assets/images/circle-face.svg +21 -0
  2. package/dist/assets/images/company.svg +34 -0
  3. package/dist/assets/images/index.d.ts +5 -1
  4. package/dist/assets/images/index.js +5 -1
  5. package/dist/assets/images/index.ts +7 -0
  6. package/dist/assets/images/location.jpg +0 -0
  7. package/dist/assets/images/logos/index.d.ts +2 -1
  8. package/dist/assets/images/logos/index.js +2 -1
  9. package/dist/assets/images/logos/index.ts +12 -1
  10. package/dist/assets/images/logos/shine.png +0 -0
  11. package/dist/assets/images/shine/gutter-cleaning.png +0 -0
  12. package/dist/assets/images/shine/holiday-lights.png +0 -0
  13. package/dist/assets/images/shine/home-cleaning.png +0 -0
  14. package/dist/assets/images/shine/index.d.ts +7 -0
  15. package/dist/assets/images/shine/index.js +7 -0
  16. package/dist/assets/images/shine/index.ts +15 -0
  17. package/dist/assets/images/shine/pressure.png +0 -0
  18. package/dist/assets/images/shine/roof-cleaning.png +0 -0
  19. package/dist/assets/images/shine/window.png +0 -0
  20. package/dist/assets/locales/en/index.json +23 -1
  21. package/dist/components/animations/CloudsAnimation.js +1 -1
  22. package/dist/components/contacts/ContactCard.d.ts +1 -1
  23. package/dist/components/contacts/ContactCard.js +8 -3
  24. package/dist/components/contacts/ContactCardHeader.d.ts +1 -1
  25. package/dist/components/contacts/ContactCardHeader.js +5 -6
  26. package/dist/components/contacts/ContactHeaderMenu.d.ts +2 -0
  27. package/dist/components/contacts/ContactHeaderMenu.js +7 -0
  28. package/dist/components/contacts/ContactsContent.d.ts +1 -1
  29. package/dist/components/contacts/ContactsContent.js +2 -2
  30. package/dist/components/contacts/addEditPanel/AddEditContactPanel.d.ts +2 -0
  31. package/dist/components/contacts/addEditPanel/AddEditContactPanel.js +24 -0
  32. package/dist/components/contacts/addEditPanel/index.d.ts +1 -0
  33. package/dist/components/contacts/addEditPanel/index.js +1 -0
  34. package/dist/components/contacts/index.d.ts +3 -0
  35. package/dist/components/contacts/index.js +3 -0
  36. package/dist/components/contacts/viewPanel/CompanyInfoCard.d.ts +2 -0
  37. package/dist/components/contacts/viewPanel/CompanyInfoCard.js +13 -0
  38. package/dist/components/contacts/viewPanel/CompanyRating.d.ts +3 -0
  39. package/dist/components/contacts/viewPanel/CompanyRating.js +27 -0
  40. package/dist/components/contacts/viewPanel/ContactAddressCard.d.ts +2 -0
  41. package/dist/components/contacts/viewPanel/ContactAddressCard.js +12 -0
  42. package/dist/components/contacts/viewPanel/ContactNotes.d.ts +3 -0
  43. package/dist/components/contacts/viewPanel/ContactNotes.js +8 -0
  44. package/dist/components/contacts/viewPanel/PersonalInfoCard.d.ts +2 -0
  45. package/dist/components/contacts/viewPanel/PersonalInfoCard.js +8 -0
  46. package/dist/components/contacts/viewPanel/RoleTag.d.ts +2 -0
  47. package/dist/components/contacts/viewPanel/RoleTag.js +9 -0
  48. package/dist/components/contacts/viewPanel/ViewContactHeader.d.ts +2 -0
  49. package/dist/components/contacts/viewPanel/ViewContactHeader.js +11 -0
  50. package/dist/components/contacts/viewPanel/ViewContactPanel.d.ts +2 -0
  51. package/dist/components/contacts/viewPanel/ViewContactPanel.js +9 -0
  52. package/dist/components/contacts/viewPanel/index.d.ts +8 -0
  53. package/dist/components/contacts/viewPanel/index.js +8 -0
  54. package/dist/components/forms/dynamicForm/DynamicForm.d.ts +1 -1
  55. package/dist/components/forms/dynamicForm/DynamicForm.js +5 -5
  56. package/dist/components/forms/dynamicForm/SimpleDynamicForm.d.ts +2 -0
  57. package/dist/components/forms/dynamicForm/SimpleDynamicForm.js +29 -0
  58. package/dist/components/forms/dynamicForm/fields/FieldWithDelete.d.ts +1 -1
  59. package/dist/components/forms/dynamicForm/fields/FieldWithDelete.js +2 -3
  60. package/dist/components/forms/dynamicForm/fields/GroupField.d.ts +1 -1
  61. package/dist/components/forms/dynamicForm/fields/GroupField.js +2 -2
  62. package/dist/components/forms/dynamicForm/index.d.ts +1 -1
  63. package/dist/components/forms/dynamicForm/index.js +1 -1
  64. package/dist/components/homeAssistant/panel/ApplianceSteps.d.ts +1 -1
  65. package/dist/components/homeAssistant/panel/ApplianceSteps.js +2 -2
  66. package/dist/components/homeAssistant/panel/HomeAssistantPanel.d.ts +1 -1
  67. package/dist/components/homeAssistant/panel/HomeAssistantPanel.js +14 -7
  68. package/dist/components/homeBoard/HomeBoard.js +1 -1
  69. package/dist/components/homeBoard/HomeCardWithRecipent.d.ts +1 -1
  70. package/dist/components/homeBoard/HomeCardWithRecipent.js +8 -2
  71. package/dist/components/onboarding/pages/ActivateAccount.js +2 -2
  72. package/dist/components/onboarding/pages/BasePageWrapper.d.ts +2 -0
  73. package/dist/components/onboarding/pages/BasePageWrapper.js +5 -0
  74. package/dist/components/onboarding/pages/EmailValidation.js +3 -3
  75. package/dist/components/onboarding/pages/NewPassword.js +2 -2
  76. package/dist/components/onboarding/pages/ResendResetPassword.js +3 -3
  77. package/dist/components/onboarding/pages/ResetPassword.js +2 -2
  78. package/dist/components/onboarding/pages/SignIn.js +2 -2
  79. package/dist/components/onboarding/pages/SignUp.js +5 -5
  80. package/dist/components/onboarding/pages/TwoFactor.js +2 -2
  81. package/dist/components/onboarding/pages/index.d.ts +10 -9
  82. package/dist/components/onboarding/pages/index.js +10 -9
  83. package/dist/components/partner/customPartnerTiles/ShineTile.d.ts +2 -0
  84. package/dist/components/partner/customPartnerTiles/ShineTile.js +56 -0
  85. package/dist/components/partner/customPartnerTiles/index.d.ts +1 -0
  86. package/dist/components/partner/customPartnerTiles/index.js +1 -0
  87. package/dist/helpers/HomeRoles.helper.d.ts +1 -5
  88. package/dist/helpers/HomeRoles.helper.js +6 -0
  89. package/dist/helpers/forms/dynamicForm.helper.js +3 -1
  90. package/dist/hooks/forms/index.d.ts +1 -0
  91. package/dist/hooks/forms/index.js +1 -0
  92. package/dist/hooks/forms/useSimpleDynamicForm.d.ts +11 -0
  93. package/dist/hooks/forms/useSimpleDynamicForm.js +36 -0
  94. package/dist/hooks/myHomes/useMyHomeCard.d.ts +1 -3
  95. package/dist/index.d.ts +1 -1
  96. package/dist/index.js +1 -1
  97. package/dist/interfaces/contacts/AddEditContactPanel.interface.d.ts +12 -0
  98. package/dist/interfaces/contacts/ContactCard.interface.d.ts +15 -1
  99. package/dist/interfaces/contacts/ContactCardInfo.interface.d.ts +2 -1
  100. package/dist/interfaces/contacts/ContactsContent.interface.d.ts +4 -0
  101. package/dist/interfaces/contacts/ViewContactPanel.interface.d.ts +9 -0
  102. package/dist/interfaces/contacts/ViewContactPanel.interface.js +1 -0
  103. package/dist/interfaces/contacts/index.d.ts +2 -0
  104. package/dist/interfaces/contacts/index.js +2 -0
  105. package/dist/interfaces/forms/dynamicForm/DynamicForm.interface.d.ts +9 -7
  106. package/dist/interfaces/forms/dynamicForm/SimpleDynamicForm.interface.d.ts +4 -0
  107. package/dist/interfaces/forms/dynamicForm/SimpleDynamicForm.interface.js +1 -0
  108. package/dist/interfaces/forms/dynamicForm/fields/FieldWithDelete.interface.d.ts +1 -1
  109. package/dist/interfaces/forms/dynamicForm/fields/GroupField.interface.d.ts +1 -1
  110. package/dist/interfaces/forms/dynamicForm/index.d.ts +1 -1
  111. package/dist/interfaces/forms/dynamicForm/index.js +1 -1
  112. package/dist/interfaces/homeAssistant/ApplianceSteps.interface.d.ts +3 -0
  113. package/dist/interfaces/homeAssistant/HomeAssistantPanel.interface.d.ts +4 -1
  114. package/dist/interfaces/homeBoard/HomeCardWithRecipent.interface.d.ts +1 -0
  115. package/dist/mocks/contacts/contacts.mock.js +17 -5
  116. package/dist/mocks/forms/dynamicForm.mock.d.ts +1 -0
  117. package/dist/mocks/forms/dynamicForm.mock.js +155 -0
  118. package/dist/proxies/contacts/contactForm.proxy.d.ts +2 -0
  119. package/dist/proxies/contacts/contactForm.proxy.js +7 -0
  120. package/dist/proxies/contacts/index.d.ts +1 -0
  121. package/dist/proxies/contacts/index.js +1 -0
  122. package/dist/proxies/index.d.ts +1 -0
  123. package/dist/proxies/index.js +1 -0
  124. package/dist/stories/assets/Illustrations.stories.js +2 -2
  125. package/dist/stories/contacts/AddEditContactPanel.stories.d.ts +5 -0
  126. package/dist/stories/contacts/AddEditContactPanel.stories.js +22 -0
  127. package/dist/stories/contacts/ContactCardAddress.stories.d.ts +2 -0
  128. package/dist/stories/contacts/ContactCardInfo.stories.d.ts +2 -0
  129. package/dist/stories/contacts/ViewContactPanel.stories.d.ts +5 -0
  130. package/dist/stories/contacts/ViewContactPanel.stories.js +28 -0
  131. package/dist/stories/homeAssistant/panel/ApplianceSteps.stories.d.ts +1 -1
  132. package/dist/stories/homeAssistant/panel/ApplianceSteps.stories.js +1 -0
  133. package/dist/stories/homeAssistant/panel/HomeAssistantPanel.stories.js +1 -1
  134. package/dist/stories/onboarding/pages/NewPassword.stories.js +2 -3
  135. package/dist/stories/onboarding/pages/ResendResetPassword.stories.js +2 -3
  136. package/dist/stories/onboarding/pages/ResetPassword.stories.js +2 -3
  137. package/dist/stories/onboarding/pages/SignIn.stories.js +2 -3
  138. package/dist/stories/onboarding/pages/SignUp.stories.js +2 -3
  139. package/dist/stories/partner/customPartnerTiles/ShineTile.stories.d.ts +5 -0
  140. package/dist/stories/partner/customPartnerTiles/ShineTile.stories.js +19 -0
  141. package/package.json +1 -1
  142. package/src/assets/images/circle-face.svg +21 -0
  143. package/src/assets/images/company.svg +34 -0
  144. package/src/assets/images/index.ts +7 -0
  145. package/src/assets/images/location.jpg +0 -0
  146. package/src/assets/images/logos/index.ts +12 -1
  147. package/src/assets/images/logos/shine.png +0 -0
  148. package/src/assets/images/shine/gutter-cleaning.png +0 -0
  149. package/src/assets/images/shine/holiday-lights.png +0 -0
  150. package/src/assets/images/shine/home-cleaning.png +0 -0
  151. package/src/assets/images/shine/index.ts +15 -0
  152. package/src/assets/images/shine/pressure.png +0 -0
  153. package/src/assets/images/shine/roof-cleaning.png +0 -0
  154. package/src/assets/images/shine/window.png +0 -0
  155. package/src/assets/locales/en/index.json +23 -1
  156. package/src/components/animations/CloudsAnimation.tsx +8 -7
  157. package/src/components/contacts/ContactCard.tsx +28 -25
  158. package/src/components/contacts/ContactCardHeader.tsx +5 -38
  159. package/src/components/contacts/ContactHeaderMenu.tsx +42 -0
  160. package/src/components/contacts/ContactsContent.tsx +3 -1
  161. package/src/components/contacts/addEditPanel/AddEditContactPanel.tsx +63 -0
  162. package/src/components/contacts/addEditPanel/index.ts +1 -0
  163. package/src/components/contacts/index.ts +3 -0
  164. package/src/components/contacts/viewPanel/CompanyInfoCard.tsx +58 -0
  165. package/src/components/contacts/viewPanel/CompanyRating.tsx +27 -0
  166. package/src/components/contacts/viewPanel/ContactAddressCard.tsx +39 -0
  167. package/src/components/contacts/viewPanel/ContactNotes.tsx +16 -0
  168. package/src/components/contacts/viewPanel/PersonalInfoCard.tsx +41 -0
  169. package/src/components/contacts/viewPanel/RoleTag.tsx +30 -0
  170. package/src/components/contacts/viewPanel/ViewContactHeader.tsx +26 -0
  171. package/src/components/contacts/viewPanel/ViewContactPanel.tsx +70 -0
  172. package/src/components/contacts/viewPanel/index.ts +8 -0
  173. package/src/components/forms/dynamicForm/DynamicForm.tsx +9 -6
  174. package/src/components/forms/dynamicForm/SimpleDynamicForm.tsx +57 -0
  175. package/src/components/forms/dynamicForm/fields/FieldWithDelete.tsx +2 -3
  176. package/src/components/forms/dynamicForm/fields/GroupField.tsx +7 -2
  177. package/src/components/forms/dynamicForm/index.ts +1 -1
  178. package/src/components/homeAssistant/panel/ApplianceSteps.tsx +5 -2
  179. package/src/components/homeAssistant/panel/HomeAssistantPanel.tsx +20 -7
  180. package/src/components/homeBoard/HomeBoard.tsx +3 -0
  181. package/src/components/homeBoard/HomeCardWithRecipent.tsx +15 -1
  182. package/src/components/onboarding/pages/ActivateAccount.tsx +8 -3
  183. package/src/components/onboarding/pages/BasePageWrapper.tsx +10 -0
  184. package/src/components/onboarding/pages/EmailValidation.tsx +3 -3
  185. package/src/components/onboarding/pages/NewPassword.tsx +9 -3
  186. package/src/components/onboarding/pages/ResendResetPassword.tsx +3 -3
  187. package/src/components/onboarding/pages/ResetPassword.tsx +3 -2
  188. package/src/components/onboarding/pages/SignIn.tsx +3 -4
  189. package/src/components/onboarding/pages/SignUp.tsx +9 -8
  190. package/src/components/onboarding/pages/TwoFactor.tsx +9 -3
  191. package/src/components/onboarding/pages/index.ts +10 -9
  192. package/src/components/partner/customPartnerTiles/ShineTile.tsx +148 -0
  193. package/src/components/partner/customPartnerTiles/index.ts +1 -0
  194. package/src/helpers/HomeRoles.helper.ts +7 -1
  195. package/src/helpers/forms/dynamicForm.helper.ts +4 -0
  196. package/src/hooks/forms/index.ts +1 -0
  197. package/src/hooks/forms/useSimpleDynamicForm.ts +58 -0
  198. package/src/index.ts +3 -0
  199. package/src/interfaces/contacts/AddEditContactPanel.interface.ts +14 -0
  200. package/src/interfaces/contacts/ContactCard.interface.ts +20 -1
  201. package/src/interfaces/contacts/ContactCardInfo.interface.ts +3 -2
  202. package/src/interfaces/contacts/ContactsContent.interface.ts +3 -0
  203. package/src/interfaces/contacts/ViewContactPanel.interface.ts +10 -0
  204. package/src/interfaces/contacts/index.ts +2 -0
  205. package/src/interfaces/forms/dynamicForm/DynamicForm.interface.ts +10 -6
  206. package/src/interfaces/forms/dynamicForm/SimpleDynamicForm.interface.ts +5 -0
  207. package/src/interfaces/forms/dynamicForm/fields/FieldWithDelete.interface.ts +1 -1
  208. package/src/interfaces/forms/dynamicForm/fields/GroupField.interface.ts +1 -1
  209. package/src/interfaces/forms/dynamicForm/index.ts +1 -1
  210. package/src/interfaces/homeAssistant/ApplianceSteps.interface.ts +13 -2
  211. package/src/interfaces/homeAssistant/HomeAssistantPanel.interface.ts +4 -1
  212. package/src/interfaces/homeBoard/HomeCardWithRecipent.interface.ts +1 -0
  213. package/src/mocks/contacts/contacts.mock.ts +17 -5
  214. package/src/mocks/forms/dynamicForm.mock.ts +156 -0
  215. package/src/proxies/contacts/contactForm.proxy.ts +9 -0
  216. package/src/proxies/contacts/index.ts +1 -0
  217. package/src/proxies/index.ts +1 -0
  218. package/src/stories/assets/Illustrations.stories.tsx +4 -0
  219. package/src/stories/contacts/AddEditContactPanel.stories.tsx +45 -0
  220. package/src/stories/contacts/ViewContactPanel.stories.tsx +35 -0
  221. package/src/stories/homeAssistant/panel/ApplianceSteps.stories.tsx +2 -1
  222. package/src/stories/homeAssistant/panel/HomeAssistantPanel.stories.tsx +2 -0
  223. package/src/stories/onboarding/pages/NewPassword.stories.tsx +3 -4
  224. package/src/stories/onboarding/pages/ResendResetPassword.stories.tsx +3 -4
  225. package/src/stories/onboarding/pages/ResetPassword.stories.tsx +3 -4
  226. package/src/stories/onboarding/pages/SignIn.stories.tsx +3 -4
  227. package/src/stories/onboarding/pages/SignUp.stories.tsx +3 -4
  228. package/src/stories/partner/customPartnerTiles/ShineTile.stories.tsx +26 -0
  229. package/dist/components/forms/dynamicForm/DynamicFormSimple.d.ts +0 -2
  230. package/dist/components/forms/dynamicForm/DynamicFormSimple.js +0 -32
  231. package/dist/interfaces/forms/dynamicForm/DynamicFormSimple.interface.d.ts +0 -4
  232. package/src/components/forms/dynamicForm/DynamicFormSimple.tsx +0 -66
  233. package/src/interfaces/forms/dynamicForm/DynamicFormSimple.interface.ts +0 -5
  234. /package/dist/interfaces/{forms/dynamicForm/DynamicFormSimple.interface.js → contacts/AddEditContactPanel.interface.js} +0 -0
@@ -1,6 +1,12 @@
1
1
  import { t } from 'i18next'
2
2
  import { Box, Button, Text, Container, Stack, Center } from '@chakra-ui/react'
3
- import { Logo, Footer, ButtonLoader, TextInput } from '@/components'
3
+ import {
4
+ Logo,
5
+ Footer,
6
+ ButtonLoader,
7
+ TextInput,
8
+ BasePageWrapper,
9
+ } from '@/components'
4
10
  import { isEmptyField } from '@/utils'
5
11
  import { TwoFactorI } from '@/interfaces'
6
12
  import { useTwoFactor } from '@/hooks'
@@ -15,7 +21,7 @@ export const TwoFactor = ({
15
21
  useTwoFactor(handleReset)
16
22
 
17
23
  return (
18
- <Box w="container.full" zIndex="2" position="relative">
24
+ <BasePageWrapper>
19
25
  <Container size="onboarding" boxShadow="lg">
20
26
  <Logo />
21
27
  <Stack my="6">
@@ -58,6 +64,6 @@ export const TwoFactor = ({
58
64
  </Box>
59
65
  </Container>
60
66
  <Footer />
61
- </Box>
67
+ </BasePageWrapper>
62
68
  )
63
69
  }
@@ -1,9 +1,10 @@
1
- export * from "./ActivateAccount"
2
- export * from "./EmailValidation"
3
- export * from "./ResetPassword"
4
- export * from "./SignIn"
5
- export * from "./SignUp"
6
- export * from "./Welcome"
7
- export * from "./NewPassword"
8
- export * from "./ResendResetPassword"
9
- export * from "./TwoFactor"
1
+ export * from './ActivateAccount'
2
+ export * from './BasePageWrapper'
3
+ export * from './EmailValidation'
4
+ export * from './ResetPassword'
5
+ export * from './SignIn'
6
+ export * from './SignUp'
7
+ export * from './Welcome'
8
+ export * from './NewPassword'
9
+ export * from './ResendResetPassword'
10
+ export * from './TwoFactor'
@@ -0,0 +1,148 @@
1
+ import { t } from 'i18next'
2
+ import {
3
+ AspectRatio,
4
+ Box,
5
+ Button,
6
+ Image,
7
+ SimpleGrid,
8
+ Stack,
9
+ Text,
10
+ } from '@chakra-ui/react'
11
+ import { PartnerFooter, PartnerHeader, PartnerTileWrapper } from '@/components'
12
+ import { ShortPartnerTileI, SocialLinkI } from '@/interfaces'
13
+ import {
14
+ GutterCleaning,
15
+ HolidayLights,
16
+ HomeCleaning,
17
+ Pressure,
18
+ RoofCleaning,
19
+ Shine,
20
+ WindowCleaning,
21
+ } from '@/assets/images'
22
+ import { ReactNode } from 'react'
23
+
24
+ export const ShineTile = ({
25
+ menuItems,
26
+ }: Pick<ShortPartnerTileI, 'menuItems'>) => {
27
+ const cardsArray = ['pressure', 'window', 'roof', 'lights', 'gutter', 'home']
28
+ return (
29
+ <PartnerTileWrapper>
30
+ <PartnerHeader logo={Shine} partnerName="Shine" menuItems={menuItems} />
31
+ <Box>
32
+ <Stack
33
+ spacing="6"
34
+ bg="neutral.white"
35
+ px="base"
36
+ py="6"
37
+ borderTop="1px solid"
38
+ borderColor="lightBlue.6"
39
+ >
40
+ <Text fontWeight="bold" textAlign="center">
41
+ {t('partner.shine.heroTitle')}
42
+ </Text>
43
+ <SimpleGrid columns={3} spacing="base">
44
+ {cardsArray.map((card) => (
45
+ <ServiceCard key={card} service={card} />
46
+ ))}
47
+ </SimpleGrid>
48
+ </Stack>
49
+
50
+ <Stack spacing="base" p="base">
51
+ <Button
52
+ onClick={() => openNewTab(links.scheduleService)}
53
+ variant="tertiary"
54
+ w="full"
55
+ h="44px"
56
+ >
57
+ {t('partner.shine.scheduleService')}
58
+ </Button>
59
+ </Stack>
60
+ <PartnerFooter
61
+ socialLinks={socialLinks}
62
+ websiteUrl="https://shine-windowcleaning.com/"
63
+ />
64
+ </Box>
65
+ </PartnerTileWrapper>
66
+ )
67
+ }
68
+
69
+ const ServiceCard = ({ service = '' }) => {
70
+ const card = cards[service]
71
+ return (
72
+ <Box
73
+ bg="neutral.white"
74
+ borderRadius="md"
75
+ border="1px solid"
76
+ borderColor="lightBlue.6"
77
+ display="flex"
78
+ flexDirection="column"
79
+ alignItems="center"
80
+ justifyContent="center"
81
+ >
82
+ <Box h="46px" display="flex" alignItems="center">
83
+ {card.image}
84
+ </Box>
85
+ <Box pb="2">
86
+ <Text
87
+ fontWeight="semibold"
88
+ textAlign="center"
89
+ fontSize="13px"
90
+ lineHeight="14px"
91
+ >
92
+ {t(card.title)}
93
+ </Text>
94
+ </Box>
95
+ </Box>
96
+ )
97
+ }
98
+
99
+ const openNewTab = (url: string) => {
100
+ window.open(url, '_blank')
101
+ }
102
+
103
+ const socialLinks: SocialLinkI[] = [
104
+ {
105
+ name: 'linkedin',
106
+ link: 'https://www.linkedin.com/company/shine-window-care-and-holiday-lighting/',
107
+ },
108
+ {
109
+ name: 'facebook',
110
+ link: 'https://www.facebook.com/ShineFranchise',
111
+ },
112
+ ]
113
+
114
+ const links = {
115
+ scheduleService: 'https://shine-windowcleaning.com/',
116
+ website: 'https://shine-windowcleaning.com/',
117
+ }
118
+
119
+ const cards: Record<string, { title: string; image: ReactNode }> = {
120
+ pressure: {
121
+ title: 'partner.shine.services.pressure',
122
+ image: <Image src={Pressure} alt="pressure" w="46px" h="auto" />,
123
+ },
124
+ window: {
125
+ title: 'partner.shine.services.window',
126
+ image: (
127
+ <Image src={WindowCleaning} alt="window-cleaning" w="46px" h="46px" />
128
+ ),
129
+ },
130
+ roof: {
131
+ title: 'partner.shine.services.roof',
132
+ image: <Image src={RoofCleaning} alt="roof-cleaning" w="42px" h="42px" />,
133
+ },
134
+ lights: {
135
+ title: 'partner.shine.services.lights',
136
+ image: <Image src={HolidayLights} alt="holiday-lights" w="auto" h="56px" />,
137
+ },
138
+ gutter: {
139
+ title: 'partner.shine.services.gutter',
140
+ image: (
141
+ <Image src={GutterCleaning} alt="gutter-cleaning" w="auto" h="40px" />
142
+ ),
143
+ },
144
+ home: {
145
+ title: 'partner.shine.services.home',
146
+ image: <Image src={HomeCleaning} alt="home-cleaning" w="auto" h="34px" />,
147
+ },
148
+ }
@@ -1 +1,2 @@
1
1
  export * from './AphwTile'
2
+ export * from './ShineTile'
@@ -15,29 +15,35 @@ export const homeRoleTypes: RoleType[] = [
15
15
  'homeowner',
16
16
  ]
17
17
 
18
- export const homeRoles: { [key: string]: { [key: string]: string } } = {
18
+ export const homeRoles: Record<string, Record<string, string>> = {
19
19
  guest: {
20
20
  bg: 'teal.4',
21
21
  width: '3.5rem',
22
+ name: 'Guest',
22
23
  },
23
24
  member: {
24
25
  bg: 'teal.4',
25
26
  width: '3.5rem',
27
+ name: 'Member',
26
28
  },
27
29
  partner: {
28
30
  bg: '#2F7F9B',
29
31
  width: '4.5rem',
32
+ name: 'Partner',
30
33
  },
31
34
  contributor: {
32
35
  bg: '#2F7F9B',
33
36
  width: '6rem',
37
+ name: 'Contributor',
34
38
  },
35
39
  manager: {
36
40
  bg: '#1A72D9',
37
41
  width: '5rem',
42
+ name: 'Manager',
38
43
  },
39
44
  homeowner: {
40
45
  bg: '#535C51',
41
46
  width: '6rem',
47
+ name: 'Homeowner',
42
48
  },
43
49
  }
@@ -39,6 +39,8 @@ import {
39
39
  GlassWater,
40
40
  Roof2,
41
41
  Target,
42
+ CircleFace,
43
+ Company,
42
44
  } from '@/assets/images'
43
45
  import { IconTypes } from '@/interfaces'
44
46
 
@@ -84,4 +86,6 @@ export const fieldIcons: Record<IconTypes, string> = {
84
86
  water: GlassWater,
85
87
  house: Structure,
86
88
  target: Target,
89
+ title: CircleFace,
90
+ company: Company,
87
91
  }
@@ -1,2 +1,3 @@
1
1
  export * from './useAddressStored'
2
2
  export * from './useDynamicForm'
3
+ export * from './useSimpleDynamicForm'
@@ -0,0 +1,58 @@
1
+ import { useEffect } from 'react'
2
+ import { FieldValues, useForm } from 'react-hook-form'
3
+ import { FolderFileI, ReportI } from '@/interfaces'
4
+
5
+ interface UseDynamicFormI {
6
+ fields: ReportI[]
7
+ onUpload?: (filesByFieldId: Record<string, FolderFileI[]>) => void
8
+ }
9
+
10
+ export const useSimpleDynamicForm = ({ fields }: UseDynamicFormI) => {
11
+ const form = useForm()
12
+
13
+ const { watch, setValue } = form
14
+
15
+ const fieldValues = watch()
16
+
17
+ const parseCurrenyValue = (value: string | number): number => {
18
+ if (typeof value === 'number') return value
19
+ const justNumbers = value?.replace(/[^0-9.]/g, '')
20
+ return parseFloat(justNumbers)
21
+ }
22
+
23
+ const handleUpdateFields = (
24
+ field: ReportI,
25
+ fieldValues: FieldValues
26
+ ): ReportI => {
27
+ const value = fieldValues[field.id]
28
+ const isCurrency = field.type === 'currency'
29
+ const parsedValue = isCurrency ? parseCurrenyValue(value) : value
30
+
31
+ return {
32
+ ...field,
33
+ value: parsedValue,
34
+ children: field?.children?.map((child) =>
35
+ handleUpdateFields(child, fieldValues)
36
+ ),
37
+ }
38
+ }
39
+ const updatedFields = fields.map((field) => {
40
+ return handleUpdateFields(field, fieldValues)
41
+ })
42
+
43
+ const handleSetDefaultValues = (fields: ReportI[]) => {
44
+ fields.forEach((field) => {
45
+ setValue(field.id, field.value)
46
+ handleSetDefaultValues(field.children || [])
47
+ })
48
+ }
49
+
50
+ useEffect(() => {
51
+ handleSetDefaultValues(fields)
52
+ }, [JSON.stringify(fields)])
53
+
54
+ return {
55
+ form,
56
+ updatedFields,
57
+ }
58
+ }
package/src/index.ts CHANGED
@@ -2,6 +2,7 @@ export {
2
2
  ActivateAccount,
3
3
  ActiveSubscription,
4
4
  AddCardBanner,
5
+ AddEditContactPanel,
5
6
  AddFolder,
6
7
  AddHomeContent,
7
8
  AddHomeItem,
@@ -155,6 +156,7 @@ export {
155
156
  ShareHome,
156
157
  ShareHomeConnections,
157
158
  ShareHomeForm,
159
+ ShineTile,
158
160
  ShortPartnerTile,
159
161
  SignIn,
160
162
  SignUp,
@@ -180,6 +182,7 @@ export {
180
182
  UpdateList,
181
183
  UserDetails,
182
184
  ValueMonitor,
185
+ ViewContactPanel,
183
186
  VideoPlayer,
184
187
  VideoPlayerModal,
185
188
  WellDone,
@@ -0,0 +1,14 @@
1
+ import { ReactNode } from 'react'
2
+ import { ReportI } from '@/interfaces'
3
+
4
+ export interface AddEditContactPanelI {
5
+ detailsComponent: ReactNode
6
+ isEditing?: boolean
7
+ onBackClick: () => void
8
+ permissionsComponent: ReactNode
9
+ }
10
+
11
+ export interface ContactFormProxyI {
12
+ fields: ReportI[]
13
+ setFields(fields: ReportI[]): void
14
+ }
@@ -1,10 +1,27 @@
1
- import { MenuItemI, ShareContactPopoverI } from '@/interfaces'
1
+ import {
2
+ MenuItemI,
3
+ ShareContactPopoverI,
4
+ ContactAndIndexForm,
5
+ } from '@/interfaces'
6
+
7
+ export interface ContactCompanyInfoI {
8
+ address: string
9
+ city: string
10
+ company: string
11
+ url: string
12
+ _id: string
13
+ phone: string
14
+ state: string
15
+ zip: string
16
+ rating?: number
17
+ }
2
18
 
3
19
  export interface InfoContactCardI {
4
20
  address: string
5
21
  category: string
6
22
  city: string
7
23
  company: string
24
+ companyInfo?: ContactCompanyInfoI
8
25
  email: string
9
26
  firstName: string
10
27
  _id: string
@@ -13,6 +30,7 @@ export interface InfoContactCardI {
13
30
  state: string
14
31
  title: string
15
32
  zip: string
33
+ notes?: string
16
34
  }
17
35
 
18
36
  export interface ContactCardI {
@@ -20,5 +38,6 @@ export interface ContactCardI {
20
38
  contact: InfoContactCardI
21
39
  index: number
22
40
  menuItems: MenuItemI[]
41
+ onClick?: (contact: ContactAndIndexForm) => void
23
42
  onShare: ShareContactPopoverI['onShare']
24
43
  }
@@ -1,8 +1,9 @@
1
1
  export interface ContactCardInfoI {
2
- company: string
2
+ company?: string
3
3
  email: string
4
4
  firstName: string
5
5
  index: number
6
6
  lastName: string
7
7
  phone: string
8
- }
8
+ title?: string
9
+ }
@@ -1,6 +1,8 @@
1
1
  import { InfoContactCardI, MenuItemI, ShareContactPopoverI } from '@/interfaces'
2
2
  import { ReactNode } from 'react'
3
3
 
4
+ export type ContactAndIndexForm = InfoContactCardI & { index: number }
5
+
4
6
  export interface ContactsContentI {
5
7
  apiError?: boolean
6
8
  contacts: InfoContactCardI[]
@@ -9,5 +11,6 @@ export interface ContactsContentI {
9
11
  menuItems: MenuItemI[]
10
12
  children?: ReactNode
11
13
  disabled?: boolean
14
+ onClick?: (contact: ContactAndIndexForm) => void
12
15
  onShare: ShareContactPopoverI['onShare']
13
16
  }
@@ -0,0 +1,10 @@
1
+ import { RoleType } from '@/helpers'
2
+ import { InfoContactCardI, MenuItemI, ShareContactPopoverI } from '@/interfaces'
3
+
4
+ export interface ViewContactPanelI {
5
+ contact: InfoContactCardI
6
+ handleClose: () => void
7
+ menuItems: MenuItemI[]
8
+ onShare: ShareContactPopoverI['onShare']
9
+ roleType: RoleType
10
+ }
@@ -1,3 +1,4 @@
1
+ export * from './AddEditContactPanel.interface'
1
2
  export * from './ContactCard.interface'
2
3
  export * from './ContactCardAddress.interface'
3
4
  export * from './ContactCardHeader.interface'
@@ -5,3 +6,4 @@ export * from './ContactCardInfo.interface'
5
6
  export * from './ContactsContent.interface'
6
7
  export * from './ShareContactByEmail.interface'
7
8
  export * from './ShareContactPopover.interface'
9
+ export * from './ViewContactPanel.interface'
@@ -61,26 +61,30 @@ export type IconTypes =
61
61
  | 'plate'
62
62
  | 'house'
63
63
  | 'target'
64
+ | 'title'
65
+ | 'company'
64
66
 
65
67
  export type ValueTypes = string | string[] | number | boolean
66
68
  export type OptionsTypes = string[] | number[] | null
67
69
 
68
70
  export interface ReportI {
71
+ canBeHidden?: boolean
72
+ children?: ReportI[]
73
+ comments?: string
74
+ description?: string
75
+ icon?: IconTypes
69
76
  id: string
70
77
  name?: string
71
- description?: string
72
- comments?: string
73
- value: ValueTypes
78
+ options?: OptionsTypes
74
79
  type: KindTypes
80
+ value: ValueTypes
75
81
  visible?: boolean
76
- options?: OptionsTypes
77
- children?: ReportI[]
78
- icon?: IconTypes
79
82
  }
80
83
 
81
84
  export interface DynamicFormI {
82
85
  form: ReportI[]
83
86
  onUpload?: (filesByFieldId: Record<string, FolderFileI[]>) => void
87
+ showTitle?: boolean
84
88
  uploadingFieldId?: string
85
89
  }
86
90
 
@@ -0,0 +1,5 @@
1
+ import { ReportI } from '@/interfaces'
2
+
3
+ export interface SimpleDynamicFormI {
4
+ fields: ReportI[]
5
+ }
@@ -1,5 +1,5 @@
1
1
  export interface FieldWithDeleteI {
2
2
  id: string
3
3
  onRemove?: (id: string) => void
4
- isAlwaysVisible?: boolean
4
+ canBeHidden?: boolean
5
5
  }
@@ -2,7 +2,7 @@ import { DynamicFormI } from '@/interfaces'
2
2
 
3
3
  export interface GroupFieldI {
4
4
  id: string
5
+ canBeHidden?: boolean
5
6
  fields?: DynamicFormI['form']
6
7
  onRemove: (id: string) => void
7
- visible?: boolean
8
8
  }
@@ -1,6 +1,6 @@
1
1
  export * from './edit'
2
2
  export * from './fields'
3
3
  export * from './DynamicForm.interface'
4
- export * from './DynamicFormSimple.interface'
4
+ export * from './SimpleDynamicForm.interface'
5
5
  export * from './HiddenField.interface'
6
6
  export * from './HiddenFieldSection.interface'
@@ -1,5 +1,16 @@
1
- import { ApplianceStepI } from '@/interfaces'
2
-
3
1
  export interface ApplianceStepsI {
2
+ addedAppliances?: AppliancesType[]
4
3
  onClick: (selectedSteps: string[]) => void
5
4
  }
5
+
6
+ type AppliancesType =
7
+ | 'fridge'
8
+ | 'freezer'
9
+ | 'washer'
10
+ | 'dryer'
11
+ | 'dish-washer'
12
+ | 'cook-top'
13
+ | 'oven'
14
+ | 'range'
15
+ | 'hood'
16
+ | 'microwave'
@@ -1,4 +1,4 @@
1
- import { DynamicFormI } from '@/interfaces'
1
+ import { DynamicFormI, ReportI } from '@/interfaces'
2
2
 
3
3
  export interface HomeAssistantPanelI {
4
4
  currentForm: DynamicFormI['form']
@@ -7,4 +7,7 @@ export interface HomeAssistantPanelI {
7
7
  onBack: () => void
8
8
  onClose: () => void
9
9
  onNext: () => void
10
+ onSave: (form: ReportI[]) => void
11
+ backDisabled: boolean
12
+ nextDisabled: boolean
10
13
  }
@@ -36,4 +36,5 @@ export interface HomeCardWithRecipentI {
36
36
  recipients?: AssociatedAccountI[]
37
37
  records?: HomeCardRecordsI
38
38
  disabled?: boolean
39
+ propertyDisabled?: boolean
39
40
  }
@@ -9,12 +9,24 @@ export const ContactsMock: InfoContactCardI[] = [
9
9
  lastName: faker.person.lastName(),
10
10
  email: faker.internet.email(),
11
11
  phone: faker.phone.number(),
12
- company: 'Company 1',
13
- address: '1134 South First Avenue',
14
- zip: '78732',
15
- city: 'Austin',
16
- state: 'TX',
12
+ company: faker.company.name(),
13
+ address: faker.location.streetAddress(),
14
+ zip: faker.location.zipCode(),
15
+ city: faker.location.city(),
16
+ state: faker.location.state(),
17
17
  _id: faker.database.mongodbObjectId(),
18
+ notes: faker.lorem.paragraphs(),
19
+ companyInfo: {
20
+ address: faker.location.streetAddress(),
21
+ city: faker.location.city(),
22
+ company: faker.company.name(),
23
+ url: faker.internet.url(),
24
+ _id: faker.database.mongodbObjectId(),
25
+ phone: faker.phone.number(),
26
+ state: faker.location.state(),
27
+ zip: faker.location.zipCode(),
28
+ rating: faker.number.int({ min: 1, max: 5 }),
29
+ },
18
30
  },
19
31
  {
20
32
  title: 'Pumpler',