@purpur/library 9.6.0 → 9.7.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 (286) hide show
  1. package/CHANGELOG.json +45 -0
  2. package/CHANGELOG.md +19 -1
  3. package/dist/LICENSE.txt +7 -7
  4. package/dist/ThemeProvider-D7oXcAde.js +2 -0
  5. package/dist/{ThemeProvider-Dy771oix.js.map → ThemeProvider-D7oXcAde.js.map} +1 -1
  6. package/dist/ThemeProvider-DiDBfyFA.mjs +348 -0
  7. package/dist/{ThemeProvider-CkX-BNWN.mjs.map → ThemeProvider-DiDBfyFA.mjs.map} +1 -1
  8. package/dist/carousel-BIKcwvYz.mjs +1658 -0
  9. package/dist/carousel-BIKcwvYz.mjs.map +1 -0
  10. package/dist/carousel-DnSaLDZf.js +2 -0
  11. package/dist/carousel-DnSaLDZf.js.map +1 -0
  12. package/dist/carousel.cjs.js +1 -1
  13. package/dist/carousel.es.js +1 -1
  14. package/dist/{comparison-table-Nhp5W6Yc.js → comparison-table-0UDB2BTU.js} +2 -2
  15. package/dist/{comparison-table-Nhp5W6Yc.js.map → comparison-table-0UDB2BTU.js.map} +1 -1
  16. package/dist/{comparison-table-CZMKl1TX.mjs → comparison-table-CjTE-fHN.mjs} +48 -48
  17. package/dist/{comparison-table-CZMKl1TX.mjs.map → comparison-table-CjTE-fHN.mjs.map} +1 -1
  18. package/dist/comparison-table.cjs.js +1 -1
  19. package/dist/comparison-table.es.js +1 -1
  20. package/dist/components/button/src/button.visual.fixtures.d.ts +43 -0
  21. package/dist/components/button/src/button.visual.fixtures.d.ts.map +1 -0
  22. package/dist/components/carousel/src/carousel.d.ts.map +1 -1
  23. package/dist/components/date-picker/src/date-picker.d.ts +8 -0
  24. package/dist/components/date-picker/src/date-picker.d.ts.map +1 -1
  25. package/dist/components/drawer/src/drawer-content.d.ts +21 -0
  26. package/dist/components/drawer/src/drawer-content.d.ts.map +1 -1
  27. package/dist/components/hero-banner/src/hero-banner.visual.fixtures.d.ts +14 -0
  28. package/dist/components/hero-banner/src/hero-banner.visual.fixtures.d.ts.map +1 -0
  29. package/dist/components/modal/src/modal-content.d.ts +21 -0
  30. package/dist/components/modal/src/modal-content.d.ts.map +1 -1
  31. package/dist/components/modal/src/modal.d.ts +2 -0
  32. package/dist/components/modal/src/modal.d.ts.map +1 -1
  33. package/dist/components/popover/src/popover-content.d.ts +14 -0
  34. package/dist/components/popover/src/popover-content.d.ts.map +1 -1
  35. package/dist/components/radio-card-group/src/is-radio-card-item.d.ts +4 -0
  36. package/dist/components/radio-card-group/src/is-radio-card-item.d.ts.map +1 -0
  37. package/dist/components/radio-card-group/src/radio-card-group.constants.d.ts +5 -0
  38. package/dist/components/radio-card-group/src/radio-card-group.constants.d.ts.map +1 -0
  39. package/dist/components/radio-card-group/src/radio-card-group.d.ts +5 -6
  40. package/dist/components/radio-card-group/src/radio-card-group.d.ts.map +1 -1
  41. package/dist/components/radio-card-group/src/radio-card-item.d.ts +1 -2
  42. package/dist/components/radio-card-group/src/radio-card-item.d.ts.map +1 -1
  43. package/dist/components/search-field/src/search-field-autocomplete.d.ts +6 -3
  44. package/dist/components/search-field/src/search-field-autocomplete.d.ts.map +1 -1
  45. package/dist/components/search-field/src/search-field-base.d.ts +10 -3
  46. package/dist/components/search-field/src/search-field-base.d.ts.map +1 -1
  47. package/dist/components/search-field/src/search-field-button.d.ts +3 -1
  48. package/dist/components/search-field/src/search-field-button.d.ts.map +1 -1
  49. package/dist/components/search-field/src/search-field.d.ts +12 -6
  50. package/dist/components/search-field/src/search-field.d.ts.map +1 -1
  51. package/dist/components/table/src/drag-indicator-circle.d.ts +8 -1
  52. package/dist/components/table/src/drag-indicator-circle.d.ts.map +1 -1
  53. package/dist/components/table/src/table.d.ts.map +1 -1
  54. package/dist/components/tooltip/src/tooltip.d.ts +21 -0
  55. package/dist/components/tooltip/src/tooltip.d.ts.map +1 -1
  56. package/dist/components-metadata.js +0 -2
  57. package/dist/date-picker-CIizn3Pv.js +2 -0
  58. package/dist/{date-picker-uyPKJulK.js.map → date-picker-CIizn3Pv.js.map} +1 -1
  59. package/dist/date-picker-DixxW60s.mjs +1617 -0
  60. package/dist/{date-picker-CzxhZxsw.mjs.map → date-picker-DixxW60s.mjs.map} +1 -1
  61. package/dist/date-picker.cjs.js +1 -1
  62. package/dist/date-picker.es.js +1 -1
  63. package/dist/drawer-BzkRd9F0.mjs +577 -0
  64. package/dist/drawer-BzkRd9F0.mjs.map +1 -0
  65. package/dist/drawer-DyhsP34o.js +2 -0
  66. package/dist/drawer-DyhsP34o.js.map +1 -0
  67. package/dist/drawer.cjs.js +1 -1
  68. package/dist/drawer.es.js +1 -1
  69. package/dist/{footer-D9AcPwlH.js → footer-3Y-664-8.js} +2 -2
  70. package/dist/{footer-D9AcPwlH.js.map → footer-3Y-664-8.js.map} +1 -1
  71. package/dist/{footer-BLPlXaZK.mjs → footer-DenAcikt.mjs} +3 -3
  72. package/dist/{footer-BLPlXaZK.mjs.map → footer-DenAcikt.mjs.map} +1 -1
  73. package/dist/footer.cjs.js +1 -1
  74. package/dist/footer.es.js +1 -1
  75. package/dist/{hero-banner-DkC_BqM7.mjs → hero-banner-B7xrDfzN.mjs} +2 -2
  76. package/dist/{hero-banner-DkC_BqM7.mjs.map → hero-banner-B7xrDfzN.mjs.map} +1 -1
  77. package/dist/{hero-banner-D1A-_qou.js → hero-banner-DthITuQ7.js} +2 -2
  78. package/dist/{hero-banner-D1A-_qou.js.map → hero-banner-DthITuQ7.js.map} +1 -1
  79. package/dist/hero-banner.cjs.js +1 -1
  80. package/dist/hero-banner.es.js +1 -1
  81. package/dist/libraries/theme/src/ThemeProvider.d.ts.map +1 -1
  82. package/dist/libraries/theme/src/theme.d.ts +1 -0
  83. package/dist/libraries/theme/src/theme.d.ts.map +1 -1
  84. package/dist/libraries/theme/src/types.d.ts +7 -0
  85. package/dist/libraries/theme/src/types.d.ts.map +1 -1
  86. package/dist/libraries/theme/src/useThemePortalContainer.d.ts +12 -0
  87. package/dist/libraries/theme/src/useThemePortalContainer.d.ts.map +1 -0
  88. package/dist/library.cjs.js +1 -1
  89. package/dist/library.es.js +469 -469
  90. package/dist/library.es.js.map +1 -1
  91. package/dist/modal-DJn9idcw.js +2 -0
  92. package/dist/modal-DJn9idcw.js.map +1 -0
  93. package/dist/{modal-fp37VbrH.mjs → modal-EIP36327.mjs} +83 -80
  94. package/dist/modal-EIP36327.mjs.map +1 -0
  95. package/dist/modal.cjs.js +1 -1
  96. package/dist/modal.es.js +1 -1
  97. package/dist/{popover-I26xNbTz.mjs → popover-DERrvReO.mjs} +328 -325
  98. package/dist/popover-DERrvReO.mjs.map +1 -0
  99. package/dist/popover-DnGgzfQr.js +2 -0
  100. package/dist/popover-DnGgzfQr.js.map +1 -0
  101. package/dist/popover.cjs.js +1 -1
  102. package/dist/popover.es.js +1 -1
  103. package/dist/{promotion-card-BiHnQvhn.mjs → promotion-card-BnzIVNQ4.mjs} +2 -2
  104. package/dist/{promotion-card-BiHnQvhn.mjs.map → promotion-card-BnzIVNQ4.mjs.map} +1 -1
  105. package/dist/{promotion-card-Bag64gqP.js → promotion-card-DKc2Cx1h.js} +2 -2
  106. package/dist/{promotion-card-Bag64gqP.js.map → promotion-card-DKc2Cx1h.js.map} +1 -1
  107. package/dist/promotion-card.cjs.js +1 -1
  108. package/dist/promotion-card.es.js +1 -1
  109. package/dist/purpur.css +1 -1
  110. package/dist/radio-card-group-ZBXjYcQs.mjs +166 -0
  111. package/dist/radio-card-group-ZBXjYcQs.mjs.map +1 -0
  112. package/dist/radio-card-group-nrDi5EPK.js +2 -0
  113. package/dist/radio-card-group-nrDi5EPK.js.map +1 -0
  114. package/dist/radio-card-group.cjs.js +1 -1
  115. package/dist/radio-card-group.es.js +3 -5
  116. package/dist/search-field-2vdDbiT0.js +2 -0
  117. package/dist/search-field-2vdDbiT0.js.map +1 -0
  118. package/dist/search-field-DKyNh7pE.mjs +167 -0
  119. package/dist/search-field-DKyNh7pE.mjs.map +1 -0
  120. package/dist/search-field.cjs.js +1 -1
  121. package/dist/search-field.es.js +1 -1
  122. package/dist/{stepper-CWR2vGPj.mjs → stepper-BDsSa6yr.mjs} +2 -2
  123. package/dist/{stepper-CWR2vGPj.mjs.map → stepper-BDsSa6yr.mjs.map} +1 -1
  124. package/dist/{stepper-Df4X7DDR.js → stepper-DpauItjx.js} +2 -2
  125. package/dist/{stepper-Df4X7DDR.js.map → stepper-DpauItjx.js.map} +1 -1
  126. package/dist/stepper.cjs.js +1 -1
  127. package/dist/stepper.es.js +1 -1
  128. package/dist/{table-gnGUejtb.js → table-BOCcBzSO.js} +4 -4
  129. package/dist/table-BOCcBzSO.js.map +1 -0
  130. package/dist/{table-g_n68i4s.mjs → table-i1Gs9e0e.mjs} +440 -440
  131. package/dist/table-i1Gs9e0e.mjs.map +1 -0
  132. package/dist/table.cjs.js +1 -1
  133. package/dist/table.es.js +1 -1
  134. package/dist/{text-area-peNKG7g4.js → text-area-D0truMT1.js} +2 -2
  135. package/dist/{text-area-peNKG7g4.js.map → text-area-D0truMT1.js.map} +1 -1
  136. package/dist/{text-area-kJvg6cFp.mjs → text-area-IVH-k4MM.mjs} +3 -3
  137. package/dist/{text-area-kJvg6cFp.mjs.map → text-area-IVH-k4MM.mjs.map} +1 -1
  138. package/dist/text-area.cjs.js +1 -1
  139. package/dist/text-area.es.js +1 -1
  140. package/dist/theme.cjs.js +1 -1
  141. package/dist/theme.es.js +8 -6
  142. package/dist/theme.es.js.map +1 -1
  143. package/dist/tooltip-CJGmJDFQ.js +2 -0
  144. package/dist/{tooltip-C8Zxnqdb.js.map → tooltip-CJGmJDFQ.js.map} +1 -1
  145. package/dist/{tooltip-LU2Cy-QC.mjs → tooltip-RA-03bKs.mjs} +277 -274
  146. package/dist/{tooltip-LU2Cy-QC.mjs.map → tooltip-RA-03bKs.mjs.map} +1 -1
  147. package/dist/tooltip.cjs.js +1 -1
  148. package/dist/tooltip.es.js +1 -1
  149. package/dist/{useColorScheme-tAkY9LHt.mjs → useColorScheme-B9DWd-LN.mjs} +2 -2
  150. package/dist/{useColorScheme-tAkY9LHt.mjs.map → useColorScheme-B9DWd-LN.mjs.map} +1 -1
  151. package/dist/useColorScheme-DbTQjxNB.js +2 -0
  152. package/dist/{useColorScheme-DNyjsWX9.js.map → useColorScheme-DbTQjxNB.js.map} +1 -1
  153. package/dist/useThemePortalContainer-D9BYjEvT.js +2 -0
  154. package/dist/useThemePortalContainer-D9BYjEvT.js.map +1 -0
  155. package/dist/useThemePortalContainer-tFLTaYKN.mjs +9 -0
  156. package/dist/useThemePortalContainer-tFLTaYKN.mjs.map +1 -0
  157. package/package.json +26 -26
  158. package/src/library.ts +2 -71
  159. package/dist/ThemeProvider-CkX-BNWN.mjs +0 -337
  160. package/dist/ThemeProvider-Dy771oix.js +0 -2
  161. package/dist/carousel-DLkTL9sj.mjs +0 -1633
  162. package/dist/carousel-DLkTL9sj.mjs.map +0 -1
  163. package/dist/carousel-DXrtxRz5.js +0 -2
  164. package/dist/carousel-DXrtxRz5.js.map +0 -1
  165. package/dist/date-picker-CzxhZxsw.mjs +0 -1611
  166. package/dist/date-picker-uyPKJulK.js +0 -2
  167. package/dist/drawer-8Acg4wkV.mjs +0 -574
  168. package/dist/drawer-8Acg4wkV.mjs.map +0 -1
  169. package/dist/drawer-BLHgcEqb.js +0 -2
  170. package/dist/drawer-BLHgcEqb.js.map +0 -1
  171. package/dist/modal-Baisuc6m.js +0 -2
  172. package/dist/modal-Baisuc6m.js.map +0 -1
  173. package/dist/modal-fp37VbrH.mjs.map +0 -1
  174. package/dist/popover-B0XJZ5mj.js +0 -2
  175. package/dist/popover-B0XJZ5mj.js.map +0 -1
  176. package/dist/popover-I26xNbTz.mjs.map +0 -1
  177. package/dist/radio-card-group-CneOprGY.mjs +0 -168
  178. package/dist/radio-card-group-CneOprGY.mjs.map +0 -1
  179. package/dist/radio-card-group-Ctuvg61o.js +0 -2
  180. package/dist/radio-card-group-Ctuvg61o.js.map +0 -1
  181. package/dist/search-field-CpkHGIYi.mjs +0 -151
  182. package/dist/search-field-CpkHGIYi.mjs.map +0 -1
  183. package/dist/search-field-Z0PqDARl.js +0 -2
  184. package/dist/search-field-Z0PqDARl.js.map +0 -1
  185. package/dist/table-g_n68i4s.mjs.map +0 -1
  186. package/dist/table-gnGUejtb.js.map +0 -1
  187. package/dist/tooltip-C8Zxnqdb.js +0 -2
  188. package/dist/useColorScheme-DNyjsWX9.js +0 -2
  189. package/tokens/_dark.scss +0 -9
  190. package/tokens/_index.scss +0 -9
  191. package/tokens/border/variables.css +0 -13
  192. package/tokens/border/variables.d.ts +0 -10
  193. package/tokens/border/variables.dark.css +0 -12
  194. package/tokens/border/variables.dark.d.ts +0 -10
  195. package/tokens/border/variables.dark.js +0 -10
  196. package/tokens/border/variables.dark.json +0 -18
  197. package/tokens/border/variables.dark.scss +0 -10
  198. package/tokens/border/variables.js +0 -10
  199. package/tokens/border/variables.json +0 -18
  200. package/tokens/border/variables.scss +0 -10
  201. package/tokens/breakpoint/variables.css +0 -11
  202. package/tokens/breakpoint/variables.d.ts +0 -8
  203. package/tokens/breakpoint/variables.dark.css +0 -10
  204. package/tokens/breakpoint/variables.dark.d.ts +0 -8
  205. package/tokens/breakpoint/variables.dark.js +0 -8
  206. package/tokens/breakpoint/variables.dark.json +0 -14
  207. package/tokens/breakpoint/variables.dark.scss +0 -8
  208. package/tokens/breakpoint/variables.js +0 -8
  209. package/tokens/breakpoint/variables.json +0 -14
  210. package/tokens/breakpoint/variables.scss +0 -8
  211. package/tokens/color/variables.css +0 -262
  212. package/tokens/color/variables.d.ts +0 -253
  213. package/tokens/color/variables.dark.css +0 -262
  214. package/tokens/color/variables.dark.d.ts +0 -252
  215. package/tokens/color/variables.dark.js +0 -252
  216. package/tokens/color/variables.dark.json +0 -306
  217. package/tokens/color/variables.dark.scss +0 -252
  218. package/tokens/color/variables.js +0 -253
  219. package/tokens/color/variables.json +0 -307
  220. package/tokens/color/variables.scss +0 -253
  221. package/tokens/dark.css +0 -9
  222. package/tokens/dark.d.ts +0 -9
  223. package/tokens/dark.js +0 -9
  224. package/tokens/filter/variables.css +0 -4
  225. package/tokens/filter/variables.d.ts +0 -1
  226. package/tokens/filter/variables.dark.css +0 -3
  227. package/tokens/filter/variables.dark.d.ts +0 -1
  228. package/tokens/filter/variables.dark.js +0 -1
  229. package/tokens/filter/variables.dark.json +0 -7
  230. package/tokens/filter/variables.dark.scss +0 -1
  231. package/tokens/filter/variables.js +0 -1
  232. package/tokens/filter/variables.json +0 -7
  233. package/tokens/filter/variables.scss +0 -1
  234. package/tokens/gradient/variables.css +0 -53
  235. package/tokens/gradient/variables.d.ts +0 -9
  236. package/tokens/gradient/variables.dark.css +0 -51
  237. package/tokens/gradient/variables.dark.d.ts +0 -9
  238. package/tokens/gradient/variables.dark.js +0 -18
  239. package/tokens/gradient/variables.dark.json +0 -27
  240. package/tokens/gradient/variables.dark.scss +0 -36
  241. package/tokens/gradient/variables.js +0 -18
  242. package/tokens/gradient/variables.json +0 -27
  243. package/tokens/gradient/variables.scss +0 -42
  244. package/tokens/index.css +0 -18
  245. package/tokens/index.d.ts +0 -9
  246. package/tokens/index.js +0 -9
  247. package/tokens/motion/variables.css +0 -14
  248. package/tokens/motion/variables.d.ts +0 -11
  249. package/tokens/motion/variables.dark.css +0 -13
  250. package/tokens/motion/variables.dark.d.ts +0 -11
  251. package/tokens/motion/variables.dark.js +0 -11
  252. package/tokens/motion/variables.dark.json +0 -19
  253. package/tokens/motion/variables.dark.scss +0 -11
  254. package/tokens/motion/variables.js +0 -11
  255. package/tokens/motion/variables.json +0 -19
  256. package/tokens/motion/variables.scss +0 -11
  257. package/tokens/shadow/variables.css +0 -11
  258. package/tokens/shadow/variables.d.ts +0 -4
  259. package/tokens/shadow/variables.dark.css +0 -10
  260. package/tokens/shadow/variables.dark.d.ts +0 -4
  261. package/tokens/shadow/variables.dark.js +0 -4
  262. package/tokens/shadow/variables.dark.json +0 -8
  263. package/tokens/shadow/variables.dark.scss +0 -4
  264. package/tokens/shadow/variables.js +0 -4
  265. package/tokens/shadow/variables.json +0 -8
  266. package/tokens/shadow/variables.scss +0 -4
  267. package/tokens/spacing/variables.css +0 -26
  268. package/tokens/spacing/variables.d.ts +0 -23
  269. package/tokens/spacing/variables.dark.css +0 -17
  270. package/tokens/spacing/variables.dark.d.ts +0 -15
  271. package/tokens/spacing/variables.dark.js +0 -15
  272. package/tokens/spacing/variables.dark.json +0 -19
  273. package/tokens/spacing/variables.dark.scss +0 -15
  274. package/tokens/spacing/variables.js +0 -23
  275. package/tokens/spacing/variables.json +0 -31
  276. package/tokens/spacing/variables.scss +0 -23
  277. package/tokens/typography/variables.css +0 -30
  278. package/tokens/typography/variables.d.ts +0 -26
  279. package/tokens/typography/variables.dark.css +0 -29
  280. package/tokens/typography/variables.dark.d.ts +0 -26
  281. package/tokens/typography/variables.dark.js +0 -28
  282. package/tokens/typography/variables.dark.json +0 -38
  283. package/tokens/typography/variables.dark.scss +0 -26
  284. package/tokens/typography/variables.js +0 -28
  285. package/tokens/typography/variables.json +0 -38
  286. package/tokens/typography/variables.scss +0 -26
@@ -1,2 +0,0 @@
1
- "use strict";const C=require("react/jsx-runtime"),M=require("react"),x=require("./floating-ui.react-dom-Cc_YSprQ.js"),Vt=require("react-dom"),xe=require("./calendar-BXQ3v62X.js"),Ye=require("./date-field-BKKty89_.js"),qe=require("./date-range-field-D8vLeSwp.js"),he=require("./drawer-BLHgcEqb.js"),Ut=require("./bind-DeUYJ6m9.js");;/* empty css */const Xe=require("./format-CFKKBdIQ.js");function Rt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const d=Rt(M),zt=Rt(Vt);var Gt=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Fe=Gt.join(","),Et=typeof Element>"u",ye=Et?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ae=!Et&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},ke=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):ke(t.parentNode));return i},Yt=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},yt=function(t,n,r){if(ke(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Fe));return n&&ye.call(t,Fe)&&o.unshift(t),o=o.filter(r),o},Oe=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!ke(i,!1))if(i.tagName==="SLOT"){var u=i.assignedElements(),l=u.length?u:i.children,a=Oe(l,!0,r);r.flatten?o.push.apply(o,a):o.push({scopeParent:i,candidates:a})}else{var v=ye.call(i,Fe);v&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var y=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),k=!ke(y,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(y&&k){var g=Oe(y===!0?i.children:y.children,!0,r);r.flatten?o.push.apply(o,g):o.push({scopeParent:i,candidates:g})}else s.unshift.apply(s,i.children)}}return o},wt=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},xt=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Yt(t))&&!wt(t)?0:t.tabIndex},Xt=function(t,n){var r=xt(t);return r<0&&n&&!wt(t)?0:r},Jt=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Tt=function(t){return t.tagName==="INPUT"},Qt=function(t){return Tt(t)&&t.type==="hidden"},Zt=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},en=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},tn=function(t){if(!t.name)return!0;var n=t.form||Ae(t),r=function(u){return n.querySelectorAll('input[type="radio"][name="'+u+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=en(o,t.form);return!s||s===t},nn=function(t){return Tt(t)&&t.type==="radio"},rn=function(t){return nn(t)&&!tn(t)},on=function(t){var n,r=t&&Ae(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,u,l;for(s=!!((i=o)!==null&&i!==void 0&&(u=i.ownerDocument)!==null&&u!==void 0&&u.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&o;){var a,v,y;r=Ae(o),o=(a=r)===null||a===void 0?void 0:a.host,s=!!((v=o)!==null&&v!==void 0&&(y=v.ownerDocument)!==null&&y!==void 0&&y.contains(o))}}return s},Je=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},sn=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=ye.call(t,"details>summary:first-of-type"),u=i?t.parentElement:t;if(ye.call(u,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var l=t;t;){var a=t.parentElement,v=Ae(t);if(a&&!a.shadowRoot&&o(a)===!0)return Je(t);t.assignedSlot?t=t.assignedSlot:!a&&v!==t.ownerDocument?t=v.host:t=a}t=l}if(on(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Je(t);return!1},an=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return ye.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Be=function(t,n){return!(n.disabled||Qt(n)||sn(n,t)||Zt(n)||an(n))},He=function(t,n){return!(rn(n)||xt(n)<0||!Be(t,n))},un=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},St=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,u=i?o.scopeParent:o,l=Xt(u,i),a=i?St(o.candidates):u;l===0?i?n.push.apply(n,a):n.push(u):r.push({documentOrder:s,tabIndex:l,item:o,isScope:i,content:a})}),r.sort(Jt).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Me=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Oe([t],n.includeContainer,{filter:He.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:un}):r=yt(t,n.includeContainer,He.bind(null,n)),St(r)},cn=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Oe([t],n.includeContainer,{filter:Be.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=yt(t,n.includeContainer,Be.bind(null,n)),r},Ct=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return ye.call(t,Fe)===!1?!1:He(n,t)};function ln(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function It(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function fn(){return/apple/i.test(navigator.vendor)}function Ke(){const e=/android/i;return e.test(ln())||e.test(It())}function dn(){return It().includes("jsdom/")}const Qe="data-floating-ui-focusable",mn="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function pe(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Q(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&x.isShadowRoot(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function fe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ne(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function gn(e){return e.matches("html,body")}function te(e){return e?.ownerDocument||document}function Dt(e){return x.isHTMLElement(e)&&e.matches(mn)}function Ze(e){return e?e.getAttribute("role")==="combobox"&&Dt(e):!1}function et(e){return e?e.hasAttribute(Qe)?e:e.querySelector("["+Qe+"]")||e:null}function Re(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var s;return o.parentId===t&&(!n||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...Re(e,o.id,n)])}function tt(e,t){var n;let r=[],o=(n=e.find(s=>s.id===t))==null?void 0:n.parentId;for(;o;){const s=e.find(i=>i.id===o);o=s?.parentId,s&&(r=r.concat(s))}return r}function _e(e){e.preventDefault(),e.stopPropagation()}function vn(e){return"nativeEvent"in e}function bn(e){return e.mozInputSource===0&&e.isTrusted?!0:Ke()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function pn(e){return dn()?!1:!Ke()&&e.width===0&&e.height===0||Ke()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function nt(e,t){return["mouse","pen"].includes(e)}var hn=typeof document<"u",Rn=function(){},Z=hn?M.useLayoutEffect:Rn;const En={...d};function Le(e){const t=d.useRef(e);return Z(()=>{t.current=e}),t}const yn=En.useInsertionEffect,wn=yn||(e=>e());function ie(e){const t=d.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return wn(()=>{t.current=e}),d.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const Ce=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Ft(e,t){const n=Me(e,Ce()),r=n.length;if(r===0)return;const o=pe(te(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function At(e){return Ft(te(e).body,1)||e}function kt(e){return Ft(te(e).body,-1)||e}function Te(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Q(n,r)}function xn(e){Me(e,Ce()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function rt(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Tn="data-floating-ui-focusable",ot="active",st="selected",Sn={...d};let it=!1,Cn=0;const at=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Cn++;function In(){const[e,t]=d.useState(()=>it?at():void 0);return Z(()=>{e==null&&t(at())},[]),d.useEffect(()=>{it=!0},[]),e}const Dn=Sn.useId,Ot=Dn||In;let We;process.env.NODE_ENV!=="production"&&(We=new Set);function Fn(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=We)!=null&&e.has(o))){var s;(s=We)==null||s.add(o),console.error(o)}}function An(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const kn=d.createContext(null),On=d.createContext(null),Pn=()=>{var e;return((e=d.useContext(kn))==null?void 0:e.id)||null},Ve=()=>d.useContext(On);function Se(e){return"data-floating-ui-"+e}function Mn(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}let ut=0;function be(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(ut);const s=()=>e?.focus({preventScroll:n});o?s():ut=requestAnimationFrame(s)}function Nn(e){return e?.ownerDocument||document}const Ee={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function ct(e){return e==="inert"?Ee.inert:e==="aria-hidden"?Ee["aria-hidden"]:Ee.none}let Ie=new WeakSet,De={},je=0;const _n=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype;function Pt(e){return e?x.isShadowRoot(e)?e.host:Pt(e.parentNode):null}const Ln=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Pt(n);return e.contains(r)?r:null}).filter(n=>n!=null);function jn(e,t,n,r){const o="data-floating-ui-inert",s=r?"inert":n?"aria-hidden":null,i=Ln(t,e),u=new Set,l=new Set(i),a=[];De[o]||(De[o]=new WeakMap);const v=De[o];i.forEach(y),k(t),u.clear();function y(g){!g||u.has(g)||(u.add(g),g.parentNode&&y(g.parentNode))}function k(g){!g||l.has(g)||[].forEach.call(g.children,E=>{if(x.getNodeName(E)!=="script")if(u.has(E))k(E);else{const m=s?E.getAttribute(s):null,I=m!==null&&m!=="false",T=ct(s),p=(T.get(E)||0)+1,h=(v.get(E)||0)+1;T.set(E,p),v.set(E,h),a.push(E),p===1&&I&&Ie.add(E),h===1&&E.setAttribute(o,""),!I&&s&&E.setAttribute(s,s==="inert"?"":"true")}})}return je++,()=>{a.forEach(g=>{const E=ct(s),I=(E.get(g)||0)-1,T=(v.get(g)||0)-1;E.set(g,I),v.set(g,T),I||(!Ie.has(g)&&s&&g.removeAttribute(s),Ie.delete(g)),T||g.removeAttribute(o)}),je--,je||(Ee.inert=new WeakMap,Ee["aria-hidden"]=new WeakMap,Ee.none=new WeakMap,Ie=new WeakSet,De={})}}function lt(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Nn(e[0]).body;return jn(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,t,n)}const Ue={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Pe=d.forwardRef(function(t,n){const[r,o]=d.useState();Z(()=>{fn()&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Se("focus-guard")]:"",style:Ue};return C.jsx("span",{...t,...s})}),$n={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Mt=d.createContext(null),ft=Se("portal");function qn(e){e===void 0&&(e={});const{id:t,root:n}=e,r=Ot(),o=_t(),[s,i]=d.useState(null),u=d.useRef(null);return Z(()=>()=>{s?.remove(),queueMicrotask(()=>{u.current=null})},[s]),Z(()=>{if(!r||u.current)return;const l=t?document.getElementById(t):null;if(!l)return;const a=document.createElement("div");a.id=r,a.setAttribute(ft,""),l.appendChild(a),u.current=a,i(a)},[t,r]),Z(()=>{if(n===null||!r||u.current)return;let l=n||o?.portalNode;l&&!x.isNode(l)&&(l=l.current),l=l||document.body;let a=null;t&&(a=document.createElement("div"),a.id=t,l.appendChild(a));const v=document.createElement("div");v.id=r,v.setAttribute(ft,""),l=a||l,l.appendChild(v),u.current=v,i(v)},[t,n,r,o]),s}function Nt(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=qn({id:n,root:r}),[i,u]=d.useState(null),l=d.useRef(null),a=d.useRef(null),v=d.useRef(null),y=d.useRef(null),k=i?.modal,g=i?.open,E=!!i&&!i.modal&&i.open&&o&&!!(r||s);return d.useEffect(()=>{if(!s||!o||k)return;function m(I){s&&Te(I)&&(I.type==="focusin"?rt:xn)(s)}return s.addEventListener("focusin",m,!0),s.addEventListener("focusout",m,!0),()=>{s.removeEventListener("focusin",m,!0),s.removeEventListener("focusout",m,!0)}},[s,o,k]),d.useEffect(()=>{s&&(g||rt(s))},[g,s]),C.jsxs(Mt.Provider,{value:d.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:a,beforeInsideRef:v,afterInsideRef:y,portalNode:s,setFocusManagerState:u}),[o,s]),children:[E&&s&&C.jsx(Pe,{"data-type":"outside",ref:l,onFocus:m=>{if(Te(m,s)){var I;(I=v.current)==null||I.focus()}else{const T=i?i.domReference:null,p=kt(T);p?.focus()}}}),E&&s&&C.jsx("span",{"aria-owns":s.id,style:$n}),s&&zt.createPortal(t,s),E&&s&&C.jsx(Pe,{"data-type":"outside",ref:a,onFocus:m=>{if(Te(m,s)){var I;(I=y.current)==null||I.focus()}else{const T=i?i.domReference:null,p=At(T);p?.focus(),i?.closeOnFocusOut&&i?.onOpenChange(!1,m.nativeEvent,"focus-out")}}})]})}const _t=()=>d.useContext(Mt);function dt(e){return d.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}const mt=20;let de=[];function ze(){de=de.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function Bn(e){ze(),e&&x.getNodeName(e)!=="body"&&(de.push(new WeakRef(e)),de.length>mt&&(de=de.slice(-mt)))}function gt(){ze();const e=de[de.length-1];return e?.deref()}function Hn(e){const t=Ce();return Ct(e,t)?e:Me(e,t)[0]||e}function vt(e,t){var n;if(!t.current.includes("floating")&&!((n=e.getAttribute("role"))!=null&&n.includes("dialog")))return;const r=Ce(),s=cn(e,r).filter(u=>{const l=u.getAttribute("data-tabindex")||"";return Ct(u,r)||u.hasAttribute("data-tabindex")&&!l.startsWith("-")}),i=e.getAttribute("tabindex");t.current.includes("floating")||s.length===0?i!=="0"&&e.setAttribute("tabindex","0"):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const Kn=d.forwardRef(function(t,n){return C.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:Ue})});function Lt(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:s=!0,initialFocus:i=0,returnFocus:u=!0,restoreFocus:l=!1,modal:a=!0,visuallyHiddenDismiss:v=!1,closeOnFocusOut:y=!0,outsideElementsInert:k=!1,getInsideElements:g=()=>[]}=e,{open:E,onOpenChange:m,events:I,dataRef:T,elements:{domReference:p,floating:h}}=t,P=ie(()=>{var D;return(D=T.current.floatingContext)==null?void 0:D.nodeId}),z=ie(g),H=typeof i=="number"&&i<0,q=Ze(p)&&H,j=_n(),G=j?s:!0,ne=!G||j&&k,U=Le(o),me=Le(i),re=Le(u),b=Ve(),f=_t(),K=d.useRef(null),B=d.useRef(null),R=d.useRef(!1),$=d.useRef(!1),W=d.useRef(-1),J=d.useRef(-1),ee=f!=null,S=et(h),X=ie(function(D){return D===void 0&&(D=S),D?Me(D,Ce()):[]}),_=ie(D=>{const O=X(D);return U.current.map(F=>p&&F==="reference"?p:S&&F==="floating"?S:O).filter(Boolean).flat()});d.useEffect(()=>{if(r||!a)return;function D(F){if(F.key==="Tab"){Q(S,pe(te(S)))&&X().length===0&&!q&&_e(F);const c=_(),A=fe(F);U.current[0]==="reference"&&A===p&&(_e(F),F.shiftKey?be(c[c.length-1]):be(c[1])),U.current[1]==="floating"&&A===S&&F.shiftKey&&(_e(F),be(c[0]))}}const O=te(S);return O.addEventListener("keydown",D),()=>{O.removeEventListener("keydown",D)}},[r,p,S,a,U,q,X,_]),d.useEffect(()=>{if(r||!h)return;function D(O){const F=fe(O),A=X().indexOf(F);A!==-1&&(W.current=A)}return h.addEventListener("focusin",D),()=>{h.removeEventListener("focusin",D)}},[r,h,X]),d.useEffect(()=>{if(r||!y)return;function D(){$.current=!0,setTimeout(()=>{$.current=!1})}function O(A){const w=A.relatedTarget,L=A.currentTarget,N=fe(A);queueMicrotask(()=>{const V=P(),ge=!(Q(p,w)||Q(h,w)||Q(w,h)||Q(f?.portalNode,w)||w!=null&&w.hasAttribute(Se("focus-guard"))||b&&(Re(b.nodesRef.current,V).find(ce=>{var ue,le;return Q((ue=ce.context)==null?void 0:ue.elements.floating,w)||Q((le=ce.context)==null?void 0:le.elements.domReference,w)})||tt(b.nodesRef.current,V).find(ce=>{var ue,le,Ge;return[(ue=ce.context)==null?void 0:ue.elements.floating,et((le=ce.context)==null?void 0:le.elements.floating)].includes(w)||((Ge=ce.context)==null?void 0:Ge.elements.domReference)===w})));if(L===p&&S&&vt(S,U),l&&L!==p&&!(N!=null&&N.isConnected)&&pe(te(S))===te(S).body){x.isHTMLElement(S)&&S.focus();const ce=W.current,ue=X(),le=ue[ce]||ue[ue.length-1]||S;x.isHTMLElement(le)&&le.focus()}if(T.current.insideReactTree){T.current.insideReactTree=!1;return}(q||!a)&&w&&ge&&!$.current&&w!==gt()&&(R.current=!0,m(!1,A,"focus-out"))})}const F=!!(!b&&f);function c(){Mn(J),T.current.insideReactTree=!0,J.current=window.setTimeout(()=>{T.current.insideReactTree=!1})}if(h&&x.isHTMLElement(p))return p.addEventListener("focusout",O),p.addEventListener("pointerdown",D),h.addEventListener("focusout",O),F&&h.addEventListener("focusout",c,!0),()=>{p.removeEventListener("focusout",O),p.removeEventListener("pointerdown",D),h.removeEventListener("focusout",O),F&&h.removeEventListener("focusout",c,!0)}},[r,p,h,S,a,b,f,m,y,l,X,q,P,U,T]);const Y=d.useRef(null),oe=d.useRef(null),we=dt([Y,f?.beforeInsideRef]),ae=dt([oe,f?.afterInsideRef]);d.useEffect(()=>{var D,O;if(r||!h)return;const F=Array.from((f==null||(D=f.portalNode)==null?void 0:D.querySelectorAll("["+Se("portal")+"]"))||[]),A=(O=(b?tt(b.nodesRef.current,P()):[]).find(N=>{var V;return Ze(((V=N.context)==null?void 0:V.elements.domReference)||null)}))==null||(O=O.context)==null?void 0:O.elements.domReference,w=[h,A,...F,...z(),K.current,B.current,Y.current,oe.current,f?.beforeOutsideRef.current,f?.afterOutsideRef.current,U.current.includes("reference")||q?p:null].filter(N=>N!=null),L=a||q?lt(w,!ne,ne):lt(w);return()=>{L()}},[r,p,h,a,U,f,q,G,ne,b,P,z]),Z(()=>{if(r||!x.isHTMLElement(S))return;const D=te(S),O=pe(D);queueMicrotask(()=>{const F=_(S),c=me.current,A=(typeof c=="number"?F[c]:c.current)||S,w=Q(S,O);!H&&!w&&E&&be(A,{preventScroll:A===S})})},[r,E,S,H,_,me]),Z(()=>{if(r||!S)return;const D=te(S),O=pe(D);Bn(O);function F(w){let{reason:L,event:N,nested:V}=w;if(["hover","safe-polygon"].includes(L)&&N.type==="mouseleave"&&(R.current=!0),L==="outside-press")if(V)R.current=!1;else if(bn(N)||pn(N))R.current=!1;else{let ge=!1;document.createElement("div").focus({get preventScroll(){return ge=!0,!1}}),ge?R.current=!1:R.current=!0}}I.on("openchange",F);const c=D.createElement("span");c.setAttribute("tabindex","-1"),c.setAttribute("aria-hidden","true"),Object.assign(c.style,Ue),ee&&p&&p.insertAdjacentElement("afterend",c);function A(){if(typeof re.current=="boolean"){const w=p||gt();return w&&w.isConnected?w:c}return re.current.current||c}return()=>{I.off("openchange",F);const w=pe(D),L=Q(h,w)||b&&Re(b.nodesRef.current,P(),!1).some(V=>{var ge;return Q((ge=V.context)==null?void 0:ge.elements.floating,w)}),N=A();queueMicrotask(()=>{const V=Hn(N);re.current&&!R.current&&x.isHTMLElement(V)&&(!(V!==w&&w!==D.body)||L)&&V.focus({preventScroll:!0}),c.remove()})}},[r,h,S,re,T,I,b,ee,p,P]),d.useEffect(()=>(queueMicrotask(()=>{R.current=!1}),()=>{queueMicrotask(ze)}),[r]),Z(()=>{if(!r&&f)return f.setFocusManagerState({modal:a,closeOnFocusOut:y,open:E,onOpenChange:m,domReference:p}),()=>{f.setFocusManagerState(null)}},[r,f,a,E,m,y,p]),Z(()=>{r||S&&vt(S,U)},[r,S,U]);function se(D){return r||!v||!a?null:C.jsx(Kn,{ref:D==="start"?K:B,onClick:O=>m(!1,O.nativeEvent),children:typeof v=="string"?v:"Dismiss"})}const ve=!r&&G&&(a?!q:!0)&&(ee||a);return C.jsxs(C.Fragment,{children:[ve&&C.jsx(Pe,{"data-type":"inside",ref:we,onFocus:D=>{if(a){const F=_();be(o[0]==="reference"?F[0]:F[F.length-1])}else if(f!=null&&f.preserveTabOrder&&f.portalNode)if(R.current=!1,Te(D,f.portalNode)){const F=At(p);F?.focus()}else{var O;(O=f.beforeOutsideRef.current)==null||O.focus()}}}),!q&&se("start"),n,se("end"),ve&&C.jsx(Pe,{"data-type":"inside",ref:ae,onFocus:D=>{if(a)be(_()[0]);else if(f!=null&&f.preserveTabOrder&&f.portalNode)if(y&&(R.current=!0),Te(D,f.portalNode)){const F=kt(p);F?.focus()}else{var O;(O=f.afterOutsideRef.current)==null||O.focus()}}})]})}function bt(e){return x.isHTMLElement(e.target)&&e.target.tagName==="BUTTON"}function Wn(e){return x.isHTMLElement(e.target)&&e.target.tagName==="A"}function pt(e){return Dt(e)}function jt(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:u="click",toggle:l=!0,ignoreMouse:a=!1,keyboardHandlers:v=!0,stickIfOpen:y=!0}=t,k=d.useRef(),g=d.useRef(!1),E=d.useMemo(()=>({onPointerDown(m){k.current=m.pointerType},onMouseDown(m){const I=k.current;m.button===0&&u!=="click"&&(nt(I)&&a||(n&&l&&(!(o.current.openEvent&&y)||o.current.openEvent.type==="mousedown")?r(!1,m.nativeEvent,"click"):(m.preventDefault(),r(!0,m.nativeEvent,"click"))))},onClick(m){const I=k.current;if(u==="mousedown"&&k.current){k.current=void 0;return}nt(I)&&a||(n&&l&&(!(o.current.openEvent&&y)||o.current.openEvent.type==="click")?r(!1,m.nativeEvent,"click"):r(!0,m.nativeEvent,"click"))},onKeyDown(m){k.current=void 0,!(m.defaultPrevented||!v||bt(m))&&(m.key===" "&&!pt(s)&&(m.preventDefault(),g.current=!0),!Wn(m)&&m.key==="Enter"&&r(!(n&&l),m.nativeEvent,"click"))},onKeyUp(m){m.defaultPrevented||!v||bt(m)||pt(s)||m.key===" "&&g.current&&(g.current=!1,r(!(n&&l),m.nativeEvent,"click"))}}),[o,s,u,a,v,r,n,y,l]);return d.useMemo(()=>i?{reference:E}:{},[i,E])}const Vn={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Un={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},ht=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function $t(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:u=!0,outsidePress:l=!0,outsidePressEvent:a="pointerdown",referencePress:v=!1,referencePressEvent:y="pointerdown",ancestorScroll:k=!1,bubbles:g,capture:E}=t,m=Ve(),I=ie(typeof l=="function"?l:()=>!1),T=typeof l=="function"?I:l,p=d.useRef(!1),{escapeKey:h,outsidePress:P}=ht(g),{escapeKey:z,outsidePress:H}=ht(E),q=d.useRef(!1),j=ie(b=>{var f;if(!n||!i||!u||b.key!=="Escape"||q.current)return;const K=(f=s.current.floatingContext)==null?void 0:f.nodeId,B=m?Re(m.nodesRef.current,K):[];if(!h&&(b.stopPropagation(),B.length>0)){let R=!0;if(B.forEach($=>{var W;if((W=$.context)!=null&&W.open&&!$.context.dataRef.current.__escapeKeyBubbles){R=!1;return}}),!R)return}r(!1,vn(b)?b.nativeEvent:b,"escape-key")}),G=ie(b=>{var f;const K=()=>{var B;j(b),(B=fe(b))==null||B.removeEventListener("keydown",K)};(f=fe(b))==null||f.addEventListener("keydown",K)}),ne=ie(b=>{var f;const K=s.current.insideReactTree;s.current.insideReactTree=!1;const B=p.current;if(p.current=!1,a==="click"&&B||K||typeof T=="function"&&!T(b))return;const R=fe(b),$="["+Se("inert")+"]",W=te(o.floating).querySelectorAll($);let J=x.isElement(R)?R:null;for(;J&&!x.isLastTraversableNode(J);){const _=x.getParentNode(J);if(x.isLastTraversableNode(_)||!x.isElement(_))break;J=_}if(W.length&&x.isElement(R)&&!gn(R)&&!Q(R,o.floating)&&Array.from(W).every(_=>!Q(J,_)))return;if(x.isHTMLElement(R)&&re){const _=x.isLastTraversableNode(R),Y=x.getComputedStyle(R),oe=/auto|scroll/,we=_||oe.test(Y.overflowX),ae=_||oe.test(Y.overflowY),se=we&&R.clientWidth>0&&R.scrollWidth>R.clientWidth,ve=ae&&R.clientHeight>0&&R.scrollHeight>R.clientHeight,D=Y.direction==="rtl",O=ve&&(D?b.offsetX<=R.offsetWidth-R.clientWidth:b.offsetX>R.clientWidth),F=se&&b.offsetY>R.clientHeight;if(O||F)return}const ee=(f=s.current.floatingContext)==null?void 0:f.nodeId,S=m&&Re(m.nodesRef.current,ee).some(_=>{var Y;return Ne(b,(Y=_.context)==null?void 0:Y.elements.floating)});if(Ne(b,o.floating)||Ne(b,o.domReference)||S)return;const X=m?Re(m.nodesRef.current,ee):[];if(X.length>0){let _=!0;if(X.forEach(Y=>{var oe;if((oe=Y.context)!=null&&oe.open&&!Y.context.dataRef.current.__outsidePressBubbles){_=!1;return}}),!_)return}r(!1,b,"outside-press")}),U=ie(b=>{var f;const K=()=>{var B;ne(b),(B=fe(b))==null||B.removeEventListener(a,K)};(f=fe(b))==null||f.addEventListener(a,K)});d.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=h,s.current.__outsidePressBubbles=P;let b=-1;function f(W){r(!1,W,"ancestor-scroll")}function K(){window.clearTimeout(b),q.current=!0}function B(){b=window.setTimeout(()=>{q.current=!1},x.isWebKit()?5:0)}const R=te(o.floating);u&&(R.addEventListener("keydown",z?G:j,z),R.addEventListener("compositionstart",K),R.addEventListener("compositionend",B)),T&&R.addEventListener(a,H?U:ne,H);let $=[];return k&&(x.isElement(o.domReference)&&($=x.getOverflowAncestors(o.domReference)),x.isElement(o.floating)&&($=$.concat(x.getOverflowAncestors(o.floating))),!x.isElement(o.reference)&&o.reference&&o.reference.contextElement&&($=$.concat(x.getOverflowAncestors(o.reference.contextElement)))),$=$.filter(W=>{var J;return W!==((J=R.defaultView)==null?void 0:J.visualViewport)}),$.forEach(W=>{W.addEventListener("scroll",f,{passive:!0})}),()=>{u&&(R.removeEventListener("keydown",z?G:j,z),R.removeEventListener("compositionstart",K),R.removeEventListener("compositionend",B)),T&&R.removeEventListener(a,H?U:ne,H),$.forEach(W=>{W.removeEventListener("scroll",f)}),window.clearTimeout(b)}},[s,o,u,T,a,n,r,k,i,h,P,j,z,G,ne,H,U]),d.useEffect(()=>{s.current.insideReactTree=!1},[s,T,a]);const me=d.useMemo(()=>({onKeyDown:j,...v&&{[Vn[y]]:b=>{r(!1,b.nativeEvent,"reference-press")},...y!=="click"&&{onClick(b){r(!1,b.nativeEvent,"reference-press")}}}}),[j,r,v,y]),re=d.useMemo(()=>{function b(f){f.button===0&&(p.current=!0)}return{onKeyDown:j,onMouseDown:b,onMouseUp:b,[Un[a]]:()=>{s.current.insideReactTree=!0}}},[j,a,s]);return d.useMemo(()=>i?{reference:me,floating:re}:{},[i,me,re])}function zn(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Ot(),s=d.useRef({}),[i]=d.useState(()=>An()),u=Pn()!=null;if(process.env.NODE_ENV!=="production"){const g=r.reference;g&&!x.isElement(g)&&Fn("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,a]=d.useState(r.reference),v=ie((g,E,m)=>{s.current.openEvent=g?E:void 0,i.emit("openchange",{open:g,event:E,reason:m,nested:u}),n?.(g,E,m)}),y=d.useMemo(()=>({setPositionReference:a}),[]),k=d.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return d.useMemo(()=>({dataRef:s,open:t,onOpenChange:v,elements:k,events:i,floatingId:o,refs:y}),[t,v,k,i,o,y])}function qt(e){e===void 0&&(e={});const{nodeId:t}=e,n=zn({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=d.useState(null),[u,l]=d.useState(null),v=o?.domReference||s,y=d.useRef(null),k=Ve();Z(()=>{v&&(y.current=v)},[v]);const g=x.useFloating({...e,elements:{...o,...u&&{reference:u}}}),E=d.useCallback(h=>{const P=x.isElement(h)?{getBoundingClientRect:()=>h.getBoundingClientRect(),getClientRects:()=>h.getClientRects(),contextElement:h}:h;l(P),g.refs.setReference(P)},[g.refs]),m=d.useCallback(h=>{(x.isElement(h)||h===null)&&(y.current=h,i(h)),(x.isElement(g.refs.reference.current)||g.refs.reference.current===null||h!==null&&!x.isElement(h))&&g.refs.setReference(h)},[g.refs]),I=d.useMemo(()=>({...g.refs,setReference:m,setPositionReference:E,domReference:y}),[g.refs,m,E]),T=d.useMemo(()=>({...g.elements,domReference:v}),[g.elements,v]),p=d.useMemo(()=>({...g,...r,refs:I,elements:T,nodeId:t}),[g,I,T,t,r]);return Z(()=>{r.dataRef.current.floatingContext=p;const h=k?.nodesRef.current.find(P=>P.id===t);h&&(h.context=p)}),d.useMemo(()=>({...g,context:p,refs:I,elements:T}),[g,I,T,p])}function $e(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[ot]:i,[st]:u,...l}=e;s=l}return{...n==="floating"&&{tabIndex:-1,[Tn]:""},...s,...t.map(i=>{const u=i?i[n]:null;return typeof u=="function"?e?u(e):null:u}).concat(e).reduce((i,u)=>(u&&Object.entries(u).forEach(l=>{let[a,v]=l;if(!(o&&[ot,st].includes(a)))if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof v=="function"){var y;(y=r.get(a))==null||y.push(v),i[a]=function(){for(var k,g=arguments.length,E=new Array(g),m=0;m<g;m++)E[m]=arguments[m];return(k=r.get(a))==null?void 0:k.map(I=>I(...E)).find(I=>I!==void 0)}}}else i[a]=v}),i),{})}}function Bt(e){e===void 0&&(e=[]);const t=e.map(u=>u?.reference),n=e.map(u=>u?.floating),r=e.map(u=>u?.item),o=d.useCallback(u=>$e(u,e,"reference"),t),s=d.useCallback(u=>$e(u,e,"floating"),n),i=d.useCallback(u=>$e(u,e,"item"),r);return d.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const Gn={"date-picker-calendar-container":"_date-picker-calendar-container_1onag_1"},Ht=Ut.c.bind(Gn),Kt=M.forwardRef((e,t)=>e.mode==="range"?C.jsx(Xn,{...e,forwardedRef:t}):C.jsx(Yn,{...e,forwardedRef:t}));Kt.displayName="DatePicker";const Yn=({calendarProps:e,drawerContentProps:t,value:n,onChange:r,overlayZIndex:o,forwardedRef:s,...i})=>{const[u,l]=M.useState(!1),[a,v]=M.useState(!1),y=Wt(),k=M.useRef(null),{context:g,refs:E,floatingStyles:m}=qt({open:u,onOpenChange:G=>{i.readOnly||l(G)},placement:"bottom-start",middleware:[x.offset({mainAxis:10,crossAxis:-32}),x.flip()],whileElementsMounted:x.autoUpdate}),I=jt(g,{enabled:!i.disabled&&!i.readOnly}),T=$t(g),{getFloatingProps:p,getReferenceProps:h}=Bt([I,T]),[P,z]=M.useState(n);M.useEffect(()=>{z(n)},[n]);const H=G=>{G?(z(G),r?.(G),(u||a)&&(l(!1),v(!1))):(z(void 0),r?.(void 0))},q=M.useId(),j=i["data-testid"];return y?C.jsxs(he.Drawer,{open:a,onOpenChange:v,children:[C.jsx(he.Drawer.Trigger,{children:C.jsx(Ye.DateField,{...i,startAdornment:C.jsx(qe.r,{size:"sm"}),id:q,value:P,onChange:H,"data-testid":j})}),C.jsx(he.Drawer.Content,{"data-testid":j&&`${j}-calendar`,fitToContent:!0,...t,zIndex:o,children:C.jsx(xe.Calendar,{showOutsideDays:!0,...e,mode:"single",selected:P,onSelect:H})})]}):C.jsxs("div",{ref:s,children:[C.jsx("div",{...h(),ref:E.setReference,children:C.jsx(Ye.DateField,{...i,startAdornment:C.jsx(qe.r,{size:"sm"}),id:q,value:P,onChange:H,"data-testid":j})}),u&&!i.readOnly&&C.jsx(Nt,{children:C.jsx(Lt,{context:g,modal:!1,order:["reference","floating","content"],children:C.jsx("div",{"data-testid":j&&`${j}-calendar`,className:Ht("date-picker-calendar-container"),ref:E.setFloating,style:{...m,zIndex:o},...p(),children:C.jsx(xe.Calendar,{showOutsideDays:!0,...e,mode:"single",selected:P,onSelect:H,firstElementRef:k})})})})]})},Xn=({calendarProps:e,drawerContentProps:t,fromValue:n,toValue:r,onFromChange:o,onToChange:s,overlayZIndex:i,forwardedRef:u,...l})=>{const[a,v]=M.useState(!1),[y,k]=M.useState(!1),g=Wt(),E=M.useRef(null),m=M.useRef(null),I=M.useRef(null),T=M.useRef("from"),p=M.useRef(!1),h=M.useRef(!1),[P,z]=M.useState(null),H=()=>{const c=p.current,A=h.current;p.current=!1,h.current=!1;let w;c&&!A?w="from":A&&!c?w="to":w=T.current,requestAnimationFrame(()=>{(w==="from"?m.current:I.current)?.focus()})},{context:q,refs:j,floatingStyles:G}=qt({open:a,onOpenChange:c=>{l.readOnly||(v(c),c||H())},placement:"bottom-start",middleware:[x.offset({mainAxis:10,crossAxis:-32}),x.flip()],whileElementsMounted:x.autoUpdate}),ne=jt(q,{enabled:!l.disabled&&!l.readOnly}),U=$t(q),{getFloatingProps:me,getReferenceProps:re}=Bt([ne,U]),b=(c,A)=>c||A?{from:c,to:A}:void 0,[f,K]=M.useState(()=>b(n,r)),B=M.useRef(f);M.useEffect(()=>{const c=b(n,r);K(c),B.current=c},[n,r]);const R=(c,A)=>{const w=f?.from,L=f?.to,N=c?.from,V=c?.to;K(c),B.current=c,w?.getTime()!==N?.getTime()&&(p.current=!0,o?.(N)),L?.getTime()!==V?.getTime()&&(h.current=!0,s?.(V)),A==="calendar"&&N&&V&&(v(!1),k(!1),z(null),H())},$=c=>{const A=T.current==="from",w=B.current;let L,N;A?(L=c,N=w?.to):(L=w?.from,N=c),L&&N&&L.getTime()>N.getTime()&&([L,N]=[N,L]),T.current=A?"to":"from",R({from:L,to:N},"calendar")},W=c=>{const A=c&&f?.to&&c.getTime()>f.to.getTime()?c:f?.to;R(b(c,A),"input")},J=c=>{const A=c&&f?.from&&c.getTime()<f.from.getTime()?c:f?.from;R(b(A,c),"input")},ee=l["data-testid"],S=f?.from&&!f?.to?f.from:f?.to&&!f?.from?f.to:null,X=(()=>{if(!S||!P||xe.isSameDay(S,P))return;const c=S<P,A=Xe.addDays(c?S:P,1),w=Xe.addDays(c?P:S,-1),L=A<=w;return{...c?{range_preview_start:S}:{range_preview_end:S},range_preview_hovered:P,...c?{range_preview_hovered_end:P}:{range_preview_hovered_start:P},...L&&{range_preview:{from:A,to:w}}}})(),_=X?{range_preview:"purpur-calendar-range-preview",range_preview_start:"purpur-calendar-range-preview-start",range_preview_end:"purpur-calendar-range-preview-end",range_preview_hovered:"purpur-calendar-range-preview-hovered",range_preview_hovered_start:"purpur-calendar-range-preview-hovered-start",range_preview_hovered_end:"purpur-calendar-range-preview-hovered-end"}:void 0,Y=S?c=>z(c):void 0,oe=()=>{T.current="from"},we=()=>{T.current="to"},ae=l.fromInputRef,se=l.toInputRef,ve=M.useCallback(c=>{m.current=c,typeof ae=="function"?ae(c):ae&&(ae.current=c)},[ae]),D=M.useCallback(c=>{I.current=c,typeof se=="function"?se(c):se&&(se.current=c)},[se]),O=C.jsx(qe.DateRangeField,{...l,fromInputRef:ve,toInputRef:D,fromFieldProps:{...l.fromFieldProps,onFocus:c=>{oe(),l.fromFieldProps?.onFocus?.(c)}},toFieldProps:{...l.toFieldProps,tabIndex:a&&T.current==="from"?-1:l.toFieldProps?.tabIndex,onFocus:c=>{we(),l.toFieldProps?.onFocus?.(c)}},fromValue:f?.from,toValue:f?.to,onFromChange:W,onToChange:J}),F=T.current==="to"?f?.to??f?.from:f?.from??f?.to;return g?C.jsxs(he.Drawer,{open:y,onOpenChange:c=>{k(c),c||H()},children:[C.jsx(he.Drawer.Trigger,{children:C.jsx("div",{children:O})}),C.jsx(he.Drawer.Content,{"data-testid":ee&&`${ee}-calendar`,fitToContent:!0,...t,zIndex:i,children:C.jsx(xe.Calendar,{showOutsideDays:!0,defaultMonth:F,...e,mode:"range",selected:f,onSelect:()=>{},onDayClick:$,modifiers:X,modifiersClassNames:_,onDayMouseEnter:Y})})]}):C.jsxs("div",{ref:u,children:[C.jsx("div",{...re(),ref:j.setReference,children:O}),a&&!l.readOnly&&C.jsx(Nt,{children:C.jsx(Lt,{context:q,modal:!1,order:["reference","floating","content"],children:C.jsx("div",{"data-testid":ee&&`${ee}-calendar`,className:Ht("date-picker-calendar-container"),ref:j.setFloating,style:{...G,zIndex:i},...me(),children:C.jsx(xe.Calendar,{showOutsideDays:!0,defaultMonth:F,...e,mode:"range",selected:f,onSelect:()=>{},onDayClick:$,modifiers:X,modifiersClassNames:_,onDayMouseEnter:Y,firstElementRef:E})})})})]})},Wt=()=>{const[e,t]=M.useState(!1);return M.useLayoutEffect(()=>{const n=()=>{t(window.innerWidth<600)};return n(),window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}},[]),e};exports.DatePicker=Kt;
2
- //# sourceMappingURL=date-picker-uyPKJulK.js.map
@@ -1,574 +0,0 @@
1
- import { jsx as e, jsxs as g, Fragment as I } from "react/jsx-runtime";
2
- import H, { createContext as wr, forwardRef as z, useContext as hr, useRef as G, useEffect as fr } from "react";
3
- import { a as mr, T as U, C as $r, D as vr, P as J, O as yr, b as br, R as gr } from "./index-3NV-ckDX.mjs";
4
- import { c as k } from "./bind-CU-R61T-.mjs";
5
- import { b as Q, a as F } from "./button-4-yWOgtD.mjs";
6
- import { H as Z, D as B } from "./heading-xwBuT_-9.mjs";
7
- import { l as Dr } from "./chevron-left.es-UFhf3v35.mjs";
8
- import { r as Nr } from "./close.es-BPmk2wkU.mjs";
9
- import { V as rr } from "./visually-hidden-BYFkJEp1.mjs";
10
- import { R as jr, V as Pr, S as zr, T as Sr } from "./index-B8Mazo6u.mjs";
11
- const ar = wr(null), Or = "_slideUp_9zrj7_1", xr = "_slideDown_9zrj7_1", kr = "_slideInRight_9zrj7_1", Ar = "_slideInLeft_9zrj7_1", Cr = "_slideOutRight_9zrj7_1", Er = "_slideOutLeft_9zrj7_1", Vr = "_fadeIn_9zrj7_1", Lr = "_fadeOut_9zrj7_1", Mr = {
12
- "purpur-drawer-content": "_purpur-drawer-content_9zrj7_1",
13
- slideUp: Or,
14
- slideDown: xr,
15
- "purpur-drawer-content--left": "_purpur-drawer-content--left_9zrj7_21",
16
- "purpur-drawer-content--right": "_purpur-drawer-content--right_9zrj7_24",
17
- "purpur-drawer-content--fit-to-content": "_purpur-drawer-content--fit-to-content_9zrj7_27",
18
- slideInRight: kr,
19
- slideInLeft: Ar,
20
- slideOutRight: Cr,
21
- slideOutLeft: Er,
22
- "purpur-drawer-content__content-container": "_purpur-drawer-content__content-container_9zrj7_63",
23
- "purpur-drawer-content__description": "_purpur-drawer-content__description_9zrj7_68",
24
- "purpur-drawer-content--ai": "_purpur-drawer-content--ai_9zrj7_78",
25
- "purpur-drawer-overlay": "_purpur-drawer-overlay_9zrj7_82",
26
- fadeIn: Vr,
27
- fadeOut: Lr
28
- }, Ur = {
29
- "purpur-drawer-container--header": "_purpur-drawer-container--header_1csed_1",
30
- "purpur-drawer-container--ai": "_purpur-drawer-container--ai_1csed_4",
31
- "purpur-drawer-container--body": "_purpur-drawer-container--body_1csed_7",
32
- "purpur-drawer-container--sticky": "_purpur-drawer-container--sticky_1csed_15",
33
- "purpur-drawer-container--footer": "_purpur-drawer-container--footer_1csed_23"
34
- }, Yr = k.bind(Ur), Y = "purpur-drawer-container", x = z(
35
- ({
36
- ["data-testid"]: r = "purpur-drawer-container",
37
- children: a,
38
- className: o,
39
- drawerVariant: n = "default",
40
- variant: u = "body",
41
- stickyFooter: c,
42
- ...s
43
- }, d) => {
44
- const p = Yr([
45
- Y,
46
- {
47
- [`${Y}--${u}`]: u,
48
- [`${Y}--sticky`]: c,
49
- [`${Y}--ai`]: n === "ai"
50
- },
51
- o
52
- ]);
53
- return /* @__PURE__ */ e("div", { className: p, "data-testid": r, ref: d, ...s, children: a });
54
- }
55
- );
56
- x.displayName = "DrawerContainer";
57
- const Hr = {
58
- "purpur-drawer-frame": "_purpur-drawer-frame_vjt35_1",
59
- "purpur-drawer-frame--ai": "_purpur-drawer-frame--ai_vjt35_11",
60
- "purpur-drawer-frame--without-back-button": "_purpur-drawer-frame--without-back-button_vjt35_14",
61
- "purpur-drawer-frame__header": "_purpur-drawer-frame__header_vjt35_14",
62
- "purpur-drawer-frame--with-back-button": "_purpur-drawer-frame--with-back-button_vjt35_17",
63
- "purpur-drawer-frame--left": "_purpur-drawer-frame--left_vjt35_21",
64
- "purpur-drawer-frame--right": "_purpur-drawer-frame--right_vjt35_25",
65
- "purpur-drawer-frame--sticky-footer": "_purpur-drawer-frame--sticky-footer_vjt35_36",
66
- "purpur-drawer-frame__body": "_purpur-drawer-frame__body_vjt35_42",
67
- "purpur-drawer-frame--fit-to-content": "_purpur-drawer-frame--fit-to-content_vjt35_46",
68
- "purpur-drawer-frame__footer": "_purpur-drawer-frame__footer_vjt35_55",
69
- "purpur-drawer-frame__content-container": "_purpur-drawer-frame__content-container_vjt35_58",
70
- "purpur-drawer-frame__content-container--no-footer": "_purpur-drawer-frame__content-container--no-footer_vjt35_63"
71
- }, Rr = {
72
- "purpur-drawer-handle": "_purpur-drawer-handle_lz3ca_1",
73
- "purpur-drawer-handle--ai": "_purpur-drawer-handle--ai_lz3ca_22"
74
- }, Fr = (r, a, o, n, u, c) => ({
75
- onPointerDown: (t) => {
76
- r.current = { y: t.clientY };
77
- },
78
- onPointerMove: (t) => {
79
- if (!r.current)
80
- return;
81
- const i = t.clientY - r.current.y, h = !!a.current, f = Math.max(0, i), _ = t.pointerType === "touch" ? 10 : 2, l = { y: f }, y = { originalEvent: t, delta: l };
82
- h ? (a.current = l, n(y)) : er(l, 0) ? (a.current = l, o(), t.target.setPointerCapture(t.pointerId)) : Math.abs(i) > _ && (r.current = null);
83
- },
84
- onPointerUp: (t) => {
85
- const i = a.current, h = t.target;
86
- if (h.hasPointerCapture(t.pointerId) && h.releasePointerCapture(t.pointerId), a.current = null, r.current = null, i) {
87
- const f = t.currentTarget, _ = { originalEvent: t, delta: i };
88
- er(i, 0) && i.y > 200 ? c(_) : u(), f.addEventListener("click", (l) => l.preventDefault(), {
89
- once: !0
90
- });
91
- }
92
- }
93
- }), er = (r, a = 0) => Math.abs(r.y) > a, Ir = k.bind(Rr), tr = "purpur-drawer-handle", nr = z(
94
- ({
95
- ["data-testid"]: r = "purpur-drawer-handle",
96
- className: a,
97
- onSwipeStart: o,
98
- onSwipeMove: n,
99
- onSwipeCancel: u,
100
- onSwipeEnd: c,
101
- variant: s = "default",
102
- ...d
103
- }, p) => {
104
- const t = Ir([tr, { [`${tr}--ai`]: s === "ai" }, a]), i = H.useRef(null), h = H.useRef(null), { onPointerDown: f, onPointerMove: _, onPointerUp: l } = Fr(
105
- h,
106
- i,
107
- o,
108
- n,
109
- u,
110
- c
111
- );
112
- return /* @__PURE__ */ e(
113
- "div",
114
- {
115
- className: t,
116
- "data-testid": r,
117
- onPointerDown: f,
118
- onPointerMove: _,
119
- onPointerUp: l,
120
- ref: p,
121
- ...d
122
- }
123
- );
124
- }
125
- );
126
- nr.displayName = "DrawerHandle";
127
- const Kr = {
128
- "purpur-drawer-header": "_purpur-drawer-header_1dlfk_1",
129
- "purpur-drawer-header__row": "_purpur-drawer-header__row_1dlfk_4",
130
- "purpur-drawer-header__row--with-back-button": "_purpur-drawer-header__row--with-back-button_1dlfk_7",
131
- "purpur-drawer-header__left": "_purpur-drawer-header__left_1dlfk_10",
132
- "purpur-drawer-header__right": "_purpur-drawer-header__right_1dlfk_13",
133
- "purpur-drawer-header__close-button": "_purpur-drawer-header__close-button_1dlfk_16",
134
- "purpur-drawer-header__back-button--only-icon": "_purpur-drawer-header__back-button--only-icon_1dlfk_27",
135
- "purpur-drawer-header__title": "_purpur-drawer-header__title_1dlfk_30"
136
- }, N = k.bind(Kr), v = "purpur-drawer-header", or = z(
137
- ({
138
- ["data-testid"]: r = "purpur-drawer-header",
139
- backButton: a,
140
- backButtonText: o,
141
- backButtonOnlyIcon: n,
142
- className: u,
143
- closeButtonAriaLabel: c,
144
- headerContent: s,
145
- onBackButtonClick: d,
146
- onCloseClick: p,
147
- title: t,
148
- variant: i = "default",
149
- ...h
150
- }, f) => {
151
- const _ = N([v, { [`${v}--ai`]: i === "ai" }, u]), l = !!(a && o && d), y = i === "ai", D = p ? H.Fragment : mr;
152
- return /* @__PURE__ */ g("div", { className: _, "data-testid": r, ref: f, ...h, children: [
153
- /* @__PURE__ */ g(
154
- "div",
155
- {
156
- className: N([
157
- `${v}__row`,
158
- {
159
- [`${v}__row--with-back-button`]: l
160
- }
161
- ]),
162
- "data-testid": `${r}-row`,
163
- children: [
164
- /* @__PURE__ */ e("div", { className: N(`${v}__left`), children: l ? /* @__PURE__ */ g(
165
- Q,
166
- {
167
- "aria-label": n ? o : "",
168
- className: N([
169
- `${v}__back-button`,
170
- {
171
- [`${v}__back-button--only-icon`]: n
172
- }
173
- ]),
174
- "data-testid": `${r}-back-button`,
175
- iconOnly: n,
176
- negative: y,
177
- onClick: d,
178
- size: "sm",
179
- variant: n ? F.TERTIARY_PURPLE : F.TEXT,
180
- children: [
181
- /* @__PURE__ */ e(Dr, { size: "sm" }),
182
- !n && o
183
- ]
184
- }
185
- ) : s ? /* @__PURE__ */ g(I, { children: [
186
- s,
187
- /* @__PURE__ */ e(rr, { asChild: !0, children: /* @__PURE__ */ e(U, { children: t }) })
188
- ] }) : /* @__PURE__ */ e(U, { asChild: !0, children: /* @__PURE__ */ e(
189
- Z,
190
- {
191
- className: N(`${v}__title`),
192
- "data-testid": `${r}-title`,
193
- negative: y,
194
- tag: "h2",
195
- variant: B.DISPLAY10,
196
- tabIndex: -1,
197
- children: t
198
- }
199
- ) }) }),
200
- /* @__PURE__ */ e("div", { className: N(`${v}__right`), children: /* @__PURE__ */ e(D, { ...p ? {} : { asChild: !0 }, children: /* @__PURE__ */ e(
201
- Q,
202
- {
203
- "aria-label": c,
204
- className: N(`${v}__close-button`),
205
- iconOnly: !0,
206
- negative: y,
207
- onClick: p,
208
- size: "sm",
209
- variant: F.TERTIARY_PURPLE,
210
- children: /* @__PURE__ */ e(Nr, { size: "sm" })
211
- }
212
- ) }) })
213
- ]
214
- }
215
- ),
216
- l && (s ? /* @__PURE__ */ g(I, { children: [
217
- s,
218
- /* @__PURE__ */ e(rr, { asChild: !0, children: /* @__PURE__ */ e(U, { children: t }) })
219
- ] }) : /* @__PURE__ */ e(U, { asChild: !0, children: /* @__PURE__ */ e(
220
- Z,
221
- {
222
- "data-testid": `${r}-title-with-back-button`,
223
- className: N(`${v}__title`),
224
- negative: y,
225
- tag: "h2",
226
- tabIndex: -1,
227
- variant: B.DISPLAY10,
228
- children: t
229
- }
230
- ) }))
231
- ] });
232
- }
233
- );
234
- or.displayName = "DrawerHeader";
235
- const Tr = {
236
- "purpur-drawer-scroll-area__root": "_purpur-drawer-scroll-area__root_vzgxi_1",
237
- "purpur-drawer-scroll-area__root--fit-to-content": "_purpur-drawer-scroll-area__root--fit-to-content_vzgxi_4",
238
- "purpur-drawer-scroll-area__viewport": "_purpur-drawer-scroll-area__viewport_vzgxi_10",
239
- "purpur-drawer-scroll-area__scrollbar": "_purpur-drawer-scroll-area__scrollbar_vzgxi_14",
240
- "purpur-drawer-scroll-area--ai": "_purpur-drawer-scroll-area--ai_vzgxi_25",
241
- "purpur-drawer-scroll-area__thumb": "_purpur-drawer-scroll-area__thumb_vzgxi_29"
242
- }, C = k.bind(Tr), P = "purpur-drawer-scroll-area", K = z(
243
- ({
244
- ["data-testid"]: r = "purpur-drawer-scroll-area",
245
- children: a,
246
- className: o,
247
- drawerVariant: n = "default",
248
- fitToContent: u = !1,
249
- ...c
250
- }, s) => {
251
- const d = C([
252
- P,
253
- { [`${P}--ai`]: n === "ai" },
254
- o
255
- ]);
256
- return /* @__PURE__ */ e("div", { className: d, "data-testid": r, ref: s, ...c, children: /* @__PURE__ */ g(
257
- jr,
258
- {
259
- className: C(`${P}__root`, {
260
- [`${P}__root--fit-to-content`]: u
261
- }),
262
- children: [
263
- /* @__PURE__ */ e(Pr, { className: C(`${P}__viewport`), children: a }),
264
- /* @__PURE__ */ e(
265
- zr,
266
- {
267
- className: C(`${P}__scrollbar`),
268
- orientation: "vertical",
269
- children: /* @__PURE__ */ e(Sr, { className: C(`${P}__thumb`) })
270
- }
271
- )
272
- ]
273
- }
274
- ) });
275
- }
276
- );
277
- K.displayName = "DrawerScrollArea";
278
- const S = k.bind(Hr), m = "purpur-drawer-frame", sr = z(
279
- ({
280
- ["data-testid"]: r = "purpur-drawer-frame",
281
- backButton: a,
282
- backButtonText: o,
283
- backButtonOnlyIcon: n,
284
- children: u,
285
- className: c,
286
- closeButtonAriaLabel: s,
287
- fitToContent: d = !1,
288
- footerContent: p,
289
- headerContent: t,
290
- onBackButtonClick: i,
291
- onCloseClick: h,
292
- onSwipeStart: f,
293
- onSwipeMove: _,
294
- onSwipeCancel: l,
295
- onSwipeEnd: y,
296
- title: D,
297
- stickyFooter: b,
298
- position: E = "right",
299
- variant: w = "default",
300
- ...A
301
- }, V) => {
302
- const L = !!(a && o && i), R = w === "ai", M = S([
303
- m,
304
- {
305
- [`${m}--fit-to-content`]: d,
306
- [`${m}--sticky-footer`]: b,
307
- [`${m}--left`]: E === "left",
308
- [`${m}--right`]: E === "right",
309
- [`${m}--without-back-button`]: !L,
310
- [`${m}--with-back-button`]: L,
311
- [`${m}--ai`]: R
312
- },
313
- c
314
- ]);
315
- return /* @__PURE__ */ g("div", { className: M, "data-testid": r, ref: V, ...A, children: [
316
- /* @__PURE__ */ e(
317
- nr,
318
- {
319
- onSwipeStart: f,
320
- onSwipeMove: _,
321
- onSwipeCancel: l,
322
- onSwipeEnd: y,
323
- variant: w
324
- }
325
- ),
326
- /* @__PURE__ */ e(
327
- x,
328
- {
329
- className: S(`${m}__header`),
330
- variant: "header",
331
- stickyFooter: b,
332
- drawerVariant: w,
333
- children: /* @__PURE__ */ e(
334
- or,
335
- {
336
- title: D,
337
- headerContent: t,
338
- backButtonOnlyIcon: n,
339
- backButton: a,
340
- backButtonText: o,
341
- closeButtonAriaLabel: s,
342
- onBackButtonClick: i,
343
- onCloseClick: h,
344
- variant: w
345
- }
346
- )
347
- }
348
- ),
349
- b ? /* @__PURE__ */ g(I, { children: [
350
- /* @__PURE__ */ e(
351
- K,
352
- {
353
- className: S(`${m}__body`),
354
- "data-testid": `${r}-sticky-footer-scroll-area`,
355
- fitToContent: d,
356
- drawerVariant: w,
357
- children: /* @__PURE__ */ e(x, { stickyFooter: !0, drawerVariant: w, children: u })
358
- }
359
- ),
360
- p && /* @__PURE__ */ e(
361
- x,
362
- {
363
- className: S(`${m}__footer`),
364
- "data-testid": `${r}-sticky-footer`,
365
- variant: "footer",
366
- stickyFooter: b,
367
- drawerVariant: w,
368
- children: p
369
- }
370
- )
371
- ] }) : /* @__PURE__ */ e(
372
- K,
373
- {
374
- className: S(`${m}__body`),
375
- "data-testid": `${r}-scroll-area`,
376
- fitToContent: d,
377
- drawerVariant: w,
378
- children: /* @__PURE__ */ g(
379
- "div",
380
- {
381
- className: S([
382
- `${m}__content-container`,
383
- { [`${m}__content-container--no-footer`]: !p }
384
- ]),
385
- children: [
386
- /* @__PURE__ */ e(x, { stickyFooter: b, drawerVariant: w, children: u }),
387
- p && /* @__PURE__ */ e(
388
- x,
389
- {
390
- "data-testid": `${r}-footer`,
391
- stickyFooter: b,
392
- variant: "footer",
393
- drawerVariant: w,
394
- children: p
395
- }
396
- )
397
- ]
398
- }
399
- )
400
- }
401
- )
402
- ] });
403
- }
404
- );
405
- sr.displayName = "DrawerFrame";
406
- const qr = (r, a) => ({
407
- onSwipeStart: () => {
408
- r.current && r.current.setAttribute("data-swipe", "start");
409
- },
410
- onSwipeMove: (s) => {
411
- if (!r.current)
412
- return;
413
- const { y: d } = s.delta;
414
- r.current.setAttribute("data-swipe", "move"), r.current.style.setProperty("--purpur-drawer-swipe-move-y", `${d}px`);
415
- },
416
- onSwipeCancel: () => {
417
- r.current && (r.current.setAttribute("data-swipe", "cancel"), r.current.style.removeProperty("--purpur-drawer-swipe-move-y"), r.current.style.removeProperty("--purpur-drawer-swipe-end-y"));
418
- },
419
- onSwipeEnd: (s) => {
420
- if (!r.current)
421
- return;
422
- const { y: d } = s.delta;
423
- r.current.setAttribute("data-swipe", "end"), r.current.style.removeProperty("--purpur-drawer-swipe-move-y"), r.current.style.setProperty("--purpur-drawer-swipe-end-y", `${d}px`), a?.(!1);
424
- }
425
- }), O = k.bind(Mr), j = "purpur-drawer-content", dr = z(
426
- ({
427
- ["data-testid"]: r = "purpur-drawer-content",
428
- backButton: a = !1,
429
- backButtonText: o,
430
- backButtonOnlyIcon: n = !1,
431
- bodyText: u,
432
- children: c,
433
- className: s,
434
- closeButtonAriaLabel: d,
435
- disableCloseOnClickOutside: p = !1,
436
- fitToContent: t = !1,
437
- footerContent: i,
438
- headerContent: h,
439
- onBackButtonClick: f,
440
- onCloseClick: _,
441
- stickyFooter: l = !1,
442
- title: y,
443
- zIndex: D,
444
- position: b = "right",
445
- ...E
446
- }, w) => {
447
- const A = hr(ar), V = A?.variant ?? "default", L = A?.isModal ?? !0, R = O([
448
- j,
449
- {
450
- [`${j}--fit-to-content`]: t,
451
- [`${j}--left`]: b === "left",
452
- [`${j}--right`]: b === "right",
453
- [`${j}--ai`]: V === "ai"
454
- },
455
- s
456
- ]), M = G(null), q = G(null), ir = ($) => {
457
- q.current = $, typeof w == "function" ? w($) : w && (w.current = $);
458
- }, { onSwipeStart: cr, onSwipeMove: pr, onSwipeCancel: lr, onSwipeEnd: _r } = qr(
459
- q,
460
- A?.onOpenChange ?? null
461
- ), W = /* @__PURE__ */ e(
462
- $r,
463
- {
464
- onPointerDownOutside: ($) => {
465
- if (p) {
466
- $.preventDefault();
467
- return;
468
- }
469
- _ && ($.preventDefault(), _());
470
- },
471
- onEscapeKeyDown: ($) => {
472
- _ && ($.preventDefault(), _());
473
- },
474
- onOpenAutoFocus: () => {
475
- const $ = M.current;
476
- if ($) {
477
- const X = $.querySelector("h2");
478
- X && setTimeout(() => {
479
- X.focus();
480
- });
481
- }
482
- },
483
- className: R,
484
- "data-testid": r,
485
- ref: ir,
486
- ...!u && { "aria-describedby": void 0 },
487
- ...E,
488
- children: /* @__PURE__ */ e(
489
- sr,
490
- {
491
- backButton: a,
492
- backButtonText: o,
493
- backButtonOnlyIcon: n,
494
- closeButtonAriaLabel: d,
495
- className: O(`${j}__drawer-frame`),
496
- fitToContent: t,
497
- footerContent: i,
498
- headerContent: h,
499
- ref: M,
500
- onBackButtonClick: f,
501
- onCloseClick: _,
502
- onSwipeStart: cr,
503
- onSwipeMove: pr,
504
- onSwipeCancel: lr,
505
- onSwipeEnd: _r,
506
- stickyFooter: l,
507
- title: y,
508
- position: b,
509
- variant: V,
510
- children: u ? /* @__PURE__ */ g("div", { className: O(`${j}__content-container`), children: [
511
- /* @__PURE__ */ e(
512
- vr,
513
- {
514
- className: O(`${j}__description`),
515
- "data-testid": `${r}-description`,
516
- children: u
517
- }
518
- ),
519
- /* @__PURE__ */ e("div", { children: c })
520
- ] }) : c
521
- }
522
- )
523
- }
524
- );
525
- return L ? /* @__PURE__ */ e(J, { children: /* @__PURE__ */ e(
526
- yr,
527
- {
528
- className: O("purpur-drawer-overlay"),
529
- style: D ? { zIndex: D } : void 0,
530
- "data-testid": `${r}-overlay`,
531
- children: W
532
- }
533
- ) }) : /* @__PURE__ */ e(J, { children: /* @__PURE__ */ e(
534
- "div",
535
- {
536
- className: O("purpur-drawer-overlay"),
537
- style: D ? { zIndex: D } : void 0,
538
- "data-testid": `${r}-overlay`,
539
- children: W
540
- }
541
- ) });
542
- }
543
- );
544
- dr.displayName = "DrawerContent";
545
- const ur = z(
546
- ({ ["data-testid"]: r = "purpur-drawer-trigger", children: a, ...o }, n) => /* @__PURE__ */ e(br, { asChild: !0, "data-testid": r, ref: n, ...o, children: a })
547
- );
548
- ur.displayName = "DrawerTrigger";
549
- const T = ({
550
- ["data-testid"]: r = "purpur-drawer",
551
- children: a,
552
- className: o,
553
- isModal: n = !0,
554
- onOpenChange: u,
555
- open: c = !1,
556
- variant: s = "default",
557
- ...d
558
- }) => {
559
- const [p, t] = H.useState(c), i = (f) => {
560
- t(f), u?.(f);
561
- };
562
- fr(() => {
563
- t(c);
564
- }, [c]);
565
- const h = { isModal: n, onOpenChange: i, variant: s };
566
- return /* @__PURE__ */ e(ar.Provider, { value: h, children: /* @__PURE__ */ e("div", { className: o, "data-testid": r, ...d, children: /* @__PURE__ */ e(gr, { open: p, onOpenChange: i, modal: n, children: a }) }) });
567
- };
568
- T.Trigger = ur;
569
- T.Content = dr;
570
- T.displayName = "Drawer";
571
- export {
572
- T as D
573
- };
574
- //# sourceMappingURL=drawer-8Acg4wkV.mjs.map