@ntbjs/react-components 2.0.0-rc.12 → 2.0.0-rc.26

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 (559) hide show
  1. package/build/ActionButton-03dc5f67.js +92 -0
  2. package/build/Alert-8a511bdc.js +138 -0
  3. package/build/AssetAction-d081e4b7.js +2377 -0
  4. package/build/AssetPreviewTopBar-623cfa18.js +152 -0
  5. package/build/Badge-aa4cd9c1.js +221 -0
  6. package/build/Button-2e26f5da.js +449 -0
  7. package/build/Checkbox-0b8faf49.js +220 -0
  8. package/build/CompactAutocompleteSelect-797778cb.js +555 -0
  9. package/build/CompactStarRating-da21b53f.js +436 -0
  10. package/build/CompactTextInput-d56aec71.js +541 -0
  11. package/build/ContextMenu-82f9d728.js +33 -0
  12. package/build/ContextMenuItem-3967010d.js +152 -0
  13. package/build/InfoCard-d0fdf377.js +132 -0
  14. package/build/InputGroup-8d4a4644.js +30 -0
  15. package/build/Instructions-af191987.js +274 -0
  16. package/build/MultiLevelCheckboxSelect-d229cf98.js +632 -0
  17. package/build/MultiSelect-d7920eb1.js +470 -0
  18. package/build/Popover-c4be47ea.js +241 -0
  19. package/build/ProgressBar-2d26c1fb.js +217 -0
  20. package/build/Radio-150fb2c9.js +141 -0
  21. package/build/SectionSeparator-e06c7660.js +38 -0
  22. package/build/Switch-d2d6e9ec.js +167 -0
  23. package/build/Tab-ccbca1f2.js +39 -0
  24. package/build/Tabs-b06c0e24.js +166 -0
  25. package/build/TextArea-26d3c8a1.js +619 -0
  26. package/build/TextInput-3a567daa.js +372 -0
  27. package/build/Tooltip-d5882b82.js +73 -0
  28. package/build/VerificationStatusIcon-9876b68f.js +120 -0
  29. package/{esm/node_modules/@babel/runtime/helpers/esm/extends.js → build/_rollupPluginBabelHelpers-4b342fad.js} +3 -1
  30. package/build/arrow-forward-d7c77ae3.js +37 -0
  31. package/build/close-1751121a.js +37 -0
  32. package/build/data/Alert/index.js +12 -0
  33. package/build/data/Badge/index.js +11 -0
  34. package/build/data/Popover/index.js +16 -0
  35. package/build/data/Tab/index.js +11 -0
  36. package/build/data/Tabs/index.js +13 -0
  37. package/build/data/Tooltip/index.js +13 -0
  38. package/build/data/index.js +30 -0
  39. package/{esm/node_modules/prop-types/factoryWithTypeCheckers.js → build/defaultTheme-d9a7342e.js} +582 -17
  40. package/build/edit-note-cefe2215.js +37 -0
  41. package/build/expand-more-d74e2bd2.js +37 -0
  42. package/build/icons/add-circle.svg +3 -0
  43. package/build/icons/add.svg +3 -0
  44. package/build/icons/album.svg +3 -0
  45. package/build/icons/arrow-back.svg +4 -0
  46. package/build/icons/arrow-drop-down.svg +4 -0
  47. package/build/icons/arrow-forward.svg +3 -0
  48. package/build/icons/audio.svg +3 -0
  49. package/build/icons/bell.svg +3 -0
  50. package/build/icons/check-circle-filled.svg +3 -0
  51. package/build/icons/check-rectangle-filled.svg +3 -0
  52. package/build/icons/check.svg +3 -0
  53. package/build/icons/clear-circle-filled.svg +14 -0
  54. package/build/icons/close.svg +4 -0
  55. package/build/icons/corporate.svg +3 -0
  56. package/build/icons/delete-context-menu.svg +4 -0
  57. package/build/icons/delete.svg +3 -0
  58. package/build/icons/design-services.svg +4 -0
  59. package/build/icons/download.svg +3 -0
  60. package/build/icons/edit-note.svg +4 -0
  61. package/build/icons/edit.svg +3 -0
  62. package/build/icons/expand-more.svg +4 -0
  63. package/build/icons/file.svg +3 -0
  64. package/build/icons/ftp.svg +3 -0
  65. package/build/icons/gear.svg +3 -0
  66. package/build/icons/headset.svg +1 -0
  67. package/build/icons/index.js +79 -0
  68. package/build/icons/layers.svg +3 -0
  69. package/build/icons/library-add.svg +3 -0
  70. package/build/icons/link.svg +4 -0
  71. package/build/icons/pdf.svg +3 -0
  72. package/build/icons/play.svg +3 -0
  73. package/build/icons/remove-circle.svg +3 -0
  74. package/build/icons/search.svg +3 -0
  75. package/build/icons/share.svg +3 -0
  76. package/build/icons/shopping_cart_add.svg +3 -0
  77. package/build/icons/star-filled.svg +3 -0
  78. package/build/icons/star.svg +3 -0
  79. package/build/icons/triangle-right.svg +4 -0
  80. package/build/icons/verification.svg +3 -0
  81. package/build/icons/warning-circle.svg +3 -0
  82. package/build/icons/warning-triangle.svg +3 -0
  83. package/build/inputs/ActionButton/index.js +12 -0
  84. package/build/inputs/Button/index.js +19 -0
  85. package/build/inputs/Checkbox/index.js +12 -0
  86. package/build/inputs/CompactAutocompleteSelect/index.js +29 -0
  87. package/build/inputs/CompactStarRating/index.js +23 -0
  88. package/build/inputs/CompactTextInput/index.js +25 -0
  89. package/build/inputs/MultiSelect/index.js +16 -0
  90. package/build/inputs/Radio/index.js +13 -0
  91. package/build/inputs/Switch/index.js +12 -0
  92. package/build/inputs/TextArea/index.js +26 -0
  93. package/build/inputs/TextInput/index.js +15 -0
  94. package/build/inputs/index.js +60 -0
  95. package/build/layout/InputGroup/index.js +11 -0
  96. package/build/layout/SectionSeparator/index.js +11 -0
  97. package/build/layout/index.js +15 -0
  98. package/build/shift-away-subtle-158617af.js +9 -0
  99. package/build/styles/all.scss +3 -0
  100. package/build/styles/config.scss +38 -0
  101. package/build/styles/utils/colors.scss +15 -0
  102. package/build/styles/utils/theme.scss +33 -0
  103. package/build/widgets/AssetGallery/index.js +55 -0
  104. package/build/widgets/AssetPreview/AssetPreviewTopBar/index.js +12 -0
  105. package/build/widgets/ContextMenu/ContextMenuItem/index.js +11 -0
  106. package/build/widgets/ContextMenu/ContextMenuItemsGroup/index.js +44 -0
  107. package/build/widgets/ContextMenu/index.js +11 -0
  108. package/build/widgets/InfoCard/index.js +12 -0
  109. package/build/widgets/Instructions/index.js +33 -0
  110. package/build/widgets/ProgressBar/index.js +12 -0
  111. package/build/widgets/index.js +65 -0
  112. package/package.json +45 -58
  113. package/styles/all.scss +3 -3
  114. package/styles/config.scss +1 -0
  115. package/styles/utils/colors.scss +1 -1
  116. package/styles/utils/theme.scss +0 -2
  117. package/.eslintrc +0 -19
  118. package/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -84
  119. package/cjs/_virtual/index.js +0 -7
  120. package/cjs/_virtual/index2.js +0 -7
  121. package/cjs/_virtual/index3.js +0 -7
  122. package/cjs/_virtual/index4.js +0 -7
  123. package/cjs/_virtual/index5.js +0 -7
  124. package/cjs/_virtual/react-dom.development.js +0 -7
  125. package/cjs/_virtual/react-dom.production.js +0 -7
  126. package/cjs/_virtual/react-is.development.js +0 -7
  127. package/cjs/_virtual/react-is.development2.js +0 -7
  128. package/cjs/_virtual/react-is.production.min.js +0 -7
  129. package/cjs/_virtual/react-is.production.min2.js +0 -7
  130. package/cjs/_virtual/react.development.js +0 -7
  131. package/cjs/_virtual/react.production.js +0 -7
  132. package/cjs/components/data/Alert/Alert.js +0 -81
  133. package/cjs/components/data/Alert/Alert.styled.js +0 -72
  134. package/cjs/components/data/Alert/data/Alert/index.js +0 -9
  135. package/cjs/components/data/Badge/Badge.js +0 -93
  136. package/cjs/components/data/Badge/Badge.styled.js +0 -156
  137. package/cjs/components/data/Badge/data/Badge/index.js +0 -9
  138. package/cjs/components/data/Popover/Popover.js +0 -102
  139. package/cjs/components/data/Popover/Popover.styled.js +0 -159
  140. package/cjs/components/data/Popover/data/Popover/index.js +0 -9
  141. package/cjs/components/data/Tab/Tab.js +0 -31
  142. package/cjs/components/data/Tab/Tab.styled.js +0 -22
  143. package/cjs/components/data/Tab/data/Tab/index.js +0 -9
  144. package/cjs/components/data/Tabs/Tabs.js +0 -91
  145. package/cjs/components/data/Tabs/Tabs.styled.js +0 -97
  146. package/cjs/components/data/Tabs/data/Tabs/index.js +0 -9
  147. package/cjs/components/data/Tooltip/Tooltip.js +0 -50
  148. package/cjs/components/data/Tooltip/Tooltip.styled.js +0 -38
  149. package/cjs/components/data/Tooltip/data/Tooltip/index.js +0 -9
  150. package/cjs/components/data/VerificationStatusIcon/VerificationStatusIcon.js +0 -42
  151. package/cjs/components/data/VerificationStatusIcon/VerificationStatusIcon.styled.js +0 -79
  152. package/cjs/components/data/data/index.js +0 -21
  153. package/cjs/components/inputs/ActionButton/ActionButton.js +0 -42
  154. package/cjs/components/inputs/ActionButton/ActionButton.styled.js +0 -66
  155. package/cjs/components/inputs/ActionButton/inputs/ActionButton/index.js +0 -9
  156. package/cjs/components/inputs/Button/Button.js +0 -188
  157. package/cjs/components/inputs/Button/Button.styled.js +0 -294
  158. package/cjs/components/inputs/Button/inputs/Button/index.js +0 -9
  159. package/cjs/components/inputs/Checkbox/Checkbox.js +0 -102
  160. package/cjs/components/inputs/Checkbox/Checkbox.styled.js +0 -145
  161. package/cjs/components/inputs/Checkbox/inputs/Checkbox/index.js +0 -9
  162. package/cjs/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.js +0 -268
  163. package/cjs/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.js +0 -352
  164. package/cjs/components/inputs/CompactAutocompleteSelect/inputs/CompactAutocompleteSelect/index.js +0 -9
  165. package/cjs/components/inputs/CompactStarRating/CompactStarRating.js +0 -178
  166. package/cjs/components/inputs/CompactStarRating/CompactStarRating.styled.js +0 -258
  167. package/cjs/components/inputs/CompactStarRating/inputs/CompactStarRating/index.js +0 -9
  168. package/cjs/components/inputs/CompactTextInput/CompactTextInput.js +0 -187
  169. package/cjs/components/inputs/CompactTextInput/CompactTextInput.styled.js +0 -352
  170. package/cjs/components/inputs/CompactTextInput/inputs/CompactTextInput/index.js +0 -9
  171. package/cjs/components/inputs/MultiLevelCheckbox/MultiLevelCheckbox.js +0 -253
  172. package/cjs/components/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.js +0 -89
  173. package/cjs/components/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.js +0 -185
  174. package/cjs/components/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.js +0 -122
  175. package/cjs/components/inputs/MultiSelect/MultiSelect.js +0 -251
  176. package/cjs/components/inputs/MultiSelect/MultiSelect.styled.js +0 -279
  177. package/cjs/components/inputs/MultiSelect/inputs/MultiSelect/index.js +0 -9
  178. package/cjs/components/inputs/Radio/Radio.js +0 -67
  179. package/cjs/components/inputs/Radio/Radio.styled.js +0 -93
  180. package/cjs/components/inputs/Radio/inputs/Radio/index.js +0 -9
  181. package/cjs/components/inputs/Switch/Switch.js +0 -69
  182. package/cjs/components/inputs/Switch/Switch.styled.js +0 -123
  183. package/cjs/components/inputs/Switch/inputs/Switch/index.js +0 -9
  184. package/cjs/components/inputs/TextArea/TextArea.js +0 -186
  185. package/cjs/components/inputs/TextArea/TextArea.styled.js +0 -455
  186. package/cjs/components/inputs/TextArea/inputs/TextArea/index.js +0 -9
  187. package/cjs/components/inputs/TextInput/TextInput.js +0 -147
  188. package/cjs/components/inputs/TextInput/TextInput.styled.js +0 -276
  189. package/cjs/components/inputs/TextInput/inputs/TextInput/index.js +0 -9
  190. package/cjs/components/inputs/inputs/index.js +0 -33
  191. package/cjs/components/layout/InputGroup/InputGroup.js +0 -26
  192. package/cjs/components/layout/InputGroup/InputGroup.styled.js +0 -18
  193. package/cjs/components/layout/InputGroup/layout/InputGroup/index.js +0 -9
  194. package/cjs/components/layout/SectionSeparator/SectionSeparator.js +0 -29
  195. package/cjs/components/layout/SectionSeparator/SectionSeparator.styled.js +0 -21
  196. package/cjs/components/layout/SectionSeparator/layout/SectionSeparator/index.js +0 -9
  197. package/cjs/components/layout/layout/index.js +0 -11
  198. package/cjs/components/widgets/AssetAction/AssetAction.js +0 -106
  199. package/cjs/components/widgets/AssetAction/AssetAction.styled.js +0 -58
  200. package/cjs/components/widgets/AssetActionsBase/AssetActionsBase.js +0 -35
  201. package/cjs/components/widgets/AssetActionsBase/AssetActionsBase.styled.js +0 -24
  202. package/cjs/components/widgets/AssetGallery/AssetGallery.js +0 -102
  203. package/cjs/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.js +0 -392
  204. package/cjs/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.js +0 -43
  205. package/cjs/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js +0 -402
  206. package/cjs/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js +0 -338
  207. package/cjs/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js +0 -396
  208. package/cjs/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js +0 -328
  209. package/cjs/components/widgets/AssetGallery/asset.propType.js +0 -58
  210. package/cjs/components/widgets/AssetGallery/widgets/AssetGallery/index.js +0 -9
  211. package/cjs/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.js +0 -50
  212. package/cjs/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.js +0 -96
  213. package/cjs/components/widgets/AssetPreview/AssetPreviewTopBar/widgets/AssetPreview/AssetPreviewTopBar/index.js +0 -9
  214. package/cjs/components/widgets/ContextMenu/ContextMenu.js +0 -28
  215. package/cjs/components/widgets/ContextMenu/ContextMenu.styled.js +0 -19
  216. package/cjs/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.js +0 -50
  217. package/cjs/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.js +0 -93
  218. package/cjs/components/widgets/ContextMenu/ContextMenuItem/widgets/ContextMenu/ContextMenuItem/index.js +0 -9
  219. package/cjs/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.js +0 -28
  220. package/cjs/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.js +0 -30
  221. package/cjs/components/widgets/ContextMenu/ContextMenuItemsGroup/widgets/ContextMenu/ContextMenuItemsGroup/index.js +0 -9
  222. package/cjs/components/widgets/ContextMenu/widgets/ContextMenu/index.js +0 -9
  223. package/cjs/components/widgets/InfoCard/InfoCard.js +0 -39
  224. package/cjs/components/widgets/InfoCard/InfoCard.styled.js +0 -110
  225. package/cjs/components/widgets/InfoCard/widgets/InfoCard/index.js +0 -9
  226. package/cjs/components/widgets/Instructions/Instructions.js +0 -217
  227. package/cjs/components/widgets/Instructions/Instructions.styled.js +0 -47
  228. package/cjs/components/widgets/Instructions/widgets/Instructions/index.js +0 -9
  229. package/cjs/components/widgets/ProgressBar/ProgressBar.js +0 -58
  230. package/cjs/components/widgets/ProgressBar/ProgressBar.styled.js +0 -154
  231. package/cjs/components/widgets/ProgressBar/widgets/ProgressBar/index.js +0 -9
  232. package/cjs/components/widgets/SummaryCard/SummaryCard.js +0 -92
  233. package/cjs/components/widgets/SummaryCard/SummaryCard.styled.js +0 -142
  234. package/cjs/components/widgets/widgets/index.js +0 -25
  235. package/cjs/hooks/useEventListner.js +0 -26
  236. package/cjs/hooks/useIsomorphicLayoutEffect.js +0 -11
  237. package/cjs/hooks/useOnClickOutside.js +0 -17
  238. package/cjs/icons/arrow-back.svg.js +0 -20
  239. package/cjs/icons/arrow-forward.svg.js +0 -20
  240. package/cjs/icons/check-rectangle-filled.svg.js +0 -20
  241. package/cjs/icons/close.svg.js +0 -20
  242. package/cjs/icons/edit-note.svg.js +0 -20
  243. package/cjs/icons/expand-more.svg.js +0 -20
  244. package/cjs/icons/headset.svg.js +0 -20
  245. package/cjs/icons/layers.svg.js +0 -20
  246. package/cjs/icons/link.svg.js +0 -20
  247. package/cjs/icons/play.svg.js +0 -20
  248. package/cjs/icons/search.svg.js +0 -20
  249. package/cjs/icons/star-filled.svg.js +0 -20
  250. package/cjs/icons/star.svg.js +0 -20
  251. package/cjs/icons/triangle-right.svg.js +0 -20
  252. package/cjs/icons/verification.svg.js +0 -20
  253. package/cjs/icons/warning-circle.svg.js +0 -20
  254. package/cjs/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +0 -11
  255. package/cjs/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js +0 -9
  256. package/cjs/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js +0 -11
  257. package/cjs/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +0 -10
  258. package/cjs/node_modules/@babel/runtime/helpers/esm/classCallCheck.js +0 -9
  259. package/cjs/node_modules/@babel/runtime/helpers/esm/createClass.js +0 -19
  260. package/cjs/node_modules/@babel/runtime/helpers/esm/createSuper.js +0 -22
  261. package/cjs/node_modules/@babel/runtime/helpers/esm/defineProperty.js +0 -16
  262. package/cjs/node_modules/@babel/runtime/helpers/esm/extends.js +0 -15
  263. package/cjs/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js +0 -11
  264. package/cjs/node_modules/@babel/runtime/helpers/esm/inherits.js +0 -20
  265. package/cjs/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js +0 -14
  266. package/cjs/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +0 -9
  267. package/cjs/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +0 -33
  268. package/cjs/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js +0 -9
  269. package/cjs/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js +0 -9
  270. package/cjs/node_modules/@babel/runtime/helpers/esm/objectSpread2.js +0 -29
  271. package/cjs/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +0 -19
  272. package/cjs/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +0 -15
  273. package/cjs/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js +0 -14
  274. package/cjs/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +0 -11
  275. package/cjs/node_modules/@babel/runtime/helpers/esm/slicedToArray.js +0 -14
  276. package/cjs/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js +0 -13
  277. package/cjs/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +0 -14
  278. package/cjs/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +0 -18
  279. package/cjs/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +0 -13
  280. package/cjs/node_modules/@babel/runtime/helpers/esm/typeof.js +0 -15
  281. package/cjs/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +0 -15
  282. package/cjs/node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js +0 -445
  283. package/cjs/node_modules/@emotion/hash/dist/emotion-hash.esm.js +0 -59
  284. package/cjs/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js +0 -13
  285. package/cjs/node_modules/@emotion/react/dist/emotion-element-f0de968e.browser.esm.js +0 -116
  286. package/cjs/node_modules/@emotion/react/dist/emotion-react.browser.esm.js +0 -63
  287. package/cjs/node_modules/@emotion/serialize/dist/emotion-serialize.esm.js +0 -240
  288. package/cjs/node_modules/@emotion/sheet/dist/emotion-sheet.esm.js +0 -144
  289. package/cjs/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js +0 -56
  290. package/cjs/node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js +0 -14
  291. package/cjs/node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js +0 -51
  292. package/cjs/node_modules/@floating-ui/core/dist/floating-ui.core.mjs.js +0 -907
  293. package/cjs/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs.js +0 -374
  294. package/cjs/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs.js +0 -128
  295. package/cjs/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs.js +0 -165
  296. package/cjs/node_modules/@restart/hooks/esm/useMergedRefs.js +0 -46
  297. package/cjs/node_modules/@restart/hooks/esm/useUpdateEffect.js +0 -41
  298. package/cjs/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +0 -24
  299. package/cjs/node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js +0 -186
  300. package/cjs/node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js +0 -22
  301. package/cjs/node_modules/hoist-non-react-statics/node_modules/react-is/index.js +0 -13
  302. package/cjs/node_modules/memoize-one/dist/memoize-one.esm.js +0 -55
  303. package/cjs/node_modules/object-assign/index.js +0 -94
  304. package/cjs/node_modules/prop-types/checkPropTypes.js +0 -110
  305. package/cjs/node_modules/prop-types/factoryWithThrowingShims.js +0 -69
  306. package/cjs/node_modules/prop-types/factoryWithTypeCheckers.js +0 -621
  307. package/cjs/node_modules/prop-types/index.js +0 -33
  308. package/cjs/node_modules/prop-types/lib/ReactPropTypesSecret.js +0 -16
  309. package/cjs/node_modules/prop-types/lib/has.js +0 -7
  310. package/cjs/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +0 -186
  311. package/cjs/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +0 -22
  312. package/cjs/node_modules/prop-types/node_modules/react-is/index.js +0 -13
  313. package/cjs/node_modules/react/cjs/react.development.js +0 -1246
  314. package/cjs/node_modules/react/cjs/react.production.js +0 -552
  315. package/cjs/node_modules/react/index.js +0 -19
  316. package/cjs/node_modules/react-dom/cjs/react-dom.development.js +0 -432
  317. package/cjs/node_modules/react-dom/cjs/react-dom.production.js +0 -218
  318. package/cjs/node_modules/react-dom/index.js +0 -44
  319. package/cjs/node_modules/react-lazy-load-image-component/src/effects/opacity.css.js +0 -6
  320. package/cjs/node_modules/react-select/creatable/dist/react-select-creatable.esm.js +0 -23
  321. package/cjs/node_modules/react-select/dist/Select-aab027f3.esm.js +0 -2653
  322. package/cjs/node_modules/react-select/dist/index-641ee5b8.esm.js +0 -1426
  323. package/cjs/node_modules/react-select/dist/useCreatable-84008237.esm.js +0 -101
  324. package/cjs/node_modules/react-select/dist/useStateManager-7e1e8489.esm.js +0 -78
  325. package/cjs/node_modules/style-inject/dist/style-inject.es.js +0 -32
  326. package/cjs/node_modules/stylis/src/Enum.js +0 -24
  327. package/cjs/node_modules/stylis/src/Middleware.js +0 -37
  328. package/cjs/node_modules/stylis/src/Parser.js +0 -201
  329. package/cjs/node_modules/stylis/src/Serializer.js +0 -43
  330. package/cjs/node_modules/stylis/src/Tokenizer.js +0 -243
  331. package/cjs/node_modules/stylis/src/Utility.js +0 -134
  332. package/cjs/node_modules/tippy.js/animations/shift-away-subtle.css.js +0 -6
  333. package/cjs/node_modules/tippy.js/dist/tippy.css.js +0 -6
  334. package/cjs/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js +0 -10
  335. package/cjs/styles/utils/colors.scss.js +0 -11
  336. package/cjs/utils/dateTime.js +0 -20
  337. package/cjs/utils/defaultTheme.js +0 -52
  338. package/doctor-storybook.log +0 -20
  339. package/esm/_virtual/_rollupPluginBabelHelpers.js +0 -74
  340. package/esm/_virtual/index.js +0 -3
  341. package/esm/_virtual/index2.js +0 -3
  342. package/esm/_virtual/index3.js +0 -3
  343. package/esm/_virtual/index4.js +0 -3
  344. package/esm/_virtual/index5.js +0 -3
  345. package/esm/_virtual/react-dom.development.js +0 -3
  346. package/esm/_virtual/react-dom.production.js +0 -3
  347. package/esm/_virtual/react-is.development.js +0 -3
  348. package/esm/_virtual/react-is.development2.js +0 -3
  349. package/esm/_virtual/react-is.production.min.js +0 -3
  350. package/esm/_virtual/react-is.production.min2.js +0 -3
  351. package/esm/_virtual/react.development.js +0 -3
  352. package/esm/_virtual/react.production.js +0 -3
  353. package/esm/components/data/Alert/Alert.js +0 -77
  354. package/esm/components/data/Alert/Alert.styled.js +0 -63
  355. package/esm/components/data/Alert/data/Alert/index.js +0 -1
  356. package/esm/components/data/Badge/Badge.js +0 -89
  357. package/esm/components/data/Badge/Badge.styled.js +0 -145
  358. package/esm/components/data/Badge/data/Badge/index.js +0 -1
  359. package/esm/components/data/Popover/Popover.js +0 -94
  360. package/esm/components/data/Popover/Popover.styled.js +0 -150
  361. package/esm/components/data/Popover/data/Popover/index.js +0 -1
  362. package/esm/components/data/Tab/Tab.js +0 -27
  363. package/esm/components/data/Tab/Tab.styled.js +0 -14
  364. package/esm/components/data/Tab/data/Tab/index.js +0 -1
  365. package/esm/components/data/Tabs/Tabs.js +0 -87
  366. package/esm/components/data/Tabs/Tabs.styled.js +0 -85
  367. package/esm/components/data/Tabs/data/Tabs/index.js +0 -1
  368. package/esm/components/data/Tooltip/Tooltip.js +0 -46
  369. package/esm/components/data/Tooltip/Tooltip.styled.js +0 -29
  370. package/esm/components/data/Tooltip/data/Tooltip/index.js +0 -1
  371. package/esm/components/data/VerificationStatusIcon/VerificationStatusIcon.js +0 -38
  372. package/esm/components/data/VerificationStatusIcon/VerificationStatusIcon.styled.js +0 -69
  373. package/esm/components/data/data/index.js +0 -7
  374. package/esm/components/inputs/ActionButton/ActionButton.js +0 -38
  375. package/esm/components/inputs/ActionButton/ActionButton.styled.js +0 -58
  376. package/esm/components/inputs/ActionButton/inputs/ActionButton/index.js +0 -1
  377. package/esm/components/inputs/Button/Button.js +0 -184
  378. package/esm/components/inputs/Button/Button.styled.js +0 -277
  379. package/esm/components/inputs/Button/inputs/Button/index.js +0 -1
  380. package/esm/components/inputs/Checkbox/Checkbox.js +0 -98
  381. package/esm/components/inputs/Checkbox/Checkbox.styled.js +0 -132
  382. package/esm/components/inputs/Checkbox/inputs/Checkbox/index.js +0 -1
  383. package/esm/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.js +0 -264
  384. package/esm/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.js +0 -324
  385. package/esm/components/inputs/CompactAutocompleteSelect/inputs/CompactAutocompleteSelect/index.js +0 -1
  386. package/esm/components/inputs/CompactStarRating/CompactStarRating.js +0 -174
  387. package/esm/components/inputs/CompactStarRating/CompactStarRating.styled.js +0 -245
  388. package/esm/components/inputs/CompactStarRating/inputs/CompactStarRating/index.js +0 -1
  389. package/esm/components/inputs/CompactTextInput/CompactTextInput.js +0 -183
  390. package/esm/components/inputs/CompactTextInput/CompactTextInput.styled.js +0 -335
  391. package/esm/components/inputs/CompactTextInput/inputs/CompactTextInput/index.js +0 -1
  392. package/esm/components/inputs/MultiLevelCheckbox/MultiLevelCheckbox.js +0 -247
  393. package/esm/components/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.js +0 -75
  394. package/esm/components/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.js +0 -181
  395. package/esm/components/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.js +0 -104
  396. package/esm/components/inputs/MultiSelect/MultiSelect.js +0 -247
  397. package/esm/components/inputs/MultiSelect/MultiSelect.styled.js +0 -251
  398. package/esm/components/inputs/MultiSelect/inputs/MultiSelect/index.js +0 -1
  399. package/esm/components/inputs/Radio/Radio.js +0 -63
  400. package/esm/components/inputs/Radio/Radio.styled.js +0 -84
  401. package/esm/components/inputs/Radio/inputs/Radio/index.js +0 -1
  402. package/esm/components/inputs/Switch/Switch.js +0 -65
  403. package/esm/components/inputs/Switch/Switch.styled.js +0 -110
  404. package/esm/components/inputs/Switch/inputs/Switch/index.js +0 -1
  405. package/esm/components/inputs/TextArea/TextArea.js +0 -182
  406. package/esm/components/inputs/TextArea/TextArea.styled.js +0 -437
  407. package/esm/components/inputs/TextArea/inputs/TextArea/index.js +0 -1
  408. package/esm/components/inputs/TextInput/TextInput.js +0 -143
  409. package/esm/components/inputs/TextInput/TextInput.styled.js +0 -261
  410. package/esm/components/inputs/TextInput/inputs/TextInput/index.js +0 -1
  411. package/esm/components/inputs/inputs/index.js +0 -13
  412. package/esm/components/layout/InputGroup/InputGroup.js +0 -22
  413. package/esm/components/layout/InputGroup/InputGroup.styled.js +0 -10
  414. package/esm/components/layout/InputGroup/layout/InputGroup/index.js +0 -1
  415. package/esm/components/layout/SectionSeparator/SectionSeparator.js +0 -25
  416. package/esm/components/layout/SectionSeparator/SectionSeparator.styled.js +0 -13
  417. package/esm/components/layout/SectionSeparator/layout/SectionSeparator/index.js +0 -1
  418. package/esm/components/layout/layout/index.js +0 -2
  419. package/esm/components/widgets/AssetAction/AssetAction.js +0 -102
  420. package/esm/components/widgets/AssetAction/AssetAction.styled.js +0 -46
  421. package/esm/components/widgets/AssetActionsBase/AssetActionsBase.js +0 -31
  422. package/esm/components/widgets/AssetActionsBase/AssetActionsBase.styled.js +0 -16
  423. package/esm/components/widgets/AssetGallery/AssetGallery.js +0 -98
  424. package/esm/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.js +0 -384
  425. package/esm/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.js +0 -33
  426. package/esm/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js +0 -398
  427. package/esm/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js +0 -311
  428. package/esm/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js +0 -392
  429. package/esm/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js +0 -302
  430. package/esm/components/widgets/AssetGallery/asset.propType.js +0 -53
  431. package/esm/components/widgets/AssetGallery/widgets/AssetGallery/index.js +0 -1
  432. package/esm/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.js +0 -46
  433. package/esm/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.js +0 -84
  434. package/esm/components/widgets/AssetPreview/AssetPreviewTopBar/widgets/AssetPreview/AssetPreviewTopBar/index.js +0 -1
  435. package/esm/components/widgets/ContextMenu/ContextMenu.js +0 -24
  436. package/esm/components/widgets/ContextMenu/ContextMenu.styled.js +0 -11
  437. package/esm/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.js +0 -46
  438. package/esm/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.js +0 -83
  439. package/esm/components/widgets/ContextMenu/ContextMenuItem/widgets/ContextMenu/ContextMenuItem/index.js +0 -1
  440. package/esm/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.js +0 -24
  441. package/esm/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.js +0 -22
  442. package/esm/components/widgets/ContextMenu/ContextMenuItemsGroup/widgets/ContextMenu/ContextMenuItemsGroup/index.js +0 -1
  443. package/esm/components/widgets/ContextMenu/widgets/ContextMenu/index.js +0 -1
  444. package/esm/components/widgets/InfoCard/InfoCard.js +0 -35
  445. package/esm/components/widgets/InfoCard/InfoCard.styled.js +0 -94
  446. package/esm/components/widgets/InfoCard/widgets/InfoCard/index.js +0 -1
  447. package/esm/components/widgets/Instructions/Instructions.js +0 -213
  448. package/esm/components/widgets/Instructions/Instructions.styled.js +0 -36
  449. package/esm/components/widgets/Instructions/widgets/Instructions/index.js +0 -1
  450. package/esm/components/widgets/ProgressBar/ProgressBar.js +0 -54
  451. package/esm/components/widgets/ProgressBar/ProgressBar.styled.js +0 -137
  452. package/esm/components/widgets/ProgressBar/widgets/ProgressBar/index.js +0 -1
  453. package/esm/components/widgets/SummaryCard/SummaryCard.js +0 -88
  454. package/esm/components/widgets/SummaryCard/SummaryCard.styled.js +0 -124
  455. package/esm/components/widgets/widgets/index.js +0 -9
  456. package/esm/hooks/useEventListner.js +0 -22
  457. package/esm/hooks/useIsomorphicLayoutEffect.js +0 -7
  458. package/esm/hooks/useOnClickOutside.js +0 -13
  459. package/esm/icons/arrow-back.svg.js +0 -16
  460. package/esm/icons/arrow-forward.svg.js +0 -16
  461. package/esm/icons/check-rectangle-filled.svg.js +0 -16
  462. package/esm/icons/close.svg.js +0 -16
  463. package/esm/icons/edit-note.svg.js +0 -16
  464. package/esm/icons/expand-more.svg.js +0 -16
  465. package/esm/icons/headset.svg.js +0 -16
  466. package/esm/icons/layers.svg.js +0 -16
  467. package/esm/icons/link.svg.js +0 -16
  468. package/esm/icons/play.svg.js +0 -16
  469. package/esm/icons/search.svg.js +0 -16
  470. package/esm/icons/star-filled.svg.js +0 -16
  471. package/esm/icons/star.svg.js +0 -16
  472. package/esm/icons/triangle-right.svg.js +0 -16
  473. package/esm/icons/verification.svg.js +0 -16
  474. package/esm/icons/warning-circle.svg.js +0 -16
  475. package/esm/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +0 -7
  476. package/esm/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js +0 -5
  477. package/esm/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js +0 -7
  478. package/esm/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +0 -6
  479. package/esm/node_modules/@babel/runtime/helpers/esm/classCallCheck.js +0 -5
  480. package/esm/node_modules/@babel/runtime/helpers/esm/createClass.js +0 -15
  481. package/esm/node_modules/@babel/runtime/helpers/esm/createSuper.js +0 -18
  482. package/esm/node_modules/@babel/runtime/helpers/esm/defineProperty.js +0 -12
  483. package/esm/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js +0 -7
  484. package/esm/node_modules/@babel/runtime/helpers/esm/inherits.js +0 -16
  485. package/esm/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js +0 -10
  486. package/esm/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +0 -5
  487. package/esm/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +0 -29
  488. package/esm/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js +0 -5
  489. package/esm/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js +0 -5
  490. package/esm/node_modules/@babel/runtime/helpers/esm/objectSpread2.js +0 -25
  491. package/esm/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +0 -15
  492. package/esm/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +0 -11
  493. package/esm/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js +0 -10
  494. package/esm/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +0 -7
  495. package/esm/node_modules/@babel/runtime/helpers/esm/slicedToArray.js +0 -10
  496. package/esm/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js +0 -9
  497. package/esm/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +0 -10
  498. package/esm/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +0 -14
  499. package/esm/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +0 -9
  500. package/esm/node_modules/@babel/runtime/helpers/esm/typeof.js +0 -11
  501. package/esm/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +0 -11
  502. package/esm/node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js +0 -441
  503. package/esm/node_modules/@emotion/hash/dist/emotion-hash.esm.js +0 -55
  504. package/esm/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js +0 -9
  505. package/esm/node_modules/@emotion/react/dist/emotion-element-f0de968e.browser.esm.js +0 -107
  506. package/esm/node_modules/@emotion/react/dist/emotion-react.browser.esm.js +0 -56
  507. package/esm/node_modules/@emotion/serialize/dist/emotion-serialize.esm.js +0 -236
  508. package/esm/node_modules/@emotion/sheet/dist/emotion-sheet.esm.js +0 -140
  509. package/esm/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js +0 -52
  510. package/esm/node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js +0 -10
  511. package/esm/node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js +0 -45
  512. package/esm/node_modules/@floating-ui/core/dist/floating-ui.core.mjs.js +0 -894
  513. package/esm/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs.js +0 -370
  514. package/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs.js +0 -110
  515. package/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs.js +0 -138
  516. package/esm/node_modules/@restart/hooks/esm/useMergedRefs.js +0 -41
  517. package/esm/node_modules/@restart/hooks/esm/useUpdateEffect.js +0 -37
  518. package/esm/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +0 -22
  519. package/esm/node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js +0 -181
  520. package/esm/node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js +0 -17
  521. package/esm/node_modules/hoist-non-react-statics/node_modules/react-is/index.js +0 -11
  522. package/esm/node_modules/memoize-one/dist/memoize-one.esm.js +0 -51
  523. package/esm/node_modules/object-assign/index.js +0 -90
  524. package/esm/node_modules/prop-types/checkPropTypes.js +0 -106
  525. package/esm/node_modules/prop-types/factoryWithThrowingShims.js +0 -65
  526. package/esm/node_modules/prop-types/index.js +0 -29
  527. package/esm/node_modules/prop-types/lib/ReactPropTypesSecret.js +0 -12
  528. package/esm/node_modules/prop-types/lib/has.js +0 -3
  529. package/esm/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +0 -181
  530. package/esm/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +0 -17
  531. package/esm/node_modules/prop-types/node_modules/react-is/index.js +0 -11
  532. package/esm/node_modules/react/cjs/react.development.js +0 -1244
  533. package/esm/node_modules/react/cjs/react.production.js +0 -547
  534. package/esm/node_modules/react/index.js +0 -15
  535. package/esm/node_modules/react-dom/cjs/react-dom.development.js +0 -427
  536. package/esm/node_modules/react-dom/cjs/react-dom.production.js +0 -213
  537. package/esm/node_modules/react-dom/index.js +0 -42
  538. package/esm/node_modules/react-lazy-load-image-component/src/effects/opacity.css.js +0 -4
  539. package/esm/node_modules/react-select/creatable/dist/react-select-creatable.esm.js +0 -19
  540. package/esm/node_modules/react-select/dist/Select-aab027f3.esm.js +0 -2644
  541. package/esm/node_modules/react-select/dist/index-641ee5b8.esm.js +0 -1385
  542. package/esm/node_modules/react-select/dist/useCreatable-84008237.esm.js +0 -97
  543. package/esm/node_modules/react-select/dist/useStateManager-7e1e8489.esm.js +0 -74
  544. package/esm/node_modules/style-inject/dist/style-inject.es.js +0 -28
  545. package/esm/node_modules/stylis/src/Enum.js +0 -12
  546. package/esm/node_modules/stylis/src/Middleware.js +0 -32
  547. package/esm/node_modules/stylis/src/Parser.js +0 -193
  548. package/esm/node_modules/stylis/src/Serializer.js +0 -38
  549. package/esm/node_modules/stylis/src/Tokenizer.js +0 -223
  550. package/esm/node_modules/stylis/src/Utility.js +0 -117
  551. package/esm/node_modules/tippy.js/animations/shift-away-subtle.css.js +0 -4
  552. package/esm/node_modules/tippy.js/dist/tippy.css.js +0 -4
  553. package/esm/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js +0 -6
  554. package/esm/ssr/ssr/index.js +0 -1
  555. package/esm/styles/utils/colors.scss.js +0 -7
  556. package/esm/utils/dateTime.js +0 -16
  557. package/esm/utils/defaultTheme.js +0 -47
  558. package/migration-storybook.log +0 -392
  559. /package/{cjs/ssr → build}/ssr/index.js +0 -0
@@ -1,894 +0,0 @@
1
- import { evaluate, getPaddingObject, getAlignmentAxis, min, clamp, getAlignment, placements, getAlignmentSides, getSide, getSideAxis, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, rectToClientRect, max, getAxisLength, getOppositeAlignmentPlacement, sides, getOppositeAxis } from '../../utils/dist/floating-ui.utils.mjs.js';
2
- export { rectToClientRect } from '../../utils/dist/floating-ui.utils.mjs.js';
3
-
4
- /**
5
- * Resolves with an object of overflow side offsets that determine how much the
6
- * element is overflowing a given clipping boundary on each side.
7
- * - positive = overflowing the boundary by that number of pixels
8
- * - negative = how many pixels left before it will overflow
9
- * - 0 = lies flush with the boundary
10
- * @see https://floating-ui.com/docs/detectOverflow
11
- */
12
- async function detectOverflow(state, options) {
13
- var _await$platform$isEle;
14
- if (options === void 0) {
15
- options = {};
16
- }
17
- const {
18
- x,
19
- y,
20
- platform,
21
- rects,
22
- elements,
23
- strategy
24
- } = state;
25
- const {
26
- boundary = 'clippingAncestors',
27
- rootBoundary = 'viewport',
28
- elementContext = 'floating',
29
- altBoundary = false,
30
- padding = 0
31
- } = evaluate(options, state);
32
- const paddingObject = getPaddingObject(padding);
33
- const altContext = elementContext === 'floating' ? 'reference' : 'floating';
34
- const element = elements[altBoundary ? altContext : elementContext];
35
- const clippingClientRect = rectToClientRect(await platform.getClippingRect({
36
- 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))),
37
- boundary,
38
- rootBoundary,
39
- strategy
40
- }));
41
- const rect = elementContext === 'floating' ? {
42
- x,
43
- y,
44
- width: rects.floating.width,
45
- height: rects.floating.height
46
- } : rects.reference;
47
- const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
48
- const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
49
- x: 1,
50
- y: 1
51
- } : {
52
- x: 1,
53
- y: 1
54
- };
55
- const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
56
- elements,
57
- rect,
58
- offsetParent,
59
- strategy
60
- }) : rect);
61
- return {
62
- top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
63
- bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
64
- left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
65
- right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
66
- };
67
- }
68
-
69
- /**
70
- * Provides data to position an inner element of the floating element so that it
71
- * appears centered to the reference element.
72
- * @see https://floating-ui.com/docs/arrow
73
- */
74
- const arrow = options => ({
75
- name: 'arrow',
76
- options,
77
- async fn(state) {
78
- const {
79
- x,
80
- y,
81
- placement,
82
- rects,
83
- platform,
84
- elements,
85
- middlewareData
86
- } = state;
87
- // Since `element` is required, we don't Partial<> the type.
88
- const {
89
- element,
90
- padding = 0
91
- } = evaluate(options, state) || {};
92
- if (element == null) {
93
- return {};
94
- }
95
- const paddingObject = getPaddingObject(padding);
96
- const coords = {
97
- x,
98
- y
99
- };
100
- const axis = getAlignmentAxis(placement);
101
- const length = getAxisLength(axis);
102
- const arrowDimensions = await platform.getDimensions(element);
103
- const isYAxis = axis === 'y';
104
- const minProp = isYAxis ? 'top' : 'left';
105
- const maxProp = isYAxis ? 'bottom' : 'right';
106
- const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
107
- const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
108
- const startDiff = coords[axis] - rects.reference[axis];
109
- const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
110
- let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
111
-
112
- // DOM platform can return `window` as the `offsetParent`.
113
- if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
114
- clientSize = elements.floating[clientProp] || rects.floating[length];
115
- }
116
- const centerToReference = endDiff / 2 - startDiff / 2;
117
-
118
- // If the padding is large enough that it causes the arrow to no longer be
119
- // centered, modify the padding so that it is centered.
120
- const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
121
- const minPadding = min(paddingObject[minProp], largestPossiblePadding);
122
- const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
123
-
124
- // Make sure the arrow doesn't overflow the floating element if the center
125
- // point is outside the floating element's bounds.
126
- const min$1 = minPadding;
127
- const max = clientSize - arrowDimensions[length] - maxPadding;
128
- const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
129
- const offset = clamp(min$1, center, max);
130
-
131
- // If the reference is small enough that the arrow's padding causes it to
132
- // to point to nothing for an aligned placement, adjust the offset of the
133
- // floating element itself. To ensure `shift()` continues to take action,
134
- // a single reset is performed when this is true.
135
- const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
136
- const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
137
- return {
138
- [axis]: coords[axis] + alignmentOffset,
139
- data: {
140
- [axis]: offset,
141
- centerOffset: center - offset - alignmentOffset,
142
- ...(shouldAddOffset && {
143
- alignmentOffset
144
- })
145
- },
146
- reset: shouldAddOffset
147
- };
148
- }
149
- });
150
-
151
- function getPlacementList(alignment, autoAlignment, allowedPlacements) {
152
- const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);
153
- return allowedPlacementsSortedByAlignment.filter(placement => {
154
- if (alignment) {
155
- return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);
156
- }
157
- return true;
158
- });
159
- }
160
- /**
161
- * Optimizes the visibility of the floating element by choosing the placement
162
- * that has the most space available automatically, without needing to specify a
163
- * preferred placement. Alternative to `flip`.
164
- * @see https://floating-ui.com/docs/autoPlacement
165
- */
166
- const autoPlacement = function (options) {
167
- if (options === void 0) {
168
- options = {};
169
- }
170
- return {
171
- name: 'autoPlacement',
172
- options,
173
- async fn(state) {
174
- var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;
175
- const {
176
- rects,
177
- middlewareData,
178
- placement,
179
- platform,
180
- elements
181
- } = state;
182
- const {
183
- crossAxis = false,
184
- alignment,
185
- allowedPlacements = placements,
186
- autoAlignment = true,
187
- ...detectOverflowOptions
188
- } = evaluate(options, state);
189
- const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
190
- const overflow = await detectOverflow(state, detectOverflowOptions);
191
- const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
192
- const currentPlacement = placements$1[currentIndex];
193
- if (currentPlacement == null) {
194
- return {};
195
- }
196
- const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
197
-
198
- // Make `computeCoords` start from the right place.
199
- if (placement !== currentPlacement) {
200
- return {
201
- reset: {
202
- placement: placements$1[0]
203
- }
204
- };
205
- }
206
- const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];
207
- const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {
208
- placement: currentPlacement,
209
- overflows: currentOverflows
210
- }];
211
- const nextPlacement = placements$1[currentIndex + 1];
212
-
213
- // There are more placements to check.
214
- if (nextPlacement) {
215
- return {
216
- data: {
217
- index: currentIndex + 1,
218
- overflows: allOverflows
219
- },
220
- reset: {
221
- placement: nextPlacement
222
- }
223
- };
224
- }
225
- const placementsSortedByMostSpace = allOverflows.map(d => {
226
- const alignment = getAlignment(d.placement);
227
- return [d.placement, alignment && crossAxis ?
228
- // Check along the mainAxis and main crossAxis side.
229
- d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :
230
- // Check only the mainAxis.
231
- d.overflows[0], d.overflows];
232
- }).sort((a, b) => a[1] - b[1]);
233
- const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,
234
- // Aligned placements should not check their opposite crossAxis
235
- // side.
236
- getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));
237
- const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
238
- if (resetPlacement !== placement) {
239
- return {
240
- data: {
241
- index: currentIndex + 1,
242
- overflows: allOverflows
243
- },
244
- reset: {
245
- placement: resetPlacement
246
- }
247
- };
248
- }
249
- return {};
250
- }
251
- };
252
- };
253
-
254
- /**
255
- * Optimizes the visibility of the floating element by flipping the `placement`
256
- * in order to keep it in view when the preferred placement(s) will overflow the
257
- * clipping boundary. Alternative to `autoPlacement`.
258
- * @see https://floating-ui.com/docs/flip
259
- */
260
- const flip = function (options) {
261
- if (options === void 0) {
262
- options = {};
263
- }
264
- return {
265
- name: 'flip',
266
- options,
267
- async fn(state) {
268
- var _middlewareData$arrow, _middlewareData$flip;
269
- const {
270
- placement,
271
- middlewareData,
272
- rects,
273
- initialPlacement,
274
- platform,
275
- elements
276
- } = state;
277
- const {
278
- mainAxis: checkMainAxis = true,
279
- crossAxis: checkCrossAxis = true,
280
- fallbackPlacements: specifiedFallbackPlacements,
281
- fallbackStrategy = 'bestFit',
282
- fallbackAxisSideDirection = 'none',
283
- flipAlignment = true,
284
- ...detectOverflowOptions
285
- } = evaluate(options, state);
286
-
287
- // If a reset by the arrow was caused due to an alignment offset being
288
- // added, we should skip any logic now since `flip()` has already done its
289
- // work.
290
- // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
291
- if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
292
- return {};
293
- }
294
- const side = getSide(placement);
295
- const initialSideAxis = getSideAxis(initialPlacement);
296
- const isBasePlacement = getSide(initialPlacement) === initialPlacement;
297
- const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
298
- const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
299
- const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
300
- if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
301
- fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
302
- }
303
- const placements = [initialPlacement, ...fallbackPlacements];
304
- const overflow = await detectOverflow(state, detectOverflowOptions);
305
- const overflows = [];
306
- let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
307
- if (checkMainAxis) {
308
- overflows.push(overflow[side]);
309
- }
310
- if (checkCrossAxis) {
311
- const sides = getAlignmentSides(placement, rects, rtl);
312
- overflows.push(overflow[sides[0]], overflow[sides[1]]);
313
- }
314
- overflowsData = [...overflowsData, {
315
- placement,
316
- overflows
317
- }];
318
-
319
- // One or more sides is overflowing.
320
- if (!overflows.every(side => side <= 0)) {
321
- var _middlewareData$flip2, _overflowsData$filter;
322
- const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
323
- const nextPlacement = placements[nextIndex];
324
- if (nextPlacement) {
325
- // Try next placement and re-run the lifecycle.
326
- return {
327
- data: {
328
- index: nextIndex,
329
- overflows: overflowsData
330
- },
331
- reset: {
332
- placement: nextPlacement
333
- }
334
- };
335
- }
336
-
337
- // First, find the candidates that fit on the mainAxis side of overflow,
338
- // then find the placement that fits the best on the main crossAxis side.
339
- let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
340
-
341
- // Otherwise fallback.
342
- if (!resetPlacement) {
343
- switch (fallbackStrategy) {
344
- case 'bestFit':
345
- {
346
- var _overflowsData$filter2;
347
- const placement = (_overflowsData$filter2 = overflowsData.filter(d => {
348
- if (hasFallbackAxisSideDirection) {
349
- const currentSideAxis = getSideAxis(d.placement);
350
- return currentSideAxis === initialSideAxis ||
351
- // Create a bias to the `y` side axis due to horizontal
352
- // reading directions favoring greater width.
353
- currentSideAxis === 'y';
354
- }
355
- return true;
356
- }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
357
- if (placement) {
358
- resetPlacement = placement;
359
- }
360
- break;
361
- }
362
- case 'initialPlacement':
363
- resetPlacement = initialPlacement;
364
- break;
365
- }
366
- }
367
- if (placement !== resetPlacement) {
368
- return {
369
- reset: {
370
- placement: resetPlacement
371
- }
372
- };
373
- }
374
- }
375
- return {};
376
- }
377
- };
378
- };
379
-
380
- function getSideOffsets(overflow, rect) {
381
- return {
382
- top: overflow.top - rect.height,
383
- right: overflow.right - rect.width,
384
- bottom: overflow.bottom - rect.height,
385
- left: overflow.left - rect.width
386
- };
387
- }
388
- function isAnySideFullyClipped(overflow) {
389
- return sides.some(side => overflow[side] >= 0);
390
- }
391
- /**
392
- * Provides data to hide the floating element in applicable situations, such as
393
- * when it is not in the same clipping context as the reference element.
394
- * @see https://floating-ui.com/docs/hide
395
- */
396
- const hide = function (options) {
397
- if (options === void 0) {
398
- options = {};
399
- }
400
- return {
401
- name: 'hide',
402
- options,
403
- async fn(state) {
404
- const {
405
- rects
406
- } = state;
407
- const {
408
- strategy = 'referenceHidden',
409
- ...detectOverflowOptions
410
- } = evaluate(options, state);
411
- switch (strategy) {
412
- case 'referenceHidden':
413
- {
414
- const overflow = await detectOverflow(state, {
415
- ...detectOverflowOptions,
416
- elementContext: 'reference'
417
- });
418
- const offsets = getSideOffsets(overflow, rects.reference);
419
- return {
420
- data: {
421
- referenceHiddenOffsets: offsets,
422
- referenceHidden: isAnySideFullyClipped(offsets)
423
- }
424
- };
425
- }
426
- case 'escaped':
427
- {
428
- const overflow = await detectOverflow(state, {
429
- ...detectOverflowOptions,
430
- altBoundary: true
431
- });
432
- const offsets = getSideOffsets(overflow, rects.floating);
433
- return {
434
- data: {
435
- escapedOffsets: offsets,
436
- escaped: isAnySideFullyClipped(offsets)
437
- }
438
- };
439
- }
440
- default:
441
- {
442
- return {};
443
- }
444
- }
445
- }
446
- };
447
- };
448
-
449
- function getBoundingRect(rects) {
450
- const minX = min(...rects.map(rect => rect.left));
451
- const minY = min(...rects.map(rect => rect.top));
452
- const maxX = max(...rects.map(rect => rect.right));
453
- const maxY = max(...rects.map(rect => rect.bottom));
454
- return {
455
- x: minX,
456
- y: minY,
457
- width: maxX - minX,
458
- height: maxY - minY
459
- };
460
- }
461
- function getRectsByLine(rects) {
462
- const sortedRects = rects.slice().sort((a, b) => a.y - b.y);
463
- const groups = [];
464
- let prevRect = null;
465
- for (let i = 0; i < sortedRects.length; i++) {
466
- const rect = sortedRects[i];
467
- if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {
468
- groups.push([rect]);
469
- } else {
470
- groups[groups.length - 1].push(rect);
471
- }
472
- prevRect = rect;
473
- }
474
- return groups.map(rect => rectToClientRect(getBoundingRect(rect)));
475
- }
476
- /**
477
- * Provides improved positioning for inline reference elements that can span
478
- * over multiple lines, such as hyperlinks or range selections.
479
- * @see https://floating-ui.com/docs/inline
480
- */
481
- const inline = function (options) {
482
- if (options === void 0) {
483
- options = {};
484
- }
485
- return {
486
- name: 'inline',
487
- options,
488
- async fn(state) {
489
- const {
490
- placement,
491
- elements,
492
- rects,
493
- platform,
494
- strategy
495
- } = state;
496
- // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a
497
- // ClientRect's bounds, despite the event listener being triggered. A
498
- // padding of 2 seems to handle this issue.
499
- const {
500
- padding = 2,
501
- x,
502
- y
503
- } = evaluate(options, state);
504
- const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);
505
- const clientRects = getRectsByLine(nativeClientRects);
506
- const fallback = rectToClientRect(getBoundingRect(nativeClientRects));
507
- const paddingObject = getPaddingObject(padding);
508
- function getBoundingClientRect() {
509
- // There are two rects and they are disjoined.
510
- if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
511
- // Find the first rect in which the point is fully inside.
512
- return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;
513
- }
514
-
515
- // There are 2 or more connected rects.
516
- if (clientRects.length >= 2) {
517
- if (getSideAxis(placement) === 'y') {
518
- const firstRect = clientRects[0];
519
- const lastRect = clientRects[clientRects.length - 1];
520
- const isTop = getSide(placement) === 'top';
521
- const top = firstRect.top;
522
- const bottom = lastRect.bottom;
523
- const left = isTop ? firstRect.left : lastRect.left;
524
- const right = isTop ? firstRect.right : lastRect.right;
525
- const width = right - left;
526
- const height = bottom - top;
527
- return {
528
- top,
529
- bottom,
530
- left,
531
- right,
532
- width,
533
- height,
534
- x: left,
535
- y: top
536
- };
537
- }
538
- const isLeftSide = getSide(placement) === 'left';
539
- const maxRight = max(...clientRects.map(rect => rect.right));
540
- const minLeft = min(...clientRects.map(rect => rect.left));
541
- const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
542
- const top = measureRects[0].top;
543
- const bottom = measureRects[measureRects.length - 1].bottom;
544
- const left = minLeft;
545
- const right = maxRight;
546
- const width = right - left;
547
- const height = bottom - top;
548
- return {
549
- top,
550
- bottom,
551
- left,
552
- right,
553
- width,
554
- height,
555
- x: left,
556
- y: top
557
- };
558
- }
559
- return fallback;
560
- }
561
- const resetRects = await platform.getElementRects({
562
- reference: {
563
- getBoundingClientRect
564
- },
565
- floating: elements.floating,
566
- strategy
567
- });
568
- if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {
569
- return {
570
- reset: {
571
- rects: resetRects
572
- }
573
- };
574
- }
575
- return {};
576
- }
577
- };
578
- };
579
-
580
- // For type backwards-compatibility, the `OffsetOptions` type was also
581
- // Derivable.
582
-
583
- async function convertValueToCoords(state, options) {
584
- const {
585
- placement,
586
- platform,
587
- elements
588
- } = state;
589
- const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
590
- const side = getSide(placement);
591
- const alignment = getAlignment(placement);
592
- const isVertical = getSideAxis(placement) === 'y';
593
- const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
594
- const crossAxisMulti = rtl && isVertical ? -1 : 1;
595
- const rawValue = evaluate(options, state);
596
-
597
- // eslint-disable-next-line prefer-const
598
- let {
599
- mainAxis,
600
- crossAxis,
601
- alignmentAxis
602
- } = typeof rawValue === 'number' ? {
603
- mainAxis: rawValue,
604
- crossAxis: 0,
605
- alignmentAxis: null
606
- } : {
607
- mainAxis: rawValue.mainAxis || 0,
608
- crossAxis: rawValue.crossAxis || 0,
609
- alignmentAxis: rawValue.alignmentAxis
610
- };
611
- if (alignment && typeof alignmentAxis === 'number') {
612
- crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
613
- }
614
- return isVertical ? {
615
- x: crossAxis * crossAxisMulti,
616
- y: mainAxis * mainAxisMulti
617
- } : {
618
- x: mainAxis * mainAxisMulti,
619
- y: crossAxis * crossAxisMulti
620
- };
621
- }
622
-
623
- /**
624
- * Modifies the placement by translating the floating element along the
625
- * specified axes.
626
- * A number (shorthand for `mainAxis` or distance), or an axes configuration
627
- * object may be passed.
628
- * @see https://floating-ui.com/docs/offset
629
- */
630
- const offset = function (options) {
631
- if (options === void 0) {
632
- options = 0;
633
- }
634
- return {
635
- name: 'offset',
636
- options,
637
- async fn(state) {
638
- var _middlewareData$offse, _middlewareData$arrow;
639
- const {
640
- x,
641
- y,
642
- placement,
643
- middlewareData
644
- } = state;
645
- const diffCoords = await convertValueToCoords(state, options);
646
-
647
- // If the placement is the same and the arrow caused an alignment offset
648
- // then we don't need to change the positioning coordinates.
649
- if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
650
- return {};
651
- }
652
- return {
653
- x: x + diffCoords.x,
654
- y: y + diffCoords.y,
655
- data: {
656
- ...diffCoords,
657
- placement
658
- }
659
- };
660
- }
661
- };
662
- };
663
-
664
- /**
665
- * Optimizes the visibility of the floating element by shifting it in order to
666
- * keep it in view when it will overflow the clipping boundary.
667
- * @see https://floating-ui.com/docs/shift
668
- */
669
- const shift = function (options) {
670
- if (options === void 0) {
671
- options = {};
672
- }
673
- return {
674
- name: 'shift',
675
- options,
676
- async fn(state) {
677
- const {
678
- x,
679
- y,
680
- placement
681
- } = state;
682
- const {
683
- mainAxis: checkMainAxis = true,
684
- crossAxis: checkCrossAxis = false,
685
- limiter = {
686
- fn: _ref => {
687
- let {
688
- x,
689
- y
690
- } = _ref;
691
- return {
692
- x,
693
- y
694
- };
695
- }
696
- },
697
- ...detectOverflowOptions
698
- } = evaluate(options, state);
699
- const coords = {
700
- x,
701
- y
702
- };
703
- const overflow = await detectOverflow(state, detectOverflowOptions);
704
- const crossAxis = getSideAxis(getSide(placement));
705
- const mainAxis = getOppositeAxis(crossAxis);
706
- let mainAxisCoord = coords[mainAxis];
707
- let crossAxisCoord = coords[crossAxis];
708
- if (checkMainAxis) {
709
- const minSide = mainAxis === 'y' ? 'top' : 'left';
710
- const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
711
- const min = mainAxisCoord + overflow[minSide];
712
- const max = mainAxisCoord - overflow[maxSide];
713
- mainAxisCoord = clamp(min, mainAxisCoord, max);
714
- }
715
- if (checkCrossAxis) {
716
- const minSide = crossAxis === 'y' ? 'top' : 'left';
717
- const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
718
- const min = crossAxisCoord + overflow[minSide];
719
- const max = crossAxisCoord - overflow[maxSide];
720
- crossAxisCoord = clamp(min, crossAxisCoord, max);
721
- }
722
- const limitedCoords = limiter.fn({
723
- ...state,
724
- [mainAxis]: mainAxisCoord,
725
- [crossAxis]: crossAxisCoord
726
- });
727
- return {
728
- ...limitedCoords,
729
- data: {
730
- x: limitedCoords.x - x,
731
- y: limitedCoords.y - y,
732
- enabled: {
733
- [mainAxis]: checkMainAxis,
734
- [crossAxis]: checkCrossAxis
735
- }
736
- }
737
- };
738
- }
739
- };
740
- };
741
- /**
742
- * Built-in `limiter` that will stop `shift()` at a certain point.
743
- */
744
- const limitShift = function (options) {
745
- if (options === void 0) {
746
- options = {};
747
- }
748
- return {
749
- options,
750
- fn(state) {
751
- const {
752
- x,
753
- y,
754
- placement,
755
- rects,
756
- middlewareData
757
- } = state;
758
- const {
759
- offset = 0,
760
- mainAxis: checkMainAxis = true,
761
- crossAxis: checkCrossAxis = true
762
- } = evaluate(options, state);
763
- const coords = {
764
- x,
765
- y
766
- };
767
- const crossAxis = getSideAxis(placement);
768
- const mainAxis = getOppositeAxis(crossAxis);
769
- let mainAxisCoord = coords[mainAxis];
770
- let crossAxisCoord = coords[crossAxis];
771
- const rawOffset = evaluate(offset, state);
772
- const computedOffset = typeof rawOffset === 'number' ? {
773
- mainAxis: rawOffset,
774
- crossAxis: 0
775
- } : {
776
- mainAxis: 0,
777
- crossAxis: 0,
778
- ...rawOffset
779
- };
780
- if (checkMainAxis) {
781
- const len = mainAxis === 'y' ? 'height' : 'width';
782
- const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
783
- const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
784
- if (mainAxisCoord < limitMin) {
785
- mainAxisCoord = limitMin;
786
- } else if (mainAxisCoord > limitMax) {
787
- mainAxisCoord = limitMax;
788
- }
789
- }
790
- if (checkCrossAxis) {
791
- var _middlewareData$offse, _middlewareData$offse2;
792
- const len = mainAxis === 'y' ? 'width' : 'height';
793
- const isOriginSide = ['top', 'left'].includes(getSide(placement));
794
- const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
795
- const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
796
- if (crossAxisCoord < limitMin) {
797
- crossAxisCoord = limitMin;
798
- } else if (crossAxisCoord > limitMax) {
799
- crossAxisCoord = limitMax;
800
- }
801
- }
802
- return {
803
- [mainAxis]: mainAxisCoord,
804
- [crossAxis]: crossAxisCoord
805
- };
806
- }
807
- };
808
- };
809
-
810
- /**
811
- * Provides data that allows you to change the size of the floating element —
812
- * for instance, prevent it from overflowing the clipping boundary or match the
813
- * width of the reference element.
814
- * @see https://floating-ui.com/docs/size
815
- */
816
- const size = function (options) {
817
- if (options === void 0) {
818
- options = {};
819
- }
820
- return {
821
- name: 'size',
822
- options,
823
- async fn(state) {
824
- var _state$middlewareData, _state$middlewareData2;
825
- const {
826
- placement,
827
- rects,
828
- platform,
829
- elements
830
- } = state;
831
- const {
832
- apply = () => {},
833
- ...detectOverflowOptions
834
- } = evaluate(options, state);
835
- const overflow = await detectOverflow(state, detectOverflowOptions);
836
- const side = getSide(placement);
837
- const alignment = getAlignment(placement);
838
- const isYAxis = getSideAxis(placement) === 'y';
839
- const {
840
- width,
841
- height
842
- } = rects.floating;
843
- let heightSide;
844
- let widthSide;
845
- if (side === 'top' || side === 'bottom') {
846
- heightSide = side;
847
- widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';
848
- } else {
849
- widthSide = side;
850
- heightSide = alignment === 'end' ? 'top' : 'bottom';
851
- }
852
- const maximumClippingHeight = height - overflow.top - overflow.bottom;
853
- const maximumClippingWidth = width - overflow.left - overflow.right;
854
- const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
855
- const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
856
- const noShift = !state.middlewareData.shift;
857
- let availableHeight = overflowAvailableHeight;
858
- let availableWidth = overflowAvailableWidth;
859
- if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {
860
- availableWidth = maximumClippingWidth;
861
- }
862
- if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {
863
- availableHeight = maximumClippingHeight;
864
- }
865
- if (noShift && !alignment) {
866
- const xMin = max(overflow.left, 0);
867
- const xMax = max(overflow.right, 0);
868
- const yMin = max(overflow.top, 0);
869
- const yMax = max(overflow.bottom, 0);
870
- if (isYAxis) {
871
- availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
872
- } else {
873
- availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
874
- }
875
- }
876
- await apply({
877
- ...state,
878
- availableWidth,
879
- availableHeight
880
- });
881
- const nextDimensions = await platform.getDimensions(elements.floating);
882
- if (width !== nextDimensions.width || height !== nextDimensions.height) {
883
- return {
884
- reset: {
885
- rects: true
886
- }
887
- };
888
- }
889
- return {};
890
- }
891
- };
892
- };
893
-
894
- export { arrow, autoPlacement, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };