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