@blimu/react 1.1.0 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (489) hide show
  1. package/README.md +1 -1
  2. package/dist/_virtual/index.cjs +5 -1
  3. package/dist/_virtual/index.cjs.map +1 -1
  4. package/dist/_virtual/index.js +3 -3
  5. package/dist/_virtual/index2.cjs +4 -1
  6. package/dist/_virtual/index2.cjs.map +1 -1
  7. package/dist/_virtual/index2.js +2 -2
  8. package/dist/_virtual/use-sync-external-store-shim.development.cjs +4 -1
  9. package/dist/_virtual/use-sync-external-store-shim.development.cjs.map +1 -1
  10. package/dist/_virtual/use-sync-external-store-shim.development.js +2 -2
  11. package/dist/_virtual/use-sync-external-store-shim.production.cjs +4 -1
  12. package/dist/_virtual/use-sync-external-store-shim.production.cjs.map +1 -1
  13. package/dist/_virtual/use-sync-external-store-shim.production.js +2 -2
  14. package/dist/client/auth.service.cjs +248 -1
  15. package/dist/client/auth.service.cjs.map +1 -1
  16. package/dist/client/auth.service.d.ts.map +1 -1
  17. package/dist/client/auth.service.js +193 -96
  18. package/dist/client/auth.service.js.map +1 -1
  19. package/dist/client/external-store.cjs +26 -1
  20. package/dist/client/external-store.cjs.map +1 -1
  21. package/dist/client/external-store.js +22 -8
  22. package/dist/client/external-store.js.map +1 -1
  23. package/dist/client/runtime-client.cjs +136 -1
  24. package/dist/client/runtime-client.cjs.map +1 -1
  25. package/dist/client/runtime-client.d.ts +1 -1
  26. package/dist/client/runtime-client.d.ts.map +1 -1
  27. package/dist/client/runtime-client.js +85 -51
  28. package/dist/client/runtime-client.js.map +1 -1
  29. package/dist/components/index.cjs +13 -0
  30. package/dist/components/index.cjs.map +1 -0
  31. package/dist/components/index.d.ts +6 -6
  32. package/dist/components/index.d.ts.map +1 -1
  33. package/dist/components/index.js +13 -0
  34. package/dist/components/index.js.map +1 -0
  35. package/dist/components/members-list.cjs +132 -1
  36. package/dist/components/members-list.cjs.map +1 -1
  37. package/dist/components/members-list.d.ts.map +1 -1
  38. package/dist/components/members-list.js +69 -64
  39. package/dist/components/members-list.js.map +1 -1
  40. package/dist/components/redirect-to-sign-in.cjs +34 -1
  41. package/dist/components/redirect-to-sign-in.cjs.map +1 -1
  42. package/dist/components/redirect-to-sign-in.js +28 -20
  43. package/dist/components/redirect-to-sign-in.js.map +1 -1
  44. package/dist/components/sign-in-button.cjs +36 -1
  45. package/dist/components/sign-in-button.cjs.map +1 -1
  46. package/dist/components/sign-in-button.d.ts.map +1 -1
  47. package/dist/components/sign-in-button.js +25 -21
  48. package/dist/components/sign-in-button.js.map +1 -1
  49. package/dist/components/ui/avatar.cjs +42 -1
  50. package/dist/components/ui/avatar.cjs.map +1 -1
  51. package/dist/components/ui/avatar.d.ts +2 -2
  52. package/dist/components/ui/avatar.d.ts.map +1 -1
  53. package/dist/components/ui/avatar.js +23 -23
  54. package/dist/components/ui/avatar.js.map +1 -1
  55. package/dist/components/ui/badge.d.ts +2 -2
  56. package/dist/components/ui/badge.d.ts.map +1 -1
  57. package/dist/components/ui/dropdown-menu.cjs +148 -1
  58. package/dist/components/ui/dropdown-menu.cjs.map +1 -1
  59. package/dist/components/ui/dropdown-menu.d.ts +2 -2
  60. package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
  61. package/dist/components/ui/dropdown-menu.js +83 -81
  62. package/dist/components/ui/dropdown-menu.js.map +1 -1
  63. package/dist/components/ui/popover.d.ts +2 -2
  64. package/dist/components/ui/popover.d.ts.map +1 -1
  65. package/dist/components/ui/separator.d.ts +1 -1
  66. package/dist/components/ui/separator.d.ts.map +1 -1
  67. package/dist/components/user-avatar.cjs +22 -1
  68. package/dist/components/user-avatar.cjs.map +1 -1
  69. package/dist/components/user-avatar.d.ts +5 -5
  70. package/dist/components/user-avatar.d.ts.map +1 -1
  71. package/dist/components/user-avatar.js +16 -16
  72. package/dist/components/user-avatar.js.map +1 -1
  73. package/dist/components/user-button/styles.cjs +39 -1
  74. package/dist/components/user-button/styles.cjs.map +1 -1
  75. package/dist/components/user-button/styles.js +6 -5
  76. package/dist/components/user-button/styles.js.map +1 -1
  77. package/dist/components/user-button/user-button.cjs +98 -1
  78. package/dist/components/user-button/user-button.cjs.map +1 -1
  79. package/dist/components/user-button/user-button.d.ts +1 -1
  80. package/dist/components/user-button/user-button.d.ts.map +1 -1
  81. package/dist/components/user-button/user-button.js +64 -58
  82. package/dist/components/user-button/user-button.js.map +1 -1
  83. package/dist/hooks/index.cjs +14 -0
  84. package/dist/hooks/index.cjs.map +1 -0
  85. package/dist/hooks/index.d.ts +3 -2
  86. package/dist/hooks/index.d.ts.map +1 -1
  87. package/dist/hooks/index.js +14 -0
  88. package/dist/hooks/index.js.map +1 -0
  89. package/dist/hooks/use-auth.cjs +44 -1
  90. package/dist/hooks/use-auth.cjs.map +1 -1
  91. package/dist/hooks/use-auth.d.ts +13 -15
  92. package/dist/hooks/use-auth.d.ts.map +1 -1
  93. package/dist/hooks/use-auth.js +30 -26
  94. package/dist/hooks/use-auth.js.map +1 -1
  95. package/dist/hooks/use-client.cjs +9 -1
  96. package/dist/hooks/use-client.cjs.map +1 -1
  97. package/dist/hooks/use-client.d.ts +1 -1
  98. package/dist/hooks/use-client.d.ts.map +1 -1
  99. package/dist/hooks/use-client.js +6 -5
  100. package/dist/hooks/use-client.js.map +1 -1
  101. package/dist/hooks/use-members.cjs +60 -1
  102. package/dist/hooks/use-members.cjs.map +1 -1
  103. package/dist/hooks/use-members.d.ts +5 -5
  104. package/dist/hooks/use-members.d.ts.map +1 -1
  105. package/dist/hooks/use-members.js +53 -41
  106. package/dist/hooks/use-members.js.map +1 -1
  107. package/dist/hooks/use-store.cjs +17 -1
  108. package/dist/hooks/use-store.cjs.map +1 -1
  109. package/dist/hooks/use-store.js +7 -7
  110. package/dist/hooks/use-store.js.map +1 -1
  111. package/dist/index.cjs +37 -1
  112. package/dist/index.cjs.map +1 -1
  113. package/dist/index.d.ts +5 -5
  114. package/dist/index.d.ts.map +1 -1
  115. package/dist/index.js +35 -35
  116. package/dist/lib/utils.cjs +8 -1
  117. package/dist/lib/utils.cjs.map +1 -1
  118. package/dist/lib/utils.js +5 -5
  119. package/dist/lib/utils.js.map +1 -1
  120. package/dist/lib/variants.cjs +46 -1
  121. package/dist/lib/variants.cjs.map +1 -1
  122. package/dist/lib/variants.d.ts +1 -1
  123. package/dist/lib/variants.js +6 -5
  124. package/dist/lib/variants.js.map +1 -1
  125. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.cjs +721 -1
  126. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.cjs.map +1 -1
  127. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +571 -377
  128. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js.map +1 -1
  129. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.cjs +625 -1
  130. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.cjs.map +1 -1
  131. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +539 -316
  132. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +1 -1
  133. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs +313 -1
  134. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs.map +1 -1
  135. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +261 -172
  136. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js.map +1 -1
  137. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.cjs +154 -1
  138. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.cjs.map +1 -1
  139. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.cjs +173 -1
  140. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.cjs.map +1 -1
  141. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +144 -107
  142. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -1
  143. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +111 -87
  144. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js.map +1 -1
  145. package/dist/node_modules/@radix-ui/primitive/dist/index.cjs +11 -1
  146. package/dist/node_modules/@radix-ui/primitive/dist/index.cjs.map +1 -1
  147. package/dist/node_modules/@radix-ui/primitive/dist/index.js +7 -5
  148. package/dist/node_modules/@radix-ui/primitive/dist/index.js.map +1 -1
  149. package/dist/node_modules/@radix-ui/react-arrow/dist/index.cjs +42 -1
  150. package/dist/node_modules/@radix-ui/react-arrow/dist/index.cjs.map +1 -1
  151. package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +17 -16
  152. package/dist/node_modules/@radix-ui/react-arrow/dist/index.js.map +1 -1
  153. package/dist/node_modules/@radix-ui/react-avatar/dist/index.cjs +140 -1
  154. package/dist/node_modules/@radix-ui/react-avatar/dist/index.cjs.map +1 -1
  155. package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +105 -57
  156. package/dist/node_modules/@radix-ui/react-avatar/dist/index.js.map +1 -1
  157. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-context/dist/index.cjs +80 -1
  158. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-context/dist/index.cjs.map +1 -1
  159. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-context/dist/index.js +49 -41
  160. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-context/dist/index.js.map +1 -1
  161. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-primitive/dist/index.cjs +56 -1
  162. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-primitive/dist/index.cjs.map +1 -1
  163. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-primitive/dist/index.js +17 -10
  164. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -1
  165. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-slot/dist/index.cjs +119 -1
  166. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-slot/dist/index.cjs.map +1 -1
  167. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-slot/dist/index.js +86 -42
  168. package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -1
  169. package/dist/node_modules/@radix-ui/react-collection/dist/index.cjs +70 -1
  170. package/dist/node_modules/@radix-ui/react-collection/dist/index.cjs.map +1 -1
  171. package/dist/node_modules/@radix-ui/react-collection/dist/index.js +57 -37
  172. package/dist/node_modules/@radix-ui/react-collection/dist/index.js.map +1 -1
  173. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +56 -1
  174. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.cjs.map +1 -1
  175. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +29 -19
  176. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js.map +1 -1
  177. package/dist/node_modules/@radix-ui/react-context/dist/index.cjs +79 -1
  178. package/dist/node_modules/@radix-ui/react-context/dist/index.cjs.map +1 -1
  179. package/dist/node_modules/@radix-ui/react-context/dist/index.js +48 -39
  180. package/dist/node_modules/@radix-ui/react-context/dist/index.js.map +1 -1
  181. package/dist/node_modules/@radix-ui/react-direction/dist/index.cjs +27 -1
  182. package/dist/node_modules/@radix-ui/react-direction/dist/index.cjs.map +1 -1
  183. package/dist/node_modules/@radix-ui/react-direction/dist/index.js +6 -6
  184. package/dist/node_modules/@radix-ui/react-direction/dist/index.js.map +1 -1
  185. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs +229 -1
  186. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs.map +1 -1
  187. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +182 -97
  188. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map +1 -1
  189. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.cjs +296 -1
  190. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.cjs.map +1 -1
  191. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +232 -167
  192. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js.map +1 -1
  193. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.cjs +46 -1
  194. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.cjs.map +1 -1
  195. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +23 -11
  196. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js.map +1 -1
  197. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.cjs +224 -1
  198. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.cjs.map +1 -1
  199. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +169 -98
  200. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js.map +1 -1
  201. package/dist/node_modules/@radix-ui/react-id/dist/index.cjs +31 -1
  202. package/dist/node_modules/@radix-ui/react-id/dist/index.cjs.map +1 -1
  203. package/dist/node_modules/@radix-ui/react-id/dist/index.js +11 -10
  204. package/dist/node_modules/@radix-ui/react-id/dist/index.js.map +1 -1
  205. package/dist/node_modules/@radix-ui/react-menu/dist/index.cjs +845 -1
  206. package/dist/node_modules/@radix-ui/react-menu/dist/index.cjs.map +1 -1
  207. package/dist/node_modules/@radix-ui/react-menu/dist/index.js +662 -442
  208. package/dist/node_modules/@radix-ui/react-menu/dist/index.js.map +1 -1
  209. package/dist/node_modules/@radix-ui/react-popper/dist/index.cjs +308 -1
  210. package/dist/node_modules/@radix-ui/react-popper/dist/index.cjs.map +1 -1
  211. package/dist/node_modules/@radix-ui/react-popper/dist/index.js +209 -137
  212. package/dist/node_modules/@radix-ui/react-popper/dist/index.js.map +1 -1
  213. package/dist/node_modules/@radix-ui/react-portal/dist/index.cjs +34 -1
  214. package/dist/node_modules/@radix-ui/react-portal/dist/index.cjs.map +1 -1
  215. package/dist/node_modules/@radix-ui/react-portal/dist/index.js +14 -12
  216. package/dist/node_modules/@radix-ui/react-portal/dist/index.js.map +1 -1
  217. package/dist/node_modules/@radix-ui/react-presence/dist/index.cjs +145 -1
  218. package/dist/node_modules/@radix-ui/react-presence/dist/index.cjs.map +1 -1
  219. package/dist/node_modules/@radix-ui/react-presence/dist/index.js +103 -45
  220. package/dist/node_modules/@radix-ui/react-presence/dist/index.js.map +1 -1
  221. package/dist/node_modules/@radix-ui/react-primitive/dist/index.cjs +61 -1
  222. package/dist/node_modules/@radix-ui/react-primitive/dist/index.cjs.map +1 -1
  223. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +21 -14
  224. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -1
  225. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.cjs +244 -1
  226. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.cjs.map +1 -1
  227. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +179 -135
  228. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js.map +1 -1
  229. package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs +105 -1
  230. package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs.map +1 -1
  231. package/dist/node_modules/@radix-ui/react-slot/dist/index.js +74 -35
  232. package/dist/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -1
  233. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +28 -1
  234. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs.map +1 -1
  235. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +8 -7
  236. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js.map +1 -1
  237. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs +86 -1
  238. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs.map +1 -1
  239. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +57 -40
  240. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js.map +1 -1
  241. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.cjs +34 -1
  242. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.cjs.map +1 -1
  243. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +13 -10
  244. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js.map +1 -1
  245. package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.cjs +15 -1
  246. package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.cjs.map +1 -1
  247. package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +8 -8
  248. package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js.map +1 -1
  249. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs +23 -1
  250. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs.map +1 -1
  251. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +3 -3
  252. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js.map +1 -1
  253. package/dist/node_modules/@radix-ui/react-use-size/dist/index.cjs +56 -1
  254. package/dist/node_modules/@radix-ui/react-use-size/dist/index.cjs.map +1 -1
  255. package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +34 -22
  256. package/dist/node_modules/@radix-ui/react-use-size/dist/index.js.map +1 -1
  257. package/dist/node_modules/aria-hidden/dist/es2015/index.cjs +122 -1
  258. package/dist/node_modules/aria-hidden/dist/es2015/index.cjs.map +1 -1
  259. package/dist/node_modules/aria-hidden/dist/es2015/index.js +111 -41
  260. package/dist/node_modules/aria-hidden/dist/es2015/index.js.map +1 -1
  261. package/dist/node_modules/class-variance-authority/dist/index.cjs +45 -1
  262. package/dist/node_modules/class-variance-authority/dist/index.cjs.map +1 -1
  263. package/dist/node_modules/class-variance-authority/dist/index.js +40 -30
  264. package/dist/node_modules/class-variance-authority/dist/index.js.map +1 -1
  265. package/dist/node_modules/clsx/dist/clsx.cjs +17 -1
  266. package/dist/node_modules/clsx/dist/clsx.cjs.map +1 -1
  267. package/dist/node_modules/clsx/dist/clsx.js +13 -13
  268. package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
  269. package/dist/node_modules/get-nonce/dist/es2015/index.cjs +9 -1
  270. package/dist/node_modules/get-nonce/dist/es2015/index.cjs.map +1 -1
  271. package/dist/node_modules/get-nonce/dist/es2015/index.js +5 -3
  272. package/dist/node_modules/get-nonce/dist/es2015/index.js.map +1 -1
  273. package/dist/node_modules/js-cookie/dist/js.cookie.cjs +99 -1
  274. package/dist/node_modules/js-cookie/dist/js.cookie.cjs.map +1 -1
  275. package/dist/node_modules/js-cookie/dist/js.cookie.js +69 -43
  276. package/dist/node_modules/js-cookie/dist/js.cookie.js.map +1 -1
  277. package/dist/node_modules/jwt-decode/build/esm/index.cjs +58 -1
  278. package/dist/node_modules/jwt-decode/build/esm/index.cjs.map +1 -1
  279. package/dist/node_modules/jwt-decode/build/esm/index.js +36 -30
  280. package/dist/node_modules/jwt-decode/build/esm/index.js.map +1 -1
  281. package/dist/node_modules/lucide-react/dist/esm/Icon.cjs +35 -1
  282. package/dist/node_modules/lucide-react/dist/esm/Icon.cjs.map +1 -1
  283. package/dist/node_modules/lucide-react/dist/esm/Icon.js +25 -25
  284. package/dist/node_modules/lucide-react/dist/esm/Icon.js.map +1 -1
  285. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.cjs +22 -1
  286. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.cjs.map +1 -1
  287. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +16 -15
  288. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js.map +1 -1
  289. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.cjs +14 -1
  290. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.cjs.map +1 -1
  291. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +2 -2
  292. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js.map +1 -1
  293. package/dist/node_modules/lucide-react/dist/esm/icons/check.cjs +7 -1
  294. package/dist/node_modules/lucide-react/dist/esm/icons/check.cjs.map +1 -1
  295. package/dist/node_modules/lucide-react/dist/esm/icons/check.js +5 -4
  296. package/dist/node_modules/lucide-react/dist/esm/icons/check.js.map +1 -1
  297. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.cjs +7 -1
  298. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.cjs.map +1 -1
  299. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.js +5 -4
  300. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.js.map +1 -1
  301. package/dist/node_modules/lucide-react/dist/esm/icons/circle.cjs +7 -1
  302. package/dist/node_modules/lucide-react/dist/esm/icons/circle.cjs.map +1 -1
  303. package/dist/node_modules/lucide-react/dist/esm/icons/circle.js +5 -4
  304. package/dist/node_modules/lucide-react/dist/esm/icons/circle.js.map +1 -1
  305. package/dist/node_modules/lucide-react/dist/esm/icons/log-out.cjs +11 -1
  306. package/dist/node_modules/lucide-react/dist/esm/icons/log-out.cjs.map +1 -1
  307. package/dist/node_modules/lucide-react/dist/esm/icons/log-out.js +6 -5
  308. package/dist/node_modules/lucide-react/dist/esm/icons/log-out.js.map +1 -1
  309. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.cjs +26 -1
  310. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.cjs.map +1 -1
  311. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +22 -14
  312. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js.map +1 -1
  313. package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.cjs +28 -1
  314. package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.cjs.map +1 -1
  315. package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +8 -8
  316. package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js.map +1 -1
  317. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.cjs +197 -4
  318. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.cjs.map +1 -1
  319. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +163 -98
  320. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js.map +1 -1
  321. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.cjs +55 -1
  322. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.cjs.map +1 -1
  323. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +31 -24
  324. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js.map +1 -1
  325. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.cjs +19 -1
  326. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.cjs.map +1 -1
  327. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +12 -9
  328. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js.map +1 -1
  329. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.cjs +102 -1
  330. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.cjs.map +1 -1
  331. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +85 -51
  332. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js.map +1 -1
  333. package/dist/node_modules/react-remove-scroll/dist/es2015/medium.cjs +5 -1
  334. package/dist/node_modules/react-remove-scroll/dist/es2015/medium.cjs.map +1 -1
  335. package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +3 -3
  336. package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js.map +1 -1
  337. package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.cjs +7 -1
  338. package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.cjs.map +1 -1
  339. package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +5 -5
  340. package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js.map +1 -1
  341. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.cjs +62 -36
  342. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.cjs.map +1 -1
  343. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +41 -65
  344. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js.map +1 -1
  345. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.cjs +10 -1
  346. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.cjs.map +1 -1
  347. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +8 -5
  348. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js.map +1 -1
  349. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.cjs +37 -1
  350. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.cjs.map +1 -1
  351. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +28 -16
  352. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js.map +1 -1
  353. package/dist/node_modules/react-style-singleton/dist/es2015/component.cjs +13 -1
  354. package/dist/node_modules/react-style-singleton/dist/es2015/component.cjs.map +1 -1
  355. package/dist/node_modules/react-style-singleton/dist/es2015/component.js +9 -7
  356. package/dist/node_modules/react-style-singleton/dist/es2015/component.js.map +1 -1
  357. package/dist/node_modules/react-style-singleton/dist/es2015/hook.cjs +33 -1
  358. package/dist/node_modules/react-style-singleton/dist/es2015/hook.cjs.map +1 -1
  359. package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +11 -10
  360. package/dist/node_modules/react-style-singleton/dist/es2015/hook.js.map +1 -1
  361. package/dist/node_modules/react-style-singleton/dist/es2015/singleton.cjs +48 -1
  362. package/dist/node_modules/react-style-singleton/dist/es2015/singleton.cjs.map +1 -1
  363. package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +35 -17
  364. package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js.map +1 -1
  365. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.cjs +3014 -1
  366. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.cjs.map +1 -1
  367. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +804 -555
  368. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
  369. package/dist/node_modules/tailwindcss/dist/plugin.cjs +13 -1
  370. package/dist/node_modules/tailwindcss/dist/plugin.cjs.map +1 -1
  371. package/dist/node_modules/tailwindcss/dist/plugin.js +8 -8
  372. package/dist/node_modules/tailwindcss/dist/plugin.js.map +1 -1
  373. package/dist/node_modules/tslib/tslib.es6.cjs +38 -1
  374. package/dist/node_modules/tslib/tslib.es6.cjs.map +1 -1
  375. package/dist/node_modules/tslib/tslib.es6.js +33 -21
  376. package/dist/node_modules/tslib/tslib.es6.js.map +1 -1
  377. package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.cjs +11 -1
  378. package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.cjs.map +1 -1
  379. package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +8 -3
  380. package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js.map +1 -1
  381. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.cjs +52 -1
  382. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.cjs.map +1 -1
  383. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +28 -19
  384. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js.map +1 -1
  385. package/dist/node_modules/use-callback-ref/dist/es2015/useRef.cjs +29 -1
  386. package/dist/node_modules/use-callback-ref/dist/es2015/useRef.cjs.map +1 -1
  387. package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +15 -11
  388. package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js.map +1 -1
  389. package/dist/node_modules/use-sidecar/dist/es2015/exports.cjs +38 -1
  390. package/dist/node_modules/use-sidecar/dist/es2015/exports.cjs.map +1 -1
  391. package/dist/node_modules/use-sidecar/dist/es2015/exports.js +15 -12
  392. package/dist/node_modules/use-sidecar/dist/es2015/exports.js.map +1 -1
  393. package/dist/node_modules/use-sidecar/dist/es2015/medium.cjs +88 -1
  394. package/dist/node_modules/use-sidecar/dist/es2015/medium.cjs.map +1 -1
  395. package/dist/node_modules/use-sidecar/dist/es2015/medium.js +64 -43
  396. package/dist/node_modules/use-sidecar/dist/es2015/medium.js.map +1 -1
  397. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.cjs +68 -1
  398. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.cjs.map +1 -1
  399. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +49 -39
  400. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +1 -1
  401. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.cjs +53 -1
  402. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.cjs.map +1 -1
  403. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +39 -32
  404. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +1 -1
  405. package/dist/node_modules/use-sync-external-store/shim/index.cjs +17 -1
  406. package/dist/node_modules/use-sync-external-store/shim/index.cjs.map +1 -1
  407. package/dist/node_modules/use-sync-external-store/shim/index.js +14 -7
  408. package/dist/node_modules/use-sync-external-store/shim/index.js.map +1 -1
  409. package/dist/providers/auth/auth.context.cjs +5 -1
  410. package/dist/providers/auth/auth.context.cjs.map +1 -1
  411. package/dist/providers/auth/auth.context.js +3 -3
  412. package/dist/providers/auth/auth.context.js.map +1 -1
  413. package/dist/providers/auth/auth.hook.cjs +12 -1
  414. package/dist/providers/auth/auth.hook.cjs.map +1 -1
  415. package/dist/providers/auth/auth.hook.js +8 -7
  416. package/dist/providers/auth/auth.hook.js.map +1 -1
  417. package/dist/providers/auth/auth.provider.cjs +37 -1
  418. package/dist/providers/auth/auth.provider.cjs.map +1 -1
  419. package/dist/providers/auth/auth.provider.js +31 -22
  420. package/dist/providers/auth/auth.provider.js.map +1 -1
  421. package/dist/providers/blimu/blimu.context.cjs +5 -1
  422. package/dist/providers/blimu/blimu.context.cjs.map +1 -1
  423. package/dist/providers/blimu/blimu.context.d.ts +4 -4
  424. package/dist/providers/blimu/blimu.context.d.ts.map +1 -1
  425. package/dist/providers/blimu/blimu.context.js +3 -3
  426. package/dist/providers/blimu/blimu.context.js.map +1 -1
  427. package/dist/providers/blimu/blimu.hook.cjs +12 -1
  428. package/dist/providers/blimu/blimu.hook.cjs.map +1 -1
  429. package/dist/providers/blimu/blimu.hook.js +8 -7
  430. package/dist/providers/blimu/blimu.hook.js.map +1 -1
  431. package/dist/providers/blimu/blimu.provider.cjs +71 -1
  432. package/dist/providers/blimu/blimu.provider.cjs.map +1 -1
  433. package/dist/providers/blimu/blimu.provider.d.ts +1 -1
  434. package/dist/providers/blimu/blimu.provider.d.ts.map +1 -1
  435. package/dist/providers/blimu/blimu.provider.js +32 -27
  436. package/dist/providers/blimu/blimu.provider.js.map +1 -1
  437. package/dist/providers/index.cjs +13 -0
  438. package/dist/providers/index.cjs.map +1 -0
  439. package/dist/providers/index.d.ts +3 -3
  440. package/dist/providers/index.d.ts.map +1 -1
  441. package/dist/providers/index.js +13 -0
  442. package/dist/providers/index.js.map +1 -0
  443. package/dist/providers/theme/index.d.ts +2 -2
  444. package/dist/providers/theme/index.d.ts.map +1 -1
  445. package/dist/providers/theme/theme.context.cjs +5 -1
  446. package/dist/providers/theme/theme.context.cjs.map +1 -1
  447. package/dist/providers/theme/theme.context.js +3 -3
  448. package/dist/providers/theme/theme.context.js.map +1 -1
  449. package/dist/providers/theme/theme.hook.cjs +12 -1
  450. package/dist/providers/theme/theme.hook.cjs.map +1 -1
  451. package/dist/providers/theme/theme.hook.js +8 -7
  452. package/dist/providers/theme/theme.hook.js.map +1 -1
  453. package/dist/providers/theme/theme.provider.cjs +104 -1
  454. package/dist/providers/theme/theme.provider.cjs.map +1 -1
  455. package/dist/providers/theme/theme.provider.d.ts.map +1 -1
  456. package/dist/providers/theme/theme.provider.js +85 -48
  457. package/dist/providers/theme/theme.provider.js.map +1 -1
  458. package/dist/styles/styles.css +34 -40
  459. package/dist/styles/tw-styles.css +34 -40
  460. package/dist/tailwind.cjs +200 -0
  461. package/dist/tailwind.cjs.map +1 -0
  462. package/dist/{tailwind.plugin.js → tailwind.js} +43 -43
  463. package/dist/tailwind.js.map +1 -0
  464. package/dist/types/index.cjs +11 -1
  465. package/dist/types/index.cjs.map +1 -1
  466. package/dist/types/index.d.ts +22 -8
  467. package/dist/types/index.d.ts.map +1 -1
  468. package/dist/types/index.js +8 -8
  469. package/dist/types/index.js.map +1 -1
  470. package/dist/utils/publishable-key.cjs +62 -1
  471. package/dist/utils/publishable-key.cjs.map +1 -1
  472. package/dist/utils/publishable-key.js +52 -27
  473. package/dist/utils/publishable-key.js.map +1 -1
  474. package/package.json +68 -53
  475. package/dist/components.cjs +0 -2
  476. package/dist/components.cjs.map +0 -1
  477. package/dist/components.js +0 -13
  478. package/dist/components.js.map +0 -1
  479. package/dist/hooks.cjs +0 -2
  480. package/dist/hooks.cjs.map +0 -1
  481. package/dist/hooks.js +0 -14
  482. package/dist/hooks.js.map +0 -1
  483. package/dist/providers.cjs +0 -2
  484. package/dist/providers.cjs.map +0 -1
  485. package/dist/providers.js +0 -13
  486. package/dist/providers.js.map +0 -1
  487. package/dist/tailwind.plugin.cjs +0 -2
  488. package/dist/tailwind.plugin.cjs.map +0 -1
  489. package/dist/tailwind.plugin.js.map +0 -1
@@ -1,528 +1,722 @@
1
- import { evaluate as L, getSideAxis as T, getSide as j, clamp as X, getOppositePlacement as ee, getExpandedPlacements as te, getOppositeAxisPlacements as ne, getAlignmentSides as ie, getAlignment as z, min as $, max as W, getPaddingObject as J, rectToClientRect as _, getOppositeAxis as K, getAlignmentAxis as N, sides as se, getAxisLength as Q } from "../../utils/dist/floating-ui.utils.js";
2
- function I(t, e, d) {
1
+ import { evaluate, getSideAxis, getSide, clamp, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, getAlignmentSides, getAlignment, min, max, getPaddingObject, rectToClientRect, getOppositeAxis, getAlignmentAxis, sides, getAxisLength } from "../../utils/dist/floating-ui.utils.js";
2
+ function computeCoordsFromPlacement(_ref, placement, rtl) {
3
3
  let {
4
- reference: a,
5
- floating: r
6
- } = t;
7
- const n = T(e), o = N(e), m = Q(o), u = j(e), h = n === "y", c = a.x + a.width / 2 - r.width / 2, s = a.y + a.height / 2 - r.height / 2, f = a[m] / 2 - r[m] / 2;
8
- let i;
9
- switch (u) {
4
+ reference,
5
+ floating
6
+ } = _ref;
7
+ const sideAxis = getSideAxis(placement);
8
+ const alignmentAxis = getAlignmentAxis(placement);
9
+ const alignLength = getAxisLength(alignmentAxis);
10
+ const side = getSide(placement);
11
+ const isVertical = sideAxis === "y";
12
+ const commonX = reference.x + reference.width / 2 - floating.width / 2;
13
+ const commonY = reference.y + reference.height / 2 - floating.height / 2;
14
+ const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
15
+ let coords;
16
+ switch (side) {
10
17
  case "top":
11
- i = {
12
- x: c,
13
- y: a.y - r.height
18
+ coords = {
19
+ x: commonX,
20
+ y: reference.y - floating.height
14
21
  };
15
22
  break;
16
23
  case "bottom":
17
- i = {
18
- x: c,
19
- y: a.y + a.height
24
+ coords = {
25
+ x: commonX,
26
+ y: reference.y + reference.height
20
27
  };
21
28
  break;
22
29
  case "right":
23
- i = {
24
- x: a.x + a.width,
25
- y: s
30
+ coords = {
31
+ x: reference.x + reference.width,
32
+ y: commonY
26
33
  };
27
34
  break;
28
35
  case "left":
29
- i = {
30
- x: a.x - r.width,
31
- y: s
36
+ coords = {
37
+ x: reference.x - floating.width,
38
+ y: commonY
32
39
  };
33
40
  break;
34
41
  default:
35
- i = {
36
- x: a.x,
37
- y: a.y
42
+ coords = {
43
+ x: reference.x,
44
+ y: reference.y
38
45
  };
39
46
  }
40
- switch (z(e)) {
47
+ switch (getAlignment(placement)) {
41
48
  case "start":
42
- i[o] -= f * (d && h ? -1 : 1);
49
+ coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
43
50
  break;
44
51
  case "end":
45
- i[o] += f * (d && h ? -1 : 1);
52
+ coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
46
53
  break;
47
54
  }
48
- return i;
55
+ return coords;
49
56
  }
50
- const ce = async (t, e, d) => {
57
+ const computePosition = async (reference, floating, config) => {
51
58
  const {
52
- placement: a = "bottom",
53
- strategy: r = "absolute",
54
- middleware: n = [],
55
- platform: o
56
- } = d, m = n.filter(Boolean), u = await (o.isRTL == null ? void 0 : o.isRTL(e));
57
- let h = await o.getElementRects({
58
- reference: t,
59
- floating: e,
60
- strategy: r
61
- }), {
62
- x: c,
63
- y: s
64
- } = I(h, a, u), f = a, i = {}, l = 0;
65
- for (let g = 0; g < m.length; g++) {
59
+ placement = "bottom",
60
+ strategy = "absolute",
61
+ middleware = [],
62
+ platform
63
+ } = config;
64
+ const validMiddleware = middleware.filter(Boolean);
65
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
66
+ let rects = await platform.getElementRects({
67
+ reference,
68
+ floating,
69
+ strategy
70
+ });
71
+ let {
72
+ x,
73
+ y
74
+ } = computeCoordsFromPlacement(rects, placement, rtl);
75
+ let statefulPlacement = placement;
76
+ let middlewareData = {};
77
+ let resetCount = 0;
78
+ for (let i = 0; i < validMiddleware.length; i++) {
79
+ const {
80
+ name,
81
+ fn
82
+ } = validMiddleware[i];
66
83
  const {
67
- name: x,
68
- fn: y
69
- } = m[g], {
70
- x: A,
71
- y: p,
72
- data: v,
73
- reset: w
74
- } = await y({
75
- x: c,
76
- y: s,
77
- initialPlacement: a,
78
- placement: f,
79
- strategy: r,
80
- middlewareData: i,
81
- rects: h,
82
- platform: o,
84
+ x: nextX,
85
+ y: nextY,
86
+ data,
87
+ reset
88
+ } = await fn({
89
+ x,
90
+ y,
91
+ initialPlacement: placement,
92
+ placement: statefulPlacement,
93
+ strategy,
94
+ middlewareData,
95
+ rects,
96
+ platform,
83
97
  elements: {
84
- reference: t,
85
- floating: e
98
+ reference,
99
+ floating
86
100
  }
87
101
  });
88
- c = A ?? c, s = p ?? s, i = {
89
- ...i,
90
- [x]: {
91
- ...i[x],
92
- ...v
102
+ x = nextX != null ? nextX : x;
103
+ y = nextY != null ? nextY : y;
104
+ middlewareData = {
105
+ ...middlewareData,
106
+ [name]: {
107
+ ...middlewareData[name],
108
+ ...data
93
109
  }
94
- }, w && l <= 50 && (l++, typeof w == "object" && (w.placement && (f = w.placement), w.rects && (h = w.rects === !0 ? await o.getElementRects({
95
- reference: t,
96
- floating: e,
97
- strategy: r
98
- }) : w.rects), {
99
- x: c,
100
- y: s
101
- } = I(h, f, u)), g = -1);
110
+ };
111
+ if (reset && resetCount <= 50) {
112
+ resetCount++;
113
+ if (typeof reset === "object") {
114
+ if (reset.placement) {
115
+ statefulPlacement = reset.placement;
116
+ }
117
+ if (reset.rects) {
118
+ rects = reset.rects === true ? await platform.getElementRects({
119
+ reference,
120
+ floating,
121
+ strategy
122
+ }) : reset.rects;
123
+ }
124
+ ({
125
+ x,
126
+ y
127
+ } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
128
+ }
129
+ i = -1;
130
+ }
102
131
  }
103
132
  return {
104
- x: c,
105
- y: s,
106
- placement: f,
107
- strategy: r,
108
- middlewareData: i
133
+ x,
134
+ y,
135
+ placement: statefulPlacement,
136
+ strategy,
137
+ middlewareData
109
138
  };
110
139
  };
111
- async function Y(t, e) {
112
- var d;
113
- e === void 0 && (e = {});
140
+ async function detectOverflow(state, options) {
141
+ var _await$platform$isEle;
142
+ if (options === void 0) {
143
+ options = {};
144
+ }
145
+ const {
146
+ x,
147
+ y,
148
+ platform,
149
+ rects,
150
+ elements,
151
+ strategy
152
+ } = state;
114
153
  const {
115
- x: a,
116
- y: r,
117
- platform: n,
118
- rects: o,
119
- elements: m,
120
- strategy: u
121
- } = t, {
122
- boundary: h = "clippingAncestors",
123
- rootBoundary: c = "viewport",
124
- elementContext: s = "floating",
125
- altBoundary: f = !1,
126
- padding: i = 0
127
- } = L(e, t), l = J(i), x = m[f ? s === "floating" ? "reference" : "floating" : s], y = _(await n.getClippingRect({
128
- element: (d = await (n.isElement == null ? void 0 : n.isElement(x))) == null || d ? x : x.contextElement || await (n.getDocumentElement == null ? void 0 : n.getDocumentElement(m.floating)),
129
- boundary: h,
130
- rootBoundary: c,
131
- strategy: u
132
- })), A = s === "floating" ? {
133
- x: a,
134
- y: r,
135
- width: o.floating.width,
136
- height: o.floating.height
137
- } : o.reference, p = await (n.getOffsetParent == null ? void 0 : n.getOffsetParent(m.floating)), v = await (n.isElement == null ? void 0 : n.isElement(p)) ? await (n.getScale == null ? void 0 : n.getScale(p)) || {
154
+ boundary = "clippingAncestors",
155
+ rootBoundary = "viewport",
156
+ elementContext = "floating",
157
+ altBoundary = false,
158
+ padding = 0
159
+ } = evaluate(options, state);
160
+ const paddingObject = getPaddingObject(padding);
161
+ const altContext = elementContext === "floating" ? "reference" : "floating";
162
+ const element = elements[altBoundary ? altContext : elementContext];
163
+ const clippingClientRect = rectToClientRect(await platform.getClippingRect({
164
+ element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating)),
165
+ boundary,
166
+ rootBoundary,
167
+ strategy
168
+ }));
169
+ const rect = elementContext === "floating" ? {
170
+ x,
171
+ y,
172
+ width: rects.floating.width,
173
+ height: rects.floating.height
174
+ } : rects.reference;
175
+ const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
176
+ const offsetScale = await (platform.isElement == null ? void 0 : platform.isElement(offsetParent)) ? await (platform.getScale == null ? void 0 : platform.getScale(offsetParent)) || {
138
177
  x: 1,
139
178
  y: 1
140
179
  } : {
141
180
  x: 1,
142
181
  y: 1
143
- }, w = _(n.convertOffsetParentRelativeRectToViewportRelativeRect ? await n.convertOffsetParentRelativeRectToViewportRelativeRect({
144
- elements: m,
145
- rect: A,
146
- offsetParent: p,
147
- strategy: u
148
- }) : A);
182
+ };
183
+ const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
184
+ elements,
185
+ rect,
186
+ offsetParent,
187
+ strategy
188
+ }) : rect);
149
189
  return {
150
- top: (y.top - w.top + l.top) / v.y,
151
- bottom: (w.bottom - y.bottom + l.bottom) / v.y,
152
- left: (y.left - w.left + l.left) / v.x,
153
- right: (w.right - y.right + l.right) / v.x
190
+ top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
191
+ bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
192
+ left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
193
+ right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
154
194
  };
155
195
  }
156
- const le = (t) => ({
196
+ const arrow = (options) => ({
157
197
  name: "arrow",
158
- options: t,
159
- async fn(e) {
198
+ options,
199
+ async fn(state) {
200
+ const {
201
+ x,
202
+ y,
203
+ placement,
204
+ rects,
205
+ platform,
206
+ elements,
207
+ middlewareData
208
+ } = state;
160
209
  const {
161
- x: d,
162
- y: a,
163
- placement: r,
164
- rects: n,
165
- platform: o,
166
- elements: m,
167
- middlewareData: u
168
- } = e, {
169
- element: h,
170
- padding: c = 0
171
- } = L(t, e) || {};
172
- if (h == null)
210
+ element,
211
+ padding = 0
212
+ } = evaluate(options, state) || {};
213
+ if (element == null) {
173
214
  return {};
174
- const s = J(c), f = {
175
- x: d,
176
- y: a
177
- }, i = N(r), l = Q(i), g = await o.getDimensions(h), x = i === "y", y = x ? "top" : "left", A = x ? "bottom" : "right", p = x ? "clientHeight" : "clientWidth", v = n.reference[l] + n.reference[i] - f[i] - n.floating[l], w = f[i] - n.reference[i], P = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(h));
178
- let C = P ? P[p] : 0;
179
- (!C || !await (o.isElement == null ? void 0 : o.isElement(P))) && (C = m.floating[p] || n.floating[l]);
180
- const M = v / 2 - w / 2, k = C / 2 - g[l] / 2 - 1, O = $(s[y], k), H = $(s[A], k), D = O, F = C - g[l] - H, b = C / 2 - g[l] / 2 + M, B = X(D, b, F), E = !u.arrow && z(r) != null && b !== B && n.reference[l] / 2 - (b < D ? O : H) - g[l] / 2 < 0, S = E ? b < D ? b - D : b - F : 0;
215
+ }
216
+ const paddingObject = getPaddingObject(padding);
217
+ const coords = {
218
+ x,
219
+ y
220
+ };
221
+ const axis = getAlignmentAxis(placement);
222
+ const length = getAxisLength(axis);
223
+ const arrowDimensions = await platform.getDimensions(element);
224
+ const isYAxis = axis === "y";
225
+ const minProp = isYAxis ? "top" : "left";
226
+ const maxProp = isYAxis ? "bottom" : "right";
227
+ const clientProp = isYAxis ? "clientHeight" : "clientWidth";
228
+ const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
229
+ const startDiff = coords[axis] - rects.reference[axis];
230
+ const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
231
+ let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
232
+ if (!clientSize || !await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent))) {
233
+ clientSize = elements.floating[clientProp] || rects.floating[length];
234
+ }
235
+ const centerToReference = endDiff / 2 - startDiff / 2;
236
+ const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
237
+ const minPadding = min(paddingObject[minProp], largestPossiblePadding);
238
+ const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
239
+ const min$1 = minPadding;
240
+ const max2 = clientSize - arrowDimensions[length] - maxPadding;
241
+ const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
242
+ const offset2 = clamp(min$1, center, max2);
243
+ const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset2 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
244
+ const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
181
245
  return {
182
- [i]: f[i] + S,
246
+ [axis]: coords[axis] + alignmentOffset,
183
247
  data: {
184
- [i]: B,
185
- centerOffset: b - B - S,
186
- ...E && {
187
- alignmentOffset: S
248
+ [axis]: offset2,
249
+ centerOffset: center - offset2 - alignmentOffset,
250
+ ...shouldAddOffset && {
251
+ alignmentOffset
188
252
  }
189
253
  },
190
- reset: E
254
+ reset: shouldAddOffset
191
255
  };
192
256
  }
193
- }), re = function(t) {
194
- return t === void 0 && (t = {}), {
257
+ });
258
+ const flip = function(options) {
259
+ if (options === void 0) {
260
+ options = {};
261
+ }
262
+ return {
195
263
  name: "flip",
196
- options: t,
197
- async fn(e) {
198
- var d, a;
264
+ options,
265
+ async fn(state) {
266
+ var _middlewareData$arrow, _middlewareData$flip;
267
+ const {
268
+ placement,
269
+ middlewareData,
270
+ rects,
271
+ initialPlacement,
272
+ platform,
273
+ elements
274
+ } = state;
199
275
  const {
200
- placement: r,
201
- middlewareData: n,
202
- rects: o,
203
- initialPlacement: m,
204
- platform: u,
205
- elements: h
206
- } = e, {
207
- mainAxis: c = !0,
208
- crossAxis: s = !0,
209
- fallbackPlacements: f,
210
- fallbackStrategy: i = "bestFit",
211
- fallbackAxisSideDirection: l = "none",
212
- flipAlignment: g = !0,
213
- ...x
214
- } = L(t, e);
215
- if ((d = n.arrow) != null && d.alignmentOffset)
276
+ mainAxis: checkMainAxis = true,
277
+ crossAxis: checkCrossAxis = true,
278
+ fallbackPlacements: specifiedFallbackPlacements,
279
+ fallbackStrategy = "bestFit",
280
+ fallbackAxisSideDirection = "none",
281
+ flipAlignment = true,
282
+ ...detectOverflowOptions
283
+ } = evaluate(options, state);
284
+ if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
216
285
  return {};
217
- const y = j(r), A = T(m), p = j(m) === m, v = await (u.isRTL == null ? void 0 : u.isRTL(h.floating)), w = f || (p || !g ? [ee(m)] : te(m)), P = l !== "none";
218
- !f && P && w.push(...ne(m, g, l, v));
219
- const C = [m, ...w], M = await Y(e, x), k = [];
220
- let O = ((a = n.flip) == null ? void 0 : a.overflows) || [];
221
- if (c && k.push(M[y]), s) {
222
- const b = ie(r, o, v);
223
- k.push(M[b[0]], M[b[1]]);
224
286
  }
225
- if (O = [...O, {
226
- placement: r,
227
- overflows: k
228
- }], !k.every((b) => b <= 0)) {
229
- var H, D;
230
- const b = (((H = n.flip) == null ? void 0 : H.index) || 0) + 1, B = C[b];
231
- if (B && (!(s === "alignment" ? A !== T(B) : !1) || // We leave the current main axis only if every placement on that axis
232
- // overflows the main axis.
233
- O.every((R) => T(R.placement) === A ? R.overflows[0] > 0 : !0)))
234
- return {
235
- data: {
236
- index: b,
237
- overflows: O
238
- },
239
- reset: {
240
- placement: B
241
- }
242
- };
243
- let E = (D = O.filter((S) => S.overflows[0] <= 0).sort((S, R) => S.overflows[1] - R.overflows[1])[0]) == null ? void 0 : D.placement;
244
- if (!E)
245
- switch (i) {
287
+ const side = getSide(placement);
288
+ const initialSideAxis = getSideAxis(initialPlacement);
289
+ const isBasePlacement = getSide(initialPlacement) === initialPlacement;
290
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
291
+ const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
292
+ const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
293
+ if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
294
+ fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
295
+ }
296
+ const placements = [initialPlacement, ...fallbackPlacements];
297
+ const overflow = await detectOverflow(state, detectOverflowOptions);
298
+ const overflows = [];
299
+ let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
300
+ if (checkMainAxis) {
301
+ overflows.push(overflow[side]);
302
+ }
303
+ if (checkCrossAxis) {
304
+ const sides2 = getAlignmentSides(placement, rects, rtl);
305
+ overflows.push(overflow[sides2[0]], overflow[sides2[1]]);
306
+ }
307
+ overflowsData = [...overflowsData, {
308
+ placement,
309
+ overflows
310
+ }];
311
+ if (!overflows.every((side2) => side2 <= 0)) {
312
+ var _middlewareData$flip2, _overflowsData$filter;
313
+ const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
314
+ const nextPlacement = placements[nextIndex];
315
+ if (nextPlacement) {
316
+ const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
317
+ if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis
318
+ // overflows the main axis.
319
+ overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
320
+ return {
321
+ data: {
322
+ index: nextIndex,
323
+ overflows: overflowsData
324
+ },
325
+ reset: {
326
+ placement: nextPlacement
327
+ }
328
+ };
329
+ }
330
+ }
331
+ let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
332
+ if (!resetPlacement) {
333
+ switch (fallbackStrategy) {
246
334
  case "bestFit": {
247
- var F;
248
- const S = (F = O.filter((R) => {
249
- if (P) {
250
- const V = T(R.placement);
251
- return V === A || // Create a bias to the `y` side axis due to horizontal
335
+ var _overflowsData$filter2;
336
+ const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => {
337
+ if (hasFallbackAxisSideDirection) {
338
+ const currentSideAxis = getSideAxis(d.placement);
339
+ return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
252
340
  // reading directions favoring greater width.
253
- V === "y";
341
+ currentSideAxis === "y";
254
342
  }
255
- return !0;
256
- }).map((R) => [R.placement, R.overflows.filter((V) => V > 0).reduce((V, Z) => V + Z, 0)]).sort((R, V) => R[1] - V[1])[0]) == null ? void 0 : F[0];
257
- S && (E = S);
343
+ return true;
344
+ }).map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
345
+ if (placement2) {
346
+ resetPlacement = placement2;
347
+ }
258
348
  break;
259
349
  }
260
350
  case "initialPlacement":
261
- E = m;
351
+ resetPlacement = initialPlacement;
262
352
  break;
263
353
  }
264
- if (r !== E)
354
+ }
355
+ if (placement !== resetPlacement) {
265
356
  return {
266
357
  reset: {
267
- placement: E
358
+ placement: resetPlacement
268
359
  }
269
360
  };
361
+ }
270
362
  }
271
363
  return {};
272
364
  }
273
365
  };
274
366
  };
275
- function q(t, e) {
367
+ function getSideOffsets(overflow, rect) {
276
368
  return {
277
- top: t.top - e.height,
278
- right: t.right - e.width,
279
- bottom: t.bottom - e.height,
280
- left: t.left - e.width
369
+ top: overflow.top - rect.height,
370
+ right: overflow.right - rect.width,
371
+ bottom: overflow.bottom - rect.height,
372
+ left: overflow.left - rect.width
281
373
  };
282
374
  }
283
- function G(t) {
284
- return se.some((e) => t[e] >= 0);
375
+ function isAnySideFullyClipped(overflow) {
376
+ return sides.some((side) => overflow[side] >= 0);
285
377
  }
286
- const fe = function(t) {
287
- return t === void 0 && (t = {}), {
378
+ const hide = function(options) {
379
+ if (options === void 0) {
380
+ options = {};
381
+ }
382
+ return {
288
383
  name: "hide",
289
- options: t,
290
- async fn(e) {
384
+ options,
385
+ async fn(state) {
386
+ const {
387
+ rects
388
+ } = state;
291
389
  const {
292
- rects: d
293
- } = e, {
294
- strategy: a = "referenceHidden",
295
- ...r
296
- } = L(t, e);
297
- switch (a) {
390
+ strategy = "referenceHidden",
391
+ ...detectOverflowOptions
392
+ } = evaluate(options, state);
393
+ switch (strategy) {
298
394
  case "referenceHidden": {
299
- const n = await Y(e, {
300
- ...r,
395
+ const overflow = await detectOverflow(state, {
396
+ ...detectOverflowOptions,
301
397
  elementContext: "reference"
302
- }), o = q(n, d.reference);
398
+ });
399
+ const offsets = getSideOffsets(overflow, rects.reference);
303
400
  return {
304
401
  data: {
305
- referenceHiddenOffsets: o,
306
- referenceHidden: G(o)
402
+ referenceHiddenOffsets: offsets,
403
+ referenceHidden: isAnySideFullyClipped(offsets)
307
404
  }
308
405
  };
309
406
  }
310
407
  case "escaped": {
311
- const n = await Y(e, {
312
- ...r,
313
- altBoundary: !0
314
- }), o = q(n, d.floating);
408
+ const overflow = await detectOverflow(state, {
409
+ ...detectOverflowOptions,
410
+ altBoundary: true
411
+ });
412
+ const offsets = getSideOffsets(overflow, rects.floating);
315
413
  return {
316
414
  data: {
317
- escapedOffsets: o,
318
- escaped: G(o)
415
+ escapedOffsets: offsets,
416
+ escaped: isAnySideFullyClipped(offsets)
319
417
  }
320
418
  };
321
419
  }
322
- default:
420
+ default: {
323
421
  return {};
422
+ }
324
423
  }
325
424
  }
326
425
  };
327
- }, U = /* @__PURE__ */ new Set(["left", "top"]);
328
- async function oe(t, e) {
426
+ };
427
+ const originSides = /* @__PURE__ */ new Set(["left", "top"]);
428
+ async function convertValueToCoords(state, options) {
329
429
  const {
330
- placement: d,
331
- platform: a,
332
- elements: r
333
- } = t, n = await (a.isRTL == null ? void 0 : a.isRTL(r.floating)), o = j(d), m = z(d), u = T(d) === "y", h = U.has(o) ? -1 : 1, c = n && u ? -1 : 1, s = L(e, t);
430
+ placement,
431
+ platform,
432
+ elements
433
+ } = state;
434
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
435
+ const side = getSide(placement);
436
+ const alignment = getAlignment(placement);
437
+ const isVertical = getSideAxis(placement) === "y";
438
+ const mainAxisMulti = originSides.has(side) ? -1 : 1;
439
+ const crossAxisMulti = rtl && isVertical ? -1 : 1;
440
+ const rawValue = evaluate(options, state);
334
441
  let {
335
- mainAxis: f,
336
- crossAxis: i,
337
- alignmentAxis: l
338
- } = typeof s == "number" ? {
339
- mainAxis: s,
442
+ mainAxis,
443
+ crossAxis,
444
+ alignmentAxis
445
+ } = typeof rawValue === "number" ? {
446
+ mainAxis: rawValue,
340
447
  crossAxis: 0,
341
448
  alignmentAxis: null
342
449
  } : {
343
- mainAxis: s.mainAxis || 0,
344
- crossAxis: s.crossAxis || 0,
345
- alignmentAxis: s.alignmentAxis
450
+ mainAxis: rawValue.mainAxis || 0,
451
+ crossAxis: rawValue.crossAxis || 0,
452
+ alignmentAxis: rawValue.alignmentAxis
346
453
  };
347
- return m && typeof l == "number" && (i = m === "end" ? l * -1 : l), u ? {
348
- x: i * c,
349
- y: f * h
454
+ if (alignment && typeof alignmentAxis === "number") {
455
+ crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
456
+ }
457
+ return isVertical ? {
458
+ x: crossAxis * crossAxisMulti,
459
+ y: mainAxis * mainAxisMulti
350
460
  } : {
351
- x: f * h,
352
- y: i * c
461
+ x: mainAxis * mainAxisMulti,
462
+ y: crossAxis * crossAxisMulti
353
463
  };
354
464
  }
355
- const me = function(t) {
356
- return t === void 0 && (t = 0), {
465
+ const offset = function(options) {
466
+ if (options === void 0) {
467
+ options = 0;
468
+ }
469
+ return {
357
470
  name: "offset",
358
- options: t,
359
- async fn(e) {
360
- var d, a;
471
+ options,
472
+ async fn(state) {
473
+ var _middlewareData$offse, _middlewareData$arrow;
361
474
  const {
362
- x: r,
363
- y: n,
364
- placement: o,
365
- middlewareData: m
366
- } = e, u = await oe(e, t);
367
- return o === ((d = m.offset) == null ? void 0 : d.placement) && (a = m.arrow) != null && a.alignmentOffset ? {} : {
368
- x: r + u.x,
369
- y: n + u.y,
475
+ x,
476
+ y,
477
+ placement,
478
+ middlewareData
479
+ } = state;
480
+ const diffCoords = await convertValueToCoords(state, options);
481
+ if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
482
+ return {};
483
+ }
484
+ return {
485
+ x: x + diffCoords.x,
486
+ y: y + diffCoords.y,
370
487
  data: {
371
- ...u,
372
- placement: o
488
+ ...diffCoords,
489
+ placement
373
490
  }
374
491
  };
375
492
  }
376
493
  };
377
- }, de = function(t) {
378
- return t === void 0 && (t = {}), {
494
+ };
495
+ const shift = function(options) {
496
+ if (options === void 0) {
497
+ options = {};
498
+ }
499
+ return {
379
500
  name: "shift",
380
- options: t,
381
- async fn(e) {
501
+ options,
502
+ async fn(state) {
382
503
  const {
383
- x: d,
384
- y: a,
385
- placement: r
386
- } = e, {
387
- mainAxis: n = !0,
388
- crossAxis: o = !1,
389
- limiter: m = {
390
- fn: (x) => {
504
+ x,
505
+ y,
506
+ placement
507
+ } = state;
508
+ const {
509
+ mainAxis: checkMainAxis = true,
510
+ crossAxis: checkCrossAxis = false,
511
+ limiter = {
512
+ fn: (_ref) => {
391
513
  let {
392
- x: y,
393
- y: A
394
- } = x;
514
+ x: x2,
515
+ y: y2
516
+ } = _ref;
395
517
  return {
396
- x: y,
397
- y: A
518
+ x: x2,
519
+ y: y2
398
520
  };
399
521
  }
400
522
  },
401
- ...u
402
- } = L(t, e), h = {
403
- x: d,
404
- y: a
405
- }, c = await Y(e, u), s = T(j(r)), f = K(s);
406
- let i = h[f], l = h[s];
407
- if (n) {
408
- const x = f === "y" ? "top" : "left", y = f === "y" ? "bottom" : "right", A = i + c[x], p = i - c[y];
409
- i = X(A, i, p);
523
+ ...detectOverflowOptions
524
+ } = evaluate(options, state);
525
+ const coords = {
526
+ x,
527
+ y
528
+ };
529
+ const overflow = await detectOverflow(state, detectOverflowOptions);
530
+ const crossAxis = getSideAxis(getSide(placement));
531
+ const mainAxis = getOppositeAxis(crossAxis);
532
+ let mainAxisCoord = coords[mainAxis];
533
+ let crossAxisCoord = coords[crossAxis];
534
+ if (checkMainAxis) {
535
+ const minSide = mainAxis === "y" ? "top" : "left";
536
+ const maxSide = mainAxis === "y" ? "bottom" : "right";
537
+ const min2 = mainAxisCoord + overflow[minSide];
538
+ const max2 = mainAxisCoord - overflow[maxSide];
539
+ mainAxisCoord = clamp(min2, mainAxisCoord, max2);
410
540
  }
411
- if (o) {
412
- const x = s === "y" ? "top" : "left", y = s === "y" ? "bottom" : "right", A = l + c[x], p = l - c[y];
413
- l = X(A, l, p);
541
+ if (checkCrossAxis) {
542
+ const minSide = crossAxis === "y" ? "top" : "left";
543
+ const maxSide = crossAxis === "y" ? "bottom" : "right";
544
+ const min2 = crossAxisCoord + overflow[minSide];
545
+ const max2 = crossAxisCoord - overflow[maxSide];
546
+ crossAxisCoord = clamp(min2, crossAxisCoord, max2);
414
547
  }
415
- const g = m.fn({
416
- ...e,
417
- [f]: i,
418
- [s]: l
548
+ const limitedCoords = limiter.fn({
549
+ ...state,
550
+ [mainAxis]: mainAxisCoord,
551
+ [crossAxis]: crossAxisCoord
419
552
  });
420
553
  return {
421
- ...g,
554
+ ...limitedCoords,
422
555
  data: {
423
- x: g.x - d,
424
- y: g.y - a,
556
+ x: limitedCoords.x - x,
557
+ y: limitedCoords.y - y,
425
558
  enabled: {
426
- [f]: n,
427
- [s]: o
559
+ [mainAxis]: checkMainAxis,
560
+ [crossAxis]: checkCrossAxis
428
561
  }
429
562
  }
430
563
  };
431
564
  }
432
565
  };
433
- }, xe = function(t) {
434
- return t === void 0 && (t = {}), {
435
- options: t,
436
- fn(e) {
566
+ };
567
+ const limitShift = function(options) {
568
+ if (options === void 0) {
569
+ options = {};
570
+ }
571
+ return {
572
+ options,
573
+ fn(state) {
574
+ const {
575
+ x,
576
+ y,
577
+ placement,
578
+ rects,
579
+ middlewareData
580
+ } = state;
437
581
  const {
438
- x: d,
439
- y: a,
440
- placement: r,
441
- rects: n,
442
- middlewareData: o
443
- } = e, {
444
- offset: m = 0,
445
- mainAxis: u = !0,
446
- crossAxis: h = !0
447
- } = L(t, e), c = {
448
- x: d,
449
- y: a
450
- }, s = T(r), f = K(s);
451
- let i = c[f], l = c[s];
452
- const g = L(m, e), x = typeof g == "number" ? {
453
- mainAxis: g,
582
+ offset: offset2 = 0,
583
+ mainAxis: checkMainAxis = true,
584
+ crossAxis: checkCrossAxis = true
585
+ } = evaluate(options, state);
586
+ const coords = {
587
+ x,
588
+ y
589
+ };
590
+ const crossAxis = getSideAxis(placement);
591
+ const mainAxis = getOppositeAxis(crossAxis);
592
+ let mainAxisCoord = coords[mainAxis];
593
+ let crossAxisCoord = coords[crossAxis];
594
+ const rawOffset = evaluate(offset2, state);
595
+ const computedOffset = typeof rawOffset === "number" ? {
596
+ mainAxis: rawOffset,
454
597
  crossAxis: 0
455
598
  } : {
456
599
  mainAxis: 0,
457
600
  crossAxis: 0,
458
- ...g
601
+ ...rawOffset
459
602
  };
460
- if (u) {
461
- const p = f === "y" ? "height" : "width", v = n.reference[f] - n.floating[p] + x.mainAxis, w = n.reference[f] + n.reference[p] - x.mainAxis;
462
- i < v ? i = v : i > w && (i = w);
603
+ if (checkMainAxis) {
604
+ const len = mainAxis === "y" ? "height" : "width";
605
+ const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
606
+ const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
607
+ if (mainAxisCoord < limitMin) {
608
+ mainAxisCoord = limitMin;
609
+ } else if (mainAxisCoord > limitMax) {
610
+ mainAxisCoord = limitMax;
611
+ }
463
612
  }
464
- if (h) {
465
- var y, A;
466
- const p = f === "y" ? "width" : "height", v = U.has(j(r)), w = n.reference[s] - n.floating[p] + (v && ((y = o.offset) == null ? void 0 : y[s]) || 0) + (v ? 0 : x.crossAxis), P = n.reference[s] + n.reference[p] + (v ? 0 : ((A = o.offset) == null ? void 0 : A[s]) || 0) - (v ? x.crossAxis : 0);
467
- l < w ? l = w : l > P && (l = P);
613
+ if (checkCrossAxis) {
614
+ var _middlewareData$offse, _middlewareData$offse2;
615
+ const len = mainAxis === "y" ? "width" : "height";
616
+ const isOriginSide = originSides.has(getSide(placement));
617
+ const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
618
+ const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
619
+ if (crossAxisCoord < limitMin) {
620
+ crossAxisCoord = limitMin;
621
+ } else if (crossAxisCoord > limitMax) {
622
+ crossAxisCoord = limitMax;
623
+ }
468
624
  }
469
625
  return {
470
- [f]: i,
471
- [s]: l
626
+ [mainAxis]: mainAxisCoord,
627
+ [crossAxis]: crossAxisCoord
472
628
  };
473
629
  }
474
630
  };
475
- }, ge = function(t) {
476
- return t === void 0 && (t = {}), {
631
+ };
632
+ const size = function(options) {
633
+ if (options === void 0) {
634
+ options = {};
635
+ }
636
+ return {
477
637
  name: "size",
478
- options: t,
479
- async fn(e) {
480
- var d, a;
638
+ options,
639
+ async fn(state) {
640
+ var _state$middlewareData, _state$middlewareData2;
481
641
  const {
482
- placement: r,
483
- rects: n,
484
- platform: o,
485
- elements: m
486
- } = e, {
487
- apply: u = () => {
642
+ placement,
643
+ rects,
644
+ platform,
645
+ elements
646
+ } = state;
647
+ const {
648
+ apply = () => {
488
649
  },
489
- ...h
490
- } = L(t, e), c = await Y(e, h), s = j(r), f = z(r), i = T(r) === "y", {
491
- width: l,
492
- height: g
493
- } = n.floating;
494
- let x, y;
495
- s === "top" || s === "bottom" ? (x = s, y = f === (await (o.isRTL == null ? void 0 : o.isRTL(m.floating)) ? "start" : "end") ? "left" : "right") : (y = s, x = f === "end" ? "top" : "bottom");
496
- const A = g - c.top - c.bottom, p = l - c.left - c.right, v = $(g - c[x], A), w = $(l - c[y], p), P = !e.middlewareData.shift;
497
- let C = v, M = w;
498
- if ((d = e.middlewareData.shift) != null && d.enabled.x && (M = p), (a = e.middlewareData.shift) != null && a.enabled.y && (C = A), P && !f) {
499
- const O = W(c.left, 0), H = W(c.right, 0), D = W(c.top, 0), F = W(c.bottom, 0);
500
- i ? M = l - 2 * (O !== 0 || H !== 0 ? O + H : W(c.left, c.right)) : C = g - 2 * (D !== 0 || F !== 0 ? D + F : W(c.top, c.bottom));
650
+ ...detectOverflowOptions
651
+ } = evaluate(options, state);
652
+ const overflow = await detectOverflow(state, detectOverflowOptions);
653
+ const side = getSide(placement);
654
+ const alignment = getAlignment(placement);
655
+ const isYAxis = getSideAxis(placement) === "y";
656
+ const {
657
+ width,
658
+ height
659
+ } = rects.floating;
660
+ let heightSide;
661
+ let widthSide;
662
+ if (side === "top" || side === "bottom") {
663
+ heightSide = side;
664
+ widthSide = alignment === (await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right";
665
+ } else {
666
+ widthSide = side;
667
+ heightSide = alignment === "end" ? "top" : "bottom";
501
668
  }
502
- await u({
503
- ...e,
504
- availableWidth: M,
505
- availableHeight: C
506
- });
507
- const k = await o.getDimensions(m.floating);
508
- return l !== k.width || g !== k.height ? {
509
- reset: {
510
- rects: !0
669
+ const maximumClippingHeight = height - overflow.top - overflow.bottom;
670
+ const maximumClippingWidth = width - overflow.left - overflow.right;
671
+ const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
672
+ const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
673
+ const noShift = !state.middlewareData.shift;
674
+ let availableHeight = overflowAvailableHeight;
675
+ let availableWidth = overflowAvailableWidth;
676
+ if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {
677
+ availableWidth = maximumClippingWidth;
678
+ }
679
+ if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {
680
+ availableHeight = maximumClippingHeight;
681
+ }
682
+ if (noShift && !alignment) {
683
+ const xMin = max(overflow.left, 0);
684
+ const xMax = max(overflow.right, 0);
685
+ const yMin = max(overflow.top, 0);
686
+ const yMax = max(overflow.bottom, 0);
687
+ if (isYAxis) {
688
+ availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
689
+ } else {
690
+ availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
511
691
  }
512
- } : {};
692
+ }
693
+ await apply({
694
+ ...state,
695
+ availableWidth,
696
+ availableHeight
697
+ });
698
+ const nextDimensions = await platform.getDimensions(elements.floating);
699
+ if (width !== nextDimensions.width || height !== nextDimensions.height) {
700
+ return {
701
+ reset: {
702
+ rects: true
703
+ }
704
+ };
705
+ }
706
+ return {};
513
707
  }
514
708
  };
515
709
  };
516
710
  export {
517
- le as arrow,
518
- ce as computePosition,
519
- Y as detectOverflow,
520
- re as flip,
521
- fe as hide,
522
- xe as limitShift,
523
- me as offset,
524
- _ as rectToClientRect,
525
- de as shift,
526
- ge as size
711
+ arrow,
712
+ computePosition,
713
+ detectOverflow,
714
+ flip,
715
+ hide,
716
+ limitShift,
717
+ offset,
718
+ rectToClientRect,
719
+ shift,
720
+ size
527
721
  };
528
722
  //# sourceMappingURL=floating-ui.core.js.map