@homefile/components-v2 1.6.1 → 2.1.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/components/animations/CloudsAnimation.d.ts +5 -5
- package/dist/components/animations/CloudsAnimation.js +2 -1
- package/dist/components/animations/HomieAnimation.js +1 -1
- package/dist/components/customToast/CustomToast.js +1 -1
- package/dist/components/customToast/StatusIllustration.js +3 -3
- package/dist/components/forms/dynamicForm/DynamicForm.d.ts +1 -1
- package/dist/components/forms/dynamicForm/DynamicForm.js +16 -2
- package/dist/components/forms/dynamicForm/fields/SingleFields.d.ts +2 -5
- package/dist/components/forms/dynamicForm/fields/SingleFields.js +16 -2
- package/dist/components/forms/dynamicForm/fields/index.d.ts +1 -0
- package/dist/components/forms/dynamicForm/fields/index.js +1 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBody.d.ts +2 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBody.js +18 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBody.tsx +24 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyAction.d.ts +2 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyAction.js +6 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyAction.tsx +11 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyHeader.d.ts +3 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyHeader.js +5 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyHeader.tsx +9 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyLogo.d.ts +2 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyLogo.js +5 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyLogo.tsx +10 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBodySectionGrid.d.ts +2 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBodySectionGrid.js +6 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileBodySectionGrid.tsx +11 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileCta.d.ts +2 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileCta.js +5 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/TileCta.tsx +14 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/VerticalIcon.d.ts +2 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/VerticalIcon.js +5 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/VerticalIcon.tsx +31 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/index.d.ts +7 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/index.js +7 -0
- package/dist/components/forms/dynamicForm/fields/uiFields/index.ts +7 -0
- package/dist/components/homeBoard/ConfirmHomeAddress.js +2 -1
- package/dist/components/icons/DisplayGrid.js +1 -1
- package/dist/components/icons/DisplayItem.js +1 -1
- package/dist/components/icons/DisplayList.js +1 -1
- package/dist/components/icons/Upload.js +1 -1
- package/dist/components/inputs/SelectInputWithBadge.js +3 -3
- package/dist/components/myHomes/steps/MyHomeDetails.js +2 -1
- package/dist/components/myHomes/steps/SearchRecords.js +2 -1
- package/dist/components/overlay/Overlay.js +2 -1
- package/dist/components/partner/adminTiles/satisfactionTile/SatisfactionProgress.js +2 -1
- package/dist/components/sendDocument/RecipientContent.js +3 -1
- package/dist/helpers/forms/dynamicForm.helper.js +7 -1
- package/dist/hooks/homeBoard/useConfirmHomeAddress.d.ts +3 -18
- package/dist/hooks/myHomes/useAddHomeContent.d.ts +3 -18
- package/dist/hooks/myProfile/useTwoFactorSetting.d.ts +3 -18
- package/dist/hooks/partner/preview/usePartnerTilePreview.d.ts +2 -2
- package/dist/interfaces/forms/dynamicForm/DynamicForm.interface.d.ts +9 -4
- package/dist/interfaces/forms/dynamicForm/fields/GroupField.interface.d.ts +6 -1
- package/dist/interfaces/forms/dynamicForm/fields/UIFields.interface.d.ts +20 -0
- package/dist/interfaces/forms/dynamicForm/fields/UIFields.interface.js +1 -0
- package/dist/interfaces/forms/dynamicForm/fields/index.d.ts +1 -0
- package/dist/interfaces/forms/dynamicForm/fields/index.js +1 -0
- package/dist/interfaces/icons/CustomIcon.interface.d.ts +2 -3
- package/dist/interfaces/partner/PartnerFooter.interface.d.ts +0 -1
- package/dist/mocks/forms/dynamicForm.mock.d.ts +1 -0
- package/dist/mocks/forms/dynamicForm.mock.js +159 -0
- package/dist/stories/forms/dynamicForm/DynamicForm.stories.d.ts +1 -0
- package/dist/stories/forms/dynamicForm/DynamicForm.stories.js +9 -3
- package/dist/stories/tour/Bubble.stories.d.ts +1 -1
- package/dist/stories/tour/HomeBoardTour.stories.d.ts +1 -1
- package/dist/stories/tour/LaunchpadTour.stories.d.ts +1 -1
- package/package.json +44 -43
- package/src/components/animations/CloudsAnimation.tsx +2 -1
- package/src/components/animations/HomieAnimation.tsx +1 -1
- package/src/components/customToast/CustomToast.tsx +4 -3
- package/src/components/customToast/StatusIllustration.tsx +3 -3
- package/src/components/forms/dynamicForm/DynamicForm.tsx +14 -0
- package/src/components/forms/dynamicForm/fields/SingleFields.tsx +62 -6
- package/src/components/forms/dynamicForm/fields/index.ts +1 -0
- package/src/components/forms/dynamicForm/fields/uiFields/TileBody.tsx +24 -0
- package/src/components/forms/dynamicForm/fields/uiFields/TileBodyAction.tsx +11 -0
- package/src/components/forms/dynamicForm/fields/uiFields/TileBodyHeader.tsx +9 -0
- package/src/components/forms/dynamicForm/fields/uiFields/TileBodyLogo.tsx +10 -0
- package/src/components/forms/dynamicForm/fields/uiFields/TileBodySectionGrid.tsx +11 -0
- package/src/components/forms/dynamicForm/fields/uiFields/TileCta.tsx +14 -0
- package/src/components/forms/dynamicForm/fields/uiFields/VerticalIcon.tsx +31 -0
- package/src/components/forms/dynamicForm/fields/uiFields/index.ts +7 -0
- package/src/components/homeBoard/ConfirmHomeAddress.tsx +1 -1
- package/src/components/icons/DisplayGrid.tsx +1 -1
- package/src/components/icons/DisplayItem.tsx +1 -1
- package/src/components/icons/DisplayList.tsx +1 -1
- package/src/components/icons/Upload.tsx +1 -1
- package/src/components/inputs/SelectInputWithBadge.tsx +6 -4
- package/src/components/myHomes/steps/MyHomeDetails.tsx +1 -1
- package/src/components/myHomes/steps/SearchRecords.tsx +1 -1
- package/src/components/overlay/Overlay.tsx +2 -1
- package/src/components/partner/adminTiles/satisfactionTile/SatisfactionProgress.tsx +2 -1
- package/src/components/sendDocument/RecipientContent.tsx +15 -7
- package/src/helpers/forms/dynamicForm.helper.ts +12 -0
- package/src/interfaces/forms/dynamicForm/DynamicForm.interface.ts +27 -2
- package/src/interfaces/forms/dynamicForm/fields/GroupField.interface.ts +7 -1
- package/src/interfaces/forms/dynamicForm/fields/UIFields.interface.ts +24 -0
- package/src/interfaces/forms/dynamicForm/fields/index.ts +1 -0
- package/src/interfaces/icons/CustomIcon.interface.ts +2 -3
- package/src/interfaces/partner/PartnerFooter.interface.ts +0 -1
- package/src/mocks/forms/dynamicForm.mock.ts +162 -0
- package/src/stories/forms/dynamicForm/DynamicForm.stories.tsx +14 -3
|
@@ -8,22 +8,7 @@ export declare const useAddHouseContent: (values: HomeFormI | undefined, callbac
|
|
|
8
8
|
handleSelectRecords: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
9
9
|
handleSubmit: () => void;
|
|
10
10
|
isOwner: boolean;
|
|
11
|
-
group: import("
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
tabIndex?: number;
|
|
15
|
-
style?: React.CSSProperties;
|
|
16
|
-
} & import("react").RefAttributes<any>;
|
|
17
|
-
ownRadio: import("@chakra-ui/react-types").InputDOMProps & import("react").AriaAttributes & import("react").DOMAttributes<HTMLInputElement> & import("@chakra-ui/react-types").DataAttributes & {
|
|
18
|
-
id?: string;
|
|
19
|
-
role?: React.AriaRole;
|
|
20
|
-
tabIndex?: number;
|
|
21
|
-
style?: React.CSSProperties;
|
|
22
|
-
} & import("react").RefAttributes<any>;
|
|
23
|
-
rentRadio: import("@chakra-ui/react-types").InputDOMProps & import("react").AriaAttributes & import("react").DOMAttributes<HTMLInputElement> & import("@chakra-ui/react-types").DataAttributes & {
|
|
24
|
-
id?: string;
|
|
25
|
-
role?: React.AriaRole;
|
|
26
|
-
tabIndex?: number;
|
|
27
|
-
style?: React.CSSProperties;
|
|
28
|
-
} & import("react").RefAttributes<any>;
|
|
11
|
+
group: import("@chakra-ui/utils").DOMAttributes<import("@chakra-ui/utils").DOMElement> & import("react").RefAttributes<any>;
|
|
12
|
+
ownRadio: import("@chakra-ui/utils").InputDOMAttributes & import("react").RefAttributes<any>;
|
|
13
|
+
rentRadio: import("@chakra-ui/utils").InputDOMAttributes & import("react").RefAttributes<any>;
|
|
29
14
|
};
|
|
@@ -6,18 +6,8 @@ export declare const useTwoFactorSetting: ({ defaultValue, email, onChange, sms,
|
|
|
6
6
|
sms: string | undefined;
|
|
7
7
|
'2fa': boolean;
|
|
8
8
|
}, any>;
|
|
9
|
-
emailRadio: import("@chakra-ui/
|
|
10
|
-
|
|
11
|
-
role?: React.AriaRole;
|
|
12
|
-
tabIndex?: number;
|
|
13
|
-
style?: React.CSSProperties;
|
|
14
|
-
} & import("react").RefAttributes<any>;
|
|
15
|
-
group: import("react").AriaAttributes & import("react").DOMAttributes<import("@chakra-ui/react-types").DOMElement> & import("@chakra-ui/react-types").DataAttributes & {
|
|
16
|
-
id?: string;
|
|
17
|
-
role?: React.AriaRole;
|
|
18
|
-
tabIndex?: number;
|
|
19
|
-
style?: React.CSSProperties;
|
|
20
|
-
} & import("react").RefAttributes<any>;
|
|
9
|
+
emailRadio: import("@chakra-ui/utils").InputDOMAttributes & import("react").RefAttributes<any>;
|
|
10
|
+
group: import("@chakra-ui/utils").DOMAttributes<import("@chakra-ui/utils").DOMElement> & import("react").RefAttributes<any>;
|
|
21
11
|
handleEmailValidation: (value?: string) => boolean;
|
|
22
12
|
handlePhoneValidation: (value?: string) => boolean;
|
|
23
13
|
handleSubmit: import("react-hook-form").UseFormHandleSubmit<{
|
|
@@ -28,10 +18,5 @@ export declare const useTwoFactorSetting: ({ defaultValue, email, onChange, sms,
|
|
|
28
18
|
is2faEnabled: boolean;
|
|
29
19
|
radioValue: string | number;
|
|
30
20
|
showButtons: boolean;
|
|
31
|
-
smsRadio: import("@chakra-ui/
|
|
32
|
-
id?: string;
|
|
33
|
-
role?: React.AriaRole;
|
|
34
|
-
tabIndex?: number;
|
|
35
|
-
style?: React.CSSProperties;
|
|
36
|
-
} & import("react").RefAttributes<any>;
|
|
21
|
+
smsRadio: import("@chakra-ui/utils").InputDOMAttributes & import("react").RefAttributes<any>;
|
|
37
22
|
};
|
|
@@ -6,9 +6,9 @@ export declare const usePartnerTilePreview: () => {
|
|
|
6
6
|
};
|
|
7
7
|
company: {
|
|
8
8
|
readonly address: {
|
|
9
|
-
readonly apartmentNumber?: string;
|
|
9
|
+
readonly apartmentNumber?: string | undefined;
|
|
10
10
|
readonly city: string;
|
|
11
|
-
readonly obs?: string;
|
|
11
|
+
readonly obs?: string | undefined;
|
|
12
12
|
readonly state: string;
|
|
13
13
|
readonly street: string;
|
|
14
14
|
readonly number: string;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { FolderFileI } from '../..';
|
|
2
|
-
type KindTypes = 'checkbox' | 'currency' | 'date' | 'email' | 'file' | 'grid' | 'group' | 'number' | 'radio' | 'rating' | 'select' | 'string' | 'switch' | 'telephone' | 'text' | 'textarea' | 'default';
|
|
3
|
-
|
|
1
|
+
import { FolderFileI, MenuItemI, PartnerFooterI, TileCtaI } from '../..';
|
|
2
|
+
type KindTypes = 'checkbox' | 'currency' | 'date' | 'email' | 'file' | 'grid' | 'group' | 'number' | 'radio' | 'rating' | 'select' | 'string' | 'switch' | 'telephone' | 'text' | 'textarea' | 'default' | UIKindTypes;
|
|
3
|
+
type UIKindTypes = 'tile-body' | 'tile-body-logo' | 'tile-body-header' | 'tile-body-section' | 'tile-body-section-grid' | 'tile-form' | 'tile-body-action' | 'vertical-icon' | 'primary-cta' | 'secondary-cta';
|
|
4
|
+
export type IconTypes = 'barcode' | 'battery' | 'billing' | 'book' | 'calc' | 'calendar' | 'check' | 'co2' | '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' | 'house' | 'target' | 'title' | 'company' | UIIconTypes;
|
|
5
|
+
export type UIIconTypes = 'sh-pressure' | 'sh-window' | 'sh-roof' | 'sh-lights' | 'sh-gutter' | 'sh-home';
|
|
4
6
|
export type ValueTypes = string | string[] | number | boolean;
|
|
5
7
|
export type OptionsTypes = string[] | number[] | null;
|
|
6
8
|
export interface ReportI {
|
|
@@ -10,14 +12,17 @@ export interface ReportI {
|
|
|
10
12
|
description?: string;
|
|
11
13
|
icon?: IconTypes;
|
|
12
14
|
id: string;
|
|
15
|
+
link?: string;
|
|
13
16
|
name?: string;
|
|
14
17
|
options?: OptionsTypes;
|
|
15
18
|
type: KindTypes;
|
|
16
19
|
value: ValueTypes;
|
|
17
20
|
visible?: boolean;
|
|
18
21
|
}
|
|
19
|
-
export interface DynamicFormI {
|
|
22
|
+
export interface DynamicFormI extends Partial<PartnerFooterI> {
|
|
23
|
+
callback?: TileCtaI['callback'];
|
|
20
24
|
form: ReportI[];
|
|
25
|
+
menuItems?: MenuItemI[];
|
|
21
26
|
onUpload?: (filesByFieldId: Record<string, FolderFileI[]>) => void;
|
|
22
27
|
showTitle?: boolean;
|
|
23
28
|
uploadingFieldId?: string;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { DynamicFormI } from '../../..';
|
|
1
|
+
import { DynamicFormI, MenuItemI, TileCtaI } from '../../..';
|
|
2
2
|
export interface GroupFieldI {
|
|
3
3
|
id: string;
|
|
4
4
|
canBeHidden?: boolean;
|
|
5
5
|
fields?: DynamicFormI['form'];
|
|
6
6
|
onRemove: (id: string) => void;
|
|
7
7
|
}
|
|
8
|
+
export interface FieldTypesI {
|
|
9
|
+
callback?: TileCtaI['callback'];
|
|
10
|
+
fields?: DynamicFormI['form'];
|
|
11
|
+
menuItems?: MenuItemI[];
|
|
12
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DynamicFormI, MenuItemI, PartnerFooterI } from '../../..';
|
|
2
|
+
export interface TileBodyLogoI {
|
|
3
|
+
menuItems?: MenuItemI[];
|
|
4
|
+
name?: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
export interface TileBodyI extends Partial<PartnerFooterI> {
|
|
8
|
+
callback?: TileCtaI['callback'];
|
|
9
|
+
fields?: DynamicFormI['form'];
|
|
10
|
+
menuItems?: MenuItemI[];
|
|
11
|
+
}
|
|
12
|
+
export interface VerticalIconI {
|
|
13
|
+
icon?: string;
|
|
14
|
+
value: string;
|
|
15
|
+
}
|
|
16
|
+
export interface TileCtaI {
|
|
17
|
+
callback?: (value: string) => void;
|
|
18
|
+
type: 'primary-cta' | 'secondary-cta';
|
|
19
|
+
value: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CSSProperties } from 'react';
|
|
1
|
+
import { CSSProperties, ElementType } from 'react';
|
|
3
2
|
export interface IconsI {
|
|
4
3
|
color?: string;
|
|
5
4
|
size?: number | string;
|
|
6
5
|
style?: CSSProperties;
|
|
7
|
-
type
|
|
6
|
+
type?: ElementType;
|
|
8
7
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Shine } from '../../assets/images';
|
|
1
2
|
import { faker } from '@faker-js/faker';
|
|
2
3
|
export const formFieldsMock = [
|
|
3
4
|
{
|
|
@@ -344,3 +345,161 @@ export const contactFieldsMock = [
|
|
|
344
345
|
icon: 'image',
|
|
345
346
|
},
|
|
346
347
|
];
|
|
348
|
+
export const tileUIMock = [
|
|
349
|
+
{
|
|
350
|
+
id: faker.database.mongodbObjectId(),
|
|
351
|
+
name: faker.lorem.word(),
|
|
352
|
+
description: faker.lorem.sentence(),
|
|
353
|
+
comments: faker.lorem.sentence(),
|
|
354
|
+
value: '',
|
|
355
|
+
type: 'tile-body',
|
|
356
|
+
visible: true,
|
|
357
|
+
options: [],
|
|
358
|
+
children: [
|
|
359
|
+
{
|
|
360
|
+
id: faker.database.mongodbObjectId(),
|
|
361
|
+
name: 'Shine',
|
|
362
|
+
description: '',
|
|
363
|
+
comments: '',
|
|
364
|
+
value: Shine,
|
|
365
|
+
type: 'tile-body-logo',
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
id: faker.database.mongodbObjectId(),
|
|
369
|
+
name: '',
|
|
370
|
+
description: '',
|
|
371
|
+
comments: '',
|
|
372
|
+
value: 'We do windows and so much more!',
|
|
373
|
+
type: 'tile-body-header',
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
id: faker.database.mongodbObjectId(),
|
|
377
|
+
name: '',
|
|
378
|
+
description: '',
|
|
379
|
+
comments: '',
|
|
380
|
+
value: '',
|
|
381
|
+
type: 'tile-body-section-grid',
|
|
382
|
+
children: [
|
|
383
|
+
{
|
|
384
|
+
id: faker.database.mongodbObjectId(),
|
|
385
|
+
name: '',
|
|
386
|
+
description: '',
|
|
387
|
+
comments: '',
|
|
388
|
+
value: 'Pressure Washing',
|
|
389
|
+
type: 'vertical-icon',
|
|
390
|
+
icon: 'sh-pressure',
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
id: faker.database.mongodbObjectId(),
|
|
394
|
+
name: '',
|
|
395
|
+
description: '',
|
|
396
|
+
comments: '',
|
|
397
|
+
value: 'Widow Cleaning',
|
|
398
|
+
type: 'vertical-icon',
|
|
399
|
+
icon: 'sh-window',
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
id: faker.database.mongodbObjectId(),
|
|
403
|
+
name: '',
|
|
404
|
+
description: '',
|
|
405
|
+
comments: '',
|
|
406
|
+
value: 'Roof Cleaning',
|
|
407
|
+
type: 'vertical-icon',
|
|
408
|
+
icon: 'sh-roof',
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
id: faker.database.mongodbObjectId(),
|
|
412
|
+
name: '',
|
|
413
|
+
description: '',
|
|
414
|
+
comments: '',
|
|
415
|
+
value: 'Holiday Lights',
|
|
416
|
+
type: 'vertical-icon',
|
|
417
|
+
icon: 'sh-lights',
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
id: faker.database.mongodbObjectId(),
|
|
421
|
+
name: '',
|
|
422
|
+
description: '',
|
|
423
|
+
comments: '',
|
|
424
|
+
value: 'Gutter Cleaning',
|
|
425
|
+
type: 'vertical-icon',
|
|
426
|
+
icon: 'sh-gutter',
|
|
427
|
+
},
|
|
428
|
+
],
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
id: faker.database.mongodbObjectId(),
|
|
432
|
+
name: '',
|
|
433
|
+
description: '',
|
|
434
|
+
comments: '',
|
|
435
|
+
value: '',
|
|
436
|
+
type: 'tile-body-action',
|
|
437
|
+
children: [
|
|
438
|
+
{
|
|
439
|
+
id: faker.database.mongodbObjectId(),
|
|
440
|
+
name: '',
|
|
441
|
+
description: '',
|
|
442
|
+
comments: '',
|
|
443
|
+
value: 'Schedule Service',
|
|
444
|
+
type: 'primary-cta',
|
|
445
|
+
link: 'www.shine.com',
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
id: faker.database.mongodbObjectId(),
|
|
449
|
+
name: '',
|
|
450
|
+
description: '',
|
|
451
|
+
comments: '',
|
|
452
|
+
value: 'Request Support',
|
|
453
|
+
type: 'secondary-cta',
|
|
454
|
+
link: 'open-drawer',
|
|
455
|
+
},
|
|
456
|
+
],
|
|
457
|
+
},
|
|
458
|
+
],
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
id: faker.database.mongodbObjectId(),
|
|
462
|
+
name: '',
|
|
463
|
+
description: '',
|
|
464
|
+
comments: '',
|
|
465
|
+
value: '',
|
|
466
|
+
type: 'tile-form',
|
|
467
|
+
visible: true,
|
|
468
|
+
children: [
|
|
469
|
+
{
|
|
470
|
+
id: faker.database.mongodbObjectId(),
|
|
471
|
+
name: '',
|
|
472
|
+
description: 'We are here to resolve any issues you may be having with our products and services. Please send us a brief description of the issue you are having and we will respond within 24 hours.',
|
|
473
|
+
comments: '',
|
|
474
|
+
value: '',
|
|
475
|
+
type: 'textarea',
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
id: faker.database.mongodbObjectId(),
|
|
479
|
+
name: '',
|
|
480
|
+
description: '',
|
|
481
|
+
comments: '',
|
|
482
|
+
value: '',
|
|
483
|
+
type: 'grid',
|
|
484
|
+
children: [
|
|
485
|
+
{
|
|
486
|
+
id: faker.database.mongodbObjectId(),
|
|
487
|
+
name: '',
|
|
488
|
+
description: 'Contact Phone',
|
|
489
|
+
comments: '',
|
|
490
|
+
value: '',
|
|
491
|
+
type: 'telephone',
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
id: faker.database.mongodbObjectId(),
|
|
495
|
+
name: '',
|
|
496
|
+
description: 'Contact Email',
|
|
497
|
+
comments: '',
|
|
498
|
+
value: '',
|
|
499
|
+
type: 'email',
|
|
500
|
+
},
|
|
501
|
+
],
|
|
502
|
+
},
|
|
503
|
+
],
|
|
504
|
+
},
|
|
505
|
+
];
|
|
@@ -3,3 +3,4 @@ import { DynamicFormI } from '../../../interfaces';
|
|
|
3
3
|
declare const _default: Meta;
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const DynamicFormComponent: (args: DynamicFormI) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const DynamicUIFormComponent: (args: DynamicFormI) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,15 +2,21 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { action } from '@storybook/addon-actions';
|
|
3
3
|
import { Box } from '@chakra-ui/react';
|
|
4
4
|
import { DynamicForm } from '../../../components';
|
|
5
|
-
import { formFieldsMock } from '../../../mocks';
|
|
5
|
+
import { formFieldsMock, menuMock, socialLinksMock, tileUIMock } from '../../../mocks';
|
|
6
6
|
export default {
|
|
7
7
|
title: 'Components/Forms/DynamicForm',
|
|
8
8
|
component: DynamicForm,
|
|
9
9
|
args: {
|
|
10
|
-
|
|
10
|
+
callback: action('callback'),
|
|
11
11
|
onUpload: action('onUpload'),
|
|
12
|
+
menuItems: menuMock,
|
|
13
|
+
socialLinks: socialLinksMock,
|
|
14
|
+
websiteUrl: 'http://www.audreyscheckdesign.com',
|
|
12
15
|
},
|
|
13
16
|
};
|
|
14
17
|
export const DynamicFormComponent = (args) => {
|
|
15
|
-
return (_jsx(Box, { p: "base", bg: "neutral.white", w: ['full', '500px'], children: _jsx(DynamicForm, Object.assign({}, args)) }));
|
|
18
|
+
return (_jsx(Box, { p: "base", bg: "neutral.white", w: ['full', '500px'], children: _jsx(DynamicForm, Object.assign({}, args, { form: formFieldsMock })) }));
|
|
19
|
+
};
|
|
20
|
+
export const DynamicUIFormComponent = (args) => {
|
|
21
|
+
return (_jsx(Box, { m: "base", w: ['full', '320px'], children: _jsx(DynamicForm, Object.assign({}, args, { form: tileUIMock, showTitle: false })) }));
|
|
16
22
|
};
|
|
@@ -5,7 +5,7 @@ export default _default;
|
|
|
5
5
|
export declare const BubbleComponent: {
|
|
6
6
|
(args: BubbleI): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
args: {
|
|
8
|
-
handleStep: import("@vitest/spy").Mock<any
|
|
8
|
+
handleStep: import("@vitest/spy").Mock<(...args: any[]) => any>;
|
|
9
9
|
steps: {
|
|
10
10
|
homeboard: {
|
|
11
11
|
topRef: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@homefile/components-v2",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"author": "Homefile",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -22,66 +22,67 @@
|
|
|
22
22
|
"src"
|
|
23
23
|
],
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@chakra-ui/storybook-addon": "^5.
|
|
26
|
-
"@chromatic-com/storybook": "^
|
|
27
|
-
"@faker-js/faker": "^
|
|
28
|
-
"@storybook/addon-a11y": "^8.
|
|
29
|
-
"@storybook/addon-essentials": "^8.
|
|
30
|
-
"@storybook/addon-interactions": "^8.
|
|
31
|
-
"@storybook/addon-links": "^8.
|
|
32
|
-
"@storybook/addon-onboarding": "^8.
|
|
33
|
-
"@storybook/addon-viewport": "^8.
|
|
34
|
-
"@storybook/blocks": "^8.
|
|
35
|
-
"@storybook/builder-vite": "^8.
|
|
25
|
+
"@chakra-ui/storybook-addon": "^5.2.5",
|
|
26
|
+
"@chromatic-com/storybook": "^2.0.2",
|
|
27
|
+
"@faker-js/faker": "^9.0.3",
|
|
28
|
+
"@storybook/addon-a11y": "^8.3.5",
|
|
29
|
+
"@storybook/addon-essentials": "^8.3.5",
|
|
30
|
+
"@storybook/addon-interactions": "^8.3.5",
|
|
31
|
+
"@storybook/addon-links": "^8.3.5",
|
|
32
|
+
"@storybook/addon-onboarding": "^8.3.5",
|
|
33
|
+
"@storybook/addon-viewport": "^8.3.5",
|
|
34
|
+
"@storybook/blocks": "^8.3.5",
|
|
35
|
+
"@storybook/builder-vite": "^8.3.5",
|
|
36
36
|
"@storybook/jest": "^0.2.3",
|
|
37
|
-
"@storybook/react": "^8.
|
|
38
|
-
"@storybook/react-vite": "^8.
|
|
39
|
-
"@storybook/test": "^8.
|
|
40
|
-
"@types/node": "^
|
|
41
|
-
"@types/react": "^18.3.
|
|
42
|
-
"@types/react-dom": "^18.3.
|
|
43
|
-
"@vitejs/plugin-react": "^4.
|
|
44
|
-
"axe-playwright": "^2.0.
|
|
37
|
+
"@storybook/react": "^8.3.5",
|
|
38
|
+
"@storybook/react-vite": "^8.3.5",
|
|
39
|
+
"@storybook/test": "^8.3.5",
|
|
40
|
+
"@types/node": "^22.7.6",
|
|
41
|
+
"@types/react": "^18.3.11",
|
|
42
|
+
"@types/react-dom": "^18.3.1",
|
|
43
|
+
"@vitejs/plugin-react": "^4.3.2",
|
|
44
|
+
"axe-playwright": "^2.0.3",
|
|
45
45
|
"copyfiles": "^2.4.1",
|
|
46
46
|
"git-commit-msg-linter": "^5.0.4",
|
|
47
|
-
"husky": "^9.1.
|
|
47
|
+
"husky": "^9.1.6",
|
|
48
48
|
"jest": "^29.7.0",
|
|
49
49
|
"json-loader": "^0.5.7",
|
|
50
|
-
"rimraf": "^
|
|
51
|
-
"semantic-release": "^24.
|
|
52
|
-
"storybook": "^8.
|
|
53
|
-
"storybook-react-i18next": "^3.1.
|
|
50
|
+
"rimraf": "^6.0.1",
|
|
51
|
+
"semantic-release": "^24.1.2",
|
|
52
|
+
"storybook": "^8.3.5",
|
|
53
|
+
"storybook-react-i18next": "^3.1.7",
|
|
54
54
|
"tsconfig-replace-paths": "^0.0.14",
|
|
55
55
|
"tscpaths": "^0.0.9",
|
|
56
|
-
"typescript": "^5.
|
|
57
|
-
"vite": "^5.
|
|
56
|
+
"typescript": "^5.6.3",
|
|
57
|
+
"vite": "^5.4.9"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@chakra-ui/
|
|
61
|
-
"@
|
|
62
|
-
"@emotion/
|
|
63
|
-
"@
|
|
64
|
-
"@fontsource/
|
|
60
|
+
"@chakra-ui/icons": "^2.2.4",
|
|
61
|
+
"@chakra-ui/react": "^2.10.3",
|
|
62
|
+
"@emotion/react": "^11.13.3",
|
|
63
|
+
"@emotion/styled": "^11.13.0",
|
|
64
|
+
"@fontsource/assistant": "^5.1.0",
|
|
65
|
+
"@fontsource/poppins": "^5.1.0",
|
|
65
66
|
"@hassanmojab/react-modern-calendar-datepicker": "^3.1.7",
|
|
66
67
|
"@hookform/resolvers": "^3.3.1",
|
|
67
68
|
"@rive-app/react-canvas": "^4.14.5",
|
|
68
|
-
"axios": "^1.7.
|
|
69
|
-
"date-fns": "^
|
|
70
|
-
"framer-motion": "^11.
|
|
71
|
-
"i18next": "^23.
|
|
69
|
+
"axios": "^1.7.7",
|
|
70
|
+
"date-fns": "^4.1.0",
|
|
71
|
+
"framer-motion": "^11.11.9",
|
|
72
|
+
"i18next": "^23.16.0",
|
|
72
73
|
"i18next-browser-languagedetector": "^8.0.0",
|
|
73
|
-
"i18next-http-backend": "^2.
|
|
74
|
+
"i18next-http-backend": "^2.6.2",
|
|
74
75
|
"react": "^18.2.0",
|
|
75
76
|
"react-dom": "^18.2.0",
|
|
76
|
-
"react-dropzone": "^14.2.
|
|
77
|
-
"react-hook-form": "^7.
|
|
78
|
-
"react-i18next": "^15.0.
|
|
79
|
-
"react-icons": "^5.
|
|
77
|
+
"react-dropzone": "^14.2.9",
|
|
78
|
+
"react-hook-form": "^7.53.0",
|
|
79
|
+
"react-i18next": "^15.0.3",
|
|
80
|
+
"react-icons": "^5.3.0",
|
|
80
81
|
"react-modern-calendar-datepicker": "^3.1.6",
|
|
81
82
|
"react-quill": "^2.0.0",
|
|
82
83
|
"react-spinners": "^0.14.1",
|
|
83
|
-
"recharts": "^2.
|
|
84
|
-
"valtio": "^1.
|
|
84
|
+
"recharts": "^2.13.0",
|
|
85
|
+
"valtio": "^2.1.0",
|
|
85
86
|
"yup": "^1.2.0"
|
|
86
87
|
},
|
|
87
88
|
"scripts": {
|
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
} from '@/assets/images'
|
|
9
9
|
import { useWindowDimensions } from '@/hooks'
|
|
10
10
|
import { colors } from '@/theme/colors'
|
|
11
|
-
import { Box,
|
|
11
|
+
import { Box, Image } from '@chakra-ui/react'
|
|
12
|
+
import { keyframes } from '@emotion/react'
|
|
12
13
|
import { Fragment, PropsWithChildren } from 'react'
|
|
13
14
|
|
|
14
15
|
export const moveLeftToRightAirplane = keyframes`
|
|
@@ -16,17 +16,18 @@ export const CustomToast = ({
|
|
|
16
16
|
}
|
|
17
17
|
return (
|
|
18
18
|
<Box
|
|
19
|
+
paddingTop={0}
|
|
20
|
+
paddingBottom={0}
|
|
19
21
|
bg={bgColors[status]}
|
|
20
22
|
borderRadius="lg"
|
|
21
23
|
boxShadow="lg"
|
|
22
24
|
position="relative"
|
|
23
|
-
py="base"
|
|
24
25
|
>
|
|
25
|
-
<Flex gap="base" p="base" align="center">
|
|
26
|
+
<Flex gap="base" p="base" align="center" position="relative" left="-26px">
|
|
26
27
|
<StatusIllustration status={status} />
|
|
27
28
|
<Box>
|
|
28
29
|
<Text
|
|
29
|
-
fontSize="
|
|
30
|
+
fontSize="22px"
|
|
30
31
|
fontWeight="medium"
|
|
31
32
|
color="neutral.white"
|
|
32
33
|
lineHeight="1.1"
|
|
@@ -14,18 +14,18 @@ export const StatusIllustration = ({
|
|
|
14
14
|
src: Check,
|
|
15
15
|
alt: t('ariaLabels.success'),
|
|
16
16
|
bg: '#28B5A8',
|
|
17
|
-
height: '
|
|
17
|
+
height: '21px',
|
|
18
18
|
},
|
|
19
19
|
error: {
|
|
20
20
|
src: Exclamation,
|
|
21
21
|
alt: t('ariaLabels.error'),
|
|
22
22
|
bg: '#991365',
|
|
23
|
-
height: '
|
|
23
|
+
height: '28px',
|
|
24
24
|
},
|
|
25
25
|
}
|
|
26
26
|
const { alt, bg, height, src } = props[status]
|
|
27
27
|
return (
|
|
28
|
-
<Center borderRadius="full" bg={bg} boxShadow="xl" w="
|
|
28
|
+
<Center borderRadius="full" bg={bg} boxShadow="xl" w="43px" h="43px">
|
|
29
29
|
<Image src={src} alt={alt} h={height} w="auto" />
|
|
30
30
|
</Center>
|
|
31
31
|
)
|
|
@@ -16,15 +16,19 @@ import {
|
|
|
16
16
|
DateField,
|
|
17
17
|
NumberField,
|
|
18
18
|
CurrencyField,
|
|
19
|
+
TileBody,
|
|
19
20
|
} from '@/components'
|
|
20
21
|
import { useDynamicForm } from '@/hooks'
|
|
21
22
|
import { fieldIcons } from '@/helpers'
|
|
22
23
|
|
|
23
24
|
export const DynamicForm = ({
|
|
25
|
+
callback,
|
|
24
26
|
form: fields,
|
|
27
|
+
menuItems,
|
|
25
28
|
onUpload,
|
|
26
29
|
showTitle = true,
|
|
27
30
|
uploadingFieldId,
|
|
31
|
+
...props
|
|
28
32
|
}: DynamicFormI) => {
|
|
29
33
|
const {
|
|
30
34
|
form,
|
|
@@ -159,6 +163,16 @@ export const DynamicForm = ({
|
|
|
159
163
|
canBeHidden={canBeHidden}
|
|
160
164
|
/>
|
|
161
165
|
)
|
|
166
|
+
case 'tile-body':
|
|
167
|
+
return (
|
|
168
|
+
<TileBody
|
|
169
|
+
key={id}
|
|
170
|
+
callback={callback}
|
|
171
|
+
fields={children}
|
|
172
|
+
menuItems={menuItems}
|
|
173
|
+
{...props}
|
|
174
|
+
/>
|
|
175
|
+
)
|
|
162
176
|
default:
|
|
163
177
|
return null
|
|
164
178
|
}
|