@popsure/dirty-swan 0.66.16 → 0.66.18

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 (57) hide show
  1. package/dist/cjs/index.js +23 -19
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/lib/components/comparisonTable/index.stories.d.ts +4 -0
  4. package/dist/cjs/lib/components/table/Table.stories.d.ts +12 -0
  5. package/dist/cjs/lib/components/table/components/TableCell/CTACell/CTACell.d.ts +2 -1
  6. package/dist/cjs/lib/components/table/components/TableCell/CTACell/CTACell.stories.d.ts +1 -1
  7. package/dist/esm/components/comparisonTable/components/AccordionItem/AccordionItem.js +2 -2
  8. package/dist/esm/components/comparisonTable/components/AccordionItem/AccordionItem.js.map +1 -1
  9. package/dist/esm/components/comparisonTable/components/Row/index.js +4 -3
  10. package/dist/esm/components/comparisonTable/components/Row/index.js.map +1 -1
  11. package/dist/esm/components/comparisonTable/index.js +6 -6
  12. package/dist/esm/components/comparisonTable/index.js.map +1 -1
  13. package/dist/esm/components/comparisonTable/index.stories.js +267 -6
  14. package/dist/esm/components/comparisonTable/index.stories.js.map +1 -1
  15. package/dist/esm/components/icon/icons/Activity.js +2 -2
  16. package/dist/esm/components/icon/icons/Activity.js.map +1 -1
  17. package/dist/esm/components/icon/icons/DentalToothTeeth.js +2 -2
  18. package/dist/esm/components/icon/icons/DentalToothTeeth.js.map +1 -1
  19. package/dist/esm/components/icon/icons/DependentsFamily.js +2 -2
  20. package/dist/esm/components/icon/icons/DependentsFamily.js.map +1 -1
  21. package/dist/esm/components/icon/icons/GlobeNetworkEarth.js +2 -2
  22. package/dist/esm/components/icon/icons/GlobeNetworkEarth.js.map +1 -1
  23. package/dist/esm/components/icon/icons/HospitalBuilding.js +2 -2
  24. package/dist/esm/components/icon/icons/HospitalBuilding.js.map +1 -1
  25. package/dist/esm/components/icon/icons.stories.js +1 -1
  26. package/dist/esm/components/icon/index.stories.js +1 -1
  27. package/dist/esm/components/table/Table.js +1 -1
  28. package/dist/esm/components/table/Table.stories.js +355 -1
  29. package/dist/esm/components/table/Table.stories.js.map +1 -1
  30. package/dist/esm/components/table/components/TableCell/BaseCell/BaseCell.js +1 -1
  31. package/dist/esm/components/table/components/TableCell/BaseCell/BaseCell.js.map +1 -1
  32. package/dist/esm/components/table/components/TableCell/CTACell/CTACell.js +4 -2
  33. package/dist/esm/components/table/components/TableCell/CTACell/CTACell.js.map +1 -1
  34. package/dist/esm/components/table/components/TableCell/TableCell.js +4 -3
  35. package/dist/esm/components/table/components/TableCell/TableCell.js.map +1 -1
  36. package/dist/esm/components/table/components/TableContents/Collapsible.js +1 -1
  37. package/dist/esm/{index-BWJpOVlt.js → index-D41W71Hh.js} +11 -11
  38. package/dist/esm/{index-BWJpOVlt.js.map → index-D41W71Hh.js.map} +1 -1
  39. package/dist/esm/lib/components/comparisonTable/index.stories.d.ts +4 -0
  40. package/dist/esm/lib/components/table/Table.stories.d.ts +12 -0
  41. package/dist/esm/lib/components/table/components/TableCell/CTACell/CTACell.d.ts +2 -1
  42. package/dist/esm/lib/components/table/components/TableCell/CTACell/CTACell.stories.d.ts +1 -1
  43. package/package.json +1 -1
  44. package/src/lib/components/comparisonTable/components/AccordionItem/AccordionItem.module.scss +15 -3
  45. package/src/lib/components/comparisonTable/components/AccordionItem/AccordionItem.tsx +1 -1
  46. package/src/lib/components/comparisonTable/components/Row/index.tsx +2 -1
  47. package/src/lib/components/comparisonTable/components/Row/style.module.scss +20 -5
  48. package/src/lib/components/comparisonTable/index.stories.tsx +370 -0
  49. package/src/lib/components/comparisonTable/index.tsx +1 -5
  50. package/src/lib/components/comparisonTable/style.module.scss +10 -8
  51. package/src/lib/components/table/Table.module.scss +1 -1
  52. package/src/lib/components/table/Table.stories.tsx +387 -0
  53. package/src/lib/components/table/components/TableCell/BaseCell/BaseCell.tsx +2 -2
  54. package/src/lib/components/table/components/TableCell/CTACell/CTACell.tsx +5 -1
  55. package/src/lib/components/table/components/TableCell/TableCell.module.scss +4 -0
  56. package/src/lib/components/table/components/TableCell/TableCell.tsx +4 -1
  57. package/src/lib/components/table/components/TableContents/Collapsible.module.scss +1 -0
@@ -2,11 +2,22 @@ import {
2
2
  ComparisonTable,
3
3
  ComparisonTableProps,
4
4
  TableButton,
5
+ TableInfoButton,
5
6
  TableRating,
6
7
  TableRowHeader,
7
8
  TableTrueFalse,
8
9
  } from '.';
9
10
  import { CardButton } from '../cards';
11
+ import {
12
+ ActivityIcon,
13
+ DentalToothTeethIcon,
14
+ DependentsFamilyIcon,
15
+ EyeVisionIcon,
16
+ GlobeNetworkEarthIcon,
17
+ HeartIcon,
18
+ HospitalBuildingIcon,
19
+ } from '../icon';
20
+ import { MiniProgressBar } from '../table/components/TableCell/BaseCell/MiniProgressBar/MiniProgressBar';
10
21
 
11
22
  const headers = [
12
23
  {
@@ -372,6 +383,365 @@ export const ComparisonTableStory = {
372
383
  name: 'ComparisonTable',
373
384
  };
374
385
 
386
+ interface PlanData {
387
+ id: number;
388
+ name: string;
389
+ cashback: string | boolean;
390
+ dependents: string | boolean;
391
+ deductible: string | boolean;
392
+ generalDoctor: string;
393
+ specialist: string;
394
+ dentalCleanings: string | boolean;
395
+ dentalTreatments: string | boolean;
396
+ physiotherapy: string | boolean;
397
+ mentalHealth: string | boolean;
398
+ glasses: string | boolean;
399
+ laserEyeSurgery: string | boolean;
400
+ pregnancyCheckups: string | boolean;
401
+ childbirth: string | boolean;
402
+ hospitalAccommodation: string;
403
+ sickDayPayout: string | boolean;
404
+ emergencyAbroad: string | boolean;
405
+ repatriation: boolean;
406
+ }
407
+
408
+ const planData: PlanData[] = [
409
+ {
410
+ id: 1,
411
+ name: 'Standard',
412
+ cashback: 'Available',
413
+ dependents: 'Optional',
414
+ deductible: '€0 / €1,200 / €3,000',
415
+ generalDoctor: '100%',
416
+ specialist: '80%',
417
+ dentalCleanings: '80%',
418
+ dentalTreatments: false,
419
+ physiotherapy: '75%-90%',
420
+ mentalHealth: false,
421
+ glasses: false,
422
+ laserEyeSurgery: false,
423
+ pregnancyCheckups: '100%',
424
+ childbirth: 'Shared room',
425
+ hospitalAccommodation: 'Shared room',
426
+ sickDayPayout: '€2,000',
427
+ emergencyAbroad: 'Up to 6 weeks',
428
+ repatriation: false,
429
+ },
430
+ {
431
+ id: 2,
432
+ name: 'Plus',
433
+ cashback: 'Available',
434
+ dependents: 'Optional',
435
+ deductible: '€0 / €1,200 / €3,000',
436
+ generalDoctor: '100%',
437
+ specialist: '100%',
438
+ dentalCleanings: '90%',
439
+ dentalTreatments: '75%-90%',
440
+ physiotherapy: '80%-100%',
441
+ mentalHealth: '80%',
442
+ glasses: 'Up to €300',
443
+ laserEyeSurgery: false,
444
+ pregnancyCheckups: '100%',
445
+ childbirth: 'Twin room',
446
+ hospitalAccommodation: 'Twin room',
447
+ sickDayPayout: '€3,500',
448
+ emergencyAbroad: 'Up to 6 months',
449
+ repatriation: true,
450
+ },
451
+ {
452
+ id: 3,
453
+ name: 'Premium',
454
+ cashback: 'Available',
455
+ dependents: 'Optional',
456
+ deductible: '€0 / €1,200 / €3,000',
457
+ generalDoctor: '100%',
458
+ specialist: '100%',
459
+ dentalCleanings: '100%',
460
+ dentalTreatments: '80%-100%',
461
+ physiotherapy: '100%',
462
+ mentalHealth: '100%',
463
+ glasses: 'Up to €500',
464
+ laserEyeSurgery: 'Up to €1,000',
465
+ pregnancyCheckups: '100%',
466
+ childbirth: 'Private room',
467
+ hospitalAccommodation: 'Private room',
468
+ sickDayPayout: '€5,000',
469
+ emergencyAbroad: 'Unlimited',
470
+ repatriation: true,
471
+ },
472
+ {
473
+ id: 4,
474
+ name: 'Public',
475
+ cashback: false,
476
+ dependents: true,
477
+ deductible: false,
478
+ generalDoctor: '100%',
479
+ specialist: 'Referral needed',
480
+ dentalCleanings: false,
481
+ dentalTreatments: false,
482
+ physiotherapy: 'Copay applies',
483
+ mentalHealth: 'Limited sessions',
484
+ glasses: false,
485
+ laserEyeSurgery: false,
486
+ pregnancyCheckups: '100%',
487
+ childbirth: 'Shared room',
488
+ hospitalAccommodation: 'Shared room',
489
+ sickDayPayout: '70% of income',
490
+ emergencyAbroad: 'EU only',
491
+ repatriation: false,
492
+ },
493
+ ];
494
+
495
+ const progressLookup: Record<string, number> = {
496
+ '30%': 1,
497
+ '50%': 2,
498
+ '70%': 3,
499
+ '75%': 4,
500
+ '80%': 4,
501
+ '90%': 4,
502
+ '75%-90%': 4,
503
+ '75%-100%': 4,
504
+ '80%-100%': 4,
505
+ '100%': 5,
506
+ };
507
+
508
+ const renderStringWithProgress = (value: string) => (
509
+ <div className="d-flex fd-column">
510
+ {value}
511
+ {progressLookup[value] !== undefined && (
512
+ <MiniProgressBar nFilledBars={progressLookup[value]} />
513
+ )}
514
+ </div>
515
+ );
516
+
517
+ const renderStringOrBoolean = (value: string | boolean) =>
518
+ typeof value === 'string' ? (
519
+ renderStringWithProgress(value)
520
+ ) : (
521
+ <TableTrueFalse value={value} />
522
+ );
523
+
524
+ const renderPlanName = (name: string) => <p className="p-h3">{name}</p>;
525
+
526
+ const renderWithInfo = (value: string | boolean) => (
527
+ <div className="d-flex ai-center gap8">
528
+ {typeof value === 'string' ? value : <TableTrueFalse value={value} />}
529
+ <TableInfoButton onClick={() => {}} />
530
+ </div>
531
+ );
532
+
533
+ const renderDeductible = (value: string | boolean) =>
534
+ typeof value === 'string' ? (
535
+ <div>
536
+ <p className="p-p">{value}</p>
537
+ <p className="p-p tc-neutral-500">Adjustable</p>
538
+ </div>
539
+ ) : (
540
+ <TableTrueFalse value={value} />
541
+ );
542
+
543
+ const sectionLabel = (icon: React.ReactNode, title: string) => (
544
+ <p className="d-flex ai-center p-h3 c-gap8">
545
+ {icon} {title}
546
+ </p>
547
+ );
548
+
549
+ const privateHealthHeaders: Array<
550
+ ComparisonTableProps<PlanData>['headers'][number]
551
+ > = [
552
+ {
553
+ id: 0,
554
+ label: '',
555
+ default: true,
556
+ cells: [
557
+ {
558
+ key: 'name',
559
+ label: 'Our plans',
560
+ render: renderPlanName,
561
+ },
562
+ {
563
+ key: 'cashback',
564
+ label: 'Cashback',
565
+ render: renderStringOrBoolean,
566
+ },
567
+ {
568
+ key: 'dependents',
569
+ label: 'Dependents coverage',
570
+ render: renderWithInfo,
571
+ },
572
+ {
573
+ key: 'deductible',
574
+ label: <TableRowHeader label="Deductible" onClickInfo={() => {}} />,
575
+ render: renderDeductible,
576
+ },
577
+ ],
578
+ },
579
+ {
580
+ id: 1,
581
+ label: sectionLabel(<HeartIcon size={20} noMargin />, 'General'),
582
+ cells: [
583
+ {
584
+ key: 'generalDoctor',
585
+ label: (
586
+ <TableRowHeader
587
+ label="General doctors' visits"
588
+ onClickInfo={() => {}}
589
+ />
590
+ ),
591
+ render: renderStringOrBoolean,
592
+ },
593
+ {
594
+ key: 'specialist',
595
+ label: <TableRowHeader label="Specialists" onClickInfo={() => {}} />,
596
+ render: renderStringOrBoolean,
597
+ },
598
+ ],
599
+ },
600
+ {
601
+ id: 2,
602
+ label: sectionLabel(<DentalToothTeethIcon size={20} noMargin />, 'Dental'),
603
+ cells: [
604
+ {
605
+ key: 'dentalCleanings',
606
+ label: <TableRowHeader label="Dental cleanings" />,
607
+ render: renderStringOrBoolean,
608
+ },
609
+ {
610
+ key: 'dentalTreatments',
611
+ label: (
612
+ <TableRowHeader label="Dental treatments" onClickInfo={() => {}} />
613
+ ),
614
+ render: renderStringOrBoolean,
615
+ },
616
+ ],
617
+ },
618
+ {
619
+ id: 3,
620
+ label: sectionLabel(
621
+ <ActivityIcon size={20} noMargin />,
622
+ 'Treatment and therapies'
623
+ ),
624
+ cells: [
625
+ {
626
+ key: 'physiotherapy',
627
+ label: <TableRowHeader label="Physiotherapy" onClickInfo={() => {}} />,
628
+ render: renderStringOrBoolean,
629
+ },
630
+ {
631
+ key: 'mentalHealth',
632
+ label: <TableRowHeader label="Mental health therapy" />,
633
+ render: renderStringOrBoolean,
634
+ },
635
+ ],
636
+ },
637
+ {
638
+ id: 4,
639
+ label: sectionLabel(<EyeVisionIcon size={20} noMargin />, 'Vision'),
640
+ cells: [
641
+ {
642
+ key: 'glasses',
643
+ label: (
644
+ <TableRowHeader
645
+ label="Glasses & contact lenses"
646
+ onClickInfo={() => {}}
647
+ />
648
+ ),
649
+ render: renderStringOrBoolean,
650
+ },
651
+ {
652
+ key: 'laserEyeSurgery',
653
+ label: <TableRowHeader label="Laser eye surgery" />,
654
+ render: renderStringOrBoolean,
655
+ },
656
+ ],
657
+ },
658
+ {
659
+ id: 5,
660
+ label: sectionLabel(
661
+ <DependentsFamilyIcon size={20} noMargin />,
662
+ 'Pregnancy and childbirth'
663
+ ),
664
+ cells: [
665
+ {
666
+ key: 'pregnancyCheckups',
667
+ label: <TableRowHeader label="Pregnancy check-ups" />,
668
+ render: renderStringOrBoolean,
669
+ },
670
+ {
671
+ key: 'childbirth',
672
+ label: <TableRowHeader label="Childbirth" onClickInfo={() => {}} />,
673
+ render: renderStringOrBoolean,
674
+ },
675
+ ],
676
+ },
677
+ {
678
+ id: 6,
679
+ label: sectionLabel(
680
+ <HospitalBuildingIcon size={20} noMargin />,
681
+ 'Hospital'
682
+ ),
683
+ cells: [
684
+ {
685
+ key: 'hospitalAccommodation',
686
+ label: <TableRowHeader label="Accommodation" onClickInfo={() => {}} />,
687
+ render: renderStringOrBoolean,
688
+ },
689
+ {
690
+ key: 'sickDayPayout',
691
+ label: (
692
+ <TableRowHeader
693
+ label="Sick day payout"
694
+ subtitle="After 6 weeks of illness"
695
+ />
696
+ ),
697
+ render: renderStringOrBoolean,
698
+ },
699
+ ],
700
+ },
701
+ {
702
+ id: 7,
703
+ label: sectionLabel(
704
+ <GlobeNetworkEarthIcon size={20} noMargin />,
705
+ 'Outside of Germany'
706
+ ),
707
+ cells: [
708
+ {
709
+ key: 'emergencyAbroad',
710
+ label: (
711
+ <TableRowHeader
712
+ label="Emergency care abroad"
713
+ onClickInfo={() => {}}
714
+ />
715
+ ),
716
+ render: renderStringOrBoolean,
717
+ },
718
+ {
719
+ key: 'repatriation',
720
+ label: <TableRowHeader label="Medical repatriation" />,
721
+ render: renderStringOrBoolean,
722
+ },
723
+ ],
724
+ },
725
+ ];
726
+
727
+ export const PrivateHealthQuoteWidget = {
728
+ render: () => (
729
+ <div className="bg-white">
730
+ <ComparisonTable
731
+ data={planData}
732
+ headers={privateHealthHeaders}
733
+ collapsibleSections
734
+ hideScrollBarsMobile
735
+ hideDetails
736
+ showDetailsCaption="What's covered?"
737
+ hideDetailsCaption="Hide details"
738
+ />
739
+ </div>
740
+ ),
741
+
742
+ name: 'Private Health - Quote Widget',
743
+ };
744
+
375
745
  export const HeaderType = () => (
376
746
  <pre>
377
747
  {`export interface Header<T> {
@@ -124,7 +124,7 @@ const ComparisonTable = <T extends { id: number }>(
124
124
  <ScrollSync onSync={headerRefCallbackRef}>
125
125
  <div
126
126
  style={cssVariablesStyle}
127
- className={classNames({
127
+ className={classNames(baseStyles.card, {
128
128
  [baseStyles.noScrollBars]: hideScrollBars,
129
129
  [baseStyles.noScrollBarsMobile]: hideScrollBarsMobile,
130
130
  })}
@@ -191,11 +191,9 @@ const ComparisonTable = <T extends { id: number }>(
191
191
  {headerGroup.label && collapsibleSections ? (
192
192
  <AccordionItem
193
193
  className={classNames(
194
- baseStyles['collapsible-section'],
195
194
  classNameOverrides?.collapsibleSection
196
195
  )}
197
196
  label={headerGroup.label}
198
- headerClassName="p24 br8"
199
197
  isOpen={openSectionId === headerGroup.id}
200
198
  onToggle={() =>
201
199
  setOpenSectionId((prev) =>
@@ -213,7 +211,6 @@ const ComparisonTable = <T extends { id: number }>(
213
211
  <div
214
212
  className={classNames(
215
213
  baseStyles.container,
216
- 'pb16',
217
214
  classNameOverrides?.container,
218
215
  {
219
216
  [baseStyles.noScrollBars]: hideScrollBars,
@@ -244,7 +241,6 @@ const ComparisonTable = <T extends { id: number }>(
244
241
  <div
245
242
  className={classNames(
246
243
  baseStyles.container,
247
- 'pb16',
248
244
  classNameOverrides?.container,
249
245
  {
250
246
  [baseStyles.noScrollBars]: hideScrollBars,
@@ -1,6 +1,16 @@
1
1
  @use "../../scss/public/grid" as *;
2
2
  @use "../../scss/public/colors" as *;
3
3
 
4
+ .card {
5
+ border: 1px solid $ds-neutral-200;
6
+ border-radius: 12px;
7
+ padding: 24px;
8
+
9
+ section:last-of-type > button {
10
+ border-bottom: none;
11
+ }
12
+ }
13
+
4
14
  .container {
5
15
  width: 100%;
6
16
  overflow-x: auto;
@@ -39,10 +49,6 @@
39
49
  }
40
50
  }
41
51
 
42
- .collapsible-section {
43
- margin-top: 6px;
44
- }
45
-
46
52
  .section + .section {
47
53
  margin-top: 48px;
48
54
 
@@ -82,10 +88,6 @@
82
88
 
83
89
  top: 0;
84
90
  left: 0;
85
-
86
- @include p-size-tablet {
87
- border-right: 1px solid $ds-neutral-50;
88
- }
89
91
  }
90
92
 
91
93
  .header {
@@ -6,7 +6,7 @@
6
6
  position: relative;
7
7
  border: 1px solid $ds-neutral-200;
8
8
  border-radius: 12px;
9
- padding: 24px 24px 0;
9
+ padding: 24px;
10
10
  }
11
11
 
12
12
  .container {