@homefile/components-v2 2.0.0 → 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/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/sendDocument/RecipientContent.js +3 -1
- package/dist/helpers/forms/dynamicForm.helper.js +7 -1
- 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/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/package.json +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/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/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
|
@@ -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
|
};
|
package/package.json
CHANGED
|
@@ -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
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fieldIcons } from '@/helpers'
|
|
2
|
-
import {
|
|
2
|
+
import { FieldTypesI } from '@/interfaces'
|
|
3
3
|
import {
|
|
4
4
|
GridField,
|
|
5
5
|
RatingField,
|
|
@@ -10,13 +10,15 @@ import {
|
|
|
10
10
|
NumberField,
|
|
11
11
|
DateField,
|
|
12
12
|
CurrencyField,
|
|
13
|
+
TileBodyHeader,
|
|
14
|
+
TileBodyLogo,
|
|
15
|
+
VerticalIcon,
|
|
16
|
+
TileBodySectionGrid,
|
|
17
|
+
TileBodyAction,
|
|
18
|
+
TileCta,
|
|
13
19
|
} from '@/components'
|
|
14
20
|
|
|
15
|
-
export
|
|
16
|
-
fields?: DynamicFormI['form']
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const SingleFields = ({ fields }: FieldTypesI) => {
|
|
21
|
+
export const SingleFields = ({ callback, fields, menuItems }: FieldTypesI) => {
|
|
20
22
|
return (
|
|
21
23
|
<>
|
|
22
24
|
{fields?.map(
|
|
@@ -61,6 +63,60 @@ export const SingleFields = ({ fields }: FieldTypesI) => {
|
|
|
61
63
|
return <TextField {...baseProps} type="tel" />
|
|
62
64
|
case 'textarea':
|
|
63
65
|
return <TextAreaField {...baseProps} />
|
|
66
|
+
|
|
67
|
+
case 'tile-body-section-grid':
|
|
68
|
+
return <TileBodySectionGrid key={id} fields={children} />
|
|
69
|
+
case 'tile-body-header':
|
|
70
|
+
return (
|
|
71
|
+
<TileBodyHeader
|
|
72
|
+
key={baseProps.key}
|
|
73
|
+
value={String(baseProps.value)}
|
|
74
|
+
/>
|
|
75
|
+
)
|
|
76
|
+
case 'tile-body-logo':
|
|
77
|
+
return (
|
|
78
|
+
<TileBodyLogo
|
|
79
|
+
key={baseProps.key}
|
|
80
|
+
name={name}
|
|
81
|
+
value={String(baseProps.value)}
|
|
82
|
+
menuItems={menuItems}
|
|
83
|
+
/>
|
|
84
|
+
)
|
|
85
|
+
case 'vertical-icon':
|
|
86
|
+
return (
|
|
87
|
+
<VerticalIcon
|
|
88
|
+
key={id}
|
|
89
|
+
icon={baseProps.icon}
|
|
90
|
+
value={String(baseProps.value)}
|
|
91
|
+
/>
|
|
92
|
+
)
|
|
93
|
+
case 'tile-body-action':
|
|
94
|
+
return (
|
|
95
|
+
<TileBodyAction
|
|
96
|
+
key={id}
|
|
97
|
+
fields={children}
|
|
98
|
+
callback={callback}
|
|
99
|
+
/>
|
|
100
|
+
)
|
|
101
|
+
case 'primary-cta':
|
|
102
|
+
return (
|
|
103
|
+
<TileCta
|
|
104
|
+
key={id}
|
|
105
|
+
type={type}
|
|
106
|
+
value={String(baseProps.value)}
|
|
107
|
+
callback={callback}
|
|
108
|
+
/>
|
|
109
|
+
)
|
|
110
|
+
case 'secondary-cta':
|
|
111
|
+
return (
|
|
112
|
+
<TileCta
|
|
113
|
+
key={id}
|
|
114
|
+
type={type}
|
|
115
|
+
value={String(baseProps.value)}
|
|
116
|
+
callback={callback}
|
|
117
|
+
/>
|
|
118
|
+
)
|
|
119
|
+
|
|
64
120
|
default:
|
|
65
121
|
return null
|
|
66
122
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Box, Stack } from '@chakra-ui/react'
|
|
2
|
+
import { TileBodyI } from '@/interfaces'
|
|
3
|
+
import { PartnerFooter, SingleFields } from '@/components'
|
|
4
|
+
|
|
5
|
+
export const TileBody = ({
|
|
6
|
+
callback,
|
|
7
|
+
fields,
|
|
8
|
+
websiteUrl = '',
|
|
9
|
+
menuItems,
|
|
10
|
+
...props
|
|
11
|
+
}: TileBodyI) => {
|
|
12
|
+
return (
|
|
13
|
+
<Box display="flex" flexDir="column" bg="neutral.white" boxShadow="lg">
|
|
14
|
+
<Stack spacing="0" flex="1">
|
|
15
|
+
<SingleFields
|
|
16
|
+
callback={callback}
|
|
17
|
+
fields={fields}
|
|
18
|
+
menuItems={menuItems}
|
|
19
|
+
/>
|
|
20
|
+
<PartnerFooter {...props} websiteUrl={websiteUrl} />
|
|
21
|
+
</Stack>
|
|
22
|
+
</Box>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Flex } from '@chakra-ui/react'
|
|
2
|
+
import { SingleFields } from '@/components'
|
|
3
|
+
import { TileBodyI } from '@/interfaces'
|
|
4
|
+
|
|
5
|
+
export const TileBodyAction = ({ fields }: TileBodyI) => {
|
|
6
|
+
return (
|
|
7
|
+
<Flex p="base" align="center" gap="base">
|
|
8
|
+
<SingleFields fields={fields} />
|
|
9
|
+
</Flex>
|
|
10
|
+
)
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PartnerHeader } from '@/components'
|
|
2
|
+
import { TileBodyLogoI } from '@/interfaces'
|
|
3
|
+
|
|
4
|
+
export const TileBodyLogo = ({
|
|
5
|
+
menuItems,
|
|
6
|
+
name = '',
|
|
7
|
+
value,
|
|
8
|
+
}: TileBodyLogoI) => {
|
|
9
|
+
return <PartnerHeader logo={value} partnerName={name} menuItems={menuItems} />
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SimpleGrid } from '@chakra-ui/react'
|
|
2
|
+
import { SingleFields } from '@/components'
|
|
3
|
+
import { TileBodyI } from '@/interfaces'
|
|
4
|
+
|
|
5
|
+
export const TileBodySectionGrid = ({ fields }: TileBodyI) => {
|
|
6
|
+
return (
|
|
7
|
+
<SimpleGrid columns={3} spacing="base" p="base">
|
|
8
|
+
<SingleFields fields={fields} />
|
|
9
|
+
</SimpleGrid>
|
|
10
|
+
)
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Button } from '@chakra-ui/react'
|
|
2
|
+
import { TileCtaI } from '@/interfaces'
|
|
3
|
+
|
|
4
|
+
export const TileCta = ({ callback, type, value }: TileCtaI) => {
|
|
5
|
+
return (
|
|
6
|
+
<Button
|
|
7
|
+
onClick={() => callback?.(value)}
|
|
8
|
+
variant={type === 'primary-cta' ? 'tertiaryFooter' : 'secondaryFooter'}
|
|
9
|
+
fontSize="sm"
|
|
10
|
+
>
|
|
11
|
+
{value}
|
|
12
|
+
</Button>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Box, Image, Text } from '@chakra-ui/react'
|
|
2
|
+
import { VerticalIconI } from '@/interfaces'
|
|
3
|
+
|
|
4
|
+
export const VerticalIcon = ({ icon, value }: VerticalIconI) => {
|
|
5
|
+
return (
|
|
6
|
+
<Box
|
|
7
|
+
bg="neutral.white"
|
|
8
|
+
borderRadius="md"
|
|
9
|
+
border="1px solid"
|
|
10
|
+
borderColor="lightBlue.6"
|
|
11
|
+
display="flex"
|
|
12
|
+
flexDirection="column"
|
|
13
|
+
alignItems="center"
|
|
14
|
+
justifyContent="center"
|
|
15
|
+
>
|
|
16
|
+
<Box h="46px" display="flex" alignItems="center">
|
|
17
|
+
<Image src={icon} alt={value} w="auto" h="80%" />
|
|
18
|
+
</Box>
|
|
19
|
+
<Box pb="2">
|
|
20
|
+
<Text
|
|
21
|
+
fontWeight="semibold"
|
|
22
|
+
textAlign="center"
|
|
23
|
+
fontSize="13px"
|
|
24
|
+
lineHeight="14px"
|
|
25
|
+
>
|
|
26
|
+
{value}
|
|
27
|
+
</Text>
|
|
28
|
+
</Box>
|
|
29
|
+
</Box>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Flex, Avatar, Stack, Box, Text } from '@chakra-ui/react'
|
|
2
2
|
import { RecipientContentI } from '@/interfaces'
|
|
3
3
|
import { randomColor } from '@/utils'
|
|
4
|
+
import MoonLoader from 'react-spinners/MoonLoader'
|
|
4
5
|
|
|
5
6
|
export const RecipientContent = ({
|
|
6
7
|
bgColor,
|
|
@@ -10,15 +11,22 @@ export const RecipientContent = ({
|
|
|
10
11
|
phone = '',
|
|
11
12
|
email = '',
|
|
12
13
|
}: RecipientContentI) => {
|
|
14
|
+
const isPending = firstName === 'Account' && lastName === 'Pending'
|
|
13
15
|
return (
|
|
14
16
|
<Flex gap="2" align={firstName ? 'start' : 'center'}>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
{isPending && (
|
|
18
|
+
<MoonLoader color="#2d2d2d" size={20} speedMultiplier={0.5} />
|
|
19
|
+
)}
|
|
20
|
+
{!isPending && (
|
|
21
|
+
<Avatar
|
|
22
|
+
size="sm"
|
|
23
|
+
bg={bgColor ?? randomColor(index)}
|
|
24
|
+
fontWeight="bold"
|
|
25
|
+
color="neutral.white"
|
|
26
|
+
name={firstName ? `${firstName} ${lastName}` : ''}
|
|
27
|
+
/>
|
|
28
|
+
)}
|
|
29
|
+
|
|
22
30
|
<Stack w="full" spacing="-2" minH="3rem" justify="space-between">
|
|
23
31
|
<Box>
|
|
24
32
|
{firstName && (
|
|
@@ -41,6 +41,12 @@ import {
|
|
|
41
41
|
Target,
|
|
42
42
|
CircleFace,
|
|
43
43
|
Company,
|
|
44
|
+
Pressure,
|
|
45
|
+
WindowCleaning,
|
|
46
|
+
RoofCleaning,
|
|
47
|
+
HolidayLights,
|
|
48
|
+
GutterCleaning,
|
|
49
|
+
HomeCleaning,
|
|
44
50
|
} from '@/assets/images'
|
|
45
51
|
import { IconTypes } from '@/interfaces'
|
|
46
52
|
|
|
@@ -88,4 +94,10 @@ export const fieldIcons: Record<IconTypes, string> = {
|
|
|
88
94
|
target: Target,
|
|
89
95
|
title: CircleFace,
|
|
90
96
|
company: Company,
|
|
97
|
+
'sh-gutter': GutterCleaning,
|
|
98
|
+
'sh-home': HomeCleaning,
|
|
99
|
+
'sh-lights': HolidayLights,
|
|
100
|
+
'sh-pressure': Pressure,
|
|
101
|
+
'sh-roof': RoofCleaning,
|
|
102
|
+
'sh-window': WindowCleaning,
|
|
91
103
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FolderFileI } from '@/interfaces'
|
|
1
|
+
import { FolderFileI, MenuItemI, PartnerFooterI, TileCtaI } from '@/interfaces'
|
|
2
2
|
|
|
3
3
|
type KindTypes =
|
|
4
4
|
| 'checkbox'
|
|
@@ -18,6 +18,19 @@ type KindTypes =
|
|
|
18
18
|
| 'text'
|
|
19
19
|
| 'textarea'
|
|
20
20
|
| 'default'
|
|
21
|
+
| UIKindTypes
|
|
22
|
+
|
|
23
|
+
type UIKindTypes =
|
|
24
|
+
| 'tile-body'
|
|
25
|
+
| 'tile-body-logo'
|
|
26
|
+
| 'tile-body-header'
|
|
27
|
+
| 'tile-body-section'
|
|
28
|
+
| 'tile-body-section-grid'
|
|
29
|
+
| 'tile-form'
|
|
30
|
+
| 'tile-body-action'
|
|
31
|
+
| 'vertical-icon'
|
|
32
|
+
| 'primary-cta'
|
|
33
|
+
| 'secondary-cta'
|
|
21
34
|
|
|
22
35
|
export type IconTypes =
|
|
23
36
|
| 'barcode'
|
|
@@ -63,6 +76,15 @@ export type IconTypes =
|
|
|
63
76
|
| 'target'
|
|
64
77
|
| 'title'
|
|
65
78
|
| 'company'
|
|
79
|
+
| UIIconTypes
|
|
80
|
+
|
|
81
|
+
export type UIIconTypes =
|
|
82
|
+
| 'sh-pressure'
|
|
83
|
+
| 'sh-window'
|
|
84
|
+
| 'sh-roof'
|
|
85
|
+
| 'sh-lights'
|
|
86
|
+
| 'sh-gutter'
|
|
87
|
+
| 'sh-home'
|
|
66
88
|
|
|
67
89
|
export type ValueTypes = string | string[] | number | boolean
|
|
68
90
|
export type OptionsTypes = string[] | number[] | null
|
|
@@ -74,6 +96,7 @@ export interface ReportI {
|
|
|
74
96
|
description?: string
|
|
75
97
|
icon?: IconTypes
|
|
76
98
|
id: string
|
|
99
|
+
link?: string
|
|
77
100
|
name?: string
|
|
78
101
|
options?: OptionsTypes
|
|
79
102
|
type: KindTypes
|
|
@@ -81,8 +104,10 @@ export interface ReportI {
|
|
|
81
104
|
visible?: boolean
|
|
82
105
|
}
|
|
83
106
|
|
|
84
|
-
export interface DynamicFormI {
|
|
107
|
+
export interface DynamicFormI extends Partial<PartnerFooterI> {
|
|
108
|
+
callback?: TileCtaI['callback']
|
|
85
109
|
form: ReportI[]
|
|
110
|
+
menuItems?: MenuItemI[]
|
|
86
111
|
onUpload?: (filesByFieldId: Record<string, FolderFileI[]>) => void
|
|
87
112
|
showTitle?: boolean
|
|
88
113
|
uploadingFieldId?: string
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DynamicFormI } from '@/interfaces'
|
|
1
|
+
import { DynamicFormI, MenuItemI, TileCtaI } from '@/interfaces'
|
|
2
2
|
|
|
3
3
|
export interface GroupFieldI {
|
|
4
4
|
id: string
|
|
@@ -6,3 +6,9 @@ export interface GroupFieldI {
|
|
|
6
6
|
fields?: DynamicFormI['form']
|
|
7
7
|
onRemove: (id: string) => void
|
|
8
8
|
}
|
|
9
|
+
|
|
10
|
+
export interface FieldTypesI {
|
|
11
|
+
callback?: TileCtaI['callback']
|
|
12
|
+
fields?: DynamicFormI['form']
|
|
13
|
+
menuItems?: MenuItemI[]
|
|
14
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DynamicFormI, MenuItemI, PartnerFooterI } from '@/interfaces'
|
|
2
|
+
|
|
3
|
+
export interface TileBodyLogoI {
|
|
4
|
+
menuItems?: MenuItemI[]
|
|
5
|
+
name?: string
|
|
6
|
+
value: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface TileBodyI extends Partial<PartnerFooterI> {
|
|
10
|
+
callback?: TileCtaI['callback']
|
|
11
|
+
fields?: DynamicFormI['form']
|
|
12
|
+
menuItems?: MenuItemI[]
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface VerticalIconI {
|
|
16
|
+
icon?: string
|
|
17
|
+
value: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface TileCtaI {
|
|
21
|
+
callback?: (value: string) => void
|
|
22
|
+
type: 'primary-cta' | 'secondary-cta'
|
|
23
|
+
value: string
|
|
24
|
+
}
|