@homefile/components-v2 2.31.1 → 2.33.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.
- package/dist/assets/images/flower.svg +19 -0
- package/dist/assets/images/index.d.ts +3 -1
- package/dist/assets/images/index.js +3 -1
- package/dist/assets/images/index.ts +4 -0
- package/dist/assets/images/magnifying-glass-person.svg +18 -0
- package/dist/components/forms/dynamicForm/DynamicForm.js +3 -1
- package/dist/components/forms/dynamicForm/fields/HomeInitialSetup.d.ts +2 -0
- package/dist/components/forms/dynamicForm/fields/HomeInitialSetup.js +17 -0
- package/dist/components/forms/dynamicForm/fields/index.d.ts +1 -0
- package/dist/components/forms/dynamicForm/fields/index.js +1 -0
- package/dist/components/homeAssistant/HomeAssistantButton.js +2 -2
- package/dist/components/homeAssistant/HomeAssistantSteps.js +1 -7
- package/dist/components/homeAssistant/index.d.ts +1 -0
- package/dist/components/homeAssistant/index.js +1 -0
- package/dist/components/homeAssistant/wizard/HomeAssistantWizardButton.d.ts +2 -0
- package/dist/components/homeAssistant/wizard/HomeAssistantWizardButton.js +29 -0
- package/dist/components/homeAssistant/wizard/HomeAssistantWizardSteps.d.ts +2 -0
- package/dist/components/homeAssistant/wizard/HomeAssistantWizardSteps.js +8 -0
- package/dist/components/homeAssistant/wizard/index.d.ts +2 -0
- package/dist/components/homeAssistant/wizard/index.js +2 -0
- package/dist/components/sendDocument/RecipientContent.js +1 -1
- package/dist/components/wizard/WizardInitialOptions.d.ts +2 -0
- package/dist/components/wizard/WizardInitialOptions.js +40 -0
- package/dist/components/wizard/WizardTextBody.d.ts +2 -0
- package/dist/components/wizard/WizardTextBody.js +5 -0
- package/dist/components/wizard/index.d.ts +2 -0
- package/dist/components/wizard/index.js +2 -0
- package/dist/helpers/forms/dynamicForm.helper.js +7 -2
- package/dist/helpers/homeAssistant/HomeAssistant.helper.d.ts +1 -0
- package/dist/helpers/homeAssistant/HomeAssistant.helper.js +23 -1
- package/dist/interfaces/forms/dynamicForm/DynamicForm.interface.d.ts +3 -2
- package/dist/interfaces/forms/dynamicForm/fields/UIFields.interface.d.ts +1 -1
- package/dist/interfaces/homeAssistant/HomeAssistantButton.interface.d.ts +2 -2
- package/dist/mocks/forms/dynamicForm.mock.d.ts +1 -0
- package/dist/mocks/forms/dynamicForm.mock.js +71 -0
- package/dist/stories/assets/Illustrations.stories.js +2 -2
- package/dist/stories/wizard/ControlledWizard.stories.js +20 -6
- package/dist/utils/Styles.utils.d.ts +1 -0
- package/dist/utils/Styles.utils.js +7 -0
- package/package.json +1 -1
- package/src/assets/images/flower.svg +19 -0
- package/src/assets/images/index.ts +4 -0
- package/src/assets/images/magnifying-glass-person.svg +18 -0
- package/src/components/forms/dynamicForm/DynamicForm.tsx +10 -0
- package/src/components/forms/dynamicForm/fields/HomeInitialSetup.tsx +34 -0
- package/src/components/forms/dynamicForm/fields/index.ts +1 -0
- package/src/components/homeAssistant/HomeAssistantButton.tsx +2 -2
- package/src/components/homeAssistant/HomeAssistantSteps.tsx +1 -6
- package/src/components/homeAssistant/index.ts +1 -0
- package/src/components/homeAssistant/wizard/HomeAssistantWizardButton.tsx +87 -0
- package/src/components/homeAssistant/wizard/HomeAssistantWizardSteps.tsx +28 -0
- package/src/components/homeAssistant/wizard/index.ts +2 -0
- package/src/components/sendDocument/RecipientContent.tsx +1 -4
- package/src/components/wizard/WizardInitialOptions.tsx +110 -0
- package/src/components/wizard/WizardTextBody.tsx +23 -0
- package/src/components/wizard/index.ts +2 -0
- package/src/helpers/forms/dynamicForm.helper.ts +12 -2
- package/src/helpers/homeAssistant/HomeAssistant.helper.tsx +25 -0
- package/src/interfaces/forms/dynamicForm/DynamicForm.interface.ts +32 -20
- package/src/interfaces/forms/dynamicForm/fields/UIFields.interface.ts +1 -1
- package/src/interfaces/homeAssistant/HomeAssistantButton.interface.ts +2 -2
- package/src/mocks/forms/dynamicForm.mock.ts +79 -0
- package/src/stories/assets/Illustrations.stories.tsx +4 -0
- package/src/stories/wizard/ControlledWizard.stories.tsx +42 -4
- package/src/utils/Styles.utils.ts +6 -0
|
@@ -74,7 +74,12 @@ import {
|
|
|
74
74
|
MRHand,
|
|
75
75
|
MRMakeReady,
|
|
76
76
|
MRRental,
|
|
77
|
-
Cleaning
|
|
77
|
+
Cleaning,
|
|
78
|
+
GearTime,
|
|
79
|
+
YellowFolder,
|
|
80
|
+
Warranty,
|
|
81
|
+
Flower,
|
|
82
|
+
MagnifyingGlassPerson,
|
|
78
83
|
} from '@/assets/images'
|
|
79
84
|
import { IconTypes } from '@/interfaces'
|
|
80
85
|
|
|
@@ -123,12 +128,17 @@ export const fieldIcons: Record<IconTypes, string> = {
|
|
|
123
128
|
pool: Pool2,
|
|
124
129
|
roof: Roof2,
|
|
125
130
|
umbrella: Closet,
|
|
131
|
+
warranty: Warranty,
|
|
126
132
|
water: GlassWater,
|
|
127
133
|
house: Structure,
|
|
128
134
|
target: Target,
|
|
129
135
|
title: CircleFace,
|
|
130
136
|
company: Company2,
|
|
131
137
|
wallet: Wallet,
|
|
138
|
+
gear: GearTime,
|
|
139
|
+
folder: YellowFolder,
|
|
140
|
+
flower: Flower,
|
|
141
|
+
'search-person': MagnifyingGlassPerson,
|
|
132
142
|
'sh-gutter': GutterCleaning,
|
|
133
143
|
'sh-home': HomeCleaning,
|
|
134
144
|
'sh-house': HouseWashing,
|
|
@@ -155,5 +165,5 @@ export const fieldIcons: Record<IconTypes, string> = {
|
|
|
155
165
|
'mr-hand': MRHand,
|
|
156
166
|
'mr-make-ready': MRMakeReady,
|
|
157
167
|
'mr-rental': MRRental,
|
|
158
|
-
|
|
168
|
+
cleaning: Cleaning,
|
|
159
169
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Fire,
|
|
3
|
+
Fridge,
|
|
3
4
|
GearTime,
|
|
4
5
|
House,
|
|
5
6
|
LargeAppliances,
|
|
7
|
+
Patio,
|
|
6
8
|
Target,
|
|
7
9
|
Temperature,
|
|
8
10
|
Water,
|
|
@@ -37,6 +39,29 @@ export const homeAssistantSteps: Array<HomeAssistantStepI> = [
|
|
|
37
39
|
},
|
|
38
40
|
]
|
|
39
41
|
|
|
42
|
+
export const homeAssistantWizardSteps: Array<HomeAssistantStepI> = [
|
|
43
|
+
{
|
|
44
|
+
title: 'Objectives',
|
|
45
|
+
icon: Target,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
title: 'Smoke & CO2 detectors',
|
|
49
|
+
icon: Fire,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
title: 'Appliances',
|
|
53
|
+
icon: Fridge,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
title: 'Heating & Cooling',
|
|
57
|
+
icon: Temperature,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
title: 'Landscape',
|
|
61
|
+
icon: Patio,
|
|
62
|
+
},
|
|
63
|
+
]
|
|
64
|
+
|
|
40
65
|
interface CategoryConfigI {
|
|
41
66
|
label: string
|
|
42
67
|
icon: string
|
|
@@ -38,6 +38,7 @@ export type KindTypes =
|
|
|
38
38
|
| HomeItemTypes
|
|
39
39
|
| AlertTabType
|
|
40
40
|
| AlertFieldType
|
|
41
|
+
| WizardTypes
|
|
41
42
|
|
|
42
43
|
export type UIKindTypes =
|
|
43
44
|
| 'tile-body'
|
|
@@ -61,56 +62,61 @@ export type HomeItemTypes =
|
|
|
61
62
|
| 'item-icon-btn'
|
|
62
63
|
|
|
63
64
|
export type IconTypes =
|
|
65
|
+
| '68'
|
|
64
66
|
| 'barcode'
|
|
65
67
|
| 'battery'
|
|
66
68
|
| 'billing'
|
|
67
|
-
| 'book'
|
|
68
69
|
| 'book-opened'
|
|
70
|
+
| 'book'
|
|
69
71
|
| 'calc'
|
|
72
|
+
| 'calendar-drop'
|
|
70
73
|
| 'calendar'
|
|
74
|
+
| 'calendar2'
|
|
71
75
|
| 'check'
|
|
72
76
|
| 'co2'
|
|
77
|
+
| 'company'
|
|
73
78
|
| 'contact'
|
|
74
79
|
| 'date'
|
|
75
80
|
| 'default'
|
|
76
81
|
| 'detector'
|
|
82
|
+
| 'drop'
|
|
77
83
|
| 'electricity'
|
|
78
84
|
| 'fire'
|
|
85
|
+
| 'flower'
|
|
86
|
+
| 'folder'
|
|
87
|
+
| 'foundation'
|
|
88
|
+
| 'gear'
|
|
79
89
|
| 'goldbars'
|
|
80
90
|
| 'heart'
|
|
91
|
+
| 'heater'
|
|
92
|
+
| 'house'
|
|
81
93
|
| 'image'
|
|
82
94
|
| 'life-preserver'
|
|
95
|
+
| 'light'
|
|
96
|
+
| 'mobile-drop'
|
|
83
97
|
| 'notes'
|
|
84
98
|
| 'palette'
|
|
85
|
-
| 'plant'
|
|
86
99
|
| 'people'
|
|
100
|
+
| 'plant'
|
|
101
|
+
| 'plate'
|
|
102
|
+
| 'pool'
|
|
103
|
+
| 'pressure-washer'
|
|
87
104
|
| 'price'
|
|
88
105
|
| 'rating'
|
|
89
106
|
| 'receipt'
|
|
90
107
|
| 'registry'
|
|
91
|
-
| 'sprinkler'
|
|
92
|
-
| 'tools'
|
|
93
|
-
| 'wind'
|
|
94
|
-
| '68'
|
|
95
|
-
| 'calendar2'
|
|
96
|
-
| 'water'
|
|
97
|
-
| 'calendar-drop'
|
|
98
|
-
| 'umbrella'
|
|
99
|
-
| 'heater'
|
|
100
108
|
| 'roof'
|
|
101
|
-
| '
|
|
109
|
+
| 'search-person'
|
|
102
110
|
| 'solar-panel'
|
|
103
|
-
| '
|
|
104
|
-
| 'drop'
|
|
105
|
-
| 'mobile-drop'
|
|
106
|
-
| 'light'
|
|
107
|
-
| 'plate'
|
|
108
|
-
| 'pressure-washer'
|
|
109
|
-
| 'house'
|
|
111
|
+
| 'sprinkler'
|
|
110
112
|
| 'target'
|
|
111
113
|
| 'title'
|
|
112
|
-
| '
|
|
114
|
+
| 'tools'
|
|
115
|
+
| 'umbrella'
|
|
113
116
|
| 'wallet'
|
|
117
|
+
| 'warranty'
|
|
118
|
+
| 'water'
|
|
119
|
+
| 'wind'
|
|
114
120
|
| UIIconTypes
|
|
115
121
|
|
|
116
122
|
export type UIIconTypes =
|
|
@@ -136,6 +142,12 @@ export type UIIconTypes =
|
|
|
136
142
|
| 'filter-size'
|
|
137
143
|
| string
|
|
138
144
|
|
|
145
|
+
export type WizardTypes =
|
|
146
|
+
| 'home-wizard'
|
|
147
|
+
| 'home-wizard-header'
|
|
148
|
+
| 'home-wizard-initial-setup'
|
|
149
|
+
| 'home-wizard-step-options'
|
|
150
|
+
|
|
139
151
|
export type ValueTypes = string | string[] | number | boolean
|
|
140
152
|
export type OptionsTypes = string[] | number[] | null
|
|
141
153
|
|
|
@@ -4,8 +4,8 @@ export interface HomeAssistantStepI {
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
export interface HomeAssistantButtonI {
|
|
7
|
-
currentStep
|
|
8
|
-
onStepClick
|
|
7
|
+
currentStep?: number
|
|
8
|
+
onStepClick?: (step: number) => void
|
|
9
9
|
status: 'completed' | 'active' | 'pending'
|
|
10
10
|
step: HomeAssistantStepI
|
|
11
11
|
}
|
|
@@ -1309,3 +1309,82 @@ export const homeItemDetails: ReportI[] = [
|
|
|
1309
1309
|
icon: 'barcode',
|
|
1310
1310
|
},
|
|
1311
1311
|
]
|
|
1312
|
+
|
|
1313
|
+
export const homeWizardForm: ReportI[] = [
|
|
1314
|
+
{
|
|
1315
|
+
type: 'home-wizard',
|
|
1316
|
+
id: 'home-wizard-1',
|
|
1317
|
+
children: [
|
|
1318
|
+
{
|
|
1319
|
+
type: 'home-wizard-header',
|
|
1320
|
+
id: 'home-wizard-header-1',
|
|
1321
|
+
label: '1. Tell Homi about your goals.',
|
|
1322
|
+
description:
|
|
1323
|
+
'These choices help Homi build a personalized Homeboard that tracks your home’s performance, savings, and priorities.',
|
|
1324
|
+
value: '',
|
|
1325
|
+
},
|
|
1326
|
+
{
|
|
1327
|
+
type: 'home-wizard-initial-setup',
|
|
1328
|
+
id: 'home-wizard-initial-setup-1',
|
|
1329
|
+
value: 'What do you want Homie to help you with?',
|
|
1330
|
+
children: [
|
|
1331
|
+
{
|
|
1332
|
+
id: 'maintenance',
|
|
1333
|
+
type: 'text',
|
|
1334
|
+
label: 'Maintenance',
|
|
1335
|
+
value: false,
|
|
1336
|
+
description:
|
|
1337
|
+
'Stay ahead of maintenance and upkeep to avoid costly repairs.',
|
|
1338
|
+
icon: 'gear',
|
|
1339
|
+
},
|
|
1340
|
+
{
|
|
1341
|
+
id: 'documentation',
|
|
1342
|
+
type: 'text',
|
|
1343
|
+
label: 'documentation',
|
|
1344
|
+
value: false,
|
|
1345
|
+
description:
|
|
1346
|
+
'Keep receipts, warranties, and records organized and accessible.',
|
|
1347
|
+
icon: 'folder',
|
|
1348
|
+
},
|
|
1349
|
+
{
|
|
1350
|
+
id: 'finance',
|
|
1351
|
+
type: 'text',
|
|
1352
|
+
label: 'Finance',
|
|
1353
|
+
value: false,
|
|
1354
|
+
description:
|
|
1355
|
+
'Monitor spending, uncover savings, and plan smarter budgets.',
|
|
1356
|
+
icon: 'check',
|
|
1357
|
+
},
|
|
1358
|
+
{
|
|
1359
|
+
id: 'service-pros',
|
|
1360
|
+
type: 'text',
|
|
1361
|
+
label: 'Service Pros',
|
|
1362
|
+
value: false,
|
|
1363
|
+
description:
|
|
1364
|
+
'Find trusted pros with upfront pricing and verified quality.',
|
|
1365
|
+
icon: 'search-person',
|
|
1366
|
+
},
|
|
1367
|
+
{
|
|
1368
|
+
id: 'improvements',
|
|
1369
|
+
type: 'text',
|
|
1370
|
+
label: 'Improvements',
|
|
1371
|
+
value: false,
|
|
1372
|
+
description:
|
|
1373
|
+
'Track upgrades, costs, and ROI to grow your home’s worth.',
|
|
1374
|
+
icon: 'flower',
|
|
1375
|
+
},
|
|
1376
|
+
{
|
|
1377
|
+
id: 'insurance',
|
|
1378
|
+
type: 'text',
|
|
1379
|
+
label: 'Insurance',
|
|
1380
|
+
value: false,
|
|
1381
|
+
description:
|
|
1382
|
+
'Verify insurance and warranties so nothing important slips through.',
|
|
1383
|
+
icon: 'warranty',
|
|
1384
|
+
},
|
|
1385
|
+
],
|
|
1386
|
+
},
|
|
1387
|
+
],
|
|
1388
|
+
value: true,
|
|
1389
|
+
},
|
|
1390
|
+
]
|
|
@@ -63,6 +63,7 @@ import {
|
|
|
63
63
|
Finance,
|
|
64
64
|
Fire,
|
|
65
65
|
Flag,
|
|
66
|
+
Flower,
|
|
66
67
|
Flooring,
|
|
67
68
|
FormSent,
|
|
68
69
|
Foundation,
|
|
@@ -100,6 +101,7 @@ import {
|
|
|
100
101
|
LivingRoom,
|
|
101
102
|
LogoSmall,
|
|
102
103
|
MagnifyingGlassReport,
|
|
104
|
+
MagnifyingGlassPerson,
|
|
103
105
|
Manager,
|
|
104
106
|
MasterBedroom,
|
|
105
107
|
Mattress,
|
|
@@ -323,6 +325,7 @@ export const Illustrations = () => {
|
|
|
323
325
|
<IconWrapper icon={FileUploading} name="FileUploading" />
|
|
324
326
|
<IconWrapper icon={Finance} name="Finance" />
|
|
325
327
|
<IconWrapper icon={Flag} name="Flag" />
|
|
328
|
+
<IconWrapper icon={Flower} name="Flower" />
|
|
326
329
|
<IconWrapper icon={FormSent} name="FormSent" />
|
|
327
330
|
<IconWrapper icon={Foundation} name="Foundation" />
|
|
328
331
|
<IconWrapper icon={Garage} name="Garage" />
|
|
@@ -353,6 +356,7 @@ export const Illustrations = () => {
|
|
|
353
356
|
<IconWrapper icon={LivingRoom} name="LivingRoom" />
|
|
354
357
|
<IconWrapper icon={LogoSmall} name="LogoSmall" />
|
|
355
358
|
<IconWrapper icon={MagnifyingGlassReport} name="MagnifyingGlassReport" />
|
|
359
|
+
<IconWrapper icon={MagnifyingGlassPerson} name="MagnifyingGlassPerson" />
|
|
356
360
|
<IconWrapper icon={Manager} name="Manager" />
|
|
357
361
|
<IconWrapper icon={MasterBedroom} name="MasterBedroom" />
|
|
358
362
|
<IconWrapper icon={Member} name="Member" />
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
+
import { useState } from 'react'
|
|
1
2
|
import { Meta } from '@storybook/react'
|
|
2
3
|
import {
|
|
3
4
|
ConfirmProperty,
|
|
4
5
|
ControlledWizard,
|
|
6
|
+
DynamicForm,
|
|
7
|
+
FooterButtons,
|
|
5
8
|
HomeAssistantTutorial,
|
|
9
|
+
HomeAssistantWizardSteps,
|
|
6
10
|
MyHomeDetails,
|
|
7
11
|
SearchRecords,
|
|
8
12
|
WizardTextHeader,
|
|
9
13
|
} from '@/components'
|
|
10
|
-
import { Box, Center } from '@chakra-ui/react'
|
|
11
|
-
import {
|
|
14
|
+
import { Box, Center, Stack } from '@chakra-ui/react'
|
|
15
|
+
import { action } from '@storybook/addon-actions'
|
|
12
16
|
import { formValues } from '@/helpers'
|
|
13
|
-
import { propertiesMock } from '@/mocks'
|
|
17
|
+
import { homeWizardForm, propertiesMock } from '@/mocks'
|
|
14
18
|
import { ControlledWizardI, HomeFormI } from '@/interfaces'
|
|
15
19
|
import { WizardSuccessHeader } from '@/components/wizard/WizardSuccessHeader'
|
|
16
20
|
|
|
@@ -32,11 +36,45 @@ function fakeLookup() {
|
|
|
32
36
|
|
|
33
37
|
export const ControlledWizardComponent = () => {
|
|
34
38
|
const [step, setStep] = useState(0)
|
|
39
|
+
const homeAssistantSteps = homeWizardForm.map((form, index) => ({
|
|
40
|
+
header: <HomeAssistantWizardSteps currentStep={index + 1} />,
|
|
41
|
+
body: () => (
|
|
42
|
+
<Stack
|
|
43
|
+
h="full"
|
|
44
|
+
spacing="10"
|
|
45
|
+
w={{ base: 'full', md: '600px' }}
|
|
46
|
+
justify="space-around"
|
|
47
|
+
m="auto"
|
|
48
|
+
>
|
|
49
|
+
<DynamicForm
|
|
50
|
+
form={[form]}
|
|
51
|
+
showTitle={false}
|
|
52
|
+
callback={action('DynamicForm')}
|
|
53
|
+
/>
|
|
54
|
+
<Box alignSelf="flex-end">
|
|
55
|
+
<FooterButtons
|
|
56
|
+
button1={{
|
|
57
|
+
buttonStyle: 'secondaryFooter',
|
|
58
|
+
onClick: () => setStep(step - 1),
|
|
59
|
+
label: 'Back',
|
|
60
|
+
}}
|
|
61
|
+
button2={{
|
|
62
|
+
buttonStyle: 'tertiaryFooter',
|
|
63
|
+
onClick: () => setStep(step + 1),
|
|
64
|
+
label: 'Save selection',
|
|
65
|
+
}}
|
|
66
|
+
/>
|
|
67
|
+
</Box>
|
|
68
|
+
</Stack>
|
|
69
|
+
),
|
|
70
|
+
}))
|
|
35
71
|
return (
|
|
36
72
|
<ControlledWizard
|
|
73
|
+
minHeight="700px"
|
|
37
74
|
step={step}
|
|
38
75
|
setStep={setStep}
|
|
39
76
|
steps={[
|
|
77
|
+
...homeAssistantSteps,
|
|
40
78
|
{
|
|
41
79
|
header: (
|
|
42
80
|
<WizardTextHeader
|
|
@@ -98,7 +136,7 @@ export const ControlledWizardComponent = () => {
|
|
|
98
136
|
),
|
|
99
137
|
body: () => (
|
|
100
138
|
<Center w="full" h="full">
|
|
101
|
-
<HomeAssistantTutorial onStart={() =>
|
|
139
|
+
<HomeAssistantTutorial onStart={() => setStep(4)} />
|
|
102
140
|
</Center>
|
|
103
141
|
),
|
|
104
142
|
},
|
|
@@ -15,3 +15,9 @@ export const getColorBasedOnPercentage = ({
|
|
|
15
15
|
const isPositive = percentage?.includes('+')
|
|
16
16
|
return isPositive ? colorPositive : colorNegative
|
|
17
17
|
}
|
|
18
|
+
|
|
19
|
+
export const getStatus = (index: number, currentStep: number) => {
|
|
20
|
+
if (index === currentStep) return 'active'
|
|
21
|
+
if (index < currentStep) return 'completed'
|
|
22
|
+
return 'pending'
|
|
23
|
+
}
|