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