@mdigital_ui/ui 0.4.2 → 0.4.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 (591) hide show
  1. package/README.md +45 -5
  2. package/dist/accordion/index.d.ts.map +1 -1
  3. package/dist/accordion/index.js +3 -3
  4. package/dist/accordion/types.d.ts +2 -42
  5. package/dist/accordion/types.d.ts.map +1 -1
  6. package/dist/alert/index.d.ts +6 -0
  7. package/dist/alert/index.d.ts.map +1 -0
  8. package/dist/alert/index.js +5 -0
  9. package/dist/alert/types.d.ts +24 -0
  10. package/dist/alert/types.d.ts.map +1 -0
  11. package/dist/anchor/index.d.ts +6 -0
  12. package/dist/anchor/index.d.ts.map +1 -0
  13. package/dist/anchor/types.d.ts +26 -0
  14. package/dist/anchor/types.d.ts.map +1 -0
  15. package/dist/autocomplete/index.d.ts +6 -0
  16. package/dist/autocomplete/index.d.ts.map +1 -0
  17. package/dist/autocomplete/types.d.ts +39 -0
  18. package/dist/autocomplete/types.d.ts.map +1 -0
  19. package/dist/avatar/index.d.ts +0 -6
  20. package/dist/avatar/index.d.ts.map +1 -1
  21. package/dist/avatar/index.js +3 -2
  22. package/dist/avatar/types.d.ts +0 -48
  23. package/dist/avatar/types.d.ts.map +1 -1
  24. package/dist/badge/index.d.ts +1 -23
  25. package/dist/badge/index.d.ts.map +1 -1
  26. package/dist/badge/index.js +3 -3
  27. package/dist/badge/types.d.ts +1 -20
  28. package/dist/badge/types.d.ts.map +1 -1
  29. package/dist/breadcrumbs/index.d.ts.map +1 -1
  30. package/dist/breadcrumbs/index.js +7 -6
  31. package/dist/breadcrumbs/types.d.ts +3 -38
  32. package/dist/breadcrumbs/types.d.ts.map +1 -1
  33. package/dist/button/index.d.ts +1 -1
  34. package/dist/button/index.d.ts.map +1 -1
  35. package/dist/button/index.js +5 -5
  36. package/dist/button/types.d.ts +2 -8
  37. package/dist/button/types.d.ts.map +1 -1
  38. package/dist/button-group/index.d.ts +0 -28
  39. package/dist/button-group/index.d.ts.map +1 -1
  40. package/dist/button-group/index.js +2 -2
  41. package/dist/button-group/types.d.ts +0 -19
  42. package/dist/button-group/types.d.ts.map +1 -1
  43. package/dist/calendar/index.d.ts +6 -0
  44. package/dist/calendar/index.d.ts.map +1 -0
  45. package/dist/calendar/types.d.ts +29 -0
  46. package/dist/calendar/types.d.ts.map +1 -0
  47. package/dist/card/index.d.ts +1 -41
  48. package/dist/card/index.d.ts.map +1 -1
  49. package/dist/card/index.js +3 -3
  50. package/dist/card/types.d.ts +3 -29
  51. package/dist/card/types.d.ts.map +1 -1
  52. package/dist/carousel/carousel-navigation.d.ts.map +1 -1
  53. package/dist/carousel/index.d.ts +5 -2
  54. package/dist/carousel/index.d.ts.map +1 -1
  55. package/dist/carousel/index.js +2 -2
  56. package/dist/carousel/styles.d.ts +12 -0
  57. package/dist/carousel/styles.d.ts.map +1 -0
  58. package/dist/cascader/CascaderMenu.d.ts +41 -0
  59. package/dist/cascader/CascaderMenu.d.ts.map +1 -0
  60. package/dist/cascader/index.d.ts +0 -21
  61. package/dist/cascader/index.d.ts.map +1 -1
  62. package/dist/cascader/index.js +3 -3
  63. package/dist/cascader/types.d.ts +3 -89
  64. package/dist/cascader/types.d.ts.map +1 -1
  65. package/dist/checkbox/index.d.ts.map +1 -1
  66. package/dist/checkbox/index.js +3 -3
  67. package/dist/checkbox/types.d.ts +2 -2
  68. package/dist/checkbox/types.d.ts.map +1 -1
  69. package/dist/checkbox-group/index.d.ts.map +1 -1
  70. package/dist/checkbox-group/index.js +2 -2
  71. package/dist/checkbox-group/types.d.ts +0 -24
  72. package/dist/checkbox-group/types.d.ts.map +1 -1
  73. package/dist/{chunk-HCOTO5WX.js → chunk-253JZOYG.js} +8 -9
  74. package/dist/chunk-253JZOYG.js.map +1 -0
  75. package/dist/{chunk-FZSCLZF6.js → chunk-3D77IPKB.js} +68 -113
  76. package/dist/chunk-3D77IPKB.js.map +1 -0
  77. package/dist/{chunk-GJPZOMFE.js → chunk-3XOHSE3X.js} +71 -34
  78. package/dist/chunk-3XOHSE3X.js.map +1 -0
  79. package/dist/{chunk-ROA7BYGB.js → chunk-3YP7HY3Y.js} +7 -5
  80. package/dist/chunk-3YP7HY3Y.js.map +1 -0
  81. package/dist/chunk-4HKPDSA6.js +378 -0
  82. package/dist/chunk-4HKPDSA6.js.map +1 -0
  83. package/dist/{chunk-OFUPJH35.js → chunk-4TEZWGX7.js} +3 -3
  84. package/dist/{chunk-OFUPJH35.js.map → chunk-4TEZWGX7.js.map} +1 -1
  85. package/dist/{chunk-TLNHWOQQ.js → chunk-4ZXHLPRS.js} +53 -44
  86. package/dist/chunk-4ZXHLPRS.js.map +1 -0
  87. package/dist/{chunk-6LYRMQOI.js → chunk-5MBKTMDW.js} +21 -16
  88. package/dist/chunk-5MBKTMDW.js.map +1 -0
  89. package/dist/{chunk-CN74CNAN.js → chunk-5SEVPU6C.js} +8 -22
  90. package/dist/chunk-5SEVPU6C.js.map +1 -0
  91. package/dist/{chunk-6JGNJI5T.js → chunk-7RT65ZGV.js} +38 -26
  92. package/dist/chunk-7RT65ZGV.js.map +1 -0
  93. package/dist/{chunk-I32ZQUYY.js → chunk-A4MYCEGM.js} +15 -16
  94. package/dist/chunk-A4MYCEGM.js.map +1 -0
  95. package/dist/{chunk-KJTMZJ7V.js → chunk-ADZWWBAX.js} +76 -110
  96. package/dist/chunk-ADZWWBAX.js.map +1 -0
  97. package/dist/{chunk-YXLIGJTN.js → chunk-AFW2ORFT.js} +16 -8
  98. package/dist/chunk-AFW2ORFT.js.map +1 -0
  99. package/dist/{chunk-OLTQAMV2.js → chunk-BGMYX7L5.js} +9 -24
  100. package/dist/chunk-BGMYX7L5.js.map +1 -0
  101. package/dist/chunk-BKLJDEUX.js +857 -0
  102. package/dist/chunk-BKLJDEUX.js.map +1 -0
  103. package/dist/{chunk-4FFVNUTK.js → chunk-BNHRUHI4.js} +7 -6
  104. package/dist/chunk-BNHRUHI4.js.map +1 -0
  105. package/dist/{chunk-DUIL5BYS.js → chunk-BS4PZPY6.js} +82 -53
  106. package/dist/chunk-BS4PZPY6.js.map +1 -0
  107. package/dist/{chunk-POLVJ36Y.js → chunk-C32HL4XU.js} +13 -38
  108. package/dist/chunk-C32HL4XU.js.map +1 -0
  109. package/dist/chunk-C65SCJD6.js +138 -0
  110. package/dist/chunk-C65SCJD6.js.map +1 -0
  111. package/dist/{chunk-3BZE6BBJ.js → chunk-CUXQZRDI.js} +45 -34
  112. package/dist/chunk-CUXQZRDI.js.map +1 -0
  113. package/dist/{chunk-674JC24S.js → chunk-DDZCRCTQ.js} +28 -29
  114. package/dist/chunk-DDZCRCTQ.js.map +1 -0
  115. package/dist/{chunk-64NHVOZS.js → chunk-FU5Q4WVX.js} +26 -16
  116. package/dist/chunk-FU5Q4WVX.js.map +1 -0
  117. package/dist/chunk-G6QIIWKU.js +24 -0
  118. package/dist/chunk-G6QIIWKU.js.map +1 -0
  119. package/dist/{chunk-UTWQ2FZK.js → chunk-GOBUFGGJ.js} +45 -108
  120. package/dist/chunk-GOBUFGGJ.js.map +1 -0
  121. package/dist/{chunk-WRSG7WU5.js → chunk-HJITFPBT.js} +78 -94
  122. package/dist/chunk-HJITFPBT.js.map +1 -0
  123. package/dist/{chunk-ZJNGZCRB.js → chunk-HR5TGNOF.js} +54 -153
  124. package/dist/chunk-HR5TGNOF.js.map +1 -0
  125. package/dist/{chunk-HECAAILV.js → chunk-HRVOTFU4.js} +24 -16
  126. package/dist/chunk-HRVOTFU4.js.map +1 -0
  127. package/dist/{chunk-LX4FDH4J.js → chunk-HSMO2BR4.js} +13 -22
  128. package/dist/chunk-HSMO2BR4.js.map +1 -0
  129. package/dist/chunk-HVHQA34X.js +534 -0
  130. package/dist/chunk-HVHQA34X.js.map +1 -0
  131. package/dist/{chunk-6G3BMY4N.js → chunk-I5AD247M.js} +80 -85
  132. package/dist/chunk-I5AD247M.js.map +1 -0
  133. package/dist/chunk-I7HJBHQU.js +99 -0
  134. package/dist/chunk-I7HJBHQU.js.map +1 -0
  135. package/dist/{chunk-3PWILVOE.js → chunk-J2WIZULN.js} +50 -50
  136. package/dist/chunk-J2WIZULN.js.map +1 -0
  137. package/dist/{chunk-VOODO2ZE.js → chunk-JFTSWOGE.js} +12 -32
  138. package/dist/chunk-JFTSWOGE.js.map +1 -0
  139. package/dist/{chunk-LOYLJRCF.js → chunk-JIXINKUJ.js} +8 -17
  140. package/dist/chunk-JIXINKUJ.js.map +1 -0
  141. package/dist/{chunk-6HGUDHHE.js → chunk-L5BU2QTI.js} +3 -5
  142. package/dist/chunk-L5BU2QTI.js.map +1 -0
  143. package/dist/chunk-LJOQ2C5W.js +81 -0
  144. package/dist/chunk-LJOQ2C5W.js.map +1 -0
  145. package/dist/chunk-LWYZCSX4.js +531 -0
  146. package/dist/chunk-LWYZCSX4.js.map +1 -0
  147. package/dist/{chunk-3BIV3QE2.js → chunk-LXHFGQOI.js} +61 -29
  148. package/dist/chunk-LXHFGQOI.js.map +1 -0
  149. package/dist/{chunk-ZIYA7TGX.js → chunk-NMP4HY6M.js} +13 -23
  150. package/dist/chunk-NMP4HY6M.js.map +1 -0
  151. package/dist/{chunk-2TLOWZE4.js → chunk-NTCAZ2LF.js} +64 -183
  152. package/dist/chunk-NTCAZ2LF.js.map +1 -0
  153. package/dist/chunk-NZHKNUGE.js +96 -0
  154. package/dist/chunk-NZHKNUGE.js.map +1 -0
  155. package/dist/{chunk-764UKE6X.js → chunk-OGB5QPNZ.js} +11 -92
  156. package/dist/chunk-OGB5QPNZ.js.map +1 -0
  157. package/dist/chunk-OJAHIPPP.js +198 -0
  158. package/dist/chunk-OJAHIPPP.js.map +1 -0
  159. package/dist/{chunk-2PNLIQYM.js → chunk-ON76IMMI.js} +3 -3
  160. package/dist/chunk-ON76IMMI.js.map +1 -0
  161. package/dist/{chunk-HUXODBIO.js → chunk-PB5VGXS5.js} +42 -101
  162. package/dist/chunk-PB5VGXS5.js.map +1 -0
  163. package/dist/chunk-PQOIW5CM.js +27 -0
  164. package/dist/chunk-PQOIW5CM.js.map +1 -0
  165. package/dist/{chunk-BVO2BNFG.js → chunk-PRDJLQLB.js} +23 -103
  166. package/dist/chunk-PRDJLQLB.js.map +1 -0
  167. package/dist/{chunk-N2WHJ3FI.js → chunk-QEAALOJC.js} +14 -16
  168. package/dist/chunk-QEAALOJC.js.map +1 -0
  169. package/dist/{chunk-NGYLRX6F.js → chunk-RAS6HUEI.js} +2 -2
  170. package/dist/chunk-RAS6HUEI.js.map +1 -0
  171. package/dist/{chunk-C5IGZLIT.js → chunk-ROQGBDET.js} +9 -23
  172. package/dist/chunk-ROQGBDET.js.map +1 -0
  173. package/dist/{chunk-Y4XAXZHB.js → chunk-RRPMZYVN.js} +9 -8
  174. package/dist/chunk-RRPMZYVN.js.map +1 -0
  175. package/dist/{chunk-D4SUSZDN.js → chunk-S6HO7HUY.js} +19 -17
  176. package/dist/chunk-S6HO7HUY.js.map +1 -0
  177. package/dist/{chunk-YS5AIY4A.js → chunk-SFP77VS3.js} +6 -5
  178. package/dist/chunk-SFP77VS3.js.map +1 -0
  179. package/dist/{chunk-RFHTC6AH.js → chunk-SJLH5ZDW.js} +16 -38
  180. package/dist/chunk-SJLH5ZDW.js.map +1 -0
  181. package/dist/{chunk-SGRACNBP.js → chunk-STAYOHDI.js} +13 -5
  182. package/dist/chunk-STAYOHDI.js.map +1 -0
  183. package/dist/{chunk-ON2CMF6J.js → chunk-TBKPQOXF.js} +58 -35
  184. package/dist/chunk-TBKPQOXF.js.map +1 -0
  185. package/dist/{chunk-GOLARX5K.js → chunk-TDNPACQD.js} +14 -11
  186. package/dist/chunk-TDNPACQD.js.map +1 -0
  187. package/dist/{chunk-7UCNBMCV.js → chunk-TQEMGWZ2.js} +27 -34
  188. package/dist/chunk-TQEMGWZ2.js.map +1 -0
  189. package/dist/{chunk-X3YNHX77.js → chunk-U4JPTWK6.js} +33 -34
  190. package/dist/chunk-U4JPTWK6.js.map +1 -0
  191. package/dist/{chunk-R3TLU26W.js → chunk-UFC3RGIN.js} +9 -7
  192. package/dist/chunk-UFC3RGIN.js.map +1 -0
  193. package/dist/{chunk-KH577UDI.js → chunk-W5VLFE4U.js} +11 -8
  194. package/dist/chunk-W5VLFE4U.js.map +1 -0
  195. package/dist/{chunk-G6NVGBYZ.js → chunk-WG5AYAC6.js} +27 -35
  196. package/dist/chunk-WG5AYAC6.js.map +1 -0
  197. package/dist/{chunk-YJOLLSHH.js → chunk-WQT24BGG.js} +44 -49
  198. package/dist/chunk-WQT24BGG.js.map +1 -0
  199. package/dist/{chunk-JWTWPZ32.js → chunk-X7MF3TIF.js} +15 -19
  200. package/dist/chunk-X7MF3TIF.js.map +1 -0
  201. package/dist/chunk-XAM5EKOS.js +150 -0
  202. package/dist/chunk-XAM5EKOS.js.map +1 -0
  203. package/dist/{chunk-EHWXPH76.js → chunk-XBXPY7U3.js} +9 -7
  204. package/dist/chunk-XBXPY7U3.js.map +1 -0
  205. package/dist/{chunk-5PUATOLR.js → chunk-XCK62GVU.js} +4 -4
  206. package/dist/chunk-XCK62GVU.js.map +1 -0
  207. package/dist/{chunk-ONGJXAYQ.js → chunk-XMBZBXXS.js} +9 -16
  208. package/dist/chunk-XMBZBXXS.js.map +1 -0
  209. package/dist/{chunk-H6G4BUPA.js → chunk-XOEEAMMY.js} +210 -183
  210. package/dist/chunk-XOEEAMMY.js.map +1 -0
  211. package/dist/{chunk-O3V3BTIJ.js → chunk-Z3DIBMBQ.js} +60 -107
  212. package/dist/chunk-Z3DIBMBQ.js.map +1 -0
  213. package/dist/clipboard/index.d.ts.map +1 -1
  214. package/dist/clipboard/index.js +4 -4
  215. package/dist/clipboard/types.d.ts +2 -35
  216. package/dist/clipboard/types.d.ts.map +1 -1
  217. package/dist/collapse/index.d.ts.map +1 -1
  218. package/dist/collapse/index.js +4 -3
  219. package/dist/collapse/types.d.ts +2 -35
  220. package/dist/collapse/types.d.ts.map +1 -1
  221. package/dist/color-picker/index.d.ts +8 -0
  222. package/dist/color-picker/index.d.ts.map +1 -0
  223. package/dist/color-picker/types.d.ts +42 -0
  224. package/dist/color-picker/types.d.ts.map +1 -0
  225. package/dist/command/index.d.ts +39 -66
  226. package/dist/command/index.d.ts.map +1 -1
  227. package/dist/command/index.js +4 -3
  228. package/dist/command/types.d.ts +2 -2
  229. package/dist/command/types.d.ts.map +1 -1
  230. package/dist/context-menu/index.d.ts +2 -46
  231. package/dist/context-menu/index.d.ts.map +1 -1
  232. package/dist/context-menu/index.js +5 -3
  233. package/dist/context-menu/types.d.ts +21 -63
  234. package/dist/context-menu/types.d.ts.map +1 -1
  235. package/dist/date-picker/CalendarHeader.d.ts +18 -0
  236. package/dist/date-picker/CalendarHeader.d.ts.map +1 -0
  237. package/dist/date-picker/MonthSelector.d.ts +11 -0
  238. package/dist/date-picker/MonthSelector.d.ts.map +1 -0
  239. package/dist/date-picker/PickerWrapper.d.ts +18 -0
  240. package/dist/date-picker/PickerWrapper.d.ts.map +1 -0
  241. package/dist/date-picker/RangePicker.d.ts +4 -0
  242. package/dist/date-picker/RangePicker.d.ts.map +1 -0
  243. package/dist/date-picker/TimePicker.d.ts +4 -0
  244. package/dist/date-picker/TimePicker.d.ts.map +1 -0
  245. package/dist/date-picker/YearSelector.d.ts +10 -0
  246. package/dist/date-picker/YearSelector.d.ts.map +1 -0
  247. package/dist/date-picker/index.d.ts +6 -6
  248. package/dist/date-picker/index.d.ts.map +1 -1
  249. package/dist/date-picker/index.js +4 -4
  250. package/dist/date-picker/shared.d.ts +3 -0
  251. package/dist/date-picker/shared.d.ts.map +1 -0
  252. package/dist/date-picker/types.d.ts +2 -2
  253. package/dist/date-picker/types.d.ts.map +1 -1
  254. package/dist/date-picker/utils.d.ts +1 -1
  255. package/dist/date-picker/utils.d.ts.map +1 -1
  256. package/dist/descriptions/index.d.ts.map +1 -1
  257. package/dist/descriptions/index.js +3 -2
  258. package/dist/divider/index.d.ts.map +1 -1
  259. package/dist/divider/index.js +3 -2
  260. package/dist/divider/types.d.ts +0 -12
  261. package/dist/divider/types.d.ts.map +1 -1
  262. package/dist/drawer/index.d.ts +4 -1
  263. package/dist/drawer/index.d.ts.map +1 -1
  264. package/dist/drawer/index.js +2 -2
  265. package/dist/drawer/types.d.ts +2 -145
  266. package/dist/drawer/types.d.ts.map +1 -1
  267. package/dist/dropdown/index.d.ts.map +1 -1
  268. package/dist/dropdown/index.js +6 -5
  269. package/dist/dropdown/types.d.ts +2 -71
  270. package/dist/dropdown/types.d.ts.map +1 -1
  271. package/dist/fetching-overlay/index.d.ts.map +1 -1
  272. package/dist/fetching-overlay/index.js +4 -4
  273. package/dist/float-button/index.d.ts +9 -0
  274. package/dist/float-button/index.d.ts.map +1 -0
  275. package/dist/float-button/types.d.ts +45 -0
  276. package/dist/float-button/types.d.ts.map +1 -0
  277. package/dist/float-input/index.d.ts.map +1 -1
  278. package/dist/float-input/index.js +4 -4
  279. package/dist/float-input/types.d.ts +5 -10
  280. package/dist/float-input/types.d.ts.map +1 -1
  281. package/dist/grid/index.d.ts +1 -1
  282. package/dist/grid/index.d.ts.map +1 -1
  283. package/dist/grid/index.js +2 -2
  284. package/dist/grid/types.d.ts +1 -9
  285. package/dist/grid/types.d.ts.map +1 -1
  286. package/dist/hooks/index.d.ts +1 -0
  287. package/dist/hooks/index.d.ts.map +1 -1
  288. package/dist/hooks/useMenuNavigation.d.ts +18 -0
  289. package/dist/hooks/useMenuNavigation.d.ts.map +1 -0
  290. package/dist/image/index.d.ts.map +1 -1
  291. package/dist/image/index.js +2 -2
  292. package/dist/image/types.d.ts +2 -34
  293. package/dist/image/types.d.ts.map +1 -1
  294. package/dist/index.d.ts +30 -3
  295. package/dist/index.d.ts.map +1 -1
  296. package/dist/index.js +3030 -90
  297. package/dist/index.js.map +1 -1
  298. package/dist/input/index.d.ts.map +1 -1
  299. package/dist/input/index.js +4 -4
  300. package/dist/input/types.d.ts +9 -4
  301. package/dist/input/types.d.ts.map +1 -1
  302. package/dist/input-group/index.d.ts.map +1 -1
  303. package/dist/input-group/index.js +2 -2
  304. package/dist/input-group/types.d.ts +7 -19
  305. package/dist/input-group/types.d.ts.map +1 -1
  306. package/dist/input-otp/index.d.ts.map +1 -1
  307. package/dist/input-otp/index.js +2 -2
  308. package/dist/input-otp/types.d.ts +3 -81
  309. package/dist/input-otp/types.d.ts.map +1 -1
  310. package/dist/input-password/index.d.ts.map +1 -1
  311. package/dist/input-password/index.js +5 -5
  312. package/dist/input-password/types.d.ts +0 -6
  313. package/dist/input-password/types.d.ts.map +1 -1
  314. package/dist/kbd/index.d.ts.map +1 -1
  315. package/dist/kbd/index.js +3 -3
  316. package/dist/kbd/types.d.ts +2 -17
  317. package/dist/kbd/types.d.ts.map +1 -1
  318. package/dist/link/index.d.ts +1 -1
  319. package/dist/link/index.d.ts.map +1 -1
  320. package/dist/link/index.js +3 -2
  321. package/dist/mentions/index.d.ts +6 -0
  322. package/dist/mentions/index.d.ts.map +1 -0
  323. package/dist/mentions/types.d.ts +36 -0
  324. package/dist/mentions/types.d.ts.map +1 -0
  325. package/dist/menubar/index.d.ts.map +1 -1
  326. package/dist/menubar/index.js +5 -4
  327. package/dist/modal/index.d.ts +1 -1
  328. package/dist/modal/index.d.ts.map +1 -1
  329. package/dist/modal/index.js +2 -2
  330. package/dist/modal/types.d.ts +7 -41
  331. package/dist/modal/types.d.ts.map +1 -1
  332. package/dist/multi-select/index.d.ts.map +1 -1
  333. package/dist/multi-select/index.js +8 -6
  334. package/dist/multi-select/types.d.ts +2 -34
  335. package/dist/multi-select/types.d.ts.map +1 -1
  336. package/dist/navigation-menu/index.d.ts.map +1 -1
  337. package/dist/navigation-menu/index.js +2 -2
  338. package/dist/navigation-menu/types.d.ts +2 -0
  339. package/dist/navigation-menu/types.d.ts.map +1 -1
  340. package/dist/notification/index.d.ts.map +1 -1
  341. package/dist/notification/index.js +3 -3
  342. package/dist/notification/types.d.ts +2 -62
  343. package/dist/notification/types.d.ts.map +1 -1
  344. package/dist/number-input/index.d.ts.map +1 -1
  345. package/dist/number-input/index.js +6 -5
  346. package/dist/number-input/types.d.ts +5 -2
  347. package/dist/number-input/types.d.ts.map +1 -1
  348. package/dist/pagination/index.d.ts.map +1 -1
  349. package/dist/pagination/index.js +4 -3
  350. package/dist/pagination/types.d.ts +3 -53
  351. package/dist/pagination/types.d.ts.map +1 -1
  352. package/dist/popover/index.d.ts +1 -1
  353. package/dist/popover/index.d.ts.map +1 -1
  354. package/dist/popover/index.js +3 -3
  355. package/dist/popover/types.d.ts +3 -17
  356. package/dist/popover/types.d.ts.map +1 -1
  357. package/dist/progress/index.d.ts.map +1 -1
  358. package/dist/progress/index.js +3 -2
  359. package/dist/progress/styles.d.ts +4 -5
  360. package/dist/progress/styles.d.ts.map +1 -1
  361. package/dist/progress/types.d.ts +2 -44
  362. package/dist/progress/types.d.ts.map +1 -1
  363. package/dist/qr-code/index.d.ts +6 -0
  364. package/dist/qr-code/index.d.ts.map +1 -0
  365. package/dist/qr-code/types.d.ts +49 -0
  366. package/dist/qr-code/types.d.ts.map +1 -0
  367. package/dist/radio/index.d.ts.map +1 -1
  368. package/dist/radio/index.js +3 -3
  369. package/dist/radio/types.d.ts +2 -2
  370. package/dist/radio/types.d.ts.map +1 -1
  371. package/dist/radio-group/index.d.ts.map +1 -1
  372. package/dist/radio-group/index.js +2 -2
  373. package/dist/radio-group/types.d.ts +0 -24
  374. package/dist/radio-group/types.d.ts.map +1 -1
  375. package/dist/rating/index.d.ts.map +1 -1
  376. package/dist/rating/index.js +3 -2
  377. package/dist/rating/types.d.ts +2 -2
  378. package/dist/rating/types.d.ts.map +1 -1
  379. package/dist/resizable/index.d.ts +7 -0
  380. package/dist/resizable/index.d.ts.map +1 -0
  381. package/dist/resizable/types.d.ts +8 -0
  382. package/dist/resizable/types.d.ts.map +1 -0
  383. package/dist/result/index.d.ts +6 -0
  384. package/dist/result/index.d.ts.map +1 -0
  385. package/dist/result/types.d.ts +22 -0
  386. package/dist/result/types.d.ts.map +1 -0
  387. package/dist/scroll-area/index.d.ts.map +1 -1
  388. package/dist/scroll-area/index.js +2 -2
  389. package/dist/select/index.d.ts.map +1 -1
  390. package/dist/select/index.js +8 -6
  391. package/dist/select/types.d.ts +8 -3
  392. package/dist/select/types.d.ts.map +1 -1
  393. package/dist/shared/useSelectBase.d.ts +4 -2
  394. package/dist/shared/useSelectBase.d.ts.map +1 -1
  395. package/dist/skeleton/index.d.ts.map +1 -1
  396. package/dist/skeleton/index.js +3 -3
  397. package/dist/skeleton/types.d.ts +1 -1
  398. package/dist/skeleton/types.d.ts.map +1 -1
  399. package/dist/slider/index.d.ts.map +1 -1
  400. package/dist/slider/index.js +3 -2
  401. package/dist/slider/types.d.ts +2 -36
  402. package/dist/slider/types.d.ts.map +1 -1
  403. package/dist/spinner/index.d.ts +2 -1
  404. package/dist/spinner/index.d.ts.map +1 -1
  405. package/dist/spinner/index.js +3 -3
  406. package/dist/spinner/types.d.ts +1 -1
  407. package/dist/spinner/types.d.ts.map +1 -1
  408. package/dist/stepper/index.d.ts +3 -3
  409. package/dist/stepper/index.d.ts.map +1 -1
  410. package/dist/stepper/index.js +3 -2
  411. package/dist/stepper/types.d.ts +3 -2
  412. package/dist/stepper/types.d.ts.map +1 -1
  413. package/dist/switch/index.d.ts.map +1 -1
  414. package/dist/switch/index.js +3 -3
  415. package/dist/switch/types.d.ts +2 -31
  416. package/dist/switch/types.d.ts.map +1 -1
  417. package/dist/table/TableHeaderCell.d.ts.map +1 -1
  418. package/dist/table/index.d.ts +1 -1
  419. package/dist/table/index.d.ts.map +1 -1
  420. package/dist/table/index.js +11 -11
  421. package/dist/table/types.d.ts +8 -2
  422. package/dist/table/types.d.ts.map +1 -1
  423. package/dist/tabs/index.d.ts.map +1 -1
  424. package/dist/tabs/index.js +3 -3
  425. package/dist/tabs/types.d.ts +3 -53
  426. package/dist/tabs/types.d.ts.map +1 -1
  427. package/dist/tag/index.d.ts +1 -1
  428. package/dist/tag/index.d.ts.map +1 -1
  429. package/dist/tag/index.js +3 -3
  430. package/dist/tag/types.d.ts +1 -1
  431. package/dist/tag/types.d.ts.map +1 -1
  432. package/dist/tags-input/index.d.ts +6 -0
  433. package/dist/tags-input/index.d.ts.map +1 -0
  434. package/dist/tags-input/types.d.ts +36 -0
  435. package/dist/tags-input/types.d.ts.map +1 -0
  436. package/dist/textarea/index.d.ts.map +1 -1
  437. package/dist/textarea/index.js +2 -2
  438. package/dist/textarea/types.d.ts +3 -54
  439. package/dist/textarea/types.d.ts.map +1 -1
  440. package/dist/theme/ThemeProvider.d.ts +11 -3
  441. package/dist/theme/ThemeProvider.d.ts.map +1 -1
  442. package/dist/theme/index.js +1 -1
  443. package/dist/theme/types.d.ts +0 -12
  444. package/dist/theme/types.d.ts.map +1 -1
  445. package/dist/timeline/index.d.ts.map +1 -1
  446. package/dist/timeline/index.js +3 -2
  447. package/dist/toast/index.d.ts.map +1 -1
  448. package/dist/toast/index.js +3 -3
  449. package/dist/toast/types.d.ts +0 -6
  450. package/dist/toast/types.d.ts.map +1 -1
  451. package/dist/toggle/index.d.ts.map +1 -1
  452. package/dist/toggle/index.js +4 -3
  453. package/dist/toggle/types.d.ts +3 -26
  454. package/dist/toggle/types.d.ts.map +1 -1
  455. package/dist/toggle-group/index.d.ts.map +1 -1
  456. package/dist/toggle-group/index.js +4 -3
  457. package/dist/toggle-group/types.d.ts +3 -44
  458. package/dist/toggle-group/types.d.ts.map +1 -1
  459. package/dist/tooltip/index.d.ts.map +1 -1
  460. package/dist/tooltip/index.js +3 -3
  461. package/dist/tooltip/types.d.ts +2 -44
  462. package/dist/tooltip/types.d.ts.map +1 -1
  463. package/dist/tour/index.d.ts +6 -0
  464. package/dist/tour/index.d.ts.map +1 -0
  465. package/dist/tour/types.d.ts +45 -0
  466. package/dist/tour/types.d.ts.map +1 -0
  467. package/dist/transfer/index.d.ts.map +1 -1
  468. package/dist/transfer/index.js +4 -4
  469. package/dist/transfer/types.d.ts +0 -20
  470. package/dist/transfer/types.d.ts.map +1 -1
  471. package/dist/transfer/utils.d.ts.map +1 -1
  472. package/dist/tree/index.d.ts.map +1 -1
  473. package/dist/tree/index.js +2 -2
  474. package/dist/tree/types.d.ts +2 -73
  475. package/dist/tree/types.d.ts.map +1 -1
  476. package/dist/tree-select/index.d.ts.map +1 -1
  477. package/dist/tree-select/index.js +5 -5
  478. package/dist/tree-select/types.d.ts +3 -91
  479. package/dist/tree-select/types.d.ts.map +1 -1
  480. package/dist/types.d.ts +1 -35
  481. package/dist/types.d.ts.map +1 -1
  482. package/dist/typography/index.d.ts +8 -0
  483. package/dist/typography/index.d.ts.map +1 -0
  484. package/dist/typography/types.d.ts +33 -0
  485. package/dist/typography/types.d.ts.map +1 -0
  486. package/dist/upload/index.d.ts.map +1 -1
  487. package/dist/upload/index.js +4 -3
  488. package/dist/upload/types.d.ts +5 -32
  489. package/dist/upload/types.d.ts.map +1 -1
  490. package/dist/upload/utils.d.ts +2 -1
  491. package/dist/upload/utils.d.ts.map +1 -1
  492. package/dist/utils.d.ts +0 -39
  493. package/dist/utils.d.ts.map +1 -1
  494. package/dist/variants.d.ts +3 -314
  495. package/dist/variants.d.ts.map +1 -1
  496. package/dist/watermark/index.d.ts +6 -0
  497. package/dist/watermark/index.d.ts.map +1 -0
  498. package/dist/watermark/types.d.ts +24 -0
  499. package/dist/watermark/types.d.ts.map +1 -0
  500. package/package.json +5 -2
  501. package/styles/global.css +575 -2012
  502. package/styles/themes/dark.css +15 -5
  503. package/styles/themes/light.css +20 -2
  504. package/styles/themes/presets/corporate.css +2 -0
  505. package/styles/themes/presets/minimal.css +2 -0
  506. package/styles/themes/presets/vibrant.css +2 -0
  507. package/dist/chunk-2PNLIQYM.js.map +0 -1
  508. package/dist/chunk-2TLOWZE4.js.map +0 -1
  509. package/dist/chunk-2WZVD7P3.js +0 -145
  510. package/dist/chunk-2WZVD7P3.js.map +0 -1
  511. package/dist/chunk-3BIV3QE2.js.map +0 -1
  512. package/dist/chunk-3BZE6BBJ.js.map +0 -1
  513. package/dist/chunk-3PWILVOE.js.map +0 -1
  514. package/dist/chunk-4FFVNUTK.js.map +0 -1
  515. package/dist/chunk-5PUATOLR.js.map +0 -1
  516. package/dist/chunk-64NHVOZS.js.map +0 -1
  517. package/dist/chunk-674JC24S.js.map +0 -1
  518. package/dist/chunk-6BAP6QUT.js +0 -72
  519. package/dist/chunk-6BAP6QUT.js.map +0 -1
  520. package/dist/chunk-6G3BMY4N.js.map +0 -1
  521. package/dist/chunk-6HGUDHHE.js.map +0 -1
  522. package/dist/chunk-6JGNJI5T.js.map +0 -1
  523. package/dist/chunk-6LYRMQOI.js.map +0 -1
  524. package/dist/chunk-6YOOKE6C.js +0 -138
  525. package/dist/chunk-6YOOKE6C.js.map +0 -1
  526. package/dist/chunk-764UKE6X.js.map +0 -1
  527. package/dist/chunk-7UCNBMCV.js.map +0 -1
  528. package/dist/chunk-BPRCBPVJ.js +0 -253
  529. package/dist/chunk-BPRCBPVJ.js.map +0 -1
  530. package/dist/chunk-BVO2BNFG.js.map +0 -1
  531. package/dist/chunk-C5IGZLIT.js.map +0 -1
  532. package/dist/chunk-CN74CNAN.js.map +0 -1
  533. package/dist/chunk-D4SUSZDN.js.map +0 -1
  534. package/dist/chunk-DUIL5BYS.js.map +0 -1
  535. package/dist/chunk-EHWXPH76.js.map +0 -1
  536. package/dist/chunk-ERRZ2CSG.js +0 -192
  537. package/dist/chunk-ERRZ2CSG.js.map +0 -1
  538. package/dist/chunk-EZGK67T6.js +0 -383
  539. package/dist/chunk-EZGK67T6.js.map +0 -1
  540. package/dist/chunk-FZSCLZF6.js.map +0 -1
  541. package/dist/chunk-G6NVGBYZ.js.map +0 -1
  542. package/dist/chunk-GJPZOMFE.js.map +0 -1
  543. package/dist/chunk-GOLARX5K.js.map +0 -1
  544. package/dist/chunk-GVVP5TZM.js +0 -506
  545. package/dist/chunk-GVVP5TZM.js.map +0 -1
  546. package/dist/chunk-H6G4BUPA.js.map +0 -1
  547. package/dist/chunk-HCOTO5WX.js.map +0 -1
  548. package/dist/chunk-HECAAILV.js.map +0 -1
  549. package/dist/chunk-HUXODBIO.js.map +0 -1
  550. package/dist/chunk-I32ZQUYY.js.map +0 -1
  551. package/dist/chunk-JWTWPZ32.js.map +0 -1
  552. package/dist/chunk-KH577UDI.js.map +0 -1
  553. package/dist/chunk-KJTMZJ7V.js.map +0 -1
  554. package/dist/chunk-L5UYN5LX.js +0 -787
  555. package/dist/chunk-L5UYN5LX.js.map +0 -1
  556. package/dist/chunk-LOYLJRCF.js.map +0 -1
  557. package/dist/chunk-LX4FDH4J.js.map +0 -1
  558. package/dist/chunk-N2WHJ3FI.js.map +0 -1
  559. package/dist/chunk-NGYLRX6F.js.map +0 -1
  560. package/dist/chunk-O3V3BTIJ.js.map +0 -1
  561. package/dist/chunk-OLTQAMV2.js.map +0 -1
  562. package/dist/chunk-ON2CMF6J.js.map +0 -1
  563. package/dist/chunk-ONGJXAYQ.js.map +0 -1
  564. package/dist/chunk-OQFYIKWR.js +0 -1264
  565. package/dist/chunk-OQFYIKWR.js.map +0 -1
  566. package/dist/chunk-POLVJ36Y.js.map +0 -1
  567. package/dist/chunk-POXI7JJ4.js +0 -351
  568. package/dist/chunk-POXI7JJ4.js.map +0 -1
  569. package/dist/chunk-R3TLU26W.js.map +0 -1
  570. package/dist/chunk-RFHTC6AH.js.map +0 -1
  571. package/dist/chunk-ROA7BYGB.js.map +0 -1
  572. package/dist/chunk-SGRACNBP.js.map +0 -1
  573. package/dist/chunk-TLNHWOQQ.js.map +0 -1
  574. package/dist/chunk-UTWQ2FZK.js.map +0 -1
  575. package/dist/chunk-VOODO2ZE.js.map +0 -1
  576. package/dist/chunk-WRSG7WU5.js.map +0 -1
  577. package/dist/chunk-X3YNHX77.js.map +0 -1
  578. package/dist/chunk-Y4XAXZHB.js.map +0 -1
  579. package/dist/chunk-YJOLLSHH.js.map +0 -1
  580. package/dist/chunk-YS5AIY4A.js.map +0 -1
  581. package/dist/chunk-YXLIGJTN.js.map +0 -1
  582. package/dist/chunk-ZIYA7TGX.js.map +0 -1
  583. package/dist/chunk-ZJNGZCRB.js.map +0 -1
  584. package/dist/empty/index.d.ts +0 -6
  585. package/dist/empty/index.d.ts.map +0 -1
  586. package/dist/empty/index.js +0 -4
  587. package/dist/empty/types.d.ts +0 -62
  588. package/dist/empty/types.d.ts.map +0 -1
  589. package/dist/styles/tokens.d.ts +0 -428
  590. package/dist/styles/tokens.d.ts.map +0 -1
  591. /package/dist/{empty → alert}/index.js.map +0 -0
@@ -1,787 +0,0 @@
1
- import { focusRingColorClasses, textColorClasses } from './chunk-POXI7JJ4.js';
2
- import { cn, iconSizes } from './chunk-NGYLRX6F.js';
3
- import * as PopoverPrimitive from '@radix-ui/react-popover';
4
- import { cva } from 'class-variance-authority';
5
- import { Loader2, X, ChevronDown, Check, ChevronRight } from 'lucide-react';
6
- import React from 'react';
7
- import { jsxs, jsx } from 'react/jsx-runtime';
8
-
9
- var cascaderTriggerVariants = cva(
10
- "flex items-center justify-between gap-2 rounded-md border transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background",
11
- {
12
- variants: {
13
- status: {
14
- default: "bg-background border-border hover:border-primary/50",
15
- error: "border-error",
16
- warning: "border-warning",
17
- info: "border-info",
18
- success: "border-success"
19
- },
20
- size: {
21
- xs: "h-(--select-height-xs) px-(--select-padding-x-xs) text-xs",
22
- sm: "h-(--select-height-sm) px-(--select-padding-x-sm) text-sm",
23
- md: "h-(--select-height-md) px-(--select-padding-x-md) text-base",
24
- lg: "h-(--select-height-lg) px-(--select-padding-x-lg) text-lg"
25
- },
26
- fullWidth: {
27
- true: "w-full",
28
- false: "max-w-full"
29
- }
30
- },
31
- defaultVariants: {
32
- status: "default",
33
- size: "md",
34
- fullWidth: true
35
- }
36
- }
37
- );
38
- var cascaderMenuVariants = cva(
39
- "overflow-auto rounded-md border bg-background w-[200px] max-h-[300px]",
40
- {
41
- variants: {
42
- size: {
43
- xs: "w-[160px]",
44
- sm: "w-[180px]",
45
- md: "w-[200px]",
46
- lg: "w-[220px]"
47
- }
48
- },
49
- defaultVariants: {
50
- size: "md"
51
- }
52
- }
53
- );
54
- var cascaderItemVariants = cva(
55
- "relative cursor-pointer select-none text-text-primary transition-colors flex items-center gap-2 w-full",
56
- {
57
- variants: {
58
- size: {
59
- xs: "px-2 py-1 text-xs min-h-[28px]",
60
- sm: "px-2.5 py-1.5 text-sm min-h-[32px]",
61
- md: "px-3 py-2 text-base min-h-[36px]",
62
- lg: "px-3.5 py-2.5 text-lg min-h-[44px]"
63
- },
64
- disabled: {
65
- true: "opacity-50 cursor-not-allowed",
66
- false: "hover:bg-surface"
67
- },
68
- active: {
69
- true: "bg-surface",
70
- false: ""
71
- },
72
- selected: {
73
- true: "font-medium",
74
- false: ""
75
- }
76
- },
77
- defaultVariants: {
78
- size: "md",
79
- disabled: false,
80
- active: false,
81
- selected: false
82
- }
83
- }
84
- );
85
- var tagSizeClasses = {
86
- xs: "text-[10px] px-1 py-0",
87
- sm: "text-xs px-1.5 py-0.5",
88
- md: "text-sm px-2 py-0.5",
89
- lg: "text-sm px-2.5 py-1"
90
- };
91
- var accentBgClasses = {
92
- default: "bg-primary/10 text-primary",
93
- primary: "bg-primary/10 text-primary",
94
- secondary: "bg-secondary/10 text-secondary",
95
- accent: "bg-accent/10 text-accent",
96
- success: "bg-success/10 text-success",
97
- error: "bg-error/10 text-error",
98
- warning: "bg-warning/10 text-warning",
99
- info: "bg-info/10 text-info"
100
- };
101
- var checkboxCheckedClasses = {
102
- default: "bg-primary border-primary",
103
- primary: "bg-primary border-primary",
104
- secondary: "bg-secondary border-secondary",
105
- accent: "bg-accent border-accent",
106
- success: "bg-success border-success",
107
- error: "bg-error border-error",
108
- warning: "bg-warning border-warning",
109
- info: "bg-info border-info"
110
- };
111
- var indeterminateBgClasses = {
112
- default: "bg-primary",
113
- primary: "bg-primary",
114
- secondary: "bg-secondary",
115
- accent: "bg-accent",
116
- success: "bg-success",
117
- error: "bg-error",
118
- warning: "bg-warning",
119
- info: "bg-info"
120
- };
121
- var Cascader = React.memo(
122
- ({
123
- options,
124
- value,
125
- defaultValue,
126
- onChange,
127
- onSelect,
128
- placeholder = "Please select",
129
- label,
130
- helperText,
131
- messagePosition = "bottom",
132
- color = "default",
133
- size = "md",
134
- placement = "bottomLeft",
135
- disabled = false,
136
- loading = false,
137
- error,
138
- warning,
139
- info,
140
- success,
141
- fullWidth = true,
142
- expandTrigger = "hover",
143
- multiple = false,
144
- maxTagCount = 3,
145
- clearable = true,
146
- showPath = true,
147
- pathSeparator = " / ",
148
- changeOnSelect = false,
149
- loadData,
150
- displayRender,
151
- tagRender,
152
- emptyContent = "No options",
153
- className,
154
- classNames,
155
- required,
156
- ref,
157
- onOpenChange
158
- }) => {
159
- const [isOpen, setIsOpen] = React.useState(false);
160
- const [internalValue, setInternalValue] = React.useState(defaultValue || []);
161
- const [activeMenus, setActiveMenus] = React.useState([
162
- options
163
- ]);
164
- const [hoveredPath, setHoveredPath] = React.useState([]);
165
- const [selectedPath, setSelectedPath] = React.useState([]);
166
- const [focusedIndex, setFocusedIndex] = React.useState(null);
167
- const containerRef = React.useRef(null);
168
- const menuRefs = React.useRef([]);
169
- const currentValue = value !== void 0 ? value : internalValue;
170
- const normalizedValue = React.useMemo(() => {
171
- if (multiple) {
172
- return Array.isArray(currentValue[0]) ? currentValue : [];
173
- }
174
- return Array.isArray(currentValue) && currentValue.length > 0 && !Array.isArray(currentValue[0]) ? [currentValue] : [];
175
- }, [currentValue, multiple]);
176
- let status = "default";
177
- if (error) status = "error";
178
- else if (warning) status = "warning";
179
- else if (success) status = "success";
180
- else if (info) status = "info";
181
- const helperMessage = error || warning || info || success || helperText;
182
- const handleOpenChange = React.useCallback(
183
- (open) => {
184
- if (disabled || loading) return;
185
- setIsOpen(open);
186
- onOpenChange?.(open);
187
- if (open) {
188
- setActiveMenus([options]);
189
- setHoveredPath([]);
190
- setFocusedIndex(null);
191
- if (normalizedValue.length > 0 && !multiple) {
192
- setSelectedPath(normalizedValue[0] || []);
193
- expandToPath(normalizedValue[0] || []);
194
- } else {
195
- setSelectedPath([]);
196
- }
197
- }
198
- },
199
- [disabled, loading, options, normalizedValue, multiple, onOpenChange]
200
- );
201
- const expandToPath = React.useCallback(
202
- (path) => {
203
- const menus = [options];
204
- let currentOptions = options;
205
- for (const val of path) {
206
- const option = currentOptions.find((opt) => opt.value === val);
207
- if (option?.children && option.children.length > 0) {
208
- menus.push(option.children);
209
- currentOptions = option.children;
210
- }
211
- }
212
- setActiveMenus(menus);
213
- },
214
- [options]
215
- );
216
- const getSelectedOptions = React.useCallback(
217
- (path) => {
218
- const selected = [];
219
- let currentOptions = options;
220
- for (const val of path) {
221
- const option = currentOptions.find((opt) => opt.value === val);
222
- if (option) {
223
- selected.push(option);
224
- currentOptions = option.children || [];
225
- }
226
- }
227
- return selected;
228
- },
229
- [options]
230
- );
231
- const isPathSelected = React.useCallback(
232
- (path) => {
233
- return normalizedValue.some(
234
- (selectedPath2) => selectedPath2.length === path.length && selectedPath2.every((val, idx) => val === path[idx])
235
- );
236
- },
237
- [normalizedValue]
238
- );
239
- const getAllLeafPaths = React.useCallback(
240
- (option, currentPath) => {
241
- const paths = [];
242
- const fullPath = [...currentPath, option.value];
243
- if (!option.children || option.children.length === 0) {
244
- paths.push(fullPath);
245
- } else {
246
- option.children.forEach((child) => {
247
- paths.push(...getAllLeafPaths(child, fullPath));
248
- });
249
- }
250
- return paths;
251
- },
252
- []
253
- );
254
- const getNodeSelectionState = React.useCallback(
255
- (option, currentPath) => {
256
- if (!option.children || option.children.length === 0) {
257
- const fullPath = [...currentPath, option.value];
258
- return { checked: isPathSelected(fullPath), indeterminate: false };
259
- }
260
- const leafPaths = getAllLeafPaths(option, currentPath);
261
- const selectedCount = leafPaths.filter(
262
- (path) => isPathSelected(path)
263
- ).length;
264
- return {
265
- checked: selectedCount === leafPaths.length && leafPaths.length > 0,
266
- indeterminate: selectedCount > 0 && selectedCount < leafPaths.length
267
- };
268
- },
269
- [isPathSelected, getAllLeafPaths]
270
- );
271
- const handleItemClick = React.useCallback(
272
- async (option, level) => {
273
- if (option.disabled) return;
274
- const newPath = [...selectedPath.slice(0, level), option.value];
275
- setSelectedPath(newPath);
276
- if (loadData && !option.children && !option.isLeaf && !option.loading) {
277
- const selectedOpts = getSelectedOptions(newPath);
278
- await loadData(selectedOpts);
279
- return;
280
- }
281
- const hasChildren = option.children && option.children.length > 0;
282
- const isLeaf = !hasChildren;
283
- if (hasChildren && !multiple) {
284
- setActiveMenus((prev) => [
285
- ...prev.slice(0, level + 1),
286
- option.children
287
- ]);
288
- if (changeOnSelect) {
289
- const selectedOpts = getSelectedOptions(newPath);
290
- if (value === void 0) setInternalValue(newPath);
291
- onChange?.(newPath, selectedOpts);
292
- }
293
- } else if (hasChildren && multiple) {
294
- const leafPaths = getAllLeafPaths(
295
- option,
296
- selectedPath.slice(0, level)
297
- );
298
- const allSelected = leafPaths.every((path) => isPathSelected(path));
299
- let newValue;
300
- if (allSelected) {
301
- newValue = normalizedValue.filter(
302
- (sp) => !leafPaths.some(
303
- (lp) => lp.length === sp.length && lp.every((v, i) => v === sp[i])
304
- )
305
- );
306
- } else {
307
- const pathsToAdd = leafPaths.filter(
308
- (path) => !isPathSelected(path)
309
- );
310
- newValue = [...normalizedValue, ...pathsToAdd];
311
- }
312
- const newSelectedOptions = newValue.map(
313
- (path) => getSelectedOptions(path)
314
- );
315
- if (value === void 0) setInternalValue(newValue);
316
- onChange?.(newValue, newSelectedOptions);
317
- setActiveMenus((prev) => [
318
- ...prev.slice(0, level + 1),
319
- option.children
320
- ]);
321
- } else if (isLeaf) {
322
- if (multiple) {
323
- let newValue;
324
- if (isPathSelected(newPath)) {
325
- newValue = normalizedValue.filter(
326
- (path) => !(path.length === newPath.length && path.every((val, idx) => val === newPath[idx]))
327
- );
328
- } else {
329
- newValue = [...normalizedValue, newPath];
330
- }
331
- const newSelectedOptions = newValue.map(
332
- (path) => getSelectedOptions(path)
333
- );
334
- if (value === void 0) setInternalValue(newValue);
335
- onChange?.(newValue, newSelectedOptions);
336
- } else {
337
- const selectedOpts = getSelectedOptions(newPath);
338
- if (value === void 0) setInternalValue(newPath);
339
- onChange?.(newPath, selectedOpts);
340
- onSelect?.(newPath, selectedOpts);
341
- handleOpenChange(false);
342
- }
343
- }
344
- },
345
- [
346
- selectedPath,
347
- value,
348
- onChange,
349
- onSelect,
350
- getSelectedOptions,
351
- multiple,
352
- isPathSelected,
353
- normalizedValue,
354
- getAllLeafPaths,
355
- changeOnSelect,
356
- loadData,
357
- handleOpenChange
358
- ]
359
- );
360
- const handleItemHover = React.useCallback(
361
- (option, level, index) => {
362
- if (expandTrigger !== "hover" || option.disabled) return;
363
- setHoveredPath((prev) => [...prev.slice(0, level), index]);
364
- setSelectedPath((prev) => [...prev.slice(0, level), option.value]);
365
- if (option.children && option.children.length > 0) {
366
- setActiveMenus((prev) => [
367
- ...prev.slice(0, level + 1),
368
- option.children
369
- ]);
370
- } else {
371
- setActiveMenus((prev) => prev.slice(0, level + 1));
372
- }
373
- },
374
- [expandTrigger]
375
- );
376
- const handleClear = React.useCallback(
377
- (e) => {
378
- e.stopPropagation();
379
- const emptyValue = multiple ? [] : [];
380
- if (value === void 0) setInternalValue(emptyValue);
381
- onChange?.(emptyValue, []);
382
- },
383
- [value, onChange, multiple]
384
- );
385
- const removeSelection = React.useCallback(
386
- (pathToRemove, e) => {
387
- e.stopPropagation();
388
- if (!multiple) return;
389
- const newValue = normalizedValue.filter(
390
- (path) => !(path.length === pathToRemove.length && path.every((val, idx) => val === pathToRemove[idx]))
391
- );
392
- const newSelectedOptions = newValue.map(
393
- (path) => getSelectedOptions(path)
394
- );
395
- if (value === void 0) setInternalValue(newValue);
396
- onChange?.(newValue, newSelectedOptions);
397
- },
398
- [multiple, normalizedValue, value, onChange, getSelectedOptions]
399
- );
400
- const handleKeyDown = React.useCallback(
401
- (e) => {
402
- if (!isOpen) {
403
- if (e.key === "Enter" || e.key === " " || e.key === "ArrowDown") {
404
- e.preventDefault();
405
- handleOpenChange(true);
406
- }
407
- return;
408
- }
409
- switch (e.key) {
410
- case "Escape":
411
- e.preventDefault();
412
- handleOpenChange(false);
413
- break;
414
- case "ArrowDown":
415
- e.preventDefault();
416
- if (focusedIndex === null) {
417
- setFocusedIndex({ level: 0, index: 0 });
418
- } else {
419
- const currentMenu = activeMenus[focusedIndex.level];
420
- if (currentMenu && focusedIndex.index < currentMenu.length - 1) {
421
- setFocusedIndex({
422
- ...focusedIndex,
423
- index: focusedIndex.index + 1
424
- });
425
- }
426
- }
427
- break;
428
- case "ArrowUp":
429
- e.preventDefault();
430
- if (focusedIndex && focusedIndex.index > 0) {
431
- setFocusedIndex({
432
- ...focusedIndex,
433
- index: focusedIndex.index - 1
434
- });
435
- }
436
- break;
437
- case "ArrowRight":
438
- e.preventDefault();
439
- if (focusedIndex) {
440
- const currentMenu = activeMenus[focusedIndex.level];
441
- const option = currentMenu?.[focusedIndex.index];
442
- if (option?.children && option.children.length > 0) {
443
- setActiveMenus((prev) => [
444
- ...prev.slice(0, focusedIndex.level + 1),
445
- option.children
446
- ]);
447
- setFocusedIndex({ level: focusedIndex.level + 1, index: 0 });
448
- }
449
- }
450
- break;
451
- case "ArrowLeft":
452
- e.preventDefault();
453
- if (focusedIndex && focusedIndex.level > 0) {
454
- const parentLevel = focusedIndex.level - 1;
455
- const parentIndex = hoveredPath[parentLevel] ?? 0;
456
- setActiveMenus((prev) => prev.slice(0, focusedIndex.level));
457
- setFocusedIndex({ level: parentLevel, index: parentIndex });
458
- }
459
- break;
460
- case "Enter":
461
- e.preventDefault();
462
- if (focusedIndex) {
463
- const currentMenu = activeMenus[focusedIndex.level];
464
- const option = currentMenu?.[focusedIndex.index];
465
- if (option) {
466
- handleItemClick(option, focusedIndex.level);
467
- }
468
- }
469
- break;
470
- }
471
- },
472
- [isOpen, focusedIndex, activeMenus, handleOpenChange, handleItemClick]
473
- );
474
- const displayValue = React.useMemo(() => {
475
- if (normalizedValue.length === 0) return null;
476
- if (displayRender) {
477
- if (multiple) {
478
- const allLabels = normalizedValue.map(
479
- (path) => getSelectedOptions(path).map((opt) => opt.label)
480
- );
481
- const allOptions = normalizedValue.map(
482
- (path) => getSelectedOptions(path)
483
- );
484
- return displayRender(allLabels, allOptions);
485
- } else {
486
- const selectedOpts = getSelectedOptions(normalizedValue[0] || []);
487
- const labels = selectedOpts.map((opt) => opt.label);
488
- return displayRender(labels, selectedOpts);
489
- }
490
- }
491
- if (!multiple) {
492
- const selectedOpts = getSelectedOptions(normalizedValue[0] || []);
493
- const labels = selectedOpts.map((opt) => opt.label);
494
- if (showPath) {
495
- return labels.join(pathSeparator);
496
- }
497
- return labels[labels.length - 1] || null;
498
- }
499
- return null;
500
- }, [
501
- normalizedValue,
502
- displayRender,
503
- getSelectedOptions,
504
- multiple,
505
- showPath,
506
- pathSeparator
507
- ]);
508
- const showClearButton = clearable && normalizedValue.length > 0 && normalizedValue[0]?.[0] && !disabled && !loading;
509
- const renderCascaderMenus = () => {
510
- return /* @__PURE__ */ jsx("div", { className: cn("flex [&>*:not(:first-child)]:rounded-l-none [&>*:not(:last-child)]:border-r-0 [&>*:not(:last-child)]:rounded-r-none cascader_dropdown", classNames?.dropdown), "data-slot": "dropdown", children: activeMenus.map((menu, level) => /* @__PURE__ */ jsx(
511
- "div",
512
- {
513
- ref: (el) => {
514
- menuRefs.current[level] = el;
515
- },
516
- role: "listbox",
517
- className: cn(cascaderMenuVariants({ size }), "border-border cascader_menu", classNames?.menu),
518
- "data-slot": "menu",
519
- children: menu.length === 0 ? /* @__PURE__ */ jsx("div", { className: "px-3 py-6 text-center text-text-secondary text-sm", children: emptyContent }) : menu.map((option, index) => {
520
- const isActive = selectedPath[level] === option.value || expandTrigger === "hover" && hoveredPath[level] === index;
521
- const isFocused = focusedIndex?.level === level && focusedIndex?.index === index;
522
- const currentPath = selectedPath.slice(0, level);
523
- const fullPath = [...currentPath, option.value];
524
- const selectionState = multiple ? getNodeSelectionState(option, currentPath) : null;
525
- const isLeafSelected = !multiple && isPathSelected(fullPath) && (!option.children || option.children.length === 0);
526
- return /* @__PURE__ */ jsxs(
527
- "div",
528
- {
529
- role: "option",
530
- "aria-selected": isLeafSelected || (selectionState?.checked ?? false),
531
- "aria-disabled": option.disabled,
532
- className: cn(
533
- cascaderItemVariants({
534
- size,
535
- disabled: !!option.disabled,
536
- active: isActive || isFocused,
537
- selected: isLeafSelected
538
- }),
539
- isLeafSelected && accentBgClasses[color],
540
- "cascader_option",
541
- classNames?.option
542
- ),
543
- onClick: () => handleItemClick(option, level),
544
- onMouseEnter: () => handleItemHover(option, level, index),
545
- "data-slot": "option",
546
- children: [
547
- multiple && /* @__PURE__ */ jsxs(
548
- "div",
549
- {
550
- className: cn(
551
- "w-4 h-4 border rounded flex items-center justify-center shrink-0",
552
- selectionState?.checked ? checkboxCheckedClasses[color] : "border-border"
553
- ),
554
- children: [
555
- selectionState?.checked && /* @__PURE__ */ jsx(Check, { className: "h-3 w-3 text-background" }),
556
- selectionState?.indeterminate && !selectionState?.checked && /* @__PURE__ */ jsx("div", { className: cn("w-2 h-0.5", indeterminateBgClasses[color]) })
557
- ]
558
- }
559
- ),
560
- /* @__PURE__ */ jsx("span", { className: "flex-1 truncate", children: option.label }),
561
- /* @__PURE__ */ jsxs(
562
- "span",
563
- {
564
- className: cn(
565
- "shrink-0 flex items-center",
566
- iconSizes[size]
567
- ),
568
- children: [
569
- option.loading && /* @__PURE__ */ jsx(
570
- Loader2,
571
- {
572
- className: cn("animate-spin", iconSizes[size])
573
- }
574
- ),
575
- !option.loading && option.children && option.children.length > 0 && /* @__PURE__ */ jsx(ChevronRight, { className: iconSizes[size] }),
576
- !option.loading && isLeafSelected && /* @__PURE__ */ jsx(
577
- Check,
578
- {
579
- className: cn(iconSizes[size], textColorClasses[color])
580
- }
581
- )
582
- ]
583
- }
584
- )
585
- ]
586
- },
587
- option.value
588
- );
589
- })
590
- },
591
- level
592
- )) });
593
- };
594
- const renderTriggerContent = () => {
595
- if (multiple && normalizedValue.length > 0) {
596
- const visibleTags = normalizedValue.slice(0, maxTagCount);
597
- const remainingCount = normalizedValue.length - maxTagCount;
598
- return /* @__PURE__ */ jsxs("div", { className: "flex-1 flex flex-wrap gap-1 items-center min-h-0 overflow-hidden", children: [
599
- visibleTags.map((path, idx) => {
600
- const selectedOpts = getSelectedOptions(path);
601
- const label2 = showPath ? selectedOpts.map((o) => o.label).join(pathSeparator) : selectedOpts[selectedOpts.length - 1]?.label || "";
602
- if (tagRender) {
603
- return tagRender({
604
- label: label2,
605
- value: path,
606
- closable: !disabled,
607
- onClose: () => removeSelection(path, {
608
- stopPropagation: () => {
609
- }
610
- })
611
- });
612
- }
613
- return /* @__PURE__ */ jsxs(
614
- "span",
615
- {
616
- className: cn(
617
- "inline-flex items-center gap-1 rounded whitespace-nowrap",
618
- accentBgClasses[color],
619
- tagSizeClasses[size]
620
- ),
621
- children: [
622
- /* @__PURE__ */ jsx("span", { className: "truncate max-w-[150px]", children: label2 }),
623
- !disabled && /* @__PURE__ */ jsx(
624
- "button",
625
- {
626
- type: "button",
627
- onClick: (e) => removeSelection(path, e),
628
- className: "hover:text-error shrink-0",
629
- children: /* @__PURE__ */ jsx(X, { className: "h-3 w-3" })
630
- }
631
- )
632
- ]
633
- },
634
- idx
635
- );
636
- }),
637
- remainingCount > 0 && /* @__PURE__ */ jsxs(
638
- "span",
639
- {
640
- className: cn(
641
- "inline-flex items-center bg-surface text-text-secondary rounded whitespace-nowrap",
642
- tagSizeClasses[size]
643
- ),
644
- children: [
645
- "+",
646
- remainingCount
647
- ]
648
- }
649
- )
650
- ] });
651
- }
652
- return /* @__PURE__ */ jsx(
653
- "span",
654
- {
655
- className: cn("truncate flex-1", !displayValue && "text-text-secondary"),
656
- children: displayValue || placeholder
657
- }
658
- );
659
- };
660
- const popoverSide = placement.startsWith("top") ? "top" : "bottom";
661
- const popoverAlign = placement.endsWith("Right") ? "end" : "start";
662
- const triggerElement = /* @__PURE__ */ jsxs(
663
- "div",
664
- {
665
- ref,
666
- className: cn(
667
- cascaderTriggerVariants({ status, size, fullWidth }),
668
- focusRingColorClasses[color],
669
- disabled && "opacity-50 cursor-not-allowed",
670
- loading && "opacity-50 pointer-events-none",
671
- "cascader_trigger",
672
- classNames?.trigger,
673
- className
674
- ),
675
- onKeyDown: handleKeyDown,
676
- tabIndex: disabled ? -1 : 0,
677
- role: "combobox",
678
- "aria-expanded": isOpen,
679
- "aria-haspopup": "listbox",
680
- "aria-disabled": disabled,
681
- "aria-label": label || placeholder,
682
- "data-slot": "trigger",
683
- children: [
684
- renderTriggerContent(),
685
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-text-secondary shrink-0", children: [
686
- loading && /* @__PURE__ */ jsx(
687
- Loader2,
688
- {
689
- className: cn("animate-spin text-text-secondary", iconSizes[size])
690
- }
691
- ),
692
- !loading && showClearButton && /* @__PURE__ */ jsx(
693
- "button",
694
- {
695
- type: "button",
696
- onClick: handleClear,
697
- className: "hover:text-text-primary",
698
- "aria-label": "Clear selection",
699
- children: /* @__PURE__ */ jsx(X, { className: iconSizes[size] })
700
- }
701
- ),
702
- !loading && /* @__PURE__ */ jsx(
703
- ChevronDown,
704
- {
705
- className: cn(
706
- "transition-transform",
707
- iconSizes[size],
708
- isOpen && "rotate-180"
709
- )
710
- }
711
- )
712
- ] })
713
- ]
714
- }
715
- );
716
- const cascaderElement = /* @__PURE__ */ jsx(
717
- "div",
718
- {
719
- ref: containerRef,
720
- className: cn("relative cascader_root", fullWidth ? "w-full" : "inline-block", classNames?.root),
721
- "data-slot": "root",
722
- children: /* @__PURE__ */ jsxs(PopoverPrimitive.Root, { open: isOpen, onOpenChange: handleOpenChange, children: [
723
- /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, { asChild: true, children: triggerElement }),
724
- /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
725
- PopoverPrimitive.Content,
726
- {
727
- side: popoverSide,
728
- align: popoverAlign,
729
- sideOffset: 4,
730
- className: "z-50 outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 duration-200",
731
- children: renderCascaderMenus()
732
- }
733
- ) })
734
- ] })
735
- }
736
- );
737
- return /* @__PURE__ */ jsxs(
738
- "div",
739
- {
740
- className: cn("flex flex-col", fullWidth ? "w-full" : "inline-block"),
741
- children: [
742
- /* @__PURE__ */ jsxs("div", { className: "flex gap-2 items-center mb-0.5", children: [
743
- label && /* @__PURE__ */ jsxs("label", { className: "text-sm font-medium text-text-secondary", children: [
744
- label,
745
- required && /* @__PURE__ */ jsx("span", { className: "text-error ml-1", children: "*" })
746
- ] }),
747
- helperMessage && messagePosition === "top" && /* @__PURE__ */ jsx(
748
- "span",
749
- {
750
- className: cn(
751
- "text-xs",
752
- status === "error" && "text-error",
753
- status === "warning" && "text-warning",
754
- status === "info" && "text-info",
755
- status === "success" && "text-success",
756
- status === "default" && "text-text-secondary"
757
- ),
758
- children: helperMessage
759
- }
760
- )
761
- ] }),
762
- cascaderElement,
763
- helperMessage && messagePosition === "bottom" && /* @__PURE__ */ jsx(
764
- "span",
765
- {
766
- className: cn(
767
- "text-xs mt-0.5",
768
- status === "error" && "text-error",
769
- status === "warning" && "text-warning",
770
- status === "info" && "text-info",
771
- status === "success" && "text-success",
772
- status === "default" && "text-text-secondary"
773
- ),
774
- children: helperMessage
775
- }
776
- )
777
- ]
778
- }
779
- );
780
- }
781
- );
782
- Cascader.displayName = "Cascader";
783
- var cascader_default = Cascader;
784
-
785
- export { cascader_default };
786
- //# sourceMappingURL=chunk-L5UYN5LX.js.map
787
- //# sourceMappingURL=chunk-L5UYN5LX.js.map