@vlrc-fe/components 1.0.7 → 1.0.8

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 (448) hide show
  1. package/dist/MultiSelect/type.d.ts +2 -2
  2. package/dist/index.cjs +1 -1
  3. package/dist/index.js +64 -41
  4. package/dist/index10.cjs +1 -1
  5. package/dist/index10.js +46 -80
  6. package/dist/index100.cjs +1 -1
  7. package/dist/index100.js +22 -60
  8. package/dist/index101.cjs +1 -1
  9. package/dist/index101.js +1147 -43
  10. package/dist/index102.cjs +1 -1
  11. package/dist/index102.js +30 -64
  12. package/dist/index103.cjs +1 -1
  13. package/dist/index103.js +31 -147
  14. package/dist/index104.cjs +1 -1
  15. package/dist/index104.js +93 -19
  16. package/dist/index105.cjs +1 -1
  17. package/dist/index105.js +80 -25
  18. package/dist/index106.cjs +1 -1
  19. package/dist/index106.js +9 -50
  20. package/dist/index107.cjs +1 -1
  21. package/dist/index107.js +30 -156
  22. package/dist/index108.cjs +1 -1
  23. package/dist/index108.js +350 -14
  24. package/dist/index109.cjs +1 -1
  25. package/dist/index109.js +11 -0
  26. package/dist/index11.cjs +1 -1
  27. package/dist/index11.js +55 -60
  28. package/dist/index110.cjs +1 -0
  29. package/dist/index110.js +430 -0
  30. package/dist/index111.cjs +1 -0
  31. package/dist/index111.js +36 -0
  32. package/dist/index112.cjs +1 -0
  33. package/dist/index112.js +28 -0
  34. package/dist/index113.cjs +1 -0
  35. package/dist/index113.js +14 -0
  36. package/dist/index114.cjs +1 -0
  37. package/dist/index114.js +156 -0
  38. package/dist/index115.cjs +1 -0
  39. package/dist/index115.js +19 -0
  40. package/dist/index116.cjs +1 -0
  41. package/dist/index116.js +67 -0
  42. package/dist/index117.cjs +1 -0
  43. package/dist/index117.js +118 -0
  44. package/dist/index118.cjs +1 -0
  45. package/dist/index118.js +36 -0
  46. package/dist/index119.cjs +1 -0
  47. package/dist/index119.js +13 -0
  48. package/dist/index12.cjs +1 -1
  49. package/dist/index12.js +44 -121
  50. package/dist/index120.cjs +1 -0
  51. package/dist/index120.js +31 -0
  52. package/dist/index121.cjs +1 -0
  53. package/dist/index121.js +37 -0
  54. package/dist/index122.cjs +1 -0
  55. package/dist/index122.js +123 -0
  56. package/dist/index123.cjs +1 -0
  57. package/dist/index123.js +44 -0
  58. package/dist/index124.cjs +1 -0
  59. package/dist/index124.js +43 -0
  60. package/dist/index125.cjs +1 -0
  61. package/dist/index125.js +14 -0
  62. package/dist/index126.cjs +1 -0
  63. package/dist/index126.js +64 -0
  64. package/dist/index127.cjs +1 -0
  65. package/dist/index127.js +23 -0
  66. package/dist/index128.cjs +1 -0
  67. package/dist/index128.js +34 -0
  68. package/dist/index129.cjs +1 -0
  69. package/dist/index129.js +27 -0
  70. package/dist/index13.cjs +1 -1
  71. package/dist/index13.js +30 -12
  72. package/dist/index130.cjs +1 -0
  73. package/dist/index130.js +26 -0
  74. package/dist/index131.cjs +1 -0
  75. package/dist/index131.js +157 -0
  76. package/dist/index132.cjs +1 -0
  77. package/dist/index132.js +34 -0
  78. package/dist/index133.cjs +1 -0
  79. package/dist/index133.js +46 -0
  80. package/dist/index134.cjs +1 -0
  81. package/dist/index134.js +142 -0
  82. package/dist/index135.cjs +1 -0
  83. package/dist/index135.js +125 -0
  84. package/dist/index136.cjs +1 -0
  85. package/dist/index136.js +26 -0
  86. package/dist/index137.cjs +1 -0
  87. package/dist/index137.js +88 -0
  88. package/dist/index138.cjs +1 -0
  89. package/dist/index138.js +221 -0
  90. package/dist/index139.cjs +1 -0
  91. package/dist/index139.js +166 -0
  92. package/dist/index14.cjs +1 -1
  93. package/dist/index14.js +8 -12
  94. package/dist/index140.cjs +1 -0
  95. package/dist/index140.js +126 -0
  96. package/dist/index141.cjs +1 -0
  97. package/dist/index141.js +15 -0
  98. package/dist/index142.cjs +1 -0
  99. package/dist/index142.js +9 -0
  100. package/dist/index143.cjs +1 -0
  101. package/dist/index143.js +17 -0
  102. package/dist/index144.cjs +1 -0
  103. package/dist/index144.js +22 -0
  104. package/dist/index145.cjs +1 -0
  105. package/dist/index145.js +18 -0
  106. package/dist/index146.cjs +1 -0
  107. package/dist/index146.js +6 -0
  108. package/dist/index147.cjs +1 -0
  109. package/dist/index147.js +7 -0
  110. package/dist/index148.cjs +1 -0
  111. package/dist/index148.js +8 -0
  112. package/dist/index149.cjs +1 -0
  113. package/dist/index149.js +7 -0
  114. package/dist/index15.cjs +1 -1
  115. package/dist/index15.js +12 -112
  116. package/dist/index150.cjs +1 -0
  117. package/dist/index150.js +7 -0
  118. package/dist/index151.cjs +1 -0
  119. package/dist/index151.js +9 -0
  120. package/dist/index152.cjs +1 -0
  121. package/dist/index152.js +69 -0
  122. package/dist/index153.cjs +1 -0
  123. package/dist/index153.js +11 -0
  124. package/dist/index154.cjs +1 -0
  125. package/dist/index154.js +202 -0
  126. package/dist/index155.cjs +1 -0
  127. package/dist/index155.js +124 -0
  128. package/dist/index156.cjs +1 -0
  129. package/dist/index156.js +32 -0
  130. package/dist/index157.cjs +1 -0
  131. package/dist/index157.js +20 -0
  132. package/dist/index158.cjs +1 -0
  133. package/dist/index158.js +69 -0
  134. package/dist/index159.cjs +1 -0
  135. package/dist/index159.js +32 -0
  136. package/dist/index16.cjs +1 -1
  137. package/dist/index16.js +4 -726
  138. package/dist/index160.cjs +1 -0
  139. package/dist/index160.js +11 -0
  140. package/dist/index161.cjs +1 -0
  141. package/dist/index161.js +280 -0
  142. package/dist/index162.cjs +1 -0
  143. package/dist/index162.js +157 -0
  144. package/dist/index163.cjs +1 -0
  145. package/dist/index163.js +20 -0
  146. package/dist/index164.cjs +1 -0
  147. package/dist/index164.js +10 -0
  148. package/dist/index165.cjs +1 -0
  149. package/dist/index165.js +14 -0
  150. package/dist/index166.cjs +1 -0
  151. package/dist/index166.js +8 -0
  152. package/dist/index167.cjs +1 -0
  153. package/dist/index167.js +8 -0
  154. package/dist/index168.cjs +1 -0
  155. package/dist/index168.js +11 -0
  156. package/dist/index169.cjs +1 -0
  157. package/dist/index169.js +10 -0
  158. package/dist/index17.cjs +1 -1
  159. package/dist/index17.js +79 -339
  160. package/dist/index170.cjs +1 -0
  161. package/dist/index170.js +6 -0
  162. package/dist/index171.cjs +1 -0
  163. package/dist/index171.js +8 -0
  164. package/dist/index172.cjs +1 -0
  165. package/dist/index172.js +8 -0
  166. package/dist/index173.cjs +1 -0
  167. package/dist/index173.js +10 -0
  168. package/dist/index174.cjs +1 -0
  169. package/dist/index174.js +11 -0
  170. package/dist/index175.cjs +1 -0
  171. package/dist/index175.js +15 -0
  172. package/dist/index176.cjs +1 -0
  173. package/dist/index176.js +11 -0
  174. package/dist/index177.cjs +1 -0
  175. package/dist/index177.js +11 -0
  176. package/dist/index178.cjs +1 -0
  177. package/dist/index178.js +6 -0
  178. package/dist/index179.cjs +1 -0
  179. package/dist/index179.js +43 -0
  180. package/dist/index18.cjs +1 -1
  181. package/dist/index18.js +19 -66
  182. package/dist/index180.cjs +1 -0
  183. package/dist/index180.js +382 -0
  184. package/dist/index181.cjs +1 -0
  185. package/dist/index181.js +40 -0
  186. package/dist/index182.cjs +1 -0
  187. package/dist/index182.js +23 -0
  188. package/dist/index183.cjs +1 -0
  189. package/dist/index183.js +59 -0
  190. package/dist/index184.cjs +1 -0
  191. package/dist/index184.js +55 -0
  192. package/dist/index185.cjs +1 -0
  193. package/dist/index185.js +54 -0
  194. package/dist/index186.cjs +1 -0
  195. package/dist/index186.js +57 -0
  196. package/dist/index187.cjs +1 -0
  197. package/dist/index187.js +57 -0
  198. package/dist/index188.cjs +1 -0
  199. package/dist/index188.js +88 -0
  200. package/dist/index189.cjs +1 -0
  201. package/dist/index189.js +66 -0
  202. package/dist/index19.cjs +1 -1
  203. package/dist/index19.js +18 -8
  204. package/dist/index190.cjs +1 -0
  205. package/dist/index190.js +594 -0
  206. package/dist/index191.cjs +9 -0
  207. package/dist/index191.js +30 -0
  208. package/dist/index192.cjs +1 -0
  209. package/dist/index192.js +50 -0
  210. package/dist/index193.cjs +1 -0
  211. package/dist/index193.js +65 -0
  212. package/dist/index194.cjs +1 -0
  213. package/dist/index194.js +48 -0
  214. package/dist/index195.cjs +1 -0
  215. package/dist/index195.js +67 -0
  216. package/dist/index196.cjs +1 -0
  217. package/dist/index196.js +151 -0
  218. package/dist/index197.cjs +1 -0
  219. package/dist/index197.js +23 -0
  220. package/dist/index198.cjs +1 -0
  221. package/dist/index198.js +27 -0
  222. package/dist/index199.cjs +1 -0
  223. package/dist/index199.js +53 -0
  224. package/dist/index20.cjs +1 -1
  225. package/dist/index20.js +51 -98
  226. package/dist/index200.cjs +1 -0
  227. package/dist/index200.js +161 -0
  228. package/dist/index201.cjs +1 -0
  229. package/dist/index201.js +16 -0
  230. package/dist/index202.cjs +1 -0
  231. package/dist/index21.cjs +1 -1
  232. package/dist/index21.js +81 -28
  233. package/dist/index22.cjs +1 -1
  234. package/dist/index22.js +64 -14
  235. package/dist/index23.cjs +1 -1
  236. package/dist/index23.js +25 -22
  237. package/dist/index24.cjs +1 -1
  238. package/dist/index24.js +1014 -33
  239. package/dist/index25.cjs +1 -1
  240. package/dist/index25.js +22 -96
  241. package/dist/index26.cjs +1 -1
  242. package/dist/index26.js +108 -25
  243. package/dist/index27.cjs +1 -1
  244. package/dist/index27.js +15 -9
  245. package/dist/index28.cjs +1 -1
  246. package/dist/index28.js +20 -66
  247. package/dist/index29.cjs +1 -1
  248. package/dist/index29.js +81 -11
  249. package/dist/index30.cjs +1 -1
  250. package/dist/index30.js +91 -29
  251. package/dist/index31.cjs +1 -1
  252. package/dist/index31.js +14 -41
  253. package/dist/index32.cjs +1 -1
  254. package/dist/index32.js +93 -12
  255. package/dist/index33.cjs +1 -1
  256. package/dist/index33.js +22 -62
  257. package/dist/index34.cjs +1 -1
  258. package/dist/index34.js +84 -22
  259. package/dist/index35.cjs +1 -1
  260. package/dist/index35.js +85 -33
  261. package/dist/index36.cjs +1 -1
  262. package/dist/index36.js +407 -25
  263. package/dist/index37.cjs +1 -1
  264. package/dist/index37.js +170 -25
  265. package/dist/index38.cjs +1 -1
  266. package/dist/index38.js +28 -154
  267. package/dist/index39.cjs +1 -1
  268. package/dist/index39.js +158 -33
  269. package/dist/index40.cjs +1 -1
  270. package/dist/index40.js +104 -45
  271. package/dist/index41.cjs +1 -1
  272. package/dist/index41.js +337 -140
  273. package/dist/index42.cjs +1 -1
  274. package/dist/index42.js +96 -124
  275. package/dist/index43.cjs +1 -1
  276. package/dist/index43.js +319 -23
  277. package/dist/index44.cjs +1 -1
  278. package/dist/index44.js +205 -81
  279. package/dist/index45.cjs +1 -1
  280. package/dist/index45.js +33 -220
  281. package/dist/index46.cjs +1 -1
  282. package/dist/index46.js +161 -163
  283. package/dist/index47.cjs +1 -1
  284. package/dist/index47.js +20 -125
  285. package/dist/index48.cjs +1 -1
  286. package/dist/index48.js +24 -14
  287. package/dist/index49.cjs +1 -1
  288. package/dist/index49.js +167 -7
  289. package/dist/index5.js +26 -14
  290. package/dist/index50.cjs +1 -1
  291. package/dist/index50.js +44 -15
  292. package/dist/index51.cjs +1 -1
  293. package/dist/index51.js +15 -18
  294. package/dist/index52.cjs +1 -1
  295. package/dist/index52.js +3 -17
  296. package/dist/index53.cjs +1 -1
  297. package/dist/index53.js +5 -5
  298. package/dist/index54.cjs +1 -1
  299. package/dist/index54.js +19 -4
  300. package/dist/index55.cjs +1 -1
  301. package/dist/index55.js +24 -6
  302. package/dist/index56.cjs +1 -1
  303. package/dist/index56.js +66 -4
  304. package/dist/index57.cjs +1 -1
  305. package/dist/index57.js +14 -5
  306. package/dist/index58.cjs +1 -1
  307. package/dist/index58.js +4 -8
  308. package/dist/index59.cjs +1 -1
  309. package/dist/index59.js +50 -67
  310. package/dist/index6.cjs +1 -1
  311. package/dist/index6.js +85 -46
  312. package/dist/index60.cjs +1 -1
  313. package/dist/index60.js +6 -10
  314. package/dist/index61.cjs +1 -1
  315. package/dist/index61.js +25 -199
  316. package/dist/index62.cjs +1 -1
  317. package/dist/index62.js +13 -122
  318. package/dist/index63.cjs +1 -1
  319. package/dist/index63.js +9 -30
  320. package/dist/index64.cjs +1 -1
  321. package/dist/index64.js +3 -20
  322. package/dist/index65.cjs +1 -1
  323. package/dist/index65.js +24 -66
  324. package/dist/index66.cjs +1 -1
  325. package/dist/index66.js +68 -30
  326. package/dist/index67.cjs +38 -1
  327. package/dist/index67.js +3 -11
  328. package/dist/index68.cjs +1 -1
  329. package/dist/index68.js +12 -279
  330. package/dist/index69.cjs +1 -1
  331. package/dist/index69.js +50 -155
  332. package/dist/index7.cjs +1 -1
  333. package/dist/index7.js +29 -85
  334. package/dist/index70.cjs +1 -1
  335. package/dist/index70.js +115 -19
  336. package/dist/index71.cjs +4 -1
  337. package/dist/index71.js +6 -9
  338. package/dist/index72.cjs +1 -1
  339. package/dist/index72.js +12 -12
  340. package/dist/index73.cjs +1 -1
  341. package/dist/index73.js +539 -6
  342. package/dist/index74.cjs +1 -1
  343. package/dist/index74.js +197 -6
  344. package/dist/index75.cjs +1 -1
  345. package/dist/index75.js +120 -9
  346. package/dist/index76.cjs +1 -1
  347. package/dist/index76.js +912 -8
  348. package/dist/index77.cjs +3 -1
  349. package/dist/index77.js +76 -4
  350. package/dist/index78.cjs +1 -1
  351. package/dist/index78.js +120 -6
  352. package/dist/index79.cjs +1 -1
  353. package/dist/index79.js +12 -6
  354. package/dist/index8.cjs +1 -1
  355. package/dist/index8.js +35 -62
  356. package/dist/index80.cjs +1 -1
  357. package/dist/index80.js +14 -8
  358. package/dist/index81.cjs +1 -1
  359. package/dist/index81.js +113 -9
  360. package/dist/index82.cjs +1 -1
  361. package/dist/index82.js +725 -13
  362. package/dist/index83.cjs +1 -1
  363. package/dist/index83.js +346 -9
  364. package/dist/index84.cjs +1 -1
  365. package/dist/index84.js +74 -9
  366. package/dist/index85.cjs +1 -1
  367. package/dist/index85.js +148 -4
  368. package/dist/index86.cjs +1 -1
  369. package/dist/index86.js +31 -42
  370. package/dist/index87.cjs +1 -1
  371. package/dist/index87.js +12 -380
  372. package/dist/index88.cjs +1 -1
  373. package/dist/index88.js +345 -37
  374. package/dist/index89.cjs +20 -1
  375. package/dist/index89.js +40 -18
  376. package/dist/index9.cjs +1 -1
  377. package/dist/index9.js +85 -17
  378. package/dist/index90.cjs +1 -1
  379. package/dist/index90.js +113 -56
  380. package/dist/index91.cjs +1 -1
  381. package/dist/index91.js +272 -51
  382. package/dist/index92.cjs +1 -1
  383. package/dist/index92.js +129 -50
  384. package/dist/index93.cjs +1 -1
  385. package/dist/index93.js +13 -54
  386. package/dist/index94.cjs +1 -1
  387. package/dist/index94.js +28 -55
  388. package/dist/index95.cjs +1 -1
  389. package/dist/index95.js +525 -80
  390. package/dist/index96.cjs +1 -1
  391. package/dist/index96.js +75 -61
  392. package/dist/index97.cjs +1 -1
  393. package/dist/index97.js +67 -583
  394. package/dist/index98.cjs +1 -9
  395. package/dist/index98.js +32 -27
  396. package/dist/index99.cjs +1 -1
  397. package/dist/index99.js +17 -49
  398. package/dist/ui/alert-dialog.d.ts +15 -0
  399. package/dist/ui/alert-dialog.d.ts.map +1 -0
  400. package/dist/ui/alert.d.ts +10 -0
  401. package/dist/ui/alert.d.ts.map +1 -0
  402. package/dist/ui/aspect-ratio.d.ts +4 -0
  403. package/dist/ui/aspect-ratio.d.ts.map +1 -0
  404. package/dist/ui/avatar.d.ts +7 -0
  405. package/dist/ui/avatar.d.ts.map +1 -0
  406. package/dist/ui/badge.d.ts +1 -1
  407. package/dist/ui/breadcrumb.d.ts +12 -0
  408. package/dist/ui/breadcrumb.d.ts.map +1 -0
  409. package/dist/ui/button.d.ts +1 -1
  410. package/dist/ui/carousel.d.ts +20 -0
  411. package/dist/ui/carousel.d.ts.map +1 -0
  412. package/dist/ui/collapsible.d.ts +6 -0
  413. package/dist/ui/collapsible.d.ts.map +1 -0
  414. package/dist/ui/context-menu.d.ts +26 -0
  415. package/dist/ui/context-menu.d.ts.map +1 -0
  416. package/dist/ui/drawer.d.ts +14 -0
  417. package/dist/ui/drawer.d.ts.map +1 -0
  418. package/dist/ui/hover-card.d.ts +7 -0
  419. package/dist/ui/hover-card.d.ts.map +1 -0
  420. package/dist/ui/index.d.ts +23 -0
  421. package/dist/ui/index.d.ts.map +1 -1
  422. package/dist/ui/input-otp.d.ts +12 -0
  423. package/dist/ui/input-otp.d.ts.map +1 -0
  424. package/dist/ui/menubar.d.ts +27 -0
  425. package/dist/ui/menubar.d.ts.map +1 -0
  426. package/dist/ui/navigation-menu.d.ts +15 -0
  427. package/dist/ui/navigation-menu.d.ts.map +1 -0
  428. package/dist/ui/pagination.d.ts +14 -0
  429. package/dist/ui/pagination.d.ts.map +1 -0
  430. package/dist/ui/resizable.d.ts +9 -0
  431. package/dist/ui/resizable.d.ts.map +1 -0
  432. package/dist/ui/sheet.d.ts +14 -0
  433. package/dist/ui/sheet.d.ts.map +1 -0
  434. package/dist/ui/sidebar.d.ts +70 -0
  435. package/dist/ui/sidebar.d.ts.map +1 -0
  436. package/dist/ui/skeleton.d.ts +3 -0
  437. package/dist/ui/skeleton.d.ts.map +1 -0
  438. package/dist/ui/slider.d.ts +5 -0
  439. package/dist/ui/slider.d.ts.map +1 -0
  440. package/dist/ui/switch.d.ts +5 -0
  441. package/dist/ui/switch.d.ts.map +1 -0
  442. package/dist/ui/tabs.d.ts +8 -0
  443. package/dist/ui/tabs.d.ts.map +1 -0
  444. package/dist/ui/toggle-group.d.ts +8 -0
  445. package/dist/ui/toggle-group.d.ts.map +1 -0
  446. package/dist/ui/toggle.d.ts +10 -0
  447. package/dist/ui/toggle.d.ts.map +1 -0
  448. package/package.json +23 -5
package/dist/index46.js CHANGED
@@ -1,166 +1,164 @@
1
- import { arraysEqual as e, buildAllOptions as t, buildBadgeAnimationClass as n, buildPopoverAnimationClass as r, buildWidthConstraints as i, computeResponsiveSettings as ee, countMatchingOptions as a, filterOptions as te } from "./index44.js";
2
- import { useCallback as o, useEffect as s, useId as ne, useImperativeHandle as re, useMemo as c, useRef as l, useState as u } from "react";
3
- //#region src/MultiSelect/useMultiSelect.ts
4
- var d = ({ forwardedRef: d, ...f }) => {
5
- let { options: p, onValueChange: m, defaultValue: h = [], animationConfig: g, maxCount: _ = 3, responsive: v, minWidth: y, maxWidth: b, deduplicateOptions: x = !1, resetOnDefaultValueChange: S = !0, closeOnSelect: C = !1, searchable: w = !0, autoSize: T = !1, disabled: E = !1 } = f, [D, O] = u(h), [k, A] = u(!1), [j, M] = u(!1), [N, P] = u(""), [F, ie] = u("desktop"), [I, L] = u(""), [ae, R] = u(""), z = l(D.length), B = l(k), V = l(N), H = ne(), U = `${H}-listbox`, W = `${H}-description`, G = `${H}-count`, K = l(h), q = l(null), J = o((e, t = "polite") => {
6
- t === "assertive" ? (R(e), setTimeout(() => R(""), 100)) : (L(e), setTimeout(() => L(""), 100));
7
- }, []), Y = o(() => {
8
- let { options: e, duplicates: n } = t(p, x);
9
- return e;
10
- }, [x, p]), X = o((e) => Y().find((t) => t.value === e), [Y]), oe = c(() => te(p, N, w), [
11
- p,
12
- N,
13
- w
14
- ]), se = (e) => {
15
- if (!E) {
16
- if (e.key === "Enter") A(!0);
17
- else if (e.key === "Backspace" && !e.currentTarget.value) {
18
- let e = [...D];
19
- e.pop(), O(e), m(e);
1
+ "use client";
2
+ import { createContextScope as e } from "./index6.js";
3
+ import { useComposedRefs as t } from "./index7.js";
4
+ import { Primitive as n } from "./index12.js";
5
+ import { useCallbackRef as r } from "./index15.js";
6
+ import { useLayoutEffect2 as i } from "./index16.js";
7
+ import { autoUpdate as a } from "./index43.js";
8
+ import { arrow as o, flip as s, hide as c, limitShift as l, offset as u, shift as d, size as f, useFloating as p } from "./index44.js";
9
+ import { useSize as m } from "./index45.js";
10
+ import * as h from "react";
11
+ import { jsx as g } from "react/jsx-runtime";
12
+ //#region ../../node_modules/.pnpm/@radix-ui+react-popper@1.3.7_@types+react-dom@19.2.3_@types+react@19.2.17__@types+react_4e5bda27561956783247cbf95bf4739f/node_modules/@radix-ui/react-popper/dist/index.mjs
13
+ var _ = Object.defineProperty, v = (e, t) => _(e, "name", {
14
+ value: t,
15
+ configurable: !0
16
+ }), y = "Popper", [b, x] = e(y), [S, C] = b(y), w = /* @__PURE__ */ v((e) => {
17
+ let { __scopePopper: t, children: n } = e, [r, i] = h.useState(null), [a, o] = h.useState(void 0);
18
+ return /* @__PURE__ */ g(S, {
19
+ scope: t,
20
+ anchor: r,
21
+ onAnchorChange: i,
22
+ placementState: a,
23
+ setPlacementState: o,
24
+ children: n
25
+ });
26
+ }, "Popper"), T = "PopperAnchor", E = /* @__PURE__ */ h.forwardRef(/* @__PURE__ */ v(function(e, r) {
27
+ let { __scopePopper: i, virtualRef: a, ...o } = e, s = C(T, i), c = h.useRef(null), l = s.onAnchorChange, u = t(r, h.useCallback((e) => {
28
+ c.current = e, e && l(e);
29
+ }, [l])), d = h.useRef(null);
30
+ h.useEffect(() => {
31
+ if (!a) return;
32
+ let e = d.current;
33
+ d.current = a.current, e !== d.current && l(d.current);
34
+ });
35
+ let f = s.placementState && M(s.placementState), p = f?.[0], m = f?.[1];
36
+ return a ? null : /* @__PURE__ */ g(n.div, {
37
+ "data-radix-popper-side": p,
38
+ "data-radix-popper-align": m,
39
+ ...o,
40
+ ref: u
41
+ });
42
+ }, "PopperAnchor")), D = "PopperContent", [O, k] = b(D), A = /* @__PURE__ */ h.forwardRef(/* @__PURE__ */ v(function(e, _) {
43
+ let { __scopePopper: y, side: b = "bottom", sideOffset: x = 0, align: S = "center", alignOffset: w = 0, arrowPadding: T = 0, avoidCollisions: E = !0, collisionBoundary: k = [], collisionPadding: A = 0, sticky: N = "partial", hideWhenDetached: P = !1, updatePositionStrategy: F = "optimized", onPlaced: te, ...I } = e, L = C(D, y), [R, ne] = h.useState(null), re = t(_, ne), [z, ie] = h.useState(null), B = m(z), ae = B?.width ?? 0, V = B?.height ?? 0, oe = b + (S === "center" ? "" : "-" + S), se = typeof A == "number" ? A : {
44
+ top: 0,
45
+ right: 0,
46
+ bottom: 0,
47
+ left: 0,
48
+ ...A
49
+ }, H = Array.isArray(k) ? k : [k], U = H.length > 0, W = {
50
+ padding: se,
51
+ boundary: H.filter(j),
52
+ altBoundary: U
53
+ }, { refs: G, floatingStyles: K, placement: q, isPositioned: J, middlewareData: Y } = p({
54
+ strategy: "fixed",
55
+ placement: oe,
56
+ whileElementsMounted: /* @__PURE__ */ v((...e) => a(...e, { animationFrame: F === "always" }), "whileElementsMounted"),
57
+ elements: { reference: L.anchor },
58
+ middleware: [
59
+ u({
60
+ mainAxis: x + V,
61
+ alignmentAxis: w
62
+ }),
63
+ E && d({
64
+ mainAxis: !0,
65
+ crossAxis: !1,
66
+ limiter: N === "partial" ? l() : void 0,
67
+ ...W
68
+ }),
69
+ E && s({ ...W }),
70
+ f({
71
+ ...W,
72
+ apply: /* @__PURE__ */ v(({ elements: e, rects: t, availableWidth: n, availableHeight: r }) => {
73
+ let { width: i, height: a } = t.reference, o = e.floating.style;
74
+ o.setProperty("--radix-popper-available-width", `${n}px`), o.setProperty("--radix-popper-available-height", `${r}px`), o.setProperty("--radix-popper-anchor-width", `${i}px`), o.setProperty("--radix-popper-anchor-height", `${a}px`);
75
+ }, "apply")
76
+ }),
77
+ z && o({
78
+ element: z,
79
+ padding: T
80
+ }),
81
+ ee({
82
+ arrowWidth: ae,
83
+ arrowHeight: V
84
+ }),
85
+ P && c({
86
+ strategy: "referenceHidden",
87
+ ...W,
88
+ boundary: U ? W.boundary : void 0
89
+ })
90
+ ]
91
+ }), X = L.setPlacementState;
92
+ i(() => (X(q), () => {
93
+ X(void 0);
94
+ }), [q, X]);
95
+ let [Z, Q] = M(q), $ = r(te);
96
+ i(() => {
97
+ J && $?.();
98
+ }, [J, $]);
99
+ let ce = Y.arrow?.x, le = Y.arrow?.y, ue = Y.arrow?.centerOffset !== 0, [de, fe] = h.useState();
100
+ return i(() => {
101
+ R && fe(window.getComputedStyle(R).zIndex);
102
+ }, [R]), /* @__PURE__ */ g("div", {
103
+ ref: G.setFloating,
104
+ "data-radix-popper-content-wrapper": "",
105
+ style: {
106
+ ...K,
107
+ transform: J ? K.transform : "translate(0, -200%)",
108
+ minWidth: "max-content",
109
+ zIndex: de,
110
+ "--radix-popper-transform-origin": [Y.transformOrigin?.x, Y.transformOrigin?.y].join(" "),
111
+ ...Y.hide?.referenceHidden && {
112
+ visibility: "hidden",
113
+ pointerEvents: "none"
20
114
  }
21
- }
22
- }, ce = (e) => {
23
- if (E || X(e)?.disabled) return;
24
- let t = D.includes(e) ? D.filter((t) => t !== e) : [...D, e];
25
- O(t), m(t), C && A(!1);
26
- }, Z = () => {
27
- E || (O([]), m([]));
28
- }, Q = () => {
29
- E || A((e) => !e);
30
- }, $ = c(() => ee(v, _, F), [
31
- v,
32
- _,
33
- F
34
- ]), le = () => {
35
- if (E) return;
36
- let e = D.slice(0, $.maxCount);
37
- O(e), m(e);
38
- }, ue = () => {
39
- if (E) return;
40
- let e = Y().filter((e) => !e.disabled);
41
- if (D.length === e.length) Z();
42
- else {
43
- let t = e.map((e) => e.value);
44
- O(t), m(t);
45
- }
46
- C && A(!1);
47
- }, de = c(() => i(F, T, y, b), [
48
- T,
49
- b,
50
- y,
51
- F
52
- ]);
53
- s(() => {
54
- if (!S) return;
55
- let t = K.current;
56
- e(t, h) || (e(D, h) || O(h), K.current = [...h]);
57
- }, [
58
- e,
59
- h,
60
- S,
61
- D
62
- ]), s(() => {
63
- k || P("");
64
- }, [k]), s(() => {
65
- let e = D.length, t = Y(), n = t.filter((e) => !e.disabled).length;
66
- if (e !== z.current) {
67
- let r = e - z.current;
68
- if (r > 0) {
69
- let i = D.slice(-r).map((e) => t.find((t) => t.value === e)?.label).filter(Boolean);
70
- i.length === 1 ? J(`${i[0]} selected. ${e} of ${n} options selected.`) : J(`${i.length} options selected. ${e} of ${n} total selected.`);
71
- } else r < 0 && J(`Option removed. ${e} of ${n} options selected.`);
72
- z.current = e;
73
- }
74
- if (k !== B.current && (J(k ? `Dropdown opened. ${n} options available. Use arrow keys to navigate.` : "Dropdown closed."), B.current = k), N !== V.current && N !== void 0) {
75
- if (N && k) {
76
- let e = a(t, N);
77
- J(`${e} option${e === 1 ? "" : "s"} found for "${N}"`);
78
- }
79
- V.current = N;
80
- }
81
- }, [
82
- J,
83
- a,
84
- Y,
85
- k,
86
- N,
87
- D
88
- ]), s(() => {
89
- if (typeof window > "u") return;
90
- let e = () => {
91
- let e = window.innerWidth;
92
- ie(e < 640 ? "mobile" : e < 1024 ? "tablet" : "desktop");
93
- };
94
- return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
95
- }, []);
96
- let fe = c(() => n(j, g), [g, j]), pe = c(() => r(g), [g]);
97
- return re(d, () => ({
98
- reset: () => {
99
- O(h), A(!1), P(""), m(h);
100
- },
101
- getSelectedValues: () => D,
102
- setSelectedValues: (e) => {
103
- O(e), m(e);
104
- },
105
- clear: () => {
106
- O([]), m([]);
107
- },
108
- focus: () => {
109
- if (q.current) {
110
- q.current.focus();
111
- let e = q.current.style.outline, t = q.current.style.outlineOffset;
112
- q.current.style.outline = "2px solid hsl(var(--ring))", q.current.style.outlineOffset = "2px", setTimeout(() => {
113
- q.current && (q.current.style.outline = e, q.current.style.outlineOffset = t);
114
- }, 1e3);
115
- }
116
- }
117
- }), [
118
- h,
119
- d,
120
- m,
121
- D
122
- ]), {
123
- ids: {
124
- multiSelectId: H,
125
- listboxId: U,
126
- triggerDescriptionId: W,
127
- selectedCountId: G
128
- },
129
- state: {
130
- selectedValues: D,
131
- isPopoverOpen: k,
132
- isAnimating: j,
133
- searchValue: N,
134
- screenSize: F
135
- },
136
- derived: {
137
- filteredOptions: oe,
138
- responsiveSettings: $,
139
- widthConstraints: de,
140
- badgeAnimationClass: fe,
141
- popoverAnimationClass: pe
142
- },
143
- refs: { buttonRef: q },
144
- helpers: {
145
- getAllOptions: Y,
146
- getOptionByValue: X
147
- },
148
- a11yMessages: {
149
- politeMessage: I,
150
- assertiveMessage: ae
151
115
  },
152
- handlers: {
153
- setIsPopoverOpen: A,
154
- handleTogglePopover: Q,
155
- handleInputKeyDown: se,
156
- toggleOption: ce,
157
- handleClear: Z,
158
- clearExtraOptions: le,
159
- toggleAll: ue,
160
- setSearchValue: P,
161
- setIsAnimating: M
162
- }
163
- };
164
- };
116
+ dir: e.dir,
117
+ children: /* @__PURE__ */ g(O, {
118
+ scope: y,
119
+ placedSide: Z,
120
+ placedAlign: Q,
121
+ onArrowChange: ie,
122
+ arrowX: ce,
123
+ arrowY: le,
124
+ shouldHideArrow: ue,
125
+ children: /* @__PURE__ */ g(n.div, {
126
+ "data-side": Z,
127
+ "data-align": Q,
128
+ ...I,
129
+ ref: re,
130
+ style: {
131
+ ...I.style,
132
+ animation: J ? I.style?.animation : "none"
133
+ }
134
+ })
135
+ })
136
+ });
137
+ }, "PopperContent"));
138
+ function j(e) {
139
+ return e !== null;
140
+ }
141
+ v(j, "isNotNull");
142
+ var ee = /* @__PURE__ */ v((e) => ({
143
+ name: "transformOrigin",
144
+ options: e,
145
+ fn(t) {
146
+ let { placement: n, rects: r, middlewareData: i } = t, a = i.arrow?.centerOffset !== 0, o = a ? 0 : e.arrowWidth, s = a ? 0 : e.arrowHeight, [c, l] = M(n), u = {
147
+ start: "0%",
148
+ center: "50%",
149
+ end: "100%"
150
+ }[l], d = (i.arrow?.x ?? 0) + o / 2, f = (i.arrow?.y ?? 0) + s / 2, p = "", m = "";
151
+ return c === "bottom" ? (p = a ? u : `${d}px`, m = `${-s}px`) : c === "top" ? (p = a ? u : `${d}px`, m = `${r.floating.height + s}px`) : c === "right" ? (p = `${-s}px`, m = a ? u : `${f}px`) : c === "left" && (p = `${r.floating.width + s}px`, m = a ? u : `${f}px`), { data: {
152
+ x: p,
153
+ y: m
154
+ } };
155
+ }
156
+ }), "transformOrigin");
157
+ function M(e) {
158
+ let [t, n = "center"] = e.split("-");
159
+ return [t, n];
160
+ }
161
+ v(M, "getSideAndAlignFromPlacement");
162
+ var N = w, P = E, F = A;
165
163
  //#endregion
166
- export { d as useMultiSelect };
164
+ export { P as Anchor, F as Content, N as Root2, x as createPopperScope };
package/dist/index47.cjs CHANGED
@@ -1 +1 @@
1
- const e=require("./index45.cjs");let t=require("react");var n=({forwardedRef:n,...r})=>{let{options:i,onValueChange:a,defaultValue:o=[],animationConfig:s,maxCount:c=3,responsive:l,minWidth:u,maxWidth:d,deduplicateOptions:f=!1,resetOnDefaultValueChange:p=!0,closeOnSelect:m=!1,searchable:h=!0,autoSize:g=!1,disabled:_=!1}=r,[v,y]=(0,t.useState)(o),[b,x]=(0,t.useState)(!1),[S,C]=(0,t.useState)(!1),[w,T]=(0,t.useState)(``),[E,D]=(0,t.useState)(`desktop`),[O,k]=(0,t.useState)(``),[A,j]=(0,t.useState)(``),M=(0,t.useRef)(v.length),N=(0,t.useRef)(b),P=(0,t.useRef)(w),F=(0,t.useId)(),I=`${F}-listbox`,L=`${F}-description`,R=`${F}-count`,z=(0,t.useRef)(o),B=(0,t.useRef)(null),V=(0,t.useCallback)((e,t=`polite`)=>{t===`assertive`?(j(e),setTimeout(()=>j(``),100)):(k(e),setTimeout(()=>k(``),100))},[]),H=(0,t.useCallback)(()=>{let{options:t,duplicates:n}=e.buildAllOptions(i,f);return t},[f,i]),U=(0,t.useCallback)(e=>H().find(t=>t.value===e),[H]),W=(0,t.useMemo)(()=>e.filterOptions(i,w,h),[i,w,h]),G=e=>{if(!_){if(e.key===`Enter`)x(!0);else if(e.key===`Backspace`&&!e.currentTarget.value){let e=[...v];e.pop(),y(e),a(e)}}},K=e=>{if(_||U(e)?.disabled)return;let t=v.includes(e)?v.filter(t=>t!==e):[...v,e];y(t),a(t),m&&x(!1)},q=()=>{_||(y([]),a([]))},J=()=>{_||x(e=>!e)},Y=(0,t.useMemo)(()=>e.computeResponsiveSettings(l,c,E),[l,c,E]),X=()=>{if(_)return;let e=v.slice(0,Y.maxCount);y(e),a(e)},Z=()=>{if(_)return;let e=H().filter(e=>!e.disabled);if(v.length===e.length)q();else{let t=e.map(e=>e.value);y(t),a(t)}m&&x(!1)},Q=(0,t.useMemo)(()=>e.buildWidthConstraints(E,g,u,d),[g,d,u,E]);(0,t.useEffect)(()=>{if(!p)return;let t=z.current;e.arraysEqual(t,o)||(e.arraysEqual(v,o)||y(o),z.current=[...o])},[e.arraysEqual,o,p,v]),(0,t.useEffect)(()=>{b||T(``)},[b]),(0,t.useEffect)(()=>{let t=v.length,n=H(),r=n.filter(e=>!e.disabled).length;if(t!==M.current){let e=t-M.current;if(e>0){let i=v.slice(-e).map(e=>n.find(t=>t.value===e)?.label).filter(Boolean);i.length===1?V(`${i[0]} selected. ${t} of ${r} options selected.`):V(`${i.length} options selected. ${t} of ${r} total selected.`)}else e<0&&V(`Option removed. ${t} of ${r} options selected.`);M.current=t}if(b!==N.current&&(V(b?`Dropdown opened. ${r} options available. Use arrow keys to navigate.`:`Dropdown closed.`),N.current=b),w!==P.current&&w!==void 0){if(w&&b){let t=e.countMatchingOptions(n,w);V(`${t} option${t===1?``:`s`} found for "${w}"`)}P.current=w}},[V,e.countMatchingOptions,H,b,w,v]),(0,t.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>{let e=window.innerWidth;D(e<640?`mobile`:e<1024?`tablet`:`desktop`)};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let $=(0,t.useMemo)(()=>e.buildBadgeAnimationClass(S,s),[s,S]),ee=(0,t.useMemo)(()=>e.buildPopoverAnimationClass(s),[s]);return(0,t.useImperativeHandle)(n,()=>({reset:()=>{y(o),x(!1),T(``),a(o)},getSelectedValues:()=>v,setSelectedValues:e=>{y(e),a(e)},clear:()=>{y([]),a([])},focus:()=>{if(B.current){B.current.focus();let e=B.current.style.outline,t=B.current.style.outlineOffset;B.current.style.outline=`2px solid hsl(var(--ring))`,B.current.style.outlineOffset=`2px`,setTimeout(()=>{B.current&&(B.current.style.outline=e,B.current.style.outlineOffset=t)},1e3)}}}),[o,n,a,v]),{ids:{multiSelectId:F,listboxId:I,triggerDescriptionId:L,selectedCountId:R},state:{selectedValues:v,isPopoverOpen:b,isAnimating:S,searchValue:w,screenSize:E},derived:{filteredOptions:W,responsiveSettings:Y,widthConstraints:Q,badgeAnimationClass:$,popoverAnimationClass:ee},refs:{buttonRef:B},helpers:{getAllOptions:H,getOptionByValue:U},a11yMessages:{politeMessage:O,assertiveMessage:A},handlers:{setIsPopoverOpen:x,handleTogglePopover:J,handleInputKeyDown:G,toggleOption:K,handleClear:q,clearExtraOptions:X,toggleAll:Z,setSearchValue:T,setIsAnimating:C}}};exports.useMultiSelect=n;
1
+ "use client";const e=require("./index2.cjs"),t=require("./index7.cjs"),n=require("./index8.cjs"),r=require("./index13.cjs"),i=require("./index16.cjs"),a=require("./index17.cjs"),o=require("./index44.cjs"),s=require("./index45.cjs"),c=require("./index46.cjs");let l=require("react");l=e.__toESM(l,1);let u=require("react/jsx-runtime");var d=Object.defineProperty,f=(e,t)=>d(e,`name`,{value:t,configurable:!0}),p=`Popper`,[m,h]=t.createContextScope(p),[g,_]=m(p),v=f(e=>{let{__scopePopper:t,children:n}=e,[r,i]=l.useState(null),[a,o]=l.useState(void 0);return(0,u.jsx)(g,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),y=`PopperAnchor`,b=l.forwardRef(f(function(e,t){let{__scopePopper:i,virtualRef:a,...o}=e,s=_(y,i),c=l.useRef(null),d=s.onAnchorChange,f=n.useComposedRefs(t,l.useCallback(e=>{c.current=e,e&&d(e)},[d])),p=l.useRef(null);l.useEffect(()=>{if(!a)return;let e=p.current;p.current=a.current,e!==p.current&&d(p.current)});let m=s.placementState&&E(s.placementState),h=m?.[0],g=m?.[1];return a?null:(0,u.jsx)(r.Primitive.div,{"data-radix-popper-side":h,"data-radix-popper-align":g,...o,ref:f})},`PopperAnchor`)),x=`PopperContent`,[ee,S]=m(x),C=l.forwardRef(f(function(e,t){let{__scopePopper:d,side:p=`bottom`,sideOffset:m=0,align:h=`center`,alignOffset:g=0,arrowPadding:v=0,avoidCollisions:y=!0,collisionBoundary:b=[],collisionPadding:S=0,sticky:C=`partial`,hideWhenDetached:D=!1,updatePositionStrategy:O=`optimized`,onPlaced:k,...A}=e,j=_(x,d),[M,N]=l.useState(null),P=n.useComposedRefs(t,N),[F,I]=l.useState(null),L=c.useSize(F),R=L?.width??0,z=L?.height??0,B=p+(h===`center`?``:`-`+h),V=typeof S==`number`?S:{top:0,right:0,bottom:0,left:0,...S},H=Array.isArray(b)?b:[b],U=H.length>0,W={padding:V,boundary:H.filter(w),altBoundary:U},{refs:G,floatingStyles:K,placement:q,isPositioned:J,middlewareData:Y}=s.useFloating({strategy:`fixed`,placement:B,whileElementsMounted:f((...e)=>o.autoUpdate(...e,{animationFrame:O===`always`}),`whileElementsMounted`),elements:{reference:j.anchor},middleware:[s.offset({mainAxis:m+z,alignmentAxis:g}),y&&s.shift({mainAxis:!0,crossAxis:!1,limiter:C===`partial`?s.limitShift():void 0,...W}),y&&s.flip({...W}),s.size({...W,apply:f(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),F&&s.arrow({element:F,padding:v}),T({arrowWidth:R,arrowHeight:z}),D&&s.hide({strategy:`referenceHidden`,...W,boundary:U?W.boundary:void 0})]}),X=j.setPlacementState;a.useLayoutEffect2(()=>(X(q),()=>{X(void 0)}),[q,X]);let[Z,Q]=E(q),$=i.useCallbackRef(k);a.useLayoutEffect2(()=>{J&&$?.()},[J,$]);let te=Y.arrow?.x,ne=Y.arrow?.y,re=Y.arrow?.centerOffset!==0,[ie,ae]=l.useState();return a.useLayoutEffect2(()=>{M&&ae(window.getComputedStyle(M).zIndex)},[M]),(0,u.jsx)(`div`,{ref:G.setFloating,"data-radix-popper-content-wrapper":``,style:{...K,transform:J?K.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ie,"--radix-popper-transform-origin":[Y.transformOrigin?.x,Y.transformOrigin?.y].join(` `),...Y.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,u.jsx)(ee,{scope:d,placedSide:Z,placedAlign:Q,onArrowChange:I,arrowX:te,arrowY:ne,shouldHideArrow:re,children:(0,u.jsx)(r.Primitive.div,{"data-side":Z,"data-align":Q,...A,ref:P,style:{...A.style,animation:J?A.style?.animation:`none`}})})})},`PopperContent`));function w(e){return e!==null}f(w,`isNotNull`);var T=f(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=E(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function E(e){let[t,n=`center`]=e.split(`-`);return[t,n]}f(E,`getSideAndAlignFromPlacement`);var D=v,O=b,k=C;exports.Anchor=O,exports.Content=k,exports.Root2=D,exports.createPopperScope=h;
package/dist/index47.js CHANGED
@@ -1,126 +1,21 @@
1
- import { cn as e } from "./index3.js";
2
- import { Button as t } from "./index6.js";
3
- import { Popover as n, PopoverContent as ee, PopoverTrigger as r } from "./index21.js";
4
- import { Icons as te } from "./index41.js";
5
- import { LiveRegion as ne, OptionsContent as re, PlaceholderContent as i, SelectedValuesContent as a } from "./index45.js";
6
- import { useMultiSelect as o } from "./index46.js";
7
- import "react";
8
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
9
- //#region src/MultiSelect/MultiSelect.tsx
10
- var u = ({ options: u, onValueChange: d, variant: f, defaultValue: p = [], value: m, placeholder: h = "Select options", animation: g = 0, animationConfig: _, maxCount: ie = 3, modalPopover: ae = !1, className: v, hideSelectAll: y = !1, searchable: b = !0, emptyIndicator: x, autoSize: S = !1, singleLine: C = !1, popoverClassName: w, disabled: T = !1, responsive: E, minWidth: D, maxWidth: O, deduplicateOptions: k = !1, resetOnDefaultValueChange: A = !0, closeOnSelect: j = !1, ref: M, ...N }) => {
11
- let { ids: P, state: F, derived: I, refs: L, helpers: R, a11yMessages: z, handlers: B } = o({
12
- options: u,
13
- onValueChange: d,
14
- defaultValue: m || p,
15
- animation: g,
16
- animationConfig: _,
17
- maxCount: ie,
18
- responsive: E,
19
- minWidth: D,
20
- maxWidth: O,
21
- deduplicateOptions: k,
22
- resetOnDefaultValueChange: A,
23
- closeOnSelect: j,
24
- searchable: b,
25
- autoSize: S,
26
- disabled: T,
27
- forwardedRef: M
28
- }), { selectedValues: V, isPopoverOpen: H, isAnimating: U, searchValue: W, screenSize: G } = F, { filteredOptions: K, responsiveSettings: q, widthConstraints: J, badgeAnimationClass: oe, popoverAnimationClass: se } = I, { buttonRef: ce } = L, { getAllOptions: Y, getOptionByValue: X } = R, { politeMessage: le, assertiveMessage: ue } = z, { setIsPopoverOpen: Z, handleTogglePopover: de, handleInputKeyDown: fe, toggleOption: Q, handleClear: $, clearExtraOptions: pe, toggleAll: me, setSearchValue: he, setIsAnimating: ge } = B, _e = (e) => {
29
- T || Z(e);
30
- }, ve = `Multi-select: ${V.length} of ${Y().length} options selected. ${h}`;
31
- return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(ne, {
32
- politeMessage: le,
33
- assertiveMessage: ue
34
- }), /* @__PURE__ */ l(n, {
35
- open: H,
36
- onOpenChange: _e,
37
- modal: ae,
38
- children: [
39
- /* @__PURE__ */ c("div", {
40
- id: P.triggerDescriptionId,
41
- className: "sr-only",
42
- children: "Multi-select dropdown. Use arrow keys to navigate, Enter to select, and Escape to close."
43
- }),
44
- /* @__PURE__ */ c("div", {
45
- id: P.selectedCountId,
46
- className: "sr-only",
47
- "aria-live": "polite",
48
- children: V.length === 0 ? "No options selected" : `${V.length} option${V.length === 1 ? "" : "s"} selected: ${V.map((e) => X(e)?.label).filter(Boolean).join(", ")}`
49
- }),
50
- /* @__PURE__ */ c(r, {
51
- asChild: !0,
52
- children: /* @__PURE__ */ c(t, {
53
- ref: ce,
54
- ...N,
55
- onClick: de,
56
- disabled: T,
57
- role: "combobox",
58
- "aria-expanded": H,
59
- "aria-haspopup": "listbox",
60
- "aria-controls": H ? P.listboxId : void 0,
61
- "aria-describedby": `${P.triggerDescriptionId} ${P.selectedCountId}`,
62
- "aria-label": ve,
63
- className: e("flex p-1 rounded-md border min-h-10 h-auto items-center justify-between bg-inherit hover:bg-inherit [&_svg]:pointer-events-auto", S ? "w-auto" : "w-full", q.compactMode && "min-h-8 text-sm", G === "mobile" && "min-h-12 text-base", T && "opacity-50 cursor-not-allowed", v),
64
- style: {
65
- ...J,
66
- maxWidth: `min(${J.maxWidth}, 100%)`
67
- },
68
- children: V.length > 0 ? /* @__PURE__ */ c(a, {
69
- selectedValues: V,
70
- responsiveSettings: q,
71
- screenSize: G,
72
- singleLine: C,
73
- animation: g,
74
- animationConfig: _,
75
- badgeAnimationClass: oe,
76
- variant: f,
77
- getOptionByValue: X,
78
- toggleOption: Q,
79
- clearExtraOptions: pe,
80
- handleClear: $
81
- }) : /* @__PURE__ */ c(i, { placeholder: h })
82
- })
83
- }),
84
- /* @__PURE__ */ c(ee, {
85
- id: P.listboxId,
86
- role: "listbox",
87
- "aria-multiselectable": "true",
88
- "aria-label": "Available options",
89
- className: e("w-auto p-0", se, G === "mobile" && "w-[85vw] max-w-70", G === "tablet" && "w-[70vw] max-w-md", G === "desktop" && "min-w-75", w),
90
- style: {
91
- animationDuration: `${_?.duration || g}s`,
92
- animationDelay: `${_?.delay || 0}s`,
93
- maxWidth: `min(${J.maxWidth}, 85vw)`,
94
- maxHeight: G === "mobile" ? "70vh" : "60vh",
95
- touchAction: "manipulation"
96
- },
97
- align: "start",
98
- onEscapeKeyDown: () => Z(!1),
99
- children: /* @__PURE__ */ c(re, {
100
- filteredOptions: K,
101
- hideSelectAll: y,
102
- searchValue: W,
103
- searchable: b,
104
- selectedValues: V,
105
- getAllOptions: Y,
106
- toggleAll: me,
107
- toggleOption: Q,
108
- handleClear: $,
109
- setIsPopoverOpen: Z,
110
- handleInputKeyDown: fe,
111
- setSearchValue: he,
112
- multiSelectId: P.multiSelectId,
113
- emptyIndicator: x,
114
- screenSize: G
115
- })
116
- }),
117
- g > 0 && V.length > 0 && /* @__PURE__ */ c(te.WandSparkles, {
118
- className: e("cursor-pointer my-2 text-foreground bg-background w-3 h-3", U ? "" : "text-muted-foreground"),
119
- onClick: () => ge(!U)
120
- })
121
- ]
122
- })] });
123
- };
124
- u.displayName = "MultiSelect";
1
+ "use client";
2
+ import { Primitive as e } from "./index12.js";
3
+ import { useLayoutEffect2 as t } from "./index16.js";
4
+ import * as n from "react";
5
+ import { jsx as r } from "react/jsx-runtime";
6
+ import * as i from "react-dom";
7
+ //#region ../../node_modules/.pnpm/@radix-ui+react-portal@1.1.17_@types+react-dom@19.2.3_@types+react@19.2.17__@types+reac_17de5f572cef13944a3e44b7d1e8f104/node_modules/@radix-ui/react-portal/dist/index.mjs
8
+ var a = Object.defineProperty, o = /* @__PURE__ */ n.forwardRef(/* @__PURE__ */ ((e, t) => a(e, "name", {
9
+ value: t,
10
+ configurable: !0
11
+ }))(function(a, o) {
12
+ let { container: s, ...c } = a, [l, u] = n.useState(!1);
13
+ t(() => u(!0), []);
14
+ let d = s || l && globalThis?.document?.body;
15
+ return d ? i.createPortal(/* @__PURE__ */ r(e.div, {
16
+ ...c,
17
+ ref: o
18
+ }), d) : null;
19
+ }, "Portal"));
125
20
  //#endregion
126
- export { u as default };
21
+ export { o as Portal };
package/dist/index48.cjs CHANGED
@@ -1 +1 @@
1
- const e=require("./index4.cjs"),t=require("./index7.cjs"),n=require("./index22.cjs"),r=require("./index42.cjs"),i=require("./index46.cjs"),a=require("./index47.cjs");require("react");let o=require("react/jsx-runtime");var s=({options:s,onValueChange:c,variant:l,defaultValue:ee=[],value:te,placeholder:u=`Select options`,animation:d=0,animationConfig:f,maxCount:p=3,modalPopover:ne=!1,className:m,hideSelectAll:h=!1,searchable:g=!0,emptyIndicator:_,autoSize:v=!1,singleLine:re=!1,popoverClassName:ie,disabled:y=!1,responsive:b,minWidth:x,maxWidth:S,deduplicateOptions:C=!1,resetOnDefaultValueChange:w=!0,closeOnSelect:T=!1,ref:E,...D})=>{let{ids:O,state:k,derived:A,refs:j,helpers:M,a11yMessages:N,handlers:P}=a.useMultiSelect({options:s,onValueChange:c,defaultValue:te||ee,animation:d,animationConfig:f,maxCount:p,responsive:b,minWidth:x,maxWidth:S,deduplicateOptions:C,resetOnDefaultValueChange:w,closeOnSelect:T,searchable:g,autoSize:v,disabled:y,forwardedRef:E}),{selectedValues:F,isPopoverOpen:I,isAnimating:L,searchValue:R,screenSize:z}=k,{filteredOptions:B,responsiveSettings:V,widthConstraints:H,badgeAnimationClass:U,popoverAnimationClass:W}=A,{buttonRef:G}=j,{getAllOptions:K,getOptionByValue:q}=M,{politeMessage:J,assertiveMessage:Y}=N,{setIsPopoverOpen:X,handleTogglePopover:ae,handleInputKeyDown:oe,toggleOption:Z,handleClear:Q,clearExtraOptions:$,toggleAll:se,setSearchValue:ce,setIsAnimating:le}=P,ue=e=>{y||X(e)},de=`Multi-select: ${F.length} of ${K().length} options selected. ${u}`;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i.LiveRegion,{politeMessage:J,assertiveMessage:Y}),(0,o.jsxs)(n.Popover,{open:I,onOpenChange:ue,modal:ne,children:[(0,o.jsx)(`div`,{id:O.triggerDescriptionId,className:`sr-only`,children:`Multi-select dropdown. Use arrow keys to navigate, Enter to select, and Escape to close.`}),(0,o.jsx)(`div`,{id:O.selectedCountId,className:`sr-only`,"aria-live":`polite`,children:F.length===0?`No options selected`:`${F.length} option${F.length===1?``:`s`} selected: ${F.map(e=>q(e)?.label).filter(Boolean).join(`, `)}`}),(0,o.jsx)(n.PopoverTrigger,{asChild:!0,children:(0,o.jsx)(t.Button,{ref:G,...D,onClick:ae,disabled:y,role:`combobox`,"aria-expanded":I,"aria-haspopup":`listbox`,"aria-controls":I?O.listboxId:void 0,"aria-describedby":`${O.triggerDescriptionId} ${O.selectedCountId}`,"aria-label":de,className:e.cn(`flex p-1 rounded-md border min-h-10 h-auto items-center justify-between bg-inherit hover:bg-inherit [&_svg]:pointer-events-auto`,v?`w-auto`:`w-full`,V.compactMode&&`min-h-8 text-sm`,z===`mobile`&&`min-h-12 text-base`,y&&`opacity-50 cursor-not-allowed`,m),style:{...H,maxWidth:`min(${H.maxWidth}, 100%)`},children:F.length>0?(0,o.jsx)(i.SelectedValuesContent,{selectedValues:F,responsiveSettings:V,screenSize:z,singleLine:re,animation:d,animationConfig:f,badgeAnimationClass:U,variant:l,getOptionByValue:q,toggleOption:Z,clearExtraOptions:$,handleClear:Q}):(0,o.jsx)(i.PlaceholderContent,{placeholder:u})})}),(0,o.jsx)(n.PopoverContent,{id:O.listboxId,role:`listbox`,"aria-multiselectable":`true`,"aria-label":`Available options`,className:e.cn(`w-auto p-0`,W,z===`mobile`&&`w-[85vw] max-w-70`,z===`tablet`&&`w-[70vw] max-w-md`,z===`desktop`&&`min-w-75`,ie),style:{animationDuration:`${f?.duration||d}s`,animationDelay:`${f?.delay||0}s`,maxWidth:`min(${H.maxWidth}, 85vw)`,maxHeight:z===`mobile`?`70vh`:`60vh`,touchAction:`manipulation`},align:`start`,onEscapeKeyDown:()=>X(!1),children:(0,o.jsx)(i.OptionsContent,{filteredOptions:B,hideSelectAll:h,searchValue:R,searchable:g,selectedValues:F,getAllOptions:K,toggleAll:se,toggleOption:Z,handleClear:Q,setIsPopoverOpen:X,handleInputKeyDown:oe,setSearchValue:ce,multiSelectId:O.multiSelectId,emptyIndicator:_,screenSize:z})}),d>0&&F.length>0&&(0,o.jsx)(r.Icons.WandSparkles,{className:e.cn(`cursor-pointer my-2 text-foreground bg-background w-3 h-3`,L?``:`text-muted-foreground`),onClick:()=>le(!L)})]})]})};s.displayName=`MultiSelect`,exports.default=s;
1
+ "use client";const e=require("./index2.cjs"),t=require("./index13.cjs"),n=require("./index17.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime"),a=require("react-dom");a=e.__toESM(a,1);var o=Object.defineProperty,s=r.forwardRef(((e,t)=>o(e,`name`,{value:t,configurable:!0}))(function(e,o){let{container:s,...c}=e,[l,u]=r.useState(!1);n.useLayoutEffect2(()=>u(!0),[]);let d=s||l&&globalThis?.document?.body;return d?a.createPortal((0,i.jsx)(t.Primitive.div,{...c,ref:o}),d):null},`Portal`));exports.Portal=s;
package/dist/index48.js CHANGED
@@ -1,15 +1,25 @@
1
- import { FormBase as e } from "./index42.js";
2
- import t from "./index47.js";
3
- import { jsx as n } from "react/jsx-runtime";
4
- //#region src/Form/FormMultiSelect/FormMultiSelect.tsx
5
- var r = ({ options: r, ...i }) => /* @__PURE__ */ n(e, {
6
- ...i,
7
- children: ({ onChange: e, value: i, ...a }) => /* @__PURE__ */ n(t, {
8
- ...a,
9
- options: r,
10
- onValueChange: e,
11
- value: i
12
- })
13
- });
1
+ import * as e from "react";
2
+ //#region ../../node_modules/.pnpm/@radix-ui+react-use-is-hydrated@0.1.3_@types+react@19.2.17_react@19.2.8/node_modules/@radix-ui/react-use-is-hydrated/dist/index.mjs
3
+ var t = Object.defineProperty, n = (e, n) => t(e, "name", {
4
+ value: n,
5
+ configurable: !0
6
+ }), r = !1;
7
+ function i() {
8
+ let [t, n] = e.useState(r);
9
+ return e.useEffect(() => {
10
+ r || (r = !0, n(!0));
11
+ }, []), t;
12
+ }
13
+ n(i, "useIsHydrated");
14
+ var a = e.useSyncExternalStore;
15
+ function o() {
16
+ return () => {};
17
+ }
18
+ n(o, "subscribe");
19
+ function s() {
20
+ return a(o, () => !0, () => !1);
21
+ }
22
+ n(s, "useIsHydratedModern");
23
+ var c = typeof a == "function" ? s : i;
14
24
  //#endregion
15
- export { r as default };
25
+ export { c as useIsHydrated2 };
package/dist/index49.cjs CHANGED
@@ -1 +1 @@
1
- const e=require("./index43.cjs"),t=require("./index48.cjs");let n=require("react/jsx-runtime");var r=({options:r,...i})=>(0,n.jsx)(e.FormBase,{...i,children:({onChange:e,value:i,...a})=>(0,n.jsx)(t.default,{...a,options:r,onValueChange:e,value:i})});exports.default=r;
1
+ const e=require("./index2.cjs");let t=require("react");t=e.__toESM(t,1);var n=Object.defineProperty,r=(e,t)=>n(e,`name`,{value:t,configurable:!0}),i=!1;function a(){let[e,n]=t.useState(i);return t.useEffect(()=>{i||(i=!0,n(!0))},[]),e}r(a,`useIsHydrated`);var o=t.useSyncExternalStore;function s(){return()=>{}}r(s,`subscribe`);function c(){return o(s,()=>!0,()=>!1)}r(c,`useIsHydratedModern`);var l=typeof o==`function`?c:a;exports.useIsHydrated2=l;