@homefile/components-v2 2.30.0 → 2.31.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/locales/en/index.json +1 -1
- package/dist/components/homeAssistant/HomeAssistantTutorial.d.ts +1 -1
- package/dist/components/homeAssistant/HomeAssistantTutorial.js +2 -2
- package/dist/components/receipts/Summary.js +2 -2
- package/dist/components/wizard/WizardSuccessHeader.d.ts +2 -0
- package/dist/components/wizard/WizardSuccessHeader.js +16 -0
- package/dist/helpers/receipts/Receipts.helper.js +1 -0
- package/dist/hooks/myHomes/useMyHomeCard.d.ts +1 -1
- package/dist/interfaces/homeAssistant/HomeAssistantTutorial.interface.d.ts +2 -1
- package/dist/interfaces/wizard/WizardSuccessHeader.interface.d.ts +3 -0
- package/dist/interfaces/wizard/WizardSuccessHeader.interface.js +1 -0
- package/dist/interfaces/wizard/index.d.ts +1 -0
- package/dist/interfaces/wizard/index.js +1 -0
- package/dist/stories/wizard/ControlledWizard.stories.js +14 -3
- package/package.json +1 -1
- package/src/assets/locales/en/index.json +1 -1
- package/src/components/homeAssistant/HomeAssistantTutorial.tsx +12 -9
- package/src/components/receipts/Summary.tsx +3 -3
- package/src/components/wizard/WizardSuccessHeader.tsx +102 -0
- package/src/helpers/receipts/Receipts.helper.ts +1 -0
- package/src/hooks/myHomes/useMyHomeCard.ts +1 -1
- package/src/interfaces/homeAssistant/HomeAssistantTutorial.interface.ts +2 -1
- package/src/interfaces/wizard/WizardSuccessHeader.interface.ts +5 -0
- package/src/interfaces/wizard/index.ts +1 -0
- package/src/stories/wizard/ControlledWizard.stories.tsx +25 -2
|
@@ -820,7 +820,7 @@
|
|
|
820
820
|
"automationDetails": "Automation Details",
|
|
821
821
|
"columnLeft": "Purchase Date:, Store:, Phone:,Cashier:",
|
|
822
822
|
"columnRight": "# of Items:, Sales Tax:, Total:, Payment Type:",
|
|
823
|
-
"daySummary": "
|
|
823
|
+
"daySummary": "Summary",
|
|
824
824
|
"deleteItem": "Delete Item",
|
|
825
825
|
"deleteReceipt": "Delete Receipt",
|
|
826
826
|
"forwardTo": "Forward receipts to:",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { HomeAssistantTutorialI } from '../../interfaces';
|
|
2
|
-
export declare const HomeAssistantTutorial: ({ onStart, videoUrl, }: HomeAssistantTutorialI) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const HomeAssistantTutorial: ({ onStart, videoUrl, maxWidth, }: HomeAssistantTutorialI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,7 +4,7 @@ import { t } from 'i18next';
|
|
|
4
4
|
import { Box, Button, Circle, Flex, Stack, Text } from '@chakra-ui/react';
|
|
5
5
|
import { ChevronRight, VideoPlayerModal, VideoPlayerTrigger, } from '..';
|
|
6
6
|
import { colors } from '../../theme/colors';
|
|
7
|
-
export const HomeAssistantTutorial = ({ onStart, videoUrl, }) => {
|
|
7
|
+
export const HomeAssistantTutorial = ({ onStart, videoUrl, maxWidth, }) => {
|
|
8
8
|
const [url, setUrl] = useState();
|
|
9
|
-
return (_jsxs(Stack, { spacing: "base", align: "center", maxW:
|
|
9
|
+
return (_jsxs(Stack, { spacing: "base", align: "center", maxW: maxWidth || '483px', px: ['base', 0], zIndex: "2", children: [_jsx(Text, { fontSize: "30px", lineHeight: "32px", textAlign: "center", children: t('homeAssistant.tutorialTitle') }), _jsx(Text, { fontFamily: "secondary", textAlign: "center", children: t('homeAssistant.tutorialDescription') }), _jsxs(Stack, { spacing: "base", w: "284px", children: [videoUrl && (_jsx(Box, { boxShadow: "lg", children: _jsx(VideoPlayerTrigger, { url: videoUrl, value: videoUrl, ratio: 16 / 9, onPlay: (value) => setUrl(value) }) })), _jsx(Button, { onClick: onStart, textTransform: "capitalize", children: _jsxs(Flex, { align: "center", justify: "space-between", w: "100%", px: "base", children: [_jsx(Text, { color: "neutral.white", children: t('homeAssistant.tutorialButton') }), _jsx(Circle, { size: "40px", bg: "blue.1", color: "neutral.white", children: _jsx(ChevronRight, { size: 26, stroke: colors.neutral.white }) })] }) })] }), _jsx(Text, { fontFamily: "secondary", textAlign: "center", children: t('homeAssistant.tutorialNote') }), url && (_jsx(VideoPlayerModal, { url: url, onClose: () => setUrl(undefined), showOverlay: true }))] }));
|
|
10
10
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { t } from 'i18next';
|
|
3
3
|
import { Box, Stack, Text } from '@chakra-ui/react';
|
|
4
|
-
import {
|
|
4
|
+
import { TotalHeader } from '..';
|
|
5
5
|
export const Summary = ({ numberOfDays = 30, incidentalSpent, inventorySpent, total, }) => {
|
|
6
|
-
return (_jsxs(Stack, { flex: "auto", children: [_jsx(Text, { variant: "receipt", children: `${
|
|
6
|
+
return (_jsxs(Stack, { flex: "auto", children: [_jsx(Text, { variant: "receipt", children: `${t('receipts.daySummary')}` }), _jsx(Box, { children: _jsx(TotalHeader, { value: total }) })] }));
|
|
7
7
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { t } from 'i18next';
|
|
3
|
+
import { Center, Show, Stack, Text, Box, Flex, Container, Image, } from '@chakra-ui/react';
|
|
4
|
+
import { ContainerHeader, Logo } from '..';
|
|
5
|
+
import { randomImages } from '../../utils';
|
|
6
|
+
import { useMyHomeCard } from '../../hooks';
|
|
7
|
+
export const WizardSuccessHeader = ({ title, subtitle, address, name, image, }) => {
|
|
8
|
+
return (_jsx(Center, { w: "full", bg: "lightGreen.1", minH: "212px", children: _jsxs(Stack, { w: "full", spacing: "0", align: "center", children: [_jsx(Show, { below: "md", children: _jsx(Logo, {}) }), _jsxs(Flex, { gap: "8", w: { base: '80%', md: '70%' }, align: "center", pt: { base: '0', md: '8' }, direction: { base: 'column', md: 'row' }, children: [_jsx(WizardHomeCard, { address: address, name: name, image: image }), _jsxs(Stack, { spacing: "2", children: [_jsxs(Text, { fontSize: "xl", fontWeight: "semibold", color: "green.1", children: [t('ariaLabels.success'), "!"] }), _jsx(Text, { fontSize: { base: '2xl', md: '3xl' }, lineHeight: "shorter", children: title }), subtitle && _jsx(Text, { fontFamily: "secondary", children: subtitle }), _jsx(Show, { below: "md", children: _jsx(Box, { h: "6" }) })] })] })] }) }));
|
|
9
|
+
};
|
|
10
|
+
const WizardHomeCard = ({ address, name, image, }) => {
|
|
11
|
+
const { imageUrl } = useMyHomeCard({
|
|
12
|
+
image,
|
|
13
|
+
});
|
|
14
|
+
const { city, state, street, number = '', zip } = address || {};
|
|
15
|
+
return (_jsxs(Container, { w: "250px", children: [_jsx(ContainerHeader, { menuItems: [], isThin: true }), _jsx(Image, { src: ((image === null || image === void 0 ? void 0 : image.bucketName) && imageUrl) || randomImages(0), alt: `${name} ${t('images.altImage')}`, objectFit: "cover", w: "full" }), _jsxs(Stack, { bg: "neutral.white", px: "2", py: "4", children: [_jsx(Flex, { align: "center", gap: "1", children: _jsx(Box, { children: _jsx(Text, { textOverflow: "ellipsis", noOfLines: 1, textAlign: "left", textTransform: "uppercase", children: name }) }) }), _jsxs(Box, { lineHeight: "1.2", textAlign: "left", children: [_jsx(Text, { isTruncated: true, variant: "home", children: `${number} ${street}` }), _jsxs(Flex, { gap: "1", children: [_jsx(Text, { isTruncated: true, variant: "home", children: `${city},` }), _jsx(Text, { isTruncated: true, variant: "home", children: state })] }), _jsx(Text, { variant: "home", children: zip })] })] })] }));
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,11 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
import { ConfirmProperty, ControlledWizard, MyHomeDetails, SearchRecords, WizardTextHeader, } from '../../components';
|
|
12
|
-
import { Box } from '@chakra-ui/react';
|
|
11
|
+
import { ConfirmProperty, ControlledWizard, HomeAssistantTutorial, MyHomeDetails, SearchRecords, WizardTextHeader, } from '../../components';
|
|
12
|
+
import { Box, Center } from '@chakra-ui/react';
|
|
13
13
|
import { useState } from 'react';
|
|
14
14
|
import { formValues } from '../../helpers';
|
|
15
15
|
import { propertiesMock } from '../../mocks';
|
|
16
|
+
import { WizardSuccessHeader } from '../../components/wizard/WizardSuccessHeader';
|
|
16
17
|
export default {
|
|
17
18
|
title: 'Components/Wizard/ControlledWizard',
|
|
18
19
|
component: ControlledWizard,
|
|
@@ -41,8 +42,18 @@ export const ControlledWizardComponent = () => {
|
|
|
41
42
|
{
|
|
42
43
|
header: (_jsx(WizardTextHeader, { title: "This is the data we found in public records.", subtitle: "Details may not represent the most up-to-date info about your home." })),
|
|
43
44
|
body: () => (_jsx(ConfirmProperty, { isWizard: true, properties: propertiesMock, handleAddress: () => {
|
|
44
|
-
setStep(
|
|
45
|
+
setStep(3);
|
|
45
46
|
} })),
|
|
46
47
|
},
|
|
48
|
+
{
|
|
49
|
+
header: (_jsx(WizardSuccessHeader, { title: "Your homefile has been created.", subtitle: "Your Homefile is created. You will be able to edit and update your home details once setup is complete.", address: {
|
|
50
|
+
city: 'Austin',
|
|
51
|
+
state: 'Texas',
|
|
52
|
+
street: 'Ronald Regan long name st here',
|
|
53
|
+
number: '123',
|
|
54
|
+
zip: '80123',
|
|
55
|
+
}, name: "your home" })),
|
|
56
|
+
body: () => (_jsx(Center, { w: "full", h: "full", children: _jsx(HomeAssistantTutorial, { onStart: () => { }, maxWidth: "500px" }) })),
|
|
57
|
+
},
|
|
47
58
|
] }));
|
|
48
59
|
};
|
package/package.json
CHANGED
|
@@ -820,7 +820,7 @@
|
|
|
820
820
|
"automationDetails": "Automation Details",
|
|
821
821
|
"columnLeft": "Purchase Date:, Store:, Phone:,Cashier:",
|
|
822
822
|
"columnRight": "# of Items:, Sales Tax:, Total:, Payment Type:",
|
|
823
|
-
"daySummary": "
|
|
823
|
+
"daySummary": "Summary",
|
|
824
824
|
"deleteItem": "Delete Item",
|
|
825
825
|
"deleteReceipt": "Delete Receipt",
|
|
826
826
|
"forwardTo": "Forward receipts to:",
|
|
@@ -12,13 +12,14 @@ import { HomeAssistantTutorialI } from '@/interfaces'
|
|
|
12
12
|
export const HomeAssistantTutorial = ({
|
|
13
13
|
onStart,
|
|
14
14
|
videoUrl,
|
|
15
|
+
maxWidth,
|
|
15
16
|
}: HomeAssistantTutorialI) => {
|
|
16
17
|
const [url, setUrl] = useState<string | undefined>()
|
|
17
18
|
return (
|
|
18
19
|
<Stack
|
|
19
20
|
spacing="base"
|
|
20
21
|
align="center"
|
|
21
|
-
maxW=
|
|
22
|
+
maxW={maxWidth || '483px'}
|
|
22
23
|
px={['base', 0]}
|
|
23
24
|
zIndex="2"
|
|
24
25
|
>
|
|
@@ -29,14 +30,16 @@ export const HomeAssistantTutorial = ({
|
|
|
29
30
|
{t('homeAssistant.tutorialDescription')}
|
|
30
31
|
</Text>
|
|
31
32
|
<Stack spacing="base" w="284px">
|
|
32
|
-
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
{videoUrl && (
|
|
34
|
+
<Box boxShadow="lg">
|
|
35
|
+
<VideoPlayerTrigger
|
|
36
|
+
url={videoUrl}
|
|
37
|
+
value={videoUrl}
|
|
38
|
+
ratio={16 / 9}
|
|
39
|
+
onPlay={(value) => setUrl(value)}
|
|
40
|
+
/>
|
|
41
|
+
</Box>
|
|
42
|
+
)}
|
|
40
43
|
<Button onClick={onStart} textTransform="capitalize">
|
|
41
44
|
<Flex align="center" justify="space-between" w="100%" px="base">
|
|
42
45
|
<Text color="neutral.white">
|
|
@@ -11,19 +11,19 @@ export const Summary = ({
|
|
|
11
11
|
}: SummaryI) => {
|
|
12
12
|
return (
|
|
13
13
|
<Stack flex="auto">
|
|
14
|
-
<Text variant="receipt">{`${
|
|
14
|
+
<Text variant="receipt">{`${t(
|
|
15
15
|
'receipts.daySummary'
|
|
16
16
|
)}`}</Text>
|
|
17
17
|
<Box>
|
|
18
18
|
<TotalHeader value={total} />
|
|
19
|
-
<Stack p="base" bg="lightGreen.1" spacing="base">
|
|
19
|
+
{/* <Stack p="base" bg="lightGreen.1" spacing="base">
|
|
20
20
|
<ProgressSpend spent={incidentalSpent} total={total} />
|
|
21
21
|
<ProgressSpend
|
|
22
22
|
spent={inventorySpent}
|
|
23
23
|
total={total}
|
|
24
24
|
variant="inventory"
|
|
25
25
|
/>
|
|
26
|
-
</Stack>
|
|
26
|
+
</Stack> */}
|
|
27
27
|
</Box>
|
|
28
28
|
</Stack>
|
|
29
29
|
)
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { t } from 'i18next'
|
|
2
|
+
import {
|
|
3
|
+
Center,
|
|
4
|
+
Show,
|
|
5
|
+
Stack,
|
|
6
|
+
Text,
|
|
7
|
+
Box,
|
|
8
|
+
Flex,
|
|
9
|
+
Container,
|
|
10
|
+
Image,
|
|
11
|
+
} from '@chakra-ui/react'
|
|
12
|
+
import { ContainerHeader, Logo } from '@/components'
|
|
13
|
+
import { MyHomeCardI, WizardSuccessHeaderI } from '@/interfaces'
|
|
14
|
+
import { randomImages } from '@/utils'
|
|
15
|
+
import { useMyHomeCard } from '@/hooks'
|
|
16
|
+
|
|
17
|
+
export const WizardSuccessHeader = ({
|
|
18
|
+
title,
|
|
19
|
+
subtitle,
|
|
20
|
+
address,
|
|
21
|
+
name,
|
|
22
|
+
image,
|
|
23
|
+
}: WizardSuccessHeaderI) => {
|
|
24
|
+
return (
|
|
25
|
+
<Center w="full" bg="lightGreen.1" minH="212px">
|
|
26
|
+
<Stack w="full" spacing="0" align="center">
|
|
27
|
+
<Show below="md">
|
|
28
|
+
<Logo />
|
|
29
|
+
</Show>
|
|
30
|
+
<Flex
|
|
31
|
+
gap="8"
|
|
32
|
+
w={{ base: '80%', md: '70%' }}
|
|
33
|
+
align="center"
|
|
34
|
+
pt={{ base: '0', md: '8' }}
|
|
35
|
+
direction={{ base: 'column', md: 'row' }}
|
|
36
|
+
>
|
|
37
|
+
<WizardHomeCard address={address} name={name} image={image} />
|
|
38
|
+
<Stack spacing="2">
|
|
39
|
+
<Text fontSize="xl" fontWeight="semibold" color="green.1">
|
|
40
|
+
{t('ariaLabels.success')}!
|
|
41
|
+
</Text>
|
|
42
|
+
<Text fontSize={{ base: '2xl', md: '3xl' }} lineHeight="shorter">
|
|
43
|
+
{title}
|
|
44
|
+
</Text>
|
|
45
|
+
{subtitle && <Text fontFamily="secondary">{subtitle}</Text>}
|
|
46
|
+
<Show below="md">
|
|
47
|
+
<Box h="6" />
|
|
48
|
+
</Show>
|
|
49
|
+
</Stack>
|
|
50
|
+
</Flex>
|
|
51
|
+
</Stack>
|
|
52
|
+
</Center>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const WizardHomeCard = ({
|
|
57
|
+
address,
|
|
58
|
+
name,
|
|
59
|
+
image,
|
|
60
|
+
}: Pick<MyHomeCardI, 'address' | 'name' | 'image'>) => {
|
|
61
|
+
const { imageUrl } = useMyHomeCard({
|
|
62
|
+
image,
|
|
63
|
+
})
|
|
64
|
+
const { city, state, street, number = '', zip } = address || {}
|
|
65
|
+
return (
|
|
66
|
+
<Container w="250px">
|
|
67
|
+
<ContainerHeader menuItems={[]} isThin />
|
|
68
|
+
<Image
|
|
69
|
+
src={(image?.bucketName && imageUrl) || randomImages(0)}
|
|
70
|
+
alt={`${name} ${t('images.altImage')}`}
|
|
71
|
+
objectFit="cover"
|
|
72
|
+
w="full"
|
|
73
|
+
/>
|
|
74
|
+
<Stack bg="neutral.white" px="2" py="4">
|
|
75
|
+
<Flex align="center" gap="1">
|
|
76
|
+
<Box>
|
|
77
|
+
<Text
|
|
78
|
+
textOverflow="ellipsis"
|
|
79
|
+
noOfLines={1}
|
|
80
|
+
textAlign="left"
|
|
81
|
+
textTransform="uppercase"
|
|
82
|
+
>
|
|
83
|
+
{name}
|
|
84
|
+
</Text>
|
|
85
|
+
</Box>
|
|
86
|
+
</Flex>
|
|
87
|
+
<Box lineHeight="1.2" textAlign="left">
|
|
88
|
+
<Text isTruncated variant="home">
|
|
89
|
+
{`${number} ${street}`}
|
|
90
|
+
</Text>
|
|
91
|
+
<Flex gap="1">
|
|
92
|
+
<Text isTruncated variant="home">{`${city},`}</Text>
|
|
93
|
+
<Text isTruncated variant="home">
|
|
94
|
+
{state}
|
|
95
|
+
</Text>
|
|
96
|
+
</Flex>
|
|
97
|
+
<Text variant="home">{zip}</Text>
|
|
98
|
+
</Box>
|
|
99
|
+
</Stack>
|
|
100
|
+
</Container>
|
|
101
|
+
)
|
|
102
|
+
}
|
|
@@ -2,15 +2,17 @@ import { Meta } from '@storybook/react'
|
|
|
2
2
|
import {
|
|
3
3
|
ConfirmProperty,
|
|
4
4
|
ControlledWizard,
|
|
5
|
+
HomeAssistantTutorial,
|
|
5
6
|
MyHomeDetails,
|
|
6
7
|
SearchRecords,
|
|
7
8
|
WizardTextHeader,
|
|
8
9
|
} from '@/components'
|
|
9
|
-
import { Box } from '@chakra-ui/react'
|
|
10
|
+
import { Box, Center } from '@chakra-ui/react'
|
|
10
11
|
import { useState } from 'react'
|
|
11
12
|
import { formValues } from '@/helpers'
|
|
12
13
|
import { propertiesMock } from '@/mocks'
|
|
13
14
|
import { ControlledWizardI, HomeFormI } from '@/interfaces'
|
|
15
|
+
import { WizardSuccessHeader } from '@/components/wizard/WizardSuccessHeader'
|
|
14
16
|
|
|
15
17
|
export default {
|
|
16
18
|
title: 'Components/Wizard/ControlledWizard',
|
|
@@ -74,11 +76,32 @@ export const ControlledWizardComponent = () => {
|
|
|
74
76
|
isWizard
|
|
75
77
|
properties={propertiesMock}
|
|
76
78
|
handleAddress={() => {
|
|
77
|
-
setStep(
|
|
79
|
+
setStep(3)
|
|
78
80
|
}}
|
|
79
81
|
/>
|
|
80
82
|
),
|
|
81
83
|
},
|
|
84
|
+
{
|
|
85
|
+
header: (
|
|
86
|
+
<WizardSuccessHeader
|
|
87
|
+
title="Your homefile has been created."
|
|
88
|
+
subtitle="Your Homefile is created. You will be able to edit and update your home details once setup is complete."
|
|
89
|
+
address={{
|
|
90
|
+
city: 'Austin',
|
|
91
|
+
state: 'Texas',
|
|
92
|
+
street: 'Ronald Regan long name st here',
|
|
93
|
+
number: '123',
|
|
94
|
+
zip: '80123',
|
|
95
|
+
}}
|
|
96
|
+
name="your home"
|
|
97
|
+
/>
|
|
98
|
+
),
|
|
99
|
+
body: () => (
|
|
100
|
+
<Center w="full" h="full">
|
|
101
|
+
<HomeAssistantTutorial onStart={() => {}} maxWidth="500px" />
|
|
102
|
+
</Center>
|
|
103
|
+
),
|
|
104
|
+
},
|
|
82
105
|
]}
|
|
83
106
|
/>
|
|
84
107
|
)
|