@itilite/lumina-ui 0.0.324 → 1.0.0-alpha

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 (273) hide show
  1. package/README.md +43 -10
  2. package/dist/AdvancedDateRangePicker-CN9WN0rH.d.mts +56 -0
  3. package/dist/AdvancedDateRangePicker-CN9WN0rH.d.ts +56 -0
  4. package/dist/AdvancedDateRangePicker-CzN1HGsC.d.mts +57 -0
  5. package/dist/AdvancedDateRangePicker-CzN1HGsC.d.ts +57 -0
  6. package/dist/AdvancedDateRangePicker-DAPxgRl3.d.mts +54 -0
  7. package/dist/AdvancedDateRangePicker-DAPxgRl3.d.ts +54 -0
  8. package/dist/AdvancedDateRangePicker-DW94285G.d.mts +56 -0
  9. package/dist/AdvancedDateRangePicker-DW94285G.d.ts +56 -0
  10. package/dist/AdvancedDateRangePicker-Eh6n4ne0.d.mts +57 -0
  11. package/dist/AdvancedDateRangePicker-Eh6n4ne0.d.ts +57 -0
  12. package/dist/Avatar-DX2JwvAs.d.mts +17 -0
  13. package/dist/Avatar-DX2JwvAs.d.ts +17 -0
  14. package/dist/Table-BA0D3p1m.d.mts +78 -0
  15. package/dist/Table-BA0D3p1m.d.ts +78 -0
  16. package/dist/Table-BLZ6c46U.d.mts +77 -0
  17. package/dist/Table-BLZ6c46U.d.ts +77 -0
  18. package/dist/Table-BMqYnFi4.d.mts +25 -0
  19. package/dist/Table-BMqYnFi4.d.ts +25 -0
  20. package/dist/Table-BOq-_9Nr.d.mts +121 -0
  21. package/dist/Table-BOq-_9Nr.d.ts +121 -0
  22. package/dist/Table-BRcthrYV.d.mts +98 -0
  23. package/dist/Table-BRcthrYV.d.ts +98 -0
  24. package/dist/Table-BWlFCfBG.d.mts +106 -0
  25. package/dist/Table-BWlFCfBG.d.ts +106 -0
  26. package/dist/Table-CHFmNrme.d.mts +77 -0
  27. package/dist/Table-CHFmNrme.d.ts +77 -0
  28. package/dist/Table-CX6UwQiD.d.mts +116 -0
  29. package/dist/Table-CX6UwQiD.d.ts +116 -0
  30. package/dist/Table-Chud2XSq.d.mts +99 -0
  31. package/dist/Table-Chud2XSq.d.ts +99 -0
  32. package/dist/Table-D5QRe_j3.d.mts +121 -0
  33. package/dist/Table-D5QRe_j3.d.ts +121 -0
  34. package/dist/Table-DAgFGahx.d.mts +39 -0
  35. package/dist/Table-DAgFGahx.d.ts +39 -0
  36. package/dist/Table-DWniK7At.d.mts +87 -0
  37. package/dist/Table-DWniK7At.d.ts +87 -0
  38. package/dist/Table-PyFlnUDu.d.mts +47 -0
  39. package/dist/Table-PyFlnUDu.d.ts +47 -0
  40. package/dist/Table-wqyg13Y9.d.mts +77 -0
  41. package/dist/Table-wqyg13Y9.d.ts +77 -0
  42. package/dist/Tag-l7I5oeyk.d.mts +13 -0
  43. package/dist/Tag-l7I5oeyk.d.ts +13 -0
  44. package/dist/atom/AdvancedDateRangePicker/AdvancedDateRangePicker.d.mts +2 -0
  45. package/dist/atom/AdvancedDateRangePicker/AdvancedDateRangePicker.d.ts +2 -0
  46. package/dist/atom/AdvancedDateRangePicker/AdvancedDateRangePicker.js +791 -0
  47. package/dist/atom/AdvancedDateRangePicker/AdvancedDateRangePicker.mjs +11 -0
  48. package/dist/atom/AdvancedDateRangePicker/InternalCalendar.d.mts +18 -0
  49. package/dist/atom/AdvancedDateRangePicker/InternalCalendar.d.ts +18 -0
  50. package/dist/atom/AdvancedDateRangePicker/InternalCalendar.js +370 -0
  51. package/dist/atom/AdvancedDateRangePicker/InternalCalendar.mjs +8 -0
  52. package/dist/atom/Avatar/Avatar.d.mts +9 -0
  53. package/dist/atom/Avatar/Avatar.d.ts +9 -0
  54. package/dist/atom/Avatar/Avatar.js +123 -0
  55. package/dist/atom/Avatar/Avatar.mjs +9 -0
  56. package/dist/{Button.js → atom/Button/Button.js} +4 -4
  57. package/dist/{Button.mjs → atom/Button/Button.mjs} +2 -2
  58. package/dist/{Checkbox.js → atom/Checkbox/Checkbox.js} +4 -4
  59. package/dist/{Checkbox.mjs → atom/Checkbox/Checkbox.mjs} +2 -2
  60. package/dist/atom/LoadingSpinner/LoadingSpinner.d.mts +19 -0
  61. package/dist/atom/LoadingSpinner/LoadingSpinner.d.ts +19 -0
  62. package/dist/atom/LoadingSpinner/LoadingSpinner.js +90 -0
  63. package/dist/atom/LoadingSpinner/LoadingSpinner.mjs +9 -0
  64. package/dist/atom/Modal/Modal.d.mts +25 -0
  65. package/dist/atom/Modal/Modal.d.ts +25 -0
  66. package/dist/atom/Modal/Modal.js +267 -0
  67. package/dist/atom/Modal/Modal.mjs +10 -0
  68. package/dist/atom/Radio/Radio.d.mts +17 -0
  69. package/dist/atom/Radio/Radio.d.ts +17 -0
  70. package/dist/atom/Radio/Radio.js +122 -0
  71. package/dist/atom/Radio/Radio.mjs +9 -0
  72. package/dist/atom/RangePicker/Chevron.d.mts +13 -0
  73. package/dist/atom/RangePicker/Chevron.d.ts +13 -0
  74. package/dist/atom/RangePicker/Chevron.js +110 -0
  75. package/dist/atom/RangePicker/Chevron.mjs +7 -0
  76. package/dist/atom/RangePicker/RangePicker.d.mts +26 -0
  77. package/dist/atom/RangePicker/RangePicker.d.ts +26 -0
  78. package/dist/atom/RangePicker/RangePicker.js +1465 -0
  79. package/dist/atom/RangePicker/RangePicker.mjs +13 -0
  80. package/dist/atom/Select/Select.d.mts +40 -0
  81. package/dist/atom/Select/Select.d.ts +40 -0
  82. package/dist/atom/Select/Select.js +805 -0
  83. package/dist/atom/Select/Select.mjs +11 -0
  84. package/dist/atom/Slider/Slider.d.mts +34 -0
  85. package/dist/atom/Slider/Slider.d.ts +34 -0
  86. package/dist/atom/Slider/Slider.js +107 -0
  87. package/dist/atom/Slider/Slider.mjs +9 -0
  88. package/dist/atom/Switch/Switch.d.mts +13 -0
  89. package/dist/atom/Switch/Switch.d.ts +13 -0
  90. package/dist/atom/Switch/Switch.js +102 -0
  91. package/dist/atom/Switch/Switch.mjs +9 -0
  92. package/dist/atom/Table/LuminaPagination.d.mts +7 -0
  93. package/dist/atom/Table/LuminaPagination.d.ts +7 -0
  94. package/dist/atom/Table/LuminaPagination.js +153 -0
  95. package/dist/atom/Table/LuminaPagination.mjs +9 -0
  96. package/dist/atom/Table/Table.d.mts +3 -0
  97. package/dist/atom/Table/Table.d.ts +3 -0
  98. package/dist/atom/Table/Table.js +306 -0
  99. package/dist/atom/Table/Table.mjs +9 -0
  100. package/dist/atom/Table/TableAccordion.d.mts +9 -0
  101. package/dist/atom/Table/TableAccordion.d.ts +9 -0
  102. package/dist/atom/Table/TableAccordion.js +91 -0
  103. package/dist/atom/Table/TableAccordion.mjs +10 -0
  104. package/dist/atom/Table/TableColumnHeader.d.mts +7 -0
  105. package/dist/atom/Table/TableColumnHeader.d.ts +7 -0
  106. package/dist/atom/Table/TableColumnHeader.js +151 -0
  107. package/dist/atom/Table/TableColumnHeader.mjs +10 -0
  108. package/dist/atom/Table/TableToolbar.d.mts +9 -0
  109. package/dist/atom/Table/TableToolbar.d.ts +9 -0
  110. package/dist/atom/Table/TableToolbar.js +114 -0
  111. package/dist/atom/Table/TableToolbar.mjs +10 -0
  112. package/dist/atom/Table/__tests__/Table.test.d.mts +2 -0
  113. package/dist/atom/Table/__tests__/Table.test.d.ts +2 -0
  114. package/dist/atom/Table/__tests__/Table.test.js +61133 -0
  115. package/dist/atom/Table/__tests__/Table.test.mjs +59522 -0
  116. package/dist/atom/TableAccordion/index.d.mts +17 -0
  117. package/dist/atom/TableAccordion/index.d.ts +17 -0
  118. package/dist/atom/TableAccordion/index.js +91 -0
  119. package/dist/atom/TableAccordion/index.mjs +9 -0
  120. package/dist/atom/TableToolbar/index.d.mts +23 -0
  121. package/dist/atom/TableToolbar/index.d.ts +23 -0
  122. package/dist/atom/TableToolbar/index.js +114 -0
  123. package/dist/atom/TableToolbar/index.mjs +9 -0
  124. package/dist/atom/Tag/Tag.d.mts +6 -0
  125. package/dist/atom/Tag/Tag.d.ts +6 -0
  126. package/dist/atom/Tag/Tag.js +108 -0
  127. package/dist/atom/Tag/Tag.mjs +9 -0
  128. package/dist/atom/Tooltip/Tooltip.d.mts +12 -0
  129. package/dist/atom/Tooltip/Tooltip.d.ts +12 -0
  130. package/dist/atom/Tooltip/Tooltip.js +97 -0
  131. package/dist/atom/Tooltip/Tooltip.mjs +9 -0
  132. package/dist/chunk-2EBPXGRY.mjs +65 -0
  133. package/dist/chunk-2PIFDGVK.mjs +420 -0
  134. package/dist/chunk-35KDS27M.mjs +618 -0
  135. package/dist/chunk-3S4X3YO2.mjs +64 -0
  136. package/dist/chunk-3XUHGVYA.mjs +77 -0
  137. package/dist/chunk-4JX54OKI.mjs +627 -0
  138. package/dist/chunk-4VZB2KR2.mjs +51 -0
  139. package/dist/chunk-5HF6Y37C.mjs +642 -0
  140. package/dist/chunk-5OGQ4YIR.mjs +238 -0
  141. package/dist/chunk-6FCSXN7R.mjs +388 -0
  142. package/dist/chunk-7W72LPSU.mjs +66 -0
  143. package/dist/chunk-A66QDQHK.mjs +627 -0
  144. package/dist/chunk-ABLIL47F.mjs +618 -0
  145. package/dist/chunk-AEPDEUGY.mjs +627 -0
  146. package/dist/chunk-AF2RKLH6.mjs +77 -0
  147. package/dist/chunk-AFLEGUF3.mjs +232 -0
  148. package/dist/chunk-APCEITHQ.mjs +232 -0
  149. package/dist/chunk-AVQBFGBT.mjs +141 -0
  150. package/dist/chunk-B5BOBELW.mjs +213 -0
  151. package/dist/chunk-BQ4PVLJ4.mjs +262 -0
  152. package/dist/chunk-D3N7VFER.mjs +73 -0
  153. package/dist/{chunk-OMYHSSPQ.mjs → chunk-DBNLBCQK.mjs} +5 -5
  154. package/dist/chunk-DLLT6V65.mjs +141 -0
  155. package/dist/chunk-DOQQRYTS.mjs +73 -0
  156. package/dist/chunk-DSVR2DVF.mjs +660 -0
  157. package/dist/chunk-DXUPULDI.mjs +424 -0
  158. package/dist/chunk-E465D6OH.mjs +644 -0
  159. package/dist/chunk-E4FCLHYA.mjs +678 -0
  160. package/dist/chunk-ENQN5BAN.mjs +225 -0
  161. package/dist/chunk-F6VMSH4N.mjs +79 -0
  162. package/dist/chunk-FKGGN3FA.mjs +412 -0
  163. package/dist/chunk-GFTO2N3Q.mjs +432 -0
  164. package/dist/chunk-GM6H6RPJ.mjs +232 -0
  165. package/dist/chunk-GU5F7Z7I.mjs +681 -0
  166. package/dist/chunk-HF3VJBMY.mjs +244 -0
  167. package/dist/{chunk-ME35H7QC.mjs → chunk-HISCHZ5H.mjs} +4 -4
  168. package/dist/chunk-HWQBE6PT.mjs +99 -0
  169. package/dist/chunk-HXM657YW.mjs +115 -0
  170. package/dist/chunk-I5VHKSQR.mjs +64 -0
  171. package/dist/chunk-ICSZZNTY.mjs +384 -0
  172. package/dist/chunk-IWO2Y5QX.mjs +89 -0
  173. package/dist/chunk-IZGLD7U3.mjs +667 -0
  174. package/dist/chunk-J7X2PZG6.mjs +232 -0
  175. package/dist/chunk-JUXBLRMQ.mjs +50 -0
  176. package/dist/chunk-JXFSGADI.mjs +678 -0
  177. package/dist/chunk-KGKRSR6D.mjs +388 -0
  178. package/dist/chunk-KQKNFGWZ.mjs +388 -0
  179. package/dist/chunk-LCH4DXJY.mjs +92 -0
  180. package/dist/chunk-LCXU3K57.mjs +232 -0
  181. package/dist/chunk-LRN4XOIR.mjs +71 -0
  182. package/dist/chunk-LROMXY35.mjs +116 -0
  183. package/dist/chunk-LUNPHYAR.mjs +681 -0
  184. package/dist/chunk-LVOTEPLC.mjs +64 -0
  185. package/dist/chunk-M2ZM3X5Y.mjs +56 -0
  186. package/dist/chunk-M4MIYHAV.mjs +43 -0
  187. package/dist/chunk-M7F7DOC4.mjs +41 -0
  188. package/dist/chunk-MHWFVML4.mjs +115 -0
  189. package/dist/chunk-MLCMZRUC.mjs +50 -0
  190. package/dist/chunk-MNARBWAJ.mjs +47 -0
  191. package/dist/chunk-MPTVYTYS.mjs +0 -0
  192. package/dist/chunk-MQFW3LZR.mjs +111 -0
  193. package/dist/chunk-N2WTNCQU.mjs +66 -0
  194. package/dist/chunk-N355RJGH.mjs +141 -0
  195. package/dist/chunk-N3YFQDW7.mjs +77 -0
  196. package/dist/chunk-N4DPPZVJ.mjs +269 -0
  197. package/dist/chunk-NGCBOOIE.mjs +225 -0
  198. package/dist/chunk-NWQQYJSP.mjs +688 -0
  199. package/dist/chunk-NYQV556V.mjs +667 -0
  200. package/dist/chunk-O5C3355V.mjs +246 -0
  201. package/dist/chunk-OCP43S7U.mjs +241 -0
  202. package/dist/chunk-OHLFRULE.mjs +432 -0
  203. package/dist/chunk-PLO46EKV.mjs +65 -0
  204. package/dist/chunk-PQ3B2FEB.mjs +249 -0
  205. package/dist/chunk-PSBEYGD4.mjs +618 -0
  206. package/dist/chunk-PWIBJI6Z.mjs +115 -0
  207. package/dist/chunk-Q5KPXEH5.mjs +223 -0
  208. package/dist/chunk-QC34HHAY.mjs +57 -0
  209. package/dist/chunk-QKTMWS4J.mjs +43 -0
  210. package/dist/chunk-QVWV36BK.mjs +73 -0
  211. package/dist/chunk-QWK3MYDM.mjs +64 -0
  212. package/dist/chunk-RE44YAMD.mjs +47 -0
  213. package/dist/chunk-RH6DAYBU.mjs +369 -0
  214. package/dist/chunk-RSSEJENT.mjs +269 -0
  215. package/dist/chunk-SJBS5QCJ.mjs +225 -0
  216. package/dist/chunk-SWRFCTJW.mjs +77 -0
  217. package/dist/chunk-T4XNCAIB.mjs +231 -0
  218. package/dist/chunk-TCX5IFQ4.mjs +627 -0
  219. package/dist/chunk-TSAUBT2F.mjs +74 -0
  220. package/dist/chunk-U7Q7ILSE.mjs +690 -0
  221. package/dist/chunk-UHTUJJH7.mjs +112 -0
  222. package/dist/chunk-UOHYCMUS.mjs +53 -0
  223. package/dist/chunk-UQJ3BDM4.mjs +141 -0
  224. package/dist/chunk-UQZBL3F7.mjs +0 -0
  225. package/dist/chunk-UQZNUEZE.mjs +64 -0
  226. package/dist/chunk-URGYNKJM.mjs +229 -0
  227. package/dist/chunk-UTMZY37A.mjs +141 -0
  228. package/dist/chunk-UUEPD2FH.mjs +141 -0
  229. package/dist/chunk-V3CHJHUX.mjs +424 -0
  230. package/dist/chunk-VQOUJQIF.mjs +249 -0
  231. package/dist/chunk-VY3QH43W.mjs +6 -0
  232. package/dist/chunk-W2N3AWY6.mjs +80 -0
  233. package/dist/chunk-WUVS6S7N.mjs +119 -0
  234. package/dist/chunk-WZS2K7X3.mjs +688 -0
  235. package/dist/chunk-X76GNSBB.mjs +87 -0
  236. package/dist/chunk-XG7CZXBW.mjs +244 -0
  237. package/dist/chunk-XXKIBYXD.mjs +109 -0
  238. package/dist/chunk-XXTUVMAY.mjs +51 -0
  239. package/dist/chunk-Y3BIY4DW.mjs +618 -0
  240. package/dist/chunk-Y7FP6ZMW.mjs +225 -0
  241. package/dist/chunk-YELLXCMY.mjs +265 -0
  242. package/dist/chunk-YQEEM26W.mjs +232 -0
  243. package/dist/chunk-ZGFE3OPJ.mjs +678 -0
  244. package/dist/chunk-ZMJ3KDDY.mjs +618 -0
  245. package/dist/chunk-ZTRM4HZJ.mjs +53 -0
  246. package/dist/chunk-ZYPWQ53U.mjs +6 -0
  247. package/dist/dist-U2IPN4FB.mjs +567 -0
  248. package/dist/index.d.mts +20 -2
  249. package/dist/index.d.ts +20 -2
  250. package/dist/index.js +2820 -13
  251. package/dist/index.mjs +59 -5
  252. package/dist/magic-string.es-XOWQCRDO.mjs +1311 -0
  253. package/dist/molecules/UserProfile/UserProfile.d.mts +23 -0
  254. package/dist/molecules/UserProfile/UserProfile.d.ts +23 -0
  255. package/dist/molecules/UserProfile/UserProfile.js +243 -0
  256. package/dist/molecules/UserProfile/UserProfile.mjs +11 -0
  257. package/dist/styles.css +1809 -1366
  258. package/dist/types-CA0Wby2L.d.mts +67 -0
  259. package/dist/types-CA0Wby2L.d.ts +67 -0
  260. package/dist/types-CncMmuJM.d.mts +44 -0
  261. package/dist/types-CncMmuJM.d.ts +44 -0
  262. package/dist/types-D4MD2w3_.d.mts +9 -0
  263. package/dist/types-D4MD2w3_.d.ts +9 -0
  264. package/dist/types-D4fdeMWQ.d.mts +62 -0
  265. package/dist/types-D4fdeMWQ.d.ts +62 -0
  266. package/dist/types-mhQmqhsR.d.mts +10 -0
  267. package/dist/types-mhQmqhsR.d.ts +10 -0
  268. package/package.json +9 -15
  269. /package/dist/{Button.d.mts → atom/Button/Button.d.mts} +0 -0
  270. /package/dist/{Button.d.ts → atom/Button/Button.d.ts} +0 -0
  271. /package/dist/{Checkbox.d.mts → atom/Checkbox/Checkbox.d.mts} +0 -0
  272. /package/dist/{Checkbox.d.ts → atom/Checkbox/Checkbox.d.ts} +0 -0
  273. /package/dist/{chunk-FUJQIYOF.mjs → chunk-FWCSY2DS.mjs} +0 -0
@@ -0,0 +1,1465 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __defProps = Object.defineProperties;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
+ var __getProtoOf = Object.getPrototypeOf;
10
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
11
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
+ var __spreadValues = (a, b) => {
14
+ for (var prop in b || (b = {}))
15
+ if (__hasOwnProp.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ if (__getOwnPropSymbols)
18
+ for (var prop of __getOwnPropSymbols(b)) {
19
+ if (__propIsEnum.call(b, prop))
20
+ __defNormalProp(a, prop, b[prop]);
21
+ }
22
+ return a;
23
+ };
24
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
+ var __objRest = (source, exclude) => {
26
+ var target = {};
27
+ for (var prop in source)
28
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
29
+ target[prop] = source[prop];
30
+ if (source != null && __getOwnPropSymbols)
31
+ for (var prop of __getOwnPropSymbols(source)) {
32
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
33
+ target[prop] = source[prop];
34
+ }
35
+ return target;
36
+ };
37
+ var __export = (target, all) => {
38
+ for (var name in all)
39
+ __defProp(target, name, { get: all[name], enumerable: true });
40
+ };
41
+ var __copyProps = (to, from, except, desc) => {
42
+ if (from && typeof from === "object" || typeof from === "function") {
43
+ for (let key of __getOwnPropNames(from))
44
+ if (!__hasOwnProp.call(to, key) && key !== except)
45
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
46
+ }
47
+ return to;
48
+ };
49
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
50
+ // If the importer is in node compatibility mode or this is not an ESM
51
+ // file that has been converted to a CommonJS file using a Babel-
52
+ // compatible transform (i.e. "__esModule" has not been set), then set
53
+ // "default" to the CommonJS "module.exports" for node compatibility.
54
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
55
+ mod
56
+ ));
57
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
58
+
59
+ // src/atom/RangePicker/RangePicker.tsx
60
+ var RangePicker_exports = {};
61
+ __export(RangePicker_exports, {
62
+ RangePicker: () => CustomRangePicker,
63
+ default: () => RangePicker_default
64
+ });
65
+ module.exports = __toCommonJS(RangePicker_exports);
66
+ var import_react3 = require("react");
67
+ var import_clsx2 = __toESM(require("clsx"));
68
+ var import_dayjs = __toESM(require("dayjs"));
69
+
70
+ // src/atom/RangePicker/Chevron.tsx
71
+ var React = __toESM(require("react"));
72
+ var import_jsx_runtime = require("react/jsx-runtime");
73
+ var Chevron = React.memo(
74
+ (_a) => {
75
+ var _b = _a, { size = "normal", color = "black", className } = _b, rest = __objRest(_b, ["size", "color", "className"]);
76
+ const getSize = (size2) => {
77
+ switch (size2) {
78
+ case "small":
79
+ 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";
80
+ case "normal":
81
+ 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";
82
+ default:
83
+ 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";
84
+ }
85
+ };
86
+ const getContainer = (size2) => {
87
+ switch (size2) {
88
+ case "small":
89
+ return 16;
90
+ case "medium":
91
+ return 20;
92
+ case "normal":
93
+ return 24;
94
+ default:
95
+ return 24;
96
+ }
97
+ };
98
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
99
+ "svg",
100
+ __spreadProps(__spreadValues({
101
+ xmlns: "http://www.w3.org/2000/svg",
102
+ width: getContainer(size),
103
+ height: getContainer(size),
104
+ fill: "none",
105
+ viewBox: `0 0 ${getContainer(size)} ${getContainer(size)}`,
106
+ className
107
+ }, rest), {
108
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: color, d: getSize(size) })
109
+ })
110
+ );
111
+ }
112
+ );
113
+
114
+ // src/atom/RangePicker/RangePicker.module.scss
115
+ var RangePicker_module_default = { "range_start": "RangePicker-module__range_start___hGQp-", "range_end": "RangePicker-module__range_end___JJNib" };
116
+
117
+ // src/atom/Select/Select.tsx
118
+ var import_react2 = require("react");
119
+ var import_clsx = __toESM(require("clsx"));
120
+
121
+ // src/icons/Chevron.tsx
122
+ var React2 = __toESM(require("react"));
123
+ var import_jsx_runtime2 = require("react/jsx-runtime");
124
+ var Chevron2 = React2.memo(
125
+ (_a) => {
126
+ var _b = _a, { size = 16, color = "#6b7280", className } = _b, rest = __objRest(_b, ["size", "color", "className"]);
127
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
128
+ "svg",
129
+ __spreadProps(__spreadValues({
130
+ xmlns: "http://www.w3.org/2000/svg",
131
+ width: size,
132
+ height: size,
133
+ fill: "none",
134
+ viewBox: "0 0 16 16",
135
+ className
136
+ }, rest), {
137
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
138
+ "path",
139
+ {
140
+ fill: color,
141
+ 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"
142
+ }
143
+ )
144
+ })
145
+ );
146
+ }
147
+ );
148
+ Chevron2.displayName = "Chevron";
149
+
150
+ // src/icons/CrossV2.tsx
151
+ var React3 = __toESM(require("react"));
152
+ var import_jsx_runtime3 = require("react/jsx-runtime");
153
+ var CrossV2 = React3.memo(
154
+ (_a) => {
155
+ var _b = _a, { size = 16, color = "#111827", className } = _b, rest = __objRest(_b, ["size", "color", "className"]);
156
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
157
+ "svg",
158
+ __spreadProps(__spreadValues({
159
+ xmlns: "http://www.w3.org/2000/svg",
160
+ width: size,
161
+ height: size,
162
+ fill: "none",
163
+ viewBox: "0 0 20 20"
164
+ }, rest), {
165
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
166
+ "path",
167
+ {
168
+ fill: color,
169
+ 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"
170
+ }
171
+ )
172
+ })
173
+ );
174
+ }
175
+ );
176
+ CrossV2.displayName = "CrossV2";
177
+
178
+ // src/icons/Lock.tsx
179
+ var import_react = __toESM(require("react"));
180
+ var import_jsx_runtime4 = require("react/jsx-runtime");
181
+ var Lock = import_react.default.memo((_a) => {
182
+ var _b = _a, { size = 16, color = "#000" } = _b, rest = __objRest(_b, ["size", "color"]);
183
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
184
+ "svg",
185
+ __spreadProps(__spreadValues({
186
+ xmlns: "http://www.w3.org/2000/svg",
187
+ width: size,
188
+ height: size,
189
+ fill: "none",
190
+ viewBox: "0 0 16 16"
191
+ }, rest), {
192
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
193
+ "path",
194
+ {
195
+ fill: color,
196
+ 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"
197
+ }
198
+ )
199
+ })
200
+ );
201
+ });
202
+
203
+ // src/atom/Tooltip/Tooltip.tsx
204
+ var import_antd = require("antd");
205
+
206
+ // src/atom/Tooltip/Tooltip.module.scss
207
+ var Tooltip_module_default = { "light": "Tooltip-module__light___H5oCc" };
208
+
209
+ // src/atom/Tooltip/Tooltip.tsx
210
+ var import_jsx_runtime5 = require("react/jsx-runtime");
211
+ var Tooltip = (_a) => {
212
+ var _b = _a, {
213
+ children,
214
+ title = "",
215
+ placement = "top",
216
+ color = "#1F2937",
217
+ className,
218
+ mode = "dark"
219
+ } = _b, rest = __objRest(_b, [
220
+ "children",
221
+ "title",
222
+ "placement",
223
+ "color",
224
+ "className",
225
+ "mode"
226
+ ]);
227
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
228
+ import_antd.Tooltip,
229
+ __spreadProps(__spreadValues({
230
+ className,
231
+ color,
232
+ title,
233
+ placement,
234
+ overlayClassName: mode === "light" ? Tooltip_module_default.light : ""
235
+ }, rest), {
236
+ children
237
+ })
238
+ );
239
+ };
240
+ Tooltip.displayName = "Tooltip";
241
+ var Tooltip_default = Tooltip;
242
+
243
+ // src/atom/LoadingSpinner/LoadingSpinner.tsx
244
+ var import_icons = require("@ant-design/icons");
245
+ var import_antd2 = require("antd");
246
+
247
+ // src/atom/LoadingSpinner/LoadingSpinner.module.scss
248
+ var LoadingSpinner_module_default = { "spinnerContainer": "LoadingSpinner-module__spinnerContainer___DiPLf" };
249
+
250
+ // src/atom/LoadingSpinner/LoadingSpinner.tsx
251
+ var import_jsx_runtime6 = require("react/jsx-runtime");
252
+ var sizeMapping = {
253
+ xs: 16,
254
+ small: 24,
255
+ medium: 36,
256
+ large: 48
257
+ };
258
+ var LoadingSpinner = (_a) => {
259
+ var _b = _a, { size = "small", color = "#ec5d25" } = _b, rest = __objRest(_b, ["size", "color"]);
260
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", __spreadProps(__spreadValues({ className: LoadingSpinner_module_default.spinnerContainer }, rest), { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
261
+ import_antd2.Spin,
262
+ {
263
+ indicator: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
264
+ import_icons.LoadingOutlined,
265
+ {
266
+ style: { fontSize: sizeMapping[size], color },
267
+ spin: true
268
+ }
269
+ )
270
+ }
271
+ ) }));
272
+ };
273
+ LoadingSpinner.displayName = "LoadingSpinner";
274
+ var LoadingSpinner_default = LoadingSpinner;
275
+
276
+ // src/atom/Select/Select.tsx
277
+ var import_jsx_runtime7 = require("react/jsx-runtime");
278
+ var InputWrapper = (0, import_react2.memo)(({ children, disabled, disabledTooltip }) => {
279
+ if (disabled && disabledTooltip)
280
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Tooltip_default, { title: disabledTooltip, children });
281
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children });
282
+ });
283
+ var OptionItem = (0, import_react2.memo)(({
284
+ option,
285
+ index,
286
+ isSelected,
287
+ isHighlighted,
288
+ experience,
289
+ size,
290
+ optionClassName,
291
+ onSelectHandler,
292
+ onMouseEnterHandler
293
+ }) => {
294
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
295
+ "div",
296
+ {
297
+ onClick: () => onSelectHandler(option),
298
+ onMouseEnter: () => onMouseEnterHandler(index),
299
+ className: (0, import_clsx.default)(
300
+ "tw-transition-all tw-duration-150",
301
+ { "tw-typography-body2": size !== "small" },
302
+ { "tw-typography-caption1": size === "small" },
303
+ optionClassName
304
+ ),
305
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
306
+ "div",
307
+ {
308
+ className: (0, import_clsx.default)(
309
+ "tw-px-4 tw-cursor-pointer tw-py-2 tw-mx-0.5 tw-rounded-xl",
310
+ isSelected ? experience === "personal" ? "tw-bg-[#f1e8fa]" : "tw-bg-[#fff1e1]" : isHighlighted ? "tw-bg-[#f3f4f6] tw-text-gray-900" : "tw-text-gray-900 hover:tw-bg-[#1118270a]"
311
+ ),
312
+ children: option.label
313
+ }
314
+ )
315
+ }
316
+ );
317
+ });
318
+ var Select = ({
319
+ label,
320
+ mandatory = false,
321
+ error = false,
322
+ options = [],
323
+ valueSelected = "",
324
+ // Keep for backward compatibility
325
+ value: _valueProp,
326
+ // Rename to avoid potential conflicts with native value attribute
327
+ onChange,
328
+ onSearch,
329
+ isLoading = false,
330
+ disabled = false,
331
+ disabledTooltip = "",
332
+ className = "",
333
+ dropdownClassName = "",
334
+ optionClassName = "",
335
+ style = {},
336
+ showDisplayValue = false,
337
+ // New prop to show displayValue instead of label
338
+ allowClear = true,
339
+ enableSearch = true,
340
+ doubleCharSearch = false,
341
+ id,
342
+ name,
343
+ tabIndex,
344
+ // Add tabIndex prop
345
+ // Additional styling props
346
+ size = "default",
347
+ // 'small', 'default', 'large'
348
+ variant = "default",
349
+ // 'default', 'filled', 'outlined'
350
+ wrapperClassName = "",
351
+ inputClassName = "",
352
+ // Custom class for input element specifically
353
+ labelClassName = "",
354
+ // Custom class for label element specifically
355
+ height = "tw-h-12",
356
+ // Custom height
357
+ experience = "business"
358
+ }) => {
359
+ const normalizeValue = (0, import_react2.useCallback)(
360
+ (val) => {
361
+ if (val === null || val === void 0) return "";
362
+ return String(val);
363
+ },
364
+ []
365
+ );
366
+ const validatedOptions = (0, import_react2.useMemo)(() => {
367
+ if (!Array.isArray(options)) return [];
368
+ return options.filter(
369
+ (opt) => opt && typeof opt === "object" && opt.value !== void 0 && opt.value !== null && opt.label !== void 0
370
+ );
371
+ }, [options]);
372
+ const [isOpen, setIsOpen] = (0, import_react2.useState)(false);
373
+ const [isFocused, setIsFocused] = (0, import_react2.useState)(false);
374
+ const [searchTerm, setSearchTerm] = (0, import_react2.useState)("");
375
+ const [isHovering, setIsHovering] = (0, import_react2.useState)(false);
376
+ const [highlightedIndex, setHighlightedIndex] = (0, import_react2.useState)(-1);
377
+ const [selectedValue, setSelectedValue] = (0, import_react2.useState)(() => {
378
+ const initialValue = valueSelected;
379
+ if (initialValue === null || initialValue === void 0) return "";
380
+ return String(initialValue);
381
+ });
382
+ const inputRef = (0, import_react2.useRef)(null);
383
+ const inputValueRef = (0, import_react2.useRef)("");
384
+ const dropdownRef = (0, import_react2.useRef)(null);
385
+ const optionRefs = (0, import_react2.useRef)([]);
386
+ const optionListRef = (0, import_react2.useRef)(null);
387
+ const blurTimeoutRef = (0, import_react2.useRef)(null);
388
+ const hoverTimeoutRef = (0, import_react2.useRef)(null);
389
+ const isActive = isFocused || Boolean(selectedValue) || Boolean(valueSelected) || Boolean(searchTerm);
390
+ const sizeClasses = (0, import_react2.useMemo)(() => {
391
+ switch (size) {
392
+ case "small":
393
+ return {
394
+ input: "tw-h-6 tw-typography-caption1Bold !tw-rounded-lg",
395
+ padding: "tw-px-2 tw-py-1",
396
+ labelActive: "tw-top-0.5 tw-typography-caption2",
397
+ labelInactive: "tw-top-1.5 tw-typography-caption3"
398
+ };
399
+ case "medium":
400
+ return {
401
+ input: "tw-h-10 tw-px-4 tw-typography-body2",
402
+ padding: label ? "tw-pt-4 tw-pb-1" : "tw-py-2",
403
+ labelActive: "tw-top-1 tw-typography-caption3",
404
+ labelInactive: "tw-top-2.5 tw-typography-body2"
405
+ };
406
+ case "large":
407
+ return {
408
+ input: "tw-h-16 tw-px-5 tw-typography-bodyLarge",
409
+ padding: label ? "tw-pt-8 tw-pb-4" : "tw-py-5",
410
+ labelActive: "tw-top-1 tw-typography-caption2",
411
+ labelInactive: "tw-top-5 tw-typography-body1"
412
+ };
413
+ default:
414
+ return {
415
+ input: height + " tw-px-4 tw-typography-bodyLarge",
416
+ padding: label ? "tw-pt-6 tw-pb-3" : "tw-py-3",
417
+ labelActive: "tw-top-1 tw-typography-caption3",
418
+ labelInactive: "tw-top-3.5 tw-typography-body2"
419
+ };
420
+ }
421
+ }, [size, label, height]);
422
+ const variantClasses = (0, import_react2.useMemo)(() => {
423
+ switch (variant) {
424
+ case "filled":
425
+ return "tw-bg-gray-50 tw-border-transparent";
426
+ case "outlined":
427
+ return "tw-bg-transparent tw-border-2";
428
+ default:
429
+ return " tw-border";
430
+ }
431
+ }, [variant]);
432
+ const handleBlur = (0, import_react2.useCallback)(() => {
433
+ blurTimeoutRef.current = setTimeout(() => {
434
+ setIsOpen(false);
435
+ setSearchTerm("");
436
+ setHighlightedIndex(-1);
437
+ blurTimeoutRef.current = null;
438
+ setIsFocused(false);
439
+ }, 150);
440
+ }, []);
441
+ const handleSearchChange = (0, import_react2.useCallback)(
442
+ (e) => {
443
+ var _a;
444
+ const searchValue = doubleCharSearch ? e.target.value.slice(0, 2) || "" : e.target.value;
445
+ if (doubleCharSearch) {
446
+ setSearchTerm(searchValue);
447
+ } else {
448
+ setSearchTerm(searchValue);
449
+ }
450
+ setIsOpen(true);
451
+ setHighlightedIndex(-1);
452
+ if (onSearch && typeof onSearch === "function") {
453
+ onSearch(searchValue);
454
+ }
455
+ (_a = optionListRef == null ? void 0 : optionListRef.current) == null ? void 0 : _a.scrollTo({
456
+ top: 0,
457
+ behavior: "smooth"
458
+ });
459
+ },
460
+ [doubleCharSearch, onSearch]
461
+ );
462
+ const handleOptionSelect = (0, import_react2.useCallback)(
463
+ (option) => {
464
+ var _a;
465
+ if (blurTimeoutRef.current) {
466
+ clearTimeout(blurTimeoutRef.current);
467
+ blurTimeoutRef.current = null;
468
+ }
469
+ inputValueRef.current = option.label;
470
+ const normalizedValue = normalizeValue(option.value);
471
+ setSelectedValue(normalizedValue);
472
+ setSearchTerm("");
473
+ setIsOpen(false);
474
+ if (enableSearch) {
475
+ setIsFocused(false);
476
+ }
477
+ setIsHovering(false);
478
+ if (onChange) onChange(option.value);
479
+ if (enableSearch) (_a = inputRef.current) == null ? void 0 : _a.blur();
480
+ },
481
+ [normalizeValue, onChange, enableSearch]
482
+ );
483
+ const handleClear = (0, import_react2.useCallback)(
484
+ (e) => {
485
+ var _a;
486
+ inputValueRef.current = "";
487
+ e.stopPropagation();
488
+ e.preventDefault();
489
+ setSelectedValue("");
490
+ setSearchTerm("");
491
+ if (enableSearch) {
492
+ setIsOpen(true);
493
+ setIsFocused(true);
494
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
495
+ } else {
496
+ setIsOpen(false);
497
+ setIsFocused(false);
498
+ }
499
+ if (onChange) onChange(null);
500
+ },
501
+ [onChange, enableSearch]
502
+ );
503
+ (0, import_react2.useEffect)(() => {
504
+ if (!validatedOptions.length) {
505
+ setSelectedValue("");
506
+ setSearchTerm("");
507
+ inputValueRef.current = "";
508
+ }
509
+ }, [validatedOptions.length]);
510
+ (0, import_react2.useEffect)(() => {
511
+ const externalValue = _valueProp !== void 0 ? _valueProp : valueSelected;
512
+ const newValue = normalizeValue(externalValue);
513
+ setSelectedValue((prevValue) => {
514
+ const prevNormalized = normalizeValue(prevValue);
515
+ return prevNormalized !== newValue ? newValue : prevValue;
516
+ });
517
+ }, [valueSelected, _valueProp, normalizeValue]);
518
+ (0, import_react2.useEffect)(() => {
519
+ const handleClickOutside = (event) => {
520
+ if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
521
+ if (blurTimeoutRef.current) {
522
+ clearTimeout(blurTimeoutRef.current);
523
+ blurTimeoutRef.current = null;
524
+ }
525
+ setIsOpen(false);
526
+ setIsFocused(false);
527
+ setSearchTerm("");
528
+ setHighlightedIndex(-1);
529
+ }
530
+ };
531
+ document.addEventListener("mousedown", handleClickOutside);
532
+ return () => {
533
+ document.removeEventListener("mousedown", handleClickOutside);
534
+ if (blurTimeoutRef.current) {
535
+ clearTimeout(blurTimeoutRef.current);
536
+ }
537
+ if (hoverTimeoutRef.current) {
538
+ clearTimeout(hoverTimeoutRef.current);
539
+ }
540
+ };
541
+ }, []);
542
+ const getDisplayValue = (0, import_react2.useCallback)(() => {
543
+ if (selectedValue && (validatedOptions == null ? void 0 : validatedOptions.length) > 0) {
544
+ const selected = validatedOptions.find(
545
+ (opt) => normalizeValue(opt.value) === normalizeValue(selectedValue)
546
+ );
547
+ if (selected) {
548
+ return showDisplayValue && selected.displayValue ? selected.displayValue : selected.label;
549
+ }
550
+ }
551
+ if (selectedValue && (!validatedOptions || validatedOptions.length === 0)) {
552
+ return selectedValue;
553
+ }
554
+ return "";
555
+ }, [selectedValue, validatedOptions, showDisplayValue, normalizeValue]);
556
+ const displayValue = (0, import_react2.useMemo)(() => getDisplayValue(), [getDisplayValue]);
557
+ const inputClasses = (0, import_react2.useMemo)(() => {
558
+ return (0, import_clsx.default)(
559
+ "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",
560
+ sizeClasses.input,
561
+ sizeClasses.padding,
562
+ variantClasses,
563
+ {
564
+ "tw-bg-white": valueSelected || displayValue || isFocused,
565
+ "tw-bg-color-gray-5": !valueSelected || !displayValue,
566
+ "!tw-bg-[#F8F7F6] tw-cursor-not-allowed tw-pointer-events-none": disabled
567
+ },
568
+ !label && "tw-flex tw-items-center",
569
+ {
570
+ "!tw-border-color-primary": isFocused && experience === "business"
571
+ },
572
+ {
573
+ "!tw-border-[#804D7B]": isFocused && experience === "personal"
574
+ },
575
+ error ? "!tw-border-color-text-critical " : "tw-border-[#EBE3DD] hover:tw-border-[#C5B7AC]",
576
+ "focus:tw-shadow-sm focus:tw-ring-offset-1",
577
+ className,
578
+ inputClassName
579
+ );
580
+ }, [sizeClasses, variantClasses, valueSelected, displayValue, isFocused, disabled, label, experience, error, className, inputClassName]);
581
+ const filteredOptions = (0, import_react2.useMemo)(() => {
582
+ var _a;
583
+ if (!enableSearch) {
584
+ return validatedOptions;
585
+ }
586
+ (_a = dropdownRef.current) == null ? void 0 : _a.scrollTo(0, 0);
587
+ const updatedFilteredOptions = validatedOptions.filter((option) => {
588
+ var _a2;
589
+ return (_a2 = option == null ? void 0 : option.label) == null ? void 0 : _a2.toLowerCase().includes(searchTerm == null ? void 0 : searchTerm.toLowerCase());
590
+ });
591
+ return updatedFilteredOptions;
592
+ }, [validatedOptions, searchTerm, enableSearch]);
593
+ const getSelectedOptionIndex = (0, import_react2.useCallback)(() => {
594
+ if (!selectedValue || !filteredOptions.length) {
595
+ return 0;
596
+ }
597
+ const index = filteredOptions.findIndex(
598
+ (option) => normalizeValue(option.value) === normalizeValue(selectedValue)
599
+ );
600
+ return index >= 0 ? index : 0;
601
+ }, [selectedValue, filteredOptions, normalizeValue]);
602
+ const handleInputInteraction = (0, import_react2.useCallback)(
603
+ (_e) => {
604
+ var _a;
605
+ if (blurTimeoutRef.current) {
606
+ clearTimeout(blurTimeoutRef.current);
607
+ blurTimeoutRef.current = null;
608
+ }
609
+ if (isOpen) {
610
+ setIsOpen(false);
611
+ setIsFocused(false);
612
+ setSearchTerm("");
613
+ setHighlightedIndex(-1);
614
+ (_a = inputRef.current) == null ? void 0 : _a.blur();
615
+ return;
616
+ }
617
+ setIsFocused(true);
618
+ setIsOpen(true);
619
+ setHighlightedIndex(getSelectedOptionIndex());
620
+ if (inputRef.current) {
621
+ inputRef.current.focus();
622
+ }
623
+ },
624
+ [isOpen, getSelectedOptionIndex]
625
+ );
626
+ const handleKeyDown = (0, import_react2.useCallback)(
627
+ (e) => {
628
+ var _a;
629
+ if (!isOpen) return;
630
+ switch (e.key) {
631
+ case "ArrowDown":
632
+ e.preventDefault();
633
+ setHighlightedIndex((prev) => {
634
+ const nextIndex = prev < filteredOptions.length - 1 ? prev + 1 : prev;
635
+ return nextIndex;
636
+ });
637
+ break;
638
+ case "ArrowUp":
639
+ e.preventDefault();
640
+ setHighlightedIndex((prev) => {
641
+ const nextIndex = prev > 0 ? prev - 1 : prev;
642
+ return nextIndex;
643
+ });
644
+ break;
645
+ case "Enter":
646
+ e.preventDefault();
647
+ if (highlightedIndex >= 0 && filteredOptions[highlightedIndex]) {
648
+ handleOptionSelect(filteredOptions[highlightedIndex]);
649
+ }
650
+ break;
651
+ case "Escape":
652
+ e.preventDefault();
653
+ setIsOpen(false);
654
+ setIsFocused(false);
655
+ setSearchTerm("");
656
+ setHighlightedIndex(-1);
657
+ (_a = inputRef.current) == null ? void 0 : _a.blur();
658
+ break;
659
+ default:
660
+ break;
661
+ }
662
+ },
663
+ [isOpen, highlightedIndex, filteredOptions, handleOptionSelect]
664
+ );
665
+ (0, import_react2.useEffect)(() => {
666
+ if (highlightedIndex >= 0 && optionRefs.current[highlightedIndex]) {
667
+ optionRefs.current[highlightedIndex].scrollIntoView({
668
+ block: "nearest",
669
+ behavior: "smooth"
670
+ });
671
+ }
672
+ }, [highlightedIndex]);
673
+ (0, import_react2.useEffect)(() => {
674
+ optionRefs.current = [];
675
+ }, [filteredOptions.length]);
676
+ const handleMouseEnter = (0, import_react2.useCallback)(() => {
677
+ if (hoverTimeoutRef.current) {
678
+ clearTimeout(hoverTimeoutRef.current);
679
+ }
680
+ if (!isHovering) {
681
+ setIsHovering(true);
682
+ }
683
+ }, [isHovering]);
684
+ const handleMouseLeave = (0, import_react2.useCallback)(() => {
685
+ hoverTimeoutRef.current = setTimeout(() => {
686
+ setIsHovering(false);
687
+ }, 50);
688
+ }, []);
689
+ const handleChevronClick = (0, import_react2.useCallback)(
690
+ (e) => {
691
+ var _a;
692
+ e.preventDefault();
693
+ if (blurTimeoutRef.current) {
694
+ clearTimeout(blurTimeoutRef.current);
695
+ blurTimeoutRef.current = null;
696
+ }
697
+ if (isOpen) {
698
+ setIsOpen(false);
699
+ setIsFocused(false);
700
+ setSearchTerm("");
701
+ setHighlightedIndex(-1);
702
+ (_a = inputRef.current) == null ? void 0 : _a.blur();
703
+ } else {
704
+ if (inputRef.current) {
705
+ inputRef.current.focus();
706
+ }
707
+ handleInputInteraction();
708
+ }
709
+ },
710
+ [isOpen, handleInputInteraction]
711
+ );
712
+ const handleChevronMouseDown = (0, import_react2.useCallback)(
713
+ (e) => {
714
+ if (isHovering && selectedValue && allowClear) {
715
+ handleClear(e);
716
+ } else {
717
+ handleChevronClick(e);
718
+ }
719
+ },
720
+ [isHovering, selectedValue, allowClear, handleClear, handleChevronClick]
721
+ );
722
+ const handleOptionClick = (0, import_react2.useCallback)((option) => {
723
+ handleOptionSelect(option);
724
+ }, [handleOptionSelect]);
725
+ const handleOptionMouseEnter = (0, import_react2.useCallback)((index) => {
726
+ setHighlightedIndex(index);
727
+ }, []);
728
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(InputWrapper, { disabled, disabledTooltip, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
729
+ "div",
730
+ {
731
+ style,
732
+ className: (0, import_clsx.default)("tw-relative tw-w-full", wrapperClassName, {
733
+ "tw-cursor-not-allowed": disabled
734
+ }),
735
+ ref: dropdownRef,
736
+ onMouseEnter: handleMouseEnter,
737
+ onMouseLeave: handleMouseLeave,
738
+ children: [
739
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "tw-relative", children: [
740
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
741
+ "input",
742
+ {
743
+ ref: inputRef,
744
+ type: "text",
745
+ id,
746
+ name,
747
+ tabIndex,
748
+ autoComplete: "off",
749
+ autoCorrect: "off",
750
+ autoCapitalize: "off",
751
+ spellCheck: "false",
752
+ value: isFocused && enableSearch ? searchTerm : displayValue,
753
+ onChange: enableSearch ? handleSearchChange : void 0,
754
+ onClick: handleInputInteraction,
755
+ onKeyDown: handleKeyDown,
756
+ className: inputClasses,
757
+ readOnly: !isFocused || !enableSearch
758
+ }
759
+ ),
760
+ label && size !== "small" && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
761
+ "label",
762
+ {
763
+ htmlFor: id,
764
+ className: (0, import_clsx.default)(
765
+ "tw-absolute tw-left-[18px] tw-pointer-events-none tw-transition-all tw-duration-200 tw-ease-out tw-text-gray-500",
766
+ isActive ? sizeClasses.labelActive : sizeClasses.labelInactive,
767
+ error && "tw-text-color-text-critical",
768
+ labelClassName
769
+ ),
770
+ children: [
771
+ label,
772
+ mandatory && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "tw-text-color-text-critical tw-ml-1", children: "*" })
773
+ ]
774
+ }
775
+ ),
776
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
777
+ "div",
778
+ {
779
+ className: (0, import_clsx.default)(
780
+ "tw-absolute tw-right-3 tw--translate-y-1/2 tw-flex tw-items-center",
781
+ {
782
+ "!tw-right-[5px]": doubleCharSearch && !(isHovering && selectedValue && allowClear),
783
+ "tw-top-3 !tw-right-2": size === "small",
784
+ "tw-top-1/2": size !== "small"
785
+ }
786
+ ),
787
+ children: [
788
+ disabled && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "tw-absolute tw-right-0 -tw-top-2", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Lock, { size: 16 }) }),
789
+ isLoading ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(LoadingSpinner_default, { size: "xs" }) }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
790
+ "div",
791
+ {
792
+ className: (0, import_clsx.default)(
793
+ "tw-transition-all tw-duration-200 tw-cursor-pointer tw-flex tw-items-center",
794
+ // Only rotate chevron when open and not showing clear icon
795
+ isOpen && !(isHovering && selectedValue && allowClear) && "-tw-rotate-180"
796
+ ),
797
+ onMouseDown: handleChevronMouseDown,
798
+ children: disabled ? null : isHovering && selectedValue && allowClear ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
799
+ CrossV2,
800
+ {
801
+ color: "#111827",
802
+ className: (0, import_clsx.default)({ "tw-mr-1": size !== "small" }),
803
+ size: size === "small" ? 12 : 16
804
+ }
805
+ ) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
806
+ Chevron2,
807
+ {
808
+ className: (0, import_clsx.default)("tw-text-gray-400"),
809
+ color: "#6B7280"
810
+ }
811
+ )
812
+ }
813
+ )
814
+ ]
815
+ }
816
+ )
817
+ ] }),
818
+ isOpen && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
819
+ "div",
820
+ {
821
+ className: (0, import_clsx.default)(
822
+ "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",
823
+ { "tw-max-h-60": !doubleCharSearch },
824
+ { "tw-max-h-44": doubleCharSearch },
825
+ dropdownClassName
826
+ ),
827
+ ref: optionListRef,
828
+ children: filteredOptions.length > 0 ? filteredOptions.map((option, index) => {
829
+ const isSelected = normalizeValue(selectedValue) === normalizeValue(option.value);
830
+ const isHighlighted = index === highlightedIndex;
831
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { ref: (el) => optionRefs.current[index] = el, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
832
+ OptionItem,
833
+ {
834
+ option,
835
+ index,
836
+ isSelected,
837
+ isHighlighted,
838
+ experience,
839
+ size,
840
+ optionClassName,
841
+ onSelectHandler: handleOptionClick,
842
+ onMouseEnterHandler: handleOptionMouseEnter
843
+ }
844
+ ) }, doubleCharSearch ? option.label : option.value);
845
+ }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "tw-px-4 tw-py-3 tw-text-gray-500 tw-text-sm", children: "No options found" })
846
+ }
847
+ )
848
+ ]
849
+ }
850
+ ) });
851
+ };
852
+ Select.displayName = "Select";
853
+ var Select_default = Select;
854
+
855
+ // src/atom/RangePicker/RangePicker.tsx
856
+ var import_jsx_runtime8 = require("react/jsx-runtime");
857
+ function CustomRangePicker(props) {
858
+ var _a, _b;
859
+ const {
860
+ id = "",
861
+ footer,
862
+ onChange = () => {
863
+ },
864
+ dateRange = ["", ""],
865
+ showNightCount = false,
866
+ isRange = true,
867
+ showYearDropdown = false,
868
+ showSingleCalendar = false,
869
+ disablePastDates = false,
870
+ // New prop to control past date restriction
871
+ minDate = null,
872
+ // New prop for minimum allowed date
873
+ maxDate = null,
874
+ // New prop for maximum allowed date
875
+ minYear = 1900,
876
+ // Minimum year for dropdown
877
+ maxYear = (/* @__PURE__ */ new Date()).getFullYear() + 10,
878
+ // Maximum year for dropdown
879
+ experience = "business",
880
+ showToastError = () => {
881
+ }
882
+ } = props;
883
+ const onChangeRef = (0, import_react3.useRef)(onChange);
884
+ (0, import_react3.useEffect)(() => {
885
+ onChangeRef.current = onChange;
886
+ }, [onChange]);
887
+ const getInitialDate = () => {
888
+ if (dateRange[0]) {
889
+ return new Date(dateRange[0]);
890
+ }
891
+ if (!minDate && !maxDate && !minYear && !maxYear) {
892
+ return /* @__PURE__ */ new Date();
893
+ }
894
+ if (maxYear && maxYear !== (/* @__PURE__ */ new Date()).getFullYear()) {
895
+ let targetDate = new Date(maxYear, 7, 1);
896
+ if (maxDate) {
897
+ const maxDateTime = new Date(maxDate);
898
+ if (targetDate > maxDateTime) {
899
+ targetDate = new Date(
900
+ maxDateTime.getFullYear(),
901
+ maxDateTime.getMonth(),
902
+ 1
903
+ );
904
+ }
905
+ }
906
+ return targetDate;
907
+ }
908
+ if (minDate) {
909
+ const minDateTime = new Date(minDate);
910
+ minDateTime.setHours(0, 0, 0, 0);
911
+ return minDateTime;
912
+ }
913
+ return /* @__PURE__ */ new Date();
914
+ };
915
+ const [currentDate, setCurrentDate] = (0, import_react3.useState)(() => getInitialDate());
916
+ const [startDate, setStartDate] = (0, import_react3.useState)(
917
+ dateRange[0] ? new Date(dateRange[0]) : null
918
+ );
919
+ const [endDate, setEndDate] = (0, import_react3.useState)(
920
+ dateRange[0] && dateRange[1] ? new Date(dateRange[1]) : null
921
+ );
922
+ const [hoverDate, setHoverDate] = (0, import_react3.useState)(null);
923
+ const [isSelectingEnd, setIsSelectingEnd] = (0, import_react3.useState)(
924
+ dateRange[0] && !dateRange[1] ? true : false
925
+ );
926
+ const [selectedDate, setSelectedDate] = (0, import_react3.useState)(
927
+ !isRange && dateRange[0] ? new Date(dateRange[0]) : null
928
+ );
929
+ (0, import_react3.useEffect)(() => {
930
+ const newStart = dateRange[0] ? new Date(dateRange[0]) : null;
931
+ const newEnd = dateRange[1] ? new Date(dateRange[1]) : null;
932
+ setStartDate(newStart);
933
+ setEndDate(newEnd);
934
+ if (newStart) {
935
+ setCurrentDate(new Date(newStart.getFullYear(), newStart.getMonth(), 1));
936
+ }
937
+ }, [dateRange]);
938
+ const getDaysBetween = (start, end) => {
939
+ if (!start || !end) return 0;
940
+ const startDay = (0, import_dayjs.default)(start).startOf("day");
941
+ const endDay = (0, import_dayjs.default)(end).startOf("day");
942
+ return endDay.diff(startDay, "day");
943
+ };
944
+ const nightCount = Math.abs(getDaysBetween(startDate || endDate, hoverDate));
945
+ const nightCountText = nightCount > 1 ? `${nightCount} nights` : "1 night";
946
+ const today = /* @__PURE__ */ new Date();
947
+ today.setHours(0, 0, 0, 0);
948
+ const firstMonth = new Date(
949
+ currentDate.getFullYear(),
950
+ currentDate.getMonth(),
951
+ 1
952
+ );
953
+ const secondMonth = new Date(
954
+ currentDate.getFullYear(),
955
+ currentDate.getMonth() + 1,
956
+ 1
957
+ );
958
+ const monthNames = [
959
+ "January",
960
+ "February",
961
+ "March",
962
+ "April",
963
+ "May",
964
+ "June",
965
+ "July",
966
+ "August",
967
+ "September",
968
+ "October",
969
+ "November",
970
+ "December"
971
+ ];
972
+ const dayNames = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
973
+ const generateYearOptions = () => {
974
+ const years = [];
975
+ for (let i = minYear; i <= maxYear; i++) {
976
+ const isYearDisabled = isYearCompletelyDisabled(i);
977
+ years.push({
978
+ label: i.toString(),
979
+ value: i,
980
+ disabled: isYearDisabled
981
+ });
982
+ }
983
+ return years;
984
+ };
985
+ const isYearCompletelyDisabled = (year) => {
986
+ const firstDayOfYear = new Date(year, 0, 1);
987
+ const lastDayOfYear = new Date(year, 11, 31);
988
+ if (minDate) {
989
+ const minDateTime = new Date(minDate);
990
+ minDateTime.setHours(0, 0, 0, 0);
991
+ if (minDateTime > lastDayOfYear) {
992
+ return true;
993
+ }
994
+ }
995
+ if (maxDate) {
996
+ const maxDateTime = new Date(maxDate);
997
+ maxDateTime.setHours(0, 0, 0, 0);
998
+ if (maxDateTime < firstDayOfYear) {
999
+ return true;
1000
+ }
1001
+ }
1002
+ if (disablePastDates) {
1003
+ const today2 = /* @__PURE__ */ new Date();
1004
+ today2.setHours(0, 0, 0, 0);
1005
+ if (lastDayOfYear < today2) {
1006
+ return true;
1007
+ }
1008
+ }
1009
+ return false;
1010
+ };
1011
+ const yearOptions = generateYearOptions();
1012
+ const generateCalendarDays = (monthDate) => {
1013
+ const year = monthDate.getFullYear();
1014
+ const month = monthDate.getMonth();
1015
+ const firstDay = new Date(year, month, 1);
1016
+ const lastDay = new Date(year, month + 1, 0);
1017
+ const daysInMonth = lastDay.getDate();
1018
+ const startingDayOfWeek = firstDay.getDay();
1019
+ const days = [];
1020
+ for (let i = 0; i < startingDayOfWeek; i++) {
1021
+ days.push(null);
1022
+ }
1023
+ for (let day = 1; day <= daysInMonth; day++) {
1024
+ days.push(new Date(year, month, day));
1025
+ }
1026
+ return days;
1027
+ };
1028
+ const formatDateKey = (date) => {
1029
+ if (!date) return "";
1030
+ return `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;
1031
+ };
1032
+ const isSameDate = (date1, date2) => {
1033
+ if (!date1 || !date2) return false;
1034
+ return formatDateKey(date1) === formatDateKey(date2);
1035
+ };
1036
+ const isDateDisabled = (date) => {
1037
+ if (!date) return false;
1038
+ const checkDate = new Date(date);
1039
+ checkDate.setHours(0, 0, 0, 0);
1040
+ if (disablePastDates && checkDate < today) {
1041
+ return true;
1042
+ }
1043
+ if (minDate) {
1044
+ const minDateTime = new Date(minDate);
1045
+ minDateTime.setHours(0, 0, 0, 0);
1046
+ if (checkDate < minDateTime) {
1047
+ return true;
1048
+ }
1049
+ }
1050
+ if (maxDate) {
1051
+ const maxDateTime = new Date(maxDate);
1052
+ maxDateTime.setHours(0, 0, 0, 0);
1053
+ if (checkDate > maxDateTime) {
1054
+ return true;
1055
+ }
1056
+ }
1057
+ return false;
1058
+ };
1059
+ const isDateInRange = (date) => {
1060
+ if (!isRange || !startDate || !date) return false;
1061
+ const compareDate = endDate || hoverDate;
1062
+ if (!compareDate) return false;
1063
+ const start = startDate < compareDate ? startDate : compareDate;
1064
+ const end = startDate < compareDate ? compareDate : startDate;
1065
+ return date >= start && date <= end;
1066
+ };
1067
+ const isDateBetweenRange = (date) => {
1068
+ if (!isRange || !startDate || !date) return false;
1069
+ const compareDate = endDate || hoverDate;
1070
+ if (!compareDate) return false;
1071
+ const start = startDate < compareDate ? startDate : compareDate;
1072
+ const end = startDate < compareDate ? compareDate : startDate;
1073
+ return date > start && date < end;
1074
+ };
1075
+ const handleDateClick = (date) => {
1076
+ if (isDateDisabled(date)) return;
1077
+ if (!isRange) {
1078
+ setSelectedDate(date);
1079
+ onChangeRef.current(null, (0, import_dayjs.default)(date).format("D MMM, YYYY"));
1080
+ return;
1081
+ }
1082
+ let nextStart = startDate;
1083
+ let nextEnd = endDate;
1084
+ const isCheckinCheckoutSame = (0, import_dayjs.default)(date).format("D MMM, YYYY") === (0, import_dayjs.default)(startDate).format("D MMM, YYYY");
1085
+ if (showNightCount && isCheckinCheckoutSame) {
1086
+ setStartDate(null);
1087
+ setEndDate(null);
1088
+ setIsSelectingEnd(false);
1089
+ setHoverDate(null);
1090
+ showToastError("Check-in and check-out dates cannot be the same.");
1091
+ onChangeRef.current(null, ["", ""]);
1092
+ return;
1093
+ }
1094
+ if (!startDate || startDate && endDate) {
1095
+ nextStart = date;
1096
+ nextEnd = null;
1097
+ setStartDate(nextStart);
1098
+ setEndDate(nextEnd);
1099
+ setIsSelectingEnd(true);
1100
+ setHoverDate(null);
1101
+ } else if (startDate && !endDate) {
1102
+ if (date < startDate) {
1103
+ nextEnd = startDate;
1104
+ nextStart = date;
1105
+ } else {
1106
+ nextEnd = date;
1107
+ }
1108
+ setStartDate(nextStart);
1109
+ setEndDate(nextEnd);
1110
+ setIsSelectingEnd(false);
1111
+ setHoverDate(null);
1112
+ }
1113
+ onChangeRef.current(null, [
1114
+ nextStart ? (0, import_dayjs.default)(nextStart).format("D MMM, YYYY") : "",
1115
+ nextEnd ? (0, import_dayjs.default)(nextEnd).format("D MMM, YYYY") : ""
1116
+ ]);
1117
+ };
1118
+ (0, import_react3.useEffect)(() => {
1119
+ if (isRange && startDate && !endDate) {
1120
+ sessionStorage.setItem(
1121
+ "rangePickerStartDate",
1122
+ (0, import_dayjs.default)(startDate).format("D MMM, YYYY")
1123
+ );
1124
+ }
1125
+ }, [startDate, endDate, isRange]);
1126
+ const handleDateHover = (date) => {
1127
+ if (isDateDisabled(date) || !isRange) return;
1128
+ if (isSelectingEnd && startDate && !endDate) {
1129
+ setHoverDate(date);
1130
+ }
1131
+ };
1132
+ const navigateMonth = (direction) => {
1133
+ const newDate = new Date(currentDate);
1134
+ newDate.setMonth(currentDate.getMonth() + direction);
1135
+ setCurrentDate(newDate);
1136
+ };
1137
+ const isPreviousMonthDisabled = () => {
1138
+ const previousMonth = new Date(currentDate);
1139
+ previousMonth.setMonth(currentDate.getMonth() - 1);
1140
+ const lastDayOfPreviousMonth = new Date(
1141
+ previousMonth.getFullYear(),
1142
+ previousMonth.getMonth() + 1,
1143
+ 0
1144
+ );
1145
+ return isDateDisabled(lastDayOfPreviousMonth);
1146
+ };
1147
+ const isNextMonthDisabled = () => {
1148
+ const nextMonth = new Date(currentDate);
1149
+ nextMonth.setMonth(currentDate.getMonth() + 1);
1150
+ const firstDayOfNextMonth = new Date(
1151
+ nextMonth.getFullYear(),
1152
+ nextMonth.getMonth(),
1153
+ 1
1154
+ );
1155
+ return isDateDisabled(firstDayOfNextMonth);
1156
+ };
1157
+ const handleYearChange = (selectedYear) => {
1158
+ const newDate = new Date(currentDate);
1159
+ newDate.setFullYear(selectedYear);
1160
+ const targetMonth = newDate.getMonth();
1161
+ if (!isMonthDisabled(selectedYear, targetMonth)) {
1162
+ setCurrentDate(newDate);
1163
+ } else {
1164
+ const firstAvailableMonth = findFirstAvailableMonth(selectedYear);
1165
+ if (firstAvailableMonth !== -1) {
1166
+ newDate.setMonth(firstAvailableMonth);
1167
+ setCurrentDate(newDate);
1168
+ }
1169
+ }
1170
+ };
1171
+ const isMonthDisabled = (year, month) => {
1172
+ const lastDayOfMonth = new Date(year, month + 1, 0);
1173
+ const firstDayOfMonth = new Date(year, month, 1);
1174
+ return isDateDisabled(lastDayOfMonth) && isDateDisabled(firstDayOfMonth);
1175
+ };
1176
+ const findFirstAvailableMonth = (year) => {
1177
+ for (let month = 0; month < 12; month++) {
1178
+ if (!isMonthDisabled(year, month)) {
1179
+ return month;
1180
+ }
1181
+ }
1182
+ return -1;
1183
+ };
1184
+ 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"));
1185
+ const NightCountTooltip = () => {
1186
+ const TooltipArrow = (0, import_react3.memo)(() => {
1187
+ return /* @__PURE__ */ (0, import_jsx_runtime8.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_runtime8.jsx)(
1188
+ "div",
1189
+ {
1190
+ style: {
1191
+ borderTop: "5px solid transparent",
1192
+ borderBottom: "5px solid transparent",
1193
+ borderLeft: "8px solid black"
1194
+ }
1195
+ }
1196
+ ) });
1197
+ });
1198
+ return /* @__PURE__ */ (0, import_jsx_runtime8.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: [
1199
+ nightCountText,
1200
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "tw-absolute tw-right-[42%] tw-bottom-[-7px]", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TooltipArrow, {}) })
1201
+ ] });
1202
+ };
1203
+ const renderCalendar = (monthDate, isSecondCalendar = false) => {
1204
+ const days = generateCalendarDays(monthDate);
1205
+ const monthName = monthNames[monthDate.getMonth()];
1206
+ const year = monthDate.getFullYear();
1207
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1208
+ "div",
1209
+ {
1210
+ className: (0, import_clsx2.default)("tw-flex-1 tw-max-w-[83vw] tw-mb-2", {
1211
+ "tw-h-[320px]": showYearDropdown || days.length > 35,
1212
+ "tw-h-[290px]": !showYearDropdown || days.length <= 35
1213
+ }),
1214
+ children: [
1215
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "tw-text-center tw-mb-4 sm:tw-mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: " tw-flex tw-justify-center tw-items-center tw-gap-4 ", children: [
1216
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("h3", { className: "tw-typography-footNoteBold tw-text-color-text-default tw-m-0", children: [
1217
+ monthName,
1218
+ " ",
1219
+ !showYearDropdown && ` ${year}`
1220
+ ] }),
1221
+ showYearDropdown && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1222
+ Select_default,
1223
+ {
1224
+ options: yearOptions,
1225
+ value: currentDate.getFullYear(),
1226
+ valueSelected: currentDate.getFullYear(),
1227
+ onChange: (selectedYear) => {
1228
+ if (typeof selectedYear === "number") {
1229
+ handleYearChange(selectedYear);
1230
+ }
1231
+ },
1232
+ className: "tw-min-w-fit tw-bg-transparent tw-typography-footNoteBold tw-text-color-text-default",
1233
+ size: "small",
1234
+ variant: "filled",
1235
+ style: { width: "80px" },
1236
+ id: `${id}-year-select`,
1237
+ allowClear: false,
1238
+ enableSearch: false,
1239
+ experience
1240
+ }
1241
+ )
1242
+ ] }) }),
1243
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "tw-grid tw-grid-cols-7 tw-mb-2", children: dayNames.map((day) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1244
+ "div",
1245
+ {
1246
+ className: "tw-py-2 tw-px-0 tw-text-center tw-typography-caption2 tw-text-[#6B7280]",
1247
+ children: day
1248
+ },
1249
+ day
1250
+ )) }),
1251
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "tw-grid tw-grid-cols-7", children: days.map((date, index) => {
1252
+ if (!date) {
1253
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "tw-h-10" }, index);
1254
+ }
1255
+ const isStart = isRange ? isSameDate(date, startDate) : false;
1256
+ const isEnd = isRange ? isSameDate(date, endDate) : false;
1257
+ const isSelected = !isRange ? isSameDate(date, selectedDate) : false;
1258
+ const isInRange = isRange ? isDateBetweenRange(date) : false;
1259
+ const isHovering = isRange && isSelectingEnd && hoverDate && isDateInRange(date) && !isStart && !isEnd;
1260
+ const isDisabled = isDateDisabled(date);
1261
+ let className = "tw-relative tw-z-20 tw-h-10 tw-w-10 tw-flex tw-items-center tw-justify-center tw-typography-caption1Bold ";
1262
+ const isFirstInRow = index % 7 === 0;
1263
+ const isLastInRow = index % 7 === 6;
1264
+ let pseudoClass = "";
1265
+ if (isDisabled) {
1266
+ className += "tw-text-gray-300 tw-cursor-not-allowed ";
1267
+ } else {
1268
+ className += "tw-cursor-pointer ";
1269
+ if (isStart || isEnd || isSelected) {
1270
+ className += "tw-bg-black tw-z-[21] tw-text-white tw-font-medium tw-rounded-full ";
1271
+ } else if (isInRange) {
1272
+ className += "tw-text-gray-900";
1273
+ if (window.innerWidth < 640) {
1274
+ className = className.replace(
1275
+ "tw-w-10",
1276
+ "tw-pr-2 tw-w-[50px] sm:tw-w-10 sm:tw-pr-0"
1277
+ );
1278
+ }
1279
+ pseudoClass = (0, import_clsx2.default)(RangePicker_module_default.range_start, RangePicker_module_default.range_end);
1280
+ } else {
1281
+ className += "tw-text-gray-700 hover:tw-border-2 hover:tw-border-black tw-rounded-full hover:tw-border-solid ";
1282
+ }
1283
+ if (isHovering) {
1284
+ className += "tw-border-2 tw-border-gray-400 tw-bg-white tw-z-[22]";
1285
+ }
1286
+ }
1287
+ const titleDate = (0, import_dayjs.default)(date).format("YYYY-MM-DD");
1288
+ const hoverDateFormatted = (0, import_dayjs.default)(hoverDate || null).format(
1289
+ "YYYY-MM-DD"
1290
+ );
1291
+ const isHoveringDate = (0, import_dayjs.default)(hoverDateFormatted).isSame(
1292
+ (0, import_dayjs.default)(date),
1293
+ "day"
1294
+ );
1295
+ const isHoverDateGreater = (0, import_dayjs.default)(hoverDate).isAfter(
1296
+ (0, import_dayjs.default)(startDate),
1297
+ "day"
1298
+ );
1299
+ const isHoverDateLess = (0, import_dayjs.default)(hoverDate).isBefore(
1300
+ (0, import_dayjs.default)(startDate),
1301
+ "day"
1302
+ );
1303
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "tw-relative", children: [
1304
+ (isStart || isEnd) && startDate && endDate && !isSameDay && isRange && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1305
+ "div",
1306
+ {
1307
+ className: (0, import_clsx2.default)(
1308
+ "tw-w-9 tw-h-8 tw-bg-[#F2EFEC] tw-rotate-90 tw-absolute tw-z-10 tw-top-1",
1309
+ {
1310
+ "tw-left-5": isStart,
1311
+ "tw-right-5": isEnd,
1312
+ "tw-invisible": isFirstInRow && isEnd || isLastInRow && isStart
1313
+ }
1314
+ )
1315
+ }
1316
+ ),
1317
+ isHoveringDate && isHovering && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1318
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1319
+ "div",
1320
+ {
1321
+ className: (0, import_clsx2.default)(
1322
+ "tw-w-9 tw-h-8 tw-bg-[#F2EFEC] tw-rotate-90 tw-absolute tw-z-10 tw-top-1",
1323
+ {
1324
+ "tw-right-5": isHoverDateGreater,
1325
+ "tw-left-5": isHoverDateLess,
1326
+ "tw-invisible": isFirstInRow && isHoverDateGreater || isLastInRow && isHoverDateLess
1327
+ }
1328
+ )
1329
+ }
1330
+ ),
1331
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1332
+ "div",
1333
+ {
1334
+ className: (0, import_clsx2.default)(
1335
+ "tw-w-[18px] tw-h-[40px] tw-bg-white tw-rounded-r-full tw-absolute tw-z-20",
1336
+ {
1337
+ "tw-left-5": isHoverDateLess,
1338
+ "tw-right-5 tw-rotate-180": isHoverDateGreater
1339
+ }
1340
+ )
1341
+ }
1342
+ )
1343
+ ] }),
1344
+ isStart && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1345
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1346
+ "div",
1347
+ {
1348
+ className: (0, import_clsx2.default)(
1349
+ "tw-w-9 tw-h-8 tw-bg-[#F2EFEC] tw-rotate-90 tw-absolute tw-z-10 tw-top-1",
1350
+ {
1351
+ "tw-right-5": isHoverDateLess,
1352
+ "tw-left-5": isHoverDateGreater,
1353
+ "tw-invisible": isLastInRow
1354
+ }
1355
+ )
1356
+ }
1357
+ ),
1358
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1359
+ "div",
1360
+ {
1361
+ className: (0, import_clsx2.default)(
1362
+ "tw-w-[18px] tw-h-[40px] tw-bg-white tw-rounded-r-full tw-absolute tw-z-20",
1363
+ {
1364
+ "tw-left-5": isHoverDateGreater,
1365
+ "tw-right-5 tw-rotate-180": isHoverDateLess
1366
+ }
1367
+ )
1368
+ }
1369
+ )
1370
+ ] }),
1371
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1372
+ "div",
1373
+ {
1374
+ className: (0, import_clsx2.default)(className, pseudoClass, "tw-group", {
1375
+ "tw-border-2 !tw-border-black tw-rounded-full tw-border-solid": (0, import_dayjs.default)(date).isSame((0, import_dayjs.default)(hoverDate), "day")
1376
+ }),
1377
+ onClick: () => handleDateClick(date),
1378
+ onMouseEnter: () => handleDateHover(date),
1379
+ "data-date": titleDate,
1380
+ children: [
1381
+ showNightCount && isRange && isHovering && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(NightCountTooltip, {}),
1382
+ date.getDate()
1383
+ ]
1384
+ }
1385
+ )
1386
+ ] }, formatDateKey(date));
1387
+ }) })
1388
+ ]
1389
+ }
1390
+ );
1391
+ };
1392
+ 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";
1393
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1394
+ "div",
1395
+ {
1396
+ className: (0, import_clsx2.default)(
1397
+ "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",
1398
+ {
1399
+ "sm:tw-w-[640px]": !showSingleCalendar,
1400
+ "sm:tw-w-[330px]": showSingleCalendar
1401
+ }
1402
+ ),
1403
+ children: [
1404
+ /* @__PURE__ */ (0, import_jsx_runtime8.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: [
1405
+ !isPreviousMonthDisabled() && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1406
+ "div",
1407
+ {
1408
+ className: (0, import_clsx2.default)(arrowClasses, "tw-left-1"),
1409
+ onClick: () => navigateMonth(-1),
1410
+ id: "calendar-previous-month-button",
1411
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1412
+ Chevron,
1413
+ {
1414
+ size: "medium",
1415
+ className: "tw-relative -tw-top-0.5 tw-right-0.5"
1416
+ }
1417
+ )
1418
+ }
1419
+ ),
1420
+ isPreviousMonthDisabled() && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "tw-w-10 tw-h-10" }),
1421
+ !isNextMonthDisabled() && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1422
+ "div",
1423
+ {
1424
+ className: (0, import_clsx2.default)(arrowClasses, "tw-mt-[1px] tw-right-1"),
1425
+ onClick: () => navigateMonth(1),
1426
+ id: "calendar-next-month-button",
1427
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1428
+ Chevron,
1429
+ {
1430
+ size: "medium",
1431
+ onClick: () => navigateMonth(1),
1432
+ className: "tw-rotate-180 tw-relative tw-top-0.5 tw-left-0.5"
1433
+ }
1434
+ )
1435
+ }
1436
+ ),
1437
+ isNextMonthDisabled() && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "tw-w-10 tw-h-10" })
1438
+ ] }),
1439
+ /* @__PURE__ */ (0, import_jsx_runtime8.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_runtime8.jsxs)(
1440
+ "div",
1441
+ {
1442
+ className: (0, import_clsx2.default)("tw-flex tw-w-full", {
1443
+ "tw-flex-col sm:tw-space-x-8 sm:tw-flex-row": isRange || !showSingleCalendar,
1444
+ "tw-justify-center": !isRange || showSingleCalendar,
1445
+ "tw-pt-4": showYearDropdown,
1446
+ // More space when year dropdown is visible
1447
+ "tw-pt-6": !showYearDropdown
1448
+ }),
1449
+ children: [
1450
+ renderCalendar(firstMonth),
1451
+ !showSingleCalendar && renderCalendar(secondMonth, true)
1452
+ ]
1453
+ }
1454
+ ) }),
1455
+ footer
1456
+ ]
1457
+ }
1458
+ );
1459
+ }
1460
+ CustomRangePicker.displayName = "RangePicker";
1461
+ var RangePicker_default = CustomRangePicker;
1462
+ // Annotate the CommonJS export names for ESM import in node:
1463
+ 0 && (module.exports = {
1464
+ RangePicker
1465
+ });