mado-ui 0.5.3 → 0.5.5

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 (83) hide show
  1. package/css/index.css +189 -1
  2. package/dist/components/form/index.d.ts +1 -0
  3. package/dist/components/form/index.d.ts.map +1 -1
  4. package/dist/components/form/input/date/index.d.ts +36 -16
  5. package/dist/components/form/input/date/index.d.ts.map +1 -1
  6. package/dist/components/form/input/date/views/calendar-view.d.ts +2 -0
  7. package/dist/components/form/input/date/views/calendar-view.d.ts.map +1 -0
  8. package/dist/components/form/input/date/views/clock-view.d.ts +2 -0
  9. package/dist/components/form/input/date/views/clock-view.d.ts.map +1 -0
  10. package/dist/components/form/input/date/views/dropdown-view.d.ts +2 -0
  11. package/dist/components/form/input/date/views/dropdown-view.d.ts.map +1 -0
  12. package/dist/components/form/input/date/views/index.d.ts +5 -0
  13. package/dist/components/form/input/date/views/index.d.ts.map +1 -0
  14. package/dist/components/form/input/date/views/rotary-view.d.ts +2 -0
  15. package/dist/components/form/input/date/views/rotary-view.d.ts.map +1 -0
  16. package/dist/components/form/input/date/views/view-handler.d.ts +21 -0
  17. package/dist/components/form/input/date/views/view-handler.d.ts.map +1 -0
  18. package/dist/components/form/input/index.d.ts +4 -87
  19. package/dist/components/form/input/index.d.ts.map +1 -1
  20. package/dist/components/form/input/input-types.d.ts +102 -0
  21. package/dist/components/form/input/input-types.d.ts.map +1 -0
  22. package/dist/components/form/input/number-input.d.ts +4 -0
  23. package/dist/components/form/input/number-input.d.ts.map +1 -0
  24. package/dist/components/form/input/text-input.d.ts +36 -0
  25. package/dist/components/form/input/text-input.d.ts.map +1 -0
  26. package/dist/components/form/select.d.ts +41 -0
  27. package/dist/components/form/select.d.ts.map +1 -0
  28. package/dist/components.d.ts +161 -62
  29. package/dist/components.esm.js +482 -183
  30. package/dist/components.esm.js.map +1 -1
  31. package/dist/components.js +481 -181
  32. package/dist/components.js.map +1 -1
  33. package/dist/graphics/index.d.ts +2 -0
  34. package/dist/graphics/index.d.ts.map +1 -0
  35. package/dist/graphics/social-media/facebook-logo.d.ts +33 -0
  36. package/dist/graphics/social-media/facebook-logo.d.ts.map +1 -0
  37. package/dist/graphics/social-media/google-logo.d.ts +13 -0
  38. package/dist/graphics/social-media/google-logo.d.ts.map +1 -0
  39. package/dist/graphics/social-media/index.d.ts +8 -0
  40. package/dist/graphics/social-media/index.d.ts.map +1 -0
  41. package/dist/graphics/social-media/instagram-logo.d.ts +13 -0
  42. package/dist/graphics/social-media/instagram-logo.d.ts.map +1 -0
  43. package/dist/graphics/social-media/linkedin-logo.d.ts +26 -0
  44. package/dist/graphics/social-media/linkedin-logo.d.ts.map +1 -0
  45. package/dist/graphics/social-media/tiktok-logo.d.ts +26 -0
  46. package/dist/graphics/social-media/tiktok-logo.d.ts.map +1 -0
  47. package/dist/graphics/social-media/x-logo.d.ts +6 -0
  48. package/dist/graphics/social-media/x-logo.d.ts.map +1 -0
  49. package/dist/graphics/social-media/youtube-logo.d.ts +26 -0
  50. package/dist/graphics/social-media/youtube-logo.d.ts.map +1 -0
  51. package/dist/graphics.d.ts +141 -0
  52. package/dist/graphics.d.ts.map +1 -0
  53. package/dist/graphics.esm.js +241 -0
  54. package/dist/graphics.esm.js.map +1 -0
  55. package/dist/graphics.js +249 -0
  56. package/dist/graphics.js.map +1 -0
  57. package/dist/hooks/use-fieldset-context.d.ts.map +1 -1
  58. package/dist/hooks/use-form-context.d.ts +5 -5
  59. package/dist/hooks/use-form-context.d.ts.map +1 -1
  60. package/dist/hooks.d.ts +5 -5
  61. package/dist/hooks.esm.js.map +1 -1
  62. package/dist/hooks.js.map +1 -1
  63. package/dist/index.d.ts +161 -62
  64. package/dist/index.esm.js +482 -183
  65. package/dist/index.esm.js.map +1 -1
  66. package/dist/index.js +481 -181
  67. package/dist/index.js.map +1 -1
  68. package/dist/utils/get-date.d.ts +32 -20
  69. package/dist/utils/get-date.d.ts.map +1 -1
  70. package/dist/utils/string-manipulation.d.ts +23 -1
  71. package/dist/utils/string-manipulation.d.ts.map +1 -1
  72. package/dist/utils.d.ts +57 -23
  73. package/dist/utils.esm.js +1139 -57
  74. package/dist/utils.esm.js.map +1 -1
  75. package/dist/utils.js +1145 -58
  76. package/dist/utils.js.map +1 -1
  77. package/package.json +100 -96
  78. package/dist/components/mado-ui-provider.d.ts +0 -1
  79. package/dist/hooks/use-anime-scope.d.ts +0 -15
  80. package/dist/types.esm.js +0 -2
  81. package/dist/types.esm.js.map +0 -1
  82. package/dist/types.js +0 -3
  83. package/dist/types.js.map +0 -1
package/dist/utils.esm.js CHANGED
@@ -350,6 +350,1008 @@ function extendMadoTailwindMerge(configExtension) {
350
350
  });
351
351
  }
352
352
 
353
+ const timezoneList = [
354
+ {
355
+ abbr: 'ACDT',
356
+ name: 'Australian Central Daylight Time',
357
+ offset: ['+', 10, 30],
358
+ },
359
+ {
360
+ abbr: 'ACST',
361
+ name: 'Australian Central Standard Time',
362
+ offset: ['+', 9, 30],
363
+ },
364
+ {
365
+ abbr: 'ACT',
366
+ name: 'Acre Time',
367
+ offset: ['-', 5, 0],
368
+ },
369
+ {
370
+ abbr: 'ACWST',
371
+ name: 'Australian Central Western Standard Time',
372
+ offset: ['+', 8, 45],
373
+ },
374
+ {
375
+ abbr: 'ADT',
376
+ name: 'Atlantic Daylight Time',
377
+ offset: ['-', 3, 0],
378
+ },
379
+ {
380
+ abbr: 'AEDT',
381
+ name: 'Australian Eastern Daylight Savings Time',
382
+ offset: ['+', 11, 0],
383
+ },
384
+ {
385
+ abbr: 'AEST',
386
+ name: 'Australian Eastern Standard Time',
387
+ offset: ['+', 10, 0],
388
+ },
389
+ {
390
+ abbr: 'AFT',
391
+ name: 'Afghanistan Time',
392
+ offset: ['+', 4, 30],
393
+ },
394
+ {
395
+ abbr: 'AKDT',
396
+ name: 'Alaska Daylight Time',
397
+ offset: ['-', 8, 0],
398
+ },
399
+ {
400
+ abbr: 'AKST',
401
+ name: 'Alaska Standard Time',
402
+ offset: ['-', 9, 0],
403
+ },
404
+ {
405
+ abbr: 'AMST',
406
+ name: 'Amazon Summer Time',
407
+ offset: ['-', 3, 0],
408
+ },
409
+ {
410
+ abbr: 'AMT',
411
+ name: 'Amazon Time',
412
+ offset: ['-', 4, 0],
413
+ },
414
+ {
415
+ abbr: 'AMT',
416
+ name: 'Armenia Time',
417
+ offset: ['+', 4, 0],
418
+ },
419
+ {
420
+ abbr: 'ART',
421
+ name: 'Argentina Time',
422
+ offset: ['-', 3, 0],
423
+ },
424
+ {
425
+ abbr: 'AST',
426
+ name: 'Atlantic Standard Time',
427
+ offset: ['-', 4, 0],
428
+ },
429
+ {
430
+ abbr: 'AST',
431
+ name: 'Arabia Standard Time',
432
+ offset: ['+', 3, 0],
433
+ },
434
+ {
435
+ abbr: 'AT',
436
+ name: 'Atlantic Time',
437
+ offset: ['-', 4, 0],
438
+ },
439
+ {
440
+ abbr: 'AWST',
441
+ name: 'Australian Western Standard Time',
442
+ offset: ['+', 8, 0],
443
+ },
444
+ {
445
+ abbr: 'AZOST',
446
+ name: 'Azores Summer Time',
447
+ offset: ['+', 0, 0],
448
+ },
449
+ {
450
+ abbr: 'AZOT',
451
+ name: 'Azores Standard Time',
452
+ offset: ['-', 1, 0],
453
+ },
454
+ {
455
+ abbr: 'AZT',
456
+ name: 'Azerbaijan Time',
457
+ offset: ['+', 4, 0],
458
+ },
459
+ {
460
+ abbr: 'BDT',
461
+ name: 'Brunei Time',
462
+ offset: ['+', 8, 0],
463
+ },
464
+ {
465
+ abbr: 'BIT',
466
+ name: 'Baker Island Time',
467
+ offset: ['-', 12, 0],
468
+ },
469
+ {
470
+ abbr: 'BNT',
471
+ name: 'Brunei Darussalam Time',
472
+ offset: ['+', 8, 0],
473
+ },
474
+ {
475
+ abbr: 'BOT',
476
+ name: 'Bolivia Time',
477
+ offset: ['-', 4, 0],
478
+ },
479
+ {
480
+ abbr: 'BRST',
481
+ name: 'Brasilia Summer Time',
482
+ offset: ['-', 2, 0],
483
+ },
484
+ {
485
+ abbr: 'BRT',
486
+ name: 'Brasilia Time',
487
+ offset: ['-', 3, 0],
488
+ },
489
+ {
490
+ abbr: 'BST',
491
+ name: 'British Summer Time',
492
+ offset: ['+', 1, 0],
493
+ },
494
+ {
495
+ abbr: 'BST',
496
+ name: 'Bangladesh Standard Time',
497
+ offset: ['+', 6, 0],
498
+ },
499
+ {
500
+ abbr: 'BST',
501
+ name: 'Bougainville Standard Time',
502
+ offset: ['+', 11, 0],
503
+ },
504
+ {
505
+ abbr: 'BTT',
506
+ name: 'Bhutan Time',
507
+ offset: ['+', 6, 0],
508
+ },
509
+ {
510
+ abbr: 'CAT',
511
+ name: 'Central Africa Time',
512
+ offset: ['+', 2, 0],
513
+ },
514
+ {
515
+ abbr: 'CCT',
516
+ name: 'Cocos Islands Time',
517
+ offset: ['+', 6, 30],
518
+ },
519
+ {
520
+ abbr: 'CDT',
521
+ name: 'Central Daylight Time',
522
+ offset: ['-', 5, 0],
523
+ },
524
+ {
525
+ abbr: 'CDT',
526
+ name: 'Cuba Daylight Time',
527
+ offset: ['-', 4, 0],
528
+ },
529
+ {
530
+ abbr: 'CEST',
531
+ name: 'Central European Summer Time',
532
+ offset: ['+', 2, 0],
533
+ },
534
+ {
535
+ abbr: 'CET',
536
+ name: 'Central European Time',
537
+ offset: ['+', 1, 0],
538
+ },
539
+ {
540
+ abbr: 'CHADT',
541
+ name: 'Chatham Daylight Time',
542
+ offset: ['+', 13, 45],
543
+ },
544
+ {
545
+ abbr: 'CHAST',
546
+ name: 'Chatham Standard Time',
547
+ offset: ['+', 12, 45],
548
+ },
549
+ {
550
+ abbr: 'CHOST',
551
+ name: 'Choibalsan Summer Time',
552
+ offset: ['+', 9, 0],
553
+ },
554
+ {
555
+ abbr: 'CHOT',
556
+ name: 'Choibalsan Standard Time',
557
+ offset: ['+', 8, 0],
558
+ },
559
+ {
560
+ abbr: 'CHST',
561
+ name: 'Chamorro Standard Time',
562
+ offset: ['+', 10, 0],
563
+ },
564
+ {
565
+ abbr: 'CHUT',
566
+ name: 'Chuuk Time',
567
+ offset: ['+', 10, 0],
568
+ },
569
+ {
570
+ abbr: 'CIST',
571
+ name: 'Clipperton Island Standard Time',
572
+ offset: ['-', 8, 0],
573
+ },
574
+ {
575
+ abbr: 'CIT',
576
+ name: 'Central Indonesia Time',
577
+ offset: ['+', 8, 0],
578
+ },
579
+ {
580
+ abbr: 'CKT',
581
+ name: 'Cook Island Time',
582
+ offset: ['-', 10, 0],
583
+ },
584
+ {
585
+ abbr: 'CLST',
586
+ name: 'Chile Summer Time',
587
+ offset: ['-', 3, 0],
588
+ },
589
+ {
590
+ abbr: 'CLT',
591
+ name: 'Chile Standard Time',
592
+ offset: ['-', 4, 0],
593
+ },
594
+ {
595
+ abbr: 'COST',
596
+ name: 'Colombia Summer Time',
597
+ offset: ['-', 4, 0],
598
+ },
599
+ {
600
+ abbr: 'COT',
601
+ name: 'Colombia Time',
602
+ offset: ['-', 5, 0],
603
+ },
604
+ {
605
+ abbr: 'CST',
606
+ name: 'Central Standard Time',
607
+ offset: ['-', 6, 0],
608
+ },
609
+ {
610
+ abbr: 'CST',
611
+ name: 'China Standard Time',
612
+ offset: ['+', 8, 0],
613
+ },
614
+ {
615
+ abbr: 'CST',
616
+ name: 'Cuba Standard Time',
617
+ offset: ['-', 5, 0],
618
+ },
619
+ {
620
+ abbr: 'CT',
621
+ name: 'Central Time',
622
+ offset: ['-', 6, 0],
623
+ },
624
+ {
625
+ abbr: 'CVT',
626
+ name: 'Cape Verde Time',
627
+ offset: ['-', 1, 0],
628
+ },
629
+ {
630
+ abbr: 'CWST',
631
+ name: 'Central Western Standard Time',
632
+ offset: ['+', 8, 45],
633
+ },
634
+ {
635
+ abbr: 'CXT',
636
+ name: 'Christmas Island Time',
637
+ offset: ['+', 7, 0],
638
+ },
639
+ {
640
+ abbr: 'DAVT',
641
+ name: 'Davis Time',
642
+ offset: ['+', 7, 0],
643
+ },
644
+ {
645
+ abbr: 'DDUT',
646
+ name: "Dumont d'Urville Time",
647
+ offset: ['+', 10, 0],
648
+ },
649
+ {
650
+ abbr: 'EASST',
651
+ name: 'Easter Island Summer Time',
652
+ offset: ['-', 5, 0],
653
+ },
654
+ {
655
+ abbr: 'EAST',
656
+ name: 'Easter Island Standard Time',
657
+ offset: ['-', 6, 0],
658
+ },
659
+ {
660
+ abbr: 'EAT',
661
+ name: 'East Africa Time',
662
+ offset: ['+', 3, 0],
663
+ },
664
+ {
665
+ abbr: 'ECT',
666
+ name: 'Ecuador Time',
667
+ offset: ['-', 5, 0],
668
+ },
669
+ {
670
+ abbr: 'EDT',
671
+ name: 'Eastern Daylight Time',
672
+ offset: ['-', 4, 0],
673
+ },
674
+ {
675
+ abbr: 'EEST',
676
+ name: 'Eastern European Summer Time',
677
+ offset: ['+', 3, 0],
678
+ },
679
+ {
680
+ abbr: 'EET',
681
+ name: 'Eastern European Time',
682
+ offset: ['+', 2, 0],
683
+ },
684
+ {
685
+ abbr: 'EGST',
686
+ name: 'Eastern Greenland Summer Time',
687
+ offset: ['+', 0, 0],
688
+ },
689
+ {
690
+ abbr: 'EGT',
691
+ name: 'Eastern Greenland Time',
692
+ offset: ['-', 1, 0],
693
+ },
694
+ {
695
+ abbr: 'EIT',
696
+ name: 'Eastern Indonesian Time',
697
+ offset: ['+', 9, 0],
698
+ },
699
+ {
700
+ abbr: 'EST',
701
+ name: 'Eastern Standard Time',
702
+ offset: ['-', 5, 0],
703
+ },
704
+ {
705
+ abbr: 'ET',
706
+ name: 'Eastern Time',
707
+ offset: ['-', 5, 0],
708
+ },
709
+ {
710
+ abbr: 'FET',
711
+ name: 'Further-eastern European Time',
712
+ offset: ['+', 3, 0],
713
+ },
714
+ {
715
+ abbr: 'FJT',
716
+ name: 'Fiji Time',
717
+ offset: ['+', 12, 0],
718
+ },
719
+ {
720
+ abbr: 'FKST',
721
+ name: 'Falkland Islands Summer Time',
722
+ offset: ['-', 3, 0],
723
+ },
724
+ {
725
+ abbr: 'FKT',
726
+ name: 'Falkland Islands Time',
727
+ offset: ['-', 4, 0],
728
+ },
729
+ {
730
+ abbr: 'FNT',
731
+ name: 'Fernando de Noronha Time',
732
+ offset: ['-', 2, 0],
733
+ },
734
+ {
735
+ abbr: 'GALT',
736
+ name: 'Galapagos Time',
737
+ offset: ['-', 6, 0],
738
+ },
739
+ {
740
+ abbr: 'GAMT',
741
+ name: 'Gambier Islands',
742
+ offset: ['-', 9, 0],
743
+ },
744
+ {
745
+ abbr: 'GET',
746
+ name: 'Georgia Standard Time',
747
+ offset: ['+', 4, 0],
748
+ },
749
+ {
750
+ abbr: 'GFT',
751
+ name: 'French Guiana Time',
752
+ offset: ['-', 3, 0],
753
+ },
754
+ {
755
+ abbr: 'GILT',
756
+ name: 'Gilbert Island Time',
757
+ offset: ['+', 12, 0],
758
+ },
759
+ {
760
+ abbr: 'GIT',
761
+ name: 'Gambier Island Time',
762
+ offset: ['-', 9, 0],
763
+ },
764
+ {
765
+ abbr: 'GMT',
766
+ name: 'Greenwich Mean Time',
767
+ offset: ['+', 0, 0],
768
+ },
769
+ {
770
+ abbr: 'GST',
771
+ name: 'Gulf Standard Time',
772
+ offset: ['+', 4, 0],
773
+ },
774
+ {
775
+ abbr: 'GST',
776
+ name: 'South Georgia Time',
777
+ offset: ['-', 2, 0],
778
+ },
779
+ {
780
+ abbr: 'GYT',
781
+ name: 'Guyana Time',
782
+ offset: ['-', 4, 0],
783
+ },
784
+ {
785
+ abbr: 'HADT',
786
+ name: 'Hawaii-Aleutian Daylight Time',
787
+ offset: ['-', 9, 0],
788
+ },
789
+ {
790
+ abbr: 'HAST',
791
+ name: 'Hawaii-Aleutian Standard Time',
792
+ offset: ['-', 10, 0],
793
+ },
794
+ {
795
+ abbr: 'HKT',
796
+ name: 'Hong Kong Time',
797
+ offset: ['+', 8, 0],
798
+ },
799
+ {
800
+ abbr: 'HMT',
801
+ name: 'Heard and McDonald Islands Time',
802
+ offset: ['+', 5, 0],
803
+ },
804
+ {
805
+ abbr: 'HOVST',
806
+ name: 'Khovd Summer Time',
807
+ offset: ['+', 8, 0],
808
+ },
809
+ {
810
+ abbr: 'HOVT',
811
+ name: 'Khovd Standard Time',
812
+ offset: ['+', 7, 0],
813
+ },
814
+ {
815
+ abbr: 'ICT',
816
+ name: 'Indochina Time',
817
+ offset: ['+', 7, 0],
818
+ },
819
+ {
820
+ abbr: 'IDT',
821
+ name: 'Israel Daylight Time',
822
+ offset: ['+', 3, 0],
823
+ },
824
+ {
825
+ abbr: 'IOT',
826
+ name: 'Indian Chagos Time',
827
+ offset: ['+', 6, 0],
828
+ },
829
+ {
830
+ abbr: 'IRDT',
831
+ name: 'Iran Daylight Time',
832
+ offset: ['+', 4, 30],
833
+ },
834
+ {
835
+ abbr: 'IRKT',
836
+ name: 'Irkutsk Time',
837
+ offset: ['+', 8, 0],
838
+ },
839
+ {
840
+ abbr: 'IRST',
841
+ name: 'Iran Standard Time',
842
+ offset: ['+', 3, 30],
843
+ },
844
+ {
845
+ abbr: 'IST',
846
+ name: 'Indian Standard Time',
847
+ offset: ['+', 5, 30],
848
+ },
849
+ {
850
+ abbr: 'IST',
851
+ name: 'Irish Standard Time',
852
+ offset: ['+', 1, 0],
853
+ },
854
+ {
855
+ abbr: 'IST',
856
+ name: 'Israel Standard Time',
857
+ offset: ['+', 2, 0],
858
+ },
859
+ {
860
+ abbr: 'JST',
861
+ name: 'Japan Standard Time',
862
+ offset: ['+', 9, 0],
863
+ },
864
+ {
865
+ abbr: 'KGT',
866
+ name: 'Kyrgyzstan time',
867
+ offset: ['+', 6, 0],
868
+ },
869
+ {
870
+ abbr: 'KOST',
871
+ name: 'Kosrae Time',
872
+ offset: ['+', 11, 0],
873
+ },
874
+ {
875
+ abbr: 'KRAT',
876
+ name: 'Krasnoyarsk Time',
877
+ offset: ['+', 7, 0],
878
+ },
879
+ {
880
+ abbr: 'KST',
881
+ name: 'Korea Standard Time',
882
+ offset: ['+', 9, 0],
883
+ },
884
+ {
885
+ abbr: 'LHDT',
886
+ name: 'Lord Howe Daylight Time',
887
+ offset: ['+', 11, 0],
888
+ },
889
+ {
890
+ abbr: 'LHST',
891
+ name: 'Lord Howe Standard Time',
892
+ offset: ['+', 10, 30],
893
+ },
894
+ {
895
+ abbr: 'LINT',
896
+ name: 'Line Islands Time',
897
+ offset: ['+', 14, 0],
898
+ },
899
+ {
900
+ abbr: 'MAGT',
901
+ name: 'Magadan Time',
902
+ offset: ['+', 11, 0],
903
+ },
904
+ {
905
+ abbr: 'MART',
906
+ name: 'Marquesas Islands Time',
907
+ offset: ['-', 9, 30],
908
+ },
909
+ {
910
+ abbr: 'MAWT',
911
+ name: 'Mawson Station Time',
912
+ offset: ['+', 5, 0],
913
+ },
914
+ {
915
+ abbr: 'MDT',
916
+ name: 'Mountain Daylight Time',
917
+ offset: ['-', 6, 0],
918
+ },
919
+ {
920
+ abbr: 'MHT',
921
+ name: 'Marshall Islands',
922
+ offset: ['+', 12, 0],
923
+ },
924
+ {
925
+ abbr: 'MIST',
926
+ name: 'Macquarie Island Station Time',
927
+ offset: ['+', 11, 0],
928
+ },
929
+ {
930
+ abbr: 'MIT',
931
+ name: 'Marquesas Islands Time',
932
+ offset: ['-', 9, 30],
933
+ },
934
+ {
935
+ abbr: 'MMT',
936
+ name: 'Myanmar Standard Time',
937
+ offset: ['+', 6, 30],
938
+ },
939
+ {
940
+ abbr: 'MSK',
941
+ name: 'Moscow Time',
942
+ offset: ['+', 3, 0],
943
+ },
944
+ {
945
+ abbr: 'MST',
946
+ name: 'Mountain Standard Time',
947
+ offset: ['-', 7, 0],
948
+ },
949
+ {
950
+ abbr: 'MST',
951
+ name: 'Malaysia Standard Time',
952
+ offset: ['+', 8, 0],
953
+ },
954
+ {
955
+ abbr: 'MT',
956
+ name: 'Mountain Time',
957
+ offset: ['-', 7, 0],
958
+ },
959
+ {
960
+ abbr: 'MUT',
961
+ name: 'Mauritius Time',
962
+ offset: ['+', 4, 0],
963
+ },
964
+ {
965
+ abbr: 'MVT',
966
+ name: 'Maldives Time',
967
+ offset: ['+', 5, 0],
968
+ },
969
+ {
970
+ abbr: 'MYT',
971
+ name: 'Malaysia Time',
972
+ offset: ['+', 8, 0],
973
+ },
974
+ {
975
+ abbr: 'NCT',
976
+ name: 'New Caledonia Time',
977
+ offset: ['+', 11, 0],
978
+ },
979
+ {
980
+ abbr: 'NDT',
981
+ name: 'Newfoundland Daylight Time',
982
+ offset: ['-', 2, 30],
983
+ },
984
+ {
985
+ abbr: 'NFT',
986
+ name: 'Norfolk Time',
987
+ offset: ['+', 11, 0],
988
+ },
989
+ {
990
+ abbr: 'NPT',
991
+ name: 'Nepal Time',
992
+ offset: ['+', 5, 45],
993
+ },
994
+ {
995
+ abbr: 'NRT',
996
+ name: 'Nauru Time',
997
+ offset: ['+', 12, 0],
998
+ },
999
+ {
1000
+ abbr: 'NST',
1001
+ name: 'Newfoundland Standard Time',
1002
+ offset: ['-', 3, 30],
1003
+ },
1004
+ {
1005
+ abbr: 'NT',
1006
+ name: 'Newfoundland Time',
1007
+ offset: ['-', 3, 30],
1008
+ },
1009
+ {
1010
+ abbr: 'NUT',
1011
+ name: 'Niue Time',
1012
+ offset: ['-', 11, 0],
1013
+ },
1014
+ {
1015
+ abbr: 'NZDT',
1016
+ name: 'New Zealand Daylight Time',
1017
+ offset: ['+', 13, 0],
1018
+ },
1019
+ {
1020
+ abbr: 'NZST',
1021
+ name: 'New Zealand Standard Time',
1022
+ offset: ['+', 12, 0],
1023
+ },
1024
+ {
1025
+ abbr: 'OMST',
1026
+ name: 'Omsk Time',
1027
+ offset: ['+', 6, 0],
1028
+ },
1029
+ {
1030
+ abbr: 'ORAT',
1031
+ name: 'Oral Time',
1032
+ offset: ['+', 5, 0],
1033
+ },
1034
+ {
1035
+ abbr: 'PDT',
1036
+ name: 'Pacific Daylight Time',
1037
+ offset: ['-', 7, 0],
1038
+ },
1039
+ {
1040
+ abbr: 'PET',
1041
+ name: 'Peru Time',
1042
+ offset: ['-', 5, 0],
1043
+ },
1044
+ {
1045
+ abbr: 'PETT',
1046
+ name: 'Kamchatka Time',
1047
+ offset: ['+', 12, 0],
1048
+ },
1049
+ {
1050
+ abbr: 'PGT',
1051
+ name: 'Papua New Guinea Time',
1052
+ offset: ['+', 10, 0],
1053
+ },
1054
+ {
1055
+ abbr: 'PHOT',
1056
+ name: 'Phoenix Island Time',
1057
+ offset: ['+', 13, 0],
1058
+ },
1059
+ {
1060
+ abbr: 'PHST',
1061
+ name: 'Philippine Standard Time',
1062
+ offset: ['+', 8, 0],
1063
+ },
1064
+ {
1065
+ abbr: 'PHT',
1066
+ name: 'Philippine Time',
1067
+ offset: ['+', 8, 0],
1068
+ },
1069
+ {
1070
+ abbr: 'PKT',
1071
+ name: 'Pakistan Standard Time',
1072
+ offset: ['+', 5, 0],
1073
+ },
1074
+ {
1075
+ abbr: 'PMDT',
1076
+ name: 'Saint Pierre and Miquelon Daylight time',
1077
+ offset: ['-', 2, 0],
1078
+ },
1079
+ {
1080
+ abbr: 'PMST',
1081
+ name: 'Saint Pierre and Miquelon Standard Time',
1082
+ offset: ['-', 3, 0],
1083
+ },
1084
+ {
1085
+ abbr: 'PONT',
1086
+ name: 'Pohnpei Standard Time',
1087
+ offset: ['+', 11, 0],
1088
+ },
1089
+ {
1090
+ abbr: 'PST',
1091
+ name: 'Pacific Standard Time',
1092
+ offset: ['-', 8, 0],
1093
+ },
1094
+ {
1095
+ abbr: 'PT',
1096
+ name: 'Pacific Time',
1097
+ offset: ['-', 8, 0],
1098
+ },
1099
+ {
1100
+ abbr: 'PWT',
1101
+ name: 'Palau Time',
1102
+ offset: ['+', 9, 0],
1103
+ },
1104
+ {
1105
+ abbr: 'PYST',
1106
+ name: 'Paraguay Summer Time',
1107
+ offset: ['-', 3, 0],
1108
+ },
1109
+ {
1110
+ abbr: 'PYT',
1111
+ name: 'Paraguay Time',
1112
+ offset: ['-', 4, 0],
1113
+ },
1114
+ {
1115
+ abbr: 'RET',
1116
+ name: 'Réunion Time',
1117
+ offset: ['+', 4, 0],
1118
+ },
1119
+ {
1120
+ abbr: 'ROTT',
1121
+ name: 'Rothera Research Station Time',
1122
+ offset: ['-', 3, 0],
1123
+ },
1124
+ {
1125
+ abbr: 'SAKT',
1126
+ name: 'Sakhalin Island time',
1127
+ offset: ['+', 11, 0],
1128
+ },
1129
+ {
1130
+ abbr: 'SAMT',
1131
+ name: 'Samara Time',
1132
+ offset: ['+', 4, 0],
1133
+ },
1134
+ {
1135
+ abbr: 'SAST',
1136
+ name: 'South African Standard Time',
1137
+ offset: ['+', 2, 0],
1138
+ },
1139
+ {
1140
+ abbr: 'SBT',
1141
+ name: 'Solomon Islands Time',
1142
+ offset: ['+', 11, 0],
1143
+ },
1144
+ {
1145
+ abbr: 'SCT',
1146
+ name: 'Seychelles Time',
1147
+ offset: ['+', 4, 0],
1148
+ },
1149
+ {
1150
+ abbr: 'SGT',
1151
+ name: 'Singapore Time',
1152
+ offset: ['+', 8, 0],
1153
+ },
1154
+ {
1155
+ abbr: 'SLST',
1156
+ name: 'Sri Lanka Standard Time',
1157
+ offset: ['+', 5, 30],
1158
+ },
1159
+ {
1160
+ abbr: 'SRET',
1161
+ name: 'Srednekolymsk Time',
1162
+ offset: ['+', 11, 0],
1163
+ },
1164
+ {
1165
+ abbr: 'SRT',
1166
+ name: 'Suriname Time',
1167
+ offset: ['-', 3, 0],
1168
+ },
1169
+ {
1170
+ abbr: 'SST',
1171
+ name: 'Samoa Standard Time',
1172
+ offset: ['-', 11, 0],
1173
+ },
1174
+ {
1175
+ abbr: 'SYOT',
1176
+ name: 'Showa Station Time',
1177
+ offset: ['+', 3, 0],
1178
+ },
1179
+ {
1180
+ abbr: 'TAHT',
1181
+ name: 'Tahiti Time',
1182
+ offset: ['-', 10, 0],
1183
+ },
1184
+ {
1185
+ abbr: 'TFT',
1186
+ name: 'French Southern and Antarctic Time',
1187
+ offset: ['+', 5, 0],
1188
+ },
1189
+ {
1190
+ abbr: 'THA',
1191
+ name: 'Thailand Standard Time',
1192
+ offset: ['+', 7, 0],
1193
+ },
1194
+ {
1195
+ abbr: 'TJT',
1196
+ name: 'Tajikistan Time',
1197
+ offset: ['+', 5, 0],
1198
+ },
1199
+ {
1200
+ abbr: 'TKT',
1201
+ name: 'Tokelau Time',
1202
+ offset: ['+', 13, 0],
1203
+ },
1204
+ {
1205
+ abbr: 'TLT',
1206
+ name: 'Timor Leste Time',
1207
+ offset: ['+', 9, 0],
1208
+ },
1209
+ {
1210
+ abbr: 'TMT',
1211
+ name: 'Turkmenistan Time',
1212
+ offset: ['+', 5, 0],
1213
+ },
1214
+ {
1215
+ abbr: 'TOT',
1216
+ name: 'Tonga Time',
1217
+ offset: ['+', 13, 0],
1218
+ },
1219
+ {
1220
+ abbr: 'TRT',
1221
+ name: 'Turkey Time',
1222
+ offset: ['+', 3, 0],
1223
+ },
1224
+ {
1225
+ abbr: 'TVT',
1226
+ name: 'Tuvalu Time',
1227
+ offset: ['+', 12, 0],
1228
+ },
1229
+ {
1230
+ abbr: 'ULAST',
1231
+ name: 'Ulaanbaatar Summer Time',
1232
+ offset: ['+', 9, 0],
1233
+ },
1234
+ {
1235
+ abbr: 'ULAT',
1236
+ name: 'Ulaanbaatar Standard Time',
1237
+ offset: ['+', 8, 0],
1238
+ },
1239
+ {
1240
+ abbr: 'USZ1',
1241
+ name: 'Kaliningrad Time',
1242
+ offset: ['+', 2, 0],
1243
+ },
1244
+ {
1245
+ abbr: 'UTC',
1246
+ name: 'Coordinated Universal Time',
1247
+ offset: ['+', 0, 0],
1248
+ },
1249
+ {
1250
+ abbr: 'UYST',
1251
+ name: 'Uruguay Summer Time',
1252
+ offset: ['-', 2, 0],
1253
+ },
1254
+ {
1255
+ abbr: 'UYT',
1256
+ name: 'Uruguay Standard Time',
1257
+ offset: ['-', 3, 0],
1258
+ },
1259
+ {
1260
+ abbr: 'UZT',
1261
+ name: 'Uzbekistan Time',
1262
+ offset: ['+', 5, 0],
1263
+ },
1264
+ {
1265
+ abbr: 'VET',
1266
+ name: 'Venezuelan Standard Time',
1267
+ offset: ['-', 4, 0],
1268
+ },
1269
+ {
1270
+ abbr: 'VLAT',
1271
+ name: 'Vladivostok Time',
1272
+ offset: ['+', 10, 0],
1273
+ },
1274
+ {
1275
+ abbr: 'VOLT',
1276
+ name: 'Volgograd Time',
1277
+ offset: ['+', 4, 0],
1278
+ },
1279
+ {
1280
+ abbr: 'VOST',
1281
+ name: 'Vostok Station Time',
1282
+ offset: ['+', 6, 0],
1283
+ },
1284
+ {
1285
+ abbr: 'VUT',
1286
+ name: 'Vanuatu Time',
1287
+ offset: ['+', 11, 0],
1288
+ },
1289
+ {
1290
+ abbr: 'WAKT',
1291
+ name: 'Wake Island Time',
1292
+ offset: ['+', 12, 0],
1293
+ },
1294
+ {
1295
+ abbr: 'WAST',
1296
+ name: 'West Africa Summer Time',
1297
+ offset: ['+', 2, 0],
1298
+ },
1299
+ {
1300
+ abbr: 'WAT',
1301
+ name: 'West Africa Time',
1302
+ offset: ['+', 1, 0],
1303
+ },
1304
+ {
1305
+ abbr: 'WEST',
1306
+ name: 'Western European Summer Time',
1307
+ offset: ['+', 1, 0],
1308
+ },
1309
+ {
1310
+ abbr: 'WET',
1311
+ name: 'Western European Time',
1312
+ offset: ['+', 0, 0],
1313
+ },
1314
+ {
1315
+ abbr: 'WFT',
1316
+ name: 'Wallis and Futuna Time',
1317
+ offset: ['+', 12, 0],
1318
+ },
1319
+ {
1320
+ abbr: 'WGST',
1321
+ name: 'West Greenland Summer Time',
1322
+ offset: ['-', 2, 0],
1323
+ },
1324
+ {
1325
+ abbr: 'WGST',
1326
+ name: 'West Greenland Time',
1327
+ offset: ['-', 3, 0],
1328
+ },
1329
+ {
1330
+ abbr: 'WIB',
1331
+ name: 'Western Indonesia Time',
1332
+ offset: ['+', 7, 0],
1333
+ },
1334
+ {
1335
+ abbr: 'WIT',
1336
+ name: 'Eastern Indonesia Time',
1337
+ offset: ['+', 9, 0],
1338
+ },
1339
+ {
1340
+ abbr: 'WST',
1341
+ name: 'Western Standard Time',
1342
+ offset: ['+', 8, 0],
1343
+ },
1344
+ {
1345
+ abbr: 'YAKT',
1346
+ name: 'Yakutsk Time',
1347
+ offset: ['+', 9, 0],
1348
+ },
1349
+ {
1350
+ abbr: 'YEKT',
1351
+ name: 'Yekaterinburg Time',
1352
+ offset: ['+', 5, 0],
1353
+ },
1354
+ ];
353
1355
  /** The current date as a Date object */
354
1356
  const d = new Date();
355
1357
  /** The current minute of the current hour */
@@ -381,12 +1383,44 @@ const weekdayNamesList = [
381
1383
  'Friday',
382
1384
  'Saturday',
383
1385
  ];
1386
+ function compareDates(d1, mode, d2) {
1387
+ const date1 = d1.getTime(), date2 = d2.getTime();
1388
+ switch (mode) {
1389
+ case '>':
1390
+ return date1 > date2;
1391
+ case '>=':
1392
+ return date1 >= date2;
1393
+ case '<':
1394
+ return date1 < date2;
1395
+ case '<=':
1396
+ return date1 <= date2;
1397
+ case '==':
1398
+ return date1 === date2;
1399
+ default:
1400
+ throw new Error('Invalid mode');
1401
+ }
1402
+ }
384
1403
  /** The name of the current month */
385
1404
  const currentMonthName = getMonthName();
386
1405
  /** The name of the current day of the week */
387
1406
  const currentWeekdayName = getWeekdayName();
1407
+ function dateMath(d1, operator, d2) {
1408
+ const date1 = d1.getTime(), date2 = d2.getTime();
1409
+ switch (operator) {
1410
+ case '+':
1411
+ return new Date(date1 + date2);
1412
+ case '-':
1413
+ return new Date(date1 - date2);
1414
+ case '*':
1415
+ return new Date(date1 * date2);
1416
+ case '/':
1417
+ return new Date(date1 / date2);
1418
+ default:
1419
+ throw new Error('Invalid operator');
1420
+ }
1421
+ }
388
1422
  /**
389
- * ### Days In Month
1423
+ * # Days In Month
390
1424
  * - Returns the number of days in the specified month.
391
1425
  * @param {Date} date A Date object representing the month to get the number of days for. (Preset to the current date)
392
1426
  * @returns {number} The number of days in the specified month.
@@ -396,7 +1430,7 @@ function daysInMonth(date = d) {
396
1430
  return new Date(selectedYear, selectedMonth, 0).getDate();
397
1431
  }
398
1432
  /**
399
- * ### First of Month
1433
+ * # First of Month
400
1434
  * - Returns the first day of the specified month.
401
1435
  * @param {Date} date A Date object representing the month to get the first day for. (Preset to current date)
402
1436
  * @returns {Date} A Date object of the given month, with the first day.
@@ -406,7 +1440,7 @@ function firstOfMonth(date = d) {
406
1440
  return new Date(date.getFullYear(), date.getMonth(), 1);
407
1441
  }
408
1442
  /**
409
- * ### Get Date
1443
+ * # Get Date
410
1444
  * - Returns the date with two digits
411
1445
  * @param {number|Date} date The date to get date
412
1446
  * @returns {string} The date with two digits
@@ -420,7 +1454,7 @@ function getDate(date = d) {
420
1454
  return formattedDate;
421
1455
  }
422
1456
  /**
423
- * ### Get Hours
1457
+ * # Get Hours
424
1458
  * - Returns the hours with two digits
425
1459
  * @param {number|Date} hours The date to get hours
426
1460
  * @returns {string} The hours with two digits
@@ -434,7 +1468,7 @@ function getHours(hours = d) {
434
1468
  return formattedHours;
435
1469
  }
436
1470
  /**
437
- * ### Get Hours in 12
1471
+ * # Get Hours in 12
438
1472
  * - Returns the hour based on the specified 24 hour value in a 12 hour format
439
1473
  * @param {number|Date} hour The hour to be converted to 12 hour format
440
1474
  * @returns {number} The hour in a 12 hour format
@@ -447,7 +1481,7 @@ function getHoursIn12(hour = d) {
447
1481
  return hour;
448
1482
  }
449
1483
  /**
450
- * ### Get Meridian from Hour
1484
+ * # Get Meridian from Hour
451
1485
  * - Returns either 'pm' or 'am' based on the specified 24 hour value
452
1486
  * @param {number|Date} hour The hour to get the meridian from
453
1487
  * @returns {'am'|'pm'} The meridian for the given hour
@@ -460,7 +1494,7 @@ function getMeridianFromHour(hour = d) {
460
1494
  return 'am';
461
1495
  }
462
1496
  /**
463
- * ### Get Milliseconds
1497
+ * # Get Milliseconds
464
1498
  * - Returns the milliseconds with two digits
465
1499
  * @param {number|Date} milliseconds The date to get milliseconds
466
1500
  * @returns {string} The milliseconds with two digits
@@ -474,7 +1508,7 @@ function getMilliseconds(milliseconds = d) {
474
1508
  return formattedMilliseconds;
475
1509
  }
476
1510
  /**
477
- * ### Get Minutes
1511
+ * # Get Minutes
478
1512
  * - Returns the minutes with two digits
479
1513
  * @param {number|Date} minutes The date to get minutes
480
1514
  * @returns {string} The minutes with two digits
@@ -488,7 +1522,7 @@ function getMinutes(minutes = d) {
488
1522
  return formattedMinutes;
489
1523
  }
490
1524
  /**
491
- * ### Get Month
1525
+ * # Get Month
492
1526
  * - Returns the month with two digits
493
1527
  * @param {number|Date} month The date to get month
494
1528
  * @returns {string} The month with two digits
@@ -505,7 +1539,7 @@ function getMonthIndexFromName(name) {
505
1539
  return monthNamesList.findIndex(monthName => monthName === name);
506
1540
  }
507
1541
  /**
508
- * ### Get Month Name
1542
+ * # Get Month Name
509
1543
  * - Returns the name of the specified month
510
1544
  * @param {Date} date A Date object representing the month to get the name of the month from. (Preset to the current date)
511
1545
  * @returns {MonthName} The name of the specified month
@@ -516,7 +1550,7 @@ function getMonthName(date = d) {
516
1550
  return monthNamesList[date.getMonth()];
517
1551
  }
518
1552
  /**
519
- * ### Get Next Month
1553
+ * # Get Next Month
520
1554
  * - Returns the number of the following month from the specified month
521
1555
  * @param {Date} date The Date object representing the month to get the following month from (Preset to current date)
522
1556
  * @returns {number} The indexed month of the following month
@@ -527,7 +1561,7 @@ function getNextMonth(date = d) {
527
1561
  return givenMonth === 11 ? 0 : givenMonth + 1;
528
1562
  }
529
1563
  /**
530
- * ### Get Previous Month
1564
+ * # Get Previous Month
531
1565
  * - Returns the number of the previous month from the specified month
532
1566
  * @param {Date} date The Date object representing the month to get the previous month from (Preset to current date)
533
1567
  * @returns {number} The indexed month of the previous month
@@ -538,7 +1572,7 @@ function getPreviousMonth(date = d) {
538
1572
  return givenMonth === 0 ? 11 : givenMonth - 1;
539
1573
  }
540
1574
  /**
541
- * ### Get Seconds
1575
+ * # Get Seconds
542
1576
  * - Returns the seconds with two digits
543
1577
  * @param {number|Date} seconds The date to get seconds
544
1578
  * @returns {string} The seconds with two digits
@@ -552,7 +1586,16 @@ function getSeconds(seconds = d) {
552
1586
  return formattedSeconds;
553
1587
  }
554
1588
  /**
555
- * ### Get User Readable Date
1589
+ * # Get Local Timezone
1590
+ * - Returns the user's local timezone data.
1591
+ * @returns {TimezoneData | undefined} Timezone data object
1592
+ */
1593
+ function getLocalTimezone() {
1594
+ const timezoneOffset = new Date().getTimezoneOffset(), isPositive = timezoneOffset >= 0, absoluteOffset = Math.abs(timezoneOffset), offsetHours = Math.floor(absoluteOffset / 60), offsetMinutes = absoluteOffset % 60;
1595
+ return timezoneList.find(({ offset }) => (isPositive ? offset[0] === '+' : offset[0] === '-') && offset[1] === offsetHours && offset[2] === offsetMinutes);
1596
+ }
1597
+ /**
1598
+ * # Get User Readable Date
556
1599
  * - Returns a string of the current date in a user-friendly way
557
1600
  * - Includes `'Yesterday'`, '`Today'`, and `'Tomorrow'`
558
1601
  * @param date (default: `new Date()`)
@@ -577,7 +1620,7 @@ function getUserReadableDate(date = d) {
577
1620
  return fullDateString;
578
1621
  }
579
1622
  /**
580
- * ### Get Weekday Name
1623
+ * # Get Weekday Name
581
1624
  * - Returns the weekday name of the specified day
582
1625
  * @param {number | Date} weekday A Date object or number representing the day to get the weekday name from. (Preset to the current date)
583
1626
  * @returns {WeekdayName} The name of the specified weekday
@@ -589,7 +1632,7 @@ function getWeekdayName(weekday = d) {
589
1632
  return weekdayNamesList[weekday.getDay()];
590
1633
  }
591
1634
  /**
592
- * ### Get Years in Range
1635
+ * # Get Years in Range
593
1636
  * - Returns an array of years in between the specified minimum and maximum years
594
1637
  * @param {number} minYear The minimum year
595
1638
  * @param {number} maxYear The maximum year
@@ -603,7 +1646,7 @@ function getYearsInRange(minYear = 0, maxYear = year) {
603
1646
  return yearList;
604
1647
  }
605
1648
  /**
606
- * ### To Full Date String
1649
+ * # To Full Date String
607
1650
  * - Returns a formatted string to display the date
608
1651
  * @param {Date} date (default: `new Date()`)
609
1652
  * @param {ToFullDateStringOptionsProps} options Change how to display the weekday, month name, day of the month, and year.
@@ -646,7 +1689,7 @@ function toFullDateString(date = d, options) {
646
1689
  return weekdayName + monthName + dayOfMonth + year;
647
1690
  }
648
1691
  /**
649
- * ### Get User Readable Date From Timestampz
1692
+ * # Get User Readable Date From Timestampz
650
1693
  * - Returns a string of the current date in a user-friendly way
651
1694
  * - Includes `'Yesterday'`, '`Today'`, and `'Tomorrow'`
652
1695
  * @param string
@@ -656,31 +1699,12 @@ function getUserReadableDateFromTimestampz(timestampz) {
656
1699
  const [date, time] = timestampz.split('T') || [];
657
1700
  const [year, month, day] = date?.split('-').map(string => Number(string)) || [];
658
1701
  const timezoneIsAheadOfUTC = time?.includes('+');
659
- const [hms, timezone] = timezoneIsAheadOfUTC ? time?.split('+') : time?.split('-') || [];
1702
+ const [hms, _timezone] = timezoneIsAheadOfUTC ? time?.split('+') : time?.split('-') || [];
660
1703
  const [hours, minutes, seconds] = hms?.split(':').map(string => Number(string)) || [];
661
- const [timezoneHours, timezoneMinutes] = timezone?.split(':').map(string => Number(string)) || [];
1704
+ // const [timezoneHours, timezoneMinutes] = timezone?.split(':').map(string => Number(string)) || []
662
1705
  const dateAndTime = new Date(year, month - 1, day, hours, minutes, seconds), userReadableDateAndTime = getUserReadableDate(dateAndTime);
663
1706
  return userReadableDateAndTime;
664
1707
  }
665
- function getLocalTime(time) {
666
- const date = new Date(), [hours, minutes] = typeof time === 'string' ? time.split(':') : time;
667
- const timezone = getTimezone();
668
- console.log(timezone);
669
- date.setUTCHours(Number(hours));
670
- date.setMinutes(Number(minutes));
671
- return date.toLocaleTimeString([], {
672
- hour: 'numeric',
673
- minute: '2-digit',
674
- hour12: true,
675
- });
676
- }
677
- function getTimezone() {
678
- const date = new Date();
679
- const timezonePart = Intl.DateTimeFormat('en-US', { timeZoneName: 'short' })
680
- .formatToParts(date)
681
- .find(part => part.type === 'timeZoneName');
682
- return timezonePart ? timezonePart.value : '';
683
- }
684
1708
 
685
1709
  function findComponentByType(children, componentType) {
686
1710
  const childrenArray = Children.toArray(children);
@@ -765,13 +1789,14 @@ function isPhoneNumber(tel) {
765
1789
  * @returns {string} string formatted
766
1790
  */
767
1791
  function formatPhoneNumber(phoneNumber, options) {
768
- const format = options?.format || 'standard';
769
- if (format !== 'none')
770
- phoneNumber = phoneNumber.replace(/\D/g, '').slice(-10);
1792
+ const format = options?.format || "standard";
1793
+ if (format !== "none") {
1794
+ phoneNumber = phoneNumber.replace(/\D/g, "").slice(-10);
1795
+ }
771
1796
  switch (format) {
772
- case 'dot':
1797
+ case "dot":
773
1798
  phoneNumber = phoneNumber
774
- .split('')
1799
+ .split("")
775
1800
  .map((char, index) => {
776
1801
  if (index === 2)
777
1802
  return `${char}.`;
@@ -779,11 +1804,11 @@ function formatPhoneNumber(phoneNumber, options) {
779
1804
  return `${char}.`;
780
1805
  return char;
781
1806
  })
782
- .join('');
1807
+ .join("");
783
1808
  break;
784
- case 'hyphenated':
1809
+ case "hyphenated":
785
1810
  phoneNumber = phoneNumber
786
- .split('')
1811
+ .split("")
787
1812
  .map((char, index) => {
788
1813
  if (index === 2)
789
1814
  return `${char}-`;
@@ -791,11 +1816,11 @@ function formatPhoneNumber(phoneNumber, options) {
791
1816
  return `${char}-`;
792
1817
  return char;
793
1818
  })
794
- .join('');
1819
+ .join("");
795
1820
  break;
796
- case 'space':
1821
+ case "space":
797
1822
  phoneNumber = phoneNumber
798
- .split('')
1823
+ .split("")
799
1824
  .map((char, index) => {
800
1825
  if (index === 2)
801
1826
  return `${char} `;
@@ -803,11 +1828,11 @@ function formatPhoneNumber(phoneNumber, options) {
803
1828
  return `${char} `;
804
1829
  return char;
805
1830
  })
806
- .join('');
1831
+ .join("");
807
1832
  break;
808
- case 'standard':
1833
+ case "standard":
809
1834
  phoneNumber = phoneNumber
810
- .split('')
1835
+ .split("")
811
1836
  .map((char, index) => {
812
1837
  if (index === 0)
813
1838
  return `(${char}`;
@@ -817,9 +1842,50 @@ function formatPhoneNumber(phoneNumber, options) {
817
1842
  return `${char}-`;
818
1843
  return char;
819
1844
  })
820
- .join('');
1845
+ .join("");
821
1846
  }
822
- return `${options?.countryCode ? `+${options?.countryCode} ` : ''}` + phoneNumber;
1847
+ return `${options?.countryCode ? `+${options?.countryCode} ` : ""}` +
1848
+ phoneNumber;
1849
+ }
1850
+ /**
1851
+ * ### Split Camel Case
1852
+ * - Separates a camel case string with a joiner (default: ' ')
1853
+ * @param {string} string
1854
+ * @returns {string} string
1855
+ */
1856
+ function splitCamelCase(string, joiner = " ") {
1857
+ if (string[0].match(/[A-Z0-9]/) || string.includes(" "))
1858
+ return string;
1859
+ let lastChar = "";
1860
+ return string.split("")
1861
+ .map((char) => {
1862
+ let returnedString = char;
1863
+ if (char.match(/[A-Z0-9]/))
1864
+ returnedString = ` ${char}`;
1865
+ if (lastChar.match(/[0-9]/) && char.match(/[0-9]/))
1866
+ returnedString = char;
1867
+ lastChar = char;
1868
+ return returnedString;
1869
+ })
1870
+ .join(joiner);
1871
+ }
1872
+ /**
1873
+ * ### To Camel Case
1874
+ * - Converts any string to camel case based on spaces
1875
+ * - Eliminates no letter-number characters
1876
+ * @param {string} string
1877
+ * @returns {string} string
1878
+ */
1879
+ function toCamelCase(string, delimiter = " ") {
1880
+ if (typeof string !== "string")
1881
+ return string;
1882
+ return string
1883
+ .toLowerCase()
1884
+ .replace(/[^a-z0-9]/gi, delimiter)
1885
+ .split(delimiter)
1886
+ .map((str, index) => index === 0 ? str : str.substring(0, 1).toUpperCase() +
1887
+ str.substring(1, str.length).toLowerCase())
1888
+ .join("");
823
1889
  }
824
1890
  /**
825
1891
  * # To Lower Case
@@ -831,12 +1897,28 @@ function formatPhoneNumber(phoneNumber, options) {
831
1897
  * @returns The lowercase version of the input string, with the replacements, if provided.
832
1898
  */
833
1899
  function toLowerCase(str, [delimiter, joiner]) {
834
- return str.toLowerCase().replaceAll(delimiter || ' ', joiner || ' ');
1900
+ return str.toLowerCase().replaceAll(delimiter || " ", joiner || " ");
1901
+ }
1902
+ /**
1903
+ * ### To Title Case
1904
+ * - Converts any string to title case based on spaces
1905
+ * @param {string} string
1906
+ * @returns {string} string
1907
+ */
1908
+ function toTitleCase(string, delimiter = " ") {
1909
+ if (typeof string !== "string")
1910
+ return string;
1911
+ return string
1912
+ .toLowerCase()
1913
+ .split(delimiter)
1914
+ .map((str) => str.substring(0, 1).toUpperCase() +
1915
+ str.substring(1, str.length).toLowerCase())
1916
+ .join(" ");
835
1917
  }
836
1918
 
837
1919
  function twSort(className) {
838
1920
  return className;
839
1921
  }
840
1922
 
841
- export { addClass, currentMonthName, currentWeekdayName, daysInMonth, easeOutExpo, emailRegex, extendMadoTailwindMerge, findComponentByType, firstOfMonth, formatPhoneNumber, getDate, getHours, getHoursIn12, getLocalTime, getMeridianFromHour, getMilliseconds, getMinutes, getMonth, getMonthIndexFromName, getMonthName, getNextMonth, getPreviousMonth, getSeconds, getTimezone, getUserReadableDate, getUserReadableDateFromTimestampz, getWeekdayName, getYearsInRange, hasClass, isEmail, isPhoneNumber, monthNamesList, removeClass, telRegex, toFullDateString, toLowerCase, toggleClass, twMerge, twSort, weekdayNamesList };
1923
+ export { addClass, compareDates, currentMonthName, currentWeekdayName, dateMath, daysInMonth, easeOutExpo, emailRegex, extendMadoTailwindMerge, findComponentByType, firstOfMonth, formatPhoneNumber, getDate, getHours, getHoursIn12, getLocalTimezone, getMeridianFromHour, getMilliseconds, getMinutes, getMonth, getMonthIndexFromName, getMonthName, getNextMonth, getPreviousMonth, getSeconds, getUserReadableDate, getUserReadableDateFromTimestampz, getWeekdayName, getYearsInRange, hasClass, isEmail, isPhoneNumber, monthNamesList, removeClass, splitCamelCase, telRegex, timezoneList, toCamelCase, toFullDateString, toLowerCase, toTitleCase, toggleClass, twMerge, twSort, weekdayNamesList };
842
1924
  //# sourceMappingURL=utils.esm.js.map