@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.
Files changed (68) hide show
  1. package/dist/components/customToast/CustomToast.js +1 -1
  2. package/dist/components/customToast/StatusIllustration.js +3 -3
  3. package/dist/components/forms/dynamicForm/DynamicForm.d.ts +1 -1
  4. package/dist/components/forms/dynamicForm/DynamicForm.js +16 -2
  5. package/dist/components/forms/dynamicForm/fields/SingleFields.d.ts +2 -5
  6. package/dist/components/forms/dynamicForm/fields/SingleFields.js +16 -2
  7. package/dist/components/forms/dynamicForm/fields/index.d.ts +1 -0
  8. package/dist/components/forms/dynamicForm/fields/index.js +1 -0
  9. package/dist/components/forms/dynamicForm/fields/uiFields/TileBody.d.ts +2 -0
  10. package/dist/components/forms/dynamicForm/fields/uiFields/TileBody.js +18 -0
  11. package/dist/components/forms/dynamicForm/fields/uiFields/TileBody.tsx +24 -0
  12. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyAction.d.ts +2 -0
  13. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyAction.js +6 -0
  14. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyAction.tsx +11 -0
  15. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyHeader.d.ts +3 -0
  16. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyHeader.js +5 -0
  17. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyHeader.tsx +9 -0
  18. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyLogo.d.ts +2 -0
  19. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyLogo.js +5 -0
  20. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodyLogo.tsx +10 -0
  21. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodySectionGrid.d.ts +2 -0
  22. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodySectionGrid.js +6 -0
  23. package/dist/components/forms/dynamicForm/fields/uiFields/TileBodySectionGrid.tsx +11 -0
  24. package/dist/components/forms/dynamicForm/fields/uiFields/TileCta.d.ts +2 -0
  25. package/dist/components/forms/dynamicForm/fields/uiFields/TileCta.js +5 -0
  26. package/dist/components/forms/dynamicForm/fields/uiFields/TileCta.tsx +14 -0
  27. package/dist/components/forms/dynamicForm/fields/uiFields/VerticalIcon.d.ts +2 -0
  28. package/dist/components/forms/dynamicForm/fields/uiFields/VerticalIcon.js +5 -0
  29. package/dist/components/forms/dynamicForm/fields/uiFields/VerticalIcon.tsx +31 -0
  30. package/dist/components/forms/dynamicForm/fields/uiFields/index.d.ts +7 -0
  31. package/dist/components/forms/dynamicForm/fields/uiFields/index.js +7 -0
  32. package/dist/components/forms/dynamicForm/fields/uiFields/index.ts +7 -0
  33. package/dist/components/sendDocument/RecipientContent.js +3 -1
  34. package/dist/helpers/forms/dynamicForm.helper.js +7 -1
  35. package/dist/interfaces/forms/dynamicForm/DynamicForm.interface.d.ts +9 -4
  36. package/dist/interfaces/forms/dynamicForm/fields/GroupField.interface.d.ts +6 -1
  37. package/dist/interfaces/forms/dynamicForm/fields/UIFields.interface.d.ts +20 -0
  38. package/dist/interfaces/forms/dynamicForm/fields/UIFields.interface.js +1 -0
  39. package/dist/interfaces/forms/dynamicForm/fields/index.d.ts +1 -0
  40. package/dist/interfaces/forms/dynamicForm/fields/index.js +1 -0
  41. package/dist/interfaces/partner/PartnerFooter.interface.d.ts +0 -1
  42. package/dist/mocks/forms/dynamicForm.mock.d.ts +1 -0
  43. package/dist/mocks/forms/dynamicForm.mock.js +159 -0
  44. package/dist/stories/forms/dynamicForm/DynamicForm.stories.d.ts +1 -0
  45. package/dist/stories/forms/dynamicForm/DynamicForm.stories.js +9 -3
  46. package/package.json +1 -1
  47. package/src/components/customToast/CustomToast.tsx +4 -3
  48. package/src/components/customToast/StatusIllustration.tsx +3 -3
  49. package/src/components/forms/dynamicForm/DynamicForm.tsx +14 -0
  50. package/src/components/forms/dynamicForm/fields/SingleFields.tsx +62 -6
  51. package/src/components/forms/dynamicForm/fields/index.ts +1 -0
  52. package/src/components/forms/dynamicForm/fields/uiFields/TileBody.tsx +24 -0
  53. package/src/components/forms/dynamicForm/fields/uiFields/TileBodyAction.tsx +11 -0
  54. package/src/components/forms/dynamicForm/fields/uiFields/TileBodyHeader.tsx +9 -0
  55. package/src/components/forms/dynamicForm/fields/uiFields/TileBodyLogo.tsx +10 -0
  56. package/src/components/forms/dynamicForm/fields/uiFields/TileBodySectionGrid.tsx +11 -0
  57. package/src/components/forms/dynamicForm/fields/uiFields/TileCta.tsx +14 -0
  58. package/src/components/forms/dynamicForm/fields/uiFields/VerticalIcon.tsx +31 -0
  59. package/src/components/forms/dynamicForm/fields/uiFields/index.ts +7 -0
  60. package/src/components/sendDocument/RecipientContent.tsx +15 -7
  61. package/src/helpers/forms/dynamicForm.helper.ts +12 -0
  62. package/src/interfaces/forms/dynamicForm/DynamicForm.interface.ts +27 -2
  63. package/src/interfaces/forms/dynamicForm/fields/GroupField.interface.ts +7 -1
  64. package/src/interfaces/forms/dynamicForm/fields/UIFields.interface.ts +24 -0
  65. package/src/interfaces/forms/dynamicForm/fields/index.ts +1 -0
  66. package/src/interfaces/partner/PartnerFooter.interface.ts +0 -1
  67. package/src/mocks/forms/dynamicForm.mock.ts +162 -0
  68. package/src/stories/forms/dynamicForm/DynamicForm.stories.tsx +14 -3
@@ -8,3 +8,4 @@ export * from './SelectField.interface'
8
8
  export * from './SwitchField.interface'
9
9
  export * from './TextAreaField.interface'
10
10
  export * from './TextField.interface'
11
+ export * from './UIFields.interface'
@@ -12,7 +12,6 @@ export interface SocialLinkI {
12
12
  }
13
13
 
14
14
  export interface PartnerFooterI {
15
- iconSize?: number
16
15
  socialLinks?: SocialLinkI[]
17
16
  websiteUrl: string
18
17
  urlText?: string
@@ -1,3 +1,4 @@
1
+ import { Shine } from '@/assets/images'
1
2
  import { ReportI } from '@/interfaces'
2
3
  import { faker } from '@faker-js/faker'
3
4
 
@@ -347,3 +348,164 @@ export const contactFieldsMock: ReportI[] = [
347
348
  icon: 'image',
348
349
  },
349
350
  ]
351
+
352
+ export const tileUIMock: ReportI[] = [
353
+ {
354
+ id: faker.database.mongodbObjectId(),
355
+ name: faker.lorem.word(),
356
+ description: faker.lorem.sentence(),
357
+ comments: faker.lorem.sentence(),
358
+ value: '',
359
+ type: 'tile-body',
360
+ visible: true,
361
+ options: [],
362
+ children: [
363
+ {
364
+ id: faker.database.mongodbObjectId(),
365
+ name: 'Shine',
366
+ description: '',
367
+ comments: '',
368
+ value: Shine,
369
+ type: 'tile-body-logo',
370
+ },
371
+ {
372
+ id: faker.database.mongodbObjectId(),
373
+ name: '',
374
+ description: '',
375
+ comments: '',
376
+ value: 'We do windows and so much more!',
377
+ type: 'tile-body-header',
378
+ },
379
+ {
380
+ id: faker.database.mongodbObjectId(),
381
+ name: '',
382
+ description: '',
383
+ comments: '',
384
+ value: '',
385
+ type: 'tile-body-section-grid',
386
+ children: [
387
+ {
388
+ id: faker.database.mongodbObjectId(),
389
+ name: '',
390
+ description: '',
391
+ comments: '',
392
+ value: 'Pressure Washing',
393
+ type: 'vertical-icon',
394
+ icon: 'sh-pressure',
395
+ },
396
+ {
397
+ id: faker.database.mongodbObjectId(),
398
+ name: '',
399
+ description: '',
400
+ comments: '',
401
+ value: 'Widow Cleaning',
402
+ type: 'vertical-icon',
403
+ icon: 'sh-window',
404
+ },
405
+ {
406
+ id: faker.database.mongodbObjectId(),
407
+ name: '',
408
+ description: '',
409
+ comments: '',
410
+ value: 'Roof Cleaning',
411
+ type: 'vertical-icon',
412
+ icon: 'sh-roof',
413
+ },
414
+ {
415
+ id: faker.database.mongodbObjectId(),
416
+ name: '',
417
+ description: '',
418
+ comments: '',
419
+ value: 'Holiday Lights',
420
+ type: 'vertical-icon',
421
+ icon: 'sh-lights',
422
+ },
423
+ {
424
+ id: faker.database.mongodbObjectId(),
425
+ name: '',
426
+ description: '',
427
+ comments: '',
428
+ value: 'Gutter Cleaning',
429
+ type: 'vertical-icon',
430
+ icon: 'sh-gutter',
431
+ },
432
+ ],
433
+ },
434
+
435
+ {
436
+ id: faker.database.mongodbObjectId(),
437
+ name: '',
438
+ description: '',
439
+ comments: '',
440
+ value: '',
441
+ type: 'tile-body-action',
442
+ children: [
443
+ {
444
+ id: faker.database.mongodbObjectId(),
445
+ name: '',
446
+ description: '',
447
+ comments: '',
448
+ value: 'Schedule Service',
449
+ type: 'primary-cta',
450
+ link: 'www.shine.com',
451
+ },
452
+ {
453
+ id: faker.database.mongodbObjectId(),
454
+ name: '',
455
+ description: '',
456
+ comments: '',
457
+ value: 'Request Support',
458
+ type: 'secondary-cta',
459
+ link: 'open-drawer',
460
+ },
461
+ ],
462
+ },
463
+ ],
464
+ },
465
+ {
466
+ id: faker.database.mongodbObjectId(),
467
+ name: '',
468
+ description: '',
469
+ comments: '',
470
+ value: '',
471
+ type: 'tile-form',
472
+ visible: true,
473
+ children: [
474
+ {
475
+ id: faker.database.mongodbObjectId(),
476
+ name: '',
477
+ description:
478
+ '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.',
479
+ comments: '',
480
+ value: '',
481
+ type: 'textarea',
482
+ },
483
+ {
484
+ id: faker.database.mongodbObjectId(),
485
+ name: '',
486
+ description: '',
487
+ comments: '',
488
+ value: '',
489
+ type: 'grid',
490
+ children: [
491
+ {
492
+ id: faker.database.mongodbObjectId(),
493
+ name: '',
494
+ description: 'Contact Phone',
495
+ comments: '',
496
+ value: '',
497
+ type: 'telephone',
498
+ },
499
+ {
500
+ id: faker.database.mongodbObjectId(),
501
+ name: '',
502
+ description: 'Contact Email',
503
+ comments: '',
504
+ value: '',
505
+ type: 'email',
506
+ },
507
+ ],
508
+ },
509
+ ],
510
+ },
511
+ ]
@@ -2,22 +2,33 @@ import { Meta } from '@storybook/react'
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
  import { DynamicFormI } from '@/interfaces'
7
7
 
8
8
  export default {
9
9
  title: 'Components/Forms/DynamicForm',
10
10
  component: DynamicForm,
11
11
  args: {
12
- form: formFieldsMock,
12
+ callback: action('callback'),
13
13
  onUpload: action('onUpload'),
14
+ menuItems: menuMock,
15
+ socialLinks: socialLinksMock,
16
+ websiteUrl: 'http://www.audreyscheckdesign.com',
14
17
  },
15
18
  } as Meta
16
19
 
17
20
  export const DynamicFormComponent = (args: DynamicFormI) => {
18
21
  return (
19
22
  <Box p="base" bg="neutral.white" w={['full', '500px']}>
20
- <DynamicForm {...args} />
23
+ <DynamicForm {...args} form={formFieldsMock} />
24
+ </Box>
25
+ )
26
+ }
27
+
28
+ export const DynamicUIFormComponent = (args: DynamicFormI) => {
29
+ return (
30
+ <Box m="base" w={['full', '320px']}>
31
+ <DynamicForm {...args} form={tileUIMock} showTitle={false} />
21
32
  </Box>
22
33
  )
23
34
  }