@homefile/components-v2 2.59.2 → 2.60.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/locales/en/index.json +5 -2
- package/dist/components/folderPanel/displayFiles/GridFile.js +9 -1
- package/dist/components/folderPanel/displayFiles/ListFile.js +9 -1
- package/dist/components/forms/dynamicForm/DynamicForm.js +1 -1
- package/dist/components/forms/dynamicForm/HiddenField.js +2 -2
- package/dist/components/forms/dynamicForm/fields/HomeInitialSetup.js +3 -1
- package/dist/components/forms/readOnly/ReadOnlyDynamicForm.js +10 -2
- package/dist/components/forms/readOnly/fields/homeItem/ReadOnlyAppliances.js +21 -22
- package/dist/components/forms/readOnly/fields/homeItem/ReadOnlyGuidelines.js +6 -3
- package/dist/components/forms/readOnly/fields/homeItem/ReadOnlyHistory.d.ts +2 -0
- package/dist/components/forms/readOnly/fields/homeItem/ReadOnlyHistory.js +35 -0
- package/dist/components/forms/readOnly/fields/homeItem/ReadOnlyItemRelated.js +8 -3
- package/dist/components/forms/readOnly/fields/homeItem/ReadOnlyOverview.d.ts +2 -0
- package/dist/components/forms/readOnly/fields/homeItem/ReadOnlyOverview.js +16 -0
- package/dist/components/forms/readOnly/fields/homeItem/ReadOnlyPurchaseDetails.d.ts +2 -0
- package/dist/components/forms/readOnly/fields/homeItem/ReadOnlyPurchaseDetails.js +30 -0
- package/dist/components/forms/readOnly/fields/homeItem/ReadOnlyWarrantyBanner.d.ts +2 -0
- package/dist/components/forms/readOnly/fields/homeItem/ReadOnlyWarrantyBanner.js +42 -0
- package/dist/components/forms/readOnly/fields/homeItem/index.d.ts +4 -0
- package/dist/components/forms/readOnly/fields/homeItem/index.js +4 -0
- package/dist/components/headers/TabsHeader.js +1 -1
- package/dist/components/history/AddDocuments.d.ts +7 -0
- package/dist/components/history/AddDocuments.js +8 -0
- package/dist/components/history/DatePennant.d.ts +7 -0
- package/dist/components/history/DatePennant.js +6 -0
- package/dist/components/history/HistoryCard.d.ts +19 -0
- package/dist/components/history/HistoryCard.js +13 -0
- package/dist/components/history/index.d.ts +3 -0
- package/dist/components/history/index.js +3 -0
- package/dist/components/homeBoard/AddToHomefile.js +1 -1
- package/dist/components/homeBoard/HomeCard.js +1 -1
- package/dist/components/homeItems/ViewingHomeItemBody.d.ts +2 -0
- package/dist/components/homeItems/ViewingHomeItemBody.js +41 -0
- package/dist/components/homeItems/ViewingHomeItemPanel.js +17 -19
- package/dist/components/homeItems/index.d.ts +1 -0
- package/dist/components/homeItems/index.js +1 -0
- package/dist/components/homi/HomiPresence.d.ts +2 -0
- package/dist/components/homi/HomiPresence.js +31 -0
- package/dist/components/homi/HomiVoice.d.ts +2 -0
- package/dist/components/homi/HomiVoice.js +6 -0
- package/dist/components/homi/ProgressBar.d.ts +2 -0
- package/dist/components/homi/ProgressBar.js +9 -0
- package/dist/components/homi/RevealValueCard.d.ts +2 -0
- package/dist/components/homi/RevealValueCard.js +23 -0
- package/dist/components/homi/StaggerReveal.d.ts +2 -0
- package/dist/components/homi/StaggerReveal.js +29 -0
- package/dist/components/homi/index.d.ts +5 -0
- package/dist/components/homi/index.js +5 -0
- package/dist/components/inboxTile/InboxForwardBanner.js +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/inputs/InlineEditField.d.ts +2 -0
- package/dist/components/inputs/InlineEditField.js +15 -0
- package/dist/components/inputs/RadioCard.d.ts +3 -1
- package/dist/components/inputs/RadioCard.js +3 -3
- package/dist/components/inputs/TextInput.d.ts +1 -1
- package/dist/components/inputs/TextInput.js +11 -4
- package/dist/components/inputs/index.d.ts +1 -0
- package/dist/components/inputs/index.js +1 -0
- package/dist/components/myHomes/HomeDetailsContent.js +1 -1
- package/dist/components/myHomes/IncludePublicRecords.d.ts +13 -1
- package/dist/components/myHomes/IncludePublicRecords.js +16 -6
- package/dist/components/myHomes/edithome/EditHomeDetails.js +12 -3
- package/dist/components/myHomes/steps/NewHomeDetails.d.ts +1 -1
- package/dist/components/myHomes/steps/NewHomeDetails.js +3 -3
- package/dist/components/myProfile/MyProfileBody.d.ts +1 -1
- package/dist/components/myProfile/MyProfileBody.js +2 -2
- package/dist/components/myProfile/details/HomiSms.d.ts +1 -1
- package/dist/components/myProfile/details/HomiSms.js +53 -23
- package/dist/components/myProfile/details/TwoFactorSetting.js +2 -1
- package/dist/components/rooms/RoomHeader.d.ts +1 -1
- package/dist/components/rooms/RoomHeader.js +3 -3
- package/dist/components/wizard/ControlledWizard.d.ts +1 -1
- package/dist/components/wizard/ControlledWizard.js +42 -3
- package/dist/components/wizard/WizardInitialOptions.js +3 -3
- package/dist/components/wizard/WizardSelectCard.d.ts +14 -0
- package/dist/components/wizard/WizardSelectCard.js +32 -0
- package/dist/components/wizard/WizardStepPrompt.d.ts +11 -0
- package/dist/components/wizard/WizardStepPrompt.js +20 -0
- package/dist/components/wizard/WizardSuccessHeader.d.ts +1 -1
- package/dist/components/wizard/WizardSuccessHeader.js +2 -2
- package/dist/components/wizard/index.d.ts +2 -0
- package/dist/components/wizard/index.js +2 -0
- package/dist/helpers/forms/dynamicForm.helper.js +4 -0
- package/dist/hooks/folderPanel/useDisplayFiles.js +11 -2
- package/dist/hooks/forms/useAddressStored.js +8 -2
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/motion/index.d.ts +2 -0
- package/dist/hooks/motion/index.js +2 -0
- package/dist/hooks/motion/useCountUp.d.ts +10 -0
- package/dist/hooks/motion/useCountUp.js +39 -0
- package/dist/hooks/motion/usePrefersReducedMotion.d.ts +14 -0
- package/dist/hooks/motion/usePrefersReducedMotion.js +15 -0
- package/dist/hooks/rooms/useRoomHeader.d.ts +4 -1
- package/dist/hooks/rooms/useRoomHeader.js +9 -1
- package/dist/hooks/useDirtySave.d.ts +14 -0
- package/dist/hooks/useDirtySave.js +33 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/interfaces/forms/dynamicForm/DynamicForm.interface.d.ts +7 -3
- package/dist/interfaces/forms/readOnly/homeItem/ReadOnlyOverview.interface.d.ts +2 -0
- package/dist/interfaces/forms/readOnly/homeItem/ReadOnlyOverview.interface.js +1 -0
- package/dist/interfaces/forms/readOnly/homeItem/ReadOnlyPurchaseDetails.interface.d.ts +5 -0
- package/dist/interfaces/forms/readOnly/homeItem/ReadOnlyPurchaseDetails.interface.js +1 -0
- package/dist/interfaces/forms/readOnly/homeItem/ReadOnlyWarrantyBanner.interface.d.ts +27 -0
- package/dist/interfaces/forms/readOnly/homeItem/ReadOnlyWarrantyBanner.interface.js +1 -0
- package/dist/interfaces/forms/readOnly/homeItem/index.d.ts +3 -0
- package/dist/interfaces/forms/readOnly/homeItem/index.js +3 -0
- package/dist/interfaces/homeItems/ViewingHomeItemPanel.interface.d.ts +1 -0
- package/dist/interfaces/homi/HomiPresence.interface.d.ts +9 -0
- package/dist/interfaces/homi/HomiPresence.interface.js +1 -0
- package/dist/interfaces/homi/ProgressBar.interface.d.ts +8 -0
- package/dist/interfaces/homi/ProgressBar.interface.js +1 -0
- package/dist/interfaces/homi/RevealValueCard.interface.d.ts +16 -0
- package/dist/interfaces/homi/RevealValueCard.interface.js +1 -0
- package/dist/interfaces/homi/StaggerReveal.interface.d.ts +9 -0
- package/dist/interfaces/homi/StaggerReveal.interface.js +1 -0
- package/dist/interfaces/homi/index.d.ts +4 -0
- package/dist/interfaces/homi/index.js +4 -0
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/index.js +1 -0
- package/dist/interfaces/inputs/InlineEditField.interface.d.ts +7 -0
- package/dist/interfaces/inputs/InlineEditField.interface.js +1 -0
- package/dist/interfaces/inputs/Input.interface.d.ts +6 -1
- package/dist/interfaces/inputs/index.d.ts +1 -0
- package/dist/interfaces/inputs/index.js +1 -0
- package/dist/interfaces/myHomes/AddHomeContent.interface.d.ts +3 -0
- package/dist/interfaces/myProfile/MyProfileBody.interface.d.ts +1 -0
- package/dist/interfaces/myProfile/details/HomiSms.interface.d.ts +11 -2
- package/dist/interfaces/rooms/RoomHeader.interface.d.ts +5 -0
- package/dist/interfaces/wizard/ControlledWizard.interface.d.ts +6 -0
- package/dist/interfaces/wizard/WizardStepPrompt.interface.d.ts +9 -0
- package/dist/interfaces/wizard/WizardStepPrompt.interface.js +1 -0
- package/dist/interfaces/wizard/index.d.ts +1 -0
- package/dist/interfaces/wizard/index.js +1 -0
- package/dist/stories/forms/readOnly/ReadOnlyAppliances.stories.d.ts +4 -0
- package/dist/stories/forms/readOnly/ReadOnlyAppliances.stories.js +33 -0
- package/dist/stories/forms/readOnly/ReadOnlyWarrantyBanner.stories.d.ts +4 -0
- package/dist/stories/forms/readOnly/ReadOnlyWarrantyBanner.stories.js +10 -0
- package/dist/stories/homeItems/ReadOnlyHistory.stories.d.ts +4 -0
- package/dist/stories/homeItems/ReadOnlyHistory.stories.js +46 -0
- package/dist/stories/homeItems/ReadOnlyOverview.stories.d.ts +5 -0
- package/dist/stories/homeItems/ReadOnlyOverview.stories.js +69 -0
- package/dist/stories/homeItems/ViewingHomeItemPanel.stories.d.ts +4 -0
- package/dist/stories/homeItems/ViewingHomeItemPanel.stories.js +204 -0
- package/dist/stories/homi/HomiPresence.stories.d.ts +18 -0
- package/dist/stories/homi/HomiPresence.stories.js +11 -0
- package/dist/stories/homi/HomiVoice.stories.d.ts +4 -0
- package/dist/stories/homi/HomiVoice.stories.js +8 -0
- package/dist/stories/homi/ProgressBar.stories.d.ts +10 -0
- package/dist/stories/homi/ProgressBar.stories.js +9 -0
- package/dist/stories/homi/RevealValueCard.stories.d.ts +19 -0
- package/dist/stories/homi/RevealValueCard.stories.js +22 -0
- package/dist/stories/homi/StaggerReveal.stories.d.ts +5 -0
- package/dist/stories/homi/StaggerReveal.stories.js +8 -0
- package/dist/stories/inputs/InlineEditField.stories.d.ts +10 -0
- package/dist/stories/inputs/InlineEditField.stories.js +11 -0
- package/dist/stories/myProfile/MyProfilePanel.stories.js +1 -1
- package/dist/stories/myProfile/details/HomiSms.stories.d.ts +3 -2
- package/dist/stories/myProfile/details/HomiSms.stories.js +3 -2
- package/dist/stories/wizard/ControlledWizard.stories.d.ts +9 -0
- package/dist/stories/wizard/ControlledWizard.stories.js +41 -60
- package/dist/theme/index.d.ts +3 -0
- package/dist/theme/index.js +7 -4
- package/dist/utils/Formaters.utils.d.ts +2 -0
- package/dist/utils/Formaters.utils.js +14 -0
- package/dist/utils/Weather.utils.js +11 -4
- package/package.json +1 -1
|
@@ -7,13 +7,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { useState } from 'react';
|
|
12
|
-
import { ControlledWizard,
|
|
13
|
-
import { Box, Center, Flex } from '@chakra-ui/react';
|
|
12
|
+
import { ControlledWizard, ConfirmHomeDetails, ConfirmPropertyBody, ConfirmPropertyFooter, SearchRecords, TextInput, WizardBodyPadding, WizardValueSummaryBody, WizardValueSummaryFooter, } from '../../components';
|
|
13
|
+
import { Box, Center, Checkbox, Collapse, Flex, Stack, Text, useDisclosure, } from '@chakra-ui/react';
|
|
14
14
|
import { action } from '@storybook/addon-actions';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
15
|
+
import { Button } from '../../components/button/Button';
|
|
16
|
+
import { assessedValueMock, propertiesMock, purchasePriceMock } from '../../mocks';
|
|
17
17
|
import { useConfirmPropertyModel } from '../../hooks';
|
|
18
18
|
export default {
|
|
19
19
|
title: 'Components/Wizard/ControlledWizard',
|
|
@@ -25,80 +25,61 @@ export default {
|
|
|
25
25
|
function fakeLookup() {
|
|
26
26
|
return new Promise((r) => setTimeout(r, 1500));
|
|
27
27
|
}
|
|
28
|
+
/** Conversational (Typeform) step header — a step marker, a bold left-aligned
|
|
29
|
+
* Homi prompt, and an optional supporting line. Composed from Text tokens. */
|
|
30
|
+
const ConvHeader = ({ marker, title, subtitle, }) => (_jsxs(Stack, { spacing: "3", pt: "2", children: [_jsx(Text, { fontFamily: "primary", fontWeight: "semibold", fontSize: "sm", color: "blue.2", children: marker }), _jsx(Text, { fontFamily: "primary", fontWeight: "bold", fontSize: { base: '3xl', md: '4xl' }, lineHeight: "1.1", color: "gray.4", children: title }), subtitle && (_jsx(Text, { fontFamily: "secondary", fontSize: "lg", color: "gray.2", children: subtitle }))] }));
|
|
31
|
+
/**
|
|
32
|
+
* Conversational New-Home setup flow, composed from existing components:
|
|
33
|
+
* 1 Address (+ trimmed consent) → conversational TextInput + Checkbox/Collapse
|
|
34
|
+
* 2 Searching → SearchRecords
|
|
35
|
+
* 3 Confirm the record → ConfirmPropertyBody
|
|
36
|
+
* 4 Reveal + name (editable) → TextInput + WizardValueSummaryBody
|
|
37
|
+
* 5 Success / hand-off → conversational, "Help me learn the basics →"
|
|
38
|
+
* Bold left headlines, white throughout, directional (Typeform) transition.
|
|
39
|
+
*/
|
|
28
40
|
export const ControlledWizardComponent = () => {
|
|
29
41
|
const [step, setStep] = useState(0);
|
|
42
|
+
const [homeName, setHomeName] = useState('The Edmunds');
|
|
43
|
+
const [address, setAddress] = useState('1240 Edmunds Way, Austin TX 78732');
|
|
44
|
+
const [records, setRecords] = useState(true);
|
|
45
|
+
const { isOpen: dataOpen, onToggle: toggleData } = useDisclosure();
|
|
30
46
|
const confirmModel = useConfirmPropertyModel({
|
|
31
47
|
properties: propertiesMock,
|
|
32
|
-
handleAddress: (
|
|
33
|
-
action('Handle Address')(address);
|
|
34
|
-
setStep(step + 1);
|
|
35
|
-
},
|
|
48
|
+
handleAddress: () => { },
|
|
36
49
|
});
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
body: () => (_jsx(Box, { pt: "4", children: _jsx(DynamicForm, { form: [form], showTitle: false, callback: action('DynamicForm') }) })),
|
|
40
|
-
footer: (_jsx(Flex, { w: "full", justify: "flex-end", children: _jsx(Box, { children: _jsx(FooterButtons, { button1: {
|
|
41
|
-
buttonStyle: 'secondaryFooter',
|
|
42
|
-
onClick: () => setStep(step - 1),
|
|
43
|
-
label: 'Back',
|
|
44
|
-
}, button2: {
|
|
45
|
-
buttonStyle: 'tertiaryFooter',
|
|
46
|
-
onClick: () => setStep(step + 1),
|
|
47
|
-
isDisabled: step === homeWizardForm.length + 4,
|
|
48
|
-
label: 'Next',
|
|
49
|
-
} }) }) })),
|
|
50
|
-
}));
|
|
51
|
-
return (_jsx(ControlledWizard, { height: "710px", step: step, setStep: setStep, steps: [
|
|
50
|
+
return (_jsx(ControlledWizard, { height: "710px", transition: "directional", step: step, setStep: setStep, steps: [
|
|
51
|
+
// 1 — Address (+ trimmed consent). Name captured at the reveal.
|
|
52
52
|
{
|
|
53
|
-
header:
|
|
54
|
-
body: () => (_jsx(WizardBodyPadding, { children: _jsx(
|
|
53
|
+
header: _jsx(Box, {}),
|
|
54
|
+
body: () => (_jsx(WizardBodyPadding, { children: _jsxs(Stack, { spacing: "7", align: "stretch", children: [_jsx(ConvHeader, { marker: "1 \u2192", title: "Hi John \u2014 let\u2019s set up your Homefile.", subtitle: "I\u2019ll handle the parts that usually blindside homeowners. First, what\u2019s your home address?" }), _jsx(TextInput, { variant: "conversational", id: "address", placeholder: "Start typing your address\u2026", value: address, handleChange: (e) => setAddress(e.target.value) }), _jsxs(Stack, { spacing: "2", children: [_jsx(Checkbox, { isChecked: records, onChange: (e) => setRecords(e.target.checked), children: _jsx(Text, { fontFamily: "secondary", children: "Let me pull public records for this home." }) }), _jsxs(Box, { pl: "6", children: [_jsxs(Text, { as: "button", type: "button", onClick: toggleData, fontFamily: "secondary", fontWeight: "semibold", fontSize: "sm", color: "blue.2", children: ["How I use this data ", dataOpen ? '⌃' : '⌄'] }), _jsx(Collapse, { in: dataOpen, children: _jsx(Text, { fontFamily: "secondary", fontSize: "sm", color: "gray.2", pt: "2", children: "Only to verify your property details, surface insights tied to taxes and value, and keep your home profile accurate \u2014 with no extra work from you." }) })] })] })] }) })),
|
|
55
55
|
footer: (_jsx(ConfirmHomeDetails, { handleCreateHomeClick: (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
56
56
|
setStep(1);
|
|
57
57
|
yield fakeLookup();
|
|
58
|
-
setStep(
|
|
58
|
+
setStep(2);
|
|
59
59
|
action('Create Home Click')(values);
|
|
60
60
|
}) })),
|
|
61
61
|
},
|
|
62
|
+
// 2 — Searching public records
|
|
62
63
|
{
|
|
63
|
-
header:
|
|
64
|
-
body: () => (_jsx(WizardBodyPadding, { children:
|
|
65
|
-
{
|
|
66
|
-
id: 'add',
|
|
67
|
-
label: 'Add public property records to your home.',
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
id: 'skip',
|
|
71
|
-
label: 'Skip for now',
|
|
72
|
-
},
|
|
73
|
-
], onChange: (id) => {
|
|
74
|
-
action('ConfirmPropertyRecords onChange')(id);
|
|
75
|
-
} }) })),
|
|
76
|
-
footer: (_jsx(ConfirmPropertyFooter, { isWizard: true, onContinue: confirmModel.handleContinue, isLoading: false, label: "Continue" })),
|
|
64
|
+
header: _jsx(Box, {}),
|
|
65
|
+
body: () => (_jsx(WizardBodyPadding, { children: _jsxs(Stack, { spacing: "8", children: [_jsx(ConvHeader, { marker: "2 \u2192", title: "One moment \u2014 I\u2019m searching public records.", subtitle: "This is the part homeowners usually spend hours hunting down. I do it automatically." }), _jsx(SearchRecords, { isWizard: true })] }) })),
|
|
77
66
|
},
|
|
67
|
+
// 3 — Confirm the matching record
|
|
78
68
|
{
|
|
79
|
-
header:
|
|
80
|
-
body: () => _jsx(
|
|
69
|
+
header: _jsx(Box, {}),
|
|
70
|
+
body: () => (_jsx(WizardBodyPadding, { children: _jsxs(Stack, { spacing: "7", children: [_jsx(ConvHeader, { marker: "3 \u2192", title: "Which one is your home?", subtitle: "Picking the right record lets me lock your verified data, so you never have to enter it again." }), _jsx(ConfirmPropertyBody, { isWizard: true, properties: confirmModel.propertiesWithNoneOfTheAbove, currentProperty: confirmModel.currentProperty, onChange: confirmModel.setCurrentProperty, footerText: confirmModel.footerText })] }) })),
|
|
71
|
+
footer: (_jsx(ConfirmPropertyFooter, { isWizard: true, onContinue: () => setStep(3), isLoading: false, label: "Confirm" })),
|
|
81
72
|
},
|
|
73
|
+
// 4 — Reveal + name the home (moved here, editable)
|
|
82
74
|
{
|
|
83
|
-
header:
|
|
84
|
-
body: () => (_jsx(WizardBodyPadding, { children: _jsx(
|
|
85
|
-
footer: (_jsx(
|
|
75
|
+
header: _jsx(Box, {}),
|
|
76
|
+
body: () => (_jsx(WizardBodyPadding, { children: _jsxs(Stack, { spacing: "7", children: [_jsx(ConvHeader, { marker: "4 \u2192", title: "Here\u2019s what I found on your home.", subtitle: "Public data can be incomplete or dated \u2014 you can fix anything inside your Homefile." }), _jsx(TextInput, { variant: "conversational", id: "homeName", placeholder: "Name this home", value: homeName, handleChange: (e) => setHomeName(e.target.value) }), _jsx(WizardValueSummaryBody, { title: "", address: "1240 Edmunds Way, Austin TX 78732", estimatedValue: 642000, purchasePrice: 540000, assessedValue: 598400, purchasePriceDetails: purchasePriceMock, assessedValueDetails: assessedValueMock })] }) })),
|
|
77
|
+
footer: (_jsx(WizardValueSummaryFooter, { onAccurate: () => setStep(4), onNotAccurate: () => setStep(4), onComplete: () => setStep(4), accuracyStatus: null })),
|
|
86
78
|
},
|
|
79
|
+
// 5 — Success / hand-off (conversational)
|
|
87
80
|
{
|
|
88
|
-
header:
|
|
89
|
-
body: (
|
|
90
|
-
footer: (_jsx(WizardValueSummaryFooter, { onAccurate: () => setStep(step + 1), onNotAccurate: () => setStep(step + 1), onComplete: () => setStep(step + 1), accuracyStatus: null })),
|
|
81
|
+
header: _jsx(Box, {}),
|
|
82
|
+
body: () => (_jsx(WizardBodyPadding, { children: _jsxs(Stack, { spacing: "6", align: "stretch", children: [_jsxs(Stack, { spacing: "3", pt: "2", children: [_jsx(Text, { fontFamily: "primary", fontWeight: "semibold", fontSize: "sm", color: "green.1", children: "\u2713 Success" }), _jsx(Text, { fontFamily: "primary", fontWeight: "bold", fontSize: { base: '3xl', md: '4xl' }, lineHeight: "1.1", color: "gray.4", children: "Your Homefile is active." }), _jsx(Text, { fontFamily: "secondary", fontSize: "lg", color: "gray.2", children: "Now help me learn a few basics about your home \u2014 that\u2019s how I start looking out for you." })] }), _jsx(Box, { border: "1px solid", borderColor: "lightBlue.3", borderRadius: "lg", p: "4", children: _jsxs(Flex, { gap: "4", align: "center", children: [_jsx(Center, { w: "96px", h: "72px", borderRadius: "md", bg: "lightBlue.2", flexShrink: 0, children: _jsx(Box, { w: "0", h: "0", borderLeft: "26px solid transparent", borderRight: "26px solid transparent", borderBottom: "26px solid", borderBottomColor: "#C69A6B" }) }), _jsxs(Box, { children: [_jsx(Text, { fontFamily: "secondary", fontSize: "xs", color: "gray.2", textTransform: "uppercase", letterSpacing: "wider", children: "Your home" }), _jsx(Text, { fontFamily: "primary", color: "gray.4", children: address })] })] }) }), _jsx(Text, { fontFamily: "secondary", fontSize: "lg", color: "gray.2", children: "The more I know, the sooner I can warn you before things fail, track your warranties, and tell you what to do next. Takes a minute." }), _jsx(Box, { children: _jsx(Button, { onClick: () => action('Help me learn the basics')(), children: "Help me learn the basics \u2192" }) }), _jsx(Text, { as: "button", type: "button", onClick: () => action('Skip for now')(), fontFamily: "secondary", fontWeight: "semibold", color: "blue.2", alignSelf: "flex-start", children: "Skip for now, go to my Homefile" })] }) })),
|
|
91
83
|
},
|
|
92
|
-
{
|
|
93
|
-
header: (_jsx(WizardSuccessHeader, { title: "Your Homefile is live.", subtitle: "Now let\u2019s set up Homi so you never guess, never search, and never get blindsided again.", address: {
|
|
94
|
-
city: 'Austin',
|
|
95
|
-
state: 'Texas',
|
|
96
|
-
street: 'Ronald Regan long name st here',
|
|
97
|
-
number: '123',
|
|
98
|
-
zip: '80123',
|
|
99
|
-
}, name: "your home" })),
|
|
100
|
-
body: () => (_jsx(Center, { h: "full", children: _jsx(HomeAssistantTutorial, { onStart: () => setStep(step + 1) }) })),
|
|
101
|
-
},
|
|
102
|
-
...homeAssistantSteps,
|
|
103
84
|
] }));
|
|
104
85
|
};
|
package/dist/theme/index.d.ts
CHANGED
package/dist/theme/index.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import '@fontsource/assistant';
|
|
2
|
+
import '@fontsource/assistant/700.css';
|
|
2
3
|
import '@fontsource/poppins';
|
|
4
|
+
import '@fontsource/poppins/500.css';
|
|
5
|
+
import '@fontsource/poppins/600.css';
|
|
3
6
|
import { extendTheme } from '@chakra-ui/react';
|
|
4
7
|
import { Button, Checkbox, Container, Drawer, Input, Progress, Select, Switch, Text, Tooltip, Textarea, } from './components';
|
|
5
8
|
import { colors } from './colors';
|
|
@@ -90,10 +93,10 @@ const theme = extendTheme({
|
|
|
90
93
|
},
|
|
91
94
|
},
|
|
92
95
|
fonts: {
|
|
93
|
-
primary: 'Poppins',
|
|
94
|
-
secondary: 'Assistant',
|
|
95
|
-
timesNewRoman: 'Times New Roman',
|
|
96
|
-
helvetica: 'Helvetica',
|
|
96
|
+
primary: 'Poppins, system-ui, sans-serif',
|
|
97
|
+
secondary: 'Assistant, system-ui, sans-serif',
|
|
98
|
+
timesNewRoman: '"Times New Roman", serif',
|
|
99
|
+
helvetica: 'Helvetica, Arial, sans-serif',
|
|
97
100
|
},
|
|
98
101
|
letterSpacings: {
|
|
99
102
|
tighter: '-0.05em',
|
|
@@ -29,6 +29,8 @@ export declare const formatISODate: (value: string) => string;
|
|
|
29
29
|
export declare const toQuantity: (q: string | number | null | undefined) => number | "";
|
|
30
30
|
export declare const formatCurrency: ({ country, currrency, value, }: FormatCurrencyI) => string;
|
|
31
31
|
export declare const formatCurrencyWithoutDigits: ({ country, currrency, value, }: FormatCurrencyI) => string;
|
|
32
|
+
export declare const toPhoneDigits: (value?: string | number) => string;
|
|
33
|
+
export declare const formatPhone: (value?: string | number) => string;
|
|
32
34
|
export declare const formatNumber: (value: string | number) => string | 0;
|
|
33
35
|
export declare const formatRoundedNumber: (value: string | number) => string | 0;
|
|
34
36
|
export declare const capitalize: (label: string) => string;
|
|
@@ -156,6 +156,20 @@ export const formatCurrencyWithoutDigits = ({ country = 'en-US', currrency = 'US
|
|
|
156
156
|
});
|
|
157
157
|
return formatter;
|
|
158
158
|
};
|
|
159
|
+
// Strip a phone value down to at most 10 digits — the canonical stored/
|
|
160
|
+
// validated form (formatting is display-only).
|
|
161
|
+
export const toPhoneDigits = (value) => String(value !== null && value !== void 0 ? value : '')
|
|
162
|
+
.replace(/\D/g, '')
|
|
163
|
+
.slice(0, 10);
|
|
164
|
+
// Display a US phone number as `XXX.XXX.XXXX` (formats partial input as typed).
|
|
165
|
+
export const formatPhone = (value) => {
|
|
166
|
+
const digits = toPhoneDigits(value);
|
|
167
|
+
if (digits.length <= 3)
|
|
168
|
+
return digits;
|
|
169
|
+
if (digits.length <= 6)
|
|
170
|
+
return `${digits.slice(0, 3)}.${digits.slice(3)}`;
|
|
171
|
+
return `${digits.slice(0, 3)}.${digits.slice(3, 6)}.${digits.slice(6)}`;
|
|
172
|
+
};
|
|
159
173
|
export const formatNumber = (value) => {
|
|
160
174
|
if (value) {
|
|
161
175
|
return new Intl.NumberFormat('en-US').format(Number(value));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { parseISO, format } from 'date-fns';
|
|
2
2
|
export function mapForecastToWidget(periods, location) {
|
|
3
|
-
var _a, _b, _c, _d;
|
|
3
|
+
var _a, _b, _c, _d, _e;
|
|
4
4
|
if (!periods.length)
|
|
5
5
|
return {};
|
|
6
6
|
// --- HEADER DATE ---
|
|
@@ -11,12 +11,19 @@ export function mapForecastToWidget(periods, location) {
|
|
|
11
11
|
const night0 = (_c = (_b = periods.find((p) => !p.isDaytime &&
|
|
12
12
|
format(parseISO(p.startTime), 'yyyy-MM-dd') ===
|
|
13
13
|
format(parseISO(day0.startTime), 'yyyy-MM-dd'))) !== null && _b !== void 0 ? _b : periods.find((p) => !p.isDaytime)) !== null && _c !== void 0 ? _c : day0;
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
// Current conditions must reflect the ACTUAL time of day, picked up on load:
|
|
15
|
+
// choose the period that contains "now" (the most recent period whose start is
|
|
16
|
+
// at/-before now) rather than always the first daytime period. So an evening
|
|
17
|
+
// load lands on the "Tonight" period → its temp + a night icon, not the day's
|
|
18
|
+
// high + a sun. High/Low stay day0/night0 (today's day/night).
|
|
19
|
+
const now = new Date();
|
|
20
|
+
const nowPeriod = (_d = periods.filter((p) => parseISO(p.startTime) <= now).slice(-1)[0]) !== null && _d !== void 0 ? _d : day0;
|
|
21
|
+
const currentTemp = nowPeriod.temperature;
|
|
22
|
+
const currentIcon = nowPeriod.icon;
|
|
16
23
|
const highTemp = day0.temperature;
|
|
17
24
|
const lowTemp = night0.temperature;
|
|
18
25
|
// --- DETAILS ---
|
|
19
|
-
const precipitation = (
|
|
26
|
+
const precipitation = (_e = day0.probabilityOfPrecipitation.value) !== null && _e !== void 0 ? _e : 0;
|
|
20
27
|
const wind = `${day0.windDirection} ${day0.windSpeed}`;
|
|
21
28
|
const humidity = undefined;
|
|
22
29
|
// --- 5-DAY FORECAST ---
|