@ngrok/mantle 0.94.0 → 0.95.0

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 (615) hide show
  1. package/README.md +11 -2
  2. package/dist/CaretDown-MgTrjdYK.js +1 -0
  3. package/dist/CaretLeft-CZIqCyEF.js +1 -0
  4. package/dist/CaretRight-BKz4JHCI.js +1 -0
  5. package/dist/Check-C5a1hX4x.js +1 -0
  6. package/dist/CheckCircle-Bi4tSau6.js +1 -0
  7. package/dist/CircleNotch-BKE0NAIr.js +1 -0
  8. package/dist/Copy-BYWMO6PW.js +1 -0
  9. package/dist/Desktop-BaSlSeg2.js +1 -0
  10. package/dist/Eye-C38LQkZ_.js +1 -0
  11. package/dist/EyeClosed-BvOq-W8o.js +1 -0
  12. package/dist/FileText-CqAezJDn.js +1 -0
  13. package/dist/Info-weHV1B4q.js +1 -0
  14. package/dist/MagnifyingGlass-DCAoDH5_.js +1 -0
  15. package/dist/Megaphone-Cir2KHXa.js +1 -0
  16. package/dist/Minus-KBzmC4_K.js +1 -0
  17. package/dist/Moon-hn_oivM6.js +1 -0
  18. package/dist/Plus-D90-H9Ei.js +1 -0
  19. package/dist/Question-BhvEyO0K.js +1 -0
  20. package/dist/SidebarSimple-BXKgNz4l.js +1 -0
  21. package/dist/SortAscending-CEk4rgu_.js +1 -0
  22. package/dist/SortDescending-C0cE7hpU.js +1 -0
  23. package/dist/Sun-C3SaXdLl.js +1 -0
  24. package/dist/Terminal-aKZ6Y9Lk.js +1 -0
  25. package/dist/Warning-DTwF27_O.js +1 -0
  26. package/dist/WarningDiamond-BwpdVJ34.js +1 -0
  27. package/dist/X-BPGjP4b6.js +1 -0
  28. package/dist/accordion-BmDXs1-q.js +1 -0
  29. package/dist/accordion-NpJz3Uer.js +1 -0
  30. package/dist/accordion-parts.d.ts +268 -0
  31. package/dist/accordion-parts.js +1 -0
  32. package/dist/accordion.d.ts +8 -359
  33. package/dist/accordion.js +1 -1
  34. package/dist/agent.json +464 -92
  35. package/dist/alert-DCGSrVTa.js +1 -0
  36. package/dist/{alert-HffaioZM.d.ts → alert-Dz541Ve9.d.ts} +10 -196
  37. package/dist/alert-center-Bb39SBqJ.js +1 -0
  38. package/dist/alert-center-CGBbqO-y.d.ts +391 -0
  39. package/dist/alert-center-parts.d.ts +6 -0
  40. package/dist/alert-center-parts.js +1 -0
  41. package/dist/alert-center.d.ts +9 -590
  42. package/dist/alert-center.js +1 -1
  43. package/dist/alert-dialog-CtKnvX5N.js +1 -0
  44. package/dist/alert-dialog-parts.d.ts +569 -0
  45. package/dist/alert-dialog-parts.js +1 -0
  46. package/dist/alert-dialog.d.ts +3 -1054
  47. package/dist/alert-dialog.js +1 -1
  48. package/dist/alert-parts.d.ts +6 -0
  49. package/dist/alert-parts.js +1 -0
  50. package/dist/alert.d.ts +43 -1
  51. package/dist/alert.js +1 -1
  52. package/dist/anchor-DW5_Gb-1.js +1 -0
  53. package/dist/anchor.d.ts +6 -6
  54. package/dist/anchor.js +1 -1
  55. package/dist/app-layout-D7kwv9su.js +1 -0
  56. package/dist/app-layout-k6UjK30v.d.ts +1167 -0
  57. package/dist/app-layout-parts.d.ts +6 -0
  58. package/dist/app-layout-parts.js +1 -0
  59. package/dist/app-layout.d.ts +98 -1883
  60. package/dist/app-layout.js +1 -1
  61. package/dist/area-chart-C6lKu7Un.d.ts +390 -0
  62. package/dist/area-chart-SAaGaZFD.js +1 -0
  63. package/dist/area-chart-parts.d.ts +6 -0
  64. package/dist/area-chart-parts.js +1 -0
  65. package/dist/area-chart.d.ts +6 -581
  66. package/dist/area-chart.js +1 -1
  67. package/dist/avatar-BMZ81f_5.js +1 -0
  68. package/dist/avatar-Ti8GKSnS.d.ts +201 -0
  69. package/dist/avatar-parts.d.ts +6 -0
  70. package/dist/avatar-parts.js +1 -0
  71. package/dist/avatar.d.ts +5 -277
  72. package/dist/avatar.js +1 -1
  73. package/dist/badge.d.ts +10 -9
  74. package/dist/badge.js +1 -1
  75. package/dist/bar-chart-C0Ra1ZpG.js +1 -0
  76. package/dist/bar-chart-Cb5fA8V7.d.ts +386 -0
  77. package/dist/bar-chart-parts.d.ts +6 -0
  78. package/dist/bar-chart-parts.js +1 -0
  79. package/dist/bar-chart.d.ts +4 -583
  80. package/dist/bar-chart.js +1 -1
  81. package/dist/behaviors-BW8RjkkS.js +1 -0
  82. package/dist/behaviors-BbOq5SFv.js +1 -0
  83. package/dist/behaviors-C7R7ZIoN.js +1 -0
  84. package/dist/behaviors-CHF5PT3C.js +1 -0
  85. package/dist/behaviors-CSZQSSfL.js +1 -0
  86. package/dist/behaviors-CcjvGa0d.js +1 -0
  87. package/dist/behaviors-CnarRd47.js +1 -0
  88. package/dist/behaviors-CoNi6Rd-.js +1 -0
  89. package/dist/behaviors-D9VIyDk1.js +1 -0
  90. package/dist/behaviors-DHVC34f9.js +1 -0
  91. package/dist/behaviors-DkCIgQ8w.js +1 -0
  92. package/dist/behaviors-Mkc_HjTB.js +1 -0
  93. package/dist/breadcrumb-CAzq3SlR.js +1 -0
  94. package/dist/breadcrumb-parts.d.ts +287 -0
  95. package/dist/breadcrumb-parts.js +1 -0
  96. package/dist/breadcrumb.d.ts +65 -555
  97. package/dist/breadcrumb.js +1 -1
  98. package/dist/browser-only-CokCtIvB.js +1 -0
  99. package/dist/browser-only-ymFoM3Ya.js +1 -0
  100. package/dist/browser-only.js +1 -1
  101. package/dist/button-Bqm7U0OC.js +1 -0
  102. package/dist/{button-K0pKc3GN.d.ts → button-C6-6TecO.d.ts} +5 -5
  103. package/dist/{button-BGwOPjGV.d.ts → button-CL17Dxza.d.ts} +28 -25
  104. package/dist/button-CRCiBPEF.js +1 -0
  105. package/dist/{button-Cgf2IcEC.d.ts → button-CRMoQyum.d.ts} +27 -28
  106. package/dist/button-Cr2iY2cI.js +1 -0
  107. package/dist/button-DhoE-BbZ.js +1 -0
  108. package/dist/button.d.ts +3 -3
  109. package/dist/button.js +1 -1
  110. package/dist/calendar-DQtapcSC.js +1 -0
  111. package/dist/calendar.d.ts +1 -1
  112. package/dist/calendar.js +1 -1
  113. package/dist/card-DbtGVKyo.d.ts +129 -0
  114. package/dist/card-parts.d.ts +6 -0
  115. package/dist/card-parts.js +1 -0
  116. package/dist/card.d.ts +3 -228
  117. package/dist/card.js +1 -1
  118. package/dist/centered-layout-parts.d.ts +169 -0
  119. package/dist/centered-layout-parts.js +1 -0
  120. package/dist/centered-layout.d.ts +3 -300
  121. package/dist/centered-layout.js +1 -1
  122. package/dist/chart-B0n2xyYi.js +1 -0
  123. package/dist/chart-BPsMxs1f.js +1 -0
  124. package/dist/chart-BmZoTjRu.js +1 -0
  125. package/dist/chart-Bybyh2Dc.js +1 -0
  126. package/dist/chart-CACfdGlp.d.ts +86 -0
  127. package/dist/chart-CBQJUTIX.js +1 -0
  128. package/dist/chart-Cb0MBaZx.js +1 -0
  129. package/dist/chart-CmMcfDmv.js +1 -0
  130. package/dist/chart-Dlp9FidW.js +2 -0
  131. package/dist/{chart-jitNqimS.d.ts → chart-XvStK-oM.d.ts} +23 -99
  132. package/dist/chart-wTwYzUMJ.js +1 -0
  133. package/dist/checkbox-DH7WFfuR.js +1 -0
  134. package/dist/checkbox-DsVXD96X.js +1 -0
  135. package/dist/checkbox-TX74-Iep.js +1 -0
  136. package/dist/checkbox-group-parts.d.ts +197 -0
  137. package/dist/checkbox-group-parts.js +1 -0
  138. package/dist/checkbox.d.ts +60 -9
  139. package/dist/checkbox.js +1 -1
  140. package/dist/choice-BekuLm-b.d.ts +217 -0
  141. package/dist/choice-DGI8VNR9.d.ts +1 -0
  142. package/dist/choice-PDT386cc.js +1 -0
  143. package/dist/choice-parts.d.ts +7 -0
  144. package/dist/choice-parts.js +1 -0
  145. package/dist/choice.d.ts +63 -1
  146. package/dist/choice.js +1 -1
  147. package/dist/code-UKPv6LVP.js +1 -0
  148. package/dist/{code-block-W3kWPxCJ.js → code-block-B-xD4_RW.js} +1 -1
  149. package/dist/code-block-B7XPzZnp.js +1 -0
  150. package/dist/code-block-BXXceNVo.js +1 -0
  151. package/dist/code-block-C7uzLs8t.js +1 -0
  152. package/dist/{code-block-BGdV4Yty.d.ts → code-block-Cs1Lcmdr.d.ts} +82 -253
  153. package/dist/code-block-Erv7wuWW.d.ts +173 -0
  154. package/dist/code-block-parts.d.ts +380 -0
  155. package/dist/code-block-parts.js +1 -0
  156. package/dist/code-block.d.ts +66 -693
  157. package/dist/code-block.js +6 -6
  158. package/dist/code-block_highlight-utils.d.ts +2 -1
  159. package/dist/code-block_highlight-utils.js +1 -1
  160. package/dist/code.d.ts +4 -4
  161. package/dist/code.js +1 -1
  162. package/dist/combobox-6LXe1cLx.js +1 -0
  163. package/dist/combobox-parts.d.ts +303 -0
  164. package/dist/combobox-parts.js +1 -0
  165. package/dist/combobox.d.ts +5 -468
  166. package/dist/combobox.js +1 -1
  167. package/dist/command-B8L-zjGt.js +1 -0
  168. package/dist/command-CCMWCjAK.js +1 -0
  169. package/dist/command-VKj84zAX.d.ts +859 -0
  170. package/dist/command-cbgO9CiG.js +1 -0
  171. package/dist/command-parts.d.ts +6 -0
  172. package/dist/command-parts.js +1 -0
  173. package/dist/command.d.ts +91 -1135
  174. package/dist/command.js +1 -1
  175. package/dist/compose-refs-BdRUneoc.js +1 -0
  176. package/dist/compose-refs-Ce1vWUz0.js +1 -0
  177. package/dist/cx-CfAFHj5_.js +73 -0
  178. package/dist/cx-DhYnQ07J.js +1 -0
  179. package/dist/cx.d.ts +23 -17
  180. package/dist/cx.js +1 -1
  181. package/dist/{data-slot-B-LqAcBB.d.ts → data-slot-BW8KQ9Xo.d.ts} +2 -2
  182. package/dist/data-table-C-FgaN3_.js +1 -0
  183. package/dist/data-table-Cw9dUo1w.js +1 -0
  184. package/dist/data-table-CwqrMtp0.js +1 -0
  185. package/dist/data-table-GUbt8mzo.d.ts +38 -0
  186. package/dist/data-table-parts.d.ts +763 -0
  187. package/dist/data-table-parts.js +1 -0
  188. package/dist/data-table.d.ts +21 -1217
  189. package/dist/data-table.js +1 -1
  190. package/dist/description-list-CjcKOOnr.d.ts +110 -0
  191. package/dist/description-list-parts.d.ts +6 -0
  192. package/dist/description-list-parts.js +1 -0
  193. package/dist/description-list.d.ts +3 -183
  194. package/dist/description-list.js +1 -1
  195. package/dist/dialog-4Ed3U7hz.js +1 -0
  196. package/dist/dialog-BDb_obii.d.ts +166 -0
  197. package/dist/dialog-BaR9D58J.js +1 -0
  198. package/dist/dialog-BkNxAcol.d.ts +467 -0
  199. package/dist/dialog-DSYuhFD5.js +1 -0
  200. package/dist/dialog-fXMCxM9W.js +1 -0
  201. package/dist/dialog-parts.d.ts +6 -0
  202. package/dist/dialog-parts.js +1 -0
  203. package/dist/dialog.d.ts +88 -2
  204. package/dist/dialog.js +1 -1
  205. package/dist/dropdown-menu-BuluRn0Z.js +1 -0
  206. package/dist/dropdown-menu-CDXlp0QT.d.ts +507 -0
  207. package/dist/dropdown-menu-parts.d.ts +6 -0
  208. package/dist/dropdown-menu-parts.js +1 -0
  209. package/dist/dropdown-menu.d.ts +57 -1
  210. package/dist/dropdown-menu.js +1 -1
  211. package/dist/empty-parts.d.ts +120 -0
  212. package/dist/empty-parts.js +1 -0
  213. package/dist/empty.d.ts +2 -216
  214. package/dist/empty.js +1 -1
  215. package/dist/field-BRYypbjO.js +1 -0
  216. package/dist/field-BVMx7HoG.js +1 -0
  217. package/dist/field-BwCq1b9R.js +1 -0
  218. package/dist/field-CYAaNexp.js +1 -0
  219. package/dist/field-DRHAcM1s.js +1 -0
  220. package/dist/field-parts.d.ts +767 -0
  221. package/dist/field-parts.js +1 -0
  222. package/dist/field.d.ts +21 -1201
  223. package/dist/field.js +1 -1
  224. package/dist/flag.d.ts +3 -3
  225. package/dist/flag.js +1 -1
  226. package/dist/float-C_vwTtzU.js +1 -0
  227. package/dist/float-JmSzKDHd.js +1 -0
  228. package/dist/float-OhVY3cf4.js +1 -0
  229. package/dist/hooks-B-Cd15iL.js +1 -0
  230. package/dist/hooks-BP_uqBsI.js +1 -0
  231. package/dist/hooks-BeLOGKwE.js +1 -0
  232. package/dist/hooks-BsOjpTgs.js +1 -0
  233. package/dist/hooks-BybaGF7O.js +1 -0
  234. package/dist/hooks-C9b-2wGy.js +1 -0
  235. package/dist/hooks-CMmpICCH.js +1 -0
  236. package/dist/hooks-CUYIUcp6.js +1 -0
  237. package/dist/hooks-DKbOd_pQ.js +1 -0
  238. package/dist/hooks-DejuqCNF.js +1 -0
  239. package/dist/hooks-GsDfo7Zl.js +1 -0
  240. package/dist/hooks-PsYFJkz2.js +1 -0
  241. package/dist/hooks-lDz_S9UG.js +1 -0
  242. package/dist/hooks.d.ts +126 -17
  243. package/dist/hooks.js +1 -1
  244. package/dist/hover-card-BEC5EQiH.js +1 -0
  245. package/dist/hover-card-parts.d.ts +160 -0
  246. package/dist/hover-card-parts.js +1 -0
  247. package/dist/hover-card.d.ts +9 -281
  248. package/dist/hover-card.js +1 -1
  249. package/dist/{icon-CgNqu-fl.d.ts → icon--purqHRo.d.ts} +1 -1
  250. package/dist/icon-0RoVrpGj.js +1 -0
  251. package/dist/icon-BSGMvJ0W.js +1 -0
  252. package/dist/icon-DIiKxRTh.js +1 -0
  253. package/dist/{icon-DXDyhy2N.d.ts → icon-Dqn_LLrR.d.ts} +2 -2
  254. package/dist/{icon-NYvyyRMG.d.ts → icon-KTcDR4--.d.ts} +2 -2
  255. package/dist/icon.d.ts +3 -3
  256. package/dist/icon.js +1 -1
  257. package/dist/icons-CVgj9Whd.js +1 -0
  258. package/dist/icons-D_4cZaL1.js +1 -0
  259. package/dist/icons-DucrvIOa.js +1 -0
  260. package/dist/icons.d.ts +2 -2
  261. package/dist/icons.js +1 -1
  262. package/dist/{in-view-B3nMAzfE.d.ts → in-view-C_daNafg.d.ts} +4 -23
  263. package/dist/{index-KJ06KK6t.d.ts → index-CCkilmv8.d.ts} +1 -1
  264. package/dist/input-83xaPZWK.js +1 -0
  265. package/dist/input-B78ah4AB.js +1 -0
  266. package/dist/{input-q8o5uMhW.d.ts → input-Bvpu3ruQ.d.ts} +2 -2
  267. package/dist/input.d.ts +5 -5
  268. package/dist/input.js +1 -1
  269. package/dist/kbd-Bz_Rbpv8.js +1 -0
  270. package/dist/kbd.d.ts +5 -5
  271. package/dist/kbd.js +1 -1
  272. package/dist/{label-r2sJcSQ4.d.ts → label-DZpKu3Pu.d.ts} +8 -8
  273. package/dist/label-DmkAp9xI.js +1 -0
  274. package/dist/label.d.ts +1 -1
  275. package/dist/label.js +1 -1
  276. package/dist/layer-container-DDOZJ0fn.js +1 -0
  277. package/dist/layer-container.d.ts +11 -3
  278. package/dist/layer-container.js +1 -1
  279. package/dist/line-chart-CBL7eCqF.js +1 -0
  280. package/dist/line-chart-CIDFDkyb.d.ts +380 -0
  281. package/dist/line-chart-parts.d.ts +6 -0
  282. package/dist/line-chart-parts.js +1 -0
  283. package/dist/line-chart.d.ts +5 -569
  284. package/dist/line-chart.js +1 -1
  285. package/dist/list-CC3Pi__V.js +1 -0
  286. package/dist/list-Cx4KNfgC.d.ts +286 -0
  287. package/dist/list-FiFQJ0BU.js +1 -0
  288. package/dist/list-parts.d.ts +6 -0
  289. package/dist/list-parts.js +1 -0
  290. package/dist/list.d.ts +9 -406
  291. package/dist/list.js +1 -1
  292. package/dist/live-region-78gbKwlB.js +1 -0
  293. package/dist/live-region.d.ts +2 -2
  294. package/dist/live-region.js +1 -1
  295. package/dist/llms.txt +50 -26
  296. package/dist/main-9d96oUPG.js +1 -0
  297. package/dist/main.d.ts +1 -1
  298. package/dist/main.js +1 -1
  299. package/dist/mantle.css +1304 -910
  300. package/dist/media-object-parts.d.ts +65 -0
  301. package/dist/media-object-parts.js +1 -0
  302. package/dist/media-object.d.ts +5 -121
  303. package/dist/media-object.js +1 -1
  304. package/dist/migrations/0017-select-owned-behavior.yml +117 -0
  305. package/dist/migrations/0018-combobox-owned-behavior.yml +1661 -0
  306. package/dist/migrations/0019-multi-select-owned-behavior.yml +1414 -0
  307. package/dist/migrations/0020-native-floats.yml +823 -0
  308. package/dist/migrations/0021-native-radio-group.yml +397 -0
  309. package/dist/migrations/0024-command-owned-behavior.yml +66 -0
  310. package/dist/migrations/0026-native-dropdown-menu.yml +351 -0
  311. package/dist/migrations/0029-data-attribute-contract.yml +1707 -0
  312. package/dist/migrations/0030-between-variant.yml +1954 -0
  313. package/dist/multi-select-parts.d.ts +487 -0
  314. package/dist/multi-select-parts.js +1 -0
  315. package/dist/multi-select-qC0BuYKD.js +1 -0
  316. package/dist/multi-select.d.ts +6 -803
  317. package/dist/multi-select.js +1 -1
  318. package/dist/otp-input-LPdkb_Fg.js +1 -0
  319. package/dist/otp-input-parts.d.ts +211 -0
  320. package/dist/otp-input-parts.js +1 -0
  321. package/dist/otp-input-zl6MVio6.js +1 -0
  322. package/dist/otp-input.d.ts +11 -252
  323. package/dist/otp-input.js +1 -1
  324. package/dist/overlay-prompt-BIzMQvx7.js +1 -0
  325. package/dist/overlay-prompt-CDnhSoPJ.js +1 -0
  326. package/dist/overlay-prompt.d.ts +57 -0
  327. package/dist/overlay-prompt.js +1 -0
  328. package/dist/pagination-B2ESEbMI.d.ts +171 -0
  329. package/dist/pagination-CxaLKZcE.js +1 -0
  330. package/dist/pagination-Df1gTCN-.js +1 -0
  331. package/dist/pagination-cursor-pagination-parts.d.ts +6 -0
  332. package/dist/pagination-cursor-pagination-parts.js +1 -0
  333. package/dist/pagination.d.ts +39 -304
  334. package/dist/pagination.js +1 -1
  335. package/dist/popover-DOd6zLvE.d.ts +226 -0
  336. package/dist/popover-DWvHbepV.js +1 -0
  337. package/dist/popover-parts.d.ts +6 -0
  338. package/dist/popover-parts.js +1 -0
  339. package/dist/popover.d.ts +60 -2
  340. package/dist/popover.js +1 -1
  341. package/dist/position-Cv3XpSur.d.ts +5 -0
  342. package/dist/progress-BE0c8GW8.js +1 -0
  343. package/dist/progress-ZhFJhv9u.js +1 -0
  344. package/dist/progress-bar-parts.d.ts +86 -0
  345. package/dist/progress-bar-parts.js +1 -0
  346. package/dist/progress-donut-parts.d.ts +94 -0
  347. package/dist/progress-donut-parts.js +1 -0
  348. package/dist/progress-mJQMhxMX.js +1 -0
  349. package/dist/progress-zDpT3TY4.d.ts +2 -0
  350. package/dist/progress.d.ts +4 -268
  351. package/dist/progress.js +1 -1
  352. package/dist/qr-code-0zh10iIE.d.ts +148 -0
  353. package/dist/qr-code-BOOubA9x.js +1 -0
  354. package/dist/qr-code-D8tBKtjP.js +1 -0
  355. package/dist/qr-code-DzJjumoc.d.ts +46 -0
  356. package/dist/qr-code-encoder.browser.d.ts +15 -0
  357. package/dist/qr-code-encoder.browser.js +1 -0
  358. package/dist/qr-code-encoder.d.ts +15 -0
  359. package/dist/qr-code-encoder.js +1 -0
  360. package/dist/qr-code-parts.d.ts +6 -0
  361. package/dist/qr-code-parts.js +1 -0
  362. package/dist/qr-code.d.ts +4 -227
  363. package/dist/qr-code.js +1 -1
  364. package/dist/query-C0e5VYNp.d.ts +440 -0
  365. package/dist/query-V5NifJGs.js +1 -0
  366. package/dist/query-filter.d.ts +6 -6
  367. package/dist/query-filter.js +1 -1
  368. package/dist/query-parts.d.ts +6 -0
  369. package/dist/query-parts.js +1 -0
  370. package/dist/query.d.ts +5 -634
  371. package/dist/query.js +1 -1
  372. package/dist/radio-group-B9jtIbV1.d.ts +39 -0
  373. package/dist/radio-group-BliblUqe.js +1 -0
  374. package/dist/radio-group-f3ThXQCx.js +1 -0
  375. package/dist/radio-group-parts.d.ts +249 -0
  376. package/dist/radio-group-parts.js +1 -0
  377. package/dist/radio-group-zA5DjlLg.js +1 -0
  378. package/dist/radio-group.d.ts +7 -399
  379. package/dist/radio-group.js +1 -1
  380. package/dist/sandbar-Cm2yMjEZ.js +1 -0
  381. package/dist/sandbar-DU4wpKRc.d.ts +345 -0
  382. package/dist/sandbar-parts.d.ts +6 -0
  383. package/dist/sandbar-parts.js +1 -0
  384. package/dist/sandbar.d.ts +6 -441
  385. package/dist/sandbar.js +1 -1
  386. package/dist/sandboxed-on-click-Cg3lewoG.js +1 -0
  387. package/dist/sandboxed-on-click-DOw_Jkhk.js +1 -0
  388. package/dist/sandboxed-on-click.d.ts +1 -1
  389. package/dist/sandboxed-on-click.js +1 -1
  390. package/dist/scatter-plot-1vFxkpjT.js +1 -0
  391. package/dist/scatter-plot-D25jLIVw.d.ts +388 -0
  392. package/dist/scatter-plot-parts.d.ts +6 -0
  393. package/dist/scatter-plot-parts.js +1 -0
  394. package/dist/scatter-plot.d.ts +5 -575
  395. package/dist/scatter-plot.js +1 -1
  396. package/dist/segmented-control-DuiDPKDZ.js +1 -0
  397. package/dist/segmented-control-parts.d.ts +72 -0
  398. package/dist/segmented-control-parts.js +1 -0
  399. package/dist/segmented-control.d.ts +4 -100
  400. package/dist/segmented-control.js +1 -1
  401. package/dist/select-08IEtypH.js +1 -0
  402. package/dist/select-DM2wWfOO.d.ts +478 -0
  403. package/dist/select-parts.d.ts +6 -0
  404. package/dist/select-parts.js +1 -0
  405. package/dist/select.d.ts +63 -1
  406. package/dist/select.js +1 -1
  407. package/dist/selectable-list-Ax5F2Gz1.js +1 -0
  408. package/dist/selectable-list-CyLc3EEt.d.ts +407 -0
  409. package/dist/selectable-list-GcpbbRM1.js +1 -0
  410. package/dist/selectable-list-parts.d.ts +6 -0
  411. package/dist/selectable-list-parts.js +1 -0
  412. package/dist/selectable-list.d.ts +7 -647
  413. package/dist/selectable-list.js +1 -1
  414. package/dist/separator-BB1ohsjn.js +1 -0
  415. package/dist/{separator-QfH0ot5K.d.ts → separator-BzHNVyyv.d.ts} +2 -2
  416. package/dist/separator.d.ts +1 -1
  417. package/dist/separator.js +1 -1
  418. package/dist/sheet-5JgxVaWC.js +1 -0
  419. package/dist/sheet-parts.d.ts +732 -0
  420. package/dist/sheet-parts.js +1 -0
  421. package/dist/sheet-qYPi5MP8.js +1 -0
  422. package/dist/sheet.d.ts +11 -1208
  423. package/dist/sheet.js +1 -1
  424. package/dist/sidebar-CsC9fyPL.js +1 -0
  425. package/dist/sidebar-OBA7L42d.d.ts +1480 -0
  426. package/dist/sidebar-parts.d.ts +6 -0
  427. package/dist/sidebar-parts.js +1 -0
  428. package/dist/sidebar.d.ts +108 -2518
  429. package/dist/sidebar.js +1 -1
  430. package/dist/skeleton-DB0oQyAx.js +1 -0
  431. package/dist/skeleton.d.ts +5 -5
  432. package/dist/skeleton.js +1 -1
  433. package/dist/skip-to-main-link-BGhAWSqB.js +1 -0
  434. package/dist/skip-to-main-link.d.ts +1 -1
  435. package/dist/skip-to-main-link.js +1 -1
  436. package/dist/slider-YlBozcPQ.js +1 -0
  437. package/dist/slider.d.ts +150 -16
  438. package/dist/slider.js +1 -1
  439. package/dist/slot-5ZSmrISx.d.ts +19 -0
  440. package/dist/slot-BxngGBJ2.js +1 -0
  441. package/dist/slot-CBcGhRdV.js +1 -0
  442. package/dist/slot-tuk2J6bY.d.ts +50 -0
  443. package/dist/slot.d.ts +1 -1
  444. package/dist/slot.js +1 -1
  445. package/dist/source-all.css +5 -1
  446. package/dist/split-button-DvJHD7cZ.js +1 -0
  447. package/dist/split-button-parts.d.ts +178 -0
  448. package/dist/split-button-parts.js +1 -0
  449. package/dist/split-button.d.ts +2 -314
  450. package/dist/split-button.js +1 -1
  451. package/dist/strata-parts.d.ts +256 -0
  452. package/dist/strata-parts.js +1 -0
  453. package/dist/strata.d.ts +6 -495
  454. package/dist/strata.js +1 -1
  455. package/dist/{suggestions-NkqYTT49.d.ts → suggestions-BJeGvwDa.d.ts} +7 -7
  456. package/dist/switch-DajWYrq3.js +1 -0
  457. package/dist/switch.d.ts +37 -5
  458. package/dist/switch.js +1 -1
  459. package/dist/{table-rWiVWEgB.d.ts → table-C2KnE83u.d.ts} +6 -445
  460. package/dist/table-DJHK48-8.js +1 -0
  461. package/dist/table-parts.d.ts +6 -0
  462. package/dist/table-parts.js +1 -0
  463. package/dist/table.d.ts +81 -1
  464. package/dist/table.js +1 -1
  465. package/dist/tabs-36-4SlRo.js +1 -0
  466. package/dist/tabs-CC_HAqr4.d.ts +193 -0
  467. package/dist/tabs-DayeszXP.js +1 -0
  468. package/dist/tabs-headless-tabs-parts.d.ts +6 -0
  469. package/dist/tabs-headless-tabs-parts.js +1 -0
  470. package/dist/tabs-parts.d.ts +237 -0
  471. package/dist/tabs-parts.js +1 -0
  472. package/dist/tabs.d.ts +43 -420
  473. package/dist/tabs.js +1 -1
  474. package/dist/text-area-D29JTaZg.js +1 -0
  475. package/dist/text-area.d.ts +2 -2
  476. package/dist/text-area.js +1 -1
  477. package/dist/theme-D6rP5Fy8.js +1 -0
  478. package/dist/theme-switcher-PKMCyJxT.js +1 -0
  479. package/dist/theme-switcher.d.ts +26 -22
  480. package/dist/theme-switcher.js +1 -1
  481. package/dist/theme-xoFnLba6.js +1 -0
  482. package/dist/theme.d.ts +84 -77
  483. package/dist/theme.js +1 -1
  484. package/dist/time-zone-CpWYKHdp.js +1 -0
  485. package/dist/time-zone-DZ4hUJ8K.js +1 -0
  486. package/dist/time-zone.d.ts +190 -0
  487. package/dist/time-zone.js +1 -0
  488. package/dist/toast-BJZ__22c.js +1 -0
  489. package/dist/toast-Cb9IN-6e.d.ts +185 -0
  490. package/dist/toast-DM_oq-3E.js +1 -0
  491. package/dist/toast-parts.d.ts +6 -0
  492. package/dist/toast-parts.js +1 -0
  493. package/dist/toast.d.ts +7 -256
  494. package/dist/toast.js +1 -1
  495. package/dist/tokens.dark.json +3026 -0
  496. package/dist/tokens.json +4867 -0
  497. package/dist/tokens.resolver.json +37 -0
  498. package/dist/tooltip-D4HZn19B.js +1 -0
  499. package/dist/tooltip-DP6Lz6jv.d.ts +180 -0
  500. package/dist/tooltip-Uy-kz0rK.d.ts +1 -0
  501. package/dist/tooltip-parts.d.ts +7 -0
  502. package/dist/tooltip-parts.js +1 -0
  503. package/dist/tooltip.d.ts +57 -1
  504. package/dist/tooltip.js +1 -1
  505. package/dist/truncated-text-B5u2AlNg.js +1 -0
  506. package/dist/truncated-text-BoXHP-cD.js +1 -0
  507. package/dist/truncated-text.d.ts +4 -6
  508. package/dist/truncated-text.js +1 -1
  509. package/dist/types.d.ts +1 -1
  510. package/dist/types.js +1 -1
  511. package/dist/typography-C2BmSH12.d.ts +148 -0
  512. package/dist/typography-parts.d.ts +6 -0
  513. package/dist/typography-parts.js +1 -0
  514. package/dist/typography.d.ts +52 -0
  515. package/dist/typography.js +1 -0
  516. package/dist/use-combobox-OhIEVioc.d.ts +23 -0
  517. package/dist/use-float-WEqqhXBE.d.ts +18 -0
  518. package/dist/use-listbox-D4uIonSN.d.ts +1 -0
  519. package/dist/utils-BN3rwHzz.js +1 -0
  520. package/dist/utils-BlLYcYik.js +1 -0
  521. package/dist/utils-C4astHJG.js +1 -0
  522. package/dist/utils-CPSttKPD.js +1 -0
  523. package/dist/{copy-to-clipboard-DInu78k_.js → utils-Dd83caRw.js} +1 -1
  524. package/dist/utils.d.ts +1 -1
  525. package/dist/utils.js +1 -1
  526. package/dist/visually-hidden.d.ts +2 -2
  527. package/dist/visually-hidden.js +1 -1
  528. package/dist/well.d.ts +2 -2
  529. package/dist/well.js +1 -1
  530. package/dist/world-map-BDd3N_Ap.d.ts +424 -0
  531. package/dist/world-map-D3c8Pq-h.js +1 -0
  532. package/dist/world-map-parts.d.ts +6 -0
  533. package/dist/world-map-parts.js +1 -0
  534. package/dist/world-map-t9U-IMKS.js +1 -0
  535. package/dist/world-map.d.ts +80 -0
  536. package/dist/world-map.js +1 -0
  537. package/package.json +30 -19
  538. package/dist/alert-CH99Rw-R.js +0 -1
  539. package/dist/anchor-CgcbWEUs.js +0 -1
  540. package/dist/browser-only-BTSrYWLj.js +0 -1
  541. package/dist/button-69InNC_m.js +0 -1
  542. package/dist/button-BQZ6eoD3.js +0 -1
  543. package/dist/button-BWGUuWnu.js +0 -1
  544. package/dist/button-Cu9e3SM7.js +0 -1
  545. package/dist/chart-BO9EwQ60.js +0 -1
  546. package/dist/chart-CE5Uaqz9.js +0 -1
  547. package/dist/chart-DCTGGlWL.js +0 -1
  548. package/dist/chart-DudCw24t.js +0 -2
  549. package/dist/checkbox-CS504fKk.js +0 -1
  550. package/dist/choice-BwfmbepO.d.ts +0 -405
  551. package/dist/choice-uyYccm0A.js +0 -1
  552. package/dist/clsx-DUGZgXfJ.js +0 -1
  553. package/dist/clsx-Dj3RWZ2l.js +0 -1
  554. package/dist/code-DUJzSl4K.js +0 -1
  555. package/dist/compose-refs-sFdxsL7k.js +0 -1
  556. package/dist/cx-CK7o_rVv.js +0 -1
  557. package/dist/dialog-B9JAGy_x.d.ts +0 -28
  558. package/dist/dialog-CsugEt2A.js +0 -1
  559. package/dist/dialog-DD5H3EH1.d.ts +0 -942
  560. package/dist/dropdown-menu-DHdgaw4P.js +0 -1
  561. package/dist/dropdown-menu-DmDxYPde.d.ts +0 -775
  562. package/dist/field-Bihblt8U.js +0 -1
  563. package/dist/field-CPvjazWN.js +0 -1
  564. package/dist/icon-BudQMD2S.js +0 -1
  565. package/dist/icon-kK0c-POG.js +0 -1
  566. package/dist/icons-4JA-SGfv.js +0 -1
  567. package/dist/icons-CDLz5lpI.js +0 -1
  568. package/dist/icons-CSwTVV2m.js +0 -1
  569. package/dist/input-DHovzBjS.js +0 -1
  570. package/dist/input-DQyN6gN0.js +0 -1
  571. package/dist/interactive-target-BXScNeOr.js +0 -1
  572. package/dist/kbd-CLHsJ99p.js +0 -1
  573. package/dist/label-DmDwzPD8.js +0 -1
  574. package/dist/layer-container-kEQiE4zV.js +0 -1
  575. package/dist/list-CO_yLdln.js +0 -1
  576. package/dist/live-region-DQ1QLv3L.js +0 -1
  577. package/dist/main-CC1L9IsH.js +0 -1
  578. package/dist/popover-BhTFutCz.d.ts +0 -1
  579. package/dist/popover-DxOqLKxy.js +0 -1
  580. package/dist/popover-lwkwWcRW.d.ts +0 -291
  581. package/dist/primitive-Dz9Al-us.js +0 -1
  582. package/dist/radio-group-jj2abc0t.js +0 -1
  583. package/dist/radio-group-sLz5AA9I.d.ts +0 -27
  584. package/dist/sandboxed-on-click-C7pPu-2M.js +0 -1
  585. package/dist/select-BqmpVJJT.d.ts +0 -890
  586. package/dist/select-C6Su0dU0.js +0 -1
  587. package/dist/separator-DfzxVutO.js +0 -1
  588. package/dist/shake-DL6WhMXM.js +0 -1
  589. package/dist/sheet-Bd2LIhzF.js +0 -1
  590. package/dist/skeleton-DBpI-ko5.js +0 -1
  591. package/dist/slot-D12N_fZJ.d.ts +0 -67
  592. package/dist/slot-DdYN1L1C.js +0 -1
  593. package/dist/table-CFHiDBW8.js +0 -1
  594. package/dist/theme-DdZgLvKH.js +0 -1
  595. package/dist/tooltip-CpK3XTor.d.ts +0 -283
  596. package/dist/tooltip-b6oiTaWq.js +0 -1
  597. package/dist/use-breakpoint--mo7kr9d.js +0 -1
  598. package/dist/use-callback-ref-BvVyI5K1.js +0 -1
  599. package/dist/use-copy-to-clipboard-Dy_0Qzb7.js +0 -1
  600. package/dist/use-inert-siblings-CNmNuS2h.js +0 -1
  601. package/dist/use-is-apple-platform-D4nifHMx.js +0 -1
  602. package/dist/use-is-hydrated-after-paint-r9Cl2mGp.js +0 -1
  603. package/dist/use-isomorphic-layout-effect-CLSmHzo4.js +0 -1
  604. package/dist/use-matches-media-query-m860lols.js +0 -1
  605. package/dist/use-prefers-reduced-motion-CU6mWmOe.js +0 -1
  606. package/dist/use-swipe-to-dismiss-i__cTF2v.js +0 -1
  607. /package/dist/{suggestions-Ciz2vaJO.js → query-filter-Ciz2vaJO.js} +0 -0
  608. /package/dist/{radio-group-HDVxTNPi.js → sidebar-HDVxTNPi.js} +0 -0
  609. /package/dist/{direction-CvDpql3O.js → sorting-CvDpql3O.js} +0 -0
  610. /package/dist/{booleanish-BfvnW6vy.js → types-BfvnW6vy.js} +0 -0
  611. /package/dist/{css-properties-D85fCNV3.js → types-D85fCNV3.js} +0 -0
  612. /package/dist/{alternate-announcement-BkH4bOKp.js → utils-BkH4bOKp.js} +0 -0
  613. /package/dist/{in-view-Dxv_GrUU.js → utils-Dxv_GrUU.js} +0 -0
  614. /package/dist/{data-slot-EM6s2WEU.js → utils-EM6s2WEU.js} +0 -0
  615. /package/dist/{cookie-ca4g5CKp.js → utils-ca4g5CKp.js} +0 -0
@@ -1 +1 @@
1
- import{t as e}from"./use-isomorphic-layout-effect-CLSmHzo4.js";import{t}from"./compose-refs-sFdxsL7k.js";import{t as n}from"./cx-CK7o_rVv.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{i,r as a}from"./layer-container-kEQiE4zV.js";import{t as o}from"./shake-DL6WhMXM.js";import{t as s}from"./field-Bihblt8U.js";import{a as c,r as l}from"./field-CPvjazWN.js";import{t as u}from"./icon-kK0c-POG.js";import{n as d}from"./separator-DfzxVutO.js";import{t as f}from"./slot-DdYN1L1C.js";import{c as p}from"react/compiler-runtime";import{cloneElement as m,createContext as h,isValidElement as g,useContext as _,useEffect as v,useRef as y,useState as b}from"react";import x from"tiny-invariant";import{Fragment as S,jsx as C,jsxs as w}from"react/jsx-runtime";import{XIcon as T}from"@phosphor-icons/react/X";import{CheckIcon as E}from"@phosphor-icons/react/Check";import{Combobox as D,ComboboxGroup as O,ComboboxGroupLabel as k,ComboboxItem as A,ComboboxItemCheck as j,ComboboxPopover as M,ComboboxProvider as N,useComboboxContext as P}from"@ariakit/react/combobox";import{useStoreState as F}from"@ariakit/react/store";import{LockIcon as I}from"@phosphor-icons/react/Lock";const L=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`),R=[],z=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),B=h({current:null}),V=h(void 0),H=h(R),U=h({onInputKeyDownRef:{current:void 0},inputRef:{current:null},setLockedValues:()=>{}}),W=e=>{let t=p(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({children:n,defaultSelectedValue:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?R:i,o=y(null),s=y(void 0),c=y(null),[l,u]=b(R),d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d={onInputKeyDownRef:s,inputRef:c,setLockedValues:u},t[4]=d):d=t[4];let f=d,m;t[5]!==n||t[6]!==a||t[7]!==r?(m=/* @__PURE__ */ C(N,{defaultSelectedValue:a,...r,children:n}),t[5]=n,t[6]=a,t[7]=r,t[8]=m):m=t[8];let h;return t[9]!==l||t[10]!==m?(h=/* @__PURE__ */ C(B.Provider,{value:o,children:/* @__PURE__ */ C(U.Provider,{value:f,children:/* @__PURE__ */ C(H.Provider,{value:l,children:m})})}),t[9]=l,t[10]=m,t[11]=h):h=t[11],h},G=e=>{let i=p(38),a,o,s,u,d,f,m,h,g;i[0]===e?(a=i[1],o=i[2],s=i[3],u=i[4],d=i[5],f=i[6],m=i[7],h=i[8],g=i[9]):({"data-slot":d,"aria-invalid":a,className:u,children:s,onKeyDown:f,onMouseDown:m,ref:g,validation:o,...h}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=u,i[5]=d,i[6]=f,i[7]=m,i[8]=h,i[9]=g);let v=_(B),{inputRef:y}=_(U),b=P(),x=c(),S=o??x,w;i[10]!==a||i[11]!==S?(w=l({"aria-invalid":a,validation:S}),i[10]=a,i[11]=S,i[12]=w):w=i[12];let{ariaInvalid:T,validation:E}=w,D;i[13]===d?D=i[14]:(D=r(d,`multi-select-trigger`),i[13]=d,i[14]=D);let O;i[15]===u?O=i[16]:(O=n(`cursor-text select-none font-sans text-sm`,`border-form bg-form text-strong flex min-h-9 w-full flex-wrap items-center gap-1 rounded-md border px-3 py-1 has-data-[slot=multi-select-tag]:px-1`,`has-focus:outline-hidden has-focus-within:ring-4 has-aria-expanded:ring-4`,`has-focus-within:border-accent-600 has-focus-within:ring-focus-accent has-aria-expanded:border-accent-600 has-aria-expanded:ring-focus-accent`,`data-validation-success:border-success-600 data-validation-success:has-focus-within:border-success-600 data-validation-success:has-focus-within:ring-focus-success data-validation-success:has-aria-expanded:border-success-600 data-validation-success:has-aria-expanded:ring-focus-success`,`data-validation-warning:border-warning-600 data-validation-warning:has-focus-within:border-warning-600 data-validation-warning:has-focus-within:ring-focus-warning data-validation-warning:has-aria-expanded:border-warning-600 data-validation-warning:has-aria-expanded:ring-focus-warning`,`data-validation-error:border-danger-600 data-validation-error:has-focus-within:border-danger-600 data-validation-error:has-focus-within:ring-focus-danger data-validation-error:has-aria-expanded:border-danger-600 data-validation-error:has-aria-expanded:ring-focus-danger motion-safe:data-validation-error:animate-shake`,u),i[15]=u,i[16]=O);let k=E||void 0,A;i[17]!==f||i[18]!==b?(A=e=>{e.key===`Escape`&&b?.getState().open&&(e.preventDefault(),b.hide()),f?.(e)},i[17]=f,i[18]=b,i[19]=A):A=i[19];let j;i[20]!==y||i[21]!==m?(j=e=>{e.target instanceof HTMLElement&&!e.target.closest(`button, input, [data-slot='multi-select-tag']`)&&(e.preventDefault(),y.current?.focus()),m?.(e)},i[20]=y,i[21]=m,i[22]=j):j=i[22];let M;i[23]!==g||i[24]!==v?(M=t(v,g),i[23]=g,i[24]=v,i[25]=M):M=i[25];let N;i[26]!==s||i[27]!==h||i[28]!==D||i[29]!==O||i[30]!==k||i[31]!==A||i[32]!==j||i[33]!==M?(N=/* @__PURE__ */ C(`div`,{role:`presentation`,"data-slot":D,className:O,"data-validation":k,onKeyDown:A,onMouseDown:j,ref:M,...h,children:s}),i[26]=s,i[27]=h,i[28]=D,i[29]=O,i[30]=k,i[31]=A,i[32]=j,i[33]=M,i[34]=N):N=i[34];let F;return i[35]!==T||i[36]!==N?(F=/* @__PURE__ */ C(V.Provider,{value:T,children:N}),i[35]=T,i[36]=N,i[37]=F):F=i[37],F},K=e=>{let i=p(47),a,s,c,l,d,f,m,h,g,_;i[0]===e?(a=i[1],s=i[2],c=i[3],l=i[4],d=i[5],f=i[6],m=i[7],h=i[8],g=i[9],_=i[10]):({"data-slot":s,className:a,value:_,onRemove:f,locked:g,onBlur:c,onFocus:l,onKeyDown:d,ref:h,...m}=e,i[0]=e,i[1]=a,i[2]=s,i[3]=c,i[4]=l,i[5]=d,i[6]=f,i[7]=m,i[8]=h,i[9]=g,i[10]=_);let v=g!==void 0&&g,x=y(null),[S,E]=b(!1),D;i[11]===h?D=i[12]:(D=t(x,h),i[11]=h,i[12]=D);let O;i[13]===s?O=i[14]:(O=r(s,`multi-select-tag`),i[13]=s,i[14]=O);let k=S||void 0,A=v||void 0,j;i[15]===a?j=i[16]:(j=n(`cursor-default bg-neutral-500/10 border border-neutral-500/20 rounded-xs text-strong inline-flex items-center gap-1 pl-2 pr-0.5 py-0.5 text-sm font-normal motion-safe:data-shake:animate-shake`,`focus-visible:outline-hidden focus-visible:border-accent-600/50 focus-visible:ring-3 focus-visible:ring-focus-accent`,a),i[15]=a,i[16]=j);let M;i[17]===c?M=i[18]:(M=e=>{E(!1),c?.(e)},i[17]=c,i[18]=M);let N;i[19]===l?N=i[20]:(N=e=>{E(!0),l?.(e)},i[19]=l,i[20]=N);let P;i[21]!==v||i[22]!==d?(P=e=>{v&&(e.key===`Backspace`||e.key===`Delete`)?(e.preventDefault(),o(e.currentTarget)):d?.(e)},i[21]=v,i[22]=d,i[23]=P):P=i[23];let F=`Remove ${_}`,L=v||void 0,R;i[24]===Symbol.for(`react.memo_cache_sentinel`)?(R=n(`cursor-pointer text-strong/40 hover:bg-neutral-500/15 hover:text-strong rounded-xs p-0.5`,`aria-disabled:cursor-default aria-disabled:hover:bg-transparent aria-disabled:hover:text-strong/40`),i[24]=R):R=i[24];let z;i[25]!==v||i[26]!==f?(z=e=>{if(e.stopPropagation(),v){let e=x.current;e&&o(e)}else f?.()},i[25]=v,i[26]=f,i[27]=z):z=i[27];let B;i[28]===v?B=i[29]:(B=/* @__PURE__ */ C(u,{svg:v?/* @__PURE__ */ C(I,{}):/* @__PURE__ */ C(T,{weight:`bold`}),className:`size-4`}),i[28]=v,i[29]=B);let V;i[30]!==F||i[31]!==L||i[32]!==z||i[33]!==B?(V=/* @__PURE__ */ C(`button`,{type:`button`,"aria-label":F,tabIndex:-1,"aria-disabled":L,className:R,onClick:z,onMouseDown:$,children:B}),i[30]=F,i[31]=L,i[32]=z,i[33]=B,i[34]=V):V=i[34];let H;return i[35]!==m||i[36]!==V||i[37]!==D||i[38]!==O||i[39]!==k||i[40]!==A||i[41]!==j||i[42]!==M||i[43]!==N||i[44]!==P||i[45]!==_?(H=/* @__PURE__ */ w(`span`,{ref:D,role:`listitem`,tabIndex:-1,"data-slot":O,"data-active":k,"data-locked":A,className:j,onBlur:M,onFocus:N,onKeyDown:P,...m,children:[_,V]}),i[35]=m,i[36]=V,i[37]=D,i[38]=O,i[39]=k,i[40]=A,i[41]=j,i[42]=M,i[43]=N,i[44]=P,i[45]=_,i[46]=H):H=i[46],H},q=({render:e,...t})=>e(t),J=t=>{let n=p(22),{"aria-label":r,children:i,lockedValues:a}=t,s=r===void 0?`Selected values`:r,c=a===void 0?R:a,l=P(),u=F(l,`selectedValue`),d;n[0]===u?d=n[1]:(d=L(u)?u:void 0,n[0]=u,n[1]=d);let f=d??R,m=y(f),h,g;n[2]===f?(h=n[3],g=n[4]):(h=()=>{m.current=f},g=[f],n[2]=f,n[3]=h,n[4]=g),e(h,g);let b;n[5]===c?b=n[6]:(b=new Set(c),n[5]=c,n[6]=b);let x=b,S=y(/* @__PURE__ */ new Map),{onInputKeyDownRef:w,inputRef:T,setLockedValues:E}=_(U),D,O;n[7]!==c||n[8]!==E?(D=()=>{E(e=>z(e,c)?e:c)},O=[c,E],n[7]=c,n[8]=E,n[9]=D,n[10]=O):(D=n[9],O=n[10]),e(D,O);let k,A;n[11]===E?(k=n[12],A=n[13]):(A=()=>()=>{E(R)},k=[E],n[11]=E,n[12]=k,n[13]=A),e(A,k);let j;n[14]===Symbol.for(`react.memo_cache_sentinel`)?(j=/* @__PURE__ */ new Set,n[14]=j):j=n[14];let M=y(j),N,I;n[15]===Symbol.for(`react.memo_cache_sentinel`)?(N=()=>()=>{M.current.forEach(cancelAnimationFrame)},I=[],n[15]=N,n[16]=I):(N=n[15],I=n[16]),v(N,I);let B=e=>{let t=requestAnimationFrame(()=>{M.current.delete(t),e()});M.current.add(t)},V;n[17]===l?V=n[18]:(V=e=>{if(l){let t=l.getState().selectedValue;if(!L(t))return;l.setSelectedValue(t.filter(t=>t!==e))}},n[17]=l,n[18]=V);let H=V,W=e=>{let t=m.current[e];if(t==null)return;let n=S.current.get(t);n&&(n.focus(),l?.show())},G=()=>{T.current?.focus()},J=(e,t)=>{let n=f[t];bb65:switch(e.key){case`ArrowLeft`:e.preventDefault(),t>0&&W(t-1);break bb65;case`ArrowRight`:e.preventDefault(),t<f.length-1?W(t+1):G();break bb65;case`Backspace`:case`Delete`:if(e.preventDefault(),n!=null){if(x.has(n)){let e=S.current.get(n);e&&o(e);break bb65}if(H(n),e.key===`Backspace`){if(t>0){let e=t-1;B(()=>W(e))}else B(()=>{m.current.length>0?W(0):G()})}else B(()=>{t<m.current.length?W(t):G()})}break bb65;case`ArrowUp`:case`ArrowDown`:e.preventDefault(),G(),T.current?.dispatchEvent(new KeyboardEvent(`keydown`,{key:e.key,bubbles:!0,cancelable:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,altKey:e.altKey}));break bb65;default:e.key.length===1&&!e.ctrlKey&&!e.metaKey&&G()}},Y=e=>{if(e.key===`ArrowLeft`&&e.currentTarget.selectionStart===0&&e.currentTarget.selectionEnd===0&&f.length>0)e.preventDefault(),W(f.length-1);else if(e.key===`Backspace`&&e.currentTarget.value===``&&f.length>0){let e=f[f.length-1];if(e!=null){if(x.has(e)){let t=S.current.get(e);t&&o(t)}else H(e)}}};if(e(()=>(w.current=Y,()=>{w.current=void 0})),f.length===0)return null;let X=f.map((e,t)=>{let n={value:e,locked:x.has(e),onRemove:()=>{if(x.has(e)){let t=S.current.get(e);t&&o(t)}else H(e)},ref:t=>{t?S.current.set(e,t):S.current.delete(e)},onKeyDown:e=>J(e,t),onClick:()=>W(t)};return i?/* @__PURE__ */ C(q,{render:i,...n},e):/* @__PURE__ */ C(K,{...n},e)}),Z;return n[19]!==s||n[20]!==X?(Z=/* @__PURE__ */ C(`span`,{role:`list`,"aria-label":s,"data-slot":`multi-select-tag-list`,className:`contents`,children:X}),n[19]=s,n[20]=X,n[21]=Z):Z=n[21],Z},Y=e=>{let i=p(44),a,o,c,l,u,d,f,m,h,g;i[0]===e?(a=i[1],o=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],m=i[8],h=i[9],g=i[10]):({"data-slot":o,className:a,onBlur:c,onChange:l,onFocus:u,onKeyDown:d,onValueChange:f,placeholder:m,ref:g,...h}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=c,i[4]=l,i[5]=u,i[6]=d,i[7]=f,i[8]=m,i[9]=h,i[10]=g);let v=P(),{onInputKeyDownRef:y,inputRef:b}=_(U),x=_(s),S=_(V),w=F(v,`selectedValue`),T=((L(w)?w:void 0)?.length??0)>0,E;i[11]===o?E=i[12]:(E=r(o,`multi-select-input`),i[11]=o,i[12]=E);let O;i[13]===a?O=i[14]:(O=n(`pointer-coarse:text-base min-w-20 flex-1 select-text border-0 bg-transparent text-sm outline-hidden`,`placeholder:select-none placeholder:text-placeholder`,a),i[13]=a,i[14]=O);let k;i[15]!==l||i[16]!==f?(k=e=>{f?.(e.target.value),l?.(e)},i[15]=l,i[16]=f,i[17]=k):k=i[17];let A;i[18]!==y||i[19]!==d?(A=e=>{y.current?.(e),d?.(e)},i[18]=y,i[19]=d,i[20]=A):A=i[20];let j;i[21]!==c||i[22]!==v?(j=e=>{e.relatedTarget instanceof HTMLElement&&e.relatedTarget.closest(`[data-slot~="multi-select-tag"]`)&&v?.show(),c?.(e)},i[21]=c,i[22]=v,i[23]=j):j=i[23];let M;i[24]!==u||i[25]!==v?(M=e=>{v?.show(),u?.(e)},i[24]=u,i[25]=v,i[26]=M):M=i[26];let N=T?void 0:m,I;i[27]!==b||i[28]!==g?(I=t(b,g),i[27]=b,i[28]=g,i[29]=I):I=i[29];let R;i[30]===x?R=i[31]:(R=x?{"aria-describedby":x[`aria-describedby`],"aria-errormessage":x[`aria-errormessage`],"aria-invalid":x[`aria-invalid`],id:x.id,name:x.name}:void 0,i[30]=x,i[31]=R);let z;return i[32]!==h||i[33]!==E||i[34]!==O||i[35]!==k||i[36]!==A||i[37]!==j||i[38]!==M||i[39]!==N||i[40]!==I||i[41]!==R||i[42]!==S?(z=/* @__PURE__ */ C(D,{autoSelect:!0,"aria-invalid":S,"data-slot":E,className:O,onChange:k,onKeyDown:A,onBlur:j,onFocus:M,placeholder:N,ref:I,...h,...R}),i[32]=h,i[33]=E,i[34]=O,i[35]=k,i[36]=A,i[37]=j,i[38]=M,i[39]=N,i[40]=I,i[41]=R,i[42]=S,i[43]=z):z=i[43],z},X=e=>{let t=p(40),o,s,c,l,u,d,f,m,h,g,v,y;t[0]===e?(o=t[1],s=t[2],c=t[3],l=t[4],u=t[5],d=t[6],f=t[7],m=t[8],h=t[9],g=t[10],v=t[11],y=t[12]):({"data-slot":c,asChild:m,backdrop:h,children:o,className:s,modal:g,portalElement:l,preventBodyScroll:u,ref:f,sameWidth:v,unmountOnHide:y,...d}=e,t[0]=e,t[1]=o,t[2]=s,t[3]=c,t[4]=l,t[5]=u,t[6]=d,t[7]=f,t[8]=m,t[9]=h,t[10]=g,t[11]=v,t[12]=y);let b=m!==void 0&&m,x=h!==void 0&&h,S=g===void 0||g,w=v===void 0||v,T=y===void 0||y,E=_(B),D=i(),O=a(),k;t[13]===E?k=t[14]:(k=()=>E.current?.getBoundingClientRect()??null,t[13]=E,t[14]=k);let A=k,j;t[15]!==D||t[16]!==l||t[17]!==E?(j=e=>typeof l==`function`?l(e):l??E.current?.closest(`[data-mantle-modal-content]`)??(D instanceof HTMLElement?D:null)??e.ownerDocument.body,t[15]=D,t[16]=l,t[17]=E,t[18]=j):j=t[18];let N=j,P;t[19]===E?P=t[20]:(P=e=>!(e.target instanceof Node&&E.current?.contains(e.target)),t[19]=E,t[20]=P);let F=P,I;t[21]===c?I=t[22]:(I=r(c,`multi-select-content`),t[21]=c,t[22]=I);let L;t[23]===s?L=t[24]:(L=n(`border-popover bg-popover relative z-50 max-h-96 min-w-32 scrollbar overflow-y-scroll overflow-x-hidden overscroll-y-none rounded-md border shadow-md pt-1 pb-1 has-data-content-footer:pb-0 font-sans flex flex-col gap-px focus:outline-hidden`,s),t[23]=s,t[24]=L);let R=u??!O,z=b?ee:void 0,V;return t[25]!==x||t[26]!==o||t[27]!==A||t[28]!==N||t[29]!==F||t[30]!==S||t[31]!==d||t[32]!==f||t[33]!==w||t[34]!==L||t[35]!==R||t[36]!==z||t[37]!==I||t[38]!==T?(V=/* @__PURE__ */ C(M,{"data-slot":I,className:L,backdrop:x,getAnchorRect:A,gutter:4,hideOnInteractOutside:F,modal:S,portalElement:N,preventBodyScroll:R,ref:f,render:z,sameWidth:w,unmountOnHide:T,...d,children:o}),t[25]=x,t[26]=o,t[27]=A,t[28]=N,t[29]=F,t[30]=S,t[31]=d,t[32]=f,t[33]=w,t[34]=L,t[35]=R,t[36]=z,t[37]=I,t[38]=T,t[39]=V):V=t[39],V},Z=e=>/* @__PURE__ */ C(`div`,{"data-slot":`multi-select-item-label`,className:`contents`,children:e}),Q={Root:W,Trigger:G,TagValues:J,Input:Y,Tag:K,Content:X,ContentFooter:e=>{let t=p(16),i,a,o,s,c;t[0]===e?(i=t[1],a=t[2],o=t[3],s=t[4],c=t[5]):({"data-slot":o,className:a,children:i,ref:c,...s}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=c);let l;t[6]===o?l=t[7]:(l=r(o,`multi-select-content-footer`),t[6]=o,t[7]=l);let u;t[8]===a?u=t[9]:(u=n(`bg-popover sticky bottom-0 border-t border-popover`,a),t[8]=a,t[9]=u);let d;return t[10]!==i||t[11]!==s||t[12]!==c||t[13]!==l||t[14]!==u?(d=/* @__PURE__ */ C(`div`,{ref:c,"data-slot":l,"data-content-footer":!0,className:u,...s,children:i}),t[10]=i,t[11]=s,t[12]=c,t[13]=l,t[14]=u,t[15]=d):d=t[15],d},Item:e=>{let t=p(41),i,a,o,s,c,l,d,f,h;t[0]===e?(i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],d=t[7],f=t[8],h=t[9]):({"data-slot":o,asChild:d,children:i,className:a,focusOnHover:f,value:h,onClick:s,ref:l,...c}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=c,t[6]=l,t[7]=d,t[8]=f,t[9]=h);let v=d!==void 0&&d,y=f===void 0||f,b=_(H),T;t[10]!==b||t[11]!==h?(T=h!=null&&b.includes(h),t[10]=b,t[11]=h,t[12]=T):T=t[12];let D=T,O;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(O=/* @__PURE__ */ C(j,{className:`absolute right-2 flex h-3.5 w-3.5 items-center justify-center`,children:/* @__PURE__ */ C(u,{svg:/* @__PURE__ */ C(E,{weight:`bold`}),className:`size-4 text-accent-600`})}),t[13]=O):O=t[13];let k=O,M;if(v){x(g(i),"When using `asChild`, MultiSelect.Item must be passed a single child as a JSX tag.");let e;if(t[14]!==i){let n;t[16]===i.props.children?n=t[17]:(n=Z(i.props.children),t[16]=i.props.children,t[17]=n);let r;t[18]===n?r=t[19]:(r=/* @__PURE__ */ w(S,{children:[n,k]}),t[18]=n,t[19]=r),e=m(i,{},r),t[14]=i,t[15]=e}else e=t[15];M=e}else{let e;t[20]===i?e=t[21]:(e=Z(i),t[20]=i,t[21]=e);let n;t[22]===e?n=t[23]:(n=/* @__PURE__ */ w(S,{children:[e,k]}),t[22]=e,t[23]=n),M=n}let N;t[24]===o?N=t[25]:(N=r(o,`multi-select-item`),t[24]=o,t[25]=N);let P;t[26]===a?P=t[27]:(P=n(`relative mx-1 cursor-pointer rounded-md pl-2 pr-8 py-1.5 text-strong text-sm font-normal flex min-w-0 items-center gap-2`,`[[role=option]+&]:mt-px`,`data-active-item:bg-active-menu-item`,`aria-disabled:opacity-50`,`aria-selected:bg-selected-menu-item aria-selected:data-active-item:bg-active-selected-menu-item`,a),t[26]=a,t[27]=P);let F;t[28]!==D||t[29]!==s?(F=e=>{D?e.preventDefault():s?.(e)},t[28]=D,t[29]=s,t[30]=F):F=t[30];let I=v?te:void 0,L;return t[31]!==M||t[32]!==y||t[33]!==c||t[34]!==l||t[35]!==N||t[36]!==P||t[37]!==F||t[38]!==I||t[39]!==h?(L=/* @__PURE__ */ C(A,{"data-slot":N,className:P,focusOnHover:y,onClick:F,ref:l,render:I,resetValueOnSelect:!0,value:h,...c,children:M}),t[31]=M,t[32]=y,t[33]=c,t[34]=l,t[35]=N,t[36]=P,t[37]=F,t[38]=I,t[39]=h,t[40]=L):L=t[40],L},Group:e=>{let t=p(14),n,i,a,o,s;t[0]===e?(n=t[1],i=t[2],a=t[3],o=t[4],s=t[5]):({"data-slot":i,asChild:s,children:n,ref:o,...a}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=s);let c=s!==void 0&&s,l;t[6]===i?l=t[7]:(l=r(i,`multi-select-group`),t[6]=i,t[7]=l);let u=c?ne:void 0,d;return t[8]!==n||t[9]!==a||t[10]!==o||t[11]!==l||t[12]!==u?(d=/* @__PURE__ */ C(O,{"data-slot":l,className:`mx-1`,ref:o,render:u,...a,children:n}),t[8]=n,t[9]=a,t[10]=o,t[11]=l,t[12]=u,t[13]=d):d=t[13],d},GroupLabel:e=>{let t=p(18),i,a,o,s,c,l;t[0]===e?(i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6]):({"data-slot":o,asChild:l,children:i,className:a,ref:c,...s}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=c,t[6]=l);let u=l!==void 0&&l,d;t[7]===o?d=t[8]:(d=r(o,`multi-select-group-label`),t[7]=o,t[8]=d);let f;t[9]===a?f=t[10]:(f=n(`text-muted px-2 py-1 text-xs font-medium`,a),t[9]=a,t[10]=f);let m=u?re:void 0,h;return t[11]!==i||t[12]!==s||t[13]!==c||t[14]!==d||t[15]!==f||t[16]!==m?(h=/* @__PURE__ */ C(k,{"data-slot":d,className:f,ref:c,render:m,...s,children:i}),t[11]=i,t[12]=s,t[13]=c,t[14]=d,t[15]=f,t[16]=m,t[17]=h):h=t[17],h},GroupDescription:e=>{let t=p(16),i,a,o,s,c;t[0]===e?(i=t[1],a=t[2],o=t[3],s=t[4],c=t[5]):({"data-slot":o,className:a,children:i,ref:c,...s}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=c);let l;t[6]===o?l=t[7]:(l=r(o,`multi-select-group-description`),t[6]=o,t[7]=l);let u;t[8]===a?u=t[9]:(u=n(`text-muted px-2 pb-1 text-xs`,a),t[8]=a,t[9]=u);let d;return t[10]!==i||t[11]!==s||t[12]!==c||t[13]!==l||t[14]!==u?(d=/* @__PURE__ */ C(`p`,{"data-slot":l,className:u,ref:c,...s,children:i}),t[10]=i,t[11]=s,t[12]=c,t[13]=l,t[14]=u,t[15]=d):d=t[15],d},Separator:e=>{let t=p(14),i,a,o,s;t[0]===e?(i=t[1],a=t[2],o=t[3],s=t[4]):({"data-slot":a,className:i,ref:s,...o}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=o,t[4]=s);let c;t[5]===a?c=t[6]:(c=r(a,`multi-select-separator`),t[5]=a,t[6]=c);let l;t[7]===i?l=t[8]:(l=n(`my-1 w-auto`,i),t[7]=i,t[8]=l);let u;return t[9]!==o||t[10]!==s||t[11]!==c||t[12]!==l?(u=/* @__PURE__ */ C(d,{"data-slot":c,ref:s,className:l,...o}),t[9]=o,t[10]=s,t[11]=c,t[12]=l,t[13]=u):u=t[13],u},Empty:e=>{let t=p(16),i,a,o,s,c;t[0]===e?(i=t[1],a=t[2],o=t[3],s=t[4],c=t[5]):({"data-slot":o,className:a,children:i,ref:c,...s}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=c);let l;t[6]===o?l=t[7]:(l=r(o,`multi-select-empty`),t[6]=o,t[7]=l);let u;t[8]===a?u=t[9]:(u=n(`mx-1 text-muted px-2 py-6 text-center text-sm`,a),t[8]=a,t[9]=u);let d;return t[10]!==i||t[11]!==s||t[12]!==c||t[13]!==l||t[14]!==u?(d=/* @__PURE__ */ C(`div`,{"data-slot":l,className:u,ref:c,role:`presentation`,...s,children:i}),t[10]=i,t[11]=s,t[12]=c,t[13]=l,t[14]=u,t[15]=d):d=t[15],d}};function $(e){e.preventDefault()}function ee(e){let{ref:t,...n}=e;return/* @__PURE__ */ C(f,{ref:t,...n})}function te(e){let{ref:t,...n}=e;return/* @__PURE__ */ C(f,{ref:t,...n})}function ne(e){let{ref:t,...n}=e;return/* @__PURE__ */ C(f,{ref:t,...n})}function re(e){let{ref:t,...n}=e;return/* @__PURE__ */ C(f,{ref:t,...n})}export{Q as MultiSelect};
1
+ export*as MultiSelect from"./multi-select-parts.js";
@@ -0,0 +1 @@
1
+ const e=({selection:e,length:t,maxLength:n,previous:r})=>{let{start:i}=e;if(t===0||i!==e.end||i===t&&t<n)return e;if(i===0)return{start:0,end:1,direction:`forward`};if(i===n)return{start:i-1,end:i,direction:`backward`};if(n<2||t<2)return e;if(r==null)return{start:i,end:i+1,direction:e.direction};let a=i<r.end?`backward`:`forward`,o=r.start===r.end&&r.start<n,s=a===`backward`&&!o?-1:0;return{start:i+s,end:i+s+1,direction:a}},t=({selection:e,index:t})=>e==null?!1:e.start===e.end?t===e.start:t>=e.start&&t<e.end,n=({selection:e,maxLength:t})=>{if(e==null)return`idle`;let n=e.start===e.end?Number(e.start<t):Math.min(e.end,t)-e.start;return n<=0?`idle`:n===1?`caret`:n===t?`all`:`range`};export{n,e as r,t};
@@ -0,0 +1,211 @@
1
+ /**
2
+ * The parts of the `OtpInput` namespace. `index.ts` imports them as one module
3
+ * namespace, so a bundler keeps only the parts a consumer reads.
4
+ */
5
+ import { ComponentProps, ReactNode } from "react";
6
+ import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
7
+ import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
8
+ import { o as WithValidation } from "./field-BshcNVe_.js";
9
+ declare const textAlignClasses: {
10
+ readonly left: "text-left";
11
+ readonly center: "text-center";
12
+ readonly right: "text-right";
13
+ };
14
+ type OtpInputRootProps = Omit<ComponentProps<"input">, "children" | "maxLength" | "onChange" | "value"> & WithValidation & {
15
+ children?: ReactNode;
16
+ /**
17
+ * The class of the element that holds the slots and the input.
18
+ */
19
+ containerClassName?: string;
20
+ /**
21
+ * The total number of character slots.
22
+ */
23
+ maxLength: number;
24
+ /**
25
+ * The CSS that shows the input when JavaScript is off, in a `<noscript>`. It
26
+ * selects the input with `[data-input-otp]`. When omitted, the input shows
27
+ * with mantle's form colors. `null` turns the fallback off.
28
+ */
29
+ noScriptCSSFallback?: string | null;
30
+ /**
31
+ * The new value, after each change.
32
+ */
33
+ onChange?: (value: string) => void;
34
+ /**
35
+ * The full value, when the value grows to `maxLength` characters: the user
36
+ * fills the final slot, or a parent sets the full value.
37
+ */
38
+ onComplete?: (value: string) => void;
39
+ /**
40
+ * Rewrites the pasted text before the input reads it, for example to remove
41
+ * dashes and spaces.
42
+ */
43
+ pasteTransformer?: (pasted: string) => string;
44
+ /**
45
+ * `"increase-width"` makes the input reach a 40px gutter past the last slot
46
+ * when the gutter fits, so a password manager draws its badge there and
47
+ * not over the last character. `"none"` keeps the input on the slots.
48
+ *
49
+ * @default "increase-width"
50
+ */
51
+ pushPasswordManagerStrategy?: "increase-width" | "none";
52
+ /**
53
+ * The text alignment of the input, which moves its invisible caret.
54
+ *
55
+ * @default "left"
56
+ */
57
+ textAlign?: keyof typeof textAlignClasses;
58
+ /**
59
+ * The controlled value.
60
+ */
61
+ value?: string;
62
+ } & WithDataSlot;
63
+ /**
64
+ * The root of the OTP input. Renders one native `<input>` over the slots: it
65
+ * takes the keystrokes, the paste, the SMS and password manager fill, and the
66
+ * focus, and each `OtpInput.Slot` shows one character of its value.
67
+ *
68
+ * Pass `validation="error"` (or `"success"` / `"warning"`) to recolor each
69
+ * group's outer borders and the active focus ring with the matching validation hue.
70
+ * `validation="error"` also sets `aria-invalid` on the underlying input so
71
+ * assistive tech announces the failure state.
72
+ *
73
+ * When composing with `Field.Item`, wrap `OtpInput.Root` in `Field.Control`.
74
+ * `Field.Control` flows the generated `id`, `aria-invalid`, `aria-describedby`,
75
+ * and `aria-errormessage` through to the underlying focusable input via
76
+ * `FieldControlContext`.
77
+ *
78
+ * **Accessibility.** The input needs an accessible name. Inside a `Field.Item`,
79
+ * `Field.Label` supplies it. On its own, pass `aria-label`.
80
+ *
81
+ * **Password managers.** The input sets `autocomplete="one-time-code"`, so
82
+ * 1Password, Bitwarden, Dashlane, and Proton Pass can fill the code. Each can
83
+ * also show its badge beside the last slot. Do not add their ignore
84
+ * attributes: an ignore attribute also stops the fill. LastPass does not fill
85
+ * one-time codes, so the input carries `data-lpignore`.
86
+ *
87
+ * @see https://mantle.ngrok.com/components/forms/otp-input
88
+ *
89
+ * @example
90
+ * ```tsx
91
+ * <OtpInput.Root maxLength={6}>
92
+ * <OtpInput.Group>
93
+ * <OtpInput.Slot index={0} />
94
+ * <OtpInput.Slot index={1} />
95
+ * <OtpInput.Slot index={2} />
96
+ * </OtpInput.Group>
97
+ * <OtpInput.Separator />
98
+ * <OtpInput.Group>
99
+ * <OtpInput.Slot index={3} />
100
+ * <OtpInput.Slot index={4} />
101
+ * <OtpInput.Slot index={5} />
102
+ * </OtpInput.Group>
103
+ * </OtpInput.Root>
104
+ * ```
105
+ */
106
+ declare const Root: ({ "aria-invalid": ariaInvalid, "data-slot": dataSlot, autoComplete, children, className, containerClassName, defaultValue, inputMode, maxLength, noScriptCSSFallback, onBlur, onChange, onComplete, onFocus, onPaste, pasteTransformer, pattern, placeholder, pushPasswordManagerStrategy, ref, spellCheck, style, textAlign, validation: _validation, value: valueProp, ...props }: OtpInputRootProps) => import("react").JSX.Element;
107
+ type OtpInputGroupProps = ComponentProps<"div"> & WithAsChild & WithDataSlot;
108
+ /**
109
+ * Groups one or more `OtpInput.Slot` parts into a visually-connected segment.
110
+ * Slots inside a group share rounded corners on the outer edges and join with
111
+ * shared borders between adjacent slots.
112
+ *
113
+ * @see https://mantle.ngrok.com/components/forms/otp-input
114
+ *
115
+ * @example
116
+ * ```tsx
117
+ * <OtpInput.Root maxLength={6}>
118
+ * <OtpInput.Group>
119
+ * <OtpInput.Slot index={0} />
120
+ * <OtpInput.Slot index={1} />
121
+ * <OtpInput.Slot index={2} />
122
+ * </OtpInput.Group>
123
+ * <OtpInput.Separator />
124
+ * <OtpInput.Group>
125
+ * <OtpInput.Slot index={3} />
126
+ * <OtpInput.Slot index={4} />
127
+ * <OtpInput.Slot index={5} />
128
+ * </OtpInput.Group>
129
+ * </OtpInput.Root>
130
+ * ```
131
+ */
132
+ declare const Group: ({ "data-slot": dataSlot, asChild, children, className, ref, ...props }: OtpInputGroupProps) => import("react").JSX.Element;
133
+ type OtpInputSlotProps = Omit<ComponentProps<"div">, "translate"> & {
134
+ /**
135
+ * The zero-based index of the character slot to render. Must be a valid
136
+ * index within the parent `OtpInput.Root`'s `maxLength`.
137
+ */
138
+ index: number;
139
+ } & WithDataSlot;
140
+ /**
141
+ * Renders a single character slot for the OTP input. Reads its display state
142
+ * (the typed character, active/focused state, and fake caret position) from
143
+ * the nearest `OtpInput.Root` via context, so this part must always be
144
+ * rendered inside an `OtpInput.Root`.
145
+ *
146
+ * **Translation.** The slot always carries `translate="no"`, so a browser
147
+ * translation engine skips the character inside it. A translated passcode
148
+ * character is wrong. The engine also wraps that character's text node in a
149
+ * `<font>`, which detaches the node React holds. The next keystroke then makes
150
+ * React remove a node its parent no longer owns, and the DOM raises
151
+ * `NotFoundError`. The `translate` prop is omitted from the type, so no call
152
+ * site can turn the guard off.
153
+ *
154
+ * @see https://mantle.ngrok.com/components/forms/otp-input
155
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/translate
156
+ *
157
+ * @example
158
+ * ```tsx
159
+ * <OtpInput.Root maxLength={6}>
160
+ * <OtpInput.Group>
161
+ * <OtpInput.Slot index={0} />
162
+ * <OtpInput.Slot index={1} />
163
+ * <OtpInput.Slot index={2} />
164
+ * </OtpInput.Group>
165
+ * <OtpInput.Separator />
166
+ * <OtpInput.Group>
167
+ * <OtpInput.Slot index={3} />
168
+ * <OtpInput.Slot index={4} />
169
+ * <OtpInput.Slot index={5} />
170
+ * </OtpInput.Group>
171
+ * </OtpInput.Root>
172
+ * ```
173
+ */
174
+ declare const OtpInputSlotImpl: ({ "data-slot": dataSlot, className, index, ref, ...props }: OtpInputSlotProps) => import("react").JSX.Element;
175
+ type OtpInputSeparatorProps = ComponentProps<"div"> & WithAsChild & {
176
+ /**
177
+ * If `true`, the separator renders with `role="separator"` so assistive
178
+ * tech announces it as a divider between OTP groups.
179
+ * If `false`, the separator is purely decorative and is removed from
180
+ * the accessibility tree. Prefer `false` inside an OTP control where the
181
+ * minus icon is visual chrome between slot groups.
182
+ *
183
+ * @default false
184
+ */
185
+ semantic?: boolean;
186
+ } & WithDataSlot;
187
+ /**
188
+ * A visual separator between two `OtpInput.Group` segments. Renders a minus
189
+ * icon by default; pass `children` to override the visual.
190
+ *
191
+ * @see https://mantle.ngrok.com/components/forms/otp-input
192
+ *
193
+ * @example
194
+ * ```tsx
195
+ * <OtpInput.Root maxLength={6}>
196
+ * <OtpInput.Group>
197
+ * <OtpInput.Slot index={0} />
198
+ * <OtpInput.Slot index={1} />
199
+ * <OtpInput.Slot index={2} />
200
+ * </OtpInput.Group>
201
+ * <OtpInput.Separator />
202
+ * <OtpInput.Group>
203
+ * <OtpInput.Slot index={3} />
204
+ * <OtpInput.Slot index={4} />
205
+ * <OtpInput.Slot index={5} />
206
+ * </OtpInput.Group>
207
+ * </OtpInput.Root>
208
+ * ```
209
+ */
210
+ declare const Separator: ({ "data-slot": dataSlot, asChild, children, className, ref, semantic, ...props }: OtpInputSeparatorProps) => import("react").JSX.Element;
211
+ export { Group, Root, Separator, OtpInputSlotImpl as Slot };
@@ -0,0 +1 @@
1
+ export{t as Group,r as Root,i as Separator,n as Slot}from"./otp-input-zl6MVio6.js";
@@ -0,0 +1 @@
1
+ "use client";import{t as e}from"./Minus-KBzmC4_K.js";import{createContext as t,useCallback as n,useContext as r,useEffect as i,useMemo as a,useRef as o,useState as s}from"react";import{flushSync as c}from"react-dom";import l from"tiny-invariant";import{t as ee}from"./behaviors-DHVC34f9.js";import{t as u}from"./types-D85fCNV3.js";import{t as te}from"./compose-refs-Ce1vWUz0.js";import{n as d,t as ne}from"./cx-CfAFHj5_.js";import{t as f}from"./utils-EM6s2WEU.js";import{t as re}from"./field-BwCq1b9R.js";import{t as ie}from"./input-BjCDSOPA.js";import{n as ae}from"./field-BRYypbjO.js";import{n as oe}from"./field-CYAaNexp.js";import{t as p}from"./slot-CBcGhRdV.js";import{n as se,r as ce,t as m}from"./otp-input-LPdkb_Fg.js";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";const le={error:`danger`,success:`success`,warning:`warning`},ue=e=>`var(--color-${e}-600)`,v=e=>`var(--ring-color-focus-${e})`,y={left:`text-left`,center:`text-center`,right:`text-right`},b=t(null),x=e=>{let t=e.getBoundingClientRect().right;for(let n=e;n!=null;n=n.parentElement)if(getComputedStyle(n).overflowX!==`visible`)return n.getBoundingClientRect().left+n.clientLeft+n.clientWidth-t>=40;return document.documentElement.clientWidth-t>=40},S=({"aria-invalid":e,"data-slot":t,autoComplete:l,children:p,className:m,containerClassName:S,defaultValue:C,inputMode:w=`numeric`,maxLength:T,noScriptCSSFallback:E,onBlur:de,onChange:fe,onComplete:pe,onFocus:me,onPaste:D,pasteTransformer:O,pattern:k,placeholder:A,pushPasswordManagerStrategy:j=`increase-width`,ref:M,spellCheck:N=!1,style:P,textAlign:F=`left`,validation:I,value:L,...R})=>{let z=oe(),B=r(re),{ariaInvalid:he,validation:V}=ae({"aria-invalid":e,defaultAriaInvalid:!1,validation:I??z}),[H,ge]=ee({value:L,defaultValue:typeof C==`string`?C:``,onChange:fe}),[U,W]=s(null),[_e,ve]=s(!1),G=o(null),K=o(null),q=o(H),J=te(M,G),Y=n(e=>{let t=ce({selection:{start:e.selectionStart??0,end:e.selectionEnd??0,direction:e.selectionDirection??`none`},length:e.value.length,maxLength:e.maxLength,previous:K.current});(t.start!==e.selectionStart||t.end!==e.selectionEnd)&&e.setSelectionRange(t.start,t.end,t.direction),K.current=t,W(e=>e?.start===t.start&&e.end===t.end?e:t)},[]),X=e=>{j===`increase-width`&&e.parentElement!=null&&ve(x(e.parentElement))},Z=e=>e.length>0&&k!=null&&!new RegExp(k).test(e)?!1:(ge(e),!0),Q=U!=null;i(()=>{let e=G.current;if(!Q||e==null)return;let t=()=>{document.activeElement===e?Y(e):W(null)};return document.addEventListener(`selectionchange`,t,{capture:!0}),()=>{document.removeEventListener(`selectionchange`,t,{capture:!0})}},[Q,Y]),i(()=>{let e=G.current;e!=null&&(e.value!==H&&Z(e.value.slice(0,T)),H!==q.current&&(H.length===T&&q.current.length<T&&pe?.(H),q.current=H),U==null?document.activeElement===e&&document.hasFocus()&&(X(e),Y(e)):(e.selectionStart!==U.start||e.selectionEnd!==U.end)&&Y(e))});let ye=a(()=>({value:H,selection:U}),[H,U]),$=V?le[V]:void 0,be=$?u({"--otp-validation-border":ue($),"--otp-validation-ring":v($)}):void 0;return/* @__PURE__ */ _(h,{children:[E!=null&&/* @__PURE__ */ g(`noscript`,{children:/* @__PURE__ */ g(`style`,{children:`@layer utilities{${E}}`})}),/* @__PURE__ */ _(`div`,{className:d(`pointer-events-none relative flex items-center gap-2 select-none has-disabled:opacity-50`,S),"data-input-otp-container":!0,translate:`no`,children:[/* @__PURE__ */ g(b,{value:ye,children:/* @__PURE__ */ g(`div`,{className:`group/otp contents`,"data-otp-state":se({selection:U,maxLength:T}),"data-validation":V||void 0,style:be,children:p})}),/* @__PURE__ */ g(`div`,{className:`pointer-events-none absolute inset-0 [container-type:size] [&>*]:pointer-events-auto!`,children:/* @__PURE__ */ g(`input`,{autoComplete:l||`one-time-code`,"aria-invalid":he,"aria-placeholder":A,"data-slot":f(t,`otp-input`),"data-input-otp":!0,"data-input-otp-mss":U?.start,"data-input-otp-mse":U?.end,"data-input-otp-placeholder-shown":H.length===0||void 0,"data-lpignore":ie[`data-lpignore`],inputMode:w,spellCheck:N,...R,...B?{"aria-describedby":B[`aria-describedby`],"aria-errormessage":B[`aria-errormessage`],id:B.id,name:B.name}:void 0,ref:J,className:ne(`otp-input-overlay disabled:cursor-not-allowed`,E===void 0&&`noscript:rounded-md! noscript:border! noscript:border-form! noscript:bg-form! noscript:text-center! noscript:text-base! noscript:tracking-[.25em]! noscript:text-strong! noscript:caret-current!`,y[F],m),style:_e&&j===`increase-width`?{...P,...u({"--_otp-badge-gutter":`40px`})}:P,maxLength:T,pattern:k,value:H,onBlur:e=>{W(null),de?.(e)},onChange:e=>{let t=e.currentTarget;Z(t.value.slice(0,T))&&document.activeElement===t&&Y(t)},onFocus:e=>{let t=e.currentTarget,n=t.value.length;t.setSelectionRange(Math.min(n,T-1),n),X(t),Y(t),me?.(e)},onPaste:e=>{D?.(e);let t=e.currentTarget;if(e.defaultPrevented||t.readOnly||O==null&&!CSS.supports?.(`-webkit-touch-callout`,`none`))return;e.preventDefault();let n=e.clipboardData.getData(`text/plain`),r=O?O(n):n,i=(H.slice(0,t.selectionStart??H.length)+r+H.slice(t.selectionEnd??H.length)).slice(0,T);c(()=>Z(i));let a=t.value.length;t.setSelectionRange(Math.min(a,T-1),a),Y(t)}})})]})]})},C=({"data-slot":e,asChild:t,children:n,className:r,ref:i,...a})=>/* @__PURE__ */ g(t?p:`div`,{ref:i,"data-slot":f(e,`otp-input-group`),className:d(`relative flex items-center rounded-md has-[[data-highlighted]~[data-highlighted]]:ring-focus-accent has-[[data-highlighted]~[data-highlighted]]:ring-4 group-data-validation/otp:has-[[data-highlighted]~[data-highlighted]]:ring-(--otp-validation-ring)`,r),...a,children:n}),w=({"data-slot":e,className:t,index:n,ref:i,...a})=>{let o=r(b);l(o!=null,`OtpInput.Slot must be rendered inside OtpInput.Root.`);let s=o.value[n],c=m({selection:o.selection,index:n});return/* @__PURE__ */ _(`div`,{ref:i,"data-slot":f(e,`otp-input-slot`),"data-highlighted":c?``:void 0,className:d(`border-form bg-form text-strong relative flex h-10 w-10 items-center justify-center border-y border-e text-sm shadow-sm outline-hidden transition-all duration-150 ease-out first:rounded-s-md first:border-s last:rounded-e-md [&:has(+[data-highlighted])]:group-data-[otp-state=caret]/otp:border-e-transparent data-highlighted:group-data-[otp-state=caret]/otp:border-accent-600 data-highlighted:group-data-[otp-state=caret]/otp:border-s data-highlighted:group-data-[otp-state=caret]/otp:ring-focus-accent data-highlighted:group-data-[otp-state=caret]/otp:z-20 data-highlighted:group-data-[otp-state=caret]/otp:ring-4 group-data-[otp-state=all]/otp:border-accent-600 group-data-validation/otp:border-y-(--otp-validation-border) group-data-validation/otp:first:border-s-(--otp-validation-border) group-data-validation/otp:last:border-e-(--otp-validation-border) group-data-validation/otp:data-highlighted:group-data-[otp-state=caret]/otp:border-(--otp-validation-border) group-data-validation/otp:data-highlighted:group-data-[otp-state=caret]/otp:ring-(--otp-validation-ring) group-data-validation/otp:group-data-[otp-state=all]/otp:border-(--otp-validation-border)`,t),...a,translate:`no`,children:[s,c&&s==null&&/* @__PURE__ */ g(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:/* @__PURE__ */ g(`div`,{className:`bg-strong h-4 w-px animate-pulse`})})]})},T=({"data-slot":t,asChild:n,children:r,className:i,ref:a,semantic:o=!1,...s})=>{let c=n?p:`div`,l=o?{role:`separator`}:{"aria-hidden":!0,role:`none`};return/* @__PURE__ */ g(c,{ref:a,"data-slot":f(t,`otp-input-separator`),className:d(`text-separator flex items-center`,i),...l,...s,children:r??/* @__PURE__ */ g(e,{weight:`bold`})})};export{T as i,w as n,S as r,C as t};
@@ -3,164 +3,28 @@
3
3
  *
4
4
  * @see https://mantle.ngrok.com/components/forms/otp-input
5
5
  */
6
- import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
7
- import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
8
- import { o as WithValidation } from "./field-BshcNVe_.js";
9
- import { ComponentProps, ReactNode } from "react";
10
- import { OTPInput, REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp";
11
- type OtpInputRootProps = Omit<ComponentProps<typeof OTPInput>, "render" | "children"> & WithValidation & {
12
- children?: ReactNode;
13
- } & WithDataSlot;
6
+ import * as OtpInputParts from "./otp-input-parts.js";
14
7
  /**
15
- * The root of the OTP input. Renders an accessible single hidden input that
16
- * captures keystrokes, paste events, and autofill, and exposes per-slot state
17
- * (active, char, fake caret) to descendant `OtpInput.Slot` parts via context.
18
- *
19
- * Wraps the `input-otp` library by Guilherme Rodz.
20
- *
21
- * Pass `validation="error"` (or `"success"` / `"warning"`) to recolor each
22
- * group's outer borders and the active focus ring with the matching validation hue.
23
- * `validation="error"` also sets `aria-invalid` on the underlying input so
24
- * assistive tech announces the failure state.
25
- *
26
- * When composing with `Field.Item`, wrap `OtpInput.Root` in `Field.Control`.
27
- * `Field.Control` flows the generated `id`, `aria-invalid`, `aria-describedby`,
28
- * and `aria-errormessage` through to the underlying focusable input via
29
- * `FieldControlContext`.
30
- *
31
- * **Accessibility.** The hidden input needs an accessible name. Inside a
32
- * `Field.Item`, `Field.Label` supplies it. On its own, pass `aria-label`.
33
- *
34
- * **Password managers.** The hidden input sets `autocomplete="one-time-code"`,
35
- * so 1Password, Bitwarden, Dashlane, and Proton Pass can fill the code. Each
36
- * can also show its badge beside the last slot. Do not add their ignore
37
- * attributes: an ignore attribute also stops the fill. LastPass does not fill
38
- * one-time codes, so the input carries `data-lpignore`.
39
- *
40
- * @see https://mantle.ngrok.com/components/forms/otp-input
8
+ * The `pattern` that accepts digits only.
41
9
  *
42
10
  * @example
43
- * ```tsx
44
- * <OtpInput.Root maxLength={6}>
45
- * <OtpInput.Group>
46
- * <OtpInput.Slot index={0} />
47
- * <OtpInput.Slot index={1} />
48
- * <OtpInput.Slot index={2} />
49
- * </OtpInput.Group>
50
- * <OtpInput.Separator />
51
- * <OtpInput.Group>
52
- * <OtpInput.Slot index={3} />
53
- * <OtpInput.Slot index={4} />
54
- * <OtpInput.Slot index={5} />
55
- * </OtpInput.Group>
56
- * </OtpInput.Root>
57
- * ```
58
- */
59
- declare const Root: ({ "data-slot": dataSlot, "aria-invalid": ariaInvalid, children, className, containerClassName, ref, validation: _validation, ...props }: OtpInputRootProps) => import("react").JSX.Element;
60
- type OtpInputGroupProps = ComponentProps<"div"> & WithAsChild & WithDataSlot;
61
- /**
62
- * Groups one or more `OtpInput.Slot` parts into a visually-connected segment.
63
- * Slots inside a group share rounded corners on the outer edges and join with
64
- * shared borders between adjacent slots.
65
- *
66
- * @see https://mantle.ngrok.com/components/forms/otp-input
67
- *
68
- * @example
69
- * ```tsx
70
- * <OtpInput.Root maxLength={6}>
71
- * <OtpInput.Group>
72
- * <OtpInput.Slot index={0} />
73
- * <OtpInput.Slot index={1} />
74
- * <OtpInput.Slot index={2} />
75
- * </OtpInput.Group>
76
- * <OtpInput.Separator />
77
- * <OtpInput.Group>
78
- * <OtpInput.Slot index={3} />
79
- * <OtpInput.Slot index={4} />
80
- * <OtpInput.Slot index={5} />
81
- * </OtpInput.Group>
82
- * </OtpInput.Root>
83
- * ```
11
+ * <OtpInput.Root maxLength={6} pattern={REGEXP_ONLY_DIGITS} />
84
12
  */
85
- declare const Group: ({ "data-slot": dataSlot, asChild, children, className, ref, ...props }: OtpInputGroupProps) => import("react").JSX.Element;
86
- type OtpInputSlotProps = Omit<ComponentProps<"div">, "translate"> & {
87
- /**
88
- * The zero-based index of the character slot to render. Must be a valid
89
- * index within the parent `OtpInput.Root`'s `maxLength`.
90
- */
91
- index: number;
92
- } & WithDataSlot;
13
+ declare const REGEXP_ONLY_DIGITS = "^\\d+$";
93
14
  /**
94
- * Renders a single character slot for the OTP input. Reads its display state
95
- * (the typed character, active/focused state, and fake caret position) from
96
- * the nearest `OtpInput.Root` via context — so this part must always be
97
- * rendered inside an `OtpInput.Root`.
98
- *
99
- * **Translation.** The slot always carries `translate="no"`, so a browser
100
- * translation engine skips the character inside it. A translated passcode
101
- * character is wrong. The engine also wraps that character's text node in a
102
- * `<font>`, which detaches the node React holds. The next keystroke then makes
103
- * React remove a node its parent no longer owns, and the DOM raises
104
- * `NotFoundError`. The `translate` prop is omitted from the type, so no call
105
- * site can turn the guard off.
106
- *
107
- * @see https://mantle.ngrok.com/components/forms/otp-input
108
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/translate
15
+ * The `pattern` that accepts ASCII letters only.
109
16
  *
110
17
  * @example
111
- * ```tsx
112
- * <OtpInput.Root maxLength={6}>
113
- * <OtpInput.Group>
114
- * <OtpInput.Slot index={0} />
115
- * <OtpInput.Slot index={1} />
116
- * <OtpInput.Slot index={2} />
117
- * </OtpInput.Group>
118
- * <OtpInput.Separator />
119
- * <OtpInput.Group>
120
- * <OtpInput.Slot index={3} />
121
- * <OtpInput.Slot index={4} />
122
- * <OtpInput.Slot index={5} />
123
- * </OtpInput.Group>
124
- * </OtpInput.Root>
125
- * ```
18
+ * <OtpInput.Root maxLength={6} pattern={REGEXP_ONLY_CHARS} />
126
19
  */
127
- declare const OtpInputSlotImpl: ({ "data-slot": dataSlot, className, index, ref, ...props }: OtpInputSlotProps) => import("react").JSX.Element;
128
- type OtpInputSeparatorProps = ComponentProps<"div"> & WithAsChild & {
129
- /**
130
- * If `true`, the separator renders with `role="separator"` so assistive
131
- * tech announces it as a divider between OTP groups.
132
- * If `false`, the separator is purely decorative and is removed from
133
- * the accessibility tree — preferred inside an OTP control where the
134
- * minus icon is visual chrome between slot groups.
135
- *
136
- * @default false
137
- */
138
- semantic?: boolean;
139
- } & WithDataSlot;
20
+ declare const REGEXP_ONLY_CHARS = "^[a-zA-Z]+$";
140
21
  /**
141
- * A visual separator between two `OtpInput.Group` segments. Renders a minus
142
- * icon by default; pass `children` to override the visual.
143
- *
144
- * @see https://mantle.ngrok.com/components/forms/otp-input
22
+ * The `pattern` that accepts ASCII letters and digits.
145
23
  *
146
24
  * @example
147
- * ```tsx
148
- * <OtpInput.Root maxLength={6}>
149
- * <OtpInput.Group>
150
- * <OtpInput.Slot index={0} />
151
- * <OtpInput.Slot index={1} />
152
- * <OtpInput.Slot index={2} />
153
- * </OtpInput.Group>
154
- * <OtpInput.Separator />
155
- * <OtpInput.Group>
156
- * <OtpInput.Slot index={3} />
157
- * <OtpInput.Slot index={4} />
158
- * <OtpInput.Slot index={5} />
159
- * </OtpInput.Group>
160
- * </OtpInput.Root>
161
- * ```
25
+ * <OtpInput.Root maxLength={6} pattern={REGEXP_ONLY_DIGITS_AND_CHARS} />
162
26
  */
163
- declare const Separator: ({ "data-slot": dataSlot, asChild, children, className, ref, semantic, ...props }: OtpInputSeparatorProps) => import("react").JSX.Element;
27
+ declare const REGEXP_ONLY_DIGITS_AND_CHARS = "^[a-zA-Z0-9]+$";
164
28
  /**
165
29
  * Compound component for capturing one-time passcodes (OTP). Combines a
166
30
  * single hidden input (handling paste, autofill, and IME) with a row of
@@ -202,110 +66,5 @@ declare const Separator: ({ "data-slot": dataSlot, asChild, children, className,
202
66
  * </OtpInput.Root>
203
67
  * ```
204
68
  */
205
- declare const OtpInput: {
206
- /**
207
- * The root of the OTP input. Renders an accessible single hidden input that
208
- * captures keystrokes, paste events, and autofill, and exposes per-slot state
209
- * (active, char, fake caret) to descendant `OtpInput.Slot` parts via context.
210
- *
211
- * The hidden input needs an accessible name. Inside a `Field.Item`,
212
- * `Field.Label` supplies it. On its own, pass `aria-label`.
213
- *
214
- * @see https://mantle.ngrok.com/components/forms/otp-input
215
- *
216
- * @example
217
- * ```tsx
218
- * <OtpInput.Root maxLength={6}>
219
- * <OtpInput.Group>
220
- * <OtpInput.Slot index={0} />
221
- * <OtpInput.Slot index={1} />
222
- * <OtpInput.Slot index={2} />
223
- * </OtpInput.Group>
224
- * <OtpInput.Separator />
225
- * <OtpInput.Group>
226
- * <OtpInput.Slot index={3} />
227
- * <OtpInput.Slot index={4} />
228
- * <OtpInput.Slot index={5} />
229
- * </OtpInput.Group>
230
- * </OtpInput.Root>
231
- * ```
232
- */
233
- readonly Root: typeof Root;
234
- /**
235
- * Groups one or more `OtpInput.Slot` parts into a visually-connected
236
- * segment with shared rounded corners and joined borders.
237
- *
238
- * @see https://mantle.ngrok.com/components/forms/otp-input
239
- *
240
- * @example
241
- * ```tsx
242
- * <OtpInput.Root maxLength={6}>
243
- * <OtpInput.Group>
244
- * <OtpInput.Slot index={0} />
245
- * <OtpInput.Slot index={1} />
246
- * <OtpInput.Slot index={2} />
247
- * </OtpInput.Group>
248
- * <OtpInput.Separator />
249
- * <OtpInput.Group>
250
- * <OtpInput.Slot index={3} />
251
- * <OtpInput.Slot index={4} />
252
- * <OtpInput.Slot index={5} />
253
- * </OtpInput.Group>
254
- * </OtpInput.Root>
255
- * ```
256
- */
257
- readonly Group: typeof Group;
258
- /**
259
- * A single character slot. Must be rendered inside an `OtpInput.Root`.
260
- * Reads its character, active state, and fake caret position from the
261
- * root via context.
262
- *
263
- * The slot always carries `translate="no"`, so a browser translation
264
- * engine skips the character inside it.
265
- *
266
- * @see https://mantle.ngrok.com/components/forms/otp-input
267
- *
268
- * @example
269
- * ```tsx
270
- * <OtpInput.Root maxLength={6}>
271
- * <OtpInput.Group>
272
- * <OtpInput.Slot index={0} />
273
- * <OtpInput.Slot index={1} />
274
- * <OtpInput.Slot index={2} />
275
- * </OtpInput.Group>
276
- * <OtpInput.Separator />
277
- * <OtpInput.Group>
278
- * <OtpInput.Slot index={3} />
279
- * <OtpInput.Slot index={4} />
280
- * <OtpInput.Slot index={5} />
281
- * </OtpInput.Group>
282
- * </OtpInput.Root>
283
- * ```
284
- */
285
- readonly Slot: typeof OtpInputSlotImpl;
286
- /**
287
- * A visual separator between two `OtpInput.Group` segments. Renders a
288
- * minus icon by default; pass `children` to override.
289
- *
290
- * @see https://mantle.ngrok.com/components/forms/otp-input
291
- *
292
- * @example
293
- * ```tsx
294
- * <OtpInput.Root maxLength={6}>
295
- * <OtpInput.Group>
296
- * <OtpInput.Slot index={0} />
297
- * <OtpInput.Slot index={1} />
298
- * <OtpInput.Slot index={2} />
299
- * </OtpInput.Group>
300
- * <OtpInput.Separator />
301
- * <OtpInput.Group>
302
- * <OtpInput.Slot index={3} />
303
- * <OtpInput.Slot index={4} />
304
- * <OtpInput.Slot index={5} />
305
- * </OtpInput.Group>
306
- * </OtpInput.Root>
307
- * ```
308
- */
309
- readonly Separator: typeof Separator;
310
- };
69
+ declare const OtpInput: typeof OtpInputParts;
311
70
  export { OtpInput, REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS };
package/dist/otp-input.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./css-properties-D85fCNV3.js";import{t}from"./cx-CK7o_rVv.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./field-Bihblt8U.js";import{t as i}from"./input-BjCDSOPA.js";import{a,r as o}from"./field-CPvjazWN.js";import{t as s}from"./slot-DdYN1L1C.js";import{c}from"react/compiler-runtime";import{useContext as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{MinusIcon as f}from"@phosphor-icons/react/Minus";import{OTPInput as p,OTPInputContext as m,REGEXP_ONLY_CHARS as h,REGEXP_ONLY_DIGITS as g,REGEXP_ONLY_DIGITS_AND_CHARS as _}from"input-otp";const v={error:`danger`,success:`success`,warning:`warning`},y=e=>`var(--color-${e}-600)`,b=e=>`var(--ring-color-focus-${e})`,x=({totalActive:e,total:t})=>e===0?`idle`:e===1?`caret`:e===t?`all`:`range`,S=t=>{let n=c(10),{children:r,validation:i}=t,a=l(m),o=a.slots.length,s;if(n[0]!==a.slots||n[1]!==o){let e=a.slots.reduce(w,0);s=x({totalActive:e,total:o}),n[0]=a.slots,n[1]=o,n[2]=s}else s=n[2];let d=s,f=i?v[i]:void 0,p;n[3]===f?p=n[4]:(p=f?e({"--otp-validation-border":y(f),"--otp-validation-ring":b(f)}):void 0,n[3]=f,n[4]=p);let h=p,g=i||void 0,_;return n[5]!==r||n[6]!==d||n[7]!==g||n[8]!==h?(_=/* @__PURE__ */ u(`div`,{className:`group/otp contents`,"data-otp-state":d,"data-validation":g,style:h,children:r}),n[5]=r,n[6]=d,n[7]=g,n[8]=h,n[9]=_):_=n[9],_},C={Root:e=>{let s=c(32),d,f,m,h,g,_,v,y;s[0]===e?(d=s[1],f=s[2],m=s[3],h=s[4],g=s[5],_=s[6],v=s[7],y=s[8]):({"data-slot":_,"aria-invalid":f,children:m,className:h,containerClassName:g,ref:y,validation:d,...v}=e,s[0]=e,s[1]=d,s[2]=f,s[3]=m,s[4]=h,s[5]=g,s[6]=_,s[7]=v,s[8]=y);let b=a(),x=l(r),C=d??b,w;s[9]!==f||s[10]!==C?(w=o({"aria-invalid":f,defaultAriaInvalid:!1,validation:C}),s[9]=f,s[10]=C,s[11]=w):w=s[11];let{ariaInvalid:T,validation:E}=w,D;s[12]===_?D=s[13]:(D=n(_,`otp-input`),s[12]=_,s[13]=D);let O;s[14]===g?O=s[15]:(O=t(`flex items-center gap-2 has-disabled:opacity-50`,g),s[14]=g,s[15]=O);let k;s[16]===h?k=s[17]:(k=t(`disabled:cursor-not-allowed`,h),s[16]=h,s[17]=k);let A;s[18]===x?A=s[19]:(A=x?{"aria-describedby":x[`aria-describedby`],"aria-errormessage":x[`aria-errormessage`],id:x.id,name:x.name}:void 0,s[18]=x,s[19]=A);let j;s[20]!==m||s[21]!==E?(j=/* @__PURE__ */ u(S,{validation:E,children:m}),s[20]=m,s[21]=E,s[22]=j):j=s[22];let M;return s[23]!==v||s[24]!==y||s[25]!==T||s[26]!==D||s[27]!==O||s[28]!==k||s[29]!==A||s[30]!==j?(M=/* @__PURE__ */ u(p,{ref:y,"aria-invalid":T,"data-slot":D,containerClassName:O,className:k,"data-lpignore":i[`data-lpignore`],...v,...A,children:j}),s[23]=v,s[24]=y,s[25]=T,s[26]=D,s[27]=O,s[28]=k,s[29]=A,s[30]=j,s[31]=M):M=s[31],M},Group:e=>{let r=c(18),i,a,o,l,d,f;r[0]===e?(i=r[1],a=r[2],o=r[3],l=r[4],d=r[5],f=r[6]):({"data-slot":l,asChild:i,children:a,className:o,ref:f,...d}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=l,r[5]=d,r[6]=f);let p=i?s:`div`,m;r[7]===l?m=r[8]:(m=n(l,`otp-input-group`),r[7]=l,r[8]=m);let h;r[9]===o?h=r[10]:(h=t(`relative flex items-center rounded-md`,`has-[[data-active]~[data-active]]:ring-focus-accent has-[[data-active]~[data-active]]:ring-4`,`group-data-validation/otp:has-[[data-active]~[data-active]]:ring-(--otp-validation-ring)`,o),r[9]=o,r[10]=h);let g;return r[11]!==p||r[12]!==a||r[13]!==d||r[14]!==f||r[15]!==m||r[16]!==h?(g=/* @__PURE__ */ u(p,{ref:f,"data-slot":m,className:h,...d,children:a}),r[11]=p,r[12]=a,r[13]=d,r[14]=f,r[15]=m,r[16]=h,r[17]=g):g=r[17],g},Slot:e=>{let r=c(20),i,a,o,s,f;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4],f=r[5]):({"data-slot":a,className:i,index:o,ref:f,...s}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=f);let p=l(m).slots[o],h=p?.char??null,g=p?.hasFakeCaret??!1,_=p?.isActive??!1,v;r[6]===a?v=r[7]:(v=n(a,`otp-input-slot`),r[6]=a,r[7]=v);let y=_?``:void 0,b;r[8]===i?b=r[9]:(b=t(`border-form bg-form text-strong relative flex h-10 w-10 items-center justify-center border-y border-r text-sm shadow-sm outline-hidden transition-all duration-150 ease-out`,`first:rounded-l-md first:border-l last:rounded-r-md`,`[&:has(+[data-active])]:group-data-[otp-state=caret]/otp:border-r-transparent`,`data-active:group-data-[otp-state=caret]/otp:border-accent-600`,`data-active:group-data-[otp-state=caret]/otp:border-l`,`data-active:group-data-[otp-state=caret]/otp:ring-focus-accent`,`data-active:group-data-[otp-state=caret]/otp:z-20`,`data-active:group-data-[otp-state=caret]/otp:ring-4`,`group-data-[otp-state=all]/otp:border-accent-600`,`group-data-validation/otp:border-y-(--otp-validation-border)`,`group-data-validation/otp:first:border-l-(--otp-validation-border)`,`group-data-validation/otp:last:border-r-(--otp-validation-border)`,`group-data-validation/otp:data-active:group-data-[otp-state=caret]/otp:border-(--otp-validation-border)`,`group-data-validation/otp:data-active:group-data-[otp-state=caret]/otp:ring-(--otp-validation-ring)`,`group-data-validation/otp:group-data-[otp-state=all]/otp:border-(--otp-validation-border)`,i),r[8]=i,r[9]=b);let x;r[10]===g?x=r[11]:(x=g&&/* @__PURE__ */ u(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:/* @__PURE__ */ u(`div`,{className:`bg-strong h-4 w-px animate-pulse`})}),r[10]=g,r[11]=x);let S;return r[12]!==h||r[13]!==s||r[14]!==f||r[15]!==v||r[16]!==y||r[17]!==b||r[18]!==x?(S=/* @__PURE__ */ d(`div`,{ref:f,"data-slot":v,"data-active":y,className:b,...s,translate:`no`,children:[h,x]}),r[12]=h,r[13]=s,r[14]=f,r[15]=v,r[16]=y,r[17]=b,r[18]=x,r[19]=S):S=r[19],S},Separator:e=>{let r=c(24),i,a,o,l,d,p,m;r[0]===e?(i=r[1],a=r[2],o=r[3],l=r[4],d=r[5],p=r[6],m=r[7]):({"data-slot":l,asChild:i,children:a,className:o,ref:p,semantic:m,...d}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=l,r[5]=d,r[6]=p,r[7]=m);let h=m!==void 0&&m,g=i?s:`div`,_;r[8]===h?_=r[9]:(_=h?{role:`separator`}:{"aria-hidden":!0,role:`none`},r[8]=h,r[9]=_);let v=_,y;r[10]===l?y=r[11]:(y=n(l,`otp-input-separator`),r[10]=l,r[11]=y);let b;r[12]===o?b=r[13]:(b=t(`text-separator flex items-center`,o),r[12]=o,r[13]=b);let x;r[14]===a?x=r[15]:(x=a??/* @__PURE__ */ u(f,{weight:`bold`}),r[14]=a,r[15]=x);let S;return r[16]!==g||r[17]!==d||r[18]!==p||r[19]!==v||r[20]!==y||r[21]!==b||r[22]!==x?(S=/* @__PURE__ */ u(g,{ref:p,"data-slot":y,className:b,...v,...d,children:x}),r[16]=g,r[17]=d,r[18]=p,r[19]=v,r[20]=y,r[21]=b,r[22]=x,r[23]=S):S=r[23],S}};function w(e,t){return e+ +!!t.isActive}export{C as OtpInput,h as REGEXP_ONLY_CHARS,g as REGEXP_ONLY_DIGITS,_ as REGEXP_ONLY_DIGITS_AND_CHARS};
1
+ import*as e from"./otp-input-parts.js";const t=`^\\d+$`,n=`^[a-zA-Z]+$`,r=`^[a-zA-Z0-9]+$`;export{e as OtpInput,n as REGEXP_ONLY_CHARS,t as REGEXP_ONLY_DIGITS,r as REGEXP_ONLY_DIGITS_AND_CHARS};
@@ -0,0 +1 @@
1
+ const e=/* @__PURE__ */ new Map;let t=null;function n(e,t){e.parentElement!==t&&(e.isConnected&&t.isConnected&&`moveBefore`in t?t.moveBefore(e,null):t.append(e))}function r(e,r){t!=null&&e.contains(t)||(e.querySelector(`dialog:modal`)??n(e,t==null||t.contains(r)?r:t))}function i(t,n){return e.set(t,n),r(t,n),()=>{e.delete(t),t.remove()}}function a(n){t=n;for(let[t,n]of e)r(t,n)}export{a as n,i as t};
@@ -0,0 +1 @@
1
+ "use client";import{useLayoutEffect as e,useRef as t,useState as n}from"react";import{createPortal as r}from"react-dom";import{t as i}from"./hooks-BeLOGKwE.js";import{t as a}from"./browser-only-ymFoM3Ya.js";import{t as o}from"./compose-refs-Ce1vWUz0.js";import{t as s}from"./utils-EM6s2WEU.js";import{t as c}from"./layer-container-DDOZJ0fn.js";import{t as l}from"./overlay-prompt-BIzMQvx7.js";import{jsx as u}from"react/jsx-runtime";function d(){let e=document.createElement(`div`);return e.className=`overlay-prompt`,e.style.display=`contents`,e}function f({children:f,"data-slot":p,ref:m}){let h=i(),[g]=n(()=>a()?d():null),[_,v]=n(!1),y=t(null),b=o(y,m);e(()=>{let e=y.current;if(g==null||e==null)return;let t=l(g,e);return v(!0),t},[g]);let x=/* @__PURE__ */ u(c,{className:`contents`,modal:!1,children:f}),S=x;return h&&g!=null&&(S=_?r(x,g):null),/* @__PURE__ */ u(`div`,{className:`contents`,"data-slot":s(p,`overlay-prompt`),ref:b,children:S})}export{f as t};