@homefile/components-v2 2.40.31 → 2.40.33

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.
@@ -438,6 +438,9 @@
438
438
  },
439
439
  "notifications": "Notification coming",
440
440
  "selectAppliances": "Select the appliances you have in your home:",
441
+ "setupButton": "Start Homi Setup",
442
+ "setupSubtitle": "Homi learns your home so he can warn you before things fail, \ntrack warranties automatically, and tell you what to do next.",
443
+ "setupTitle": "Let’s set up Homi, your \nintelligent home assistant. ",
441
444
  "steps": {
442
445
  "appliances": "Appliances",
443
446
  "goals": "Goals",
@@ -0,0 +1,2 @@
1
+ import { StartHomiSetupI } from '../../interfaces';
2
+ export declare const StartHomiSetup: ({ onStart, videoUrl, onSkip, }: StartHomiSetupI) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { t } from 'i18next';
4
+ import { Box, Button, Circle, Flex, GridItem, Stack, Text, } from '@chakra-ui/react';
5
+ import { ChevronRight, TileTooltip, VideoPlayerModal, VideoPlayerTrigger, } from '../../components';
6
+ import { colors } from '../../theme/colors';
7
+ export const StartHomiSetup = ({ onStart, videoUrl, onSkip, }) => {
8
+ const [url, setUrl] = useState();
9
+ return (_jsx(GridItem, { colSpan: [1, 2], children: _jsx(TileTooltip, { label: "homeAssistant", children: _jsxs(Stack, { w: "full", h: "full", spacing: "4", align: "center", justify: "center", bg: "lightGreen.1", pt: "12", children: [_jsx(Text, { fontSize: "24px", lineHeight: "28px", textAlign: "center", whiteSpace: "pre-line", children: t('homeAssistant.setupTitle') }), _jsx(Text, { fontFamily: "secondary", textAlign: "center", whiteSpace: "pre-line", children: t('homeAssistant.setupSubtitle') }), videoUrl && (_jsx(Box, { boxShadow: "lg", w: "395px", my: "3", children: _jsx(VideoPlayerTrigger, { url: videoUrl, value: videoUrl, ratio: 16 / 9, onPlay: (value) => setUrl(value) }) })), _jsxs(Stack, { bg: "neutral.white", pb: "4", pt: "2", spacing: "4", w: "full", align: "center", children: [_jsx(Button, { onClick: onStart, textTransform: "capitalize", mt: "4", w: "395px", children: _jsxs(Flex, { align: "center", justify: "space-between", w: "full", px: "base", children: [_jsx(Text, { color: "neutral.white", children: t('homeAssistant.setupButton') }), _jsx(Circle, { size: "40px", bg: "blue.1", color: "neutral.white", children: _jsx(ChevronRight, { size: 26, stroke: colors.neutral.white }) })] }) }), _jsx(Button, { variant: "text", onClick: onSkip, children: t('buttons.skip') })] }), url && (_jsx(VideoPlayerModal, { url: url, onClose: () => setUrl(undefined), showOverlay: true }))] }) }) }));
10
+ };
@@ -10,3 +10,4 @@ export * from './HomeAssistantWrapper';
10
10
  export * from './HomeMonitor';
11
11
  export * from './HomeMonitorButton';
12
12
  export * from './HomeMonitorSteps';
13
+ export * from './StartHomiSetup';
@@ -10,3 +10,4 @@ export * from './HomeAssistantWrapper';
10
10
  export * from './HomeMonitor';
11
11
  export * from './HomeMonitorButton';
12
12
  export * from './HomeMonitorSteps';
13
+ export * from './StartHomiSetup';
@@ -2,8 +2,5 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Stack, Text } from '@chakra-ui/react';
3
3
  import { WrapperWithShadow } from '../../../components';
4
4
  export const MyHomesStepBody = ({ animation, children, fadeDelay, subtitle, title, isWizard, }) => {
5
- if (isWizard) {
6
- return (_jsx(WrapperWithShadow, { animation: animation, fadeDelay: fadeDelay, isWizard: true, children: children }));
7
- }
8
- return (_jsx(WrapperWithShadow, { animation: animation, fadeDelay: fadeDelay, children: _jsxs(Stack, { align: "center", spacing: "4", py: "8", children: [_jsx(Text, { fontSize: "xl", textAlign: "center", w: "80%", lineHeight: "1.3", children: title }), _jsx(Text, { fontFamily: "secondary", w: "85%", textAlign: "center", children: subtitle }), children] }) }));
5
+ return (_jsx(WrapperWithShadow, { animation: animation, fadeDelay: fadeDelay, isWizard: isWizard, children: _jsxs(Stack, { align: "center", spacing: "4", py: "8", children: [title && (_jsx(Text, { fontSize: "xl", textAlign: "center", whiteSpace: "pre-line", lineHeight: "1.3", children: title })), subtitle && (_jsx(Text, { fontFamily: "secondary", whiteSpace: "pre-line", textAlign: "center", children: subtitle })), children] }) }));
9
6
  };
@@ -1,2 +1,2 @@
1
1
  import { SearchRecordsI } from '../../../interfaces';
2
- export declare const SearchRecords: ({ isFirstHome, isWizard, title, subtitle, subtitlePrefix, showAddressInSubtitle, sourcesText, }: SearchRecordsI) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const SearchRecords: ({ isFirstHome, isWizard, title, subtitle, sourcesText, }: SearchRecordsI) => import("react/jsx-runtime").JSX.Element;
@@ -17,24 +17,17 @@ const fadeAnimation = keyframes `
17
17
  to { opacity: 1 }
18
18
  `;
19
19
  const fade = `${fadeAnimation} 50ms ease-in-out backwards`;
20
- export const SearchRecords = ({ isFirstHome, isWizard = false, title, subtitle, subtitlePrefix, showAddressInSubtitle = true, sourcesText, }) => {
20
+ export const SearchRecords = ({ isFirstHome, isWizard = false, title, subtitle, sourcesText, }) => {
21
21
  const { fields: { street, city, state }, } = useSnapshot(addressProxy, { sync: true });
22
22
  const [progressValue, setProgressValue] = useState(0);
23
23
  const address = `${street}, ${city} ${state}`;
24
24
  const size = '90px';
25
- const defaultTitle = t('myHomes.search.title');
26
- const defaultSubtitlePrefix = t('myHomes.search.subtitle');
27
25
  const defaultSources = [
28
26
  t('myHomes.search.msl'),
29
27
  t('myHomes.search.tax'),
30
28
  t('myHomes.search.google'),
31
29
  t('myHomes.search.leins'),
32
30
  ];
33
- const resolvedTitle = title !== null && title !== void 0 ? title : defaultTitle;
34
- const resolvedSubtitlePrefix = subtitlePrefix !== null && subtitlePrefix !== void 0 ? subtitlePrefix : defaultSubtitlePrefix;
35
- const resolvedSubtitle = subtitle !== null && subtitle !== void 0 ? subtitle : (showAddressInSubtitle
36
- ? `${resolvedSubtitlePrefix} ${address}`
37
- : resolvedSubtitlePrefix);
38
31
  const resolvedSources = sourcesText !== null && sourcesText !== void 0 ? sourcesText : defaultSources;
39
32
  useEffect(() => {
40
33
  const interval = setInterval(() => {
@@ -47,5 +40,5 @@ export const SearchRecords = ({ isFirstHome, isWizard = false, title, subtitle,
47
40
  return undefined;
48
41
  return `${1 + index * 0.5}s`;
49
42
  };
50
- return (_jsx(MyHomesStepWrapper, { isFirstHome: isFirstHome, isWizard: isWizard, children: _jsx(MyHomesStepBody, { isWizard: isWizard, animation: up, title: resolvedTitle, subtitle: resolvedSubtitle, children: _jsxs(Stack, { align: "center", bg: isWizard ? 'transparent' : 'lightViolet.1', borderRadius: "sm", w: "100%", py: "6", children: [_jsxs(Box, { position: "relative", children: [_jsx(CircularProgress, { value: progressValue, isIndeterminate: progressValue === 100, color: "violet.1", thickness: "4px", size: size, zIndex: "1" }), _jsx(Center, { position: "absolute", top: "0", left: "0", h: size, w: size, children: _jsx(Center, { bg: "neutral.white", h: "70px", w: "70px", borderRadius: "50%", children: _jsx(Image, { src: MagnifyingGlassReport, alt: "records", h: "40px", w: "auto" }) }) })] }), _jsx(Flex, { direction: "column", alignItems: "center", children: resolvedSources.map((text, index) => (_jsx(AnimatedText, { animation: fade, animationDelay: getAnimationDelay(index), children: text }, `${text}-${index}`))) })] }) }) }));
43
+ return (_jsx(MyHomesStepWrapper, { isFirstHome: isFirstHome, isWizard: isWizard, children: _jsx(MyHomesStepBody, { isWizard: isWizard, animation: up, title: title, subtitle: subtitle, children: _jsxs(Stack, { align: "center", bg: isWizard ? 'transparent' : 'lightViolet.1', borderRadius: "sm", w: "100%", py: "6", children: [_jsxs(Box, { position: "relative", children: [_jsx(CircularProgress, { value: progressValue, isIndeterminate: progressValue === 100, color: "violet.1", thickness: "4px", size: size, zIndex: "1" }), _jsx(Center, { position: "absolute", top: "0", left: "0", h: size, w: size, children: _jsx(Center, { bg: "neutral.white", h: "70px", w: "70px", borderRadius: "50%", children: _jsx(Image, { src: MagnifyingGlassReport, alt: "records", h: "40px", w: "auto" }) }) })] }), _jsx(Flex, { direction: "column", alignItems: "center", children: resolvedSources.map((text, index) => (_jsx(AnimatedText, { animation: fade, animationDelay: getAnimationDelay(index), children: text }, `${text}-${index}`))) })] }) }) }));
51
44
  };
@@ -0,0 +1,5 @@
1
+ export interface StartHomiSetupI {
2
+ onStart: () => void;
3
+ videoUrl?: string;
4
+ onSkip?: () => void;
5
+ }
@@ -12,4 +12,5 @@ export * from './HomeMonitorPanel.interface';
12
12
  export * from './HomeMonitorSteps.interface';
13
13
  export * from './HomieAddItems.interface';
14
14
  export * from './MonitorAlerts.interface';
15
+ export * from './StartHomiSetup.interface';
15
16
  export * from './WeatherWidget.interface';
@@ -12,4 +12,5 @@ export * from './HomeMonitorPanel.interface';
12
12
  export * from './HomeMonitorSteps.interface';
13
13
  export * from './HomieAddItems.interface';
14
14
  export * from './MonitorAlerts.interface';
15
+ export * from './StartHomiSetup.interface';
15
16
  export * from './WeatherWidget.interface';
@@ -1,5 +1,5 @@
1
1
  import { WrapperWithShadowI } from '../../interfaces';
2
2
  export interface MyHomesStepBodyI extends WrapperWithShadowI {
3
- subtitle: string;
4
- title: string;
3
+ subtitle?: string;
4
+ title?: string;
5
5
  }
@@ -0,0 +1,5 @@
1
+ import { Meta } from '@storybook/react';
2
+ import { StartHomiSetupI } from '../../interfaces';
3
+ declare const _default: Meta<StartHomiSetupI>;
4
+ export default _default;
5
+ export declare const StartHomiSetupComponent: (args: StartHomiSetupI) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Box } from '@chakra-ui/react';
3
+ import { action } from '@storybook/addon-actions';
4
+ import { StartHomiSetup } from '../../components';
5
+ import { videoMock } from '../../mocks';
6
+ export default {
7
+ title: 'Components/HomeAssistant',
8
+ component: StartHomiSetup,
9
+ args: {
10
+ onSkip: action('onSkip'),
11
+ onStart: action('onStart'),
12
+ },
13
+ decorators: [
14
+ (Story) => (_jsx(Box, { p: "base", w: ['full', '669px'], h: "477px", children: _jsx(Story, {}) })),
15
+ ],
16
+ };
17
+ export const StartHomiSetupComponent = (args) => {
18
+ return _jsx(StartHomiSetup, Object.assign({}, args, { videoUrl: videoMock }));
19
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.40.31",
3
+ "version": "2.40.33",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",