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