willba-component-library 0.2.57 → 0.2.58

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.
@@ -5,3 +5,4 @@ export default meta;
5
5
  type Story = StoryObj<typeof FilterCalendar>;
6
6
  export declare const Default: Story;
7
7
  export declare const RangeContext: Story;
8
+ export declare const DisabledRangeContextDates: Story;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "willba-component-library",
3
- "version": "0.2.57",
3
+ "version": "0.2.58",
4
4
  "description": "A custom UI component library",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.esm.js",
@@ -15,60 +15,150 @@ type Story = StoryObj<typeof FilterCalendar>
15
15
  const baseData = {
16
16
  disableCalendarDates: {
17
17
  availableDates: [
18
+ {
19
+ checkIn: new Date('2024-10-14'),
20
+ firstCheckOut: new Date('2024-10-15'),
21
+ lastCheckOut: new Date('2024-11-12'),
22
+ },
23
+ {
24
+ checkIn: new Date('2024-10-15'),
25
+ firstCheckOut: new Date('2024-10-16'),
26
+ lastCheckOut: new Date('2024-11-12'),
27
+ },
28
+ {
29
+ checkIn: new Date('2024-10-16'),
30
+ firstCheckOut: new Date('2024-10-17'),
31
+ lastCheckOut: new Date('2024-11-12'),
32
+ },
33
+ {
34
+ checkIn: new Date('2024-10-17'),
35
+ firstCheckOut: new Date('2024-10-18'),
36
+ lastCheckOut: new Date('2024-11-12'),
37
+ },
38
+ {
39
+ checkIn: new Date('2024-10-18'),
40
+ firstCheckOut: new Date('2024-10-19'),
41
+ lastCheckOut: new Date('2024-11-12'),
42
+ },
43
+ {
44
+ checkIn: new Date('2024-10-19'),
45
+ firstCheckOut: new Date('2024-10-20'),
46
+ lastCheckOut: new Date('2024-11-12'),
47
+ },
48
+ {
49
+ checkIn: new Date('2024-10-20'),
50
+ firstCheckOut: new Date('2024-10-21'),
51
+ lastCheckOut: new Date('2024-11-12'),
52
+ },
53
+ {
54
+ checkIn: new Date('2024-10-21'),
55
+ firstCheckOut: new Date('2024-10-22'),
56
+ lastCheckOut: new Date('2024-11-12'),
57
+ },
58
+ {
59
+ checkIn: new Date('2024-10-22'),
60
+ firstCheckOut: new Date('2024-10-23'),
61
+ lastCheckOut: new Date('2024-11-12'),
62
+ },
63
+ {
64
+ checkIn: new Date('2024-10-23'),
65
+ firstCheckOut: new Date('2024-10-24'),
66
+ lastCheckOut: new Date('2024-11-12'),
67
+ },
68
+ {
69
+ checkIn: new Date('2024-10-24'),
70
+ firstCheckOut: new Date('2024-10-25'),
71
+ lastCheckOut: new Date('2024-11-12'),
72
+ },
73
+ {
74
+ checkIn: new Date('2024-10-25'),
75
+ firstCheckOut: new Date('2024-10-26'),
76
+ lastCheckOut: new Date('2024-11-12'),
77
+ },
78
+ {
79
+ checkIn: new Date('2024-10-26'),
80
+ firstCheckOut: new Date('2024-10-27'),
81
+ lastCheckOut: new Date('2024-11-12'),
82
+ },
83
+ {
84
+ checkIn: new Date('2024-10-27'),
85
+ firstCheckOut: new Date('2024-10-28'),
86
+ lastCheckOut: new Date('2024-11-12'),
87
+ },
88
+ {
89
+ checkIn: new Date('2024-10-28'),
90
+ firstCheckOut: new Date('2024-10-29'),
91
+ lastCheckOut: new Date('2024-11-12'),
92
+ },
93
+ {
94
+ checkIn: new Date('2024-10-29'),
95
+ firstCheckOut: new Date('2024-10-30'),
96
+ lastCheckOut: new Date('2024-11-12'),
97
+ },
98
+ {
99
+ checkIn: new Date('2024-10-30'),
100
+ firstCheckOut: new Date('2024-10-31'),
101
+ lastCheckOut: new Date('2024-11-12'),
102
+ },
103
+ {
104
+ checkIn: new Date('2024-10-31'),
105
+ firstCheckOut: new Date('2024-11-01'),
106
+ lastCheckOut: new Date('2024-11-12'),
107
+ },
18
108
  {
19
109
  checkIn: new Date('2024-11-01'),
20
110
  firstCheckOut: new Date('2024-11-02'),
21
- lastCheckOut: new Date('2024-11-11'),
111
+ lastCheckOut: new Date('2024-11-12'),
22
112
  },
23
113
  {
24
114
  checkIn: new Date('2024-11-02'),
25
115
  firstCheckOut: new Date('2024-11-03'),
26
- lastCheckOut: new Date('2024-11-11'),
116
+ lastCheckOut: new Date('2024-11-12'),
27
117
  },
28
118
  {
29
119
  checkIn: new Date('2024-11-03'),
30
120
  firstCheckOut: new Date('2024-11-04'),
31
- lastCheckOut: new Date('2024-11-11'),
121
+ lastCheckOut: new Date('2024-11-12'),
32
122
  },
33
123
  {
34
124
  checkIn: new Date('2024-11-04'),
35
125
  firstCheckOut: new Date('2024-11-05'),
36
- lastCheckOut: new Date('2024-11-11'),
126
+ lastCheckOut: new Date('2024-11-12'),
37
127
  },
38
128
  {
39
129
  checkIn: new Date('2024-11-05'),
40
130
  firstCheckOut: new Date('2024-11-06'),
41
- lastCheckOut: new Date('2024-11-11'),
131
+ lastCheckOut: new Date('2024-11-12'),
42
132
  },
43
133
  {
44
134
  checkIn: new Date('2024-11-06'),
45
135
  firstCheckOut: new Date('2024-11-07'),
46
- lastCheckOut: new Date('2024-11-11'),
136
+ lastCheckOut: new Date('2024-11-12'),
47
137
  },
48
138
  {
49
139
  checkIn: new Date('2024-11-07'),
50
140
  firstCheckOut: new Date('2024-11-08'),
51
- lastCheckOut: new Date('2024-11-11'),
141
+ lastCheckOut: new Date('2024-11-12'),
52
142
  },
53
143
  {
54
144
  checkIn: new Date('2024-11-08'),
55
145
  firstCheckOut: new Date('2024-11-09'),
56
- lastCheckOut: new Date('2024-11-11'),
146
+ lastCheckOut: new Date('2024-11-12'),
57
147
  },
58
148
  {
59
149
  checkIn: new Date('2024-11-09'),
60
150
  firstCheckOut: new Date('2024-11-10'),
61
- lastCheckOut: new Date('2024-11-11'),
151
+ lastCheckOut: new Date('2024-11-12'),
62
152
  },
63
153
  {
64
154
  checkIn: new Date('2024-11-10'),
65
155
  firstCheckOut: new Date('2024-11-11'),
66
- lastCheckOut: new Date('2024-11-11'),
156
+ lastCheckOut: new Date('2024-11-12'),
67
157
  },
68
158
  {
69
- checkIn: new Date('2024-11-15'),
70
- firstCheckOut: new Date('2024-11-16'),
71
- lastCheckOut: new Date('2025-03-01'),
159
+ checkIn: new Date('2024-11-11'),
160
+ firstCheckOut: new Date('2024-11-12'),
161
+ lastCheckOut: new Date('2024-11-12'),
72
162
  },
73
163
  {
74
164
  checkIn: new Date('2024-11-16'),
@@ -302,22 +392,8 @@ const baseData = {
302
392
  },
303
393
  ],
304
394
  disabledDates: [
305
- {
306
- to: new Date('2024-10-09'),
307
- from: new Date('2024-10-01'),
308
- },
309
- {
310
- to: new Date('2024-10-18'),
311
- from: new Date('2024-10-17'),
312
- },
313
- {
314
- to: new Date('2024-10-23'),
315
- from: new Date('2024-10-22'),
316
- },
317
- {
318
- to: new Date('2024-11-14'),
319
- from: new Date('2024-11-11'),
320
- },
395
+ { from: new Date('2024-10-01'), to: new Date('2024-10-13') },
396
+ { from: new Date('2024-11-12'), to: new Date('2024-11-15') },
321
397
  ],
322
398
  },
323
399
  language: 'en',
@@ -374,3 +450,334 @@ export const RangeContext: Story = {
374
450
  )
375
451
  },
376
452
  }
453
+
454
+ export const DisabledRangeContextDates: Story = {
455
+ args: {
456
+ ...baseData,
457
+ rangeContext: {
458
+ from: new Date('2024-11-12'),
459
+ to: new Date('2024-11-16'),
460
+ },
461
+ },
462
+ render: (args) => {
463
+ const [toggleCalendar, setToggleCalendar] = useState(true)
464
+ return (
465
+ <div style={{ padding: '30px', height: '100vh' }}>
466
+ <FilterCalendar
467
+ {...args}
468
+ toggleCalendar={toggleCalendar}
469
+ setToggleCalendar={setToggleCalendar}
470
+ />
471
+ {/* <button onClick={() => setToggleCalendar(true)}>Open calendar</button> */}
472
+ </div>
473
+ )
474
+ },
475
+ }
476
+
477
+ // disableCalendarDates: {
478
+ // availableDates: [
479
+ // {
480
+ // checkIn: new Date('2024-11-01'),
481
+ // firstCheckOut: new Date('2024-11-02'),
482
+ // lastCheckOut: new Date('2024-11-11'),
483
+ // },
484
+ // {
485
+ // checkIn: new Date('2024-11-02'),
486
+ // firstCheckOut: new Date('2024-11-03'),
487
+ // lastCheckOut: new Date('2024-11-11'),
488
+ // },
489
+ // {
490
+ // checkIn: new Date('2024-11-03'),
491
+ // firstCheckOut: new Date('2024-11-04'),
492
+ // lastCheckOut: new Date('2024-11-11'),
493
+ // },
494
+ // {
495
+ // checkIn: new Date('2024-11-04'),
496
+ // firstCheckOut: new Date('2024-11-05'),
497
+ // lastCheckOut: new Date('2024-11-11'),
498
+ // },
499
+ // {
500
+ // checkIn: new Date('2024-11-05'),
501
+ // firstCheckOut: new Date('2024-11-06'),
502
+ // lastCheckOut: new Date('2024-11-11'),
503
+ // },
504
+ // {
505
+ // checkIn: new Date('2024-11-06'),
506
+ // firstCheckOut: new Date('2024-11-07'),
507
+ // lastCheckOut: new Date('2024-11-11'),
508
+ // },
509
+ // {
510
+ // checkIn: new Date('2024-11-07'),
511
+ // firstCheckOut: new Date('2024-11-08'),
512
+ // lastCheckOut: new Date('2024-11-11'),
513
+ // },
514
+ // {
515
+ // checkIn: new Date('2024-11-08'),
516
+ // firstCheckOut: new Date('2024-11-09'),
517
+ // lastCheckOut: new Date('2024-11-11'),
518
+ // },
519
+ // {
520
+ // checkIn: new Date('2024-11-09'),
521
+ // firstCheckOut: new Date('2024-11-10'),
522
+ // lastCheckOut: new Date('2024-11-11'),
523
+ // },
524
+ // {
525
+ // checkIn: new Date('2024-11-10'),
526
+ // firstCheckOut: new Date('2024-11-11'),
527
+ // lastCheckOut: new Date('2024-11-11'),
528
+ // },
529
+ // {
530
+ // checkIn: new Date('2024-11-15'),
531
+ // firstCheckOut: new Date('2024-11-16'),
532
+ // lastCheckOut: new Date('2025-03-01'),
533
+ // },
534
+ // {
535
+ // checkIn: new Date('2024-11-16'),
536
+ // firstCheckOut: new Date('2024-11-17'),
537
+ // lastCheckOut: new Date('2025-03-01'),
538
+ // },
539
+ // {
540
+ // checkIn: new Date('2024-11-17'),
541
+ // firstCheckOut: new Date('2024-11-18'),
542
+ // lastCheckOut: new Date('2025-03-01'),
543
+ // },
544
+ // {
545
+ // checkIn: new Date('2024-11-18'),
546
+ // firstCheckOut: new Date('2024-11-19'),
547
+ // lastCheckOut: new Date('2025-03-01'),
548
+ // },
549
+ // {
550
+ // checkIn: new Date('2024-11-19'),
551
+ // firstCheckOut: new Date('2024-11-20'),
552
+ // lastCheckOut: new Date('2025-03-01'),
553
+ // },
554
+ // {
555
+ // checkIn: new Date('2024-11-20'),
556
+ // firstCheckOut: new Date('2024-11-21'),
557
+ // lastCheckOut: new Date('2025-03-01'),
558
+ // },
559
+ // {
560
+ // checkIn: new Date('2024-11-21'),
561
+ // firstCheckOut: new Date('2024-11-22'),
562
+ // lastCheckOut: new Date('2025-03-01'),
563
+ // },
564
+ // {
565
+ // checkIn: new Date('2024-11-22'),
566
+ // firstCheckOut: new Date('2024-11-23'),
567
+ // lastCheckOut: new Date('2025-03-01'),
568
+ // },
569
+ // {
570
+ // checkIn: new Date('2024-11-23'),
571
+ // firstCheckOut: new Date('2024-11-24'),
572
+ // lastCheckOut: new Date('2025-03-01'),
573
+ // },
574
+ // {
575
+ // checkIn: new Date('2024-11-24'),
576
+ // firstCheckOut: new Date('2024-11-25'),
577
+ // lastCheckOut: new Date('2025-03-01'),
578
+ // },
579
+ // {
580
+ // checkIn: new Date('2024-11-25'),
581
+ // firstCheckOut: new Date('2024-11-26'),
582
+ // lastCheckOut: new Date('2025-03-01'),
583
+ // },
584
+ // {
585
+ // checkIn: new Date('2024-11-26'),
586
+ // firstCheckOut: new Date('2024-11-27'),
587
+ // lastCheckOut: new Date('2025-03-01'),
588
+ // },
589
+ // {
590
+ // checkIn: new Date('2024-11-27'),
591
+ // firstCheckOut: new Date('2024-11-28'),
592
+ // lastCheckOut: new Date('2025-03-01'),
593
+ // },
594
+ // {
595
+ // checkIn: new Date('2024-11-28'),
596
+ // firstCheckOut: new Date('2024-11-29'),
597
+ // lastCheckOut: new Date('2025-03-01'),
598
+ // },
599
+ // {
600
+ // checkIn: new Date('2024-11-29'),
601
+ // firstCheckOut: new Date('2024-11-30'),
602
+ // lastCheckOut: new Date('2025-03-01'),
603
+ // },
604
+ // {
605
+ // checkIn: new Date('2024-11-30'),
606
+ // firstCheckOut: new Date('2024-12-01'),
607
+ // lastCheckOut: new Date('2025-03-01'),
608
+ // },
609
+ // {
610
+ // checkIn: new Date('2024-12-01'),
611
+ // firstCheckOut: new Date('2024-12-02'),
612
+ // lastCheckOut: new Date('2025-03-01'),
613
+ // },
614
+ // {
615
+ // checkIn: new Date('2024-12-02'),
616
+ // firstCheckOut: new Date('2024-12-03'),
617
+ // lastCheckOut: new Date('2025-03-01'),
618
+ // },
619
+ // {
620
+ // checkIn: new Date('2024-12-03'),
621
+ // firstCheckOut: new Date('2024-12-04'),
622
+ // lastCheckOut: new Date('2025-03-01'),
623
+ // },
624
+ // {
625
+ // checkIn: new Date('2024-12-04'),
626
+ // firstCheckOut: new Date('2024-12-05'),
627
+ // lastCheckOut: new Date('2025-03-01'),
628
+ // },
629
+ // {
630
+ // checkIn: new Date('2024-12-05'),
631
+ // firstCheckOut: new Date('2024-12-06'),
632
+ // lastCheckOut: new Date('2025-03-01'),
633
+ // },
634
+ // {
635
+ // checkIn: new Date('2024-12-06'),
636
+ // firstCheckOut: new Date('2024-12-07'),
637
+ // lastCheckOut: new Date('2025-03-01'),
638
+ // },
639
+ // {
640
+ // checkIn: new Date('2024-12-07'),
641
+ // firstCheckOut: new Date('2024-12-08'),
642
+ // lastCheckOut: new Date('2025-03-01'),
643
+ // },
644
+ // {
645
+ // checkIn: new Date('2024-12-08'),
646
+ // firstCheckOut: new Date('2024-12-09'),
647
+ // lastCheckOut: new Date('2025-03-01'),
648
+ // },
649
+ // {
650
+ // checkIn: new Date('2024-12-09'),
651
+ // firstCheckOut: new Date('2024-12-10'),
652
+ // lastCheckOut: new Date('2025-03-01'),
653
+ // },
654
+ // {
655
+ // checkIn: new Date('2024-12-10'),
656
+ // firstCheckOut: new Date('2024-12-11'),
657
+ // lastCheckOut: new Date('2025-03-01'),
658
+ // },
659
+ // {
660
+ // checkIn: new Date('2024-12-11'),
661
+ // firstCheckOut: new Date('2024-12-12'),
662
+ // lastCheckOut: new Date('2025-03-01'),
663
+ // },
664
+ // {
665
+ // checkIn: new Date('2024-12-12'),
666
+ // firstCheckOut: new Date('2024-12-13'),
667
+ // lastCheckOut: new Date('2025-03-01'),
668
+ // },
669
+ // {
670
+ // checkIn: new Date('2024-12-13'),
671
+ // firstCheckOut: new Date('2024-12-14'),
672
+ // lastCheckOut: new Date('2025-03-01'),
673
+ // },
674
+ // {
675
+ // checkIn: new Date('2024-12-14'),
676
+ // firstCheckOut: new Date('2024-12-15'),
677
+ // lastCheckOut: new Date('2025-03-01'),
678
+ // },
679
+ // {
680
+ // checkIn: new Date('2024-12-15'),
681
+ // firstCheckOut: new Date('2024-12-16'),
682
+ // lastCheckOut: new Date('2025-03-01'),
683
+ // },
684
+ // {
685
+ // checkIn: new Date('2024-12-16'),
686
+ // firstCheckOut: new Date('2024-12-17'),
687
+ // lastCheckOut: new Date('2025-03-01'),
688
+ // },
689
+ // {
690
+ // checkIn: new Date('2024-12-17'),
691
+ // firstCheckOut: new Date('2024-12-18'),
692
+ // lastCheckOut: new Date('2025-03-01'),
693
+ // },
694
+ // {
695
+ // checkIn: new Date('2024-12-18'),
696
+ // firstCheckOut: new Date('2024-12-19'),
697
+ // lastCheckOut: new Date('2025-03-01'),
698
+ // },
699
+ // {
700
+ // checkIn: new Date('2024-12-19'),
701
+ // firstCheckOut: new Date('2024-12-20'),
702
+ // lastCheckOut: new Date('2025-03-01'),
703
+ // },
704
+ // {
705
+ // checkIn: new Date('2024-12-20'),
706
+ // firstCheckOut: new Date('2024-12-21'),
707
+ // lastCheckOut: new Date('2025-03-01'),
708
+ // },
709
+ // {
710
+ // checkIn: new Date('2024-12-21'),
711
+ // firstCheckOut: new Date('2024-12-22'),
712
+ // lastCheckOut: new Date('2025-03-01'),
713
+ // },
714
+ // {
715
+ // checkIn: new Date('2024-12-22'),
716
+ // firstCheckOut: new Date('2024-12-23'),
717
+ // lastCheckOut: new Date('2025-03-01'),
718
+ // },
719
+ // {
720
+ // checkIn: new Date('2024-12-23'),
721
+ // firstCheckOut: new Date('2024-12-24'),
722
+ // lastCheckOut: new Date('2025-03-01'),
723
+ // },
724
+ // {
725
+ // checkIn: new Date('2024-12-24'),
726
+ // firstCheckOut: new Date('2024-12-25'),
727
+ // lastCheckOut: new Date('2025-03-01'),
728
+ // },
729
+ // {
730
+ // checkIn: new Date('2024-12-25'),
731
+ // firstCheckOut: new Date('2024-12-26'),
732
+ // lastCheckOut: new Date('2025-03-01'),
733
+ // },
734
+ // {
735
+ // checkIn: new Date('2024-12-26'),
736
+ // firstCheckOut: new Date('2024-12-27'),
737
+ // lastCheckOut: new Date('2025-03-01'),
738
+ // },
739
+ // {
740
+ // checkIn: new Date('2024-12-27'),
741
+ // firstCheckOut: new Date('2024-12-28'),
742
+ // lastCheckOut: new Date('2025-03-01'),
743
+ // },
744
+ // {
745
+ // checkIn: new Date('2024-12-28'),
746
+ // firstCheckOut: new Date('2024-12-29'),
747
+ // lastCheckOut: new Date('2025-03-01'),
748
+ // },
749
+ // {
750
+ // checkIn: new Date('2024-12-29'),
751
+ // firstCheckOut: new Date('2024-12-30'),
752
+ // lastCheckOut: new Date('2025-03-01'),
753
+ // },
754
+ // {
755
+ // checkIn: new Date('2024-12-30'),
756
+ // firstCheckOut: new Date('2024-12-31'),
757
+ // lastCheckOut: new Date('2025-03-01'),
758
+ // },
759
+ // {
760
+ // checkIn: new Date('2024-12-31'),
761
+ // firstCheckOut: new Date('2025-01-01'),
762
+ // lastCheckOut: new Date('2025-03-01'),
763
+ // },
764
+ // ],
765
+ // disabledDates: [
766
+ // {
767
+ // to: new Date('2024-10-09'),
768
+ // from: new Date('2024-10-01'),
769
+ // },
770
+ // {
771
+ // to: new Date('2024-10-18'),
772
+ // from: new Date('2024-10-17'),
773
+ // },
774
+ // {
775
+ // to: new Date('2024-10-23'),
776
+ // from: new Date('2024-10-22'),
777
+ // },
778
+ // {
779
+ // to: new Date('2024-11-14'),
780
+ // from: new Date('2024-11-11'),
781
+ // },
782
+ // ],
783
+ // },