@dmsi/wedgekit-react 0.0.4

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 (596) hide show
  1. package/README.md +35 -0
  2. package/dist/acc.css +3 -0
  3. package/dist/agility.css +7 -0
  4. package/dist/chunk-22YZ6LFN.js +322 -0
  5. package/dist/chunk-25Y2OMTD.js +38 -0
  6. package/dist/chunk-27KIIUAR.js +59 -0
  7. package/dist/chunk-27OSC5OM.js +68 -0
  8. package/dist/chunk-2B7WUAOV.js +28 -0
  9. package/dist/chunk-2EHJFFX4.js +124 -0
  10. package/dist/chunk-2G2E2JMA.js +123 -0
  11. package/dist/chunk-2GC2SPSS.js +130 -0
  12. package/dist/chunk-2KLCMD2M.js +106 -0
  13. package/dist/chunk-2TLQVCQQ.js +130 -0
  14. package/dist/chunk-2Y6GPKXR.js +263 -0
  15. package/dist/chunk-322ATVWD.js +298 -0
  16. package/dist/chunk-35DCQU2F.js +127 -0
  17. package/dist/chunk-3B7FAEF7.js +38 -0
  18. package/dist/chunk-3FLOLZYP.js +21 -0
  19. package/dist/chunk-3IZWY2C7.js +221 -0
  20. package/dist/chunk-3NGYDV56.js +38 -0
  21. package/dist/chunk-3NLKVKFR.js +72 -0
  22. package/dist/chunk-3R7YVBRL.js +135 -0
  23. package/dist/chunk-3RDFNEVD.js +91 -0
  24. package/dist/chunk-3TPGMRVY.js +123 -0
  25. package/dist/chunk-42X2EOOI.js +129 -0
  26. package/dist/chunk-47GJZWOH.js +103 -0
  27. package/dist/chunk-4BUU5MTT.js +263 -0
  28. package/dist/chunk-4C66DLIJ.js +51 -0
  29. package/dist/chunk-4IZG2UCW.js +31 -0
  30. package/dist/chunk-4M7CJVTZ.js +136 -0
  31. package/dist/chunk-4NZBVXM3.js +53 -0
  32. package/dist/chunk-4RD5ZF2V.js +55 -0
  33. package/dist/chunk-4RJKB7LC.js +14 -0
  34. package/dist/chunk-4S4WZ3MQ.js +103 -0
  35. package/dist/chunk-4SV7MJMP.js +340 -0
  36. package/dist/chunk-4T7F5BZZ.js +26 -0
  37. package/dist/chunk-4TH2SUHQ.js +145 -0
  38. package/dist/chunk-56ORPWGF.js +148 -0
  39. package/dist/chunk-5GOBP2JS.js +53 -0
  40. package/dist/chunk-5HIUW5CM.js +128 -0
  41. package/dist/chunk-5K3U4IUW.js +34 -0
  42. package/dist/chunk-5KOZKEEM.js +91 -0
  43. package/dist/chunk-5OIRPFRD.js +114 -0
  44. package/dist/chunk-5QW5SJNW.js +31 -0
  45. package/dist/chunk-5QZO37QK.js +263 -0
  46. package/dist/chunk-5ROMJJRK.js +135 -0
  47. package/dist/chunk-5VHYVTZI.js +123 -0
  48. package/dist/chunk-6277DY3K.js +437 -0
  49. package/dist/chunk-6C5NOV6D.js +263 -0
  50. package/dist/chunk-6CDVHKTS.js +103 -0
  51. package/dist/chunk-6E4OJA7E.js +263 -0
  52. package/dist/chunk-6GBZFWQ4.js +105 -0
  53. package/dist/chunk-6GGLA6DI.js +263 -0
  54. package/dist/chunk-6HKVN4QK.js +340 -0
  55. package/dist/chunk-6HLJFPGY.js +284 -0
  56. package/dist/chunk-6KUUK27D.js +31 -0
  57. package/dist/chunk-6Q5NNY5V.js +135 -0
  58. package/dist/chunk-6VAZR5GK.js +122 -0
  59. package/dist/chunk-6XDXJ3Z3.js +131 -0
  60. package/dist/chunk-6XIXUFSA.js +114 -0
  61. package/dist/chunk-7CG4GVU7.js +21 -0
  62. package/dist/chunk-7DNCGSXK.js +284 -0
  63. package/dist/chunk-7GFGBJCU.js +287 -0
  64. package/dist/chunk-7VA3AERB.js +31 -0
  65. package/dist/chunk-7YJLGGIR.js +83 -0
  66. package/dist/chunk-7ZCBQXHR.js +272 -0
  67. package/dist/chunk-A4BGWCF6.js +221 -0
  68. package/dist/chunk-A6RDEIAN.js +254 -0
  69. package/dist/chunk-AE7SZPWF.js +121 -0
  70. package/dist/chunk-AEQYZFXI.js +50 -0
  71. package/dist/chunk-AFEIB2Y7.js +213 -0
  72. package/dist/chunk-AGQML5BM.js +340 -0
  73. package/dist/chunk-AHBE63RV.js +263 -0
  74. package/dist/chunk-AHHXD4EH.js +31 -0
  75. package/dist/chunk-AILPQXDY.js +47 -0
  76. package/dist/chunk-AKTL6JU5.js +25 -0
  77. package/dist/chunk-AMZFEIAM.js +114 -0
  78. package/dist/chunk-ANI7PKSV.js +38 -0
  79. package/dist/chunk-AO6WGDPJ.js +105 -0
  80. package/dist/chunk-ASDN5OZ3.js +318 -0
  81. package/dist/chunk-ASSOOV4N.js +53 -0
  82. package/dist/chunk-AWQSSKCK.js +32 -0
  83. package/dist/chunk-AWSUZLRR.js +79 -0
  84. package/dist/chunk-B6A3BOGW.js +31 -0
  85. package/dist/chunk-B6NMINKX.js +72 -0
  86. package/dist/chunk-B7UOXS2S.js +221 -0
  87. package/dist/chunk-BDN7SDV5.js +31 -0
  88. package/dist/chunk-BDPJYJD2.js +218 -0
  89. package/dist/chunk-BDYWCYRG.js +263 -0
  90. package/dist/chunk-BENTHNAQ.js +51 -0
  91. package/dist/chunk-BGPBLXQ5.js +131 -0
  92. package/dist/chunk-BKC5DNOX.js +162 -0
  93. package/dist/chunk-BMGYSXYW.js +50 -0
  94. package/dist/chunk-BNHSAFMP.js +93 -0
  95. package/dist/chunk-BNOE4DGB.js +79 -0
  96. package/dist/chunk-BQMI4NKT.js +103 -0
  97. package/dist/chunk-BSBXTPTA.js +84 -0
  98. package/dist/chunk-BYNATA7V.js +114 -0
  99. package/dist/chunk-BZFVPEG3.js +98 -0
  100. package/dist/chunk-C2GYWE4S.js +263 -0
  101. package/dist/chunk-C5NNFQ4B.js +114 -0
  102. package/dist/chunk-C7ALJGJG.js +322 -0
  103. package/dist/chunk-C7S6DKZ6.js +31 -0
  104. package/dist/chunk-CA4BW655.js +50 -0
  105. package/dist/chunk-CABAANHQ.js +249 -0
  106. package/dist/chunk-CELC37U6.js +38 -0
  107. package/dist/chunk-CIWOBFZ4.js +340 -0
  108. package/dist/chunk-CKB4S3O3.js +284 -0
  109. package/dist/chunk-CL6RYGIT.js +263 -0
  110. package/dist/chunk-CLB4OQS5.js +84 -0
  111. package/dist/chunk-CMBMFSP4.js +340 -0
  112. package/dist/chunk-CTHHLBRT.js +90 -0
  113. package/dist/chunk-DDQ4KWHW.js +74 -0
  114. package/dist/chunk-DHWXCPF2.js +56 -0
  115. package/dist/chunk-DV3IMUO6.js +50 -0
  116. package/dist/chunk-DZHPNWUL.js +70 -0
  117. package/dist/chunk-DZLUR2I7.js +34 -0
  118. package/dist/chunk-E5ALT5W7.js +182 -0
  119. package/dist/chunk-E7H6GJIB.js +31 -0
  120. package/dist/chunk-EAJ37R7R.js +31 -0
  121. package/dist/chunk-EDMIKY4Q.js +50 -0
  122. package/dist/chunk-EE4GUGFX.js +31 -0
  123. package/dist/chunk-EHCD3FVZ.js +50 -0
  124. package/dist/chunk-EHOMG5B4.js +31 -0
  125. package/dist/chunk-EM7ODK2O.js +53 -0
  126. package/dist/chunk-ER3HQRPL.js +105 -0
  127. package/dist/chunk-ER6TD3DA.js +30 -0
  128. package/dist/chunk-ESK7AT3B.js +38 -0
  129. package/dist/chunk-ETWMDEUU.js +114 -0
  130. package/dist/chunk-EWX2EDF5.js +236 -0
  131. package/dist/chunk-EXJKOP3Y.js +236 -0
  132. package/dist/chunk-F2YQE6G5.js +145 -0
  133. package/dist/chunk-F3U3RHIB.js +131 -0
  134. package/dist/chunk-F433MJII.js +91 -0
  135. package/dist/chunk-F4JE6AD2.js +160 -0
  136. package/dist/chunk-FCYGYC7R.js +30 -0
  137. package/dist/chunk-FEEMBYZR.js +98 -0
  138. package/dist/chunk-FKQ63FLW.js +91 -0
  139. package/dist/chunk-FNFDOS7L.js +263 -0
  140. package/dist/chunk-FNLYAP3I.js +135 -0
  141. package/dist/chunk-FQVCRL3Z.js +145 -0
  142. package/dist/chunk-FY7PTP6E.js +322 -0
  143. package/dist/chunk-FZ6I2KRT.js +263 -0
  144. package/dist/chunk-FZLYFJ53.js +26 -0
  145. package/dist/chunk-G3AYBQ2Y.js +221 -0
  146. package/dist/chunk-G4V7WZAV.js +72 -0
  147. package/dist/chunk-GDAY5XPY.js +47 -0
  148. package/dist/chunk-GELM4Z36.js +263 -0
  149. package/dist/chunk-GGR5UY3Q.js +83 -0
  150. package/dist/chunk-GK556OXV.js +263 -0
  151. package/dist/chunk-GOB3NB3Q.js +130 -0
  152. package/dist/chunk-GPIG2QUB.js +437 -0
  153. package/dist/chunk-GV63QYC5.js +130 -0
  154. package/dist/chunk-GWNDXZUZ.js +263 -0
  155. package/dist/chunk-H3INEB6H.js +296 -0
  156. package/dist/chunk-H3VQYL46.js +50 -0
  157. package/dist/chunk-H53EBFHV.js +114 -0
  158. package/dist/chunk-HBD6NLMB.js +51 -0
  159. package/dist/chunk-HBTQFVPW.js +121 -0
  160. package/dist/chunk-HCDYAZGJ.js +91 -0
  161. package/dist/chunk-HE3XKR3P.js +130 -0
  162. package/dist/chunk-HK3NQMPY.js +51 -0
  163. package/dist/chunk-HK54SJNM.js +103 -0
  164. package/dist/chunk-HL2IYNCS.js +50 -0
  165. package/dist/chunk-I5A3SU35.js +282 -0
  166. package/dist/chunk-I5HKQSF2.js +59 -0
  167. package/dist/chunk-I7LXSGQA.js +10 -0
  168. package/dist/chunk-IDAZ53A4.js +261 -0
  169. package/dist/chunk-IGQVA7SC.js +41 -0
  170. package/dist/chunk-II6HWGH6.js +295 -0
  171. package/dist/chunk-IIDPTJCI.js +31 -0
  172. package/dist/chunk-IJ6AAL4W.js +59 -0
  173. package/dist/chunk-IKZQIIV3.js +123 -0
  174. package/dist/chunk-ISKELMPI.js +67 -0
  175. package/dist/chunk-IWUZ6NSN.js +218 -0
  176. package/dist/chunk-IYDKL3OH.js +130 -0
  177. package/dist/chunk-IZ75D7KD.js +30 -0
  178. package/dist/chunk-JCLVMFRY.js +122 -0
  179. package/dist/chunk-JDHZQIFC.js +135 -0
  180. package/dist/chunk-JFMZU3WS.js +123 -0
  181. package/dist/chunk-JI54AM6E.js +105 -0
  182. package/dist/chunk-JM4DMO5V.js +91 -0
  183. package/dist/chunk-JNLDVEK3.js +221 -0
  184. package/dist/chunk-JU3RVFK5.js +114 -0
  185. package/dist/chunk-JU4PINK3.js +282 -0
  186. package/dist/chunk-K2YPB4SV.js +38 -0
  187. package/dist/chunk-K3IKUSZW.js +59 -0
  188. package/dist/chunk-K5EXR7F7.js +253 -0
  189. package/dist/chunk-K7CWFWAA.js +263 -0
  190. package/dist/chunk-KENSVWOY.js +151 -0
  191. package/dist/chunk-KGCFZ3ZY.js +263 -0
  192. package/dist/chunk-KJEU2OLC.js +263 -0
  193. package/dist/chunk-KNZWZVWO.js +50 -0
  194. package/dist/chunk-KVQDUSDT.js +33 -0
  195. package/dist/chunk-KX3O6GJ6.js +138 -0
  196. package/dist/chunk-KXFCVFX7.js +50 -0
  197. package/dist/chunk-KXWYWY7O.js +135 -0
  198. package/dist/chunk-KYJFCVGO.js +53 -0
  199. package/dist/chunk-L4SK5HYC.js +114 -0
  200. package/dist/chunk-L5OMTPWT.js +130 -0
  201. package/dist/chunk-LBL6VQ5F.js +51 -0
  202. package/dist/chunk-LCJKAY5H.js +122 -0
  203. package/dist/chunk-LEPHUIU3.js +263 -0
  204. package/dist/chunk-LFNCUQNK.js +103 -0
  205. package/dist/chunk-LIQIMUDD.js +270 -0
  206. package/dist/chunk-LJ2W2FEG.js +134 -0
  207. package/dist/chunk-LJGUNBDS.js +238 -0
  208. package/dist/chunk-LK6UNOMX.js +24 -0
  209. package/dist/chunk-LQLPGMGP.js +238 -0
  210. package/dist/chunk-LRNZOITG.js +318 -0
  211. package/dist/chunk-LSDPH4GX.js +38 -0
  212. package/dist/chunk-LXYDGV6K.js +437 -0
  213. package/dist/chunk-MFNBBTWX.js +177 -0
  214. package/dist/chunk-MGJ3GO6Z.js +284 -0
  215. package/dist/chunk-MIMYQH75.js +91 -0
  216. package/dist/chunk-MKIVQLZW.js +122 -0
  217. package/dist/chunk-MLQQU3ZN.js +31 -0
  218. package/dist/chunk-MLTOT73W.js +38 -0
  219. package/dist/chunk-MM2YBW7A.js +31 -0
  220. package/dist/chunk-MMHTKJ7Z.js +50 -0
  221. package/dist/chunk-MNZUBPVB.js +263 -0
  222. package/dist/chunk-MRXJRTKP.js +62 -0
  223. package/dist/chunk-MSM2B2VT.js +106 -0
  224. package/dist/chunk-MTJDLHR6.js +218 -0
  225. package/dist/chunk-MU4ZBPUT.js +263 -0
  226. package/dist/chunk-MUQHKNFV.js +158 -0
  227. package/dist/chunk-N2XNU5PP.js +91 -0
  228. package/dist/chunk-N4NGR36H.js +263 -0
  229. package/dist/chunk-NA4H2JQX.js +145 -0
  230. package/dist/chunk-NBV3Y6UB.js +315 -0
  231. package/dist/chunk-NEBYCDGE.js +284 -0
  232. package/dist/chunk-NS2KPONF.js +263 -0
  233. package/dist/chunk-O2KOOPL4.js +148 -0
  234. package/dist/chunk-OEIQDS7X.js +50 -0
  235. package/dist/chunk-OJ4PX3ZG.js +59 -0
  236. package/dist/chunk-OOIM4AHV.js +106 -0
  237. package/dist/chunk-OQ2SDHRA.js +267 -0
  238. package/dist/chunk-OQAOAEH5.js +114 -0
  239. package/dist/chunk-OQWOF5CI.js +322 -0
  240. package/dist/chunk-ORMEWXMH.js +37 -0
  241. package/dist/chunk-ORW5CX24.js +316 -0
  242. package/dist/chunk-OUHI4UBN.js +38 -0
  243. package/dist/chunk-OULD24TE.js +98 -0
  244. package/dist/chunk-P66A67NV.js +30 -0
  245. package/dist/chunk-PC5JSEHD.js +269 -0
  246. package/dist/chunk-PLCJ56FF.js +72 -0
  247. package/dist/chunk-PMNRGAPH.js +191 -0
  248. package/dist/chunk-PMQOPIJZ.js +75 -0
  249. package/dist/chunk-PPU6PK34.js +263 -0
  250. package/dist/chunk-PQEWSSM5.js +31 -0
  251. package/dist/chunk-PY6MF2II.js +51 -0
  252. package/dist/chunk-QBXVAKCM.js +59 -0
  253. package/dist/chunk-QDAFX66E.js +55 -0
  254. package/dist/chunk-QEXYUSGH.js +201 -0
  255. package/dist/chunk-QFEYPU44.js +91 -0
  256. package/dist/chunk-QJWVR7FR.js +387 -0
  257. package/dist/chunk-QKKRKHFR.js +38 -0
  258. package/dist/chunk-QKQ4M6UK.js +263 -0
  259. package/dist/chunk-QTKPVQAY.js +66 -0
  260. package/dist/chunk-R3IEEDQ6.js +284 -0
  261. package/dist/chunk-R4UZI5WE.js +171 -0
  262. package/dist/chunk-RBXILAST.js +437 -0
  263. package/dist/chunk-RENGWIST.js +263 -0
  264. package/dist/chunk-REZ33AJK.js +172 -0
  265. package/dist/chunk-RGI3V47F.js +216 -0
  266. package/dist/chunk-RMIQDOJV.js +287 -0
  267. package/dist/chunk-ROYYCT4A.js +31 -0
  268. package/dist/chunk-RWVJ2YAO.js +131 -0
  269. package/dist/chunk-RZLSOKZB.js +123 -0
  270. package/dist/chunk-S3POCSOH.js +31 -0
  271. package/dist/chunk-S4IHG5J6.js +54 -0
  272. package/dist/chunk-SEKKGFM6.js +28 -0
  273. package/dist/chunk-SHQVFIVR.js +122 -0
  274. package/dist/chunk-SPQH4CSJ.js +31 -0
  275. package/dist/chunk-SPV52UKB.js +50 -0
  276. package/dist/chunk-SSBZHFHQ.js +123 -0
  277. package/dist/chunk-STVC6SBJ.js +91 -0
  278. package/dist/chunk-SY3HT54E.js +91 -0
  279. package/dist/chunk-T23U4LBM.js +148 -0
  280. package/dist/chunk-TBHTISFW.js +119 -0
  281. package/dist/chunk-TC5ACZ3X.js +263 -0
  282. package/dist/chunk-TD5JMMNX.js +72 -0
  283. package/dist/chunk-TDEEN7O7.js +50 -0
  284. package/dist/chunk-TKRAU33B.js +53 -0
  285. package/dist/chunk-TMLPJ27P.js +126 -0
  286. package/dist/chunk-TTKSTVEF.js +41 -0
  287. package/dist/chunk-TVYKK7ZX.js +123 -0
  288. package/dist/chunk-TWZZB4WO.js +114 -0
  289. package/dist/chunk-TYI74BSP.js +62 -0
  290. package/dist/chunk-TZCA2T5D.js +282 -0
  291. package/dist/chunk-U2CMWI75.js +250 -0
  292. package/dist/chunk-UA7N4NQJ.js +30 -0
  293. package/dist/chunk-UEN5BURK.js +106 -0
  294. package/dist/chunk-UGXT677T.js +437 -0
  295. package/dist/chunk-ULCNZZBV.js +38 -0
  296. package/dist/chunk-UO4T3RQ7.js +62 -0
  297. package/dist/chunk-US3SPKKB.js +266 -0
  298. package/dist/chunk-UU3FA6LV.js +72 -0
  299. package/dist/chunk-UUNHTQDU.js +79 -0
  300. package/dist/chunk-UUZXVVJY.js +161 -0
  301. package/dist/chunk-UZJMB6V7.js +26 -0
  302. package/dist/chunk-V3HXUE6V.js +221 -0
  303. package/dist/chunk-V6UMVJGA.js +53 -0
  304. package/dist/chunk-V7C6DTJ6.js +72 -0
  305. package/dist/chunk-VFWFORJJ.js +131 -0
  306. package/dist/chunk-VHWB6H64.js +75 -0
  307. package/dist/chunk-VI62SXXU.js +284 -0
  308. package/dist/chunk-VK3FB67Z.js +31 -0
  309. package/dist/chunk-VKC7QT46.js +83 -0
  310. package/dist/chunk-VVTY2NT4.js +105 -0
  311. package/dist/chunk-VWEOVI4O.js +123 -0
  312. package/dist/chunk-WOCMJF6O.js +221 -0
  313. package/dist/chunk-WPDU5H5L.js +114 -0
  314. package/dist/chunk-WQMFGEAF.js +235 -0
  315. package/dist/chunk-WTAZ6P6T.js +263 -0
  316. package/dist/chunk-WUJFEG3H.js +118 -0
  317. package/dist/chunk-WUTFZGXS.js +50 -0
  318. package/dist/chunk-WVUIIBRR.js +51 -0
  319. package/dist/chunk-X65IBJJM.js +436 -0
  320. package/dist/chunk-XATMLZOP.js +263 -0
  321. package/dist/chunk-XFCRKJRI.js +261 -0
  322. package/dist/chunk-XGKHSZ6E.js +38 -0
  323. package/dist/chunk-XJAQVF2E.js +83 -0
  324. package/dist/chunk-XQX7HSL5.js +38 -0
  325. package/dist/chunk-XTP3ODBD.js +56 -0
  326. package/dist/chunk-XWF3ZJCZ.js +97 -0
  327. package/dist/chunk-XX3GHFG5.js +121 -0
  328. package/dist/chunk-XZ6AMNDQ.js +290 -0
  329. package/dist/chunk-Y2LOHSZL.js +72 -0
  330. package/dist/chunk-Y66VCVZZ.js +122 -0
  331. package/dist/chunk-YD462QK7.js +346 -0
  332. package/dist/chunk-YELD6VJI.js +68 -0
  333. package/dist/chunk-YHPZ5T3W.js +91 -0
  334. package/dist/chunk-YJV7JCIC.js +38 -0
  335. package/dist/chunk-YMZUZ5HX.js +263 -0
  336. package/dist/chunk-YN7MUHAZ.js +218 -0
  337. package/dist/chunk-YOCKCBUA.js +72 -0
  338. package/dist/chunk-YPFUW2PT.js +306 -0
  339. package/dist/chunk-YRLRIQNP.js +284 -0
  340. package/dist/chunk-YRTR6KJN.js +210 -0
  341. package/dist/chunk-YSSJHCRC.js +221 -0
  342. package/dist/chunk-YWLJJNJY.js +259 -0
  343. package/dist/chunk-YYRH2SGW.js +114 -0
  344. package/dist/chunk-YZRIJ4AP.js +263 -0
  345. package/dist/chunk-Z4UCFUF7.js +299 -0
  346. package/dist/chunk-Z64CLA4J.js +53 -0
  347. package/dist/chunk-ZCFOYW2U.js +296 -0
  348. package/dist/chunk-ZEYZVUG5.js +53 -0
  349. package/dist/chunk-ZHRZMJA3.js +31 -0
  350. package/dist/chunk-ZJQAMKIP.js +113 -0
  351. package/dist/chunk-ZRQZOT6X.js +141 -0
  352. package/dist/chunk-ZUTAZW53.js +306 -0
  353. package/dist/chunk-ZVJ2T3DC.js +79 -0
  354. package/dist/chunk-ZWJZHUKU.js +50 -0
  355. package/dist/chunk-ZXQKFHBO.js +221 -0
  356. package/dist/components/Breadcrumbs.cjs +376 -0
  357. package/dist/components/Breadcrumbs.js +90 -0
  358. package/dist/components/Button.cjs +319 -0
  359. package/dist/components/Button.js +8 -0
  360. package/dist/components/Calendar.cjs +219 -0
  361. package/dist/components/Calendar.js +10 -0
  362. package/dist/components/CalendarRange.cjs +520 -0
  363. package/dist/components/CalendarRange.js +13 -0
  364. package/dist/components/CalendarRange.stories.cjs +1 -0
  365. package/dist/components/CalendarRange.stories.js +0 -0
  366. package/dist/components/Caption.cjs +283 -0
  367. package/dist/components/Caption.js +80 -0
  368. package/dist/components/Checkbox.cjs +377 -0
  369. package/dist/components/Checkbox.js +11 -0
  370. package/dist/components/ContentTab.cjs +382 -0
  371. package/dist/components/ContentTab.js +10 -0
  372. package/dist/components/ContentTabs.cjs +472 -0
  373. package/dist/components/ContentTabs.js +98 -0
  374. package/dist/components/DMSiLogo.cjs +79 -0
  375. package/dist/components/DMSiLogo.js +56 -0
  376. package/dist/components/DataGrid.cjs +2985 -0
  377. package/dist/components/DataGrid.js +639 -0
  378. package/dist/components/DataGridCell.cjs +1905 -0
  379. package/dist/components/DataGridCell.js +24 -0
  380. package/dist/components/DataTable.cjs +791 -0
  381. package/dist/components/DataTable.js +720 -0
  382. package/dist/components/DateInput.cjs +1128 -0
  383. package/dist/components/DateInput.js +170 -0
  384. package/dist/components/DateRangeInput.cjs +1129 -0
  385. package/dist/components/DateRangeInput.js +171 -0
  386. package/dist/components/DebugJson.cjs +50 -0
  387. package/dist/components/DebugJson.js +27 -0
  388. package/dist/components/Display.cjs +234 -0
  389. package/dist/components/Display.js +12 -0
  390. package/dist/components/Display1.cjs +223 -0
  391. package/dist/components/Display1.js +8 -0
  392. package/dist/components/Display2.cjs +220 -0
  393. package/dist/components/Display2.js +46 -0
  394. package/dist/components/EditingContext.cjs +73 -0
  395. package/dist/components/EditingContext.js +35 -0
  396. package/dist/components/FilterGroup.cjs +903 -0
  397. package/dist/components/FilterGroup.js +213 -0
  398. package/dist/components/FullViewportBox.cjs +35 -0
  399. package/dist/components/FullViewportBox.js +12 -0
  400. package/dist/components/Grid.cjs +69 -0
  401. package/dist/components/Grid.js +36 -0
  402. package/dist/components/GridContainer.cjs +125 -0
  403. package/dist/components/GridContainer.js +92 -0
  404. package/dist/components/Heading.cjs +238 -0
  405. package/dist/components/Heading.js +14 -0
  406. package/dist/components/Heading1.cjs +223 -0
  407. package/dist/components/Heading1.js +49 -0
  408. package/dist/components/Heading2.cjs +223 -0
  409. package/dist/components/Heading2.js +8 -0
  410. package/dist/components/Heading3.cjs +223 -0
  411. package/dist/components/Heading3.js +8 -0
  412. package/dist/components/HorizontalDivider.cjs +33 -0
  413. package/dist/components/HorizontalDivider.js +10 -0
  414. package/dist/components/Icon.cjs +98 -0
  415. package/dist/components/Icon.js +7 -0
  416. package/dist/components/Input.cjs +670 -0
  417. package/dist/components/Input.js +21 -0
  418. package/dist/components/InputGroup.cjs +270 -0
  419. package/dist/components/InputGroup.js +60 -0
  420. package/dist/components/Label.cjs +223 -0
  421. package/dist/components/Label.js +8 -0
  422. package/dist/components/Link.cjs +262 -0
  423. package/dist/components/Link.js +8 -0
  424. package/dist/components/List.cjs +37 -0
  425. package/dist/components/List.js +14 -0
  426. package/dist/components/LiveChatComponent.cjs +63 -0
  427. package/dist/components/LiveChatComponent.js +40 -0
  428. package/dist/components/LogoAgilityTopBar.cjs +115 -0
  429. package/dist/components/LogoAgilityTopBar.js +92 -0
  430. package/dist/components/LogoDMSiTopBar.cjs +79 -0
  431. package/dist/components/LogoDMSiTopBar.js +7 -0
  432. package/dist/components/LogoMillworkTopBar.cjs +221 -0
  433. package/dist/components/LogoMillworkTopBar.js +198 -0
  434. package/dist/components/MainBar.cjs +210 -0
  435. package/dist/components/MainBar.js +64 -0
  436. package/dist/components/Menu.cjs +437 -0
  437. package/dist/components/Menu.js +11 -0
  438. package/dist/components/MenuOption.cjs +483 -0
  439. package/dist/components/MenuOption.js +13 -0
  440. package/dist/components/Modal.cjs +688 -0
  441. package/dist/components/Modal.js +195 -0
  442. package/dist/components/ModalButtons.cjs +381 -0
  443. package/dist/components/ModalButtons.js +10 -0
  444. package/dist/components/ModalContent.cjs +34 -0
  445. package/dist/components/ModalContent.js +7 -0
  446. package/dist/components/ModalHeader.cjs +418 -0
  447. package/dist/components/ModalHeader.js +11 -0
  448. package/dist/components/ModalScrim.cjs +65 -0
  449. package/dist/components/ModalScrim.js +7 -0
  450. package/dist/components/NavigationTab.cjs +431 -0
  451. package/dist/components/NavigationTab.js +10 -0
  452. package/dist/components/NavigationTabs.cjs +477 -0
  453. package/dist/components/NavigationTabs.js +56 -0
  454. package/dist/components/Notification.cjs +529 -0
  455. package/dist/components/Notification.js +104 -0
  456. package/dist/components/OptionPill.cjs +478 -0
  457. package/dist/components/OptionPill.js +11 -0
  458. package/dist/components/Paragraph.cjs +231 -0
  459. package/dist/components/Paragraph.js +8 -0
  460. package/dist/components/Password.cjs +698 -0
  461. package/dist/components/Password.js +53 -0
  462. package/dist/components/ProjectBar.cjs +242 -0
  463. package/dist/components/ProjectBar.js +63 -0
  464. package/dist/components/Radio.cjs +349 -0
  465. package/dist/components/Radio.js +131 -0
  466. package/dist/components/Search.cjs +765 -0
  467. package/dist/components/Search.js +12 -0
  468. package/dist/components/Select.cjs +750 -0
  469. package/dist/components/Select.js +12 -0
  470. package/dist/components/SideMenu.cjs +54 -0
  471. package/dist/components/SideMenu.js +21 -0
  472. package/dist/components/SideMenuGroup.cjs +393 -0
  473. package/dist/components/SideMenuGroup.js +83 -0
  474. package/dist/components/SideMenuItem.cjs +359 -0
  475. package/dist/components/SideMenuItem.js +70 -0
  476. package/dist/components/Stack.cjs +109 -0
  477. package/dist/components/Stack.js +7 -0
  478. package/dist/components/StatusPill.cjs +265 -0
  479. package/dist/components/StatusPill.js +52 -0
  480. package/dist/components/Stepper.cjs +883 -0
  481. package/dist/components/Stepper.js +105 -0
  482. package/dist/components/Subheader.cjs +226 -0
  483. package/dist/components/Subheader.js +8 -0
  484. package/dist/components/Surface.cjs +98 -0
  485. package/dist/components/Surface.js +7 -0
  486. package/dist/components/Swatch.cjs +779 -0
  487. package/dist/components/Swatch.js +398 -0
  488. package/dist/components/Textarea.cjs +269 -0
  489. package/dist/components/Textarea.js +96 -0
  490. package/dist/components/Theme.cjs +36 -0
  491. package/dist/components/Theme.js +13 -0
  492. package/dist/components/Time.cjs +1059 -0
  493. package/dist/components/Time.js +365 -0
  494. package/dist/components/Toast.cjs +644 -0
  495. package/dist/components/Toast.js +218 -0
  496. package/dist/components/Tooltip.cjs +273 -0
  497. package/dist/components/Tooltip.js +9 -0
  498. package/dist/components/TopBar.cjs +352 -0
  499. package/dist/components/TopBar.js +132 -0
  500. package/dist/components/useInfiniteScroll.cjs +57 -0
  501. package/dist/components/useInfiniteScroll.js +8 -0
  502. package/dist/components/useMatchesMedia.cjs +53 -0
  503. package/dist/components/useMatchesMedia.js +9 -0
  504. package/dist/components/useMenuSystem.cjs +358 -0
  505. package/dist/components/useMenuSystem.js +11 -0
  506. package/dist/components/useMounted.cjs +39 -0
  507. package/dist/components/useMounted.js +8 -0
  508. package/dist/fonts.css +19 -0
  509. package/dist/icons-light-QXLRBPC4.woff2 +0 -0
  510. package/dist/icons-light[FILL]-PPZXOLWS.woff2 +0 -0
  511. package/dist/icons-normal-MJATZ73K.woff2 +0 -0
  512. package/dist/icons-normal[FILL]-PPZXOLWS.woff2 +0 -0
  513. package/dist/index.css +4049 -0
  514. package/dist/millwork.css +4 -0
  515. package/dist/open-sans-55T6A4JE.woff2 +0 -0
  516. package/dist/types.cjs +18 -0
  517. package/dist/types.js +0 -0
  518. package/package.json +66 -0
  519. package/src/brand.css +110 -0
  520. package/src/classNames.ts +144 -0
  521. package/src/components/Breadcrumbs.tsx +116 -0
  522. package/src/components/Button.tsx +210 -0
  523. package/src/components/CalendarRange.tsx +429 -0
  524. package/src/components/Caption.tsx +101 -0
  525. package/src/components/Checkbox.tsx +195 -0
  526. package/src/components/ContentTab.tsx +66 -0
  527. package/src/components/ContentTabs.tsx +103 -0
  528. package/src/components/DMSiLogo.tsx +32 -0
  529. package/src/components/DataGrid.tsx +819 -0
  530. package/src/components/DataGridCell.tsx +384 -0
  531. package/src/components/DataTable.tsx +835 -0
  532. package/src/components/DateInput.tsx +188 -0
  533. package/src/components/DateRangeInput.tsx +179 -0
  534. package/src/components/DebugJson.tsx +24 -0
  535. package/src/components/Display.tsx +60 -0
  536. package/src/components/EditingContext.tsx +40 -0
  537. package/src/components/FilterGroup.tsx +211 -0
  538. package/src/components/FullViewportBox.tsx +11 -0
  539. package/src/components/Grid.tsx +75 -0
  540. package/src/components/GridContainer.tsx +124 -0
  541. package/src/components/Heading.tsx +66 -0
  542. package/src/components/HorizontalDivider.tsx +3 -0
  543. package/src/components/Icon.tsx +36 -0
  544. package/src/components/Input.tsx +508 -0
  545. package/src/components/InputGroup.tsx +51 -0
  546. package/src/components/Label.tsx +40 -0
  547. package/src/components/Link.tsx +106 -0
  548. package/src/components/List.tsx +10 -0
  549. package/src/components/LiveChatComponent.tsx +56 -0
  550. package/src/components/LogoAgilityTopBar.tsx +53 -0
  551. package/src/components/LogoDMSiTopBar.tsx +32 -0
  552. package/src/components/LogoMillworkTopBar.tsx +118 -0
  553. package/src/components/MainBar.tsx +82 -0
  554. package/src/components/Menu.tsx +279 -0
  555. package/src/components/MenuOption.tsx +275 -0
  556. package/src/components/Modal.tsx +211 -0
  557. package/src/components/ModalButtons.tsx +35 -0
  558. package/src/components/ModalContent.tsx +5 -0
  559. package/src/components/ModalHeader.tsx +30 -0
  560. package/src/components/ModalScrim.tsx +34 -0
  561. package/src/components/NavigationTab.tsx +89 -0
  562. package/src/components/NavigationTabs.tsx +63 -0
  563. package/src/components/Notification.tsx +113 -0
  564. package/src/components/OptionPill.tsx +114 -0
  565. package/src/components/Paragraph.tsx +49 -0
  566. package/src/components/Password.tsx +46 -0
  567. package/src/components/ProjectBar.tsx +76 -0
  568. package/src/components/Radio.tsx +140 -0
  569. package/src/components/Search.tsx +129 -0
  570. package/src/components/Select.tsx +106 -0
  571. package/src/components/SideMenu.tsx +21 -0
  572. package/src/components/SideMenuGroup.tsx +81 -0
  573. package/src/components/SideMenuItem.tsx +90 -0
  574. package/src/components/Stack.tsx +114 -0
  575. package/src/components/StatusPill.tsx +51 -0
  576. package/src/components/Stepper.tsx +91 -0
  577. package/src/components/Subheader.tsx +44 -0
  578. package/src/components/Surface.tsx +35 -0
  579. package/src/components/Swatch.tsx +293 -0
  580. package/src/components/Textarea.tsx +101 -0
  581. package/src/components/Theme.tsx +13 -0
  582. package/src/components/Time.tsx +457 -0
  583. package/src/components/Toast.tsx +244 -0
  584. package/src/components/Tooltip.tsx +137 -0
  585. package/src/components/TopBar.tsx +124 -0
  586. package/src/components/useInfiniteScroll.tsx +40 -0
  587. package/src/components/useMatchesMedia.tsx +28 -0
  588. package/src/components/useMenuSystem.tsx +367 -0
  589. package/src/components/useMounted.tsx +14 -0
  590. package/src/darkmode.css +125 -0
  591. package/src/fonts.css +21 -0
  592. package/src/index.css +489 -0
  593. package/src/index.tsx +2 -0
  594. package/src/types.ts +149 -0
  595. package/src/utils/formatting.tsx +81 -0
  596. package/src/utils.ts +23 -0
@@ -0,0 +1,2985 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __defProps = Object.defineProperties;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
8
+ var __getOwnPropNames = Object.getOwnPropertyNames;
9
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
10
+ var __getProtoOf = Object.getPrototypeOf;
11
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
12
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
13
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
14
+ var __spreadValues = (a, b) => {
15
+ for (var prop in b || (b = {}))
16
+ if (__hasOwnProp.call(b, prop))
17
+ __defNormalProp(a, prop, b[prop]);
18
+ if (__getOwnPropSymbols)
19
+ for (var prop of __getOwnPropSymbols(b)) {
20
+ if (__propIsEnum.call(b, prop))
21
+ __defNormalProp(a, prop, b[prop]);
22
+ }
23
+ return a;
24
+ };
25
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
26
+ var __objRest = (source, exclude) => {
27
+ var target = {};
28
+ for (var prop in source)
29
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
30
+ target[prop] = source[prop];
31
+ if (source != null && __getOwnPropSymbols)
32
+ for (var prop of __getOwnPropSymbols(source)) {
33
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
34
+ target[prop] = source[prop];
35
+ }
36
+ return target;
37
+ };
38
+ var __export = (target, all) => {
39
+ for (var name in all)
40
+ __defProp(target, name, { get: all[name], enumerable: true });
41
+ };
42
+ var __copyProps = (to, from, except, desc) => {
43
+ if (from && typeof from === "object" || typeof from === "function") {
44
+ for (let key of __getOwnPropNames(from))
45
+ if (!__hasOwnProp.call(to, key) && key !== except)
46
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
47
+ }
48
+ return to;
49
+ };
50
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
51
+ // If the importer is in node compatibility mode or this is not an ESM
52
+ // file that has been converted to a CommonJS file using a Babel-
53
+ // compatible transform (i.e. "__esModule" has not been set), then set
54
+ // "default" to the CommonJS "module.exports" for node compatibility.
55
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
56
+ mod
57
+ ));
58
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
59
+
60
+ // src/components/DataGrid.tsx
61
+ var DataGrid_exports = {};
62
+ __export(DataGrid_exports, {
63
+ DataGrid: () => DataGrid
64
+ });
65
+ module.exports = __toCommonJS(DataGrid_exports);
66
+ var import_react12 = __toESM(require("react"), 1);
67
+ var import_react_table = require("@tanstack/react-table");
68
+ var import_react_virtual = require("@tanstack/react-virtual");
69
+ var import_core = require("@dnd-kit/core");
70
+ var import_sortable2 = require("@dnd-kit/sortable");
71
+ var import_modifiers = require("@dnd-kit/modifiers");
72
+
73
+ // src/components/Button.tsx
74
+ var import_clsx2 = __toESM(require("clsx"), 1);
75
+
76
+ // src/classNames.ts
77
+ var import_clsx = __toESM(require("clsx"), 1);
78
+ var typography = {
79
+ display1: (0, import_clsx.default)(
80
+ "font-sans font-semibold",
81
+ "text-display-1-mobile desktop:text-display-1-desktop compact:text-display-1-desktop-compact",
82
+ "leading-display-1-mobile desktop:leading-display-1-desktop"
83
+ ),
84
+ display2: (0, import_clsx.default)(
85
+ "font-sans font-bold",
86
+ "text-display-2-mobile desktop:text-display-2-desktop compact:text-display-2-desktop-compact",
87
+ "leading-display-2-mobile desktop:leading-display-2-desktop"
88
+ ),
89
+ heading1: (0, import_clsx.default)(
90
+ "font-sans font-semibold",
91
+ "text-heading-1-mobile desktop:text-heading-1-desktop compact:text-heading-1-desktop-compact",
92
+ "leading-heading-1-mobile desktop:leading-heading-1-desktop"
93
+ ),
94
+ heading2: (0, import_clsx.default)(
95
+ "font-sans font-normal",
96
+ "text-heading-2-mobile desktop:text-heading-2-desktop compact:text-heading-2-desktop-compact",
97
+ "leading-heading-2-mobile desktop:leading-heading-2-desktop"
98
+ ),
99
+ heading3: (0, import_clsx.default)(
100
+ "font-sans font-semibold",
101
+ "text-heading-3-mobile desktop:text-heading-3-desktop compact:text-heading-3-desktop-compact",
102
+ "leading-heading-3-mobile desktop:leading-heading-3-desktop"
103
+ ),
104
+ subheader: (0, import_clsx.default)(
105
+ "font-sans font-semibold",
106
+ "text-subheader-mobile desktop:text-subheader-desktop compact:text-subheader-desktop-compact",
107
+ "leading-subheader-mobile desktop:leading-subheader-desktop"
108
+ ),
109
+ link: (0, import_clsx.default)(
110
+ "font-sans font-normal",
111
+ "text-link-mobile desktop:text-link-desktop compact:text-link-desktop-compact",
112
+ "leading-link-mobile desktop:leading-link-desktop"
113
+ ),
114
+ buttonLabel: (0, import_clsx.default)(
115
+ "font-sans font-semibold",
116
+ "text-label-mobile desktop:text-label-desktop compact:text-label-desktop-compact",
117
+ "leading-label-mobile desktop:leading-label-desktop"
118
+ ),
119
+ label: (0, import_clsx.default)(
120
+ "font-sans font-semibold",
121
+ "text-label-mobile desktop:text-label-desktop compact:text-label-desktop-compact",
122
+ "leading-label-mobile desktop:leading-label-desktop"
123
+ ),
124
+ paragraph: (0, import_clsx.default)(
125
+ "font-sans font-normal",
126
+ "text-paragraph-mobile desktop:text-paragraph-desktop compact:text-paragraph-desktop-compact",
127
+ "leading-paragraph-mobile desktop:leading-paragraph-desktop"
128
+ ),
129
+ caption: (0, import_clsx.default)(
130
+ "font-sans font-normal",
131
+ "text-caption-mobile desktop:text-caption-desktop compact:text-caption-desktop-compact",
132
+ "leading-caption-mobile desktop:leading-caption-desktop"
133
+ )
134
+ };
135
+ var baseTransition = (0, import_clsx.default)(
136
+ "transition-colors duration-100 ease-in-out"
137
+ );
138
+ var componentGap = (0, import_clsx.default)(
139
+ "gap-mobile-component-gap desktop:gap-desktop-component-gap compact:gap-desktop-compact-component-gap"
140
+ );
141
+ var paddingUsingComponentGap = (0, import_clsx.default)(
142
+ "p-mobile-component-gap desktop:p-desktop-component-gap compact:p-desktop-compact-component-gap"
143
+ );
144
+ var paddingYUsingLayoutGroupGap = (0, import_clsx.default)(
145
+ "py-mobile-layout-group-gap desktop:py-desktop-layout-group-gap compact:py-desktop-compact-layout-group-gap"
146
+ );
147
+ var componentPadding = (0, import_clsx.default)(
148
+ "p-mobile-component-padding desktop:p-desktop-component-padding compact:p-desktop-compact-component-padding"
149
+ );
150
+ var componentPaddingBottom = (0, import_clsx.default)(
151
+ "pb-mobile-component-padding desktop:pb-desktop-component-padding compact:pb-desktop-compact-component-padding"
152
+ );
153
+ var componentPaddingY = (0, import_clsx.default)(
154
+ "py-mobile-component-padding desktop:py-desktop-component-padding compact:py-desktop-compact-component-padding"
155
+ );
156
+ var componentPaddingXUsingComponentGap = (0, import_clsx.default)(
157
+ "px-mobile-component-gap desktop:px-desktop-component-gap compact:px-desktop-compact-component-gap"
158
+ );
159
+ var componentPaddingYUsingComponentGap = (0, import_clsx.default)(
160
+ "py-mobile-component-gap desktop:py-desktop-component-gap compact:py-desktop-compact-component-gap"
161
+ );
162
+ var componentPaddingMinusBorder = (0, import_clsx.default)(
163
+ "p-[calc(var(--spacing-mobile-component-padding)_-_1px)] desktop:p-[calc(var(--spacing-desktop-component-padding)_-_1px)] compact:p-[calc(var(--spacing-desktop-compact-component-padding)_-_1px)]"
164
+ );
165
+ var componentPaddingMinus2pxBorder = (0, import_clsx.default)(
166
+ "p-[calc(var(--spacing-mobile-component-padding)_-_2px)] desktop:p-[calc(var(--spacing-desktop-component-padding)_-_2px)] compact:p-[calc(var(--spacing-desktop-compact-component-padding)_-_2px)]"
167
+ );
168
+ var layoutPaddingBottom = (0, import_clsx.default)(
169
+ "pb-mobile-layout-padding desktop:pb-desktop-layout-padding compact:pb-desktop-compact-layout-padding"
170
+ );
171
+ var layoutPaddingY = (0, import_clsx.default)(
172
+ "py-mobile-layout-padding desktop:py-desktop-layout-padding compact:py-desktop-compact-layout-padding"
173
+ );
174
+ var containerPaddingX = (0, import_clsx.default)(
175
+ "px-mobile-container-padding desktop:px-desktop-container-padding compact:px-desktop-compact-container-padding"
176
+ );
177
+ var containerPaddingY = (0, import_clsx.default)(
178
+ "py-mobile-container-padding desktop:py-desktop-container-padding compact:py-desktop-compact-container-padding"
179
+ );
180
+ var layoutGroupGapPaddingY = (0, import_clsx.default)(
181
+ "py-mobile-layout-group-gap desktop:py-desktop-layout-group-gap compact:py-desktop-compact-layout-group-gap"
182
+ );
183
+ var layoutGroupGap = (0, import_clsx.default)(
184
+ "gap-mobile-layout-group-gap desktop:gap-desktop-layout-group-gap compact:gap-desktop-compact-layout-group-gap"
185
+ );
186
+ var layoutGap = (0, import_clsx.default)(
187
+ "gap-mobile-layout-gap desktop:gap-desktop-layout-gap compact:gap-desktop-compact-layout-gap"
188
+ );
189
+ var gapUsingContainerPadding = (0, import_clsx.default)(
190
+ "gap-mobile-container-padding desktop:gap-desktop-container-padding compact:gap-desktop-compact-container-padding"
191
+ );
192
+
193
+ // src/components/Button.tsx
194
+ var import_jsx_runtime = require("react/jsx-runtime");
195
+ var Button = (_a) => {
196
+ var _b = _a, {
197
+ variant = "primary",
198
+ as = "button",
199
+ block,
200
+ leftIcon,
201
+ rightIcon,
202
+ className,
203
+ classNameLabel,
204
+ disabled = false,
205
+ children,
206
+ iconOnly = false,
207
+ colorClassName,
208
+ href
209
+ } = _b, props = __objRest(_b, [
210
+ "variant",
211
+ "as",
212
+ "block",
213
+ "leftIcon",
214
+ "rightIcon",
215
+ "className",
216
+ "classNameLabel",
217
+ "disabled",
218
+ "children",
219
+ "iconOnly",
220
+ "colorClassName",
221
+ "href"
222
+ ]);
223
+ const primaryVariantStyles = variant === "primary" && (0, import_clsx2.default)(
224
+ (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-on-action-primary-normal",
225
+ "bg-background-action-primary-normal border-background-action-primary-normal",
226
+ "hover:bg-background-action-primary-hover hover:border-background-action-primary-hover",
227
+ "focus:bg-background-action-primary-hover focus:border-background-action-primary-hover focus:outline-0",
228
+ "active:bg-background-action-primary-active active:border-background-action-primary-active",
229
+ "disabled:bg-background-action-primary-disabled disabled:border-background-action-primary-disabled disabled:text-text-on-action-primary-disabled"
230
+ );
231
+ const secondaryVariantStyles = variant === "secondary" && (0, import_clsx2.default)(
232
+ (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-action-primary-normal",
233
+ "bg-background-action-secondary-normal border-border-action-normal",
234
+ "hover:bg-background-action-secondary-hover hover:border-border-action-hover hover:text-text-action-primary-hover",
235
+ "focus:bg-background-action-secondary-hover focus:border-border-action-hover focus:text-text-action-primary-hover focus:outline-0",
236
+ "active:bg-background-action-secondary-active active:border-border-action-active active:text-text-action-primary-active",
237
+ "disabled:bg-background-action-primary-disabled disabled:border-border-action-disabled disabled:text-text-action-primary-disabled"
238
+ );
239
+ const tertiaryVariantStyles = variant === "tertiary" && (0, import_clsx2.default)(
240
+ "bg-transparent border-transparent",
241
+ iconOnly ? (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-icon-action-primary-normal" : (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-action-primary-normal",
242
+ "bg-transparent border-transparent",
243
+ "hover:bg-background-action-secondary-hover hover:border-background-action-secondary-hover hover:text-text-action-primary-hover",
244
+ "focus:bg-background-action-secondary-hover focus:border-background-action-secondary-hover focus:text-text-action-primary-hover focus:outline-0",
245
+ "active:bg-background-action-secondary-active active:border-transparent active:text-text-action-primary-active",
246
+ "disabled:bg-transparent disabled:border-transparent disabled:text-text-action-primary-disabled"
247
+ );
248
+ const primaryCriticalVariantStyles = variant === "primary-critical" && (0, import_clsx2.default)(
249
+ (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-on-action-primary-normal",
250
+ "bg-background-action-critical-primary-normal border-background-action-critical-primary-normal",
251
+ "hover:bg-background-action-critical-primary-hover hover:border-background-action-critical-primary-hover",
252
+ "focus:bg-background-action-critical-primary-hover focus:border-background-action-critical-primary-hover focus:outline-0",
253
+ "active:bg-background-action-critical-primary-active active:border-background-action-critical-primary-active",
254
+ "disabled:bg-background-action-critical-primary-disabled disabled:border-background-action-critical-primary-disabled disabled:text-text-on-action-primary-disabled"
255
+ );
256
+ const secondaryCriticalVariantStyles = variant === "secondary-critical" && (0, import_clsx2.default)(
257
+ (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-action-critical-normal",
258
+ "bg-background-action-critical-secondary-normal border-border-action-critical-normal",
259
+ "hover:bg-background-action-critical-secondary-hover hover:border-border-action-critical-hover hover:text-text-action-critical-hover",
260
+ "focus:bg-background-action-critical-secondary-hover focus:border-border-action-critical-hover focus:text-text-action-critical-hover focus:outline-0",
261
+ "active:bg-background-action-critical-secondary-active active:border-border-action-critical-active active:text-text-action-critical-active",
262
+ "disabled:bg-background-action-critical-disabled disabled:border-border-action-critical-disabled disabled:text-text-action-critical-disabled"
263
+ );
264
+ const tertiaryCriticalVariantStyles = variant === "tertiary-critical" && (0, import_clsx2.default)(
265
+ (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-action-critical-normal",
266
+ "bg-transparent border-transparent text-text-action-critical-normal",
267
+ "hover:bg-background-action-critical-secondary-hover hover:border-background-action-critical-secondary-hover hover:text-text-action-critical-hover",
268
+ "focus:bg-background-action-critical-secondary-hover focus:border-background-action-critical-secondary-hover focus:text-text-action-critical-hover focus:outline-0",
269
+ "active:bg-background-action-critical-secondary-active active:border-background-action-critical-secondary-active active:text-text-action-critical-active",
270
+ "disabled:bg-transparent disabled:border-transparent disabled:text-text-action-critical-disabled"
271
+ );
272
+ const navigationVarianStyles = variant === "navigation" && (0, import_clsx2.default)(
273
+ (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-on-action-primary-normal",
274
+ "bg-transparent",
275
+ "hover:bg-background-on-action-secondary-hover hover:text-brand-text-action-primary-hover",
276
+ // "hover:bg-background-action-secondary-hover hover:text-text-action-primary-hover", // Will use this once colors are finalized
277
+ "focus:bg-background-on-action-secondary-hover focus:text-brand-text-action-primary-hover focus:outline-0",
278
+ // "focus:bg-background-action-secondary-hover focus:text-text-action-primary-hover", // Will use this once colors are finalized
279
+ "active:bg-background-on-action-secondary-active active:text-brand-text-action-primary-active",
280
+ // "active:bg-background-action-secondary-active active:text-text-action-primary-active", // Will use this once colors are finalized
281
+ "disabled:bg-transparent disabled:text-text-on-action-primary-disabled",
282
+ "flex-col",
283
+ paddingUsingComponentGap
284
+ );
285
+ const notNavigationVariantStyles = variant !== "navigation" && (0, import_clsx2.default)("border-2 flex-row", componentPaddingMinus2pxBorder, componentGap);
286
+ const buttonClasses = (0, import_clsx2.default)(
287
+ disabled ? "cursor-default" : "cursor-pointer",
288
+ block ? "w-full" : "w-fit",
289
+ baseTransition,
290
+ "rounded-sm whitespace-nowrap inline-flex items-center justify-center group/btn",
291
+ primaryVariantStyles,
292
+ secondaryVariantStyles,
293
+ tertiaryVariantStyles,
294
+ primaryCriticalVariantStyles,
295
+ secondaryCriticalVariantStyles,
296
+ tertiaryCriticalVariantStyles,
297
+ navigationVarianStyles,
298
+ notNavigationVariantStyles,
299
+ className
300
+ );
301
+ const labelClasses = (0, import_clsx2.default)(
302
+ "min-h-6 flex items-center justify-center",
303
+ classNameLabel,
304
+ componentPaddingXUsingComponentGap,
305
+ typography.buttonLabel
306
+ );
307
+ const Element = href ? "a" : as;
308
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
309
+ Element,
310
+ __spreadProps(__spreadValues({
311
+ type: Element === "button" ? "button" : void 0,
312
+ className: buttonClasses
313
+ }, props), {
314
+ disabled,
315
+ href,
316
+ children: [
317
+ leftIcon && leftIcon,
318
+ !iconOnly && children && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: labelClasses, children }),
319
+ rightIcon && rightIcon
320
+ ]
321
+ })
322
+ );
323
+ };
324
+ Button.displayName = "Button";
325
+
326
+ // src/components/Checkbox.tsx
327
+ var import_clsx5 = __toESM(require("clsx"), 1);
328
+
329
+ // src/components/Icon.tsx
330
+ var import_clsx3 = __toESM(require("clsx"), 1);
331
+ var import_jsx_runtime2 = require("react/jsx-runtime");
332
+ function Icon(_a) {
333
+ var _b = _a, {
334
+ name,
335
+ size = 24,
336
+ variant = "outline"
337
+ } = _b, props = __objRest(_b, [
338
+ "name",
339
+ "size",
340
+ "variant"
341
+ ]);
342
+ const variantStyle = variant === "filled" ? '"FILL" 1' : '"FILL" 0';
343
+ const weightStyle = size === 16 ? '"wght" 400' : '"wght" 300';
344
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
345
+ "span",
346
+ __spreadProps(__spreadValues({}, props), {
347
+ className: (0, import_clsx3.default)(
348
+ "icon",
349
+ `icon-${size}`,
350
+ // size === 16 ? "font-normal" : "font-light", // size 16 font weight is not working as normal from before
351
+ props.className
352
+ ),
353
+ style: __spreadValues({
354
+ fontVariationSettings: variantStyle + `, ${weightStyle}`
355
+ }, props.style),
356
+ children: name
357
+ })
358
+ );
359
+ }
360
+
361
+ // src/components/Paragraph.tsx
362
+ var import_clsx4 = __toESM(require("clsx"), 1);
363
+ var import_jsx_runtime3 = require("react/jsx-runtime");
364
+ var Paragraph = (_a) => {
365
+ var _b = _a, {
366
+ className,
367
+ color,
368
+ padded,
369
+ align = "left",
370
+ tall,
371
+ addOverflow,
372
+ children,
373
+ as = "p"
374
+ } = _b, props = __objRest(_b, [
375
+ "className",
376
+ "color",
377
+ "padded",
378
+ "align",
379
+ "tall",
380
+ "addOverflow",
381
+ "children",
382
+ "as"
383
+ ]);
384
+ const Element = as;
385
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
386
+ Element,
387
+ __spreadProps(__spreadValues({}, props), {
388
+ className: (0, import_clsx4.default)(
389
+ typography.paragraph,
390
+ className,
391
+ padded && componentPaddingXUsingComponentGap,
392
+ align === "left" && "text-left",
393
+ align === "center" && "text-center",
394
+ align === "right" && "text-right",
395
+ tall && "!leading-6",
396
+ addOverflow && "whitespace-nowrap text-ellipsis overflow-hidden"
397
+ ),
398
+ style: __spreadProps(__spreadValues({}, props.style), {
399
+ color: color ? `var(--color-${color})` : void 0
400
+ }),
401
+ children
402
+ })
403
+ );
404
+ };
405
+ Paragraph.displayName = "Paragraph";
406
+
407
+ // src/components/Checkbox.tsx
408
+ var import_jsx_runtime4 = require("react/jsx-runtime");
409
+ var Checkbox = (_a) => {
410
+ var _b = _a, {
411
+ label,
412
+ error,
413
+ disabled,
414
+ readOnly,
415
+ checked,
416
+ onChange,
417
+ indeterminate,
418
+ paragraphClassName
419
+ } = _b, props = __objRest(_b, [
420
+ "label",
421
+ "error",
422
+ "disabled",
423
+ "readOnly",
424
+ "checked",
425
+ "onChange",
426
+ "indeterminate",
427
+ "paragraphClassName"
428
+ ]);
429
+ const selected = indeterminate || checked;
430
+ const normalClassName = (0, import_clsx5.default)(
431
+ !selected && !error && !disabled && !readOnly && "border-border-primary-normal bg-background-action-secondary-normal peer-hover:border-border-action-hover peer-hover:bg-background-action-secondary-hover peer-active:border-border-action-active peer-active:bg-background-action-secondary-active"
432
+ );
433
+ const normalSelectedClassName = (0, import_clsx5.default)(
434
+ selected && !error && !disabled && !readOnly && "bg-background-action-primary-normal border-background-action-primary-normal peer-hover:bg-background-action-primary-hover peer-hover:border-background-action-primary-hover peer-active:bg-background-action-primary-active peer-active:border-background-action-primary-active"
435
+ );
436
+ const errorClassName = (0, import_clsx5.default)(
437
+ error && !selected && "bg-background-action-critical-secondary-normal border-border-action-critical-normal peer-hover:border-border-action-critical-hover peer-hover:bg-background-action-critical-secondary-hover peer-active:border-border-action-critical-active peer-active:bg-background-action-secondary-active"
438
+ );
439
+ const errorSelectedClassName = (0, import_clsx5.default)(
440
+ error && selected && "bg-background-action-critical-primary-normal border-background-action-critical-primary-normal peer-hover:bg-background-action-critical-primary-hover peer-hover:border-background-action-critical-primary-hover peer-active:bg-background-action-critical-primary-active peer-active:border-background-action-critical-primary-active"
441
+ );
442
+ const disabledClassName = (0, import_clsx5.default)(
443
+ disabled && !readOnly && "border-border-primary-normal bg-background-action-secondary-disabled peer-checked:bg-icon-on-action-primary-disabled peer-checked:border-icon-on-action-primary-disabled"
444
+ );
445
+ const readOnlyClassName = (0, import_clsx5.default)(
446
+ readOnly && "border-transparent bg-transparent peer-checked:bg-transparent peer-checked:border-transparent"
447
+ );
448
+ const checkColor = (0, import_clsx5.default)(
449
+ selected && !disabled && !readOnly && "color-icon-on-action-primary-normal peer-hover:color-icon-on-action-primary-hover peer-active:color-icon-on-action-primary-active",
450
+ selected && disabled && "color-background-action-primary-disabled"
451
+ );
452
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
453
+ "label",
454
+ {
455
+ className: (0, import_clsx5.default)(
456
+ "flex items-center",
457
+ componentGap,
458
+ (disabled || readOnly && error || readOnly) && "cursor-default",
459
+ !(readOnly && error) && !disabled && !readOnly && "cursor-pointer"
460
+ ),
461
+ children: [
462
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "relative", children: [
463
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
464
+ "input",
465
+ __spreadValues({
466
+ type: "checkbox",
467
+ className: "sr-only peer",
468
+ disabled,
469
+ checked: selected,
470
+ onChange: handleOnChange,
471
+ id: props.id,
472
+ "data-indeterminate": indeterminate
473
+ }, props)
474
+ ),
475
+ error && (readOnly || disabled) ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: (0, import_clsx5.default)("size-6", "flex items-center justify-center"), children: selected ? indeterminate ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "question_mark" }) }) : readOnly ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-success-400 contents", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "check" }) }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-icon-on-action-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "check", className: "pointer-events-none" }) }) : readOnly && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "close" }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
476
+ "div",
477
+ {
478
+ className: (0, import_clsx5.default)(
479
+ "size-6 border rounded-base",
480
+ "flex items-center justify-center",
481
+ baseTransition,
482
+ normalClassName,
483
+ normalSelectedClassName,
484
+ errorClassName,
485
+ errorSelectedClassName,
486
+ disabledClassName,
487
+ readOnlyClassName,
488
+ checkColor
489
+ ),
490
+ children: selected ? indeterminate ? readOnly ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "question_mark" }) }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-icon-on-action-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "remove", className: "pointer-events-none" }) }) : readOnly ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-success-400 contents", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "check" }) }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-icon-on-action-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "check", className: "pointer-events-none" }) }) : readOnly && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "close" }) })
491
+ }
492
+ )
493
+ ] }),
494
+ label && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
495
+ Paragraph,
496
+ {
497
+ padded: true,
498
+ className: (0, import_clsx5.default)(
499
+ "text-nowrap",
500
+ disabled && !error && "!text-text-primary-disabled",
501
+ error && !disabled && !readOnly && "!text-text-primary-error",
502
+ paragraphClassName
503
+ ),
504
+ children: label
505
+ }
506
+ )
507
+ ]
508
+ }
509
+ );
510
+ function handleOnChange(e) {
511
+ if (disabled || readOnly || readOnly && error || !onChange) {
512
+ return;
513
+ }
514
+ onChange(e);
515
+ }
516
+ };
517
+ Checkbox.displayName = "Checkbox";
518
+
519
+ // src/components/DataGridCell.tsx
520
+ var import_sortable = require("@dnd-kit/sortable");
521
+
522
+ // ../../node_modules/@dnd-kit/utilities/dist/utilities.esm.js
523
+ var import_react = require("react");
524
+ var canUseDOM = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
525
+ var CSS = /* @__PURE__ */ Object.freeze({
526
+ Translate: {
527
+ toString(transform) {
528
+ if (!transform) {
529
+ return;
530
+ }
531
+ const {
532
+ x,
533
+ y
534
+ } = transform;
535
+ return "translate3d(" + (x ? Math.round(x) : 0) + "px, " + (y ? Math.round(y) : 0) + "px, 0)";
536
+ }
537
+ },
538
+ Scale: {
539
+ toString(transform) {
540
+ if (!transform) {
541
+ return;
542
+ }
543
+ const {
544
+ scaleX,
545
+ scaleY
546
+ } = transform;
547
+ return "scaleX(" + scaleX + ") scaleY(" + scaleY + ")";
548
+ }
549
+ },
550
+ Transform: {
551
+ toString(transform) {
552
+ if (!transform) {
553
+ return;
554
+ }
555
+ return [CSS.Translate.toString(transform), CSS.Scale.toString(transform)].join(" ");
556
+ }
557
+ },
558
+ Transition: {
559
+ toString(_ref) {
560
+ let {
561
+ property,
562
+ duration,
563
+ easing
564
+ } = _ref;
565
+ return property + " " + duration + "ms " + easing;
566
+ }
567
+ }
568
+ });
569
+
570
+ // src/components/DataGridCell.tsx
571
+ var import_clsx10 = __toESM(require("clsx"), 1);
572
+ var import_react8 = require("react");
573
+
574
+ // src/components/Search.tsx
575
+ var import_react3 = require("react");
576
+
577
+ // src/components/Input.tsx
578
+ var import_react2 = require("react");
579
+ var import_clsx7 = __toESM(require("clsx"), 1);
580
+
581
+ // src/components/Label.tsx
582
+ var import_clsx6 = __toESM(require("clsx"), 1);
583
+ var import_jsx_runtime5 = require("react/jsx-runtime");
584
+ var Label = (_a) => {
585
+ var _b = _a, {
586
+ as = "span",
587
+ padded,
588
+ className,
589
+ color,
590
+ align
591
+ } = _b, props = __objRest(_b, [
592
+ "as",
593
+ "padded",
594
+ "className",
595
+ "color",
596
+ "align"
597
+ ]);
598
+ const Element = as;
599
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
600
+ Element,
601
+ __spreadProps(__spreadValues({
602
+ className: (0, import_clsx6.default)(
603
+ typography.label,
604
+ align === "left" && "text-left",
605
+ align === "center" && "text-center",
606
+ align === "right" && "text-right",
607
+ className,
608
+ padded && componentPaddingXUsingComponentGap
609
+ )
610
+ }, props), {
611
+ style: __spreadProps(__spreadValues({}, props.style), {
612
+ color: color ? `var(--color-${color})` : void 0
613
+ })
614
+ })
615
+ );
616
+ };
617
+ Label.displayName = "Label";
618
+
619
+ // src/utils/formatting.tsx
620
+ function getDecimalPlaceholder(decimals) {
621
+ if (!decimals || decimals <= 0) {
622
+ return {};
623
+ }
624
+ return {
625
+ placeholder: `0.${"0".repeat(decimals)}`
626
+ };
627
+ }
628
+ function formatDecimalValue(value, decimals) {
629
+ if (!value || value === "") {
630
+ return "";
631
+ }
632
+ const numValue = typeof value === "string" ? parseFloat(value) : value;
633
+ if (isNaN(numValue)) {
634
+ return "";
635
+ }
636
+ if (!decimals || decimals <= 0) {
637
+ return String(Math.round(numValue));
638
+ }
639
+ return numValue.toFixed(decimals);
640
+ }
641
+ function formatCurrencyDisplay(value) {
642
+ if (!value || value === "") {
643
+ return "";
644
+ }
645
+ const parts = value.split(".");
646
+ const integerPart = parts[0];
647
+ const decimalPart = parts[1];
648
+ const formattedInteger = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
649
+ return decimalPart !== void 0 ? `${formattedInteger}.${decimalPart}` : formattedInteger;
650
+ }
651
+
652
+ // src/components/Input.tsx
653
+ var import_jsx_runtime6 = require("react/jsx-runtime");
654
+ var InputBase = (_a) => {
655
+ var _b = _a, {
656
+ before,
657
+ after,
658
+ type,
659
+ label,
660
+ error,
661
+ className,
662
+ align = "left",
663
+ caption,
664
+ required,
665
+ selectOnFocus,
666
+ removeRoundness,
667
+ inputContainerRef,
668
+ removeBorder,
669
+ wrapperClassName,
670
+ focus
671
+ } = _b, props = __objRest(_b, [
672
+ "before",
673
+ "after",
674
+ "type",
675
+ "label",
676
+ "error",
677
+ "className",
678
+ "align",
679
+ "caption",
680
+ "required",
681
+ "selectOnFocus",
682
+ "removeRoundness",
683
+ "inputContainerRef",
684
+ "removeBorder",
685
+ "wrapperClassName",
686
+ "focus"
687
+ ]);
688
+ const attributes = {
689
+ "data-error": error && !focus || null,
690
+ "data-focus": focus || null
691
+ };
692
+ const inputRef = (0, import_react2.useRef)(null);
693
+ (0, import_react2.useEffect)(() => {
694
+ var _a2;
695
+ const input = inputRef.current;
696
+ const focusHandler = () => {
697
+ input == null ? void 0 : input.select();
698
+ };
699
+ if (selectOnFocus) {
700
+ (_a2 = inputRef.current) == null ? void 0 : _a2.addEventListener("focus", focusHandler);
701
+ return () => {
702
+ input == null ? void 0 : input.removeEventListener("focus", focusHandler);
703
+ };
704
+ }
705
+ }, [selectOnFocus]);
706
+ const inputBaseClass = (0, import_clsx7.default)(
707
+ "w-full",
708
+ "flex flex-row items-center",
709
+ "bg-background-action-secondary-normal caret-icon-on-action-secondary-normal",
710
+ componentGap,
711
+ baseTransition,
712
+ "outline-transparent outline-2 -outline-offset-2",
713
+ componentPaddingMinusBorder,
714
+ !removeRoundness && "rounded-base",
715
+ !removeBorder && "border border-border-primary-normal",
716
+ "relative"
717
+ );
718
+ const inputFocusClass = (0, import_clsx7.default)(
719
+ "has-[[data-focus]]:border-transparent has-[[data-focus]]:outline-border-primary-focus focus-within:border-transparent focus-within:outline-border-primary-focus"
720
+ );
721
+ const inputDisabledClass = (0, import_clsx7.default)(
722
+ "has-disabled:bg-background-action-secondary-disabled"
723
+ );
724
+ const inputReadOnlyClass = (0, import_clsx7.default)(
725
+ "has-[input:not(:disabled):read-only]:outline-none has-[input:not(:disabled):read-only]:bg-transparent has-[input:not(:disabled):read-only]:border-transparent has-[input:not(:disabled):read-only]:pl-0"
726
+ );
727
+ const inputInvalidClass = (0, import_clsx7.default)(
728
+ "has-[[data-error]]:border-transparent has-[[data-error]]:not-focus-within:outline-border-primary-error has-[[data-error]]:not-focus-within:outline-1"
729
+ );
730
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
731
+ "label",
732
+ {
733
+ ref: inputContainerRef,
734
+ className: (0, import_clsx7.default)(
735
+ "w-full flex flex-col",
736
+ "block",
737
+ "text-text-primary-normal has-disabled:text-text-primary-disabled",
738
+ componentGap
739
+ ),
740
+ style: __spreadValues({}, props.style),
741
+ children: [
742
+ label && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: (0, import_clsx7.default)("flex items-center", componentGap), children: [
743
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
744
+ Label,
745
+ {
746
+ className: (0, import_clsx7.default)(
747
+ props.disabled || props.readOnly ? "cursor-default" : "cursor-pointer"
748
+ ),
749
+ children: label
750
+ }
751
+ ),
752
+ required && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
753
+ "span",
754
+ {
755
+ className: (0, import_clsx7.default)(typography.label, "text-text-critical-normal"),
756
+ children: "*"
757
+ }
758
+ )
759
+ ] }),
760
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
761
+ "div",
762
+ {
763
+ className: (0, import_clsx7.default)(
764
+ inputBaseClass,
765
+ !props.disabled && inputInvalidClass,
766
+ inputFocusClass,
767
+ inputDisabledClass,
768
+ inputReadOnlyClass,
769
+ wrapperClassName
770
+ ),
771
+ children: [
772
+ before,
773
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
774
+ "input",
775
+ __spreadProps(__spreadValues(__spreadValues({
776
+ ref: (el) => {
777
+ inputRef.current = el;
778
+ },
779
+ type,
780
+ required
781
+ }, props), attributes), {
782
+ id: props.id,
783
+ className: (0, import_clsx7.default)(
784
+ "flex-1 outline-none w-full max-w-full min-h-6 min-w-0",
785
+ "[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",
786
+ "placeholder:text-text-secondary-normal disabled:text-text-secondary-disabled",
787
+ align === "right" && "text-right",
788
+ align === "center" && "text-center",
789
+ componentPaddingXUsingComponentGap,
790
+ typography.paragraph,
791
+ className,
792
+ props.readOnly && !props.disabled && "!px-0"
793
+ )
794
+ })
795
+ ),
796
+ after
797
+ ]
798
+ }
799
+ ),
800
+ caption
801
+ ]
802
+ }
803
+ );
804
+ };
805
+ var Input = (_a) => {
806
+ var _b = _a, {
807
+ variant = "default",
808
+ decimals,
809
+ uom,
810
+ removeSearchIcon,
811
+ value: propValue,
812
+ onChange,
813
+ onBlur,
814
+ onClear
815
+ } = _b, props = __objRest(_b, [
816
+ "variant",
817
+ "decimals",
818
+ "uom",
819
+ "removeSearchIcon",
820
+ "value",
821
+ "onChange",
822
+ "onBlur",
823
+ "onClear"
824
+ ]);
825
+ const [internalValue, setInternalValue] = (0, import_react2.useState)("");
826
+ const [displayValue, setDisplayValue] = (0, import_react2.useState)("");
827
+ (0, import_react2.useEffect)(() => {
828
+ var _a2;
829
+ const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
830
+ if (variant === "currency") {
831
+ if (propValue === void 0 || propValue === "" || typeof propValue === "number" && isNaN(propValue)) {
832
+ setInternalValue("");
833
+ setDisplayValue("");
834
+ } else {
835
+ const numValue = typeof propValue === "string" ? parseFloat(propValue) : propValue;
836
+ if (!isNaN(numValue)) {
837
+ const formatted = numValue.toFixed(decimals != null ? decimals : 2);
838
+ setInternalValue(formatted);
839
+ setDisplayValue(formatCurrencyDisplay(formatted));
840
+ }
841
+ }
842
+ } else {
843
+ setInternalValue(stringValue);
844
+ setDisplayValue(stringValue);
845
+ }
846
+ }, [propValue, decimals, variant]);
847
+ const getInputProps = () => {
848
+ var _a2;
849
+ const baseProps = __spreadValues(__spreadValues({}, props), getDecimalPlaceholder(decimals));
850
+ switch (variant) {
851
+ case "search":
852
+ return __spreadProps(__spreadValues({}, baseProps), {
853
+ placeholder: (_a2 = props.placeholder) != null ? _a2 : "Search",
854
+ className: "!mr-6",
855
+ value: displayValue
856
+ });
857
+ case "finder":
858
+ return baseProps;
859
+ case "currency":
860
+ return __spreadProps(__spreadValues({}, baseProps), {
861
+ align: "right",
862
+ type: "text",
863
+ value: displayValue
864
+ });
865
+ case "percentage":
866
+ case "uom":
867
+ return __spreadProps(__spreadValues({}, baseProps), {
868
+ type: "number",
869
+ align: "right"
870
+ });
871
+ default:
872
+ return baseProps;
873
+ }
874
+ };
875
+ const getBeforeElement = () => {
876
+ if (props.before) return props.before;
877
+ switch (variant) {
878
+ case "search":
879
+ return !removeSearchIcon ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "search" }) }) : null;
880
+ case "currency":
881
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "attach_money" }) });
882
+ default:
883
+ return null;
884
+ }
885
+ };
886
+ const getAfterElement = () => {
887
+ if (props.after) return props.after;
888
+ switch (variant) {
889
+ case "search": {
890
+ const hasValue = displayValue.length > 0;
891
+ return hasValue && !props.readOnly ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
892
+ Icon,
893
+ {
894
+ name: "close",
895
+ onClick: handleSearchReset,
896
+ className: "cursor-pointer absolute right-2 bottom-2/4 translate-y-2/4"
897
+ }
898
+ ) : null;
899
+ }
900
+ case "finder":
901
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "search" });
902
+ case "uom":
903
+ return uom ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-text-secondary-normal uppercase", children: uom }) : null;
904
+ case "percentage":
905
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "percent" }) });
906
+ default:
907
+ return null;
908
+ }
909
+ };
910
+ const handleSearchReset = () => {
911
+ setInternalValue("");
912
+ setDisplayValue("");
913
+ if (onChange) {
914
+ const syntheticEvent = {
915
+ target: { value: "" }
916
+ };
917
+ if (typeof onChange === "function") {
918
+ onChange(syntheticEvent);
919
+ }
920
+ }
921
+ onClear == null ? void 0 : onClear();
922
+ };
923
+ const handleChange = (e) => {
924
+ const rawValue = e.target.value;
925
+ if (variant === "search") {
926
+ setInternalValue(rawValue);
927
+ setDisplayValue(rawValue);
928
+ if (typeof onChange === "function") {
929
+ onChange(e);
930
+ }
931
+ return;
932
+ }
933
+ if (variant === "currency") {
934
+ const raw = rawValue.replace(/,/g, "");
935
+ if (raw === "") {
936
+ setInternalValue("");
937
+ setDisplayValue("");
938
+ if (onChange) {
939
+ const syntheticEvent = __spreadProps(__spreadValues({}, e), {
940
+ target: __spreadProps(__spreadValues({}, e.target), { value: "" })
941
+ });
942
+ onChange(syntheticEvent);
943
+ }
944
+ return;
945
+ }
946
+ const regex = /^\d*\.?\d*$/;
947
+ if (!regex.test(raw)) return;
948
+ const parts = raw.split(".");
949
+ const currentDecimals = decimals != null ? decimals : 2;
950
+ if (parts.length === 2 && parts[1].length > currentDecimals) return;
951
+ setInternalValue(raw);
952
+ setDisplayValue(formatCurrencyDisplay(raw));
953
+ const asNumber = Number(raw);
954
+ if (!isNaN(asNumber) && onChange) {
955
+ const syntheticEvent = __spreadProps(__spreadValues({}, e), {
956
+ target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
957
+ });
958
+ onChange(syntheticEvent);
959
+ }
960
+ return;
961
+ }
962
+ setInternalValue(rawValue);
963
+ setDisplayValue(rawValue);
964
+ if (typeof onChange === "function") {
965
+ onChange(e);
966
+ }
967
+ };
968
+ const handleBlur = (e) => {
969
+ if (variant === "currency") {
970
+ const formatted = formatDecimalValue(internalValue, decimals != null ? decimals : 2);
971
+ setInternalValue(formatted);
972
+ setDisplayValue(formatCurrencyDisplay(formatted));
973
+ const asNumber = Number(formatted);
974
+ if (!isNaN(asNumber) && onChange) {
975
+ const syntheticEvent = __spreadProps(__spreadValues({}, e), {
976
+ target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
977
+ });
978
+ onChange(syntheticEvent);
979
+ }
980
+ } else if (variant === "uom" || variant === "percentage") {
981
+ const formattedValue = formatDecimalValue(e.target.value, decimals);
982
+ e.target.value = formattedValue;
983
+ }
984
+ onBlur == null ? void 0 : onBlur(e);
985
+ };
986
+ const inputProps = getInputProps();
987
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
988
+ InputBase,
989
+ __spreadProps(__spreadValues({}, inputProps), {
990
+ before: getBeforeElement(),
991
+ after: getAfterElement(),
992
+ onChange: handleChange,
993
+ onBlur: handleBlur
994
+ })
995
+ );
996
+ };
997
+ Input.displayName = "Input";
998
+ var Finder = (props) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Input, __spreadProps(__spreadValues({}, props), { variant: "finder" }));
999
+ var UOM = (props) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Input, __spreadProps(__spreadValues({}, props), { variant: "uom" }));
1000
+ var Currency = (props) => {
1001
+ var _a;
1002
+ const handleCurrencyChange = (e) => {
1003
+ var _a2;
1004
+ (_a2 = props.onChange) == null ? void 0 : _a2.call(props, e);
1005
+ };
1006
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1007
+ Input,
1008
+ __spreadProps(__spreadValues({}, props), {
1009
+ variant: "currency",
1010
+ decimals: (_a = props.decimals) != null ? _a : 2,
1011
+ onChange: handleCurrencyChange
1012
+ })
1013
+ );
1014
+ };
1015
+ var Percentage = (props) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Input, __spreadProps(__spreadValues({}, props), { variant: "percentage" }));
1016
+ Finder.displayName = "Finder";
1017
+ UOM.displayName = "UOM";
1018
+ Currency.displayName = "Currency";
1019
+ Percentage.displayName = "Percentage";
1020
+
1021
+ // src/components/Search.tsx
1022
+ var import_jsx_runtime7 = require("react/jsx-runtime");
1023
+ var Search = (_a) => {
1024
+ var _b = _a, {
1025
+ label,
1026
+ error,
1027
+ children,
1028
+ readOnly,
1029
+ renderMenu,
1030
+ onClick,
1031
+ className,
1032
+ wrapperClassName,
1033
+ removeRoundness
1034
+ } = _b, props = __objRest(_b, [
1035
+ "label",
1036
+ "error",
1037
+ "children",
1038
+ "readOnly",
1039
+ "renderMenu",
1040
+ "onClick",
1041
+ "className",
1042
+ "wrapperClassName",
1043
+ "removeRoundness"
1044
+ ]);
1045
+ const inputRef = (0, import_react3.useRef)(null);
1046
+ const inputContainerRef = (0, import_react3.useRef)(null);
1047
+ const preventFocusOnInitialRender = (0, import_react3.useRef)(true);
1048
+ const [show, setShow] = (0, import_react3.useState)(false);
1049
+ const [clearing, setClearing] = (0, import_react3.useState)(false);
1050
+ const uniqueId = (0, import_react3.useId)();
1051
+ const searchMenuName = `search-menu-${uniqueId}`;
1052
+ (0, import_react3.useEffect)(() => {
1053
+ var _a2;
1054
+ if (preventFocusOnInitialRender.current) {
1055
+ preventFocusOnInitialRender.current = false;
1056
+ return;
1057
+ }
1058
+ (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
1059
+ }, [props.value]);
1060
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
1061
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1062
+ Input,
1063
+ __spreadValues({
1064
+ variant: "search",
1065
+ inputContainerRef,
1066
+ ref: inputRef,
1067
+ label,
1068
+ wrapperClassName,
1069
+ onClick: (e) => {
1070
+ if (props.disabled || readOnly) {
1071
+ return;
1072
+ }
1073
+ if (clearing) {
1074
+ setClearing(false);
1075
+ return;
1076
+ }
1077
+ onClick == null ? void 0 : onClick(e);
1078
+ setShow(!show);
1079
+ },
1080
+ onClear: () => {
1081
+ setClearing(true);
1082
+ },
1083
+ onKeyDown: (e) => {
1084
+ setShow(true);
1085
+ if (["ArrowUp", "ArrowDown"].includes(e.key)) {
1086
+ e.preventDefault();
1087
+ const menu = document.querySelector(`[data-menu="${searchMenuName}"]`);
1088
+ const selectedMenuOption = menu == null ? void 0 : menu.querySelector("[data-selected]");
1089
+ if (selectedMenuOption) {
1090
+ const allMenuOptions = Array.from((menu == null ? void 0 : menu.querySelectorAll('[role="menuitem"]')) || []);
1091
+ const currentIndex = allMenuOptions.indexOf(selectedMenuOption);
1092
+ let targetOption;
1093
+ if (e.key === "ArrowDown") {
1094
+ targetOption = allMenuOptions[currentIndex + 1] || allMenuOptions[0];
1095
+ } else {
1096
+ targetOption = allMenuOptions[currentIndex - 1] || allMenuOptions[allMenuOptions.length - 1];
1097
+ }
1098
+ targetOption == null ? void 0 : targetOption.focus();
1099
+ } else {
1100
+ const toFocusMenuOption = e.key === "ArrowDown" ? menu == null ? void 0 : menu.querySelector('[role="menuitem"]') : menu == null ? void 0 : menu.querySelector('[role="menuitem"]:last-child');
1101
+ toFocusMenuOption == null ? void 0 : toFocusMenuOption.focus();
1102
+ }
1103
+ }
1104
+ },
1105
+ error,
1106
+ readOnly,
1107
+ removeRoundness,
1108
+ focus: show
1109
+ }, props)
1110
+ ),
1111
+ renderMenu ? renderMenu({
1112
+ positionTo: inputContainerRef,
1113
+ show,
1114
+ setShow,
1115
+ topOffset: props.caption ? -16 : null,
1116
+ autoFocusOff: true,
1117
+ menuName: searchMenuName
1118
+ }) : children
1119
+ ] });
1120
+ };
1121
+ Search.displayName = "Search";
1122
+
1123
+ // src/components/Menu.tsx
1124
+ var import_clsx8 = __toESM(require("clsx"), 1);
1125
+ var import_react6 = require("react");
1126
+ var import_react_dom = require("react-dom");
1127
+
1128
+ // src/components/useMenuSystem.tsx
1129
+ var import_react5 = require("react");
1130
+
1131
+ // src/components/useMatchesMedia.tsx
1132
+ var import_react4 = require("react");
1133
+ var useMatchesMedia = (query) => {
1134
+ const [matches, setMatches] = (0, import_react4.useState)(
1135
+ () => typeof window !== "undefined" ? window.matchMedia(query).matches : false
1136
+ );
1137
+ (0, import_react4.useLayoutEffect)(() => {
1138
+ const mediaQueryList = window.matchMedia(query);
1139
+ const listener = (event) => {
1140
+ setMatches(event.matches);
1141
+ };
1142
+ mediaQueryList.addEventListener("change", listener);
1143
+ setMatches(mediaQueryList.matches);
1144
+ return () => {
1145
+ mediaQueryList.removeEventListener("change", listener);
1146
+ };
1147
+ }, [query]);
1148
+ return matches;
1149
+ };
1150
+ var useMatchesMobile = () => {
1151
+ const isMobile = useMatchesMedia("(width < 48rem)");
1152
+ return isMobile;
1153
+ };
1154
+
1155
+ // src/components/useMenuSystem.tsx
1156
+ function useSubMenuSystem(mobilePositionTo) {
1157
+ const [activeMenus, setActiveMenus] = (0, import_react5.useState)(
1158
+ {}
1159
+ );
1160
+ const [activeMenu, setActiveMenu] = (0, import_react5.useState)("");
1161
+ const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0, import_react5.useState)(null);
1162
+ const menuRootRef = (0, import_react5.useRef)(null);
1163
+ const subMenuRefs = (0, import_react5.useRef)({});
1164
+ const hoverTimeoutRef = (0, import_react5.useRef)(null);
1165
+ const closeTimeoutRef = (0, import_react5.useRef)(null);
1166
+ const isMobile = useMatchesMobile();
1167
+ const toggleMenu = (menuId, level) => {
1168
+ if (closeTimeoutRef.current) {
1169
+ clearTimeout(closeTimeoutRef.current);
1170
+ closeTimeoutRef.current = null;
1171
+ }
1172
+ setActiveMenu(menuId);
1173
+ setCurrentSubMenuLevel(level);
1174
+ setActiveMenus((prev) => {
1175
+ const newActiveMenus = __spreadValues({}, prev);
1176
+ if (newActiveMenus[level] === menuId) {
1177
+ delete newActiveMenus[level];
1178
+ } else {
1179
+ newActiveMenus[level] = menuId;
1180
+ }
1181
+ Object.keys(newActiveMenus).forEach((key) => {
1182
+ if (Number(key) > level) {
1183
+ delete newActiveMenus[Number(key)];
1184
+ }
1185
+ });
1186
+ return newActiveMenus;
1187
+ });
1188
+ };
1189
+ const openMenu = (menuId, level) => {
1190
+ if (closeTimeoutRef.current) {
1191
+ clearTimeout(closeTimeoutRef.current);
1192
+ closeTimeoutRef.current = null;
1193
+ }
1194
+ setActiveMenus((prev) => {
1195
+ const newActiveMenus = __spreadValues({}, prev);
1196
+ newActiveMenus[level] = menuId;
1197
+ Object.keys(newActiveMenus).forEach((key) => {
1198
+ if (Number(key) > level) {
1199
+ delete newActiveMenus[Number(key)];
1200
+ }
1201
+ });
1202
+ return newActiveMenus;
1203
+ });
1204
+ };
1205
+ const openMenuWithDelay = (menuId, level, delay = 150) => {
1206
+ if (isMobile) {
1207
+ return;
1208
+ }
1209
+ if (hoverTimeoutRef.current) {
1210
+ clearTimeout(hoverTimeoutRef.current);
1211
+ }
1212
+ hoverTimeoutRef.current = setTimeout(() => {
1213
+ openMenu(menuId, level);
1214
+ }, delay);
1215
+ };
1216
+ const closeMenuWithDelay = (level, delay = 500) => {
1217
+ if (isMobile) {
1218
+ return;
1219
+ }
1220
+ if (hoverTimeoutRef.current) {
1221
+ clearTimeout(hoverTimeoutRef.current);
1222
+ hoverTimeoutRef.current = null;
1223
+ }
1224
+ closeTimeoutRef.current = setTimeout(() => {
1225
+ closeSubMenuLevel(level);
1226
+ }, delay);
1227
+ };
1228
+ const cancelCloseTimeout = () => {
1229
+ if (isMobile) {
1230
+ return;
1231
+ }
1232
+ if (closeTimeoutRef.current) {
1233
+ clearTimeout(closeTimeoutRef.current);
1234
+ closeTimeoutRef.current = null;
1235
+ }
1236
+ };
1237
+ const closeSubMenuLevel = (level) => {
1238
+ setActiveMenus((prev) => {
1239
+ const newActiveMenus = __spreadValues({}, prev);
1240
+ delete newActiveMenus[level];
1241
+ Object.keys(newActiveMenus).forEach((key) => {
1242
+ if (Number(key) >= level) {
1243
+ delete newActiveMenus[Number(key)];
1244
+ }
1245
+ });
1246
+ if (isMobile) {
1247
+ const newSubMenuLevel = level - 1;
1248
+ setCurrentSubMenuLevel(newSubMenuLevel);
1249
+ const newActiveMenu = newActiveMenus[newSubMenuLevel];
1250
+ if (Object.keys(newActiveMenus).length > 0 && newActiveMenu) {
1251
+ setActiveMenu(newActiveMenu);
1252
+ }
1253
+ }
1254
+ return newActiveMenus;
1255
+ });
1256
+ };
1257
+ const registerSubMenu = (id, element) => {
1258
+ subMenuRefs.current[id] = element;
1259
+ };
1260
+ const isMenuActive = (menuId, level) => {
1261
+ return activeMenus[level] === menuId;
1262
+ };
1263
+ (0, import_react5.useEffect)(() => {
1264
+ const handleClickOutside = (event) => {
1265
+ var _a;
1266
+ if (Object.keys(activeMenus).length === 0) return;
1267
+ const target = event.target;
1268
+ if ((_a = menuRootRef.current) == null ? void 0 : _a.contains(target)) return;
1269
+ const isInsideActiveSubmenu = Object.values(activeMenus).some((id) => {
1270
+ const submenuEl = subMenuRefs.current[id];
1271
+ return submenuEl == null ? void 0 : submenuEl.contains(target);
1272
+ });
1273
+ if (!isInsideActiveSubmenu) {
1274
+ setActiveMenus({});
1275
+ }
1276
+ };
1277
+ document.addEventListener("mousedown", handleClickOutside);
1278
+ return () => {
1279
+ document.removeEventListener("mousedown", handleClickOutside);
1280
+ };
1281
+ }, [activeMenus]);
1282
+ (0, import_react5.useEffect)(() => {
1283
+ return () => {
1284
+ if (hoverTimeoutRef.current) {
1285
+ clearTimeout(hoverTimeoutRef.current);
1286
+ }
1287
+ if (closeTimeoutRef.current) {
1288
+ clearTimeout(closeTimeoutRef.current);
1289
+ }
1290
+ };
1291
+ }, []);
1292
+ const getAllFocusableMenuElements = () => {
1293
+ const elements = [];
1294
+ if (menuRootRef.current) {
1295
+ elements.push(...Array.from(menuRootRef.current.children));
1296
+ }
1297
+ Object.values(activeMenus).forEach((menuId) => {
1298
+ const submenuEl = subMenuRefs.current[menuId];
1299
+ if (submenuEl) {
1300
+ elements.push(...Array.from(submenuEl.children));
1301
+ }
1302
+ });
1303
+ return elements;
1304
+ };
1305
+ const findCurrentMenuLevel = (element) => {
1306
+ let current = element.parentElement;
1307
+ while (current) {
1308
+ const level = current.getAttribute("data-menu-level");
1309
+ if (level !== null) {
1310
+ return parseInt(level, 10);
1311
+ }
1312
+ current = current.parentElement;
1313
+ }
1314
+ return 0;
1315
+ };
1316
+ const getMenuElementsAtLevel = (level) => {
1317
+ var _a;
1318
+ if (level === 0 && menuRootRef.current) {
1319
+ return Array.from(menuRootRef.current.children);
1320
+ }
1321
+ const menuId = (_a = Object.entries(activeMenus).find(([, id]) => {
1322
+ const submenuEl = subMenuRefs.current[id];
1323
+ return submenuEl && submenuEl.getAttribute("data-menu-level") === level.toString();
1324
+ })) == null ? void 0 : _a[1];
1325
+ if (menuId) {
1326
+ const submenuEl = subMenuRefs.current[menuId];
1327
+ if (submenuEl) {
1328
+ return Array.from(submenuEl.children);
1329
+ }
1330
+ }
1331
+ return [];
1332
+ };
1333
+ return {
1334
+ menuRootRef,
1335
+ activeMenus,
1336
+ openMenu,
1337
+ isMenuActive,
1338
+ registerSubMenu,
1339
+ closeSubMenuLevel,
1340
+ getAllFocusableMenuElements,
1341
+ findCurrentMenuLevel,
1342
+ getMenuElementsAtLevel,
1343
+ mobileHide: isMobile && Object.keys(activeMenus).length > 0,
1344
+ listeners: {
1345
+ onSubMenuHover: openMenuWithDelay,
1346
+ onSubMenuLeave: closeMenuWithDelay,
1347
+ onSubMenuEnter: cancelCloseTimeout,
1348
+ toggleMenu,
1349
+ mobilePositionTo,
1350
+ activeMenu,
1351
+ currentSubMenuLevel,
1352
+ closeSubMenuLevel
1353
+ }
1354
+ };
1355
+ }
1356
+ function useMenuPosition(elementRef, position = "bottom", options) {
1357
+ const [menuPosition, setMenuPosition] = (0, import_react5.useState)({
1358
+ top: 0,
1359
+ left: 0,
1360
+ minWidth: 0
1361
+ });
1362
+ const isMobile = useMatchesMobile();
1363
+ const updatePosition = (0, import_react5.useCallback)(() => {
1364
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
1365
+ if (!(elementRef == null ? void 0 : elementRef.current)) return;
1366
+ const triggerRect = elementRef.current.getBoundingClientRect();
1367
+ const menuRect = (_b = (_a = options == null ? void 0 : options.menuRef) == null ? void 0 : _a.current) == null ? void 0 : _b.getBoundingClientRect();
1368
+ const viewportWidth = window.innerWidth;
1369
+ const menuWidth = (menuRect == null ? void 0 : menuRect.width) || triggerRect.width;
1370
+ const topOffset = (_c = options == null ? void 0 : options.topOffset) != null ? _c : 4;
1371
+ let top = 0;
1372
+ let left = 0;
1373
+ if (position === "bottom" || position === "bottom-right") {
1374
+ top = triggerRect.top + triggerRect.height + topOffset;
1375
+ } else {
1376
+ top = triggerRect.top;
1377
+ }
1378
+ if (position === "bottom") {
1379
+ left = triggerRect.left + window.scrollX;
1380
+ } else if (position === "bottom-right") {
1381
+ left = triggerRect.right + window.scrollX - menuWidth;
1382
+ } else if (position === "right") {
1383
+ left = triggerRect.right + window.scrollX;
1384
+ }
1385
+ const overflowsLeftViewport = left + menuWidth > viewportWidth;
1386
+ if (overflowsLeftViewport) {
1387
+ left = triggerRect.left - menuWidth;
1388
+ }
1389
+ if (isMobile) {
1390
+ left = triggerRect.left + menuWidth > viewportWidth ? Math.max(viewportWidth - menuWidth, 0) - 8 : triggerRect.left;
1391
+ top = ((_f = (_e = (_d = elementRef.current.parentElement) == null ? void 0 : _d.getBoundingClientRect()) == null ? void 0 : _e.top) != null ? _f : 0) + ((_i = (_h = (_g = elementRef.current.parentElement) == null ? void 0 : _g.getBoundingClientRect()) == null ? void 0 : _h.height) != null ? _i : 0) + topOffset;
1392
+ }
1393
+ setMenuPosition({
1394
+ top,
1395
+ left,
1396
+ minWidth: triggerRect.width
1397
+ });
1398
+ }, [elementRef, position, options == null ? void 0 : options.menuRef, options == null ? void 0 : options.topOffset, isMobile]);
1399
+ (0, import_react5.useEffect)(() => {
1400
+ if (!(options == null ? void 0 : options.isOpen) || !(options == null ? void 0 : options.setIsOpen)) return;
1401
+ const handleClickOutside = (event) => {
1402
+ var _a, _b, _c, _d, _e;
1403
+ const target = event.target;
1404
+ if ((_a = elementRef.current) == null ? void 0 : _a.contains(target)) return;
1405
+ if ((_c = (_b = options.menuRef) == null ? void 0 : _b.current) == null ? void 0 : _c.contains(target)) return;
1406
+ if ((_d = options.additionalRefs) == null ? void 0 : _d.some((ref) => {
1407
+ var _a2;
1408
+ return (_a2 = ref.current) == null ? void 0 : _a2.contains(target);
1409
+ }))
1410
+ return;
1411
+ (_e = options.setIsOpen) == null ? void 0 : _e.call(options, false);
1412
+ };
1413
+ document.addEventListener("mousedown", handleClickOutside);
1414
+ return () => {
1415
+ document.removeEventListener("mousedown", handleClickOutside);
1416
+ };
1417
+ }, [
1418
+ options,
1419
+ elementRef,
1420
+ options == null ? void 0 : options.isOpen,
1421
+ options == null ? void 0 : options.setIsOpen,
1422
+ options == null ? void 0 : options.menuRef,
1423
+ options == null ? void 0 : options.additionalRefs
1424
+ ]);
1425
+ (0, import_react5.useEffect)(() => {
1426
+ updatePosition();
1427
+ const resizeObserver = new ResizeObserver(updatePosition);
1428
+ if (elementRef == null ? void 0 : elementRef.current) {
1429
+ resizeObserver.observe(elementRef.current);
1430
+ }
1431
+ window.addEventListener("scroll", updatePosition);
1432
+ window.addEventListener("resize", updatePosition);
1433
+ return () => {
1434
+ resizeObserver.disconnect();
1435
+ window.removeEventListener("scroll", updatePosition);
1436
+ window.removeEventListener("resize", updatePosition);
1437
+ };
1438
+ }, [elementRef, updatePosition]);
1439
+ return { menuPosition, updatePosition };
1440
+ }
1441
+
1442
+ // src/utils.ts
1443
+ function findDocumentRoot(element) {
1444
+ if (typeof window === "undefined" || typeof document === "undefined") {
1445
+ throw new Error(
1446
+ "findDocumentRoot can only be used in a browser environment."
1447
+ );
1448
+ }
1449
+ if (!element || !(element instanceof Node)) {
1450
+ return window.document.body;
1451
+ }
1452
+ var currentElement = element;
1453
+ while (currentElement && currentElement.parentNode) {
1454
+ if (currentElement.parentNode === document) {
1455
+ return document.body;
1456
+ } else if (currentElement.parentNode instanceof DocumentFragment) {
1457
+ return currentElement.parentNode;
1458
+ } else {
1459
+ currentElement = currentElement.parentNode;
1460
+ }
1461
+ }
1462
+ return window.document.body;
1463
+ }
1464
+
1465
+ // src/components/Menu.tsx
1466
+ var import_jsx_runtime8 = require("react/jsx-runtime");
1467
+ var Menu = (_a) => {
1468
+ var _b = _a, {
1469
+ children,
1470
+ className,
1471
+ ref,
1472
+ positionTo,
1473
+ mobilePositionTo,
1474
+ show,
1475
+ setShow,
1476
+ position = "bottom",
1477
+ maxHeight: customMaxHeight,
1478
+ topOffset,
1479
+ mobileBackMenuOption,
1480
+ mobileHide,
1481
+ useDefaultMinWidth,
1482
+ autoFocusOff,
1483
+ menuName
1484
+ } = _b, props = __objRest(_b, [
1485
+ "children",
1486
+ "className",
1487
+ "ref",
1488
+ "positionTo",
1489
+ "mobilePositionTo",
1490
+ "show",
1491
+ "setShow",
1492
+ "position",
1493
+ "maxHeight",
1494
+ "topOffset",
1495
+ "mobileBackMenuOption",
1496
+ "mobileHide",
1497
+ "useDefaultMinWidth",
1498
+ "autoFocusOff",
1499
+ "menuName"
1500
+ ]);
1501
+ const internalRef = (0, import_react6.useRef)(null);
1502
+ const actualRef = ref || internalRef;
1503
+ const [maxHeight, setMaxHeight] = (0, import_react6.useState)("180px");
1504
+ const isMobile = useMatchesMobile();
1505
+ const { menuPosition, updatePosition } = useMenuPosition(
1506
+ isMobile && mobilePositionTo ? mobilePositionTo : positionTo,
1507
+ position,
1508
+ {
1509
+ isOpen: show,
1510
+ setIsOpen: setShow,
1511
+ menuRef: internalRef,
1512
+ topOffset
1513
+ }
1514
+ );
1515
+ (0, import_react6.useEffect)(() => {
1516
+ const raf = requestAnimationFrame(() => {
1517
+ if (!actualRef || !actualRef.current || customMaxHeight) {
1518
+ return;
1519
+ }
1520
+ if (actualRef.current.childElementCount > 4) {
1521
+ let accumulatedHeight = 0;
1522
+ Array.from(actualRef.current.children).forEach((child, index) => {
1523
+ if (index >= 5) {
1524
+ return;
1525
+ }
1526
+ accumulatedHeight += child.clientHeight;
1527
+ });
1528
+ accumulatedHeight = accumulatedHeight / 5 * 4.5;
1529
+ setMaxHeight(`${accumulatedHeight}px`);
1530
+ }
1531
+ });
1532
+ return () => {
1533
+ cancelAnimationFrame(raf);
1534
+ };
1535
+ }, [actualRef, customMaxHeight]);
1536
+ (0, import_react6.useEffect)(() => {
1537
+ if (!show) {
1538
+ return;
1539
+ }
1540
+ initializeMenuFocus();
1541
+ updatePosition();
1542
+ }, [show, updatePosition]);
1543
+ (0, import_react6.useEffect)(() => {
1544
+ if (!show || !setShow) {
1545
+ return;
1546
+ }
1547
+ const handleEscapeKey = (event) => {
1548
+ var _a2;
1549
+ if (event.key !== "Escape") {
1550
+ return;
1551
+ }
1552
+ setShow(false);
1553
+ (_a2 = positionTo == null ? void 0 : positionTo.current) == null ? void 0 : _a2.focus();
1554
+ };
1555
+ document.addEventListener("keydown", handleEscapeKey);
1556
+ return () => {
1557
+ document.removeEventListener("keydown", handleEscapeKey);
1558
+ };
1559
+ }, [show, setShow, positionTo]);
1560
+ return show && (0, import_react_dom.createPortal)(
1561
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1562
+ "div",
1563
+ __spreadProps(__spreadValues({
1564
+ ref: setRefs,
1565
+ className: (0, import_clsx8.default)(
1566
+ "shadow-4 rounded-base bg-background-grouped-primary-normal overflow-x-hidden overflow-y-auto flex flex-col outline-0",
1567
+ "fixed",
1568
+ "z-50",
1569
+ mobileHide && "opacity-0 pointer-events-none",
1570
+ className
1571
+ )
1572
+ }, props), {
1573
+ style: __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props.style), {
1574
+ maxHeight: customMaxHeight || maxHeight
1575
+ }), menuPosition), {
1576
+ minWidth: useDefaultMinWidth ? "212px" : menuPosition.minWidth
1577
+ }),
1578
+ onKeyDown: handleKeydown,
1579
+ onMouseDown: stopPropagation,
1580
+ onMouseUp: stopPropagation,
1581
+ onTouchStart: stopPropagation,
1582
+ onTouchEnd: stopPropagation,
1583
+ tabIndex: -1,
1584
+ "data-menu": menuName != null ? menuName : "",
1585
+ children: [
1586
+ mobileBackMenuOption == null ? void 0 : mobileBackMenuOption(),
1587
+ children
1588
+ ]
1589
+ })
1590
+ ),
1591
+ findDocumentRoot(internalRef.current)
1592
+ );
1593
+ function handleKeydown(e) {
1594
+ var _a2, _b2;
1595
+ if (!internalRef.current) {
1596
+ return;
1597
+ }
1598
+ if (e.key !== "Escape") {
1599
+ e.stopPropagation();
1600
+ }
1601
+ const menuOptions = Array.from(
1602
+ internalRef.current.querySelectorAll('[role="menuitem"]')
1603
+ );
1604
+ if (menuOptions.length === 0) {
1605
+ return;
1606
+ }
1607
+ let currentIndex = -1;
1608
+ const focusedElement = document.activeElement;
1609
+ for (let i = 0; i < menuOptions.length; i++) {
1610
+ if (menuOptions[i] === focusedElement) {
1611
+ currentIndex = i;
1612
+ break;
1613
+ }
1614
+ }
1615
+ switch (e.key) {
1616
+ case "ArrowDown": {
1617
+ e.preventDefault();
1618
+ const nextIndex = currentIndex < menuOptions.length - 1 ? currentIndex + 1 : 0;
1619
+ menuOptions[nextIndex].focus();
1620
+ break;
1621
+ }
1622
+ case "ArrowUp": {
1623
+ e.preventDefault();
1624
+ const prevIndex = currentIndex > 0 ? currentIndex - 1 : menuOptions.length - 1;
1625
+ menuOptions[prevIndex].focus();
1626
+ break;
1627
+ }
1628
+ case "Home":
1629
+ e.preventDefault();
1630
+ menuOptions[0].focus();
1631
+ break;
1632
+ case "End":
1633
+ e.preventDefault();
1634
+ menuOptions[menuOptions.length - 1].focus();
1635
+ break;
1636
+ case "Enter":
1637
+ case " ":
1638
+ case "ArrowRight":
1639
+ e.preventDefault();
1640
+ if (currentIndex >= 0) {
1641
+ menuOptions[currentIndex].click();
1642
+ }
1643
+ break;
1644
+ case "ArrowLeft":
1645
+ e.preventDefault();
1646
+ (_a2 = positionTo == null ? void 0 : positionTo.current) == null ? void 0 : _a2.click();
1647
+ (_b2 = positionTo == null ? void 0 : positionTo.current) == null ? void 0 : _b2.focus();
1648
+ break;
1649
+ }
1650
+ }
1651
+ function initializeMenuFocus() {
1652
+ var _a2, _b2, _c;
1653
+ if (!autoFocusOff) {
1654
+ (_a2 = internalRef.current) == null ? void 0 : _a2.focus();
1655
+ }
1656
+ const selectedOption = (_b2 = internalRef.current) == null ? void 0 : _b2.querySelector(
1657
+ "[data-selected]"
1658
+ );
1659
+ const firstMenuItem = (_c = internalRef.current) == null ? void 0 : _c.querySelector(
1660
+ '[role="menuitem"]'
1661
+ );
1662
+ const targetElement = selectedOption || firstMenuItem;
1663
+ if (!targetElement) {
1664
+ return;
1665
+ }
1666
+ targetElement.scrollIntoView({
1667
+ block: "nearest",
1668
+ behavior: "instant"
1669
+ });
1670
+ if (autoFocusOff) {
1671
+ return;
1672
+ }
1673
+ requestAnimationFrame(() => {
1674
+ targetElement.focus();
1675
+ });
1676
+ }
1677
+ function setRefs(node) {
1678
+ internalRef.current = node;
1679
+ if (ref) {
1680
+ if (typeof ref === "function") {
1681
+ ref(node);
1682
+ } else {
1683
+ ref.current = node;
1684
+ }
1685
+ }
1686
+ }
1687
+ function stopPropagation(e) {
1688
+ e.stopPropagation();
1689
+ }
1690
+ };
1691
+ Menu.displayName = "Menu";
1692
+
1693
+ // src/components/MenuOption.tsx
1694
+ var import_clsx9 = __toESM(require("clsx"), 1);
1695
+ var import_react7 = require("react");
1696
+ var import_jsx_runtime9 = require("react/jsx-runtime");
1697
+ var MenuOption = ({
1698
+ children,
1699
+ disabled = false,
1700
+ variant = "normal",
1701
+ value,
1702
+ before,
1703
+ after,
1704
+ subMenu,
1705
+ onClick,
1706
+ selected,
1707
+ ref,
1708
+ onSubMenuHover,
1709
+ onSubMenuLeave,
1710
+ onSubMenuEnter,
1711
+ toggleMenu,
1712
+ subMenuLevel = 1,
1713
+ currentSubMenuLevel,
1714
+ closeSubMenuLevel,
1715
+ activeMenu,
1716
+ mobilePositionTo,
1717
+ highlightMatchingText = false,
1718
+ menuValue
1719
+ }) => {
1720
+ const uniqueId = (0, import_react7.useId)();
1721
+ const internalRef = (0, import_react7.useRef)(null);
1722
+ const actualRef = ref || internalRef;
1723
+ const menuId = (0, import_react7.useRef)(`menu-${uniqueId}`);
1724
+ const isMobile = useMatchesMobile();
1725
+ const handleMouseEnter = () => {
1726
+ if (subMenu && onSubMenuHover && !disabled) {
1727
+ onSubMenuHover(menuId.current, subMenuLevel);
1728
+ }
1729
+ };
1730
+ const handleMouseLeave = () => {
1731
+ if (subMenu && onSubMenuLeave && !disabled) {
1732
+ onSubMenuLeave(subMenuLevel);
1733
+ }
1734
+ };
1735
+ const handleSubMenuEnter = () => {
1736
+ if (onSubMenuEnter) {
1737
+ onSubMenuEnter();
1738
+ }
1739
+ };
1740
+ const additionalAttributes = {
1741
+ "data-selected": selected || null
1742
+ };
1743
+ const svgStyles = (0, import_clsx9.default)(
1744
+ "[&>svg]:shrink-0 [&>svg]:fill-icon-action-primary-normal"
1745
+ );
1746
+ const textLabelStyles = (0, import_clsx9.default)("w-full whitespace-nowrap !leading-6");
1747
+ const normalStyles = variant === "normal" && !disabled && (0, import_clsx9.default)(
1748
+ "bg-transparent text-text-primary-normal",
1749
+ "hover:bg-background-action-secondary-hover",
1750
+ "focus:bg-background-action-secondary-hover",
1751
+ "data-selected:bg-background-action-secondary-hover",
1752
+ "active:bg-background-action-secondary-active"
1753
+ );
1754
+ const normalDisabledStyles = variant === "normal" && disabled && (0, import_clsx9.default)("text-text-primary-disabled");
1755
+ const actionStyles = variant === "action" && !disabled && (0, import_clsx9.default)(
1756
+ "text-action-400 bg-transparent",
1757
+ "hover:bg-background-action-secondary-hover hover:text-text-action-hover",
1758
+ "focus:bg-background-action-secondary-hover focus:text-text-action-hover",
1759
+ "data-selected:bg-background-action-secondary-active data-selected:text-text-action-active",
1760
+ "active:bg-background-action-secondary-active active:text-text-action-active"
1761
+ );
1762
+ const actionDisabledStyles = variant === "action" && disabled && (0, import_clsx9.default)("text-text-action-disabled");
1763
+ const disabledStyles = disabled && (0, import_clsx9.default)("bg-transparent cursor-default pointer-events-none");
1764
+ const renderChildren = typeof children === "string" && highlightMatchingText ? highlightMatch(children, menuValue) : children;
1765
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
1766
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1767
+ "div",
1768
+ __spreadProps(__spreadValues({
1769
+ ref: actualRef,
1770
+ className: (0, import_clsx9.default)(
1771
+ "flex items-center cursor-pointer w-full text-left relative outline-none",
1772
+ svgStyles,
1773
+ componentGap,
1774
+ componentPadding,
1775
+ baseTransition,
1776
+ normalStyles,
1777
+ normalDisabledStyles,
1778
+ actionStyles,
1779
+ actionDisabledStyles,
1780
+ disabledStyles
1781
+ ),
1782
+ "data-value": value || children,
1783
+ onClick: () => {
1784
+ onClick == null ? void 0 : onClick(menuId.current, value || children);
1785
+ if (subMenu) {
1786
+ toggleMenu(menuId.current, subMenuLevel);
1787
+ }
1788
+ },
1789
+ onMouseEnter: handleMouseEnter,
1790
+ onMouseLeave: handleMouseLeave
1791
+ }, additionalAttributes), {
1792
+ tabIndex: -1,
1793
+ role: "menuitem",
1794
+ "aria-haspopup": subMenu ? "menu" : void 0,
1795
+ children: [
1796
+ before && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "shrink-0 flex items-center", children: before }),
1797
+ variant === "action" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Label, { padded: true, className: textLabelStyles, children: renderChildren }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Paragraph, { padded: true, className: textLabelStyles, children: renderChildren }),
1798
+ renderAfterProp()
1799
+ ]
1800
+ })
1801
+ ),
1802
+ subMenu && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1803
+ "div",
1804
+ {
1805
+ onMouseEnter: handleSubMenuEnter,
1806
+ onMouseLeave: handleMouseLeave,
1807
+ "data-submenu-parent": menuId.current,
1808
+ "data-menu-level": subMenuLevel + 1,
1809
+ children: subMenu({ menuId: menuId.current, positionTo: actualRef, mobilePositionTo, position: "right", subMenuLevel, mobileBackMenuOption, mobileHide: isMobile && activeMenu !== menuId.current })
1810
+ }
1811
+ )
1812
+ ] });
1813
+ function renderAfterProp() {
1814
+ if (after) {
1815
+ return after;
1816
+ }
1817
+ if (subMenu && after !== null) {
1818
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { name: "chevron_right" });
1819
+ }
1820
+ }
1821
+ function mobileBackMenuOption() {
1822
+ if (!isMobile) {
1823
+ return;
1824
+ }
1825
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1826
+ MenuOption,
1827
+ {
1828
+ onClick: () => {
1829
+ closeSubMenuLevel == null ? void 0 : closeSubMenuLevel(currentSubMenuLevel != null ? currentSubMenuLevel : 0);
1830
+ },
1831
+ variant: "action",
1832
+ before: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { name: "chevron_left" }),
1833
+ children: "Back"
1834
+ }
1835
+ );
1836
+ }
1837
+ };
1838
+ MenuOption.displayName = "MenuOption";
1839
+ function highlightMatch(text, searchValue) {
1840
+ if (!searchValue || !searchValue.trim()) {
1841
+ return text;
1842
+ }
1843
+ const regex = new RegExp(`(${searchValue.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})`, "gi");
1844
+ const parts = text.split(regex);
1845
+ return parts.map(
1846
+ (part, index) => regex.test(part) ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "font-bold", children: part }, index) : part
1847
+ );
1848
+ }
1849
+
1850
+ // src/components/DataGridCell.tsx
1851
+ var import_jsx_runtime10 = require("react/jsx-runtime");
1852
+ var DataGridCell = (0, import_react8.memo)(
1853
+ (_a) => {
1854
+ var _b = _a, {
1855
+ type = "default",
1856
+ component = "static",
1857
+ children,
1858
+ className,
1859
+ locked = false,
1860
+ noPadding = false,
1861
+ paddedLeft = false,
1862
+ style,
1863
+ onClick,
1864
+ onRightClick,
1865
+ error,
1866
+ warning,
1867
+ center,
1868
+ width
1869
+ } = _b, props = __objRest(_b, [
1870
+ "type",
1871
+ "component",
1872
+ "children",
1873
+ "className",
1874
+ "locked",
1875
+ "noPadding",
1876
+ "paddedLeft",
1877
+ "style",
1878
+ "onClick",
1879
+ "onRightClick",
1880
+ "error",
1881
+ "warning",
1882
+ "center",
1883
+ "width"
1884
+ ]);
1885
+ const Element = type === "header" ? "th" : "td";
1886
+ const timerRef = (0, import_react8.useRef)(null);
1887
+ const [isGrabbing, setIsGrabbing] = (0, import_react8.useState)(false);
1888
+ const [isPointerPressed, setIsPointerPressed] = (0, import_react8.useState)(false);
1889
+ (0, import_react8.useEffect)(() => {
1890
+ return () => {
1891
+ if (timerRef.current) {
1892
+ clearTimeout(timerRef.current);
1893
+ timerRef.current = null;
1894
+ }
1895
+ };
1896
+ }, []);
1897
+ const handlePointerDown = (_event) => {
1898
+ setIsPointerPressed(true);
1899
+ timerRef.current = window.setTimeout(() => {
1900
+ setIsGrabbing(true);
1901
+ }, 500);
1902
+ };
1903
+ const handlePointerUp = (event) => {
1904
+ if (timerRef.current) {
1905
+ clearTimeout(timerRef.current);
1906
+ timerRef.current = null;
1907
+ }
1908
+ const rightClick = event.nativeEvent instanceof MouseEvent && event.nativeEvent.button === 2;
1909
+ if (!isGrabbing && onClick && !rightClick && isPointerPressed) {
1910
+ onClick(event);
1911
+ }
1912
+ if (rightClick && onRightClick) {
1913
+ onRightClick();
1914
+ }
1915
+ setIsGrabbing(false);
1916
+ setIsPointerPressed(false);
1917
+ };
1918
+ const handlePointerLeave = () => {
1919
+ if (timerRef.current) {
1920
+ clearTimeout(timerRef.current);
1921
+ timerRef.current = null;
1922
+ }
1923
+ };
1924
+ const headerBgStyles = type === "header" && !locked && !["button"].includes(component) && "bg-brand-400 border-brand-200";
1925
+ const lockedHeaderBgStyles = locked && !["button"].includes(component) && "bg-neutral-400 border-neutral-300";
1926
+ const headerTypeStyles = type === "header" && component !== "button" && component !== "icon" && (0, import_clsx10.default)("border-r");
1927
+ const buttonComponentStyles = component === "button" && (0, import_clsx10.default)("border-r border-b border-border-primary-normal");
1928
+ const iconComponentStyles = component === "icon" && (0, import_clsx10.default)("border-l");
1929
+ const cellClasses = (0, import_clsx10.default)(
1930
+ headerTypeStyles,
1931
+ buttonComponentStyles,
1932
+ headerBgStyles,
1933
+ lockedHeaderBgStyles,
1934
+ iconComponentStyles,
1935
+ className,
1936
+ "flex flex-1 items-center gap-1 whitespace-nowrap min-w-full max-h-10 relative text-text-primary-normal",
1937
+ "focus-within:!z-10",
1938
+ component === "input" && "border",
1939
+ component === "input" && !error && !warning && "border-border-primary-normal",
1940
+ component === "input" && error && "border-border-primary-error",
1941
+ component === "input" && warning && "border-background-warning-normal",
1942
+ !["button", "icon"].includes(component) && !noPadding && "p-2",
1943
+ paddedLeft && "pl-2",
1944
+ component === "icon" && "border-l",
1945
+ isGrabbing && "!cursor-grabbing",
1946
+ component === "checkbox" || center && "justify-center"
1947
+ );
1948
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1949
+ Element,
1950
+ __spreadProps(__spreadValues({
1951
+ className: (0, import_clsx10.default)("flex", !width && "flex-1"),
1952
+ style: { width }
1953
+ }, props), {
1954
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1955
+ "div",
1956
+ {
1957
+ className: cellClasses,
1958
+ style: __spreadValues({}, style),
1959
+ onMouseDown: handlePointerDown,
1960
+ onMouseUp: handlePointerUp,
1961
+ onMouseLeave: handlePointerLeave,
1962
+ onTouchStart: handlePointerDown,
1963
+ onTouchEnd: handlePointerUp,
1964
+ onTouchCancel: handlePointerLeave,
1965
+ onContextMenu: (e) => e.preventDefault(),
1966
+ children
1967
+ }
1968
+ )
1969
+ })
1970
+ );
1971
+ }
1972
+ );
1973
+ DataGridCell.displayName = "DataGridCell";
1974
+ function DraggableCellHeader(_a) {
1975
+ var _b = _a, {
1976
+ header,
1977
+ children,
1978
+ locked = false
1979
+ } = _b, props = __objRest(_b, [
1980
+ "header",
1981
+ "children",
1982
+ "locked"
1983
+ ]);
1984
+ var _a2;
1985
+ const { attributes, isDragging, listeners, setNodeRef, transform, node } = (0, import_sortable.useSortable)({
1986
+ id: header.column.id
1987
+ });
1988
+ const [showMenu, setShowMenu] = (0, import_react8.useState)(false);
1989
+ const [filter, setFilter] = (0, import_react8.useState)(
1990
+ (_a2 = header.column.getFilterValue()) != null ? _a2 : ""
1991
+ );
1992
+ const {
1993
+ menuRootRef,
1994
+ isMenuActive,
1995
+ registerSubMenu,
1996
+ listeners: subMenuListeners,
1997
+ mobileHide
1998
+ } = useSubMenuSystem(node);
1999
+ (0, import_react8.useEffect)(() => {
2000
+ const handler = setTimeout(() => {
2001
+ header.column.setFilterValue(filter);
2002
+ }, 500);
2003
+ return () => {
2004
+ clearTimeout(handler);
2005
+ };
2006
+ }, [filter]);
2007
+ const style = {
2008
+ opacity: isDragging ? 0.8 : 1,
2009
+ position: "relative",
2010
+ transform: CSS.Translate.toString(transform),
2011
+ transition: "width transform 0.2s ease-in-out",
2012
+ whiteSpace: "nowrap",
2013
+ width: header.column.getSize(),
2014
+ zIndex: isDragging ? 1 : 0,
2015
+ "--color-text-primary-normal": "var(--color-neutral-000)"
2016
+ };
2017
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2018
+ DataGridCell,
2019
+ __spreadProps(__spreadValues(__spreadValues(__spreadProps(__spreadValues({
2020
+ locked,
2021
+ type: "header",
2022
+ component: "header",
2023
+ ref: setNodeRef,
2024
+ colSpan: header.colSpan,
2025
+ style
2026
+ }, props), {
2027
+ onClick: header.column.getToggleSortingHandler(),
2028
+ onRightClick: () => setShowMenu(!showMenu)
2029
+ }), locked ? {} : attributes), locked ? {} : listeners), {
2030
+ children: [
2031
+ children,
2032
+ header.column.getCanFilter() && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2033
+ Menu,
2034
+ {
2035
+ ref: menuRootRef,
2036
+ positionTo: node,
2037
+ show: showMenu,
2038
+ setShow: setShowMenu,
2039
+ mobileHide,
2040
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2041
+ MenuOption,
2042
+ __spreadProps(__spreadValues({}, subMenuListeners), {
2043
+ subMenu: (_b2) => {
2044
+ var _c = _b2, { menuId, subMenuLevel } = _c, props2 = __objRest(_c, ["menuId", "subMenuLevel"]);
2045
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2046
+ Menu,
2047
+ __spreadProps(__spreadValues({}, props2), {
2048
+ show: isMenuActive(menuId, subMenuLevel),
2049
+ ref: (el) => {
2050
+ registerSubMenu(menuId, el);
2051
+ },
2052
+ children: [
2053
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: (0, import_clsx10.default)(paddingUsingComponentGap), children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2054
+ Search,
2055
+ {
2056
+ onChange: (event) => {
2057
+ setFilter(event.target.value);
2058
+ },
2059
+ onKeyDown: (event) => {
2060
+ if ([" ", "Space"].includes(event.key)) {
2061
+ event.stopPropagation();
2062
+ }
2063
+ },
2064
+ value: filter != null ? filter : ""
2065
+ }
2066
+ ) }),
2067
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2068
+ MenuOption,
2069
+ {
2070
+ onClick: handleFilterFnChange,
2071
+ before: menuOptionIcon("includesString"),
2072
+ children: "Contains"
2073
+ }
2074
+ ),
2075
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2076
+ MenuOption,
2077
+ {
2078
+ onClick: handleFilterFnChange,
2079
+ before: menuOptionIcon("startsWith"),
2080
+ children: "Starts with"
2081
+ }
2082
+ ),
2083
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2084
+ MenuOption,
2085
+ {
2086
+ onClick: handleFilterFnChange,
2087
+ before: menuOptionIcon("endsWith"),
2088
+ children: "Ends with"
2089
+ }
2090
+ )
2091
+ ]
2092
+ })
2093
+ );
2094
+ },
2095
+ children: "Filter"
2096
+ })
2097
+ )
2098
+ }
2099
+ )
2100
+ ]
2101
+ })
2102
+ );
2103
+ function menuOptionIcon(value) {
2104
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2105
+ Icon,
2106
+ {
2107
+ name: "check",
2108
+ className: (0, import_clsx10.default)(
2109
+ header.column.columnDef.filterFn !== value && "text-transparent"
2110
+ )
2111
+ }
2112
+ );
2113
+ }
2114
+ function handleFilterFnChange(_id, value) {
2115
+ var _a3;
2116
+ let filterFn = "includesString";
2117
+ const currentFilterFn = header.column.columnDef.filterFn;
2118
+ if ((value == null ? void 0 : value.toLowerCase()) === "starts with") {
2119
+ filterFn = currentFilterFn === "startsWith" ? "auto" : "startsWith";
2120
+ }
2121
+ if ((value == null ? void 0 : value.toLowerCase()) === "ends with") {
2122
+ filterFn = currentFilterFn === "endsWith" ? "auto" : "endsWith";
2123
+ }
2124
+ if ((value == null ? void 0 : value.toLowerCase()) === "contains") {
2125
+ filterFn = currentFilterFn === "includesString" ? "auto" : "includesString";
2126
+ }
2127
+ header.column.columnDef.filterFn = filterFn;
2128
+ header.column.setFilterValue((_a3 = header.column.getFilterValue()) != null ? _a3 : "");
2129
+ }
2130
+ }
2131
+ DraggableCellHeader.displayName = "DraggableCellHeader";
2132
+ function DragAlongCell(_a) {
2133
+ var _b = _a, {
2134
+ cell,
2135
+ children
2136
+ } = _b, props = __objRest(_b, [
2137
+ "cell",
2138
+ "children"
2139
+ ]);
2140
+ const { isDragging, setNodeRef, transform } = (0, import_sortable.useSortable)({
2141
+ id: cell.column.id
2142
+ });
2143
+ const style = {
2144
+ opacity: isDragging ? 0.8 : 1,
2145
+ position: "relative",
2146
+ transform: CSS.Translate.toString(transform),
2147
+ transition: "width transform 0.2s ease-in-out",
2148
+ zIndex: isDragging ? 1 : 0,
2149
+ width: cell.column.getSize(),
2150
+ minWidth: "min-content"
2151
+ };
2152
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DataGridCell, __spreadProps(__spreadValues({ style, ref: setNodeRef }, props), { children }));
2153
+ }
2154
+ DragAlongCell.displayName = "DragAlongCell";
2155
+
2156
+ // src/components/Select.tsx
2157
+ var import_react9 = require("react");
2158
+ var import_clsx11 = __toESM(require("clsx"), 1);
2159
+ var import_jsx_runtime11 = require("react/jsx-runtime");
2160
+ var Select = (_a) => {
2161
+ var _b = _a, {
2162
+ label,
2163
+ error,
2164
+ children,
2165
+ readOnly,
2166
+ renderMenu,
2167
+ onClick,
2168
+ className,
2169
+ wrapperClassName,
2170
+ removeRoundness
2171
+ } = _b, props = __objRest(_b, [
2172
+ "label",
2173
+ "error",
2174
+ "children",
2175
+ "readOnly",
2176
+ "renderMenu",
2177
+ "onClick",
2178
+ "className",
2179
+ "wrapperClassName",
2180
+ "removeRoundness"
2181
+ ]);
2182
+ const inputRef = (0, import_react9.useRef)(null);
2183
+ const inputContainerRef = (0, import_react9.useRef)(null);
2184
+ const preventFocusOnInitialRender = (0, import_react9.useRef)(true);
2185
+ const [show, setShow] = (0, import_react9.useState)(false);
2186
+ (0, import_react9.useEffect)(() => {
2187
+ var _a2;
2188
+ if (preventFocusOnInitialRender.current) {
2189
+ preventFocusOnInitialRender.current = false;
2190
+ return;
2191
+ }
2192
+ (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
2193
+ }, [props.value]);
2194
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
2195
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2196
+ InputBase,
2197
+ __spreadValues({
2198
+ inputContainerRef,
2199
+ ref: inputRef,
2200
+ label,
2201
+ after: !readOnly && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2202
+ "span",
2203
+ {
2204
+ className: (0, import_clsx11.default)(
2205
+ props.disabled ? "text-icon-action-primary-disabled" : "text-icon-action-primary-normal",
2206
+ "contents"
2207
+ ),
2208
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { name: "keyboard_arrow_down" })
2209
+ }
2210
+ ),
2211
+ maxLength: 0,
2212
+ className: (0, import_clsx11.default)("!caret-transparent !cursor-default", className),
2213
+ wrapperClassName,
2214
+ onKeyDown: (e) => {
2215
+ const openKeys = ["Enter", "Space", " "];
2216
+ if (openKeys.includes(e.key)) {
2217
+ e.preventDefault();
2218
+ e.target.click();
2219
+ }
2220
+ },
2221
+ onClick: (e) => {
2222
+ if (props.disabled || readOnly) {
2223
+ return;
2224
+ }
2225
+ setShow(!show);
2226
+ onClick == null ? void 0 : onClick(e);
2227
+ },
2228
+ error,
2229
+ readOnly,
2230
+ removeRoundness,
2231
+ focus: show
2232
+ }, props)
2233
+ ),
2234
+ renderMenu ? renderMenu({
2235
+ positionTo: inputContainerRef,
2236
+ show,
2237
+ setShow,
2238
+ topOffset: props.caption ? -16 : null
2239
+ }) : children
2240
+ ] });
2241
+ };
2242
+ Select.displayName = "Select";
2243
+
2244
+ // src/components/Subheader.tsx
2245
+ var import_clsx12 = __toESM(require("clsx"), 1);
2246
+ var import_jsx_runtime12 = require("react/jsx-runtime");
2247
+ var Subheader = (_a) => {
2248
+ var _b = _a, {
2249
+ className,
2250
+ children,
2251
+ as = "span",
2252
+ align,
2253
+ color,
2254
+ tall
2255
+ } = _b, props = __objRest(_b, [
2256
+ "className",
2257
+ "children",
2258
+ "as",
2259
+ "align",
2260
+ "color",
2261
+ "tall"
2262
+ ]);
2263
+ const Element = as;
2264
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2265
+ Element,
2266
+ __spreadProps(__spreadValues({
2267
+ className: (0, import_clsx12.default)(
2268
+ typography.subheader,
2269
+ className,
2270
+ align === "left" && "text-left",
2271
+ align === "center" && "text-center",
2272
+ align === "right" && "text-right",
2273
+ tall && "!leading-6"
2274
+ ),
2275
+ style: __spreadProps(__spreadValues({}, props.style), {
2276
+ color: color ? `var(--color-${color})` : void 0
2277
+ })
2278
+ }, props), {
2279
+ children
2280
+ })
2281
+ );
2282
+ };
2283
+ Subheader.displayName = "Subheader";
2284
+
2285
+ // src/components/Tooltip.tsx
2286
+ var import_clsx13 = __toESM(require("clsx"), 1);
2287
+ var import_react10 = require("react");
2288
+ var import_react_dom2 = require("react-dom");
2289
+ var import_jsx_runtime13 = require("react/jsx-runtime");
2290
+ var Tooltip = ({
2291
+ message,
2292
+ position = "top",
2293
+ children,
2294
+ showOnTruncation = false,
2295
+ offset = 8
2296
+ }) => {
2297
+ const ref = (0, import_react10.useRef)(null);
2298
+ const tooltipRef = (0, import_react10.useRef)(null);
2299
+ const [isTruncated, setIsTruncated] = (0, import_react10.useState)(false);
2300
+ const [tooltipPosition, setTooltipPosition] = (0, import_react10.useState)({ top: 0, left: 0 });
2301
+ const [isVisible, setIsVisible] = (0, import_react10.useState)(false);
2302
+ const [removeOpacity, setRemoveOpacity] = (0, import_react10.useState)(false);
2303
+ const updatePosition = () => {
2304
+ if (!ref.current || !tooltipRef.current) return;
2305
+ const rect = ref.current.getBoundingClientRect();
2306
+ const tooltipRect = tooltipRef.current.getBoundingClientRect();
2307
+ let top = 0;
2308
+ let left = 0;
2309
+ switch (position) {
2310
+ case "top":
2311
+ top = rect.top - tooltipRect.height - offset;
2312
+ left = rect.left + rect.width / 2 - tooltipRect.width / 2;
2313
+ break;
2314
+ case "bottom":
2315
+ top = rect.bottom + offset;
2316
+ left = rect.left + rect.width / 2 - tooltipRect.width / 2;
2317
+ break;
2318
+ case "left":
2319
+ top = rect.top + rect.height / 2 - tooltipRect.height / 2;
2320
+ left = rect.left - tooltipRect.width - offset;
2321
+ break;
2322
+ case "right":
2323
+ top = rect.top + rect.height / 2 - tooltipRect.height / 2;
2324
+ left = rect.right + offset;
2325
+ break;
2326
+ }
2327
+ setTooltipPosition({ top, left });
2328
+ requestAnimationFrame(() => {
2329
+ setRemoveOpacity(true);
2330
+ });
2331
+ };
2332
+ const handleMouseEnter = () => {
2333
+ if (!showOnTruncation || checkForTextTruncation()) {
2334
+ setIsVisible(true);
2335
+ }
2336
+ };
2337
+ const handleMouseLeave = () => {
2338
+ setIsVisible(false);
2339
+ setRemoveOpacity(false);
2340
+ };
2341
+ (0, import_react10.useEffect)(() => {
2342
+ if (isVisible && tooltipRef.current) {
2343
+ requestAnimationFrame(() => {
2344
+ updatePosition();
2345
+ });
2346
+ }
2347
+ }, [isVisible]);
2348
+ (0, import_react10.useEffect)(() => {
2349
+ if (isVisible) {
2350
+ window.addEventListener("resize", updatePosition);
2351
+ return () => window.removeEventListener("resize", updatePosition);
2352
+ }
2353
+ }, [isVisible]);
2354
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
2355
+ "div",
2356
+ {
2357
+ ref,
2358
+ className: "relative inline-grid grid-cols-[auto_1fr] items-center",
2359
+ onMouseEnter: handleMouseEnter,
2360
+ onMouseLeave: handleMouseLeave,
2361
+ children: [
2362
+ children,
2363
+ isVisible && typeof document !== "undefined" && (0, import_react_dom2.createPortal)(
2364
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2365
+ "div",
2366
+ {
2367
+ ref: tooltipRef,
2368
+ style: {
2369
+ position: "fixed",
2370
+ top: `${tooltipPosition.top}px`,
2371
+ left: `${tooltipPosition.left}px`,
2372
+ zIndex: 9999
2373
+ },
2374
+ className: (0, import_clsx13.default)(
2375
+ typography.caption,
2376
+ "p-2 bg-neutral-500 text-neutral-100 rounded whitespace-nowrap shadow-2 pointer-events-none transition-opacity duration-100 ease-in-out",
2377
+ !removeOpacity && "opacity-0"
2378
+ ),
2379
+ children: message
2380
+ }
2381
+ ),
2382
+ document.body
2383
+ )
2384
+ ]
2385
+ }
2386
+ );
2387
+ function checkForTextTruncation() {
2388
+ if (showOnTruncation && ref.current) {
2389
+ const paragraph = ref.current.querySelector("p");
2390
+ if (paragraph) {
2391
+ const isTruncated2 = paragraph.scrollWidth > paragraph.clientWidth;
2392
+ setIsTruncated(isTruncated2);
2393
+ return isTruncated2;
2394
+ }
2395
+ }
2396
+ return false;
2397
+ }
2398
+ };
2399
+ Tooltip.displayName = "Tooltip";
2400
+
2401
+ // src/components/useInfiniteScroll.tsx
2402
+ var import_react11 = require("react");
2403
+ function useInfiniteScroll({
2404
+ containerRef,
2405
+ onLoadMore,
2406
+ isLoading,
2407
+ offset = 50,
2408
+ enabled = true
2409
+ // ✅ Add this
2410
+ }) {
2411
+ (0, import_react11.useEffect)(() => {
2412
+ if (!enabled) return;
2413
+ const handleScroll = () => {
2414
+ const el2 = containerRef.current;
2415
+ if (!el2 || isLoading) return;
2416
+ const { scrollTop, scrollHeight, clientHeight } = el2;
2417
+ const isNearBottom = scrollTop + clientHeight >= scrollHeight - offset;
2418
+ if (isNearBottom) {
2419
+ onLoadMore();
2420
+ }
2421
+ };
2422
+ const el = containerRef.current;
2423
+ if (el) el.addEventListener("scroll", handleScroll);
2424
+ return () => {
2425
+ if (el) el.removeEventListener("scroll", handleScroll);
2426
+ };
2427
+ }, [containerRef, onLoadMore, isLoading, offset, enabled]);
2428
+ }
2429
+
2430
+ // src/components/DataGrid.tsx
2431
+ var import_clsx14 = __toESM(require("clsx"), 1);
2432
+ var import_jsx_runtime14 = (
2433
+ // fake empty column to the left for virtualization scroll padding
2434
+ require("react/jsx-runtime")
2435
+ );
2436
+ var PAGE_SIZE_OPTIONS = [5, 10, 15, 20, 25, 30, 35];
2437
+ var NO_RESULTS_HEIGHT = "h-[120px]";
2438
+ function adaptTableStateSetter(setter) {
2439
+ return (valueOrFn) => {
2440
+ setter(
2441
+ (prev) => typeof valueOrFn === "function" ? valueOrFn(prev) : valueOrFn
2442
+ );
2443
+ };
2444
+ }
2445
+ function DataGrid({
2446
+ data,
2447
+ columns,
2448
+ status,
2449
+ isLoadingMore = false,
2450
+ onLoadMore,
2451
+ pagination,
2452
+ showFilterRow = false,
2453
+ hasMore = false,
2454
+ sorting: externalSorting,
2455
+ onSortingChange,
2456
+ columnFilters: externalColumnFilters,
2457
+ onColumnFiltersChange,
2458
+ rowSelection: externalRowSelection,
2459
+ onRowSelectionChange,
2460
+ filteredSortedData,
2461
+ totalRowCount,
2462
+ hideStatusBar,
2463
+ centerHeader
2464
+ }) {
2465
+ var _a, _b, _c, _d, _e;
2466
+ const [columnOrder, setColumnOrder] = (0, import_react12.useState)(
2467
+ () => columns.map((c) => c.id)
2468
+ );
2469
+ const [localSorting, setLocalSorting] = (0, import_react12.useState)([]);
2470
+ const [localColumnFilters, setLocalColumnFilters] = (0, import_react12.useState)([]);
2471
+ const [localRowSelection, setLocalRowSelection] = (0, import_react12.useState)({});
2472
+ const sortingState = pagination ? externalSorting != null ? externalSorting : localSorting : localSorting;
2473
+ const setSortingState = pagination ? (updaterOrValue) => {
2474
+ const value = typeof updaterOrValue === "function" ? updaterOrValue(
2475
+ externalSorting != null ? externalSorting : []
2476
+ ) : updaterOrValue;
2477
+ (onSortingChange != null ? onSortingChange : setLocalSorting)(value);
2478
+ } : setLocalSorting;
2479
+ const columnFilterState = pagination ? externalColumnFilters != null ? externalColumnFilters : localColumnFilters : localColumnFilters;
2480
+ const setColumnFilterState = pagination ? (updaterOrValue) => {
2481
+ const value = typeof updaterOrValue === "function" ? updaterOrValue(externalColumnFilters != null ? externalColumnFilters : []) : updaterOrValue;
2482
+ (onColumnFiltersChange != null ? onColumnFiltersChange : setLocalColumnFilters)(value);
2483
+ } : setLocalColumnFilters;
2484
+ const rowSelection = pagination ? externalRowSelection != null ? externalRowSelection : localRowSelection : localRowSelection;
2485
+ const setRowSelection = pagination ? (updaterOrValue) => {
2486
+ const value = typeof updaterOrValue === "function" ? updaterOrValue(externalRowSelection != null ? externalRowSelection : {}) : updaterOrValue;
2487
+ (onRowSelectionChange != null ? onRowSelectionChange : setLocalRowSelection)(value);
2488
+ } : setLocalRowSelection;
2489
+ const id = (0, import_react12.useId)();
2490
+ const containerRef = import_react12.default.useRef(null);
2491
+ const table = (0, import_react_table.useReactTable)({
2492
+ columns,
2493
+ data,
2494
+ getCoreRowModel: (0, import_react_table.getCoreRowModel)(),
2495
+ getSortedRowModel: (0, import_react_table.getSortedRowModel)(),
2496
+ getFilteredRowModel: (0, import_react_table.getFilteredRowModel)(),
2497
+ columnResizeMode: "onChange",
2498
+ getRowId: (row, index) => {
2499
+ var _a2;
2500
+ return String((_a2 = row.id) != null ? _a2 : index + 1);
2501
+ },
2502
+ state: {
2503
+ columnOrder,
2504
+ sorting: sortingState,
2505
+ columnFilters: columnFilterState,
2506
+ rowSelection
2507
+ },
2508
+ onColumnOrderChange: setColumnOrder,
2509
+ onSortingChange: adaptTableStateSetter(setSortingState),
2510
+ onColumnFiltersChange: adaptTableStateSetter(setColumnFilterState),
2511
+ onRowSelectionChange: adaptTableStateSetter(setRowSelection),
2512
+ filterFns: {
2513
+ startsWith: (row, columnId, filterValue) => {
2514
+ var _a2;
2515
+ return (_a2 = row.getValue(columnId)) == null ? void 0 : _a2.toLowerCase().startsWith(filterValue.toLowerCase());
2516
+ },
2517
+ endsWith: (row, columnId, filterValue) => {
2518
+ var _a2;
2519
+ return (_a2 = row.getValue(columnId)) == null ? void 0 : _a2.toLowerCase().endsWith(filterValue.toLowerCase());
2520
+ }
2521
+ }
2522
+ });
2523
+ const allRowIds = pagination ? (_a = filteredSortedData == null ? void 0 : filteredSortedData.map((row) => String(row.id))) != null ? _a : [] : Array.from(
2524
+ { length: totalRowCount != null ? totalRowCount : data.length },
2525
+ (_, i) => String(i + 1)
2526
+ );
2527
+ const allSelectedAcrossPages = allRowIds.every((id2) => rowSelection[id2]);
2528
+ const someSelectedAcrossPages = !allSelectedAcrossPages && allRowIds.some((id2) => rowSelection[id2]);
2529
+ const toggleSelectAllAcrossPages = () => {
2530
+ setRowSelection((prev) => {
2531
+ const isSelecting = !allSelectedAcrossPages;
2532
+ if (isSelecting) {
2533
+ const newSelection = {};
2534
+ for (const id2 of allRowIds) {
2535
+ newSelection[id2] = true;
2536
+ }
2537
+ return __spreadValues(__spreadValues({}, prev), newSelection);
2538
+ } else {
2539
+ const updatedSelection = __spreadValues({}, prev);
2540
+ for (const id2 of allRowIds) {
2541
+ delete updatedSelection[id2];
2542
+ }
2543
+ return updatedSelection;
2544
+ }
2545
+ });
2546
+ };
2547
+ useInfiniteScroll({
2548
+ containerRef,
2549
+ onLoadMore: onLoadMore != null ? onLoadMore : () => {
2550
+ },
2551
+ isLoading: isLoadingMore,
2552
+ enabled: !pagination
2553
+ });
2554
+ const handleDragEnd = (event) => {
2555
+ const { active, over } = event;
2556
+ if (active && over && active.id !== over.id) {
2557
+ setColumnOrder((prev) => {
2558
+ const oldIndex = prev.indexOf(active.id);
2559
+ const newIndex = prev.indexOf(over.id);
2560
+ return (0, import_sortable2.arrayMove)(prev, oldIndex, newIndex);
2561
+ });
2562
+ }
2563
+ };
2564
+ const sensors = (0, import_core.useSensors)(
2565
+ (0, import_core.useSensor)(import_core.MouseSensor),
2566
+ (0, import_core.useSensor)(import_core.TouchSensor),
2567
+ (0, import_core.useSensor)(import_core.KeyboardSensor)
2568
+ );
2569
+ const visibleColumns = table.getVisibleLeafColumns();
2570
+ const columnVirtualizer = (0, import_react_virtual.useVirtualizer)({
2571
+ count: visibleColumns.length,
2572
+ estimateSize: (index) => visibleColumns[index].getSize(),
2573
+ //estimate width of each column for accurate scrollbar dragging
2574
+ getScrollElement: () => containerRef.current,
2575
+ horizontal: true,
2576
+ overscan: 3
2577
+ //how many columns to render on each side off screen each way
2578
+ });
2579
+ const virtualColumns = columnVirtualizer.getVirtualItems();
2580
+ let virtualPaddingLeft;
2581
+ let virtualPaddingRight;
2582
+ if (columnVirtualizer && (virtualColumns == null ? void 0 : virtualColumns.length)) {
2583
+ virtualPaddingLeft = (_c = (_b = virtualColumns[0]) == null ? void 0 : _b.start) != null ? _c : 0;
2584
+ virtualPaddingRight = columnVirtualizer.getTotalSize() - ((_e = (_d = virtualColumns[virtualColumns.length - 1]) == null ? void 0 : _d.end) != null ? _e : 0);
2585
+ }
2586
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2587
+ import_core.DndContext,
2588
+ {
2589
+ id,
2590
+ collisionDetection: import_core.closestCenter,
2591
+ modifiers: [import_modifiers.restrictToHorizontalAxis],
2592
+ onDragEnd: handleDragEnd,
2593
+ sensors,
2594
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2595
+ import_sortable2.SortableContext,
2596
+ {
2597
+ items: columnOrder,
2598
+ strategy: import_sortable2.horizontalListSortingStrategy,
2599
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-col flex-1 max-h-screen m-4 rounded border border-border-primary-normal overflow-hidden text-text-primary-normal", children: [
2600
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2601
+ "div",
2602
+ {
2603
+ className: "overflow-auto scrollbar-thin max-h-full relative contain-paint will-change-transform",
2604
+ ref: containerRef,
2605
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("table", { className: "min-w-full grid", children: [
2606
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("thead", { className: "sticky top-0 z-10 grid", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("tr", { className: "flex w-full", children: [
2607
+ virtualPaddingLeft ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2608
+ "th",
2609
+ {
2610
+ style: { display: "flex", width: virtualPaddingLeft }
2611
+ }
2612
+ ) : null,
2613
+ virtualColumns.map((virtualColumn) => {
2614
+ var _a2, _b2, _c2, _d2, _e2;
2615
+ const header = headerGroup.headers[virtualColumn.index];
2616
+ if (typeof header.column.columnDef.header === "string") {
2617
+ const customHeaderWidth = (_a2 = header.column.columnDef.meta) == null ? void 0 : _a2.headerWidth;
2618
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2619
+ DraggableCellHeader,
2620
+ {
2621
+ header,
2622
+ locked: (_b2 = header.column.columnDef.meta) == null ? void 0 : _b2.locked,
2623
+ center: centerHeader,
2624
+ width: customHeaderWidth,
2625
+ className: (0, import_clsx14.default)(
2626
+ header.column.getCanSort() ? "cursor-pointer" : "cursor-grab",
2627
+ "group"
2628
+ ),
2629
+ children: [
2630
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Subheader, { tall: true, children: header.column.columnDef.header }),
2631
+ getSortIcon(header.column.getIsSorted()),
2632
+ !header.column.getIsSorted() && header.column.getCanSort() && getSortIcon(
2633
+ header.column.getNextSortingOrder(),
2634
+ true
2635
+ ),
2636
+ header.column.getSortIndex() !== -1 && table.getState().sorting.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Subheader, { tall: true, children: header.column.getSortIndex() + 1 }),
2637
+ !((_c2 = header.column.columnDef.meta) == null ? void 0 : _c2.locked) && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2638
+ "div",
2639
+ {
2640
+ onDoubleClick: (e) => {
2641
+ e.stopPropagation();
2642
+ header.column.resetSize();
2643
+ },
2644
+ onMouseDown: (e) => {
2645
+ e.stopPropagation();
2646
+ header.getResizeHandler()(e);
2647
+ },
2648
+ onTouchStart: (e) => {
2649
+ e.stopPropagation();
2650
+ header.getResizeHandler()(e);
2651
+ },
2652
+ className: "absolute right-0 inset-y-0 w-px bg-black cursor-col-resize"
2653
+ }
2654
+ )
2655
+ ]
2656
+ },
2657
+ header.id
2658
+ );
2659
+ }
2660
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react12.default.Fragment, { children: ((_d2 = header.column.columnDef.meta) == null ? void 0 : _d2.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2661
+ DataGridCell,
2662
+ {
2663
+ type: "header",
2664
+ component: "checkbox",
2665
+ locked: (_e2 = header.column.columnDef.meta) == null ? void 0 : _e2.locked,
2666
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2667
+ Checkbox,
2668
+ {
2669
+ checked: allSelectedAcrossPages,
2670
+ indeterminate: someSelectedAcrossPages,
2671
+ onChange: toggleSelectAllAcrossPages
2672
+ }
2673
+ )
2674
+ }
2675
+ ) : (0, import_react_table.flexRender)(
2676
+ header.column.columnDef.header,
2677
+ header.getContext()
2678
+ ) }, header.id);
2679
+ }),
2680
+ virtualPaddingRight ? (
2681
+ //fake empty column to the right for virtualization scroll padding
2682
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2683
+ "th",
2684
+ {
2685
+ style: { display: "flex", width: virtualPaddingRight }
2686
+ }
2687
+ )
2688
+ ) : null
2689
+ ] }, headerGroup.id)) }),
2690
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2691
+ TableBody,
2692
+ {
2693
+ columnVirtualizer,
2694
+ table,
2695
+ tableContainerRef: containerRef,
2696
+ virtualPaddingLeft,
2697
+ virtualPaddingRight,
2698
+ pagination,
2699
+ isLoadingMore,
2700
+ hasMore,
2701
+ showFilterRow
2702
+ }
2703
+ )
2704
+ ] })
2705
+ }
2706
+ ),
2707
+ table.getRowModel().rows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2708
+ "div",
2709
+ {
2710
+ className: (0, import_clsx14.default)(
2711
+ NO_RESULTS_HEIGHT,
2712
+ "flex flex-col items-center justify-center",
2713
+ componentGap,
2714
+ componentPadding
2715
+ ),
2716
+ children: [
2717
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Subheader, { color: "text-secondary-normal", children: "No Results" }),
2718
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Paragraph, { color: "text-secondary-normal", children: "To view results, enter or update your search criteria." })
2719
+ ]
2720
+ }
2721
+ ),
2722
+ !hideStatusBar && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "p-2 pt-[7px] border-t border-border-primary-normal h-full min-h-[34px]", children: [
2723
+ pagination && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex justify-between items-center", children: [
2724
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-1 w-min", children: [
2725
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2726
+ Select,
2727
+ {
2728
+ wrapperClassName: "!w-20",
2729
+ value: pagination.pageSize.toString(),
2730
+ onChange: (e) => {
2731
+ var _a2;
2732
+ return (_a2 = pagination.onPageSizeChange) == null ? void 0 : _a2.call(pagination, Number(e.target.value));
2733
+ },
2734
+ renderMenu: (props) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Menu, __spreadProps(__spreadValues({}, props), { onClick: () => props.setShow(false), children: PAGE_SIZE_OPTIONS.map((option) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2735
+ MenuOption,
2736
+ {
2737
+ selected: pagination.pageSize === option,
2738
+ onClick: () => {
2739
+ var _a2;
2740
+ return (_a2 = pagination.onPageSizeChange) == null ? void 0 : _a2.call(pagination, option);
2741
+ },
2742
+ children: option
2743
+ },
2744
+ option
2745
+ )) }))
2746
+ }
2747
+ ),
2748
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Label, { className: "whitespace-nowrap", children: "Per Page" })
2749
+ ] }),
2750
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-2", children: [
2751
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2752
+ Button,
2753
+ {
2754
+ iconOnly: true,
2755
+ leftIcon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { name: "chevron_left" }),
2756
+ onClick: () => pagination.onPageChange(pagination.pageIndex - 1),
2757
+ variant: "tertiary",
2758
+ disabled: pagination.pageIndex === 0
2759
+ }
2760
+ ),
2761
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Paragraph, { children: [
2762
+ pagination.pageIndex * pagination.pageSize + 1,
2763
+ " -",
2764
+ " ",
2765
+ Math.min(
2766
+ (pagination.pageIndex + 1) * pagination.pageSize,
2767
+ pagination.total
2768
+ ),
2769
+ " ",
2770
+ "of ",
2771
+ pagination.total
2772
+ ] }),
2773
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2774
+ Button,
2775
+ {
2776
+ iconOnly: true,
2777
+ leftIcon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { name: "chevron_right" }),
2778
+ onClick: () => pagination.onPageChange(pagination.pageIndex + 1),
2779
+ variant: "tertiary",
2780
+ disabled: (pagination.pageIndex + 1) * pagination.pageSize >= pagination.total
2781
+ }
2782
+ )
2783
+ ] })
2784
+ ] }),
2785
+ status && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Paragraph, { children: status })
2786
+ ] })
2787
+ ] })
2788
+ }
2789
+ )
2790
+ }
2791
+ );
2792
+ }
2793
+ DataGrid.displayName = "DataGrid";
2794
+ function TableBody({
2795
+ columnVirtualizer,
2796
+ table,
2797
+ tableContainerRef,
2798
+ virtualPaddingLeft,
2799
+ virtualPaddingRight,
2800
+ pagination,
2801
+ isLoadingMore,
2802
+ hasMore,
2803
+ showFilterRow
2804
+ }) {
2805
+ const { rows } = table.getRowModel();
2806
+ const rowVirtualizer = (0, import_react_virtual.useVirtualizer)({
2807
+ count: rows.length,
2808
+ estimateSize: () => 40,
2809
+ getScrollElement: () => tableContainerRef.current,
2810
+ overscan: 8
2811
+ });
2812
+ const virtualRows = rowVirtualizer.getVirtualItems();
2813
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2814
+ "tbody",
2815
+ {
2816
+ style: {
2817
+ display: "grid",
2818
+ height: `${showFilterRow ? rowVirtualizer.getTotalSize() + 40 : rowVirtualizer.getTotalSize()}px`,
2819
+ // tells scrollbar how big the table is
2820
+ position: "relative"
2821
+ // needed for absolute positioning of rows
2822
+ },
2823
+ children: [
2824
+ showFilterRow && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2825
+ "tr",
2826
+ {
2827
+ style: {
2828
+ display: "flex",
2829
+ position: "sticky",
2830
+ top: "40px",
2831
+ width: "100%",
2832
+ height: "40px",
2833
+ zIndex: 10
2834
+ },
2835
+ className: "even:bg-background-grouped-primary-normal odd:bg-background-grouped-secondary-normal",
2836
+ children: table.getHeaderGroups().flatMap(
2837
+ (x) => x.headers.map((header) => {
2838
+ var _a, _b, _c, _d, _e;
2839
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2840
+ DragAlongCell,
2841
+ {
2842
+ noPadding: true,
2843
+ cell: header,
2844
+ width: (_a = header.column.columnDef.meta) == null ? void 0 : _a.headerWidth,
2845
+ children: header.column.getCanFilter() && ((_e = (_c = (_b = header.column.columnDef.meta) == null ? void 0 : _b.filterRowCell) == null ? void 0 : _c.call(_b, {
2846
+ header,
2847
+ table
2848
+ })) != null ? _e : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2849
+ Search,
2850
+ {
2851
+ removeRoundness: true,
2852
+ onChange: (e) => header.column.setFilterValue(e.target.value),
2853
+ value: (_d = header.column.getFilterValue()) != null ? _d : "",
2854
+ placeholder: "",
2855
+ removeSearchIcon: true
2856
+ }
2857
+ ))
2858
+ },
2859
+ header.id
2860
+ );
2861
+ })
2862
+ )
2863
+ }
2864
+ ),
2865
+ virtualRows.map((virtualRow) => {
2866
+ const row = rows[virtualRow.index];
2867
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2868
+ TableBodyRow,
2869
+ {
2870
+ columnVirtualizer,
2871
+ row,
2872
+ rowVirtualizer,
2873
+ virtualPaddingLeft,
2874
+ virtualPaddingRight,
2875
+ virtualRow,
2876
+ showFilterRow
2877
+ },
2878
+ row.id
2879
+ );
2880
+ }),
2881
+ !pagination && isLoadingMore && hasMore && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2882
+ "tr",
2883
+ {
2884
+ style: {
2885
+ display: "flex",
2886
+ position: "absolute",
2887
+ width: "100%",
2888
+ transform: `translateY(${virtualRows[virtualRows.length - 1].start + 40}px)`
2889
+ },
2890
+ className: "odd:bg-background-grouped-primary-normal even:bg-background-grouped-secondary-normal",
2891
+ children: table.getAllLeafColumns().map((column) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LoadingCell, { column: column.columnDef }, column.id))
2892
+ }
2893
+ )
2894
+ ]
2895
+ }
2896
+ );
2897
+ }
2898
+ function TableBodyRow({
2899
+ columnVirtualizer,
2900
+ row,
2901
+ // rowVirtualizer,
2902
+ virtualPaddingLeft,
2903
+ virtualPaddingRight,
2904
+ virtualRow,
2905
+ showFilterRow
2906
+ }) {
2907
+ const visibleCells = row.getVisibleCells();
2908
+ const virtualColumns = columnVirtualizer.getVirtualItems();
2909
+ const isError = typeof row.original === "object" && row.original !== null && "rowState" in row.original && row.original.rowState === "error";
2910
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2911
+ "tr",
2912
+ {
2913
+ className: (0, import_clsx14.default)(
2914
+ "transition-colors hover:bg-background-action-secondary-hover",
2915
+ row.getIsSelected() && "!bg-background-action-secondary-hover",
2916
+ isError && "!bg-background-action-critical-secondary-hover",
2917
+ showFilterRow ? "even:bg-background-grouped-primary-normal odd:bg-background-grouped-secondary-normal" : "odd:bg-background-grouped-primary-normal even:bg-background-grouped-secondary-normal"
2918
+ ),
2919
+ style: {
2920
+ display: "flex",
2921
+ position: "absolute",
2922
+ transform: `translateY(${showFilterRow ? virtualRow.start + 40 : virtualRow.start}px)`,
2923
+ width: "100%"
2924
+ },
2925
+ children: [
2926
+ virtualPaddingLeft ? (
2927
+ // fake empty column to the left for virtualization scroll padding
2928
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("td", { style: { display: "flex", width: virtualPaddingLeft } })
2929
+ ) : null,
2930
+ virtualColumns.map((virtualColumn) => {
2931
+ var _a;
2932
+ const cell = visibleCells[virtualColumn.index];
2933
+ return ((_a = cell.column.columnDef.meta) == null ? void 0 : _a.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react12.default.Fragment, { children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DragAlongCell, { cell, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2934
+ Tooltip,
2935
+ {
2936
+ showOnTruncation: true,
2937
+ message: cell.getValue(),
2938
+ position: "bottom",
2939
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Paragraph, { addOverflow: true, tall: true, children: cell.getValue() })
2940
+ }
2941
+ ) }, cell.id);
2942
+ }),
2943
+ virtualPaddingRight ? (
2944
+ // fake empty column to the right for virtualization scroll padding
2945
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("td", { style: { display: "flex", width: virtualPaddingRight } })
2946
+ ) : null
2947
+ ]
2948
+ },
2949
+ row.id
2950
+ );
2951
+ }
2952
+ var LoadingCell = ({
2953
+ column
2954
+ }) => {
2955
+ const key = `loading-${column.id}`;
2956
+ if (column.cell === "checkbox") {
2957
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DataGridCell, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Checkbox, { disabled: true }) }, key);
2958
+ }
2959
+ if (column.cell === "input") {
2960
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DataGridCell, { component: "input", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2961
+ Input,
2962
+ {
2963
+ align: "left",
2964
+ disabled: true,
2965
+ wrapperClassName: "!rounded-none !border-0"
2966
+ }
2967
+ ) }, key);
2968
+ }
2969
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DataGridCell, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "bg-linear-270 to-neutral-300/[24%] from-neutral-300/[12%] rounded-xs w-full max-w-25 h-6" }) }, key);
2970
+ };
2971
+ function getSortIcon(sort, nextSort = false) {
2972
+ const iconClassName = (0, import_clsx14.default)(
2973
+ "text-icon-on-action-primary-normal",
2974
+ nextSort && "hidden group-hover:block"
2975
+ );
2976
+ if (sort === "asc")
2977
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { size: 16, className: iconClassName, name: "arrow_upward" });
2978
+ if (sort === "desc")
2979
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { size: 16, className: iconClassName, name: "arrow_downward" });
2980
+ return null;
2981
+ }
2982
+ // Annotate the CommonJS export names for ESM import in node:
2983
+ 0 && (module.exports = {
2984
+ DataGrid
2985
+ });