@itilite/lumina-ui 1.1.4 → 1.1.6

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 (181) hide show
  1. package/dist/atom/LoadingSpinner/LoadingSpinner.d.mts +19 -0
  2. package/dist/atom/LoadingSpinner/LoadingSpinner.d.ts +19 -0
  3. package/dist/atom/LoadingSpinner/LoadingSpinner.js +90 -0
  4. package/dist/atom/LoadingSpinner/LoadingSpinner.mjs +9 -0
  5. package/dist/atom/RangePicker/Chevron.d.mts +13 -0
  6. package/dist/atom/RangePicker/Chevron.d.ts +13 -0
  7. package/dist/atom/RangePicker/Chevron.js +110 -0
  8. package/dist/atom/RangePicker/Chevron.mjs +7 -0
  9. package/dist/atom/RangePicker/RangePicker.d.mts +26 -0
  10. package/dist/atom/RangePicker/RangePicker.d.ts +26 -0
  11. package/dist/atom/RangePicker/RangePicker.js +1451 -0
  12. package/dist/atom/RangePicker/RangePicker.mjs +13 -0
  13. package/dist/atom/Select/Select.d.mts +43 -0
  14. package/dist/atom/Select/Select.d.ts +43 -0
  15. package/dist/atom/Select/Select.js +800 -0
  16. package/dist/atom/Select/Select.mjs +11 -0
  17. package/dist/chunk-22VF7AVT.mjs +618 -0
  18. package/dist/chunk-2BNAAOBU.mjs +670 -0
  19. package/dist/chunk-2IMRLK6M.mjs +44 -0
  20. package/dist/chunk-2JIINZEK.mjs +618 -0
  21. package/dist/chunk-2LBFKQDZ.mjs +660 -0
  22. package/dist/chunk-2ZJBF5C4.mjs +618 -0
  23. package/dist/chunk-33JITG5Y.mjs +621 -0
  24. package/dist/chunk-3IMCN4K3.mjs +670 -0
  25. package/dist/chunk-3K2RTVMH.mjs +584 -0
  26. package/dist/chunk-3KBQQCET.mjs +674 -0
  27. package/dist/chunk-3KUHXNFH.mjs +678 -0
  28. package/dist/chunk-3PPNOIXN.mjs +618 -0
  29. package/dist/chunk-3XFY3TXJ.mjs +611 -0
  30. package/dist/chunk-3XW7HS5W.mjs +618 -0
  31. package/dist/chunk-3YDCRJYV.mjs +618 -0
  32. package/dist/chunk-447HZYZ4.mjs +612 -0
  33. package/dist/chunk-46F3B4U6.mjs +618 -0
  34. package/dist/chunk-4K5RZHL4.mjs +618 -0
  35. package/dist/chunk-4QHFP4YD.mjs +666 -0
  36. package/dist/chunk-4TFX4DHY.mjs +702 -0
  37. package/dist/chunk-4TWO6JES.mjs +666 -0
  38. package/dist/chunk-4UQVJ3ZU.mjs +666 -0
  39. package/dist/chunk-5247J65D.mjs +670 -0
  40. package/dist/chunk-66H5WSEJ.mjs +618 -0
  41. package/dist/chunk-6NZEDJ2M.mjs +582 -0
  42. package/dist/chunk-6OGEXG5U.mjs +618 -0
  43. package/dist/chunk-6ROQXYVN.mjs +672 -0
  44. package/dist/chunk-6WNI6X5Q.mjs +618 -0
  45. package/dist/chunk-72PPCN6D.mjs +675 -0
  46. package/dist/chunk-74EGXFNN.mjs +618 -0
  47. package/dist/chunk-77NCDGJA.mjs +707 -0
  48. package/dist/chunk-7NGBIPZT.mjs +618 -0
  49. package/dist/chunk-7NM4FNMQ.mjs +666 -0
  50. package/dist/chunk-7YBBSVUA.mjs +672 -0
  51. package/dist/chunk-7Z52UP7P.mjs +618 -0
  52. package/dist/chunk-B3LDL3KD.mjs +670 -0
  53. package/dist/chunk-B65LGQ47.mjs +666 -0
  54. package/dist/chunk-B6MTRO54.mjs +618 -0
  55. package/dist/chunk-BJBP5XYB.mjs +618 -0
  56. package/dist/chunk-BLLSWPCC.mjs +618 -0
  57. package/dist/chunk-BOYB7REJ.mjs +670 -0
  58. package/dist/chunk-BP2D64XI.mjs +618 -0
  59. package/dist/chunk-BP4XS2GF.mjs +585 -0
  60. package/dist/chunk-BRT5IPGQ.mjs +618 -0
  61. package/dist/chunk-BTIIO2CP.mjs +582 -0
  62. package/dist/chunk-C2J3VBFZ.mjs +670 -0
  63. package/dist/chunk-CDOR7GQP.mjs +618 -0
  64. package/dist/chunk-CI2RMA4V.mjs +612 -0
  65. package/dist/chunk-CNUIZOQJ.mjs +669 -0
  66. package/dist/chunk-CPBXPEST.mjs +672 -0
  67. package/dist/chunk-CVOLXLMU.mjs +618 -0
  68. package/dist/chunk-CWUCNC36.mjs +666 -0
  69. package/dist/chunk-CZBGN6GS.mjs +612 -0
  70. package/dist/chunk-D3APB62N.mjs +618 -0
  71. package/dist/chunk-D5B2TUSL.mjs +591 -0
  72. package/dist/chunk-D7TWXVL2.mjs +674 -0
  73. package/dist/chunk-DAZ53AD7.mjs +671 -0
  74. package/dist/chunk-DBY5U6IU.mjs +618 -0
  75. package/dist/chunk-DXTVU4M5.mjs +618 -0
  76. package/dist/chunk-DZBTD6QK.mjs +666 -0
  77. package/dist/chunk-E6UPDTDY.mjs +611 -0
  78. package/dist/chunk-EAK2IMM4.mjs +37 -0
  79. package/dist/chunk-EQT2Q2LW.mjs +610 -0
  80. package/dist/chunk-EWMCELQV.mjs +670 -0
  81. package/dist/chunk-EYKWBEHX.mjs +612 -0
  82. package/dist/chunk-FHLCFUP6.mjs +666 -0
  83. package/dist/chunk-FMPFLQZV.mjs +670 -0
  84. package/dist/chunk-G25YXZ74.mjs +618 -0
  85. package/dist/chunk-G6P5MKL3.mjs +582 -0
  86. package/dist/chunk-GSG6ZC3R.mjs +37 -0
  87. package/dist/chunk-H3MQUFTJ.mjs +618 -0
  88. package/dist/chunk-HKZRLVBX.mjs +618 -0
  89. package/dist/chunk-HQALJGVT.mjs +618 -0
  90. package/dist/chunk-I5GBZ3UX.mjs +676 -0
  91. package/dist/chunk-IUTUCRDD.mjs +611 -0
  92. package/dist/chunk-IV4V55OA.mjs +672 -0
  93. package/dist/chunk-J2RAFKAD.mjs +618 -0
  94. package/dist/chunk-JCMSG75Q.mjs +51 -0
  95. package/dist/chunk-JL34UFI7.mjs +670 -0
  96. package/dist/chunk-JTKSGGQM.mjs +611 -0
  97. package/dist/chunk-JZC2RRDH.mjs +618 -0
  98. package/dist/chunk-JZCHXA6R.mjs +585 -0
  99. package/dist/chunk-K3Y7VKT6.mjs +670 -0
  100. package/dist/chunk-KEVXNUFG.mjs +672 -0
  101. package/dist/chunk-KH7D4ESJ.mjs +584 -0
  102. package/dist/chunk-KQBCWIIM.mjs +618 -0
  103. package/dist/chunk-KRYAP7NG.mjs +670 -0
  104. package/dist/chunk-KU655POK.mjs +657 -0
  105. package/dist/chunk-L55SLVNX.mjs +618 -0
  106. package/dist/chunk-LCRYOZEV.mjs +618 -0
  107. package/dist/chunk-LH7PP6V2.mjs +618 -0
  108. package/dist/chunk-LJMMYKE2.mjs +618 -0
  109. package/dist/chunk-LK5TROLL.mjs +666 -0
  110. package/dist/chunk-MDR7DAKM.mjs +618 -0
  111. package/dist/chunk-MJZLCWZ5.mjs +666 -0
  112. package/dist/chunk-MKZTEJLS.mjs +612 -0
  113. package/dist/chunk-MQCOQHHP.mjs +618 -0
  114. package/dist/chunk-MSM4KUBM.mjs +618 -0
  115. package/dist/chunk-MTIUER63.mjs +676 -0
  116. package/dist/chunk-NBLV3UX5.mjs +618 -0
  117. package/dist/chunk-NLADSOJS.mjs +618 -0
  118. package/dist/chunk-NPMTWR3Y.mjs +618 -0
  119. package/dist/chunk-NQ6GKEO7.mjs +670 -0
  120. package/dist/chunk-NZSFYNUK.mjs +618 -0
  121. package/dist/chunk-OCNF4O5U.mjs +612 -0
  122. package/dist/chunk-OCW5QSWA.mjs +618 -0
  123. package/dist/chunk-OQF7JZFS.mjs +670 -0
  124. package/dist/chunk-OT675HGC.mjs +670 -0
  125. package/dist/chunk-P47TCYKN.mjs +618 -0
  126. package/dist/chunk-P7TOGXPI.mjs +672 -0
  127. package/dist/chunk-PCAXXEEQ.mjs +618 -0
  128. package/dist/chunk-PDHMG7OZ.mjs +672 -0
  129. package/dist/chunk-PFGVOZGM.mjs +618 -0
  130. package/dist/chunk-PGAAFJOG.mjs +576 -0
  131. package/dist/chunk-PQSSDK3E.mjs +618 -0
  132. package/dist/chunk-PST7W3NG.mjs +618 -0
  133. package/dist/chunk-QGPBZ2YV.mjs +664 -0
  134. package/dist/chunk-QKTMWS4J.mjs +43 -0
  135. package/dist/chunk-QOPCJITC.mjs +618 -0
  136. package/dist/chunk-QSE52CRC.mjs +618 -0
  137. package/dist/chunk-QTP2QMPL.mjs +669 -0
  138. package/dist/chunk-QUZAACW5.mjs +585 -0
  139. package/dist/chunk-R47XX6IW.mjs +611 -0
  140. package/dist/chunk-RL6AEU6E.mjs +612 -0
  141. package/dist/chunk-RZ7V2KQZ.mjs +621 -0
  142. package/dist/chunk-S3CUYIE3.mjs +585 -0
  143. package/dist/chunk-T7T4HCHH.mjs +618 -0
  144. package/dist/chunk-TED2WCDG.mjs +618 -0
  145. package/dist/chunk-TENXL4LK.mjs +107 -0
  146. package/dist/chunk-TJLIMMMB.mjs +612 -0
  147. package/dist/chunk-TNOJDLON.mjs +611 -0
  148. package/dist/chunk-TOR67IHH.mjs +672 -0
  149. package/dist/chunk-TOV7NVKM.mjs +618 -0
  150. package/dist/chunk-TSYMIRRN.mjs +618 -0
  151. package/dist/chunk-TTSRI4V7.mjs +708 -0
  152. package/dist/chunk-UBS3DTE5.mjs +672 -0
  153. package/dist/chunk-UBW6RYVF.mjs +670 -0
  154. package/dist/chunk-UFAFA6RV.mjs +585 -0
  155. package/dist/chunk-UJNUFKR5.mjs +43 -0
  156. package/dist/chunk-VAZZJOSJ.mjs +618 -0
  157. package/dist/chunk-VCWXOX2B.mjs +618 -0
  158. package/dist/chunk-VHCLEOHZ.mjs +618 -0
  159. package/dist/chunk-VTZSCGME.mjs +666 -0
  160. package/dist/chunk-W33KZ2XR.mjs +618 -0
  161. package/dist/chunk-WOVMTYDV.mjs +612 -0
  162. package/dist/chunk-WR3USBWK.mjs +672 -0
  163. package/dist/chunk-WXYQARQ6.mjs +618 -0
  164. package/dist/chunk-XE4LPYOW.mjs +581 -0
  165. package/dist/chunk-Y6XKW4NG.mjs +618 -0
  166. package/dist/chunk-YQSNJFZE.mjs +618 -0
  167. package/dist/chunk-Z6VG6AG7.mjs +678 -0
  168. package/dist/chunk-ZAPKQ4C3.mjs +678 -0
  169. package/dist/chunk-ZCWDQNHL.mjs +618 -0
  170. package/dist/chunk-ZF5JBNCI.mjs +618 -0
  171. package/dist/chunk-ZN7BHWOF.mjs +672 -0
  172. package/dist/chunk-ZTRM4HZJ.mjs +53 -0
  173. package/dist/chunk-ZUMHWVMV.mjs +585 -0
  174. package/dist/chunk-ZUQJKA5J.mjs +666 -0
  175. package/dist/chunk-ZWHWIGYQ.mjs +618 -0
  176. package/dist/index.d.mts +4 -0
  177. package/dist/index.d.ts +4 -0
  178. package/dist/index.js +1350 -0
  179. package/dist/index.mjs +22 -9
  180. package/dist/styles.css +845 -228
  181. package/package.json +4 -2
package/dist/index.js CHANGED
@@ -62,8 +62,11 @@ __export(index_exports, {
62
62
  Avatar: () => Avatar_default,
63
63
  Button: () => Button_default,
64
64
  Checkbox: () => Checkbox_default,
65
+ LoadingSpinner: () => LoadingSpinner_default,
65
66
  Modal: () => Modal_default,
66
67
  Radio: () => Radio_default,
68
+ RangePicker: () => RangePicker_default,
69
+ Select: () => Select_default,
67
70
  Switch: () => Switch_default,
68
71
  Tag: () => Tag_default,
69
72
  Tooltip: () => Tooltip_default
@@ -583,13 +586,1360 @@ var Tag = (_a) => {
583
586
  };
584
587
  Tag.displayName = "Tag";
585
588
  var Tag_default = Tag;
589
+
590
+ // src/atom/RangePicker/RangePicker.tsx
591
+ var import_react3 = require("react");
592
+ var import_clsx9 = __toESM(require("clsx"));
593
+ var import_dayjs = __toESM(require("dayjs"));
594
+
595
+ // src/atom/RangePicker/Chevron.tsx
596
+ var React = __toESM(require("react"));
597
+ var import_jsx_runtime9 = require("react/jsx-runtime");
598
+ var Chevron = React.memo(
599
+ (_a) => {
600
+ var _b = _a, { size = "normal", color = "black", className } = _b, rest = __objRest(_b, ["size", "color", "className"]);
601
+ const getSize = (size2) => {
602
+ switch (size2) {
603
+ case "small":
604
+ return "M9.78 11.78a.75.75 0 000-1.06L7.06 8l2.72-2.72a.75.75 0 00-1.06-1.06L5.47 7.47a.75.75 0 000 1.06l3.25 3.25a.75.75 0 001.06 0z";
605
+ case "normal":
606
+ return "M14.78 17.78a.75.75 0 000-1.06L10.06 12l4.72-4.72a.75.75 0 00-1.06-1.06l-5.25 5.25a.75.75 0 000 1.06l5.25 5.25a.75.75 0 001.06 0z";
607
+ default:
608
+ return "M14.78 17.78a.75.75 0 000-1.06L10.06 12l4.72-4.72a.75.75 0 00-1.06-1.06l-5.25 5.25a.75.75 0 000 1.06l5.25 5.25a.75.75 0 001.06 0z";
609
+ }
610
+ };
611
+ const getContainer = (size2) => {
612
+ switch (size2) {
613
+ case "small":
614
+ return 16;
615
+ case "medium":
616
+ return 20;
617
+ case "normal":
618
+ return 24;
619
+ default:
620
+ return 24;
621
+ }
622
+ };
623
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
624
+ "svg",
625
+ __spreadProps(__spreadValues({
626
+ xmlns: "http://www.w3.org/2000/svg",
627
+ width: getContainer(size),
628
+ height: getContainer(size),
629
+ fill: "none",
630
+ viewBox: `0 0 ${getContainer(size)} ${getContainer(size)}`,
631
+ className
632
+ }, rest), {
633
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { fill: color, d: getSize(size) })
634
+ })
635
+ );
636
+ }
637
+ );
638
+
639
+ // src/atom/RangePicker/RangePicker.module.scss
640
+ var RangePicker_module_default = { "range_start": "RangePicker-module__range_start___hGQp-", "range_end": "RangePicker-module__range_end___JJNib" };
641
+
642
+ // src/atom/Select/Select.tsx
643
+ var import_react2 = require("react");
644
+ var import_clsx8 = __toESM(require("clsx"));
645
+
646
+ // src/icons/Chevron.tsx
647
+ var React2 = __toESM(require("react"));
648
+ var import_jsx_runtime10 = require("react/jsx-runtime");
649
+ var Chevron2 = React2.memo(
650
+ (_a) => {
651
+ var _b = _a, { size = 16, color = "#6b7280", className } = _b, rest = __objRest(_b, ["size", "color", "className"]);
652
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
653
+ "svg",
654
+ __spreadProps(__spreadValues({
655
+ xmlns: "http://www.w3.org/2000/svg",
656
+ width: size,
657
+ height: size,
658
+ fill: "none",
659
+ viewBox: "0 0 16 16",
660
+ className
661
+ }, rest), {
662
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
663
+ "path",
664
+ {
665
+ fill: color,
666
+ d: "M11.78 6.22a.75.75 0 00-1.06 0L8 8.94 5.28 6.22a.75.75 0 00-1.06 1.06l3.25 3.25a.75.75 0 001.06 0l3.25-3.25a.75.75 0 000-1.06z"
667
+ }
668
+ )
669
+ })
670
+ );
671
+ }
672
+ );
673
+ Chevron2.displayName = "Chevron";
674
+
675
+ // src/icons/CrossV2.tsx
676
+ var React3 = __toESM(require("react"));
677
+ var import_jsx_runtime11 = require("react/jsx-runtime");
678
+ var CrossV2 = React3.memo(
679
+ (_a) => {
680
+ var _b = _a, { size = 16, color = "#111827", className } = _b, rest = __objRest(_b, ["size", "color", "className"]);
681
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
682
+ "svg",
683
+ __spreadProps(__spreadValues({
684
+ xmlns: "http://www.w3.org/2000/svg",
685
+ width: size,
686
+ height: size,
687
+ fill: "none",
688
+ viewBox: "0 0 20 20"
689
+ }, rest), {
690
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
691
+ "path",
692
+ {
693
+ fill: color,
694
+ d: "M4.411 4.41a.833.833 0 0 1 1.179 0L10 8.822l4.411-4.41a.833.833 0 1 1 1.179 1.178L11.179 10l4.41 4.41a.833.833 0 0 1-1.178 1.18l-4.41-4.411-4.411 4.41a.833.833 0 1 1-1.179-1.178L8.821 10l-4.41-4.41a.833.833 0 0 1 0-1.18"
695
+ }
696
+ )
697
+ })
698
+ );
699
+ }
700
+ );
701
+ CrossV2.displayName = "CrossV2";
702
+
703
+ // src/icons/Lock.tsx
704
+ var import_react = __toESM(require("react"));
705
+ var import_jsx_runtime12 = require("react/jsx-runtime");
706
+ var Lock = import_react.default.memo((_a) => {
707
+ var _b = _a, { size = 16, color = "#000" } = _b, rest = __objRest(_b, ["size", "color"]);
708
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
709
+ "svg",
710
+ __spreadProps(__spreadValues({
711
+ xmlns: "http://www.w3.org/2000/svg",
712
+ width: size,
713
+ height: size,
714
+ fill: "none",
715
+ viewBox: "0 0 16 16"
716
+ }, rest), {
717
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
718
+ "path",
719
+ {
720
+ fill: color,
721
+ d: "M9 9a1 1 0 11-2 0 1 1 0 012 0zM5 4h-.5A2.5 2.5 0 002 6.5v5A2.5 2.5 0 004.5 14h7a2.5 2.5 0 002.5-2.5v-5A2.5 2.5 0 0011.5 4H11v-.5a3 3 0 00-6 0V4zm1-.5a2 2 0 114 0V4H6v-.5zM11.5 5A1.5 1.5 0 0113 6.5v5a1.5 1.5 0 01-1.5 1.5h-7A1.5 1.5 0 013 11.5v-5A1.5 1.5 0 014.5 5h7z"
722
+ }
723
+ )
724
+ })
725
+ );
726
+ });
727
+
728
+ // src/atom/LoadingSpinner/LoadingSpinner.tsx
729
+ var import_icons = require("@ant-design/icons");
730
+ var import_antd8 = require("antd");
731
+
732
+ // src/atom/LoadingSpinner/LoadingSpinner.module.scss
733
+ var LoadingSpinner_module_default = { "spinnerContainer": "LoadingSpinner-module__spinnerContainer___DiPLf" };
734
+
735
+ // src/atom/LoadingSpinner/LoadingSpinner.tsx
736
+ var import_jsx_runtime13 = require("react/jsx-runtime");
737
+ var sizeMapping = {
738
+ xs: 16,
739
+ small: 24,
740
+ medium: 36,
741
+ large: 48
742
+ };
743
+ var LoadingSpinner = (_a) => {
744
+ var _b = _a, { size = "small", color = "#ec5d25" } = _b, rest = __objRest(_b, ["size", "color"]);
745
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", __spreadProps(__spreadValues({ className: LoadingSpinner_module_default.spinnerContainer }, rest), { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
746
+ import_antd8.Spin,
747
+ {
748
+ indicator: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
749
+ import_icons.LoadingOutlined,
750
+ {
751
+ style: { fontSize: sizeMapping[size], color },
752
+ spin: true
753
+ }
754
+ )
755
+ }
756
+ ) }));
757
+ };
758
+ LoadingSpinner.displayName = "LoadingSpinner";
759
+ var LoadingSpinner_default = LoadingSpinner;
760
+
761
+ // src/atom/Select/Select.tsx
762
+ var import_jsx_runtime14 = require("react/jsx-runtime");
763
+ var Select = ({
764
+ label,
765
+ mandatory = false,
766
+ error = false,
767
+ options = [],
768
+ valueSelected = "",
769
+ // Keep for backward compatibility
770
+ value: _valueProp,
771
+ // Rename to avoid potential conflicts with native value attribute
772
+ onChange,
773
+ onSearch,
774
+ isLoading = false,
775
+ disabled = false,
776
+ disabledTooltip = "",
777
+ className = "",
778
+ dropdownClassName = "",
779
+ optionClassName = "",
780
+ style = {},
781
+ showDisplayValue = false,
782
+ // New prop to show displayValue instead of label
783
+ allowClear = true,
784
+ enableSearch = true,
785
+ doubleCharSearch = false,
786
+ id,
787
+ name,
788
+ tabIndex,
789
+ // Add tabIndex prop
790
+ // Additional styling props
791
+ size = "default",
792
+ // 'small', 'default', 'large'
793
+ variant = "default",
794
+ // 'default', 'filled', 'outlined'
795
+ wrapperClassName = "",
796
+ inputClassName = "",
797
+ // Custom class for input element specifically
798
+ labelClassName = "",
799
+ // Custom class for label element specifically
800
+ height = "tw-h-12",
801
+ // Custom height
802
+ experience = "business"
803
+ }) => {
804
+ const normalizeValue = (0, import_react2.useCallback)(
805
+ (val) => {
806
+ if (val === null || val === void 0) return "";
807
+ return String(val);
808
+ },
809
+ []
810
+ );
811
+ const validatedOptions = (0, import_react2.useMemo)(() => {
812
+ if (!Array.isArray(options)) return [];
813
+ return options.filter(
814
+ (opt) => opt && typeof opt === "object" && opt.value !== void 0 && opt.value !== null && opt.label !== void 0
815
+ );
816
+ }, [options]);
817
+ const [isOpen, setIsOpen] = (0, import_react2.useState)(false);
818
+ const [isFocused, setIsFocused] = (0, import_react2.useState)(false);
819
+ const [searchTerm, setSearchTerm] = (0, import_react2.useState)("");
820
+ const [isHovering, setIsHovering] = (0, import_react2.useState)(false);
821
+ const [highlightedIndex, setHighlightedIndex] = (0, import_react2.useState)(-1);
822
+ const [selectedValue, setSelectedValue] = (0, import_react2.useState)(() => {
823
+ const initialValue = valueSelected;
824
+ if (initialValue === null || initialValue === void 0) return "";
825
+ return String(initialValue);
826
+ });
827
+ const inputRef = (0, import_react2.useRef)(null);
828
+ const inputValueRef = (0, import_react2.useRef)("");
829
+ const dropdownRef = (0, import_react2.useRef)(null);
830
+ const optionRefs = (0, import_react2.useRef)([]);
831
+ const optionListRef = (0, import_react2.useRef)(null);
832
+ const blurTimeoutRef = (0, import_react2.useRef)(null);
833
+ const hoverTimeoutRef = (0, import_react2.useRef)(null);
834
+ const isActive = isFocused || Boolean(selectedValue) || Boolean(valueSelected) || Boolean(searchTerm);
835
+ const sizeClasses = (0, import_react2.useMemo)(() => {
836
+ switch (size) {
837
+ case "small":
838
+ return {
839
+ input: "tw-h-6 tw-px-3 tw-typography-caption1Bold !tw-rounded-lg",
840
+ padding: "tw-px-2 tw-py-1",
841
+ labelActive: "tw-top-0.5 tw-typography-caption2",
842
+ labelInactive: "tw-top-1.5 tw-typography-caption3"
843
+ };
844
+ case "medium":
845
+ return {
846
+ input: "tw-h-10 tw-px-4 tw-typography-body2",
847
+ padding: label ? "tw-pt-4 tw-pb-1" : "tw-py-2",
848
+ labelActive: "tw-top-1 tw-typography-caption3",
849
+ labelInactive: "tw-top-2.5 tw-typography-body2"
850
+ };
851
+ case "large":
852
+ return {
853
+ input: "tw-h-16 tw-px-5 tw-typography-bodyLarge",
854
+ padding: label ? "tw-pt-8 tw-pb-4" : "tw-py-5",
855
+ labelActive: "tw-top-1 tw-typography-caption2",
856
+ labelInactive: "tw-top-5 tw-typography-body1"
857
+ };
858
+ default:
859
+ return {
860
+ input: height + " tw-px-4 tw-typography-bodyLarge",
861
+ padding: label ? "tw-pt-6 tw-pb-3" : "tw-py-3",
862
+ labelActive: "tw-top-1 tw-typography-caption3",
863
+ labelInactive: "tw-top-3.5 tw-typography-body2"
864
+ };
865
+ }
866
+ }, [size, label, height]);
867
+ const variantClasses = (0, import_react2.useMemo)(() => {
868
+ switch (variant) {
869
+ case "filled":
870
+ return "tw-bg-gray-50 tw-border-transparent";
871
+ case "outlined":
872
+ return "tw-bg-transparent tw-border-2";
873
+ default:
874
+ return " tw-border";
875
+ }
876
+ }, [variant]);
877
+ const handleBlur = (0, import_react2.useCallback)(() => {
878
+ blurTimeoutRef.current = setTimeout(() => {
879
+ setIsOpen(false);
880
+ setSearchTerm("");
881
+ setHighlightedIndex(-1);
882
+ blurTimeoutRef.current = null;
883
+ setIsFocused(false);
884
+ }, 150);
885
+ }, []);
886
+ const handleSearchChange = (0, import_react2.useCallback)(
887
+ (e) => {
888
+ var _a;
889
+ const searchValue = doubleCharSearch ? e.target.value.slice(0, 2) || "" : e.target.value;
890
+ if (doubleCharSearch) {
891
+ setSearchTerm(searchValue);
892
+ } else {
893
+ setSearchTerm(searchValue);
894
+ }
895
+ setIsOpen(true);
896
+ setHighlightedIndex(-1);
897
+ if (onSearch && typeof onSearch === "function") {
898
+ onSearch(searchValue);
899
+ }
900
+ (_a = optionListRef == null ? void 0 : optionListRef.current) == null ? void 0 : _a.scrollTo({
901
+ top: 0,
902
+ behavior: "smooth"
903
+ });
904
+ },
905
+ [doubleCharSearch, onSearch]
906
+ );
907
+ const handleOptionSelect = (0, import_react2.useCallback)(
908
+ (option) => {
909
+ var _a;
910
+ if (blurTimeoutRef.current) {
911
+ clearTimeout(blurTimeoutRef.current);
912
+ blurTimeoutRef.current = null;
913
+ }
914
+ inputValueRef.current = option.label;
915
+ const normalizedValue = normalizeValue(option.value);
916
+ setSelectedValue(normalizedValue);
917
+ setSearchTerm("");
918
+ setIsOpen(false);
919
+ if (enableSearch) {
920
+ setIsFocused(false);
921
+ }
922
+ setIsHovering(false);
923
+ if (onChange) onChange(option.value);
924
+ if (enableSearch) (_a = inputRef.current) == null ? void 0 : _a.blur();
925
+ },
926
+ [normalizeValue, onChange, enableSearch]
927
+ );
928
+ const handleClear = (0, import_react2.useCallback)(
929
+ (e) => {
930
+ var _a;
931
+ inputValueRef.current = "";
932
+ e.stopPropagation();
933
+ e.preventDefault();
934
+ setSelectedValue("");
935
+ setSearchTerm("");
936
+ if (enableSearch) {
937
+ setIsOpen(true);
938
+ setIsFocused(true);
939
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
940
+ } else {
941
+ setIsOpen(false);
942
+ setIsFocused(false);
943
+ }
944
+ if (onChange) onChange(null);
945
+ },
946
+ [onChange, enableSearch]
947
+ );
948
+ (0, import_react2.useEffect)(() => {
949
+ if (!validatedOptions.length) {
950
+ setSelectedValue("");
951
+ setSearchTerm("");
952
+ inputValueRef.current = "";
953
+ }
954
+ }, [validatedOptions.length]);
955
+ (0, import_react2.useEffect)(() => {
956
+ const externalValue = _valueProp !== void 0 ? _valueProp : valueSelected;
957
+ const newValue = normalizeValue(externalValue);
958
+ setSelectedValue((prevValue) => {
959
+ const prevNormalized = normalizeValue(prevValue);
960
+ return prevNormalized !== newValue ? newValue : prevValue;
961
+ });
962
+ }, [valueSelected, _valueProp, normalizeValue]);
963
+ (0, import_react2.useEffect)(() => {
964
+ const handleClickOutside = (event) => {
965
+ if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
966
+ if (blurTimeoutRef.current) {
967
+ clearTimeout(blurTimeoutRef.current);
968
+ blurTimeoutRef.current = null;
969
+ }
970
+ setIsOpen(false);
971
+ setIsFocused(false);
972
+ setSearchTerm("");
973
+ setHighlightedIndex(-1);
974
+ }
975
+ };
976
+ document.addEventListener("mousedown", handleClickOutside);
977
+ return () => {
978
+ document.removeEventListener("mousedown", handleClickOutside);
979
+ if (blurTimeoutRef.current) {
980
+ clearTimeout(blurTimeoutRef.current);
981
+ }
982
+ if (hoverTimeoutRef.current) {
983
+ clearTimeout(hoverTimeoutRef.current);
984
+ }
985
+ };
986
+ }, []);
987
+ const getDisplayValue = (0, import_react2.useCallback)(() => {
988
+ if (selectedValue && (validatedOptions == null ? void 0 : validatedOptions.length) > 0) {
989
+ const selected = validatedOptions.find(
990
+ (opt) => normalizeValue(opt.value) === normalizeValue(selectedValue)
991
+ );
992
+ if (selected) {
993
+ return showDisplayValue && selected.displayValue ? selected.displayValue : selected.label;
994
+ }
995
+ }
996
+ if (selectedValue && (!validatedOptions || validatedOptions.length === 0)) {
997
+ return selectedValue;
998
+ }
999
+ return "";
1000
+ }, [selectedValue, validatedOptions, showDisplayValue, normalizeValue]);
1001
+ const filteredOptions = (0, import_react2.useMemo)(() => {
1002
+ var _a;
1003
+ if (!enableSearch) {
1004
+ return validatedOptions;
1005
+ }
1006
+ (_a = dropdownRef.current) == null ? void 0 : _a.scrollTo(0, 0);
1007
+ const updatedFilteredOptions = validatedOptions.filter((option) => {
1008
+ var _a2;
1009
+ return (_a2 = option == null ? void 0 : option.label) == null ? void 0 : _a2.toLowerCase().includes(searchTerm == null ? void 0 : searchTerm.toLowerCase());
1010
+ });
1011
+ return updatedFilteredOptions;
1012
+ }, [validatedOptions, searchTerm, enableSearch]);
1013
+ const getSelectedOptionIndex = (0, import_react2.useCallback)(() => {
1014
+ if (!selectedValue || !filteredOptions.length) {
1015
+ return 0;
1016
+ }
1017
+ const index = filteredOptions.findIndex(
1018
+ (option) => normalizeValue(option.value) === normalizeValue(selectedValue)
1019
+ );
1020
+ return index >= 0 ? index : 0;
1021
+ }, [selectedValue, filteredOptions, normalizeValue]);
1022
+ const handleInputInteraction = (0, import_react2.useCallback)(
1023
+ (_e) => {
1024
+ var _a;
1025
+ if (blurTimeoutRef.current) {
1026
+ clearTimeout(blurTimeoutRef.current);
1027
+ blurTimeoutRef.current = null;
1028
+ }
1029
+ if (isOpen) {
1030
+ setIsOpen(false);
1031
+ setIsFocused(false);
1032
+ setSearchTerm("");
1033
+ setHighlightedIndex(-1);
1034
+ (_a = inputRef.current) == null ? void 0 : _a.blur();
1035
+ return;
1036
+ }
1037
+ setIsFocused(true);
1038
+ setIsOpen(true);
1039
+ setHighlightedIndex(getSelectedOptionIndex());
1040
+ if (inputRef.current) {
1041
+ inputRef.current.focus();
1042
+ }
1043
+ },
1044
+ [isOpen, getSelectedOptionIndex]
1045
+ );
1046
+ const handleKeyDown = (0, import_react2.useCallback)(
1047
+ (e) => {
1048
+ var _a;
1049
+ if (!isOpen) return;
1050
+ switch (e.key) {
1051
+ case "ArrowDown":
1052
+ e.preventDefault();
1053
+ setHighlightedIndex((prev) => {
1054
+ const nextIndex = prev < filteredOptions.length - 1 ? prev + 1 : prev;
1055
+ return nextIndex;
1056
+ });
1057
+ break;
1058
+ case "ArrowUp":
1059
+ e.preventDefault();
1060
+ setHighlightedIndex((prev) => {
1061
+ const nextIndex = prev > 0 ? prev - 1 : prev;
1062
+ return nextIndex;
1063
+ });
1064
+ break;
1065
+ case "Enter":
1066
+ e.preventDefault();
1067
+ if (highlightedIndex >= 0 && filteredOptions[highlightedIndex]) {
1068
+ handleOptionSelect(filteredOptions[highlightedIndex]);
1069
+ }
1070
+ break;
1071
+ case "Escape":
1072
+ e.preventDefault();
1073
+ setIsOpen(false);
1074
+ setIsFocused(false);
1075
+ setSearchTerm("");
1076
+ setHighlightedIndex(-1);
1077
+ (_a = inputRef.current) == null ? void 0 : _a.blur();
1078
+ break;
1079
+ default:
1080
+ break;
1081
+ }
1082
+ },
1083
+ [isOpen, highlightedIndex, filteredOptions, handleOptionSelect]
1084
+ );
1085
+ (0, import_react2.useEffect)(() => {
1086
+ if (highlightedIndex >= 0 && optionRefs.current[highlightedIndex]) {
1087
+ optionRefs.current[highlightedIndex].scrollIntoView({
1088
+ block: "nearest",
1089
+ behavior: "smooth"
1090
+ });
1091
+ }
1092
+ }, [highlightedIndex]);
1093
+ (0, import_react2.useEffect)(() => {
1094
+ optionRefs.current = [];
1095
+ }, [filteredOptions]);
1096
+ const handleMouseEnter = (0, import_react2.useCallback)(() => {
1097
+ if (hoverTimeoutRef.current) {
1098
+ clearTimeout(hoverTimeoutRef.current);
1099
+ }
1100
+ if (!isHovering) {
1101
+ setIsHovering(true);
1102
+ }
1103
+ }, [isHovering]);
1104
+ const handleMouseLeave = (0, import_react2.useCallback)(() => {
1105
+ hoverTimeoutRef.current = setTimeout(() => {
1106
+ setIsHovering(false);
1107
+ }, 50);
1108
+ }, []);
1109
+ const handleChevronClick = (0, import_react2.useCallback)(
1110
+ (e) => {
1111
+ var _a;
1112
+ e.preventDefault();
1113
+ if (blurTimeoutRef.current) {
1114
+ clearTimeout(blurTimeoutRef.current);
1115
+ blurTimeoutRef.current = null;
1116
+ }
1117
+ if (isOpen) {
1118
+ setIsOpen(false);
1119
+ setIsFocused(false);
1120
+ setSearchTerm("");
1121
+ setHighlightedIndex(-1);
1122
+ (_a = inputRef.current) == null ? void 0 : _a.blur();
1123
+ } else {
1124
+ if (inputRef.current) {
1125
+ inputRef.current.focus();
1126
+ }
1127
+ handleInputInteraction();
1128
+ }
1129
+ },
1130
+ [isOpen, handleInputInteraction]
1131
+ );
1132
+ const InputWrapper = ({ children }) => {
1133
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Tooltip_default, { title: disabledTooltip, children });
1134
+ return children;
1135
+ };
1136
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(InputWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1137
+ "div",
1138
+ {
1139
+ style,
1140
+ className: (0, import_clsx8.default)("tw-relative tw-w-full", wrapperClassName, {
1141
+ "tw-cursor-not-allowed": disabled
1142
+ }),
1143
+ ref: dropdownRef,
1144
+ onMouseEnter: handleMouseEnter,
1145
+ onMouseLeave: handleMouseLeave,
1146
+ children: [
1147
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "tw-relative", children: [
1148
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1149
+ "input",
1150
+ {
1151
+ ref: inputRef,
1152
+ type: "text",
1153
+ id,
1154
+ name,
1155
+ tabIndex,
1156
+ autoComplete: "off",
1157
+ autoCorrect: "off",
1158
+ autoCapitalize: "off",
1159
+ spellCheck: "false",
1160
+ value: isFocused && enableSearch ? searchTerm : getDisplayValue(),
1161
+ onChange: enableSearch ? handleSearchChange : void 0,
1162
+ onClick: handleInputInteraction,
1163
+ onKeyDown: handleKeyDown,
1164
+ className: (0, import_clsx8.default)(
1165
+ "tw-w-full tw-rounded-xl tw-outline-none tw-transition-all tw-duration-200 tw-cursor-pointer tw-border-solid tw-text-color-text-default",
1166
+ sizeClasses.input,
1167
+ sizeClasses.padding,
1168
+ variantClasses,
1169
+ {
1170
+ "tw-bg-white": valueSelected || getDisplayValue() || isFocused,
1171
+ "tw-bg-color-gray-5": !valueSelected || !getDisplayValue(),
1172
+ "!tw-bg-[#F8F7F6] tw-cursor-not-allowed tw-pointer-events-none": disabled
1173
+ },
1174
+ // Conditional padding based on label presence
1175
+ !label && "tw-flex tw-items-center",
1176
+ {
1177
+ "!tw-border-color-primary": isFocused && experience === "business"
1178
+ },
1179
+ {
1180
+ "!tw-border-[#804D7B]": isFocused && experience === "personal"
1181
+ },
1182
+ error ? "!tw-border-color-text-critical " : "tw-border-[#EBE3DD] hover:tw-border-[#C5B7AC]",
1183
+ // Add focus state styling
1184
+ "focus:tw-shadow-sm focus:tw-ring-offset-1",
1185
+ className,
1186
+ inputClassName
1187
+ // Put inputClassName last so it can override default classes
1188
+ ),
1189
+ readOnly: !isFocused || !enableSearch
1190
+ }
1191
+ ),
1192
+ label && size !== "small" && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1193
+ "label",
1194
+ {
1195
+ htmlFor: id,
1196
+ className: (0, import_clsx8.default)(
1197
+ "tw-absolute tw-left-[18px] tw-pointer-events-none tw-transition-all tw-duration-200 tw-ease-out tw-text-gray-500",
1198
+ isActive ? sizeClasses.labelActive : sizeClasses.labelInactive,
1199
+ error && "tw-text-color-text-critical",
1200
+ labelClassName
1201
+ ),
1202
+ children: [
1203
+ label,
1204
+ mandatory && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "tw-text-color-text-critical tw-ml-1", children: "*" })
1205
+ ]
1206
+ }
1207
+ ),
1208
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1209
+ "div",
1210
+ {
1211
+ className: (0, import_clsx8.default)(
1212
+ "tw-absolute tw-right-3 tw--translate-y-1/2 tw-flex tw-items-center",
1213
+ {
1214
+ "!tw-right-[5px]": doubleCharSearch && !(isHovering && selectedValue && allowClear),
1215
+ "tw-top-3.5 !tw-right-2": size === "small",
1216
+ "tw-top-1/2": size !== "small"
1217
+ }
1218
+ ),
1219
+ children: [
1220
+ disabled && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "tw-absolute tw-right-0 -tw-top-2", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Lock, { size: 16 }) }),
1221
+ isLoading ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LoadingSpinner_default, { size: "xs" }) }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1222
+ "div",
1223
+ {
1224
+ className: (0, import_clsx8.default)(
1225
+ "tw-transition-all tw-duration-200 tw-cursor-pointer tw-flex tw-items-center",
1226
+ // Only rotate chevron when open and not showing clear icon
1227
+ isOpen && !(isHovering && selectedValue && allowClear) && "-tw-rotate-180"
1228
+ ),
1229
+ onMouseDown: (e) => {
1230
+ if (isHovering && selectedValue && allowClear) {
1231
+ handleClear(e);
1232
+ } else {
1233
+ handleChevronClick(e);
1234
+ }
1235
+ },
1236
+ children: disabled ? null : isHovering && selectedValue && allowClear ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1237
+ CrossV2,
1238
+ {
1239
+ color: "#111827",
1240
+ className: (0, import_clsx8.default)({ "tw-mr-1": size !== "small" }),
1241
+ size: size === "small" ? 12 : 16
1242
+ }
1243
+ ) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1244
+ Chevron2,
1245
+ {
1246
+ className: (0, import_clsx8.default)("tw-text-gray-400"),
1247
+ color: "#6B7280"
1248
+ }
1249
+ )
1250
+ }
1251
+ )
1252
+ ]
1253
+ }
1254
+ )
1255
+ ] }),
1256
+ isOpen && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1257
+ "div",
1258
+ {
1259
+ className: (0, import_clsx8.default)(
1260
+ "tw-absolute tw-z-[100] tw-w-full tw-mt-0 tw-bg-white tw-border tw-border-[#ebe3dd] tw-border-solid tw-rounded-xl tw-shadow-lg tw-overflow-y-auto tw-py-1",
1261
+ { "tw-max-h-60": !doubleCharSearch },
1262
+ { "tw-max-h-44": doubleCharSearch },
1263
+ dropdownClassName
1264
+ ),
1265
+ ref: optionListRef,
1266
+ children: filteredOptions.length > 0 ? filteredOptions.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1267
+ "div",
1268
+ {
1269
+ ref: (el) => optionRefs.current[index] = el,
1270
+ onClick: () => handleOptionSelect(option),
1271
+ onMouseEnter: () => setHighlightedIndex(index),
1272
+ className: (0, import_clsx8.default)(
1273
+ "tw-transition-all tw-duration-150 tw-typography-body2",
1274
+ // Selected option styling
1275
+ optionClassName
1276
+ ),
1277
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1278
+ "div",
1279
+ {
1280
+ className: (0, import_clsx8.default)(
1281
+ "tw-px-4 tw-cursor-pointer tw-py-2 tw-mx-0.5 tw-rounded-xl",
1282
+ normalizeValue(selectedValue) === normalizeValue(option.value) ? experience === "personal" ? "tw-bg-[#f1e8fa]" : "tw-bg-[#fff1e1]" : (
1283
+ // Highlighted option styling (keyboard navigation)
1284
+ index === highlightedIndex ? "tw-bg-[#f3f4f6] tw-text-gray-900" : (
1285
+ // Default option styling
1286
+ "tw-text-gray-900 hover:tw-bg-[#1118270a]"
1287
+ )
1288
+ )
1289
+ ),
1290
+ children: option.label
1291
+ }
1292
+ )
1293
+ },
1294
+ doubleCharSearch ? option.label : option.value
1295
+ )) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "tw-px-4 tw-py-3 tw-text-gray-500 tw-text-sm", children: "No options found" })
1296
+ }
1297
+ )
1298
+ ]
1299
+ }
1300
+ ) });
1301
+ };
1302
+ var arePropsEqual = (prevProps, nextProps) => {
1303
+ var _a, _b;
1304
+ const criticalProps = [
1305
+ "value",
1306
+ "valueSelected",
1307
+ "options",
1308
+ "error",
1309
+ "disabled",
1310
+ "label",
1311
+ "mandatory"
1312
+ ];
1313
+ for (const prop of criticalProps) {
1314
+ if (prevProps[prop] !== nextProps[prop]) {
1315
+ return false;
1316
+ }
1317
+ }
1318
+ if (((_a = prevProps.options) == null ? void 0 : _a.length) !== ((_b = nextProps.options) == null ? void 0 : _b.length)) {
1319
+ return false;
1320
+ }
1321
+ if (prevProps.options && nextProps.options) {
1322
+ for (let i = 0; i < prevProps.options.length; i++) {
1323
+ const prevOpt = prevProps.options[i];
1324
+ const nextOpt = nextProps.options[i];
1325
+ if ((prevOpt == null ? void 0 : prevOpt.value) !== (nextOpt == null ? void 0 : nextOpt.value) || (prevOpt == null ? void 0 : prevOpt.label) !== (nextOpt == null ? void 0 : nextOpt.label)) {
1326
+ return false;
1327
+ }
1328
+ }
1329
+ }
1330
+ return true;
1331
+ };
1332
+ Select.displayName = "Select";
1333
+ var Select_default = (0, import_react2.memo)(Select, arePropsEqual);
1334
+
1335
+ // src/atom/RangePicker/RangePicker.tsx
1336
+ var import_jsx_runtime15 = require("react/jsx-runtime");
1337
+ function CustomRangePicker(props) {
1338
+ var _a, _b;
1339
+ const {
1340
+ id = "",
1341
+ footer,
1342
+ onChange = () => {
1343
+ },
1344
+ dateRange = ["", ""],
1345
+ showNightCount = false,
1346
+ isRange = true,
1347
+ showYearDropdown = false,
1348
+ showSingleCalendar = false,
1349
+ disablePastDates = false,
1350
+ // New prop to control past date restriction
1351
+ minDate = null,
1352
+ // New prop for minimum allowed date
1353
+ maxDate = null,
1354
+ // New prop for maximum allowed date
1355
+ minYear = 1900,
1356
+ // Minimum year for dropdown
1357
+ maxYear = (/* @__PURE__ */ new Date()).getFullYear() + 10,
1358
+ // Maximum year for dropdown
1359
+ experience = "business",
1360
+ showToastError = () => {
1361
+ }
1362
+ } = props;
1363
+ const onChangeRef = (0, import_react3.useRef)(onChange);
1364
+ (0, import_react3.useEffect)(() => {
1365
+ onChangeRef.current = onChange;
1366
+ }, [onChange]);
1367
+ const getInitialDate = () => {
1368
+ if (dateRange[0]) {
1369
+ return new Date(dateRange[0]);
1370
+ }
1371
+ if (!minDate && !maxDate && !minYear && !maxYear) {
1372
+ return /* @__PURE__ */ new Date();
1373
+ }
1374
+ if (maxYear && maxYear !== (/* @__PURE__ */ new Date()).getFullYear()) {
1375
+ let targetDate = new Date(maxYear, 7, 1);
1376
+ if (maxDate) {
1377
+ const maxDateTime = new Date(maxDate);
1378
+ if (targetDate > maxDateTime) {
1379
+ targetDate = new Date(
1380
+ maxDateTime.getFullYear(),
1381
+ maxDateTime.getMonth(),
1382
+ 1
1383
+ );
1384
+ }
1385
+ }
1386
+ return targetDate;
1387
+ }
1388
+ if (minDate) {
1389
+ const minDateTime = new Date(minDate);
1390
+ minDateTime.setHours(0, 0, 0, 0);
1391
+ return minDateTime;
1392
+ }
1393
+ return /* @__PURE__ */ new Date();
1394
+ };
1395
+ const [currentDate, setCurrentDate] = (0, import_react3.useState)(() => getInitialDate());
1396
+ const [startDate, setStartDate] = (0, import_react3.useState)(
1397
+ dateRange[0] ? new Date(dateRange[0]) : null
1398
+ );
1399
+ const [endDate, setEndDate] = (0, import_react3.useState)(
1400
+ dateRange[0] && dateRange[1] ? new Date(dateRange[1]) : null
1401
+ );
1402
+ const [hoverDate, setHoverDate] = (0, import_react3.useState)(null);
1403
+ const [isSelectingEnd, setIsSelectingEnd] = (0, import_react3.useState)(
1404
+ dateRange[0] && !dateRange[1] ? true : false
1405
+ );
1406
+ const [selectedDate, setSelectedDate] = (0, import_react3.useState)(
1407
+ !isRange && dateRange[0] ? new Date(dateRange[0]) : null
1408
+ );
1409
+ const getDaysBetween = (start, end) => {
1410
+ if (!start || !end) return 0;
1411
+ const startDay = (0, import_dayjs.default)(start).startOf("day");
1412
+ const endDay = (0, import_dayjs.default)(end).startOf("day");
1413
+ return endDay.diff(startDay, "day");
1414
+ };
1415
+ const nightCount = Math.abs(getDaysBetween(startDate || endDate, hoverDate));
1416
+ const nightCountText = nightCount > 1 ? `${nightCount} nights` : "1 night";
1417
+ const today = /* @__PURE__ */ new Date();
1418
+ today.setHours(0, 0, 0, 0);
1419
+ const firstMonth = new Date(
1420
+ currentDate.getFullYear(),
1421
+ currentDate.getMonth(),
1422
+ 1
1423
+ );
1424
+ const secondMonth = new Date(
1425
+ currentDate.getFullYear(),
1426
+ currentDate.getMonth() + 1,
1427
+ 1
1428
+ );
1429
+ const monthNames = [
1430
+ "January",
1431
+ "February",
1432
+ "March",
1433
+ "April",
1434
+ "May",
1435
+ "June",
1436
+ "July",
1437
+ "August",
1438
+ "September",
1439
+ "October",
1440
+ "November",
1441
+ "December"
1442
+ ];
1443
+ const dayNames = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
1444
+ const generateYearOptions = () => {
1445
+ const years = [];
1446
+ for (let i = minYear; i <= maxYear; i++) {
1447
+ const isYearDisabled = isYearCompletelyDisabled(i);
1448
+ years.push({
1449
+ label: i.toString(),
1450
+ value: i,
1451
+ disabled: isYearDisabled
1452
+ });
1453
+ }
1454
+ return years;
1455
+ };
1456
+ const isYearCompletelyDisabled = (year) => {
1457
+ const firstDayOfYear = new Date(year, 0, 1);
1458
+ const lastDayOfYear = new Date(year, 11, 31);
1459
+ if (minDate) {
1460
+ const minDateTime = new Date(minDate);
1461
+ minDateTime.setHours(0, 0, 0, 0);
1462
+ if (minDateTime > lastDayOfYear) {
1463
+ return true;
1464
+ }
1465
+ }
1466
+ if (maxDate) {
1467
+ const maxDateTime = new Date(maxDate);
1468
+ maxDateTime.setHours(0, 0, 0, 0);
1469
+ if (maxDateTime < firstDayOfYear) {
1470
+ return true;
1471
+ }
1472
+ }
1473
+ if (disablePastDates) {
1474
+ const today2 = /* @__PURE__ */ new Date();
1475
+ today2.setHours(0, 0, 0, 0);
1476
+ if (lastDayOfYear < today2) {
1477
+ return true;
1478
+ }
1479
+ }
1480
+ return false;
1481
+ };
1482
+ const yearOptions = generateYearOptions();
1483
+ const generateCalendarDays = (monthDate) => {
1484
+ const year = monthDate.getFullYear();
1485
+ const month = monthDate.getMonth();
1486
+ const firstDay = new Date(year, month, 1);
1487
+ const lastDay = new Date(year, month + 1, 0);
1488
+ const daysInMonth = lastDay.getDate();
1489
+ const startingDayOfWeek = firstDay.getDay();
1490
+ const days = [];
1491
+ for (let i = 0; i < startingDayOfWeek; i++) {
1492
+ days.push(null);
1493
+ }
1494
+ for (let day = 1; day <= daysInMonth; day++) {
1495
+ days.push(new Date(year, month, day));
1496
+ }
1497
+ return days;
1498
+ };
1499
+ const formatDateKey = (date) => {
1500
+ if (!date) return "";
1501
+ return `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;
1502
+ };
1503
+ const isSameDate = (date1, date2) => {
1504
+ if (!date1 || !date2) return false;
1505
+ return formatDateKey(date1) === formatDateKey(date2);
1506
+ };
1507
+ const isDateDisabled = (date) => {
1508
+ if (!date) return false;
1509
+ const checkDate = new Date(date);
1510
+ checkDate.setHours(0, 0, 0, 0);
1511
+ if (disablePastDates && checkDate < today) {
1512
+ return true;
1513
+ }
1514
+ if (minDate) {
1515
+ const minDateTime = new Date(minDate);
1516
+ minDateTime.setHours(0, 0, 0, 0);
1517
+ if (checkDate < minDateTime) {
1518
+ return true;
1519
+ }
1520
+ }
1521
+ if (maxDate) {
1522
+ const maxDateTime = new Date(maxDate);
1523
+ maxDateTime.setHours(0, 0, 0, 0);
1524
+ if (checkDate > maxDateTime) {
1525
+ return true;
1526
+ }
1527
+ }
1528
+ return false;
1529
+ };
1530
+ const isDateInRange = (date) => {
1531
+ if (!isRange || !startDate || !date) return false;
1532
+ const compareDate = endDate || hoverDate;
1533
+ if (!compareDate) return false;
1534
+ const start = startDate < compareDate ? startDate : compareDate;
1535
+ const end = startDate < compareDate ? compareDate : startDate;
1536
+ return date >= start && date <= end;
1537
+ };
1538
+ const isDateBetweenRange = (date) => {
1539
+ if (!isRange || !startDate || !date) return false;
1540
+ const compareDate = endDate || hoverDate;
1541
+ if (!compareDate) return false;
1542
+ const start = startDate < compareDate ? startDate : compareDate;
1543
+ const end = startDate < compareDate ? compareDate : startDate;
1544
+ return date > start && date < end;
1545
+ };
1546
+ const handleDateClick = (date) => {
1547
+ if (isDateDisabled(date)) return;
1548
+ if (!isRange) {
1549
+ setSelectedDate(date);
1550
+ return;
1551
+ }
1552
+ const isCheckinCheckoutSame = (0, import_dayjs.default)(date).format("D MMM, YYYY") === (0, import_dayjs.default)(startDate).format("D MMM, YYYY");
1553
+ if (showNightCount && isCheckinCheckoutSame) {
1554
+ setStartDate(null);
1555
+ setEndDate(null);
1556
+ setIsSelectingEnd(false);
1557
+ setHoverDate(null);
1558
+ showToastError("Check-in and check-out dates cannot be the same.");
1559
+ return;
1560
+ }
1561
+ if (!startDate || startDate && endDate) {
1562
+ setStartDate(date);
1563
+ setEndDate(null);
1564
+ setIsSelectingEnd(true);
1565
+ setHoverDate(null);
1566
+ } else if (startDate && !endDate) {
1567
+ if (date < startDate) {
1568
+ setEndDate(startDate);
1569
+ setStartDate(date);
1570
+ } else {
1571
+ setEndDate(date);
1572
+ }
1573
+ setIsSelectingEnd(false);
1574
+ setHoverDate(null);
1575
+ }
1576
+ };
1577
+ (0, import_react3.useEffect)(() => {
1578
+ if (isRange) {
1579
+ sessionStorage.removeItem("rangePickerStartDate");
1580
+ onChangeRef.current(null, [
1581
+ startDate ? (0, import_dayjs.default)(startDate).format("D MMM, YYYY") : "",
1582
+ endDate ? (0, import_dayjs.default)(endDate).format("D MMM, YYYY") : ""
1583
+ ]);
1584
+ }
1585
+ if (isRange && startDate && !endDate) {
1586
+ sessionStorage.setItem(
1587
+ "rangePickerStartDate",
1588
+ (0, import_dayjs.default)(startDate).format("D MMM, YYYY")
1589
+ );
1590
+ }
1591
+ }, [startDate, endDate, isRange]);
1592
+ (0, import_react3.useEffect)(() => {
1593
+ if (!isRange && selectedDate) {
1594
+ onChangeRef.current(null, (0, import_dayjs.default)(selectedDate).format("D MMM, YYYY"));
1595
+ }
1596
+ }, [selectedDate, isRange]);
1597
+ const handleDateHover = (date) => {
1598
+ if (isDateDisabled(date) || !isRange) return;
1599
+ if (isSelectingEnd && startDate && !endDate) {
1600
+ setHoverDate(date);
1601
+ }
1602
+ };
1603
+ const navigateMonth = (direction) => {
1604
+ const newDate = new Date(currentDate);
1605
+ newDate.setMonth(currentDate.getMonth() + direction);
1606
+ setCurrentDate(newDate);
1607
+ };
1608
+ const isPreviousMonthDisabled = () => {
1609
+ const previousMonth = new Date(currentDate);
1610
+ previousMonth.setMonth(currentDate.getMonth() - 1);
1611
+ const lastDayOfPreviousMonth = new Date(
1612
+ previousMonth.getFullYear(),
1613
+ previousMonth.getMonth() + 1,
1614
+ 0
1615
+ );
1616
+ return isDateDisabled(lastDayOfPreviousMonth);
1617
+ };
1618
+ const isNextMonthDisabled = () => {
1619
+ const nextMonth = new Date(currentDate);
1620
+ nextMonth.setMonth(currentDate.getMonth() + 1);
1621
+ const firstDayOfNextMonth = new Date(
1622
+ nextMonth.getFullYear(),
1623
+ nextMonth.getMonth(),
1624
+ 1
1625
+ );
1626
+ return isDateDisabled(firstDayOfNextMonth);
1627
+ };
1628
+ const handleYearChange = (selectedYear) => {
1629
+ const newDate = new Date(currentDate);
1630
+ newDate.setFullYear(selectedYear);
1631
+ const targetMonth = newDate.getMonth();
1632
+ if (!isMonthDisabled(selectedYear, targetMonth)) {
1633
+ setCurrentDate(newDate);
1634
+ } else {
1635
+ const firstAvailableMonth = findFirstAvailableMonth(selectedYear);
1636
+ if (firstAvailableMonth !== -1) {
1637
+ newDate.setMonth(firstAvailableMonth);
1638
+ setCurrentDate(newDate);
1639
+ }
1640
+ }
1641
+ };
1642
+ const isMonthDisabled = (year, month) => {
1643
+ const lastDayOfMonth = new Date(year, month + 1, 0);
1644
+ const firstDayOfMonth = new Date(year, month, 1);
1645
+ return isDateDisabled(lastDayOfMonth) && isDateDisabled(firstDayOfMonth);
1646
+ };
1647
+ const findFirstAvailableMonth = (year) => {
1648
+ for (let month = 0; month < 12; month++) {
1649
+ if (!isMonthDisabled(year, month)) {
1650
+ return month;
1651
+ }
1652
+ }
1653
+ return -1;
1654
+ };
1655
+ const isSameDay = ((_a = (0, import_dayjs.default)(startDate)) == null ? void 0 : _a.format("D MMM, YYYY")) === ((_b = (0, import_dayjs.default)(endDate)) == null ? void 0 : _b.format("D MMM, YYYY"));
1656
+ const NightCountTooltip = () => {
1657
+ const TooltipArrow = (0, import_react3.memo)(() => {
1658
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "tw-w-3 tw-h-3 tw-flex tw-items-center tw-justify-center tw-rounded tw-bg-transparent tw-rotate-90", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1659
+ "div",
1660
+ {
1661
+ style: {
1662
+ borderTop: "5px solid transparent",
1663
+ borderBottom: "5px solid transparent",
1664
+ borderLeft: "8px solid black"
1665
+ }
1666
+ }
1667
+ ) });
1668
+ });
1669
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "tw-absolute tw-bottom-11 tw-py-2 tw-bg-black tw-text-white tw-px-2 tw-rounded-lg tw-z-50 tw-text-xs tw-whitespace-nowrap tw-opacity-0 tw-pointer-events-none group-hover:tw-opacity-100 tw-transition-opacity tw-duration-200", children: [
1670
+ nightCountText,
1671
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "tw-absolute tw-right-[42%] tw-bottom-[-7px]", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TooltipArrow, {}) })
1672
+ ] });
1673
+ };
1674
+ const renderCalendar = (monthDate, isSecondCalendar = false) => {
1675
+ const days = generateCalendarDays(monthDate);
1676
+ const monthName = monthNames[monthDate.getMonth()];
1677
+ const year = monthDate.getFullYear();
1678
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1679
+ "div",
1680
+ {
1681
+ className: (0, import_clsx9.default)("tw-flex-1 tw-max-w-[83vw] tw-mb-2", {
1682
+ "tw-h-[320px]": showYearDropdown || days.length > 35,
1683
+ "tw-h-[290px]": !showYearDropdown || days.length <= 35
1684
+ }),
1685
+ children: [
1686
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "tw-text-center tw-mb-4 sm:tw-mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: " tw-flex tw-justify-center tw-items-center tw-gap-4 ", children: [
1687
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("h3", { className: "tw-typography-footNoteBold tw-text-color-text-default tw-m-0", children: [
1688
+ monthName,
1689
+ " ",
1690
+ !showYearDropdown && ` ${year}`
1691
+ ] }),
1692
+ showYearDropdown && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1693
+ Select_default,
1694
+ {
1695
+ options: yearOptions,
1696
+ value: currentDate.getFullYear(),
1697
+ valueSelected: currentDate.getFullYear(),
1698
+ onChange: (selectedYear) => {
1699
+ if (typeof selectedYear === "number") {
1700
+ handleYearChange(selectedYear);
1701
+ }
1702
+ },
1703
+ className: "tw-min-w-fit tw-bg-transparent tw-typography-footNoteBold tw-text-color-text-default",
1704
+ size: "small",
1705
+ variant: "filled",
1706
+ style: { width: "80px" },
1707
+ id: `${id}-year-select`,
1708
+ allowClear: false,
1709
+ enableSearch: false,
1710
+ experience
1711
+ }
1712
+ )
1713
+ ] }) }),
1714
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "tw-grid tw-grid-cols-7 tw-mb-2", children: dayNames.map((day) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1715
+ "div",
1716
+ {
1717
+ className: "tw-py-2 tw-px-0 tw-text-center tw-typography-caption2 tw-text-[#6B7280]",
1718
+ children: day
1719
+ },
1720
+ day
1721
+ )) }),
1722
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "tw-grid tw-grid-cols-7", children: days.map((date, index) => {
1723
+ if (!date) {
1724
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "tw-h-10" }, index);
1725
+ }
1726
+ const isStart = isRange ? isSameDate(date, startDate) : false;
1727
+ const isEnd = isRange ? isSameDate(date, endDate) : false;
1728
+ const isSelected = !isRange ? isSameDate(date, selectedDate) : false;
1729
+ const isInRange = isRange ? isDateBetweenRange(date) : false;
1730
+ const isHovering = isRange && isSelectingEnd && hoverDate && isDateInRange(date) && !isStart && !isEnd;
1731
+ const isDisabled = isDateDisabled(date);
1732
+ let className = "tw-relative tw-z-20 tw-h-10 tw-w-10 tw-flex tw-items-center tw-justify-center tw-typography-caption1Bold ";
1733
+ const isFirstInRow = index % 7 === 0;
1734
+ const isLastInRow = index % 7 === 6;
1735
+ let pseudoClass = "";
1736
+ if (isDisabled) {
1737
+ className += "tw-text-gray-300 tw-cursor-not-allowed ";
1738
+ } else {
1739
+ className += "tw-cursor-pointer ";
1740
+ if (isStart || isEnd || isSelected) {
1741
+ className += "tw-bg-black tw-z-[21] tw-text-white tw-font-medium tw-rounded-full ";
1742
+ } else if (isInRange) {
1743
+ className += "tw-text-gray-900";
1744
+ if (window.innerWidth < 640) {
1745
+ className = className.replace(
1746
+ "tw-w-10",
1747
+ "tw-pr-2 tw-w-[50px] sm:tw-w-10 sm:tw-pr-0"
1748
+ );
1749
+ }
1750
+ pseudoClass = (0, import_clsx9.default)(RangePicker_module_default.range_start, RangePicker_module_default.range_end);
1751
+ } else {
1752
+ className += "tw-text-gray-700 hover:tw-border-2 hover:tw-border-black tw-rounded-full hover:tw-border-solid ";
1753
+ }
1754
+ if (isHovering) {
1755
+ className += "tw-border-2 tw-border-gray-400 tw-bg-white tw-z-[22]";
1756
+ }
1757
+ }
1758
+ const titleDate = (0, import_dayjs.default)(date).format("YYYY-MM-DD");
1759
+ const hoverDateFormatted = (0, import_dayjs.default)(hoverDate || null).format(
1760
+ "YYYY-MM-DD"
1761
+ );
1762
+ const isHoveringDate = (0, import_dayjs.default)(hoverDateFormatted).isSame(
1763
+ (0, import_dayjs.default)(date),
1764
+ "day"
1765
+ );
1766
+ const isHoverDateGreater = (0, import_dayjs.default)(hoverDate).isAfter(
1767
+ (0, import_dayjs.default)(startDate),
1768
+ "day"
1769
+ );
1770
+ const isHoverDateLess = (0, import_dayjs.default)(hoverDate).isBefore(
1771
+ (0, import_dayjs.default)(startDate),
1772
+ "day"
1773
+ );
1774
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "tw-relative", children: [
1775
+ (isStart || isEnd) && startDate && endDate && !isSameDay && isRange && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1776
+ "div",
1777
+ {
1778
+ className: (0, import_clsx9.default)(
1779
+ "tw-w-9 tw-h-8 tw-bg-[#F2EFEC] tw-rotate-90 tw-absolute tw-z-10 tw-top-1",
1780
+ {
1781
+ "tw-left-5": isStart,
1782
+ "tw-right-5": isEnd,
1783
+ "tw-invisible": isFirstInRow && isEnd || isLastInRow && isStart
1784
+ }
1785
+ )
1786
+ }
1787
+ ),
1788
+ isHoveringDate && isHovering && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
1789
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1790
+ "div",
1791
+ {
1792
+ className: (0, import_clsx9.default)(
1793
+ "tw-w-9 tw-h-8 tw-bg-[#F2EFEC] tw-rotate-90 tw-absolute tw-z-10 tw-top-1",
1794
+ {
1795
+ "tw-right-5": isHoverDateGreater,
1796
+ "tw-left-5": isHoverDateLess,
1797
+ "tw-invisible": isFirstInRow && isHoverDateGreater || isLastInRow && isHoverDateLess
1798
+ }
1799
+ )
1800
+ }
1801
+ ),
1802
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1803
+ "div",
1804
+ {
1805
+ className: (0, import_clsx9.default)(
1806
+ "tw-w-[18px] tw-h-[40px] tw-bg-white tw-rounded-r-full tw-absolute tw-z-20",
1807
+ {
1808
+ "tw-left-5": isHoverDateLess,
1809
+ "tw-right-5 tw-rotate-180": isHoverDateGreater
1810
+ }
1811
+ )
1812
+ }
1813
+ )
1814
+ ] }),
1815
+ isStart && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
1816
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1817
+ "div",
1818
+ {
1819
+ className: (0, import_clsx9.default)(
1820
+ "tw-w-9 tw-h-8 tw-bg-[#F2EFEC] tw-rotate-90 tw-absolute tw-z-10 tw-top-1",
1821
+ {
1822
+ "tw-right-5": isHoverDateLess,
1823
+ "tw-left-5": isHoverDateGreater,
1824
+ "tw-invisible": isLastInRow
1825
+ }
1826
+ )
1827
+ }
1828
+ ),
1829
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1830
+ "div",
1831
+ {
1832
+ className: (0, import_clsx9.default)(
1833
+ "tw-w-[18px] tw-h-[40px] tw-bg-white tw-rounded-r-full tw-absolute tw-z-20",
1834
+ {
1835
+ "tw-left-5": isHoverDateGreater,
1836
+ "tw-right-5 tw-rotate-180": isHoverDateLess
1837
+ }
1838
+ )
1839
+ }
1840
+ )
1841
+ ] }),
1842
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1843
+ "div",
1844
+ {
1845
+ className: (0, import_clsx9.default)(className, pseudoClass, "tw-group", {
1846
+ "tw-border-2 !tw-border-black tw-rounded-full tw-border-solid": (0, import_dayjs.default)(date).isSame((0, import_dayjs.default)(hoverDate), "day")
1847
+ }),
1848
+ onClick: () => handleDateClick(date),
1849
+ onMouseEnter: () => handleDateHover(date),
1850
+ "data-date": titleDate,
1851
+ children: [
1852
+ showNightCount && isRange && isHovering && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(NightCountTooltip, {}),
1853
+ date.getDate()
1854
+ ]
1855
+ }
1856
+ )
1857
+ ] }, formatDateKey(date));
1858
+ }) })
1859
+ ]
1860
+ }
1861
+ );
1862
+ };
1863
+ const arrowClasses = "tw-relative tw-top-3 sm:tw-top-0 tw-cursor-pointer tw-rounded-full tw-w-10 tw-h-10 tw-flex tw-justify-center hover:tw-bg-gray-100 tw-items-center";
1864
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1865
+ "div",
1866
+ {
1867
+ className: (0, import_clsx9.default)(
1868
+ "custom-range-picker tw-relative tw-bg-white tw-rounded-xl tw-pt-1 tw-px-0 tw-max-w-4xl tw-mx-auto tw-border tw-border-gray-200 tw-border-solid tw-w-full tw-max-h-[90vh] tw-overflow-y-auto",
1869
+ {
1870
+ "sm:tw-w-[640px]": !showSingleCalendar,
1871
+ "sm:tw-w-[330px]": showSingleCalendar
1872
+ }
1873
+ ),
1874
+ children: [
1875
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "tw-flex tw-items-center tw-px-4 tw-justify-between tw-mb-4 tw-absolute tw-right-0 tw-left-0 tw-top-0.5 sm:tw-top-4 tw-w-auto", children: [
1876
+ !isPreviousMonthDisabled() && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1877
+ "div",
1878
+ {
1879
+ className: (0, import_clsx9.default)(arrowClasses, "tw-left-1"),
1880
+ onClick: () => navigateMonth(-1),
1881
+ id: "calendar-previous-month-button",
1882
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1883
+ Chevron,
1884
+ {
1885
+ size: "medium",
1886
+ className: "tw-relative -tw-top-0.5 tw-right-0.5"
1887
+ }
1888
+ )
1889
+ }
1890
+ ),
1891
+ isPreviousMonthDisabled() && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "tw-w-10 tw-h-10" }),
1892
+ !isNextMonthDisabled() && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1893
+ "div",
1894
+ {
1895
+ className: (0, import_clsx9.default)(arrowClasses, "tw-mt-[1px] tw-right-1"),
1896
+ onClick: () => navigateMonth(1),
1897
+ id: "calendar-next-month-button",
1898
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1899
+ Chevron,
1900
+ {
1901
+ size: "medium",
1902
+ onClick: () => navigateMonth(1),
1903
+ className: "tw-rotate-180 tw-relative tw-top-0.5 tw-left-0.5"
1904
+ }
1905
+ )
1906
+ }
1907
+ ),
1908
+ isNextMonthDisabled() && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "tw-w-10 tw-h-10" })
1909
+ ] }),
1910
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "tw-flex tw-items-center tw-justify-between tw-px-6 tw-border-solid tw-border-color-gray-100 tw-border-b tw-border-t-0 tw-border-l-0 tw-border-r-0 tw-w-auto", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1911
+ "div",
1912
+ {
1913
+ className: (0, import_clsx9.default)("tw-flex tw-w-full", {
1914
+ "tw-flex-col sm:tw-space-x-8 sm:tw-flex-row": isRange || !showSingleCalendar,
1915
+ "tw-justify-center": !isRange || showSingleCalendar,
1916
+ "tw-pt-4": showYearDropdown,
1917
+ // More space when year dropdown is visible
1918
+ "tw-pt-6": !showYearDropdown
1919
+ }),
1920
+ children: [
1921
+ renderCalendar(firstMonth),
1922
+ !showSingleCalendar && renderCalendar(secondMonth, true)
1923
+ ]
1924
+ }
1925
+ ) }),
1926
+ footer
1927
+ ]
1928
+ }
1929
+ );
1930
+ }
1931
+ CustomRangePicker.displayName = "RangePicker";
1932
+ var RangePicker_default = CustomRangePicker;
586
1933
  // Annotate the CommonJS export names for ESM import in node:
587
1934
  0 && (module.exports = {
588
1935
  Avatar,
589
1936
  Button,
590
1937
  Checkbox,
1938
+ LoadingSpinner,
591
1939
  Modal,
592
1940
  Radio,
1941
+ RangePicker,
1942
+ Select,
593
1943
  Switch,
594
1944
  Tag,
595
1945
  Tooltip