@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,678 @@
1
+ import {
2
+ Tooltip_default
3
+ } from "./chunk-MLCMZRUC.mjs";
4
+ import {
5
+ LoadingSpinner_default
6
+ } from "./chunk-QKTMWS4J.mjs";
7
+ import {
8
+ __objRest,
9
+ __spreadProps,
10
+ __spreadValues
11
+ } from "./chunk-FWCSY2DS.mjs";
12
+
13
+ // src/atom/Select/Select.tsx
14
+ import { memo as memo3, useCallback, useEffect, useMemo, useRef, useState } from "react";
15
+ import clsx from "clsx";
16
+
17
+ // src/icons/Chevron.tsx
18
+ import * as React from "react";
19
+ import { jsx } from "react/jsx-runtime";
20
+ var Chevron = React.memo(
21
+ (_a) => {
22
+ var _b = _a, { size = 16, color = "#6b7280", className } = _b, rest = __objRest(_b, ["size", "color", "className"]);
23
+ return /* @__PURE__ */ jsx(
24
+ "svg",
25
+ __spreadProps(__spreadValues({
26
+ xmlns: "http://www.w3.org/2000/svg",
27
+ width: size,
28
+ height: size,
29
+ fill: "none",
30
+ viewBox: "0 0 16 16",
31
+ className
32
+ }, rest), {
33
+ children: /* @__PURE__ */ jsx(
34
+ "path",
35
+ {
36
+ fill: color,
37
+ 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"
38
+ }
39
+ )
40
+ })
41
+ );
42
+ }
43
+ );
44
+ Chevron.displayName = "Chevron";
45
+
46
+ // src/icons/CrossV2.tsx
47
+ import * as React2 from "react";
48
+ import { jsx as jsx2 } from "react/jsx-runtime";
49
+ var CrossV2 = React2.memo(
50
+ (_a) => {
51
+ var _b = _a, { size = 16, color = "#111827", className } = _b, rest = __objRest(_b, ["size", "color", "className"]);
52
+ return /* @__PURE__ */ jsx2(
53
+ "svg",
54
+ __spreadProps(__spreadValues({
55
+ xmlns: "http://www.w3.org/2000/svg",
56
+ width: size,
57
+ height: size,
58
+ fill: "none",
59
+ viewBox: "0 0 20 20"
60
+ }, rest), {
61
+ children: /* @__PURE__ */ jsx2(
62
+ "path",
63
+ {
64
+ fill: color,
65
+ 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"
66
+ }
67
+ )
68
+ })
69
+ );
70
+ }
71
+ );
72
+ CrossV2.displayName = "CrossV2";
73
+
74
+ // src/icons/Lock.tsx
75
+ import React3 from "react";
76
+ import { jsx as jsx3 } from "react/jsx-runtime";
77
+ var Lock = React3.memo((_a) => {
78
+ var _b = _a, { size = 16, color = "#000" } = _b, rest = __objRest(_b, ["size", "color"]);
79
+ return /* @__PURE__ */ jsx3(
80
+ "svg",
81
+ __spreadProps(__spreadValues({
82
+ xmlns: "http://www.w3.org/2000/svg",
83
+ width: size,
84
+ height: size,
85
+ fill: "none",
86
+ viewBox: "0 0 16 16"
87
+ }, rest), {
88
+ children: /* @__PURE__ */ jsx3(
89
+ "path",
90
+ {
91
+ fill: color,
92
+ 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"
93
+ }
94
+ )
95
+ })
96
+ );
97
+ });
98
+
99
+ // src/atom/Select/Select.tsx
100
+ import { jsx as jsx4, jsxs } from "react/jsx-runtime";
101
+ var Select = ({
102
+ label,
103
+ mandatory = false,
104
+ error = false,
105
+ options = [],
106
+ valueSelected = "",
107
+ // Keep for backward compatibility
108
+ value: _valueProp,
109
+ // Rename to avoid potential conflicts with native value attribute
110
+ onChange,
111
+ onSearch,
112
+ isLoading = false,
113
+ disabled = false,
114
+ disabledTooltip = "",
115
+ className = "",
116
+ dropdownClassName = "",
117
+ optionClassName = "",
118
+ style = {},
119
+ showDisplayValue = false,
120
+ // New prop to show displayValue instead of label
121
+ allowClear = true,
122
+ enableSearch = true,
123
+ doubleCharSearch = false,
124
+ id,
125
+ name,
126
+ tabIndex,
127
+ // Add tabIndex prop
128
+ // Additional styling props
129
+ size = "default",
130
+ // 'small', 'default', 'large'
131
+ variant = "default",
132
+ // 'default', 'filled', 'outlined'
133
+ wrapperClassName = "",
134
+ inputClassName = "",
135
+ // Custom class for input element specifically
136
+ labelClassName = "",
137
+ // Custom class for label element specifically
138
+ height = "tw-h-12",
139
+ // Custom height
140
+ experience = "business"
141
+ }) => {
142
+ const normalizeValue = useCallback(
143
+ (val) => {
144
+ if (val === null || val === void 0) return "";
145
+ return String(val);
146
+ },
147
+ []
148
+ );
149
+ const validatedOptions = useMemo(() => {
150
+ if (!Array.isArray(options)) return [];
151
+ return options.filter(
152
+ (opt) => opt && typeof opt === "object" && opt.value !== void 0 && opt.value !== null && opt.label !== void 0
153
+ );
154
+ }, [options]);
155
+ const [isOpen, setIsOpen] = useState(false);
156
+ const [isFocused, setIsFocused] = useState(false);
157
+ const [searchTerm, setSearchTerm] = useState("");
158
+ const [isHovering, setIsHovering] = useState(false);
159
+ const [highlightedIndex, setHighlightedIndex] = useState(-1);
160
+ const [selectedValue, setSelectedValue] = useState(() => {
161
+ const initialValue = valueSelected;
162
+ if (initialValue === null || initialValue === void 0) return "";
163
+ return String(initialValue);
164
+ });
165
+ const inputRef = useRef(null);
166
+ const inputValueRef = useRef("");
167
+ const dropdownRef = useRef(null);
168
+ const optionRefs = useRef([]);
169
+ const optionListRef = useRef(null);
170
+ const blurTimeoutRef = useRef(null);
171
+ const hoverTimeoutRef = useRef(null);
172
+ const isActive = isFocused || Boolean(selectedValue) || Boolean(valueSelected) || Boolean(searchTerm);
173
+ const sizeClasses = useMemo(() => {
174
+ switch (size) {
175
+ case "small":
176
+ return {
177
+ input: "tw-h-6 tw-px-3 tw-typography-caption1Bold !tw-rounded-lg",
178
+ padding: "tw-px-2 tw-py-1",
179
+ labelActive: "tw-top-0.5 tw-typography-caption2",
180
+ labelInactive: "tw-top-1.5 tw-typography-caption3"
181
+ };
182
+ case "medium":
183
+ return {
184
+ input: "tw-h-10 tw-px-4 tw-typography-body2",
185
+ padding: label ? "tw-pt-4 tw-pb-1" : "tw-py-2",
186
+ labelActive: "tw-top-1 tw-typography-caption3",
187
+ labelInactive: "tw-top-2.5 tw-typography-body2"
188
+ };
189
+ case "large":
190
+ return {
191
+ input: "tw-h-16 tw-px-5 tw-typography-bodyLarge",
192
+ padding: label ? "tw-pt-8 tw-pb-4" : "tw-py-5",
193
+ labelActive: "tw-top-1 tw-typography-caption2",
194
+ labelInactive: "tw-top-5 tw-typography-body1"
195
+ };
196
+ default:
197
+ return {
198
+ input: height + " tw-px-4 tw-typography-bodyLarge",
199
+ padding: label ? "tw-pt-6 tw-pb-3" : "tw-py-3",
200
+ labelActive: "tw-top-1 tw-typography-caption3",
201
+ labelInactive: "tw-top-3.5 tw-typography-body2"
202
+ };
203
+ }
204
+ }, [size, label, height]);
205
+ const variantClasses = useMemo(() => {
206
+ switch (variant) {
207
+ case "filled":
208
+ return "tw-bg-gray-50 tw-border-transparent";
209
+ case "outlined":
210
+ return "tw-bg-transparent tw-border-2";
211
+ default:
212
+ return " tw-border";
213
+ }
214
+ }, [variant]);
215
+ const handleBlur = useCallback(() => {
216
+ blurTimeoutRef.current = setTimeout(() => {
217
+ setIsOpen(false);
218
+ setSearchTerm("");
219
+ setHighlightedIndex(-1);
220
+ blurTimeoutRef.current = null;
221
+ setIsFocused(false);
222
+ }, 150);
223
+ }, []);
224
+ const handleSearchChange = useCallback(
225
+ (e) => {
226
+ var _a;
227
+ const searchValue = doubleCharSearch ? e.target.value.slice(0, 2) || "" : e.target.value;
228
+ if (doubleCharSearch) {
229
+ setSearchTerm(searchValue);
230
+ } else {
231
+ setSearchTerm(searchValue);
232
+ }
233
+ setIsOpen(true);
234
+ setHighlightedIndex(-1);
235
+ if (onSearch && typeof onSearch === "function") {
236
+ onSearch(searchValue);
237
+ }
238
+ (_a = optionListRef == null ? void 0 : optionListRef.current) == null ? void 0 : _a.scrollTo({
239
+ top: 0,
240
+ behavior: "smooth"
241
+ });
242
+ },
243
+ [doubleCharSearch, onSearch]
244
+ );
245
+ const handleOptionSelect = useCallback(
246
+ (option) => {
247
+ var _a;
248
+ if (blurTimeoutRef.current) {
249
+ clearTimeout(blurTimeoutRef.current);
250
+ blurTimeoutRef.current = null;
251
+ }
252
+ inputValueRef.current = option.label;
253
+ const normalizedValue = normalizeValue(option.value);
254
+ setSelectedValue(normalizedValue);
255
+ setSearchTerm("");
256
+ setIsOpen(false);
257
+ if (enableSearch) {
258
+ setIsFocused(false);
259
+ }
260
+ setIsHovering(false);
261
+ if (onChange) onChange(option.value);
262
+ if (enableSearch) (_a = inputRef.current) == null ? void 0 : _a.blur();
263
+ },
264
+ [normalizeValue, onChange, enableSearch]
265
+ );
266
+ const handleClear = useCallback(
267
+ (e) => {
268
+ var _a;
269
+ inputValueRef.current = "";
270
+ e.stopPropagation();
271
+ e.preventDefault();
272
+ setSelectedValue("");
273
+ setSearchTerm("");
274
+ if (enableSearch) {
275
+ setIsOpen(true);
276
+ setIsFocused(true);
277
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
278
+ } else {
279
+ setIsOpen(false);
280
+ setIsFocused(false);
281
+ }
282
+ if (onChange) onChange(null);
283
+ },
284
+ [onChange, enableSearch]
285
+ );
286
+ useEffect(() => {
287
+ if (!validatedOptions.length) {
288
+ setSelectedValue("");
289
+ setSearchTerm("");
290
+ inputValueRef.current = "";
291
+ }
292
+ }, [validatedOptions.length]);
293
+ useEffect(() => {
294
+ const externalValue = _valueProp !== void 0 ? _valueProp : valueSelected;
295
+ const newValue = normalizeValue(externalValue);
296
+ setSelectedValue((prevValue) => {
297
+ const prevNormalized = normalizeValue(prevValue);
298
+ return prevNormalized !== newValue ? newValue : prevValue;
299
+ });
300
+ }, [valueSelected, _valueProp, normalizeValue]);
301
+ useEffect(() => {
302
+ const handleClickOutside = (event) => {
303
+ if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
304
+ if (blurTimeoutRef.current) {
305
+ clearTimeout(blurTimeoutRef.current);
306
+ blurTimeoutRef.current = null;
307
+ }
308
+ setIsOpen(false);
309
+ setIsFocused(false);
310
+ setSearchTerm("");
311
+ setHighlightedIndex(-1);
312
+ }
313
+ };
314
+ document.addEventListener("mousedown", handleClickOutside);
315
+ return () => {
316
+ document.removeEventListener("mousedown", handleClickOutside);
317
+ if (blurTimeoutRef.current) {
318
+ clearTimeout(blurTimeoutRef.current);
319
+ }
320
+ if (hoverTimeoutRef.current) {
321
+ clearTimeout(hoverTimeoutRef.current);
322
+ }
323
+ };
324
+ }, []);
325
+ const getDisplayValue = useCallback(() => {
326
+ if (selectedValue && (validatedOptions == null ? void 0 : validatedOptions.length) > 0) {
327
+ const selected = validatedOptions.find(
328
+ (opt) => normalizeValue(opt.value) === normalizeValue(selectedValue)
329
+ );
330
+ if (selected) {
331
+ return showDisplayValue && selected.displayValue ? selected.displayValue : selected.label;
332
+ }
333
+ }
334
+ if (selectedValue && (!validatedOptions || validatedOptions.length === 0)) {
335
+ return selectedValue;
336
+ }
337
+ return "";
338
+ }, [selectedValue, validatedOptions, showDisplayValue, normalizeValue]);
339
+ const filteredOptions = useMemo(() => {
340
+ var _a;
341
+ if (!enableSearch) {
342
+ return validatedOptions;
343
+ }
344
+ (_a = dropdownRef.current) == null ? void 0 : _a.scrollTo(0, 0);
345
+ const updatedFilteredOptions = validatedOptions.filter((option) => {
346
+ var _a2;
347
+ return (_a2 = option == null ? void 0 : option.label) == null ? void 0 : _a2.toLowerCase().includes(searchTerm == null ? void 0 : searchTerm.toLowerCase());
348
+ });
349
+ return updatedFilteredOptions;
350
+ }, [validatedOptions, searchTerm, enableSearch]);
351
+ const getSelectedOptionIndex = useCallback(() => {
352
+ if (!selectedValue || !filteredOptions.length) {
353
+ return 0;
354
+ }
355
+ const index = filteredOptions.findIndex(
356
+ (option) => normalizeValue(option.value) === normalizeValue(selectedValue)
357
+ );
358
+ return index >= 0 ? index : 0;
359
+ }, [selectedValue, filteredOptions, normalizeValue]);
360
+ const handleInputInteraction = useCallback(
361
+ (_e) => {
362
+ var _a;
363
+ if (blurTimeoutRef.current) {
364
+ clearTimeout(blurTimeoutRef.current);
365
+ blurTimeoutRef.current = null;
366
+ }
367
+ if (isOpen) {
368
+ setIsOpen(false);
369
+ setIsFocused(false);
370
+ setSearchTerm("");
371
+ setHighlightedIndex(-1);
372
+ (_a = inputRef.current) == null ? void 0 : _a.blur();
373
+ return;
374
+ }
375
+ setIsFocused(true);
376
+ setIsOpen(true);
377
+ setHighlightedIndex(getSelectedOptionIndex());
378
+ if (inputRef.current) {
379
+ inputRef.current.focus();
380
+ }
381
+ },
382
+ [isOpen, getSelectedOptionIndex]
383
+ );
384
+ const handleKeyDown = useCallback(
385
+ (e) => {
386
+ var _a;
387
+ if (!isOpen) return;
388
+ switch (e.key) {
389
+ case "ArrowDown":
390
+ e.preventDefault();
391
+ setHighlightedIndex((prev) => {
392
+ const nextIndex = prev < filteredOptions.length - 1 ? prev + 1 : prev;
393
+ return nextIndex;
394
+ });
395
+ break;
396
+ case "ArrowUp":
397
+ e.preventDefault();
398
+ setHighlightedIndex((prev) => {
399
+ const nextIndex = prev > 0 ? prev - 1 : prev;
400
+ return nextIndex;
401
+ });
402
+ break;
403
+ case "Enter":
404
+ e.preventDefault();
405
+ if (highlightedIndex >= 0 && filteredOptions[highlightedIndex]) {
406
+ handleOptionSelect(filteredOptions[highlightedIndex]);
407
+ }
408
+ break;
409
+ case "Escape":
410
+ e.preventDefault();
411
+ setIsOpen(false);
412
+ setIsFocused(false);
413
+ setSearchTerm("");
414
+ setHighlightedIndex(-1);
415
+ (_a = inputRef.current) == null ? void 0 : _a.blur();
416
+ break;
417
+ default:
418
+ break;
419
+ }
420
+ },
421
+ [isOpen, highlightedIndex, filteredOptions, handleOptionSelect]
422
+ );
423
+ useEffect(() => {
424
+ if (highlightedIndex >= 0 && optionRefs.current[highlightedIndex]) {
425
+ optionRefs.current[highlightedIndex].scrollIntoView({
426
+ block: "nearest",
427
+ behavior: "smooth"
428
+ });
429
+ }
430
+ }, [highlightedIndex]);
431
+ useEffect(() => {
432
+ optionRefs.current = [];
433
+ }, [filteredOptions]);
434
+ const handleMouseEnter = useCallback(() => {
435
+ if (hoverTimeoutRef.current) {
436
+ clearTimeout(hoverTimeoutRef.current);
437
+ }
438
+ if (!isHovering) {
439
+ setIsHovering(true);
440
+ }
441
+ }, [isHovering]);
442
+ const handleMouseLeave = useCallback(() => {
443
+ hoverTimeoutRef.current = setTimeout(() => {
444
+ setIsHovering(false);
445
+ }, 50);
446
+ }, []);
447
+ const handleChevronClick = useCallback(
448
+ (e) => {
449
+ var _a;
450
+ e.preventDefault();
451
+ if (blurTimeoutRef.current) {
452
+ clearTimeout(blurTimeoutRef.current);
453
+ blurTimeoutRef.current = null;
454
+ }
455
+ if (isOpen) {
456
+ setIsOpen(false);
457
+ setIsFocused(false);
458
+ setSearchTerm("");
459
+ setHighlightedIndex(-1);
460
+ (_a = inputRef.current) == null ? void 0 : _a.blur();
461
+ } else {
462
+ if (inputRef.current) {
463
+ inputRef.current.focus();
464
+ }
465
+ handleInputInteraction();
466
+ }
467
+ },
468
+ [isOpen, handleInputInteraction]
469
+ );
470
+ const InputWrapper = ({ children }) => {
471
+ if (disabled && disabledTooltip)
472
+ return /* @__PURE__ */ jsx4(Tooltip_default, { title: disabledTooltip, children });
473
+ return children;
474
+ };
475
+ return /* @__PURE__ */ jsx4(InputWrapper, { children: /* @__PURE__ */ jsxs(
476
+ "div",
477
+ {
478
+ style,
479
+ className: clsx("tw-relative tw-w-full", wrapperClassName, {
480
+ "tw-cursor-not-allowed": disabled
481
+ }),
482
+ ref: dropdownRef,
483
+ onMouseEnter: handleMouseEnter,
484
+ onMouseLeave: handleMouseLeave,
485
+ children: [
486
+ /* @__PURE__ */ jsxs("div", { className: "tw-relative", children: [
487
+ /* @__PURE__ */ jsx4(
488
+ "input",
489
+ {
490
+ ref: inputRef,
491
+ type: "text",
492
+ id,
493
+ name,
494
+ tabIndex,
495
+ autoComplete: "off",
496
+ autoCorrect: "off",
497
+ autoCapitalize: "off",
498
+ spellCheck: "false",
499
+ value: isFocused && enableSearch ? searchTerm : getDisplayValue(),
500
+ onChange: enableSearch ? handleSearchChange : void 0,
501
+ onClick: handleInputInteraction,
502
+ onKeyDown: handleKeyDown,
503
+ className: clsx(
504
+ "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",
505
+ sizeClasses.input,
506
+ sizeClasses.padding,
507
+ variantClasses,
508
+ {
509
+ "tw-bg-white": valueSelected || getDisplayValue() || isFocused,
510
+ "tw-bg-color-gray-5": !valueSelected || !getDisplayValue(),
511
+ "!tw-bg-[#F8F7F6] tw-cursor-not-allowed tw-pointer-events-none": disabled
512
+ },
513
+ // Conditional padding based on label presence
514
+ !label && "tw-flex tw-items-center",
515
+ {
516
+ "!tw-border-color-primary": isFocused && experience === "business"
517
+ },
518
+ {
519
+ "!tw-border-[#804D7B]": isFocused && experience === "personal"
520
+ },
521
+ error ? "!tw-border-color-text-critical " : "tw-border-[#EBE3DD] hover:tw-border-[#C5B7AC]",
522
+ // Add focus state styling
523
+ "focus:tw-shadow-sm focus:tw-ring-offset-1",
524
+ className,
525
+ inputClassName
526
+ // Put inputClassName last so it can override default classes
527
+ ),
528
+ readOnly: !isFocused || !enableSearch
529
+ }
530
+ ),
531
+ label && size !== "small" && /* @__PURE__ */ jsxs(
532
+ "label",
533
+ {
534
+ htmlFor: id,
535
+ className: clsx(
536
+ "tw-absolute tw-left-[18px] tw-pointer-events-none tw-transition-all tw-duration-200 tw-ease-out tw-text-gray-500",
537
+ isActive ? sizeClasses.labelActive : sizeClasses.labelInactive,
538
+ error && "tw-text-color-text-critical",
539
+ labelClassName
540
+ ),
541
+ children: [
542
+ label,
543
+ mandatory && /* @__PURE__ */ jsx4("span", { className: "tw-text-color-text-critical tw-ml-1", children: "*" })
544
+ ]
545
+ }
546
+ ),
547
+ /* @__PURE__ */ jsxs(
548
+ "div",
549
+ {
550
+ className: clsx(
551
+ "tw-absolute tw-right-3 tw--translate-y-1/2 tw-flex tw-items-center",
552
+ {
553
+ "!tw-right-[5px]": doubleCharSearch && !(isHovering && selectedValue && allowClear),
554
+ "tw-top-3 !tw-right-2": size === "small",
555
+ "tw-top-1/2": size !== "small"
556
+ }
557
+ ),
558
+ children: [
559
+ disabled && /* @__PURE__ */ jsx4("div", { className: "tw-absolute tw-right-0 -tw-top-2", children: /* @__PURE__ */ jsx4(Lock, { size: 16 }) }),
560
+ isLoading ? /* @__PURE__ */ jsx4("div", { children: /* @__PURE__ */ jsx4(LoadingSpinner_default, { size: "xs" }) }) : /* @__PURE__ */ jsx4(
561
+ "div",
562
+ {
563
+ className: clsx(
564
+ "tw-transition-all tw-duration-200 tw-cursor-pointer tw-flex tw-items-center",
565
+ // Only rotate chevron when open and not showing clear icon
566
+ isOpen && !(isHovering && selectedValue && allowClear) && "-tw-rotate-180"
567
+ ),
568
+ onMouseDown: (e) => {
569
+ if (isHovering && selectedValue && allowClear) {
570
+ handleClear(e);
571
+ } else {
572
+ handleChevronClick(e);
573
+ }
574
+ },
575
+ children: disabled ? null : isHovering && selectedValue && allowClear ? /* @__PURE__ */ jsx4(
576
+ CrossV2,
577
+ {
578
+ color: "#111827",
579
+ className: clsx({ "tw-mr-1": size !== "small" }),
580
+ size: size === "small" ? 12 : 16
581
+ }
582
+ ) : /* @__PURE__ */ jsx4(
583
+ Chevron,
584
+ {
585
+ className: clsx("tw-text-gray-400"),
586
+ color: "#6B7280"
587
+ }
588
+ )
589
+ }
590
+ )
591
+ ]
592
+ }
593
+ )
594
+ ] }),
595
+ isOpen && /* @__PURE__ */ jsx4(
596
+ "div",
597
+ {
598
+ className: clsx(
599
+ "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",
600
+ { "tw-max-h-60": !doubleCharSearch },
601
+ { "tw-max-h-44": doubleCharSearch },
602
+ dropdownClassName
603
+ ),
604
+ ref: optionListRef,
605
+ children: filteredOptions.length > 0 ? filteredOptions.map((option, index) => /* @__PURE__ */ jsx4(
606
+ "div",
607
+ {
608
+ ref: (el) => optionRefs.current[index] = el,
609
+ onClick: () => handleOptionSelect(option),
610
+ onMouseEnter: () => setHighlightedIndex(index),
611
+ className: clsx(
612
+ "tw-transition-all tw-duration-150",
613
+ { "tw-typography-body2": size !== "small" },
614
+ { "tw-typography-caption1": size === "small" },
615
+ optionClassName
616
+ ),
617
+ children: /* @__PURE__ */ jsx4(
618
+ "div",
619
+ {
620
+ className: clsx(
621
+ "tw-px-4 tw-cursor-pointer tw-py-2 tw-mx-0.5 tw-rounded-xl",
622
+ normalizeValue(selectedValue) === normalizeValue(option.value) ? experience === "personal" ? "tw-bg-[#f1e8fa]" : "tw-bg-[#fff1e1]" : (
623
+ // Highlighted option styling (keyboard navigation)
624
+ index === highlightedIndex ? "tw-bg-[#f3f4f6] tw-text-gray-900" : (
625
+ // Default option styling
626
+ "tw-text-gray-900 hover:tw-bg-[#1118270a]"
627
+ )
628
+ )
629
+ ),
630
+ children: option.label
631
+ }
632
+ )
633
+ },
634
+ doubleCharSearch ? option.label : option.value
635
+ )) : /* @__PURE__ */ jsx4("div", { className: "tw-px-4 tw-py-3 tw-text-gray-500 tw-text-sm", children: "No options found" })
636
+ }
637
+ )
638
+ ]
639
+ }
640
+ ) });
641
+ };
642
+ var arePropsEqual = (prevProps, nextProps) => {
643
+ var _a, _b;
644
+ const criticalProps = [
645
+ "value",
646
+ "valueSelected",
647
+ "options",
648
+ "error",
649
+ "disabled",
650
+ "label",
651
+ "mandatory"
652
+ ];
653
+ for (const prop of criticalProps) {
654
+ if (prevProps[prop] !== nextProps[prop]) {
655
+ return false;
656
+ }
657
+ }
658
+ if (((_a = prevProps.options) == null ? void 0 : _a.length) !== ((_b = nextProps.options) == null ? void 0 : _b.length)) {
659
+ return false;
660
+ }
661
+ if (prevProps.options && nextProps.options) {
662
+ for (let i = 0; i < prevProps.options.length; i++) {
663
+ const prevOpt = prevProps.options[i];
664
+ const nextOpt = nextProps.options[i];
665
+ 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)) {
666
+ return false;
667
+ }
668
+ }
669
+ }
670
+ return true;
671
+ };
672
+ Select.displayName = "Select";
673
+ var Select_default = memo3(Select, arePropsEqual);
674
+
675
+ export {
676
+ Select,
677
+ Select_default
678
+ };