@getflip/swirl-components 0.1.0 → 0.2.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 (407) hide show
  1. package/dist/cjs/flip-action-list-item.cjs.entry.js +1 -1
  2. package/dist/cjs/flip-action-list-section.cjs.entry.js +1 -1
  3. package/dist/cjs/flip-action-list.cjs.entry.js +1 -1
  4. package/dist/cjs/flip-avatar-group.cjs.entry.js +2 -2
  5. package/dist/cjs/flip-avatar.cjs.entry.js +1 -1
  6. package/dist/cjs/flip-badge.cjs.entry.js +2 -2
  7. package/dist/cjs/flip-banner.cjs.entry.js +1 -1
  8. package/dist/cjs/flip-button-group.cjs.entry.js +24 -0
  9. package/dist/{esm/flip-button_2.entry.js → cjs/flip-button.cjs.entry.js} +10 -23
  10. package/dist/cjs/flip-checkbox.cjs.entry.js +3 -2
  11. package/dist/cjs/flip-chip.cjs.entry.js +1 -1
  12. package/dist/cjs/flip-description-list-item.cjs.entry.js +1 -1
  13. package/dist/cjs/flip-description-list.cjs.entry.js +1 -1
  14. package/dist/cjs/flip-dialog.cjs.entry.js +1 -1
  15. package/dist/cjs/flip-file-uploader.cjs.entry.js +49 -0
  16. package/dist/cjs/flip-icon-add-photo.cjs.entry.js +1 -1
  17. package/dist/cjs/flip-icon-add.cjs.entry.js +1 -1
  18. package/dist/cjs/flip-icon-admin-panel-settings.cjs.entry.js +1 -1
  19. package/dist/cjs/flip-icon-arrow-back.cjs.entry.js +1 -1
  20. package/dist/cjs/flip-icon-arrow-forward.cjs.entry.js +1 -1
  21. package/dist/cjs/flip-icon-arrow-right-small.cjs.entry.js +1 -1
  22. package/dist/cjs/flip-icon-attachment.cjs.entry.js +1 -1
  23. package/dist/cjs/flip-icon-cancel_2.cjs.entry.js +1 -1
  24. package/dist/cjs/flip-icon-chat-bubble.cjs.entry.js +1 -1
  25. package/dist/cjs/flip-icon-check-circle.cjs.entry.js +1 -1
  26. package/dist/cjs/flip-icon-check-small.cjs.entry.js +1 -1
  27. package/dist/cjs/flip-icon-check-strong.cjs.entry.js +1 -1
  28. package/dist/cjs/flip-icon-check.cjs.entry.js +1 -1
  29. package/dist/cjs/flip-icon-chevron-left.cjs.entry.js +1 -1
  30. package/dist/cjs/flip-icon-chevron-right.cjs.entry.js +1 -1
  31. package/dist/cjs/flip-icon-close-small.cjs.entry.js +1 -1
  32. package/dist/cjs/flip-icon-close.cjs.entry.js +1 -1
  33. package/dist/cjs/flip-icon-cloud-upload.cjs.entry.js +20 -0
  34. package/dist/cjs/flip-icon-comment.cjs.entry.js +1 -1
  35. package/dist/cjs/flip-icon-copy.cjs.entry.js +1 -1
  36. package/dist/cjs/flip-icon-date-range.cjs.entry.js +1 -1
  37. package/dist/cjs/flip-icon-delete.cjs.entry.js +1 -1
  38. package/dist/cjs/flip-icon-description.cjs.entry.js +1 -1
  39. package/dist/cjs/flip-icon-download.cjs.entry.js +1 -1
  40. package/dist/cjs/flip-icon-edit.cjs.entry.js +1 -1
  41. package/dist/cjs/flip-icon-emoji-mood.cjs.entry.js +1 -1
  42. package/dist/cjs/flip-icon-emoji-satisfied.cjs.entry.js +1 -1
  43. package/dist/cjs/flip-icon-error.cjs.entry.js +1 -1
  44. package/dist/cjs/flip-icon-expand-less.cjs.entry.js +1 -1
  45. package/dist/cjs/flip-icon-expand-more.cjs.entry.js +1 -1
  46. package/dist/cjs/flip-icon-file.cjs.entry.js +1 -1
  47. package/dist/cjs/flip-icon-folder-shared.cjs.entry.js +1 -1
  48. package/dist/cjs/flip-icon-group-assign.cjs.entry.js +1 -1
  49. package/dist/cjs/flip-icon-groups-custom.cjs.entry.js +1 -1
  50. package/dist/cjs/flip-icon-groups.cjs.entry.js +1 -1
  51. package/dist/cjs/flip-icon-image.cjs.entry.js +1 -1
  52. package/dist/cjs/flip-icon-info.cjs.entry.js +1 -1
  53. package/dist/cjs/flip-icon-inventory.cjs.entry.js +1 -1
  54. package/dist/cjs/flip-icon-like.cjs.entry.js +1 -1
  55. package/dist/cjs/flip-icon-link.cjs.entry.js +1 -1
  56. package/dist/cjs/flip-icon-lock.cjs.entry.js +1 -1
  57. package/dist/cjs/flip-icon-logout.cjs.entry.js +1 -1
  58. package/dist/cjs/flip-icon-mail.cjs.entry.js +1 -1
  59. package/dist/cjs/flip-icon-manage-accounts.cjs.entry.js +1 -1
  60. package/dist/cjs/flip-icon-mention.cjs.entry.js +1 -1
  61. package/dist/cjs/flip-icon-message.cjs.entry.js +1 -1
  62. package/dist/cjs/flip-icon-more-horizontal.cjs.entry.js +1 -1
  63. package/dist/cjs/flip-icon-more-vertikal.cjs.entry.js +1 -1
  64. package/dist/cjs/flip-icon-notifications-active.cjs.entry.js +1 -1
  65. package/dist/cjs/flip-icon-notifications-off.cjs.entry.js +1 -1
  66. package/dist/cjs/flip-icon-notifications.cjs.entry.js +1 -1
  67. package/dist/cjs/flip-icon-people-alt.cjs.entry.js +1 -1
  68. package/dist/cjs/flip-icon-person-off.cjs.entry.js +1 -1
  69. package/dist/cjs/flip-icon-person.cjs.entry.js +1 -1
  70. package/dist/cjs/flip-icon-phone.cjs.entry.js +1 -1
  71. package/dist/cjs/flip-icon-poll.cjs.entry.js +1 -1
  72. package/dist/cjs/flip-icon-recieved.cjs.entry.js +1 -1
  73. package/dist/cjs/flip-icon-search-strong.cjs.entry.js +1 -1
  74. package/dist/cjs/flip-icon-send.cjs.entry.js +1 -1
  75. package/dist/cjs/flip-icon-settings.cjs.entry.js +1 -1
  76. package/dist/cjs/flip-icon-time-filled.cjs.entry.js +1 -1
  77. package/dist/cjs/flip-icon-time-outlined.cjs.entry.js +1 -1
  78. package/dist/cjs/flip-icon-today.cjs.entry.js +1 -1
  79. package/dist/cjs/flip-icon-user-assign.cjs.entry.js +1 -1
  80. package/dist/cjs/flip-icon-video-camera.cjs.entry.js +1 -1
  81. package/dist/cjs/flip-icon-visibility-off.cjs.entry.js +1 -1
  82. package/dist/cjs/flip-icon-visibility.cjs.entry.js +1 -1
  83. package/dist/cjs/flip-icon-warning.cjs.entry.js +1 -1
  84. package/dist/cjs/{flip-spinner.cjs.entry.js → flip-inline-error_2.cjs.entry.js} +17 -1
  85. package/dist/cjs/flip-link.cjs.entry.js +1 -1
  86. package/dist/cjs/flip-popover.cjs.entry.js +6 -1155
  87. package/dist/cjs/flip-radio-group.cjs.entry.js +1 -1
  88. package/dist/cjs/flip-radio.cjs.entry.js +1 -1
  89. package/dist/cjs/flip-resource-list-file-item.cjs.entry.js +30 -0
  90. package/dist/cjs/flip-resource-list-item.cjs.entry.js +73 -0
  91. package/dist/cjs/flip-resource-list.cjs.entry.js +67 -0
  92. package/dist/cjs/flip-search.cjs.entry.js +1 -1
  93. package/dist/cjs/flip-stack.cjs.entry.js +1 -1
  94. package/dist/cjs/flip-switch.cjs.entry.js +1 -1
  95. package/dist/cjs/flip-tab.cjs.entry.js +21 -0
  96. package/dist/cjs/flip-tabs.cjs.entry.js +124 -0
  97. package/dist/cjs/flip-tag.cjs.entry.js +1 -1
  98. package/dist/cjs/flip-theme-provider.cjs.entry.js +1 -1
  99. package/dist/cjs/flip-thumbnail.cjs.entry.js +1 -1
  100. package/dist/cjs/flip-toast-provider.cjs.entry.js +1 -1
  101. package/dist/cjs/flip-toast.cjs.entry.js +1 -1
  102. package/dist/cjs/flip-tooltip.cjs.entry.js +22 -14
  103. package/dist/cjs/flip-visually-hidden.cjs.entry.js +1 -1
  104. package/dist/cjs/floating-ui.dom.esm-75453e4e.js +1228 -0
  105. package/dist/cjs/{index-37fbfe64.js → index-bd89db61.js} +3 -0
  106. package/dist/cjs/loader.cjs.js +2 -2
  107. package/dist/cjs/swirl-components.cjs.js +2 -2
  108. package/dist/collection/collection-manifest.json +7 -0
  109. package/dist/collection/components/flip-avatar-group/flip-avatar-group.css +2 -2
  110. package/dist/collection/components/flip-badge/flip-badge.css +1 -1
  111. package/dist/collection/components/flip-button/flip-button.js +18 -1
  112. package/dist/collection/components/flip-checkbox/flip-checkbox.js +3 -2
  113. package/dist/collection/components/flip-file-uploader/flip-file-uploader.css +86 -0
  114. package/dist/collection/components/flip-file-uploader/flip-file-uploader.js +285 -0
  115. package/dist/collection/components/flip-file-uploader/flip-file-uploader.stories.js +23 -0
  116. package/dist/collection/components/flip-icon/icons/flip-icon-cloud-upload.js +49 -0
  117. package/dist/collection/components/flip-inline-error/flip-inline-error.css +1 -1
  118. package/dist/collection/components/flip-popover/flip-popover.js +1 -1
  119. package/dist/collection/components/flip-resource-list/flip-resource-list.css +8 -0
  120. package/dist/collection/components/flip-resource-list/flip-resource-list.js +85 -0
  121. package/dist/collection/components/flip-resource-list/flip-resource-list.stories.js +36 -0
  122. package/dist/collection/components/flip-resource-list-file-item/flip-resource-list-file-item.css +89 -0
  123. package/dist/collection/components/flip-resource-list-file-item/flip-resource-list-file-item.js +180 -0
  124. package/dist/collection/components/flip-resource-list-file-item/flip-resource-list-file-item.stories.js +35 -0
  125. package/dist/collection/components/flip-resource-list-item/flip-resource-list-item.css +195 -0
  126. package/dist/collection/components/flip-resource-list-item/flip-resource-list-item.js +303 -0
  127. package/dist/collection/components/flip-resource-list-item/flip-resource-list-item.stories.js +64 -0
  128. package/dist/collection/components/flip-tab/flip-tab.css +18 -0
  129. package/dist/collection/components/flip-tab/flip-tab.js +71 -0
  130. package/dist/collection/components/flip-tab/flip-tab.stories.js +22 -0
  131. package/dist/collection/components/flip-tabs/flip-tabs.css +94 -0
  132. package/dist/collection/components/flip-tabs/flip-tabs.js +220 -0
  133. package/dist/collection/components/flip-tabs/flip-tabs.stories.js +25 -0
  134. package/dist/collection/components/flip-tooltip/flip-tooltip.css +20 -0
  135. package/dist/collection/components/flip-tooltip/flip-tooltip.js +20 -10
  136. package/dist/components/flip-avatar-group.js +1 -1
  137. package/dist/components/flip-badge.js +1 -1
  138. package/dist/components/flip-button2.js +2 -1
  139. package/dist/components/flip-checkbox.js +2 -1
  140. package/dist/components/flip-file-uploader.d.ts +11 -0
  141. package/dist/components/flip-file-uploader.js +88 -0
  142. package/dist/components/flip-icon-cloud-upload.d.ts +11 -0
  143. package/dist/components/flip-icon-cloud-upload.js +6 -0
  144. package/dist/components/flip-icon-cloud-upload2.js +34 -0
  145. package/dist/components/flip-inline-error.js +1 -42
  146. package/dist/components/flip-inline-error2.js +44 -0
  147. package/dist/components/flip-popover.js +2 -1151
  148. package/dist/components/flip-resource-list-file-item.d.ts +11 -0
  149. package/dist/components/flip-resource-list-file-item.js +83 -0
  150. package/dist/components/flip-resource-list-item.d.ts +11 -0
  151. package/dist/components/flip-resource-list-item.js +113 -0
  152. package/dist/components/flip-resource-list.d.ts +11 -0
  153. package/dist/components/flip-resource-list.js +90 -0
  154. package/dist/components/flip-spinner.js +1 -41
  155. package/dist/{esm/flip-spinner.entry.js → components/flip-spinner2.js} +33 -8
  156. package/dist/components/flip-tab.d.ts +11 -0
  157. package/dist/components/flip-tab.js +40 -0
  158. package/dist/components/flip-tabs.d.ts +11 -0
  159. package/dist/components/flip-tabs.js +144 -0
  160. package/dist/components/flip-tooltip.js +21 -13
  161. package/dist/components/floating-ui.dom.esm.js +1222 -0
  162. package/dist/components/index.d.ts +7 -0
  163. package/dist/components/index.js +7 -0
  164. package/dist/esm/flip-action-list-item.entry.js +1 -1
  165. package/dist/esm/flip-action-list-section.entry.js +1 -1
  166. package/dist/esm/flip-action-list.entry.js +1 -1
  167. package/dist/esm/flip-avatar-group.entry.js +2 -2
  168. package/dist/esm/flip-avatar.entry.js +1 -1
  169. package/dist/esm/flip-badge.entry.js +2 -2
  170. package/dist/esm/flip-banner.entry.js +1 -1
  171. package/dist/esm/flip-button-group.entry.js +20 -0
  172. package/dist/{cjs/flip-button_2.cjs.entry.js → esm/flip-button.entry.js} +6 -28
  173. package/dist/esm/flip-checkbox.entry.js +3 -2
  174. package/dist/esm/flip-chip.entry.js +1 -1
  175. package/dist/esm/flip-description-list-item.entry.js +1 -1
  176. package/dist/esm/flip-description-list.entry.js +1 -1
  177. package/dist/esm/flip-dialog.entry.js +1 -1
  178. package/dist/esm/flip-file-uploader.entry.js +45 -0
  179. package/dist/esm/flip-icon-add-photo.entry.js +1 -1
  180. package/dist/esm/flip-icon-add.entry.js +1 -1
  181. package/dist/esm/flip-icon-admin-panel-settings.entry.js +1 -1
  182. package/dist/esm/flip-icon-arrow-back.entry.js +1 -1
  183. package/dist/esm/flip-icon-arrow-forward.entry.js +1 -1
  184. package/dist/esm/flip-icon-arrow-right-small.entry.js +1 -1
  185. package/dist/esm/flip-icon-attachment.entry.js +1 -1
  186. package/dist/esm/flip-icon-cancel_2.entry.js +1 -1
  187. package/dist/esm/flip-icon-chat-bubble.entry.js +1 -1
  188. package/dist/esm/flip-icon-check-circle.entry.js +1 -1
  189. package/dist/esm/flip-icon-check-small.entry.js +1 -1
  190. package/dist/esm/flip-icon-check-strong.entry.js +1 -1
  191. package/dist/esm/flip-icon-check.entry.js +1 -1
  192. package/dist/esm/flip-icon-chevron-left.entry.js +1 -1
  193. package/dist/esm/flip-icon-chevron-right.entry.js +1 -1
  194. package/dist/esm/flip-icon-close-small.entry.js +1 -1
  195. package/dist/esm/flip-icon-close.entry.js +1 -1
  196. package/dist/esm/flip-icon-cloud-upload.entry.js +16 -0
  197. package/dist/esm/flip-icon-comment.entry.js +1 -1
  198. package/dist/esm/flip-icon-copy.entry.js +1 -1
  199. package/dist/esm/flip-icon-date-range.entry.js +1 -1
  200. package/dist/esm/flip-icon-delete.entry.js +1 -1
  201. package/dist/esm/flip-icon-description.entry.js +1 -1
  202. package/dist/esm/flip-icon-download.entry.js +1 -1
  203. package/dist/esm/flip-icon-edit.entry.js +1 -1
  204. package/dist/esm/flip-icon-emoji-mood.entry.js +1 -1
  205. package/dist/esm/flip-icon-emoji-satisfied.entry.js +1 -1
  206. package/dist/esm/flip-icon-error.entry.js +1 -1
  207. package/dist/esm/flip-icon-expand-less.entry.js +1 -1
  208. package/dist/esm/flip-icon-expand-more.entry.js +1 -1
  209. package/dist/esm/flip-icon-file.entry.js +1 -1
  210. package/dist/esm/flip-icon-folder-shared.entry.js +1 -1
  211. package/dist/esm/flip-icon-group-assign.entry.js +1 -1
  212. package/dist/esm/flip-icon-groups-custom.entry.js +1 -1
  213. package/dist/esm/flip-icon-groups.entry.js +1 -1
  214. package/dist/esm/flip-icon-image.entry.js +1 -1
  215. package/dist/esm/flip-icon-info.entry.js +1 -1
  216. package/dist/esm/flip-icon-inventory.entry.js +1 -1
  217. package/dist/esm/flip-icon-like.entry.js +1 -1
  218. package/dist/esm/flip-icon-link.entry.js +1 -1
  219. package/dist/esm/flip-icon-lock.entry.js +1 -1
  220. package/dist/esm/flip-icon-logout.entry.js +1 -1
  221. package/dist/esm/flip-icon-mail.entry.js +1 -1
  222. package/dist/esm/flip-icon-manage-accounts.entry.js +1 -1
  223. package/dist/esm/flip-icon-mention.entry.js +1 -1
  224. package/dist/esm/flip-icon-message.entry.js +1 -1
  225. package/dist/esm/flip-icon-more-horizontal.entry.js +1 -1
  226. package/dist/esm/flip-icon-more-vertikal.entry.js +1 -1
  227. package/dist/esm/flip-icon-notifications-active.entry.js +1 -1
  228. package/dist/esm/flip-icon-notifications-off.entry.js +1 -1
  229. package/dist/esm/flip-icon-notifications.entry.js +1 -1
  230. package/dist/esm/flip-icon-people-alt.entry.js +1 -1
  231. package/dist/esm/flip-icon-person-off.entry.js +1 -1
  232. package/dist/esm/flip-icon-person.entry.js +1 -1
  233. package/dist/esm/flip-icon-phone.entry.js +1 -1
  234. package/dist/esm/flip-icon-poll.entry.js +1 -1
  235. package/dist/esm/flip-icon-recieved.entry.js +1 -1
  236. package/dist/esm/flip-icon-search-strong.entry.js +1 -1
  237. package/dist/esm/flip-icon-send.entry.js +1 -1
  238. package/dist/esm/flip-icon-settings.entry.js +1 -1
  239. package/dist/esm/flip-icon-time-filled.entry.js +1 -1
  240. package/dist/esm/flip-icon-time-outlined.entry.js +1 -1
  241. package/dist/esm/flip-icon-today.entry.js +1 -1
  242. package/dist/esm/flip-icon-user-assign.entry.js +1 -1
  243. package/dist/esm/flip-icon-video-camera.entry.js +1 -1
  244. package/dist/esm/flip-icon-visibility-off.entry.js +1 -1
  245. package/dist/esm/flip-icon-visibility.entry.js +1 -1
  246. package/dist/esm/flip-icon-warning.entry.js +1 -1
  247. package/dist/esm/flip-inline-error_2.entry.js +33 -0
  248. package/dist/esm/flip-link.entry.js +1 -1
  249. package/dist/esm/flip-popover.entry.js +3 -1152
  250. package/dist/esm/flip-radio-group.entry.js +1 -1
  251. package/dist/esm/flip-radio.entry.js +1 -1
  252. package/dist/esm/flip-resource-list-file-item.entry.js +26 -0
  253. package/dist/esm/flip-resource-list-item.entry.js +69 -0
  254. package/dist/esm/flip-resource-list.entry.js +63 -0
  255. package/dist/esm/flip-search.entry.js +1 -1
  256. package/dist/esm/flip-stack.entry.js +1 -1
  257. package/dist/esm/flip-switch.entry.js +1 -1
  258. package/dist/esm/flip-tab.entry.js +17 -0
  259. package/dist/esm/flip-tabs.entry.js +120 -0
  260. package/dist/esm/flip-tag.entry.js +1 -1
  261. package/dist/esm/flip-theme-provider.entry.js +1 -1
  262. package/dist/esm/flip-thumbnail.entry.js +1 -1
  263. package/dist/esm/flip-toast-provider.entry.js +1 -1
  264. package/dist/esm/flip-toast.entry.js +1 -1
  265. package/dist/esm/flip-tooltip.entry.js +22 -14
  266. package/dist/esm/flip-visually-hidden.entry.js +1 -1
  267. package/dist/esm/floating-ui.dom.esm-1a4e8b8a.js +1222 -0
  268. package/dist/esm/{index-36517fab.js → index-64709274.js} +3 -0
  269. package/dist/esm/loader.js +2 -2
  270. package/dist/esm/swirl-components.js +2 -2
  271. package/dist/swirl-components/{p-adbcf0ae.entry.js → p-0b197bc2.entry.js} +1 -1
  272. package/dist/swirl-components/{p-4f3d8490.entry.js → p-0bd72823.entry.js} +1 -1
  273. package/dist/swirl-components/{p-e1554c48.entry.js → p-0f72be83.entry.js} +1 -1
  274. package/dist/swirl-components/p-0fd19b1e.entry.js +1 -0
  275. package/dist/swirl-components/{p-432dd5f1.entry.js → p-118f9dbc.entry.js} +1 -1
  276. package/dist/swirl-components/p-14404622.entry.js +1 -0
  277. package/dist/swirl-components/p-14a71662.entry.js +1 -0
  278. package/dist/swirl-components/{p-5a13d6fe.entry.js → p-150885c6.entry.js} +1 -1
  279. package/dist/swirl-components/p-1b14d1f8.entry.js +1 -0
  280. package/dist/swirl-components/{p-b64b6dc5.entry.js → p-294bc0f5.entry.js} +1 -1
  281. package/dist/swirl-components/{p-b4540264.entry.js → p-29f4348a.entry.js} +1 -1
  282. package/dist/swirl-components/{p-7a6b480c.entry.js → p-2b183dbd.entry.js} +1 -1
  283. package/dist/swirl-components/p-2e39e57a.entry.js +1 -0
  284. package/dist/swirl-components/{p-63e5b5d9.entry.js → p-2fada438.entry.js} +1 -1
  285. package/dist/swirl-components/{p-ff0868ae.entry.js → p-2fc324d2.entry.js} +1 -1
  286. package/dist/swirl-components/{p-f6e77552.entry.js → p-3115dcce.entry.js} +1 -1
  287. package/dist/swirl-components/{p-a1946e3b.entry.js → p-314da0b6.entry.js} +1 -1
  288. package/dist/swirl-components/p-3203d26c.entry.js +1 -0
  289. package/dist/swirl-components/{p-ad434623.entry.js → p-33eeffa4.entry.js} +1 -1
  290. package/dist/swirl-components/{p-1419666f.entry.js → p-340a8594.entry.js} +1 -1
  291. package/dist/swirl-components/p-3a78c66a.entry.js +1 -0
  292. package/dist/swirl-components/{p-6b840e3d.entry.js → p-3fd6dfcc.entry.js} +1 -1
  293. package/dist/swirl-components/{p-e384bd2c.entry.js → p-41b352e3.entry.js} +1 -1
  294. package/dist/swirl-components/{p-3234f836.entry.js → p-428b8a65.entry.js} +1 -1
  295. package/dist/swirl-components/{p-cfef8bdb.entry.js → p-45a0619d.entry.js} +1 -1
  296. package/dist/swirl-components/{p-d1c899ad.entry.js → p-46db6bb6.entry.js} +1 -1
  297. package/dist/swirl-components/{p-1429e47a.entry.js → p-482528d9.entry.js} +1 -1
  298. package/dist/swirl-components/{p-213191cb.entry.js → p-4c846d53.entry.js} +1 -1
  299. package/dist/swirl-components/{p-1a9f0bc1.entry.js → p-4cd180da.entry.js} +1 -1
  300. package/dist/swirl-components/{p-17073db0.entry.js → p-4d5bc933.entry.js} +1 -1
  301. package/dist/swirl-components/{p-e0513b73.entry.js → p-4eda9d6d.entry.js} +1 -1
  302. package/dist/swirl-components/{p-102db76d.entry.js → p-4f209111.entry.js} +1 -1
  303. package/dist/swirl-components/{p-e65d2d81.entry.js → p-562db126.entry.js} +1 -1
  304. package/dist/swirl-components/p-5757b517.entry.js +1 -0
  305. package/dist/swirl-components/{p-94d933b3.entry.js → p-589d6d22.entry.js} +1 -1
  306. package/dist/swirl-components/{p-c5200740.entry.js → p-5cc28450.entry.js} +1 -1
  307. package/dist/swirl-components/{p-b16d4978.entry.js → p-6384f8ba.entry.js} +1 -1
  308. package/dist/swirl-components/{p-545caf4a.entry.js → p-638b96a3.entry.js} +1 -1
  309. package/dist/swirl-components/{p-468d0e9b.entry.js → p-639fe827.entry.js} +1 -1
  310. package/dist/swirl-components/{p-0d619d62.entry.js → p-65231ba1.entry.js} +1 -1
  311. package/dist/swirl-components/{p-5d27a69e.entry.js → p-6966c97a.entry.js} +1 -1
  312. package/dist/swirl-components/{p-1609dbf3.entry.js → p-69b15b39.entry.js} +1 -1
  313. package/dist/swirl-components/p-6ab4b7cf.entry.js +1 -0
  314. package/dist/swirl-components/{p-56bdede5.entry.js → p-6c2b7a96.entry.js} +1 -1
  315. package/dist/swirl-components/{p-cc50d7a7.entry.js → p-70c5764b.entry.js} +1 -1
  316. package/dist/swirl-components/{p-70b255b3.entry.js → p-7272b763.entry.js} +1 -1
  317. package/dist/swirl-components/{p-f45709c0.entry.js → p-73ee554b.entry.js} +1 -1
  318. package/dist/swirl-components/p-7548473c.js +2 -0
  319. package/dist/swirl-components/{p-a71261bc.entry.js → p-75cf42d4.entry.js} +1 -1
  320. package/dist/swirl-components/{p-9c12d1eb.entry.js → p-7740f11b.entry.js} +1 -1
  321. package/dist/swirl-components/{p-fb19d8b9.entry.js → p-77cf9f30.entry.js} +1 -1
  322. package/dist/swirl-components/{p-0fa4c4cf.entry.js → p-84197db5.entry.js} +1 -1
  323. package/dist/swirl-components/p-88d8a3a9.entry.js +1 -0
  324. package/dist/swirl-components/{p-54b9e1b5.entry.js → p-8949fe7a.entry.js} +1 -1
  325. package/dist/swirl-components/{p-47a9a9cb.entry.js → p-8f1f9e78.entry.js} +1 -1
  326. package/dist/swirl-components/p-8fa700a5.entry.js +1 -0
  327. package/dist/swirl-components/{p-db229451.entry.js → p-926857f1.entry.js} +1 -1
  328. package/dist/swirl-components/{p-b624ff23.entry.js → p-97257780.entry.js} +1 -1
  329. package/dist/swirl-components/{p-0fa6b98f.entry.js → p-9b154fa3.entry.js} +1 -1
  330. package/dist/swirl-components/{p-453db2cf.entry.js → p-9c9da0a4.entry.js} +1 -1
  331. package/dist/swirl-components/{p-f8273972.entry.js → p-a133fb9d.entry.js} +1 -1
  332. package/dist/swirl-components/{p-9d07fb5a.entry.js → p-a362f0f9.entry.js} +1 -1
  333. package/dist/swirl-components/p-a6054ed9.entry.js +1 -0
  334. package/dist/swirl-components/p-a81417d9.entry.js +1 -0
  335. package/dist/swirl-components/{p-a6fb93df.entry.js → p-a8f3668a.entry.js} +1 -1
  336. package/dist/swirl-components/{p-1c8b77fe.entry.js → p-a94f114d.entry.js} +1 -1
  337. package/dist/swirl-components/{p-6a6de48d.entry.js → p-a98d70ca.entry.js} +1 -1
  338. package/dist/swirl-components/{p-126ead5f.entry.js → p-aaad68e8.entry.js} +1 -1
  339. package/dist/swirl-components/{p-a605b3d1.entry.js → p-b117edfa.entry.js} +1 -1
  340. package/dist/swirl-components/{p-01857435.entry.js → p-b3a71d9f.entry.js} +1 -1
  341. package/dist/swirl-components/{p-ae504b3e.entry.js → p-b6790219.entry.js} +1 -1
  342. package/dist/swirl-components/{p-24d112d7.entry.js → p-bb2d617e.entry.js} +1 -1
  343. package/dist/swirl-components/{p-0a9f3ada.entry.js → p-be40f14f.entry.js} +1 -1
  344. package/dist/swirl-components/{p-1bd3e7c0.entry.js → p-c3b49fae.entry.js} +1 -1
  345. package/dist/swirl-components/{p-f1774da0.entry.js → p-c69ba478.entry.js} +1 -1
  346. package/dist/swirl-components/{p-1c2e8e09.entry.js → p-c6d26cc3.entry.js} +1 -1
  347. package/dist/swirl-components/{p-fa7cc450.entry.js → p-c7427e54.entry.js} +1 -1
  348. package/dist/swirl-components/{p-cf8be27a.entry.js → p-c76f568b.entry.js} +1 -1
  349. package/dist/swirl-components/{p-a203be4a.entry.js → p-c8ef7c7b.entry.js} +1 -1
  350. package/dist/swirl-components/{p-6b957569.entry.js → p-c9281fc5.entry.js} +1 -1
  351. package/dist/swirl-components/p-cb622b3f.entry.js +1 -0
  352. package/dist/swirl-components/{p-0de885c6.entry.js → p-d34657bb.entry.js} +1 -1
  353. package/dist/swirl-components/{p-db902aec.entry.js → p-d353d8a6.entry.js} +1 -1
  354. package/dist/swirl-components/{p-55aaf1d3.entry.js → p-d437a017.entry.js} +1 -1
  355. package/dist/swirl-components/{p-67deba9e.entry.js → p-daf021ff.entry.js} +1 -1
  356. package/dist/swirl-components/p-db407fe2.entry.js +1 -0
  357. package/dist/swirl-components/{p-30011711.entry.js → p-df779bfc.entry.js} +1 -1
  358. package/dist/swirl-components/{p-95bd2274.entry.js → p-e04eac13.entry.js} +1 -1
  359. package/dist/swirl-components/{p-e89c7891.entry.js → p-e3c228f6.entry.js} +1 -1
  360. package/dist/swirl-components/{p-32a5e2a7.entry.js → p-e4a8a549.entry.js} +1 -1
  361. package/dist/swirl-components/p-e8bb09e8.js +1 -0
  362. package/dist/swirl-components/{p-e4df2658.entry.js → p-e8f32c6d.entry.js} +1 -1
  363. package/dist/swirl-components/{p-37d96123.entry.js → p-ec59a844.entry.js} +1 -1
  364. package/dist/swirl-components/{p-1126e372.entry.js → p-ece8d0a9.entry.js} +1 -1
  365. package/dist/swirl-components/{p-6a9a0e08.entry.js → p-f2bd932c.entry.js} +1 -1
  366. package/dist/swirl-components/{p-46f638cf.entry.js → p-f5bd49b1.entry.js} +1 -1
  367. package/dist/swirl-components/{p-b5cd4041.entry.js → p-f6a1e319.entry.js} +1 -1
  368. package/dist/swirl-components/{p-d41e3a37.entry.js → p-f8eaba53.entry.js} +1 -1
  369. package/dist/swirl-components/{p-437842a2.entry.js → p-f9719283.entry.js} +1 -1
  370. package/dist/swirl-components/{p-f59098f7.entry.js → p-f9a4a60c.entry.js} +1 -1
  371. package/dist/swirl-components/{p-8bf1ad8a.entry.js → p-f9e967e7.entry.js} +1 -1
  372. package/dist/swirl-components/{p-828cc4a3.entry.js → p-fa626f0f.entry.js} +1 -1
  373. package/dist/swirl-components/{p-8423a1b5.entry.js → p-fca2a909.entry.js} +1 -1
  374. package/dist/swirl-components/{p-c35a6610.entry.js → p-fcd09fdc.entry.js} +1 -1
  375. package/dist/swirl-components/{p-67aaf094.entry.js → p-ff23c876.entry.js} +1 -1
  376. package/dist/swirl-components/swirl-components.css +2 -2
  377. package/dist/swirl-components/swirl-components.esm.js +1 -1
  378. package/dist/types/components/flip-button/flip-button.d.ts +1 -0
  379. package/dist/types/components/flip-file-uploader/flip-file-uploader.d.ts +24 -0
  380. package/dist/types/components/flip-file-uploader/flip-file-uploader.stories.d.ts +13 -0
  381. package/dist/types/components/flip-icon/icons/flip-icon-cloud-upload.d.ts +5 -0
  382. package/dist/types/components/flip-resource-list/flip-resource-list.d.ts +13 -0
  383. package/dist/types/components/flip-resource-list/flip-resource-list.stories.d.ts +13 -0
  384. package/dist/types/components/flip-resource-list-file-item/flip-resource-list-file-item.d.ts +12 -0
  385. package/dist/types/components/flip-resource-list-file-item/flip-resource-list-file-item.stories.d.ts +23 -0
  386. package/dist/types/components/flip-resource-list-item/flip-resource-list-item.d.ts +23 -0
  387. package/dist/types/components/flip-resource-list-item/flip-resource-list-item.stories.d.ts +16 -0
  388. package/dist/types/components/flip-tab/flip-tab.d.ts +6 -0
  389. package/dist/types/components/flip-tab/flip-tab.stories.d.ts +13 -0
  390. package/dist/types/components/flip-tabs/flip-tabs.d.ts +27 -0
  391. package/dist/types/components/flip-tabs/flip-tabs.stories.d.ts +13 -0
  392. package/dist/types/components/flip-tooltip/flip-tooltip.d.ts +2 -2
  393. package/dist/types/components.d.ts +196 -0
  394. package/dist/types/utils.d.ts +9 -0
  395. package/package.json +3 -4
  396. package/vscode-data.json +215 -0
  397. package/dist/cjs/flip-inline-error.cjs.entry.js +0 -23
  398. package/dist/esm/flip-inline-error.entry.js +0 -19
  399. package/dist/swirl-components/p-1853aaf0.entry.js +0 -1
  400. package/dist/swirl-components/p-18965b40.entry.js +0 -1
  401. package/dist/swirl-components/p-18a51976.entry.js +0 -1
  402. package/dist/swirl-components/p-3d59d365.entry.js +0 -1
  403. package/dist/swirl-components/p-9b4a9856.entry.js +0 -1
  404. package/dist/swirl-components/p-aada2b77.entry.js +0 -1
  405. package/dist/swirl-components/p-cac72e30.entry.js +0 -1
  406. package/dist/swirl-components/p-d3999b94.entry.js +0 -2
  407. package/dist/swirl-components/p-e12fbb2d.js +0 -2
@@ -0,0 +1,1222 @@
1
+ function getSide(placement) {
2
+ return placement.split('-')[0];
3
+ }
4
+
5
+ function getAlignment(placement) {
6
+ return placement.split('-')[1];
7
+ }
8
+
9
+ function getMainAxisFromPlacement(placement) {
10
+ return ['top', 'bottom'].includes(getSide(placement)) ? 'x' : 'y';
11
+ }
12
+
13
+ function getLengthFromAxis(axis) {
14
+ return axis === 'y' ? 'height' : 'width';
15
+ }
16
+
17
+ function computeCoordsFromPlacement(_ref, placement, rtl) {
18
+ let {
19
+ reference,
20
+ floating
21
+ } = _ref;
22
+ const commonX = reference.x + reference.width / 2 - floating.width / 2;
23
+ const commonY = reference.y + reference.height / 2 - floating.height / 2;
24
+ const mainAxis = getMainAxisFromPlacement(placement);
25
+ const length = getLengthFromAxis(mainAxis);
26
+ const commonAlign = reference[length] / 2 - floating[length] / 2;
27
+ const side = getSide(placement);
28
+ const isVertical = mainAxis === 'x';
29
+ let coords;
30
+
31
+ switch (side) {
32
+ case 'top':
33
+ coords = {
34
+ x: commonX,
35
+ y: reference.y - floating.height
36
+ };
37
+ break;
38
+
39
+ case 'bottom':
40
+ coords = {
41
+ x: commonX,
42
+ y: reference.y + reference.height
43
+ };
44
+ break;
45
+
46
+ case 'right':
47
+ coords = {
48
+ x: reference.x + reference.width,
49
+ y: commonY
50
+ };
51
+ break;
52
+
53
+ case 'left':
54
+ coords = {
55
+ x: reference.x - floating.width,
56
+ y: commonY
57
+ };
58
+ break;
59
+
60
+ default:
61
+ coords = {
62
+ x: reference.x,
63
+ y: reference.y
64
+ };
65
+ }
66
+
67
+ switch (getAlignment(placement)) {
68
+ case 'start':
69
+ coords[mainAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
70
+ break;
71
+
72
+ case 'end':
73
+ coords[mainAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
74
+ break;
75
+ }
76
+
77
+ return coords;
78
+ }
79
+
80
+ /**
81
+ * Computes the `x` and `y` coordinates that will place the floating element
82
+ * next to a reference element when it is given a certain positioning strategy.
83
+ *
84
+ * This export does not have any `platform` interface logic. You will need to
85
+ * write one for the platform you are using Floating UI with.
86
+ */
87
+
88
+ const computePosition$1 = async (reference, floating, config) => {
89
+ const {
90
+ placement = 'bottom',
91
+ strategy = 'absolute',
92
+ middleware = [],
93
+ platform
94
+ } = config;
95
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
96
+
97
+ let rects = await platform.getElementRects({
98
+ reference,
99
+ floating,
100
+ strategy
101
+ });
102
+ let {
103
+ x,
104
+ y
105
+ } = computeCoordsFromPlacement(rects, placement, rtl);
106
+ let statefulPlacement = placement;
107
+ let middlewareData = {};
108
+ let resetCount = 0;
109
+
110
+ for (let i = 0; i < middleware.length; i++) {
111
+ const {
112
+ name,
113
+ fn
114
+ } = middleware[i];
115
+ const {
116
+ x: nextX,
117
+ y: nextY,
118
+ data,
119
+ reset
120
+ } = await fn({
121
+ x,
122
+ y,
123
+ initialPlacement: placement,
124
+ placement: statefulPlacement,
125
+ strategy,
126
+ middlewareData,
127
+ rects,
128
+ platform,
129
+ elements: {
130
+ reference,
131
+ floating
132
+ }
133
+ });
134
+ x = nextX != null ? nextX : x;
135
+ y = nextY != null ? nextY : y;
136
+ middlewareData = { ...middlewareData,
137
+ [name]: { ...middlewareData[name],
138
+ ...data
139
+ }
140
+ };
141
+
142
+ if (reset && resetCount <= 50) {
143
+ resetCount++;
144
+
145
+ if (typeof reset === 'object') {
146
+ if (reset.placement) {
147
+ statefulPlacement = reset.placement;
148
+ }
149
+
150
+ if (reset.rects) {
151
+ rects = reset.rects === true ? await platform.getElementRects({
152
+ reference,
153
+ floating,
154
+ strategy
155
+ }) : reset.rects;
156
+ }
157
+
158
+ ({
159
+ x,
160
+ y
161
+ } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
162
+ }
163
+
164
+ i = -1;
165
+ continue;
166
+ }
167
+ }
168
+
169
+ return {
170
+ x,
171
+ y,
172
+ placement: statefulPlacement,
173
+ strategy,
174
+ middlewareData
175
+ };
176
+ };
177
+
178
+ function expandPaddingObject(padding) {
179
+ return {
180
+ top: 0,
181
+ right: 0,
182
+ bottom: 0,
183
+ left: 0,
184
+ ...padding
185
+ };
186
+ }
187
+
188
+ function getSideObjectFromPadding(padding) {
189
+ return typeof padding !== 'number' ? expandPaddingObject(padding) : {
190
+ top: padding,
191
+ right: padding,
192
+ bottom: padding,
193
+ left: padding
194
+ };
195
+ }
196
+
197
+ function rectToClientRect(rect) {
198
+ return { ...rect,
199
+ top: rect.y,
200
+ left: rect.x,
201
+ right: rect.x + rect.width,
202
+ bottom: rect.y + rect.height
203
+ };
204
+ }
205
+
206
+ /**
207
+ * Resolves with an object of overflow side offsets that determine how much the
208
+ * element is overflowing a given clipping boundary.
209
+ * - positive = overflowing the boundary by that number of pixels
210
+ * - negative = how many pixels left before it will overflow
211
+ * - 0 = lies flush with the boundary
212
+ * @see https://floating-ui.com/docs/detectOverflow
213
+ */
214
+ async function detectOverflow(middlewareArguments, options) {
215
+ var _await$platform$isEle;
216
+
217
+ if (options === void 0) {
218
+ options = {};
219
+ }
220
+
221
+ const {
222
+ x,
223
+ y,
224
+ platform,
225
+ rects,
226
+ elements,
227
+ strategy
228
+ } = middlewareArguments;
229
+ const {
230
+ boundary = 'clippingAncestors',
231
+ rootBoundary = 'viewport',
232
+ elementContext = 'floating',
233
+ altBoundary = false,
234
+ padding = 0
235
+ } = options;
236
+ const paddingObject = getSideObjectFromPadding(padding);
237
+ const altContext = elementContext === 'floating' ? 'reference' : 'floating';
238
+ const element = elements[altBoundary ? altContext : elementContext];
239
+ const clippingClientRect = rectToClientRect(await platform.getClippingRect({
240
+ 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))),
241
+ boundary,
242
+ rootBoundary,
243
+ strategy
244
+ }));
245
+ const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
246
+ rect: elementContext === 'floating' ? { ...rects.floating,
247
+ x,
248
+ y
249
+ } : rects.reference,
250
+ offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),
251
+ strategy
252
+ }) : rects[elementContext]);
253
+ return {
254
+ top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
255
+ bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
256
+ left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
257
+ right: elementClientRect.right - clippingClientRect.right + paddingObject.right
258
+ };
259
+ }
260
+
261
+ const min$1 = Math.min;
262
+ const max$1 = Math.max;
263
+
264
+ function within(min$1$1, value, max$1$1) {
265
+ return max$1(min$1$1, min$1(value, max$1$1));
266
+ }
267
+
268
+ const hash$1 = {
269
+ left: 'right',
270
+ right: 'left',
271
+ bottom: 'top',
272
+ top: 'bottom'
273
+ };
274
+ function getOppositePlacement(placement) {
275
+ return placement.replace(/left|right|bottom|top/g, matched => hash$1[matched]);
276
+ }
277
+
278
+ function getAlignmentSides(placement, rects, rtl) {
279
+ if (rtl === void 0) {
280
+ rtl = false;
281
+ }
282
+
283
+ const alignment = getAlignment(placement);
284
+ const mainAxis = getMainAxisFromPlacement(placement);
285
+ const length = getLengthFromAxis(mainAxis);
286
+ let mainAlignmentSide = mainAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
287
+
288
+ if (rects.reference[length] > rects.floating[length]) {
289
+ mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
290
+ }
291
+
292
+ return {
293
+ main: mainAlignmentSide,
294
+ cross: getOppositePlacement(mainAlignmentSide)
295
+ };
296
+ }
297
+
298
+ const hash = {
299
+ start: 'end',
300
+ end: 'start'
301
+ };
302
+ function getOppositeAlignmentPlacement(placement) {
303
+ return placement.replace(/start|end/g, matched => hash[matched]);
304
+ }
305
+
306
+ function getExpandedPlacements(placement) {
307
+ const oppositePlacement = getOppositePlacement(placement);
308
+ return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
309
+ }
310
+
311
+ /**
312
+ * Changes the placement of the floating element to one that will fit if the
313
+ * initially specified `placement` does not.
314
+ * @see https://floating-ui.com/docs/flip
315
+ */
316
+ const flip = function (options) {
317
+ if (options === void 0) {
318
+ options = {};
319
+ }
320
+
321
+ return {
322
+ name: 'flip',
323
+ options,
324
+
325
+ async fn(middlewareArguments) {
326
+ var _middlewareData$flip;
327
+
328
+ const {
329
+ placement,
330
+ middlewareData,
331
+ rects,
332
+ initialPlacement,
333
+ platform,
334
+ elements
335
+ } = middlewareArguments;
336
+ const {
337
+ mainAxis: checkMainAxis = true,
338
+ crossAxis: checkCrossAxis = true,
339
+ fallbackPlacements: specifiedFallbackPlacements,
340
+ fallbackStrategy = 'bestFit',
341
+ flipAlignment = true,
342
+ ...detectOverflowOptions
343
+ } = options;
344
+ const side = getSide(placement);
345
+ const isBasePlacement = side === initialPlacement;
346
+ const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
347
+ const placements = [initialPlacement, ...fallbackPlacements];
348
+ const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
349
+ const overflows = [];
350
+ let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
351
+
352
+ if (checkMainAxis) {
353
+ overflows.push(overflow[side]);
354
+ }
355
+
356
+ if (checkCrossAxis) {
357
+ const {
358
+ main,
359
+ cross
360
+ } = getAlignmentSides(placement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
361
+ overflows.push(overflow[main], overflow[cross]);
362
+ }
363
+
364
+ overflowsData = [...overflowsData, {
365
+ placement,
366
+ overflows
367
+ }]; // One or more sides is overflowing
368
+
369
+ if (!overflows.every(side => side <= 0)) {
370
+ var _middlewareData$flip$, _middlewareData$flip2;
371
+
372
+ const nextIndex = ((_middlewareData$flip$ = (_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) != null ? _middlewareData$flip$ : 0) + 1;
373
+ const nextPlacement = placements[nextIndex];
374
+
375
+ if (nextPlacement) {
376
+ // Try next placement and re-run the lifecycle
377
+ return {
378
+ data: {
379
+ index: nextIndex,
380
+ overflows: overflowsData
381
+ },
382
+ reset: {
383
+ placement: nextPlacement
384
+ }
385
+ };
386
+ }
387
+
388
+ let resetPlacement = 'bottom';
389
+
390
+ switch (fallbackStrategy) {
391
+ case 'bestFit':
392
+ {
393
+ var _overflowsData$map$so;
394
+
395
+ const placement = (_overflowsData$map$so = overflowsData.map(d => [d, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0].placement;
396
+
397
+ if (placement) {
398
+ resetPlacement = placement;
399
+ }
400
+
401
+ break;
402
+ }
403
+
404
+ case 'initialPlacement':
405
+ resetPlacement = initialPlacement;
406
+ break;
407
+ }
408
+
409
+ if (placement !== resetPlacement) {
410
+ return {
411
+ reset: {
412
+ placement: resetPlacement
413
+ }
414
+ };
415
+ }
416
+ }
417
+
418
+ return {};
419
+ }
420
+
421
+ };
422
+ };
423
+
424
+ async function convertValueToCoords(middlewareArguments, value) {
425
+ const {
426
+ placement,
427
+ platform,
428
+ elements
429
+ } = middlewareArguments;
430
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
431
+ const side = getSide(placement);
432
+ const alignment = getAlignment(placement);
433
+ const isVertical = getMainAxisFromPlacement(placement) === 'x';
434
+ const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
435
+ const crossAxisMulti = rtl && isVertical ? -1 : 1;
436
+ const rawValue = typeof value === 'function' ? value(middlewareArguments) : value; // eslint-disable-next-line prefer-const
437
+
438
+ let {
439
+ mainAxis,
440
+ crossAxis,
441
+ alignmentAxis
442
+ } = typeof rawValue === 'number' ? {
443
+ mainAxis: rawValue,
444
+ crossAxis: 0,
445
+ alignmentAxis: null
446
+ } : {
447
+ mainAxis: 0,
448
+ crossAxis: 0,
449
+ alignmentAxis: null,
450
+ ...rawValue
451
+ };
452
+
453
+ if (alignment && typeof alignmentAxis === 'number') {
454
+ crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
455
+ }
456
+
457
+ return isVertical ? {
458
+ x: crossAxis * crossAxisMulti,
459
+ y: mainAxis * mainAxisMulti
460
+ } : {
461
+ x: mainAxis * mainAxisMulti,
462
+ y: crossAxis * crossAxisMulti
463
+ };
464
+ }
465
+ /**
466
+ * Displaces the floating element from its reference element.
467
+ * @see https://floating-ui.com/docs/offset
468
+ */
469
+
470
+ const offset = function (value) {
471
+ if (value === void 0) {
472
+ value = 0;
473
+ }
474
+
475
+ return {
476
+ name: 'offset',
477
+ options: value,
478
+
479
+ async fn(middlewareArguments) {
480
+ const {
481
+ x,
482
+ y
483
+ } = middlewareArguments;
484
+ const diffCoords = await convertValueToCoords(middlewareArguments, value);
485
+ return {
486
+ x: x + diffCoords.x,
487
+ y: y + diffCoords.y,
488
+ data: diffCoords
489
+ };
490
+ }
491
+
492
+ };
493
+ };
494
+
495
+ function getCrossAxis(axis) {
496
+ return axis === 'x' ? 'y' : 'x';
497
+ }
498
+
499
+ /**
500
+ * Shifts the floating element in order to keep it in view when it will overflow
501
+ * a clipping boundary.
502
+ * @see https://floating-ui.com/docs/shift
503
+ */
504
+ const shift = function (options) {
505
+ if (options === void 0) {
506
+ options = {};
507
+ }
508
+
509
+ return {
510
+ name: 'shift',
511
+ options,
512
+
513
+ async fn(middlewareArguments) {
514
+ const {
515
+ x,
516
+ y,
517
+ placement
518
+ } = middlewareArguments;
519
+ const {
520
+ mainAxis: checkMainAxis = true,
521
+ crossAxis: checkCrossAxis = false,
522
+ limiter = {
523
+ fn: _ref => {
524
+ let {
525
+ x,
526
+ y
527
+ } = _ref;
528
+ return {
529
+ x,
530
+ y
531
+ };
532
+ }
533
+ },
534
+ ...detectOverflowOptions
535
+ } = options;
536
+ const coords = {
537
+ x,
538
+ y
539
+ };
540
+ const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
541
+ const mainAxis = getMainAxisFromPlacement(getSide(placement));
542
+ const crossAxis = getCrossAxis(mainAxis);
543
+ let mainAxisCoord = coords[mainAxis];
544
+ let crossAxisCoord = coords[crossAxis];
545
+
546
+ if (checkMainAxis) {
547
+ const minSide = mainAxis === 'y' ? 'top' : 'left';
548
+ const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
549
+ const min = mainAxisCoord + overflow[minSide];
550
+ const max = mainAxisCoord - overflow[maxSide];
551
+ mainAxisCoord = within(min, mainAxisCoord, max);
552
+ }
553
+
554
+ if (checkCrossAxis) {
555
+ const minSide = crossAxis === 'y' ? 'top' : 'left';
556
+ const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
557
+ const min = crossAxisCoord + overflow[minSide];
558
+ const max = crossAxisCoord - overflow[maxSide];
559
+ crossAxisCoord = within(min, crossAxisCoord, max);
560
+ }
561
+
562
+ const limitedCoords = limiter.fn({ ...middlewareArguments,
563
+ [mainAxis]: mainAxisCoord,
564
+ [crossAxis]: crossAxisCoord
565
+ });
566
+ return { ...limitedCoords,
567
+ data: {
568
+ x: limitedCoords.x - x,
569
+ y: limitedCoords.y - y
570
+ }
571
+ };
572
+ }
573
+
574
+ };
575
+ };
576
+
577
+ function isWindow(value) {
578
+ return value && value.document && value.location && value.alert && value.setInterval;
579
+ }
580
+ function getWindow(node) {
581
+ if (node == null) {
582
+ return window;
583
+ }
584
+
585
+ if (!isWindow(node)) {
586
+ const ownerDocument = node.ownerDocument;
587
+ return ownerDocument ? ownerDocument.defaultView || window : window;
588
+ }
589
+
590
+ return node;
591
+ }
592
+
593
+ function getComputedStyle(element) {
594
+ return getWindow(element).getComputedStyle(element);
595
+ }
596
+
597
+ function getNodeName(node) {
598
+ return isWindow(node) ? '' : node ? (node.nodeName || '').toLowerCase() : '';
599
+ }
600
+
601
+ function getUAString() {
602
+ const uaData = navigator.userAgentData;
603
+
604
+ if (uaData != null && uaData.brands) {
605
+ return uaData.brands.map(item => item.brand + "/" + item.version).join(' ');
606
+ }
607
+
608
+ return navigator.userAgent;
609
+ }
610
+
611
+ function isHTMLElement(value) {
612
+ return value instanceof getWindow(value).HTMLElement;
613
+ }
614
+ function isElement(value) {
615
+ return value instanceof getWindow(value).Element;
616
+ }
617
+ function isNode(value) {
618
+ return value instanceof getWindow(value).Node;
619
+ }
620
+ function isShadowRoot(node) {
621
+ // Browsers without `ShadowRoot` support
622
+ if (typeof ShadowRoot === 'undefined') {
623
+ return false;
624
+ }
625
+
626
+ const OwnElement = getWindow(node).ShadowRoot;
627
+ return node instanceof OwnElement || node instanceof ShadowRoot;
628
+ }
629
+ function isOverflowElement(element) {
630
+ // Firefox wants us to check `-x` and `-y` variations as well
631
+ const {
632
+ overflow,
633
+ overflowX,
634
+ overflowY
635
+ } = getComputedStyle(element);
636
+ return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
637
+ }
638
+ function isTableElement(element) {
639
+ return ['table', 'td', 'th'].includes(getNodeName(element));
640
+ }
641
+ function isContainingBlock(element) {
642
+ // TODO: Try and use feature detection here instead
643
+ const isFirefox = /firefox/i.test(getUAString());
644
+ const css = getComputedStyle(element); // This is non-exhaustive but covers the most common CSS properties that
645
+ // create a containing block.
646
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
647
+
648
+ return css.transform !== 'none' || css.perspective !== 'none' || // @ts-ignore (TS 4.1 compat)
649
+ css.contain === 'paint' || ['transform', 'perspective'].includes(css.willChange) || isFirefox && css.willChange === 'filter' || isFirefox && (css.filter ? css.filter !== 'none' : false);
650
+ }
651
+ function isLayoutViewport() {
652
+ // Not Safari
653
+ return !/^((?!chrome|android).)*safari/i.test(getUAString()); // Feature detection for this fails in various ways
654
+ // • Always-visible scrollbar or not
655
+ // • Width of <html>, etc.
656
+ // const vV = win.visualViewport;
657
+ // return vV ? Math.abs(win.innerWidth / vV.scale - vV.width) < 0.5 : true;
658
+ }
659
+
660
+ const min = Math.min;
661
+ const max = Math.max;
662
+ const round = Math.round;
663
+
664
+ function getBoundingClientRect(element, includeScale, isFixedStrategy) {
665
+ var _win$visualViewport$o, _win$visualViewport, _win$visualViewport$o2, _win$visualViewport2;
666
+
667
+ if (includeScale === void 0) {
668
+ includeScale = false;
669
+ }
670
+
671
+ if (isFixedStrategy === void 0) {
672
+ isFixedStrategy = false;
673
+ }
674
+
675
+ const clientRect = element.getBoundingClientRect();
676
+ let scaleX = 1;
677
+ let scaleY = 1;
678
+
679
+ if (includeScale && isHTMLElement(element)) {
680
+ scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
681
+ scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
682
+ }
683
+
684
+ const win = isElement(element) ? getWindow(element) : window;
685
+ const addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
686
+ const x = (clientRect.left + (addVisualOffsets ? (_win$visualViewport$o = (_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) != null ? _win$visualViewport$o : 0 : 0)) / scaleX;
687
+ const y = (clientRect.top + (addVisualOffsets ? (_win$visualViewport$o2 = (_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) != null ? _win$visualViewport$o2 : 0 : 0)) / scaleY;
688
+ const width = clientRect.width / scaleX;
689
+ const height = clientRect.height / scaleY;
690
+ return {
691
+ width,
692
+ height,
693
+ top: y,
694
+ right: x + width,
695
+ bottom: y + height,
696
+ left: x,
697
+ x,
698
+ y
699
+ };
700
+ }
701
+
702
+ function getDocumentElement(node) {
703
+ return ((isNode(node) ? node.ownerDocument : node.document) || window.document).documentElement;
704
+ }
705
+
706
+ function getNodeScroll(element) {
707
+ if (isElement(element)) {
708
+ return {
709
+ scrollLeft: element.scrollLeft,
710
+ scrollTop: element.scrollTop
711
+ };
712
+ }
713
+
714
+ return {
715
+ scrollLeft: element.pageXOffset,
716
+ scrollTop: element.pageYOffset
717
+ };
718
+ }
719
+
720
+ function getWindowScrollBarX(element) {
721
+ // If <html> has a CSS width greater than the viewport, then this will be
722
+ // incorrect for RTL.
723
+ return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
724
+ }
725
+
726
+ function isScaled(element) {
727
+ const rect = getBoundingClientRect(element);
728
+ return round(rect.width) !== element.offsetWidth || round(rect.height) !== element.offsetHeight;
729
+ }
730
+
731
+ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
732
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
733
+ const documentElement = getDocumentElement(offsetParent);
734
+ const rect = getBoundingClientRect(element, // @ts-ignore - checked above (TS 4.1 compat)
735
+ isOffsetParentAnElement && isScaled(offsetParent), strategy === 'fixed');
736
+ let scroll = {
737
+ scrollLeft: 0,
738
+ scrollTop: 0
739
+ };
740
+ const offsets = {
741
+ x: 0,
742
+ y: 0
743
+ };
744
+
745
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
746
+ if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
747
+ scroll = getNodeScroll(offsetParent);
748
+ }
749
+
750
+ if (isHTMLElement(offsetParent)) {
751
+ const offsetRect = getBoundingClientRect(offsetParent, true);
752
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
753
+ offsets.y = offsetRect.y + offsetParent.clientTop;
754
+ } else if (documentElement) {
755
+ offsets.x = getWindowScrollBarX(documentElement);
756
+ }
757
+ }
758
+
759
+ return {
760
+ x: rect.left + scroll.scrollLeft - offsets.x,
761
+ y: rect.top + scroll.scrollTop - offsets.y,
762
+ width: rect.width,
763
+ height: rect.height
764
+ };
765
+ }
766
+
767
+ function getParentNode(node) {
768
+ if (getNodeName(node) === 'html') {
769
+ return node;
770
+ }
771
+
772
+ return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
773
+ // @ts-ignore
774
+ node.assignedSlot || // step into the shadow DOM of the parent of a slotted node
775
+ node.parentNode || ( // DOM Element detected
776
+ isShadowRoot(node) ? node.host : null) || // ShadowRoot detected
777
+ getDocumentElement(node) // fallback
778
+
779
+ );
780
+ }
781
+
782
+ function getTrueOffsetParent(element) {
783
+ if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
784
+ return null;
785
+ }
786
+
787
+ return composedOffsetParent(element);
788
+ }
789
+ /**
790
+ * Polyfills the old offsetParent behavior from before the spec was changed:
791
+ * https://github.com/w3c/csswg-drafts/issues/159
792
+ */
793
+
794
+
795
+ function composedOffsetParent(element) {
796
+ let {
797
+ offsetParent
798
+ } = element;
799
+ let ancestor = element;
800
+ let foundInsideSlot = false;
801
+
802
+ while (ancestor && ancestor !== offsetParent) {
803
+ const {
804
+ assignedSlot
805
+ } = ancestor;
806
+
807
+ if (assignedSlot) {
808
+ let newOffsetParent = assignedSlot.offsetParent;
809
+
810
+ if (getComputedStyle(assignedSlot).display === 'contents') {
811
+ const hadStyleAttribute = assignedSlot.hasAttribute('style');
812
+ const oldDisplay = assignedSlot.style.display;
813
+ assignedSlot.style.display = getComputedStyle(ancestor).display;
814
+ newOffsetParent = assignedSlot.offsetParent;
815
+ assignedSlot.style.display = oldDisplay;
816
+
817
+ if (!hadStyleAttribute) {
818
+ assignedSlot.removeAttribute('style');
819
+ }
820
+ }
821
+
822
+ ancestor = assignedSlot;
823
+
824
+ if (offsetParent !== newOffsetParent) {
825
+ offsetParent = newOffsetParent;
826
+ foundInsideSlot = true;
827
+ }
828
+ } else if (isShadowRoot(ancestor) && ancestor.host && foundInsideSlot) {
829
+ break;
830
+ }
831
+
832
+ ancestor = isShadowRoot(ancestor) && ancestor.host || ancestor.parentNode;
833
+ }
834
+
835
+ return offsetParent;
836
+ }
837
+
838
+ function getContainingBlock(element) {
839
+ let currentNode = getParentNode(element);
840
+
841
+ if (isShadowRoot(currentNode)) {
842
+ currentNode = currentNode.host;
843
+ }
844
+
845
+ while (isHTMLElement(currentNode) && !['html', 'body'].includes(getNodeName(currentNode))) {
846
+ if (isContainingBlock(currentNode)) {
847
+ return currentNode;
848
+ } else {
849
+ const parent = currentNode.parentNode;
850
+ currentNode = isShadowRoot(parent) ? parent.host : parent;
851
+ }
852
+ }
853
+
854
+ return null;
855
+ } // Gets the closest ancestor positioned element. Handles some edge cases,
856
+ // such as table ancestors and cross browser bugs.
857
+
858
+
859
+ function getOffsetParent(element) {
860
+ const window = getWindow(element);
861
+ let offsetParent = getTrueOffsetParent(element);
862
+
863
+ while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
864
+ offsetParent = getTrueOffsetParent(offsetParent);
865
+ }
866
+
867
+ if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
868
+ return window;
869
+ }
870
+
871
+ return offsetParent || getContainingBlock(element) || window;
872
+ }
873
+
874
+ function getDimensions(element) {
875
+ if (isHTMLElement(element)) {
876
+ return {
877
+ width: element.offsetWidth,
878
+ height: element.offsetHeight
879
+ };
880
+ }
881
+
882
+ const rect = getBoundingClientRect(element);
883
+ return {
884
+ width: rect.width,
885
+ height: rect.height
886
+ };
887
+ }
888
+
889
+ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
890
+ let {
891
+ rect,
892
+ offsetParent,
893
+ strategy
894
+ } = _ref;
895
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
896
+ const documentElement = getDocumentElement(offsetParent);
897
+
898
+ if (offsetParent === documentElement) {
899
+ return rect;
900
+ }
901
+
902
+ let scroll = {
903
+ scrollLeft: 0,
904
+ scrollTop: 0
905
+ };
906
+ const offsets = {
907
+ x: 0,
908
+ y: 0
909
+ };
910
+
911
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
912
+ if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
913
+ scroll = getNodeScroll(offsetParent);
914
+ }
915
+
916
+ if (isHTMLElement(offsetParent)) {
917
+ const offsetRect = getBoundingClientRect(offsetParent, true);
918
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
919
+ offsets.y = offsetRect.y + offsetParent.clientTop;
920
+ } // This doesn't appear to be need to be negated.
921
+ // else if (documentElement) {
922
+ // offsets.x = getWindowScrollBarX(documentElement);
923
+ // }
924
+
925
+ }
926
+
927
+ return { ...rect,
928
+ x: rect.x - scroll.scrollLeft + offsets.x,
929
+ y: rect.y - scroll.scrollTop + offsets.y
930
+ };
931
+ }
932
+
933
+ function getViewportRect(element, strategy) {
934
+ const win = getWindow(element);
935
+ const html = getDocumentElement(element);
936
+ const visualViewport = win.visualViewport;
937
+ let width = html.clientWidth;
938
+ let height = html.clientHeight;
939
+ let x = 0;
940
+ let y = 0;
941
+
942
+ if (visualViewport) {
943
+ width = visualViewport.width;
944
+ height = visualViewport.height;
945
+ const layoutViewport = isLayoutViewport();
946
+
947
+ if (layoutViewport || !layoutViewport && strategy === 'fixed') {
948
+ x = visualViewport.offsetLeft;
949
+ y = visualViewport.offsetTop;
950
+ }
951
+ }
952
+
953
+ return {
954
+ width,
955
+ height,
956
+ x,
957
+ y
958
+ };
959
+ }
960
+
961
+ // of the `<html>` and `<body>` rect bounds if horizontally scrollable
962
+
963
+ function getDocumentRect(element) {
964
+ var _element$ownerDocumen;
965
+
966
+ const html = getDocumentElement(element);
967
+ const scroll = getNodeScroll(element);
968
+ const body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
969
+ const width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
970
+ const height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
971
+ let x = -scroll.scrollLeft + getWindowScrollBarX(element);
972
+ const y = -scroll.scrollTop;
973
+
974
+ if (getComputedStyle(body || html).direction === 'rtl') {
975
+ x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
976
+ }
977
+
978
+ return {
979
+ width,
980
+ height,
981
+ x,
982
+ y
983
+ };
984
+ }
985
+
986
+ function getNearestOverflowAncestor(node) {
987
+ const parentNode = getParentNode(node);
988
+
989
+ if (['html', 'body', '#document'].includes(getNodeName(parentNode))) {
990
+ // @ts-ignore assume body is always available
991
+ return node.ownerDocument.body;
992
+ }
993
+
994
+ if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
995
+ return parentNode;
996
+ }
997
+
998
+ return getNearestOverflowAncestor(parentNode);
999
+ }
1000
+
1001
+ function getOverflowAncestors(node, list) {
1002
+ var _node$ownerDocument;
1003
+
1004
+ if (list === void 0) {
1005
+ list = [];
1006
+ }
1007
+
1008
+ const scrollableAncestor = getNearestOverflowAncestor(node);
1009
+ const isBody = scrollableAncestor === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body);
1010
+ const win = getWindow(scrollableAncestor);
1011
+ const target = isBody ? [win].concat(win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []) : scrollableAncestor;
1012
+ const updatedList = list.concat(target);
1013
+ return isBody ? updatedList : // @ts-ignore: isBody tells us target will be an HTMLElement here
1014
+ updatedList.concat(getOverflowAncestors(target));
1015
+ }
1016
+
1017
+ function contains(parent, child) {
1018
+ const rootNode = child.getRootNode == null ? void 0 : child.getRootNode(); // First, attempt with faster native method
1019
+
1020
+ if (parent.contains(child)) {
1021
+ return true;
1022
+ } // then fallback to custom implementation with Shadow DOM support
1023
+ else if (rootNode && isShadowRoot(rootNode)) {
1024
+ let next = child;
1025
+
1026
+ do {
1027
+ // use `===` replace node.isSameNode()
1028
+ if (next && parent === next) {
1029
+ return true;
1030
+ } // @ts-ignore: need a better way to handle this...
1031
+
1032
+
1033
+ next = next.parentNode || next.host;
1034
+ } while (next);
1035
+ }
1036
+
1037
+ return false;
1038
+ }
1039
+
1040
+ function getInnerBoundingClientRect(element, strategy) {
1041
+ const clientRect = getBoundingClientRect(element, false, strategy === 'fixed');
1042
+ const top = clientRect.top + element.clientTop;
1043
+ const left = clientRect.left + element.clientLeft;
1044
+ return {
1045
+ top,
1046
+ left,
1047
+ x: left,
1048
+ y: top,
1049
+ right: left + element.clientWidth,
1050
+ bottom: top + element.clientHeight,
1051
+ width: element.clientWidth,
1052
+ height: element.clientHeight
1053
+ };
1054
+ }
1055
+
1056
+ function getClientRectFromClippingAncestor(element, clippingParent, strategy) {
1057
+ if (clippingParent === 'viewport') {
1058
+ return rectToClientRect(getViewportRect(element, strategy));
1059
+ }
1060
+
1061
+ if (isElement(clippingParent)) {
1062
+ return getInnerBoundingClientRect(clippingParent, strategy);
1063
+ }
1064
+
1065
+ return rectToClientRect(getDocumentRect(getDocumentElement(element)));
1066
+ } // A "clipping ancestor" is an overflowable container with the characteristic of
1067
+ // clipping (or hiding) overflowing elements with a position different from
1068
+ // `initial`
1069
+
1070
+
1071
+ function getClippingAncestors(element) {
1072
+ const clippingAncestors = getOverflowAncestors(element);
1073
+ const canEscapeClipping = ['absolute', 'fixed'].includes(getComputedStyle(element).position);
1074
+ const clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
1075
+
1076
+ if (!isElement(clipperElement)) {
1077
+ return [];
1078
+ } // @ts-ignore isElement check ensures we return Array<Element>
1079
+
1080
+
1081
+ return clippingAncestors.filter(clippingAncestors => isElement(clippingAncestors) && contains(clippingAncestors, clipperElement) && getNodeName(clippingAncestors) !== 'body');
1082
+ } // Gets the maximum area that the element is visible in due to any number of
1083
+ // clipping ancestors
1084
+
1085
+
1086
+ function getClippingRect(_ref) {
1087
+ let {
1088
+ element,
1089
+ boundary,
1090
+ rootBoundary,
1091
+ strategy
1092
+ } = _ref;
1093
+ const mainClippingAncestors = boundary === 'clippingAncestors' ? getClippingAncestors(element) : [].concat(boundary);
1094
+ const clippingAncestors = [...mainClippingAncestors, rootBoundary];
1095
+ const firstClippingAncestor = clippingAncestors[0];
1096
+ const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
1097
+ const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
1098
+ accRect.top = max(rect.top, accRect.top);
1099
+ accRect.right = min(rect.right, accRect.right);
1100
+ accRect.bottom = min(rect.bottom, accRect.bottom);
1101
+ accRect.left = max(rect.left, accRect.left);
1102
+ return accRect;
1103
+ }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
1104
+ return {
1105
+ width: clippingRect.right - clippingRect.left,
1106
+ height: clippingRect.bottom - clippingRect.top,
1107
+ x: clippingRect.left,
1108
+ y: clippingRect.top
1109
+ };
1110
+ }
1111
+
1112
+ const platform = {
1113
+ getClippingRect,
1114
+ convertOffsetParentRelativeRectToViewportRelativeRect,
1115
+ isElement,
1116
+ getDimensions,
1117
+ getOffsetParent,
1118
+ getDocumentElement,
1119
+ getElementRects: _ref => {
1120
+ let {
1121
+ reference,
1122
+ floating,
1123
+ strategy
1124
+ } = _ref;
1125
+ return {
1126
+ reference: getRectRelativeToOffsetParent(reference, getOffsetParent(floating), strategy),
1127
+ floating: { ...getDimensions(floating),
1128
+ x: 0,
1129
+ y: 0
1130
+ }
1131
+ };
1132
+ },
1133
+ getClientRects: element => Array.from(element.getClientRects()),
1134
+ isRTL: element => getComputedStyle(element).direction === 'rtl'
1135
+ };
1136
+
1137
+ /**
1138
+ * Automatically updates the position of the floating element when necessary.
1139
+ * @see https://floating-ui.com/docs/autoUpdate
1140
+ */
1141
+ function autoUpdate(reference, floating, update, options) {
1142
+ if (options === void 0) {
1143
+ options = {};
1144
+ }
1145
+
1146
+ const {
1147
+ ancestorScroll: _ancestorScroll = true,
1148
+ ancestorResize: _ancestorResize = true,
1149
+ elementResize = true,
1150
+ animationFrame = false
1151
+ } = options;
1152
+ const ancestorScroll = _ancestorScroll && !animationFrame;
1153
+ const ancestorResize = _ancestorResize && !animationFrame;
1154
+ const ancestors = ancestorScroll || ancestorResize ? [...(isElement(reference) ? getOverflowAncestors(reference) : []), ...getOverflowAncestors(floating)] : [];
1155
+ ancestors.forEach(ancestor => {
1156
+ ancestorScroll && ancestor.addEventListener('scroll', update, {
1157
+ passive: true
1158
+ });
1159
+ ancestorResize && ancestor.addEventListener('resize', update);
1160
+ });
1161
+ let observer = null;
1162
+
1163
+ if (elementResize) {
1164
+ let initialUpdate = true;
1165
+ observer = new ResizeObserver(() => {
1166
+ if (!initialUpdate) {
1167
+ update();
1168
+ }
1169
+
1170
+ initialUpdate = false;
1171
+ });
1172
+ isElement(reference) && !animationFrame && observer.observe(reference);
1173
+ observer.observe(floating);
1174
+ }
1175
+
1176
+ let frameId;
1177
+ let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
1178
+
1179
+ if (animationFrame) {
1180
+ frameLoop();
1181
+ }
1182
+
1183
+ function frameLoop() {
1184
+ const nextRefRect = getBoundingClientRect(reference);
1185
+
1186
+ if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
1187
+ update();
1188
+ }
1189
+
1190
+ prevRefRect = nextRefRect;
1191
+ frameId = requestAnimationFrame(frameLoop);
1192
+ }
1193
+
1194
+ update();
1195
+ return () => {
1196
+ var _observer;
1197
+
1198
+ ancestors.forEach(ancestor => {
1199
+ ancestorScroll && ancestor.removeEventListener('scroll', update);
1200
+ ancestorResize && ancestor.removeEventListener('resize', update);
1201
+ });
1202
+ (_observer = observer) == null ? void 0 : _observer.disconnect();
1203
+ observer = null;
1204
+
1205
+ if (animationFrame) {
1206
+ cancelAnimationFrame(frameId);
1207
+ }
1208
+ };
1209
+ }
1210
+
1211
+ /**
1212
+ * Computes the `x` and `y` coordinates that will place the floating element
1213
+ * next to a reference element when it is given a certain CSS positioning
1214
+ * strategy.
1215
+ */
1216
+
1217
+ const computePosition = (reference, floating, options) => computePosition$1(reference, floating, {
1218
+ platform,
1219
+ ...options
1220
+ });
1221
+
1222
+ export { autoUpdate as a, computePosition as c, flip as f, offset as o, shift as s };