@ntbjs/react-components 2.0.0-rc.13 → 2.0.0-rc.27

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