@homefile/components-v2 2.18.0 → 2.20.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 (43) hide show
  1. package/dist/assets/images/filter-size.png +0 -0
  2. package/dist/assets/images/index.d.ts +2 -1
  3. package/dist/assets/images/index.js +2 -1
  4. package/dist/assets/images/index.ts +2 -0
  5. package/dist/components/badge/CustomBadge.d.ts +3 -4
  6. package/dist/components/badge/CustomBadge.js +14 -2
  7. package/dist/components/homeAssistant/monitorAlerts/BackendAlert.d.ts +1 -1
  8. package/dist/components/homeAssistant/monitorAlerts/BackendAlert.js +2 -2
  9. package/dist/components/homeAssistant/monitorAlerts/alertDetails/AlertFields.d.ts +1 -1
  10. package/dist/components/homeAssistant/monitorAlerts/alertDetails/AlertFields.js +11 -3
  11. package/dist/components/homeAssistant/monitorAlerts/alertDetails/FilterSize.d.ts +2 -0
  12. package/dist/components/homeAssistant/monitorAlerts/alertDetails/FilterSize.js +6 -0
  13. package/dist/components/homeAssistant/monitorAlerts/alertDetails/PurchaseProduct.d.ts +2 -0
  14. package/dist/components/homeAssistant/monitorAlerts/alertDetails/PurchaseProduct.js +26 -0
  15. package/dist/components/homeAssistant/monitorAlerts/alertDetails/SearchField.d.ts +2 -0
  16. package/dist/components/homeAssistant/monitorAlerts/alertDetails/SearchField.js +27 -0
  17. package/dist/components/homeAssistant/monitorAlerts/alertDetails/VideoDetail.js +1 -1
  18. package/dist/components/homeAssistant/monitorAlerts/alertDetails/index.d.ts +3 -0
  19. package/dist/components/homeAssistant/monitorAlerts/alertDetails/index.js +3 -0
  20. package/dist/helpers/forms/dynamicForm.helper.js +3 -2
  21. package/dist/interfaces/forms/dynamicForm/DynamicForm.interface.d.ts +1 -1
  22. package/dist/interfaces/homeAssistant/BackendAlert.interface.d.ts +1 -1
  23. package/dist/interfaces/inputs/SearchInput.interface.d.ts +2 -2
  24. package/dist/mocks/forms/dynamicForm.mock.js +90 -1
  25. package/dist/stories/homeAssistant/monitorAlerts/BackendAlert.stories.js +2 -0
  26. package/package.json +1 -1
  27. package/src/assets/images/filter-size.png +0 -0
  28. package/src/assets/images/index.ts +2 -0
  29. package/src/components/badge/CustomBadge.tsx +4 -2
  30. package/src/components/forms/dynamicForm/fields/TextField.tsx +1 -1
  31. package/src/components/homeAssistant/monitorAlerts/BackendAlert.tsx +4 -2
  32. package/src/components/homeAssistant/monitorAlerts/alertDetails/AlertFields.tsx +17 -4
  33. package/src/components/homeAssistant/monitorAlerts/alertDetails/FilterSize.tsx +19 -0
  34. package/src/components/homeAssistant/monitorAlerts/alertDetails/PurchaseProduct.tsx +78 -0
  35. package/src/components/homeAssistant/monitorAlerts/alertDetails/SearchField.tsx +36 -0
  36. package/src/components/homeAssistant/monitorAlerts/alertDetails/VideoDetail.tsx +1 -1
  37. package/src/components/homeAssistant/monitorAlerts/alertDetails/index.ts +3 -0
  38. package/src/helpers/forms/dynamicForm.helper.ts +4 -2
  39. package/src/interfaces/forms/dynamicForm/DynamicForm.interface.ts +2 -0
  40. package/src/interfaces/homeAssistant/BackendAlert.interface.ts +1 -1
  41. package/src/interfaces/inputs/SearchInput.interface.ts +3 -3
  42. package/src/mocks/forms/dynamicForm.mock.ts +93 -1
  43. package/src/stories/homeAssistant/monitorAlerts/BackendAlert.stories.tsx +2 -0
@@ -53,6 +53,7 @@ import Exclamation from './exclamation.svg';
53
53
  import Face from './face.svg';
54
54
  import Feedback from './feedback.svg';
55
55
  import FileUploading from './file-uploading.svg';
56
+ import FilterSize from './filter-size.png';
56
57
  import Finance from './finance.svg';
57
58
  import Fire from './fire.svg';
58
59
  import Flag from './flag.png';
@@ -161,7 +162,7 @@ import WizardDetailed from './wizard-detailed.svg';
161
162
  import WizardQuick from './wizard-quick.svg';
162
163
  import YellowFolder from './yellow-folder.svg';
163
164
  import YellowFolderUnshared from './yellow-folder-unshared.svg';
164
- export { AlertDelete, AlertDeletePurple, Arrow, Batery, Bathroom, Battery, Battery2, Bedroom, BgBlue, BgLogo, Billing, BillingAddress, BlueFolder, BlueFolderShared, BookOpened, Box, Building, Calc, Calendar2, Catalog, ChatBubble, Check, CheckInCircle, CheckPen, Chemistry, CircleFace, Cleaning, Closet, Clouds, Co2, Company, Company2, ComputerReport, Confirmation, Construction, Contacts, Contacts2, Contributor, Create, CreditCard, Detector, Diamond, DiningRoom, DocIcon, Document, Document2, Drop, DropCalendar, Electricity, Entryway, EstValue, Exclamation, Face, Feedback, FileUploading, Finance, Fire, Flag, FormSent, Foundation, Garage, GearPencil, GearTime, GenericField, GlassWater, GreenFolder, Group, Groups, GuestBedroom, Hallway, HandPencil, Heater, Help, HomeAddress, Homeowner, House, HouseHands, IA, ImageDefault, ImgIcon, Inbox, Insect, Kitchen, Laundry, Light, LivingRoom, Loading, Location, LogoCompany, LogoSmall, MagnifyingGlassReport, Manager, MasterBedroom, Member, Message, MobileDrop, Money, Mudroom, NeedHelp, Office, Painting, PartnerGeneric, Patio, PdfIcon, PersonMail, Plate, Play, Plus, Pool, Pool2, PressureWasher, Price, Profile, ProgressReport, Proposal, RealEstate, Receipt, ReceiptBg, ReceiptHouse, Receipts, Recipient, Records, Register, RelationshipHome, ResendPassword, Rocket, Roof2, Security, Send, ShareHome, ShareWith, SixtyEight, SMS, Social, SolarPanel, Speaker, Sprinkler, Structure, Subscription, Target, Temperature, Theatre, Thumbnail, ThumbnailSmall, ThumbUp, Trash, Trees, TreesCrop, TreesCrop2, VideoIcon, VideoPlay, VioletFolder, Warning, Warranty, WellDone, WholeHome, Wind, WindWhite, Wizard, WizardDetailed, WizardQuick, YellowFolder, YellowFolderUnshared, };
165
+ export { AlertDelete, AlertDeletePurple, Arrow, Batery, Bathroom, Battery, Battery2, Bedroom, BgBlue, BgLogo, Billing, BillingAddress, BlueFolder, BlueFolderShared, BookOpened, Box, Building, Calc, Calendar2, Catalog, ChatBubble, Check, CheckInCircle, CheckPen, Chemistry, CircleFace, Cleaning, Closet, Clouds, Co2, Company, Company2, ComputerReport, Confirmation, Construction, Contacts, Contacts2, Contributor, Create, CreditCard, Detector, Diamond, DiningRoom, DocIcon, Document, Document2, Drop, DropCalendar, Electricity, Entryway, EstValue, Exclamation, Face, Feedback, FileUploading, FilterSize, Finance, Fire, Flag, FormSent, Foundation, Garage, GearPencil, GearTime, GenericField, GlassWater, GreenFolder, Group, Groups, GuestBedroom, Hallway, HandPencil, Heater, Help, HomeAddress, Homeowner, House, HouseHands, IA, ImageDefault, ImgIcon, Inbox, Insect, Kitchen, Laundry, Light, LivingRoom, Loading, Location, LogoCompany, LogoSmall, MagnifyingGlassReport, Manager, MasterBedroom, Member, Message, MobileDrop, Money, Mudroom, NeedHelp, Office, Painting, PartnerGeneric, Patio, PdfIcon, PersonMail, Plate, Play, Plus, Pool, Pool2, PressureWasher, Price, Profile, ProgressReport, Proposal, RealEstate, Receipt, ReceiptBg, ReceiptHouse, Receipts, Recipient, Records, Register, RelationshipHome, ResendPassword, Rocket, Roof2, Security, Send, ShareHome, ShareWith, SixtyEight, SMS, Social, SolarPanel, Speaker, Sprinkler, Structure, Subscription, Target, Temperature, Theatre, Thumbnail, ThumbnailSmall, ThumbUp, Trash, Trees, TreesCrop, TreesCrop2, VideoIcon, VideoPlay, VioletFolder, Warning, Warranty, WellDone, WholeHome, Wind, WindWhite, Wizard, WizardDetailed, WizardQuick, YellowFolder, YellowFolderUnshared, };
165
166
  export * from './alerts';
166
167
  export * from './animations';
167
168
  export * from './appliances';
@@ -53,6 +53,7 @@ import Exclamation from './exclamation.svg';
53
53
  import Face from './face.svg';
54
54
  import Feedback from './feedback.svg';
55
55
  import FileUploading from './file-uploading.svg';
56
+ import FilterSize from './filter-size.png';
56
57
  import Finance from './finance.svg';
57
58
  import Fire from './fire.svg';
58
59
  import Flag from './flag.png';
@@ -161,7 +162,7 @@ import WizardDetailed from './wizard-detailed.svg';
161
162
  import WizardQuick from './wizard-quick.svg';
162
163
  import YellowFolder from './yellow-folder.svg';
163
164
  import YellowFolderUnshared from './yellow-folder-unshared.svg';
164
- export { AlertDelete, AlertDeletePurple, Arrow, Batery, Bathroom, Battery, Battery2, Bedroom, BgBlue, BgLogo, Billing, BillingAddress, BlueFolder, BlueFolderShared, BookOpened, Box, Building, Calc, Calendar2, Catalog, ChatBubble, Check, CheckInCircle, CheckPen, Chemistry, CircleFace, Cleaning, Closet, Clouds, Co2, Company, Company2, ComputerReport, Confirmation, Construction, Contacts, Contacts2, Contributor, Create, CreditCard, Detector, Diamond, DiningRoom, DocIcon, Document, Document2, Drop, DropCalendar, Electricity, Entryway, EstValue, Exclamation, Face, Feedback, FileUploading, Finance, Fire, Flag, FormSent, Foundation, Garage, GearPencil, GearTime, GenericField, GlassWater, GreenFolder, Group, Groups, GuestBedroom, Hallway, HandPencil, Heater, Help, HomeAddress, Homeowner, House, HouseHands, IA, ImageDefault, ImgIcon, Inbox, Insect, Kitchen, Laundry, Light, LivingRoom, Loading, Location, LogoCompany, LogoSmall, MagnifyingGlassReport, Manager, MasterBedroom, Member, Message, MobileDrop, Money, Mudroom, NeedHelp, Office, Painting, PartnerGeneric, Patio, PdfIcon, PersonMail, Plate, Play, Plus, Pool, Pool2, PressureWasher, Price, Profile, ProgressReport, Proposal, RealEstate, Receipt, ReceiptBg, ReceiptHouse, Receipts, Recipient, Records, Register, RelationshipHome, ResendPassword, Rocket, Roof2, Security, Send, ShareHome, ShareWith, SixtyEight, SMS, Social, SolarPanel, Speaker, Sprinkler, Structure, Subscription, Target, Temperature, Theatre, Thumbnail, ThumbnailSmall, ThumbUp, Trash, Trees, TreesCrop, TreesCrop2, VideoIcon, VideoPlay, VioletFolder, Warning, Warranty, WellDone, WholeHome, Wind, WindWhite, Wizard, WizardDetailed, WizardQuick, YellowFolder, YellowFolderUnshared, };
165
+ export { AlertDelete, AlertDeletePurple, Arrow, Batery, Bathroom, Battery, Battery2, Bedroom, BgBlue, BgLogo, Billing, BillingAddress, BlueFolder, BlueFolderShared, BookOpened, Box, Building, Calc, Calendar2, Catalog, ChatBubble, Check, CheckInCircle, CheckPen, Chemistry, CircleFace, Cleaning, Closet, Clouds, Co2, Company, Company2, ComputerReport, Confirmation, Construction, Contacts, Contacts2, Contributor, Create, CreditCard, Detector, Diamond, DiningRoom, DocIcon, Document, Document2, Drop, DropCalendar, Electricity, Entryway, EstValue, Exclamation, Face, Feedback, FileUploading, FilterSize, Finance, Fire, Flag, FormSent, Foundation, Garage, GearPencil, GearTime, GenericField, GlassWater, GreenFolder, Group, Groups, GuestBedroom, Hallway, HandPencil, Heater, Help, HomeAddress, Homeowner, House, HouseHands, IA, ImageDefault, ImgIcon, Inbox, Insect, Kitchen, Laundry, Light, LivingRoom, Loading, Location, LogoCompany, LogoSmall, MagnifyingGlassReport, Manager, MasterBedroom, Member, Message, MobileDrop, Money, Mudroom, NeedHelp, Office, Painting, PartnerGeneric, Patio, PdfIcon, PersonMail, Plate, Play, Plus, Pool, Pool2, PressureWasher, Price, Profile, ProgressReport, Proposal, RealEstate, Receipt, ReceiptBg, ReceiptHouse, Receipts, Recipient, Records, Register, RelationshipHome, ResendPassword, Rocket, Roof2, Security, Send, ShareHome, ShareWith, SixtyEight, SMS, Social, SolarPanel, Speaker, Sprinkler, Structure, Subscription, Target, Temperature, Theatre, Thumbnail, ThumbnailSmall, ThumbUp, Trash, Trees, TreesCrop, TreesCrop2, VideoIcon, VideoPlay, VioletFolder, Warning, Warranty, WellDone, WholeHome, Wind, WindWhite, Wizard, WizardDetailed, WizardQuick, YellowFolder, YellowFolderUnshared, };
165
166
  export * from './alerts';
166
167
  export * from './animations';
167
168
  export * from './appliances';
@@ -53,6 +53,7 @@ import Exclamation from './exclamation.svg'
53
53
  import Face from './face.svg'
54
54
  import Feedback from './feedback.svg'
55
55
  import FileUploading from './file-uploading.svg'
56
+ import FilterSize from './filter-size.png'
56
57
  import Finance from './finance.svg'
57
58
  import Fire from './fire.svg'
58
59
  import Flag from './flag.png'
@@ -218,6 +219,7 @@ export {
218
219
  Face,
219
220
  Feedback,
220
221
  FileUploading,
222
+ FilterSize,
221
223
  Finance,
222
224
  Fire,
223
225
  Flag,
@@ -1,5 +1,4 @@
1
- export declare const CustomBadge: ({ bg, color, label, }: {
2
- bg?: string | undefined;
3
- color?: string | undefined;
4
- label?: string | undefined;
1
+ import { CenterProps } from '@chakra-ui/react';
2
+ export declare const CustomBadge: ({ bg, color, label, ...props }: CenterProps & {
3
+ label?: string;
5
4
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,17 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import { jsx as _jsx } from "react/jsx-runtime";
2
13
  import { Center } from '@chakra-ui/react';
3
- export const CustomBadge = ({ bg = 'neutral.white', color = 'neutral.white', label = '', }) => {
4
- return (_jsx(Center, { bg: bg, fontSize: "xxs", color: color, fontWeight: "bold", py: "1", px: "2", rounded: "md", textTransform: "uppercase", children: label }));
14
+ export const CustomBadge = (_a) => {
15
+ var { bg = 'neutral.white', color = 'neutral.white', label = '' } = _a, props = __rest(_a, ["bg", "color", "label"]);
16
+ return (_jsx(Center, Object.assign({ bg: bg, fontSize: "xxs", color: color, fontWeight: "bold", py: "1", px: "2", rounded: "md", textTransform: "uppercase" }, props, { children: label })));
5
17
  };
@@ -1,2 +1,2 @@
1
1
  import { BackendAlertI } from '../../../interfaces';
2
- export declare const BackendAlert: ({ category, form }: BackendAlertI) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const BackendAlert: ({ category, form, callback }: BackendAlertI) => import("react/jsx-runtime").JSX.Element;
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { AlertFields, BackendAlertCard, TabsHeader } from '../..';
3
3
  import { getCategoryStyles } from '../../../utils/Alerts.utils';
4
4
  import { Divider } from '@chakra-ui/react';
5
- export const BackendAlert = ({ category, form }) => {
5
+ export const BackendAlert = ({ category, form, callback }) => {
6
6
  var _a, _b, _c, _d, _e;
7
7
  const { headerBg, alertIcon, alertIconBg, alertTitle } = getCategoryStyles(category);
8
8
  const alert = form === null || form === void 0 ? void 0 : form.find((item) => item.type === 'alert');
@@ -10,7 +10,7 @@ export const BackendAlert = ({ category, form }) => {
10
10
  var _a;
11
11
  return ({
12
12
  label: tab.name,
13
- component: _jsx(AlertFields, { fields: (_a = tab.children) !== null && _a !== void 0 ? _a : [] }),
13
+ component: (_jsx(AlertFields, { fields: (_a = tab.children) !== null && _a !== void 0 ? _a : [], callback: callback })),
14
14
  });
15
15
  })) !== null && _b !== void 0 ? _b : [];
16
16
  return (_jsxs(BackendAlertCard, { alertBg: headerBg, alertIcon: alertIcon, alertTitle: alertTitle, bg: alertIconBg, icon: (_c = alert === null || alert === void 0 ? void 0 : alert.icon) !== null && _c !== void 0 ? _c : '', title: (_d = alert === null || alert === void 0 ? void 0 : alert.label) !== null && _d !== void 0 ? _d : '', description: (_e = alert === null || alert === void 0 ? void 0 : alert.description) !== null && _e !== void 0 ? _e : '', children: [_jsx(Divider, {}), _jsx(TabsHeader, { tabList: tabs })] }));
@@ -1,2 +1,2 @@
1
1
  import { FieldTypesI } from '../../../../interfaces';
2
- export declare const AlertFields: ({ fields }: FieldTypesI) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const AlertFields: ({ fields, callback }: FieldTypesI) => import("react/jsx-runtime").JSX.Element;
@@ -1,15 +1,23 @@
1
1
  import { createElement as _createElement } from "react";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { Stack, Text } from '@chakra-ui/react';
4
- import { VideoDetail } from './VideoDetail';
5
- export const AlertFields = ({ fields }) => {
4
+ import { FilterSize, PurchaseProduct, SearchField, VideoDetail, } from '../../..';
5
+ import { fieldIcons } from '../../../../helpers';
6
+ export const AlertFields = ({ fields, callback }) => {
6
7
  return (_jsx(Stack, { spacing: "base", p: "base", children: fields === null || fields === void 0 ? void 0 : fields.map((field) => {
7
- const { id, type, value } = field;
8
+ const { id, type, value, icon } = field;
9
+ const mappedIcon = icon && fieldIcons[icon];
8
10
  switch (type) {
9
11
  case 'text':
10
12
  return (_jsx(Text, { fontSize: "sm", fontFamily: "secondary", lineHeight: "1.2", whiteSpace: "pre-line", children: String(value) }, id));
11
13
  case 'video':
12
14
  return _createElement(VideoDetail, Object.assign({}, field, { key: id }));
15
+ case 'filter-size':
16
+ return _createElement(FilterSize, Object.assign({}, field, { key: id, icon: mappedIcon }));
17
+ case 'search':
18
+ return _createElement(SearchField, Object.assign({}, field, { key: id, callback: callback }));
19
+ case 'purchase-product':
20
+ return _createElement(PurchaseProduct, Object.assign({}, field, { key: id, callback: callback }));
13
21
  default:
14
22
  return null;
15
23
  }
@@ -0,0 +1,2 @@
1
+ import { ReportI } from '../../../../interfaces';
2
+ export declare const FilterSize: ({ name, icon, value }: ReportI) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Flex, Image, Stack, Text } from '@chakra-ui/react';
3
+ import { CustomDivider } from '../../..';
4
+ export const FilterSize = ({ name, icon, value }) => {
5
+ return (_jsxs(Stack, { spacing: "base", children: [_jsx(CustomDivider, {}), _jsx(Text, { fontWeight: "semibold", children: name }), _jsxs(Flex, { gap: "base", children: [_jsx(Image, { boxSize: "86px", src: icon }), _jsx(Text, { fontSize: "sm", fontFamily: "secondary", lineHeight: "1.2", children: value })] }), _jsx(CustomDivider, {})] }));
6
+ };
@@ -0,0 +1,2 @@
1
+ import { FieldTypesI, ReportI } from '../../../../interfaces';
2
+ export declare const PurchaseProduct: ({ name, label, icon, comments, value, callback, ...rest }: ReportI & Pick<FieldTypesI, "callback">) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,26 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { CustomBadge, Plus } from '../../..';
14
+ import { colors } from '../../../../theme/colors';
15
+ import { AspectRatio, Container, Flex, IconButton, Image, Stack, Text, } from '@chakra-ui/react';
16
+ export const PurchaseProduct = (_a) => {
17
+ var _b;
18
+ var { name, label, icon, comments, value, callback } = _a, rest = __rest(_a, ["name", "label", "icon", "comments", "value", "callback"]);
19
+ const bgs = {
20
+ best: '#232669',
21
+ better: '#424CBF',
22
+ good: '#5C81C7',
23
+ };
24
+ const bg = bgs[(_b = label === null || label === void 0 ? void 0 : label.toLowerCase()) !== null && _b !== void 0 ? _b : 'best'];
25
+ return (_jsxs(Container, { p: "base", position: "relative", boxShadow: "md", children: [_jsx(CustomBadge, { label: label, bg: bg, position: "absolute", top: "2", left: "-1", zIndex: "3" }), _jsxs(Flex, { gap: "base", ml: "6", children: [_jsx(AspectRatio, { ratio: 1, minW: "70px", h: "auto", children: _jsx(Image, { src: icon, alt: name, objectFit: "cover", w: "100%", h: "100%" }) }), _jsxs(Stack, { spacing: "0", children: [_jsx(Text, { fontWeight: "semibold", fontSize: "sm", noOfLines: 2, overflow: "hidden", textOverflow: "ellipsis", children: name }), _jsxs(Flex, { alignSelf: "end", gap: "base", align: "center", children: [_jsxs(Stack, { spacing: "0", align: "end", children: [_jsx(Text, { fontSize: "xs", fontFamily: "secondary", color: "red", children: comments }), _jsx(Text, { fontSize: "sm", fontWeight: "bold", lineHeight: "1.2", children: value })] }), _jsx(IconButton, { w: "2rem", h: "2rem", "aria-label": "Add product", variant: "iconOutlined", icon: _jsx(Plus, { size: 20, stroke: colors.blue['3'] }), onClick: () => callback === null || callback === void 0 ? void 0 : callback(Object.assign({ name, icon, value: String(value) }, rest)) })] })] })] })] }));
26
+ };
@@ -0,0 +1,2 @@
1
+ import { FieldTypesI, ReportI } from '../../../../interfaces';
2
+ export declare const SearchField: ({ callback, description, ...props }: ReportI & Pick<FieldTypesI, "callback">) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,27 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { Stack, Text } from '@chakra-ui/react';
14
+ import { SearchInput } from '../../..';
15
+ import { useState } from 'react';
16
+ export const SearchField = (_a) => {
17
+ var { callback, description } = _a, props = __rest(_a, ["callback", "description"]);
18
+ const [search, setSearch] = useState('');
19
+ const handleSearch = (value) => {
20
+ callback === null || callback === void 0 ? void 0 : callback(Object.assign(Object.assign({}, props), { value }));
21
+ };
22
+ return (_jsxs(Stack, { spacing: "base", children: [_jsx(Text, { fontSize: "sm", fontFamily: "secondary", lineHeight: "1.2", children: description }), _jsx(SearchInput, { onChange: (e) => setSearch(e.target.value), value: search, maxW: "full", onBlur: () => handleSearch(search), onKeyDown: (e) => {
23
+ if (e.key === 'Enter') {
24
+ handleSearch(search);
25
+ }
26
+ } })] }));
27
+ };
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { AspectRatio, Box, Container, Flex, Text } from '@chakra-ui/react';
3
3
  export const VideoDetail = ({ name, label, link, description }) => {
4
- return (_jsx(Container, { p: "base", children: _jsxs(Flex, { gap: "base", children: [_jsx(AspectRatio, { w: "140px", ratio: 16 / 9, children: _jsx("iframe", { title: name, src: link, allowFullScreen: true }) }), _jsxs(Box, { children: [_jsx(Text, { fontWeight: "semibold", children: name }), _jsx(Text, { fontSize: "sm", fontFamily: "secondary", children: `${label} | ${description}` })] })] }) }));
4
+ return (_jsx(Container, { p: "base", boxShadow: "md", children: _jsxs(Flex, { gap: "base", children: [_jsx(AspectRatio, { w: "140px", ratio: 16 / 9, children: _jsx("iframe", { title: name, src: link, allowFullScreen: true }) }), _jsxs(Box, { children: [_jsx(Text, { fontWeight: "semibold", children: name }), _jsx(Text, { fontSize: "sm", fontFamily: "secondary", children: `${label} | ${description}` })] })] }) }));
5
5
  };
@@ -1,6 +1,9 @@
1
1
  export * from './AlertFields';
2
2
  export * from './ChangeAirFilter';
3
3
  export * from './CustomDivider';
4
+ export * from './FilterSize';
5
+ export * from './PurchaseProduct';
6
+ export * from './SearchField';
4
7
  export * from './SmokeDetectorBattery';
5
8
  export * from './SmokeDetectorExpired';
6
9
  export * from './VideoDetail';
@@ -1,6 +1,9 @@
1
1
  export * from './AlertFields';
2
2
  export * from './ChangeAirFilter';
3
3
  export * from './CustomDivider';
4
+ export * from './FilterSize';
5
+ export * from './PurchaseProduct';
6
+ export * from './SearchField';
4
7
  export * from './SmokeDetectorBattery';
5
8
  export * from './SmokeDetectorExpired';
6
9
  export * from './VideoDetail';
@@ -1,4 +1,4 @@
1
- import { Paint, Receipt, Barcode, GoldenBars, Heart, Rating, Notes, Book, ImgIcon, Registry, ShareWith, Calendar, Contacts, Tools2, Billing, Calc, CheckPen, GenericField, Price, Battery2, Co2, Detector, Electricity, Sprinkler, SixtyEight, DropCalendar, MobileDrop, SolarPanel, Calendar2, Drop, Wind, Foundation, Heater, Light, Plate, Pool2, Closet, Structure, GlassWater, Roof2, Target, CircleFace, Pressure, WindowCleaning, RoofCleaning, HolidayLights, GutterCleaning, HomeCleaning, HouseWashing, PressureWasher, BookOpened, Company2, AADisease, AADressing, AALawn, AAMowing, AAWeed, AApest } from '../../assets/images';
1
+ import { Paint, Receipt, Barcode, GoldenBars, Heart, Rating, Notes, Book, ImgIcon, Registry, ShareWith, Calendar, Contacts, Tools2, Billing, Calc, CheckPen, GenericField, Price, Battery2, Co2, Detector, Electricity, Sprinkler, SixtyEight, DropCalendar, MobileDrop, SolarPanel, Calendar2, Drop, Wind, Foundation, Heater, Light, Plate, Pool2, Closet, Structure, GlassWater, Roof2, Target, CircleFace, Pressure, WindowCleaning, RoofCleaning, HolidayLights, GutterCleaning, HomeCleaning, HouseWashing, PressureWasher, BookOpened, Company2, AADisease, AADressing, AALawn, AAMowing, AAWeed, AApest, FilterSize, } from '../../assets/images';
2
2
  export const fieldIcons = {
3
3
  barcode: Barcode,
4
4
  billing: Billing,
@@ -58,5 +58,6 @@ export const fieldIcons = {
58
58
  'aa-disease': AADisease,
59
59
  'aa-weed': AAWeed,
60
60
  'aa-dressing': AADressing,
61
- 'aa-pest': AApest
61
+ 'aa-pest': AApest,
62
+ 'filter-size': FilterSize,
62
63
  };
@@ -3,7 +3,7 @@ export type KindTypes = 'ai-image' | 'ai-grid' | 'checkbox' | 'checkbox-agreemen
3
3
  export type UIKindTypes = 'tile-body' | 'tile-body-logo' | 'tile-body-header' | 'tile-body-section' | 'tile-body-section-grid' | 'tile-body-partner-image' | 'tile-body-description' | 'tile-form' | 'tile-body-action' | 'vertical-icon' | 'primary-cta' | 'secondary-cta';
4
4
  export type HomeItemTypes = 'appliances' | 'images' | 'guidelines' | 'item-related' | 'item-icon-btn';
5
5
  export type IconTypes = 'barcode' | 'battery' | 'billing' | 'book' | 'book-opened' | 'calc' | 'calendar' | 'check' | 'co2' | 'contact' | 'date' | 'default' | 'detector' | 'electricity' | 'goldbars' | 'heart' | 'image' | 'notes' | 'palette' | 'people' | 'price' | 'rating' | 'receipt' | 'registry' | 'sprinkler' | 'tools' | 'wind' | '68' | 'calendar2' | 'water' | 'calendar-drop' | 'umbrella' | 'heater' | 'roof' | 'foundation' | 'solar-panel' | 'pool' | 'drop' | 'mobile-drop' | 'light' | 'plate' | 'pressure-washer' | 'house' | 'target' | 'title' | 'company' | UIIconTypes;
6
- export type UIIconTypes = 'sh-pressure' | 'sh-window' | 'sh-roof' | 'sh-lights' | 'sh-gutter' | 'sh-home' | 'sh-house' | 'aa-mowing' | 'aa-fertilization' | 'aa-disease' | 'aa-weed' | 'aa-dressing' | 'aa-pest';
6
+ export type UIIconTypes = 'sh-pressure' | 'sh-window' | 'sh-roof' | 'sh-lights' | 'sh-gutter' | 'sh-home' | 'sh-house' | 'aa-mowing' | 'aa-fertilization' | 'aa-disease' | 'aa-weed' | 'aa-dressing' | 'aa-pest' | 'filter-size' | string;
7
7
  export type ValueTypes = string | string[] | number | boolean;
8
8
  export type OptionsTypes = string[] | number[] | null;
9
9
  export interface ReportI {
@@ -1,7 +1,7 @@
1
1
  import { DynamicFormI } from '..';
2
2
  export type AlertCategory = 'safeguard' | 'maintain' | 'budget' | 'improve';
3
3
  export type AlertTabType = 'details' | 'filter-size' | 'purchase' | 'hire-out';
4
- export type AlertFieldType = 'alert' | 'iconSection' | 'tabList' | 'list';
4
+ export type AlertFieldType = 'alert' | 'search' | 'purchase-product';
5
5
  export interface BackendAlertI extends DynamicFormI {
6
6
  category: AlertCategory;
7
7
  }
@@ -1,5 +1,5 @@
1
- import { ChakraProps } from "@chakra-ui/react";
2
- export interface SearchInputI extends ChakraProps {
1
+ import { InputProps } from '@chakra-ui/react';
2
+ export interface SearchInputI extends InputProps {
3
3
  maxW?: string;
4
4
  onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
5
5
  placeholder?: string;
@@ -852,7 +852,7 @@ export const alertFieldsMock = [
852
852
  {
853
853
  id: faker.database.mongodbObjectId(),
854
854
  name: 'Details',
855
- label: 'Model or Serial',
855
+ label: '',
856
856
  description: faker.lorem.sentence(),
857
857
  comments: faker.lorem.sentence(),
858
858
  value: '',
@@ -891,6 +891,95 @@ export const alertFieldsMock = [
891
891
  value: faker.image.urlPicsumPhotos(),
892
892
  type: 'filter-size',
893
893
  visible: true,
894
+ children: [
895
+ {
896
+ id: faker.database.mongodbObjectId(),
897
+ name: '',
898
+ label: '',
899
+ description: '',
900
+ comments: '',
901
+ value: 'Home air filters are typically located in the HVAC system’s return air vent, furnace compartment, or air handler, usually near the blower unit or ductwork intake.',
902
+ type: 'text',
903
+ visible: true,
904
+ },
905
+ {
906
+ id: faker.database.mongodbObjectId(),
907
+ name: 'Check the filter:',
908
+ label: '',
909
+ description: '',
910
+ comments: '',
911
+ icon: 'filter-size',
912
+ value: 'The size of the filter is usually printed on the side of the filter in inches. The size may be written as length x width x depth. For example, a filter that is 16 in long, 20 in wide, and 1 in deep would be written as 16 x 20 x 1. ',
913
+ type: 'filter-size',
914
+ visible: true,
915
+ },
916
+ {
917
+ id: faker.database.mongodbObjectId(),
918
+ name: '',
919
+ label: '',
920
+ description: 'or enter your air conditioning/furnace model number below.',
921
+ comments: '',
922
+ value: '',
923
+ type: 'search',
924
+ visible: true,
925
+ },
926
+ ],
927
+ },
928
+ {
929
+ id: faker.database.mongodbObjectId(),
930
+ name: 'Purchase',
931
+ label: '',
932
+ description: faker.lorem.sentence(),
933
+ comments: faker.lorem.sentence(),
934
+ value: '',
935
+ type: 'purchase',
936
+ visible: true,
937
+ children: [
938
+ {
939
+ id: faker.database.mongodbObjectId(),
940
+ name: 'Filtrete™ Allergen Defense Furnace AC Air Filter 1000 MPR',
941
+ label: 'best',
942
+ description: '',
943
+ icon: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT50sebT9p-twQB-DdM2tlRo12In8F09QCsmg&s',
944
+ comments: 'Save 20% off Retail',
945
+ value: '$22.99',
946
+ type: 'purchase-product',
947
+ visible: true,
948
+ },
949
+ {
950
+ id: faker.database.mongodbObjectId(),
951
+ name: 'Filtrete™ Smart Allergen Bacteria & Virus Furnace AC Air Filter MPR 1500',
952
+ label: 'better',
953
+ description: '',
954
+ icon: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSbFpjG3kybZDb6psqPIlQSoXgp9OjOR672kg&s',
955
+ comments: 'Save 28% off Retail',
956
+ value: '$16.99',
957
+ type: 'purchase-product',
958
+ visible: true,
959
+ },
960
+ {
961
+ id: faker.database.mongodbObjectId(),
962
+ name: 'Filtrete™ 700 MPR Dust Pollen and Pet Dander Electrostatic Air Filter',
963
+ label: 'good',
964
+ description: '',
965
+ icon: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ7j1KYfPZqPnFmTgyx7b9pp78N6RForQfZFQ&s',
966
+ comments: 'Save 24% off Retail',
967
+ value: '$10.99',
968
+ type: 'purchase-product',
969
+ visible: true,
970
+ },
971
+ ],
972
+ },
973
+ {
974
+ id: faker.database.mongodbObjectId(),
975
+ name: 'Hire out',
976
+ label: '',
977
+ description: faker.lorem.sentence(),
978
+ comments: faker.lorem.sentence(),
979
+ value: faker.image.urlPicsumPhotos(),
980
+ type: 'hire-out',
981
+ visible: true,
982
+ children: [],
894
983
  },
895
984
  ],
896
985
  },
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { action } from '@storybook/addon-actions';
2
3
  import { BackendAlert } from '../../../components';
3
4
  import { alertFieldsMock } from '../../../mocks';
4
5
  export default {
@@ -7,6 +8,7 @@ export default {
7
8
  args: {
8
9
  category: 'budget',
9
10
  form: alertFieldsMock,
11
+ callback: action('onClick'),
10
12
  },
11
13
  };
12
14
  export const BackendAlertComponent = (args) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.18.0",
3
+ "version": "2.20.0",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",
@@ -53,6 +53,7 @@ import Exclamation from './exclamation.svg'
53
53
  import Face from './face.svg'
54
54
  import Feedback from './feedback.svg'
55
55
  import FileUploading from './file-uploading.svg'
56
+ import FilterSize from './filter-size.png'
56
57
  import Finance from './finance.svg'
57
58
  import Fire from './fire.svg'
58
59
  import Flag from './flag.png'
@@ -218,6 +219,7 @@ export {
218
219
  Face,
219
220
  Feedback,
220
221
  FileUploading,
222
+ FilterSize,
221
223
  Finance,
222
224
  Fire,
223
225
  Flag,
@@ -1,10 +1,11 @@
1
- import { Center } from '@chakra-ui/react'
1
+ import { Center, CenterProps } from '@chakra-ui/react'
2
2
 
3
3
  export const CustomBadge = ({
4
4
  bg = 'neutral.white',
5
5
  color = 'neutral.white',
6
6
  label = '',
7
- }) => {
7
+ ...props
8
+ }: CenterProps & { label?: string }) => {
8
9
  return (
9
10
  <Center
10
11
  bg={bg}
@@ -15,6 +16,7 @@ export const CustomBadge = ({
15
16
  px="2"
16
17
  rounded="md"
17
18
  textTransform="uppercase"
19
+ {...props}
18
20
  >
19
21
  {label}
20
22
  </Center>
@@ -1,6 +1,6 @@
1
1
  import { Controller, useFormContext } from 'react-hook-form'
2
2
  import { Flex } from '@chakra-ui/react'
3
- import { FormIcon, TextInput } from '@/components'
3
+ import { TextInput } from '@/components'
4
4
  import { TextFieldI } from '@/interfaces'
5
5
 
6
6
  export const TextField = ({
@@ -3,7 +3,7 @@ import { BackendAlertI, TabI } from '@/interfaces'
3
3
  import { getCategoryStyles } from '@/utils/Alerts.utils'
4
4
  import { Divider } from '@chakra-ui/react'
5
5
 
6
- export const BackendAlert = ({ category, form }: BackendAlertI) => {
6
+ export const BackendAlert = ({ category, form, callback }: BackendAlertI) => {
7
7
  const { headerBg, alertIcon, alertIconBg, alertTitle } =
8
8
  getCategoryStyles(category)
9
9
  const alert = form?.find((item) => item.type === 'alert')
@@ -13,7 +13,9 @@ export const BackendAlert = ({ category, form }: BackendAlertI) => {
13
13
  (tab) =>
14
14
  ({
15
15
  label: tab.name,
16
- component: <AlertFields fields={tab.children ?? []} />,
16
+ component: (
17
+ <AlertFields fields={tab.children ?? []} callback={callback} />
18
+ ),
17
19
  } as TabI)
18
20
  ) ?? []
19
21
 
@@ -1,12 +1,19 @@
1
- import { FieldTypesI } from '@/interfaces'
1
+ import { FieldTypesI, IconTypes } from '@/interfaces'
2
2
  import { Box, Stack, Text } from '@chakra-ui/react'
3
- import { VideoDetail } from './VideoDetail'
3
+ import {
4
+ FilterSize,
5
+ PurchaseProduct,
6
+ SearchField,
7
+ VideoDetail,
8
+ } from '@/components'
9
+ import { fieldIcons } from '@/helpers'
4
10
 
5
- export const AlertFields = ({ fields }: FieldTypesI) => {
11
+ export const AlertFields = ({ fields, callback }: FieldTypesI) => {
6
12
  return (
7
13
  <Stack spacing="base" p="base">
8
14
  {fields?.map((field) => {
9
- const { id, type, value } = field
15
+ const { id, type, value, icon } = field
16
+ const mappedIcon = icon && (fieldIcons[icon] as IconTypes)
10
17
  switch (type) {
11
18
  case 'text':
12
19
  return (
@@ -22,6 +29,12 @@ export const AlertFields = ({ fields }: FieldTypesI) => {
22
29
  )
23
30
  case 'video':
24
31
  return <VideoDetail {...field} key={id} />
32
+ case 'filter-size':
33
+ return <FilterSize {...field} key={id} icon={mappedIcon} />
34
+ case 'search':
35
+ return <SearchField {...field} key={id} callback={callback} />
36
+ case 'purchase-product':
37
+ return <PurchaseProduct {...field} key={id} callback={callback} />
25
38
  default:
26
39
  return null
27
40
  }
@@ -0,0 +1,19 @@
1
+ import { Flex, Image, Stack, Text } from '@chakra-ui/react'
2
+ import { CustomDivider } from '@/components'
3
+ import { ReportI } from '@/interfaces'
4
+
5
+ export const FilterSize = ({ name, icon, value }: ReportI) => {
6
+ return (
7
+ <Stack spacing="base">
8
+ <CustomDivider />
9
+ <Text fontWeight="semibold">{name}</Text>
10
+ <Flex gap="base">
11
+ <Image boxSize="86px" src={icon} />
12
+ <Text fontSize="sm" fontFamily="secondary" lineHeight="1.2">
13
+ {value}
14
+ </Text>
15
+ </Flex>
16
+ <CustomDivider />
17
+ </Stack>
18
+ )
19
+ }
@@ -0,0 +1,78 @@
1
+ import { CustomBadge, Plus } from '@/components'
2
+ import { FieldTypesI, ReportI } from '@/interfaces'
3
+ import { colors } from '@/theme/colors'
4
+ import {
5
+ AspectRatio,
6
+ Container,
7
+ Flex,
8
+ IconButton,
9
+ Image,
10
+ Stack,
11
+ Text,
12
+ } from '@chakra-ui/react'
13
+
14
+ export const PurchaseProduct = ({
15
+ name,
16
+ label,
17
+ icon,
18
+ comments,
19
+ value,
20
+ callback,
21
+ ...rest
22
+ }: ReportI & Pick<FieldTypesI, 'callback'>) => {
23
+ const bgs = {
24
+ best: '#232669',
25
+ better: '#424CBF',
26
+ good: '#5C81C7',
27
+ }
28
+ const bg = bgs[(label?.toLowerCase() as keyof typeof bgs) ?? 'best']
29
+ return (
30
+ <Container p="base" position="relative" boxShadow="md">
31
+ <CustomBadge
32
+ label={label}
33
+ bg={bg}
34
+ position="absolute"
35
+ top="2"
36
+ left="-1"
37
+ zIndex="3"
38
+ />
39
+ <Flex gap="base" ml="6">
40
+ <AspectRatio ratio={1} minW="70px" h="auto">
41
+ <Image src={icon} alt={name} objectFit="cover" w="100%" h="100%" />
42
+ </AspectRatio>
43
+
44
+ <Stack spacing="0">
45
+ <Text
46
+ fontWeight="semibold"
47
+ fontSize="sm"
48
+ noOfLines={2}
49
+ overflow="hidden"
50
+ textOverflow="ellipsis"
51
+ >
52
+ {name}
53
+ </Text>
54
+ <Flex alignSelf="end" gap="base" align="center">
55
+ <Stack spacing="0" align="end">
56
+ <Text fontSize="xs" fontFamily="secondary" color="red">
57
+ {comments}
58
+ </Text>
59
+ <Text fontSize="sm" fontWeight="bold" lineHeight="1.2">
60
+ {value}
61
+ </Text>
62
+ </Stack>
63
+ <IconButton
64
+ w="2rem"
65
+ h="2rem"
66
+ aria-label="Add product"
67
+ variant="iconOutlined"
68
+ icon={<Plus size={20} stroke={colors.blue['3']} />}
69
+ onClick={() =>
70
+ callback?.({ name, icon, value: String(value), ...rest })
71
+ }
72
+ />
73
+ </Flex>
74
+ </Stack>
75
+ </Flex>
76
+ </Container>
77
+ )
78
+ }
@@ -0,0 +1,36 @@
1
+ import { Stack, Text } from '@chakra-ui/react'
2
+ import { SearchInput } from '@/components'
3
+ import { FieldTypesI, ReportI } from '@/interfaces'
4
+ import { useState } from 'react'
5
+
6
+ export const SearchField = ({
7
+ callback,
8
+ description,
9
+ ...props
10
+ }: ReportI & Pick<FieldTypesI, 'callback'>) => {
11
+ const [search, setSearch] = useState('')
12
+ const handleSearch = (value: string) => {
13
+ callback?.({
14
+ ...props,
15
+ value,
16
+ })
17
+ }
18
+ return (
19
+ <Stack spacing="base">
20
+ <Text fontSize="sm" fontFamily="secondary" lineHeight="1.2">
21
+ {description}
22
+ </Text>
23
+ <SearchInput
24
+ onChange={(e) => setSearch(e.target.value)}
25
+ value={search}
26
+ maxW="full"
27
+ onBlur={() => handleSearch(search)}
28
+ onKeyDown={(e) => {
29
+ if (e.key === 'Enter') {
30
+ handleSearch(search)
31
+ }
32
+ }}
33
+ />
34
+ </Stack>
35
+ )
36
+ }
@@ -3,7 +3,7 @@ import { AspectRatio, Box, Container, Flex, Text } from '@chakra-ui/react'
3
3
 
4
4
  export const VideoDetail = ({ name, label, link, description }: ReportI) => {
5
5
  return (
6
- <Container p="base">
6
+ <Container p="base" boxShadow="md">
7
7
  <Flex gap="base">
8
8
  <AspectRatio w="140px" ratio={16 / 9}>
9
9
  <iframe title={name} src={link} allowFullScreen />
@@ -1,6 +1,9 @@
1
1
  export * from './AlertFields'
2
2
  export * from './ChangeAirFilter'
3
3
  export * from './CustomDivider'
4
+ export * from './FilterSize'
5
+ export * from './PurchaseProduct'
6
+ export * from './SearchField'
4
7
  export * from './SmokeDetectorBattery'
5
8
  export * from './SmokeDetectorExpired'
6
9
  export * from './VideoDetail'
@@ -56,7 +56,8 @@ import {
56
56
  AALawn,
57
57
  AAMowing,
58
58
  AAWeed,
59
- AApest
59
+ AApest,
60
+ FilterSize,
60
61
  } from '@/assets/images'
61
62
  import { IconTypes } from '@/interfaces'
62
63
 
@@ -119,5 +120,6 @@ export const fieldIcons: Record<IconTypes, string> = {
119
120
  'aa-disease': AADisease,
120
121
  'aa-weed': AAWeed,
121
122
  'aa-dressing': AADressing,
122
- 'aa-pest': AApest
123
+ 'aa-pest': AApest,
124
+ 'filter-size': FilterSize,
123
125
  }
@@ -122,6 +122,8 @@ export type UIIconTypes =
122
122
  | 'aa-weed'
123
123
  | 'aa-dressing'
124
124
  | 'aa-pest'
125
+ | 'filter-size'
126
+ | string
125
127
 
126
128
  export type ValueTypes = string | string[] | number | boolean
127
129
  export type OptionsTypes = string[] | number[] | null
@@ -4,7 +4,7 @@ export type AlertCategory = 'safeguard' | 'maintain' | 'budget' | 'improve'
4
4
 
5
5
  export type AlertTabType = 'details' | 'filter-size' | 'purchase' | 'hire-out'
6
6
 
7
- export type AlertFieldType = 'alert' | 'iconSection' | 'tabList' | 'list'
7
+ export type AlertFieldType = 'alert' | 'search' | 'purchase-product'
8
8
 
9
9
  export interface BackendAlertI extends DynamicFormI {
10
10
  category: AlertCategory
@@ -1,9 +1,9 @@
1
- import { ChakraProps } from "@chakra-ui/react"
1
+ import { InputProps } from '@chakra-ui/react'
2
2
 
3
- export interface SearchInputI extends ChakraProps {
3
+ export interface SearchInputI extends InputProps {
4
4
  maxW?: string
5
5
  onChange: (e: React.ChangeEvent<HTMLInputElement>) => void
6
6
  placeholder?: string
7
7
  size?: string
8
8
  value: string
9
- }
9
+ }
@@ -868,7 +868,7 @@ export const alertFieldsMock: ReportI[] = [
868
868
  {
869
869
  id: faker.database.mongodbObjectId(),
870
870
  name: 'Details',
871
- label: 'Model or Serial',
871
+ label: '',
872
872
  description: faker.lorem.sentence(),
873
873
  comments: faker.lorem.sentence(),
874
874
  value: '',
@@ -908,6 +908,98 @@ export const alertFieldsMock: ReportI[] = [
908
908
  value: faker.image.urlPicsumPhotos(),
909
909
  type: 'filter-size',
910
910
  visible: true,
911
+ children: [
912
+ {
913
+ id: faker.database.mongodbObjectId(),
914
+ name: '',
915
+ label: '',
916
+ description: '',
917
+ comments: '',
918
+ value:
919
+ 'Home air filters are typically located in the HVAC system’s return air vent, furnace compartment, or air handler, usually near the blower unit or ductwork intake.',
920
+ type: 'text',
921
+ visible: true,
922
+ },
923
+ {
924
+ id: faker.database.mongodbObjectId(),
925
+ name: 'Check the filter:',
926
+ label: '',
927
+ description: '',
928
+ comments: '',
929
+ icon: 'filter-size',
930
+ value:
931
+ 'The size of the filter is usually printed on the side of the filter in inches. The size may be written as length x width x depth. For example, a filter that is 16 in long, 20 in wide, and 1 in deep would be written as 16 x 20 x 1. ',
932
+ type: 'filter-size',
933
+ visible: true,
934
+ },
935
+ {
936
+ id: faker.database.mongodbObjectId(),
937
+ name: '',
938
+ label: '',
939
+ description:
940
+ 'or enter your air conditioning/furnace model number below.',
941
+ comments: '',
942
+ value: '',
943
+ type: 'search',
944
+ visible: true,
945
+ },
946
+ ],
947
+ },
948
+ {
949
+ id: faker.database.mongodbObjectId(),
950
+ name: 'Purchase',
951
+ label: '',
952
+ description: faker.lorem.sentence(),
953
+ comments: faker.lorem.sentence(),
954
+ value: '',
955
+ type: 'purchase',
956
+ visible: true,
957
+ children: [
958
+ {
959
+ id: faker.database.mongodbObjectId(),
960
+ name: 'Filtrete™ Allergen Defense Furnace AC Air Filter 1000 MPR',
961
+ label: 'best',
962
+ description: '',
963
+ icon: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT50sebT9p-twQB-DdM2tlRo12In8F09QCsmg&s',
964
+ comments: 'Save 20% off Retail',
965
+ value: '$22.99',
966
+ type: 'purchase-product',
967
+ visible: true,
968
+ },
969
+ {
970
+ id: faker.database.mongodbObjectId(),
971
+ name: 'Filtrete™ Smart Allergen Bacteria & Virus Furnace AC Air Filter MPR 1500',
972
+ label: 'better',
973
+ description: '',
974
+ icon: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSbFpjG3kybZDb6psqPIlQSoXgp9OjOR672kg&s',
975
+ comments: 'Save 28% off Retail',
976
+ value: '$16.99',
977
+ type: 'purchase-product',
978
+ visible: true,
979
+ },
980
+ {
981
+ id: faker.database.mongodbObjectId(),
982
+ name: 'Filtrete™ 700 MPR Dust Pollen and Pet Dander Electrostatic Air Filter',
983
+ label: 'good',
984
+ description: '',
985
+ icon: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ7j1KYfPZqPnFmTgyx7b9pp78N6RForQfZFQ&s',
986
+ comments: 'Save 24% off Retail',
987
+ value: '$10.99',
988
+ type: 'purchase-product',
989
+ visible: true,
990
+ },
991
+ ],
992
+ },
993
+ {
994
+ id: faker.database.mongodbObjectId(),
995
+ name: 'Hire out',
996
+ label: '',
997
+ description: faker.lorem.sentence(),
998
+ comments: faker.lorem.sentence(),
999
+ value: faker.image.urlPicsumPhotos(),
1000
+ type: 'hire-out',
1001
+ visible: true,
1002
+ children: [],
911
1003
  },
912
1004
  ],
913
1005
  },
@@ -1,4 +1,5 @@
1
1
  import { Meta } from '@storybook/react'
2
+ import { action } from '@storybook/addon-actions'
2
3
  import { BackendAlert } from '@/components'
3
4
  import { BackendAlertI } from '@/interfaces'
4
5
  import { alertFieldsMock } from '@/mocks'
@@ -9,6 +10,7 @@ export default {
9
10
  args: {
10
11
  category: 'budget',
11
12
  form: alertFieldsMock,
13
+ callback: action('onClick'),
12
14
  },
13
15
  } as Meta<BackendAlertI>
14
16