@ntbjs/react-components 1.3.0-rc.8 → 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/esm/node_modules/prop-types/factoryWithTypeCheckers.js +617 -0
- 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-46735b89.js +0 -61
- package/Alert-13b75102.js +0 -117
- package/AssetGallery-0d503207.js +0 -1923
- package/AssetPreviewTopBar-912c3469.js +0 -99
- package/Badge-757b0a39.js +0 -221
- package/Button-49f82b31.js +0 -264
- package/Checkbox-68dc38a8.js +0 -140
- package/CompactAutocompleteSelect-96137f48.js +0 -451
- package/CompactStarRating-15c1b812.js +0 -339
- package/CompactTextInput-198d0800.js +0 -349
- package/ContextMenu-4ec3d9f3.js +0 -32
- package/ContextMenuItem-ba2b697e.js +0 -110
- package/InputGroup-49fbc423.js +0 -28
- package/Instructions-2babb8a3.js +0 -263
- package/MultiLevelCheckboxSelect-e6e5cb90.js +0 -698
- package/MultiSelect-efd60232.js +0 -377
- package/Popover-569cd272.js +0 -146
- package/Radio-32d0513a.js +0 -86
- package/SectionSeparator-259a22ed.js +0 -37
- package/Switch-4a41585f.js +0 -107
- package/Tab-f499ecbc.js +0 -35
- package/Tabs-116aa951.js +0 -151
- package/TextArea-18fbcc9f.js +0 -375
- package/TextInput-0d109708.js +0 -236
- package/Tooltip-66daf6e3.js +0 -61
- package/VerificationStatusIcon-d5bfb67a.js +0 -121
- package/close-ebf2f3cf.js +0 -41
- package/data/Alert/index.js +0 -11
- package/data/Badge/index.js +0 -10
- package/data/Popover/index.js +0 -15
- package/data/Tab/index.js +0 -10
- package/data/Tabs/index.js +0 -12
- package/data/Tooltip/index.js +0 -12
- package/data/index.js +0 -29
- package/defaultTheme-ea44e34a.js +0 -1422
- package/edit-note-c47d292e.js +0 -41
- package/expand-more-94585605.js +0 -41
- package/inputs/ActionButton/index.js +0 -11
- package/inputs/Button/index.js +0 -18
- package/inputs/Checkbox/index.js +0 -12
- package/inputs/CompactAutocompleteSelect/index.js +0 -29
- package/inputs/CompactStarRating/index.js +0 -22
- package/inputs/CompactTextInput/index.js +0 -24
- package/inputs/MultiSelect/index.js +0 -16
- package/inputs/Radio/index.js +0 -12
- package/inputs/Switch/index.js +0 -12
- package/inputs/TextArea/index.js +0 -25
- package/inputs/TextInput/index.js +0 -14
- package/inputs/index.js +0 -59
- package/layout/InputGroup/index.js +0 -10
- package/layout/SectionSeparator/index.js +0 -10
- package/layout/index.js +0 -14
- package/react-select-creatable.esm-2f23d6c6.js +0 -7709
- package/shift-away-subtle-0bed9a3c.js +0 -9
- package/warning-circle-24522402.js +0 -41
- package/widgets/AssetGallery/index.js +0 -50
- package/widgets/AssetPreview/AssetPreviewTopBar/index.js +0 -11
- package/widgets/ContextMenu/ContextMenuItem/index.js +0 -10
- package/widgets/ContextMenu/ContextMenuItemsGroup/index.js +0 -32
- package/widgets/ContextMenu/index.js +0 -10
- package/widgets/Instructions/index.js +0 -34
- package/widgets/index.js +0 -58
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
import { offset, autoPlacement, shift, flip, size, hide, arrow, inline, limitShift } from '../../core/dist/floating-ui.core.mjs.js';
|
|
2
|
+
import { createCoords, rectToClientRect, round, floor, max, min } from '../../utils/dist/floating-ui.utils.mjs.js';
|
|
3
|
+
import { getOverflowAncestors, isElement, getWindow, getFrameElement, getComputedStyle, getDocumentElement, isHTMLElement, isWebKit } from '../../utils/dist/floating-ui.utils.dom.mjs.js';
|
|
4
|
+
export { getOverflowAncestors } from '../../utils/dist/floating-ui.utils.dom.mjs.js';
|
|
5
|
+
|
|
6
|
+
function getCssDimensions(element) {
|
|
7
|
+
const css = getComputedStyle(element);
|
|
8
|
+
// In testing environments, the `width` and `height` properties are empty
|
|
9
|
+
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
|
|
10
|
+
let width = parseFloat(css.width) || 0;
|
|
11
|
+
let height = parseFloat(css.height) || 0;
|
|
12
|
+
const hasOffset = isHTMLElement(element);
|
|
13
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
14
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
15
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
16
|
+
if (shouldFallback) {
|
|
17
|
+
width = offsetWidth;
|
|
18
|
+
height = offsetHeight;
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
width,
|
|
22
|
+
height,
|
|
23
|
+
$: shouldFallback
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function unwrapElement(element) {
|
|
28
|
+
return !isElement(element) ? element.contextElement : element;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function getScale(element) {
|
|
32
|
+
const domElement = unwrapElement(element);
|
|
33
|
+
if (!isHTMLElement(domElement)) {
|
|
34
|
+
return createCoords(1);
|
|
35
|
+
}
|
|
36
|
+
const rect = domElement.getBoundingClientRect();
|
|
37
|
+
const {
|
|
38
|
+
width,
|
|
39
|
+
height,
|
|
40
|
+
$
|
|
41
|
+
} = getCssDimensions(domElement);
|
|
42
|
+
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
43
|
+
let y = ($ ? round(rect.height) : rect.height) / height;
|
|
44
|
+
|
|
45
|
+
// 0, NaN, or Infinity should always fallback to 1.
|
|
46
|
+
|
|
47
|
+
if (!x || !Number.isFinite(x)) {
|
|
48
|
+
x = 1;
|
|
49
|
+
}
|
|
50
|
+
if (!y || !Number.isFinite(y)) {
|
|
51
|
+
y = 1;
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
x,
|
|
55
|
+
y
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const noOffsets = /*#__PURE__*/createCoords(0);
|
|
60
|
+
function getVisualOffsets(element) {
|
|
61
|
+
const win = getWindow(element);
|
|
62
|
+
if (!isWebKit() || !win.visualViewport) {
|
|
63
|
+
return noOffsets;
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
x: win.visualViewport.offsetLeft,
|
|
67
|
+
y: win.visualViewport.offsetTop
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
71
|
+
if (isFixed === void 0) {
|
|
72
|
+
isFixed = false;
|
|
73
|
+
}
|
|
74
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
return isFixed;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
81
|
+
if (includeScale === void 0) {
|
|
82
|
+
includeScale = false;
|
|
83
|
+
}
|
|
84
|
+
if (isFixedStrategy === void 0) {
|
|
85
|
+
isFixedStrategy = false;
|
|
86
|
+
}
|
|
87
|
+
const clientRect = element.getBoundingClientRect();
|
|
88
|
+
const domElement = unwrapElement(element);
|
|
89
|
+
let scale = createCoords(1);
|
|
90
|
+
if (includeScale) {
|
|
91
|
+
if (offsetParent) {
|
|
92
|
+
if (isElement(offsetParent)) {
|
|
93
|
+
scale = getScale(offsetParent);
|
|
94
|
+
}
|
|
95
|
+
} else {
|
|
96
|
+
scale = getScale(element);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
100
|
+
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
101
|
+
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
102
|
+
let width = clientRect.width / scale.x;
|
|
103
|
+
let height = clientRect.height / scale.y;
|
|
104
|
+
if (domElement) {
|
|
105
|
+
const win = getWindow(domElement);
|
|
106
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
107
|
+
let currentWin = win;
|
|
108
|
+
let currentIFrame = getFrameElement(currentWin);
|
|
109
|
+
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
110
|
+
const iframeScale = getScale(currentIFrame);
|
|
111
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
112
|
+
const css = getComputedStyle(currentIFrame);
|
|
113
|
+
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
114
|
+
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
115
|
+
x *= iframeScale.x;
|
|
116
|
+
y *= iframeScale.y;
|
|
117
|
+
width *= iframeScale.x;
|
|
118
|
+
height *= iframeScale.y;
|
|
119
|
+
x += left;
|
|
120
|
+
y += top;
|
|
121
|
+
currentWin = getWindow(currentIFrame);
|
|
122
|
+
currentIFrame = getFrameElement(currentWin);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return rectToClientRect({
|
|
126
|
+
width,
|
|
127
|
+
height,
|
|
128
|
+
x,
|
|
129
|
+
y
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function rectsAreEqual(a, b) {
|
|
134
|
+
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// https://samthor.au/2021/observing-dom/
|
|
138
|
+
function observeMove(element, onMove) {
|
|
139
|
+
let io = null;
|
|
140
|
+
let timeoutId;
|
|
141
|
+
const root = getDocumentElement(element);
|
|
142
|
+
function cleanup() {
|
|
143
|
+
var _io;
|
|
144
|
+
clearTimeout(timeoutId);
|
|
145
|
+
(_io = io) == null || _io.disconnect();
|
|
146
|
+
io = null;
|
|
147
|
+
}
|
|
148
|
+
function refresh(skip, threshold) {
|
|
149
|
+
if (skip === void 0) {
|
|
150
|
+
skip = false;
|
|
151
|
+
}
|
|
152
|
+
if (threshold === void 0) {
|
|
153
|
+
threshold = 1;
|
|
154
|
+
}
|
|
155
|
+
cleanup();
|
|
156
|
+
const elementRectForRootMargin = element.getBoundingClientRect();
|
|
157
|
+
const {
|
|
158
|
+
left,
|
|
159
|
+
top,
|
|
160
|
+
width,
|
|
161
|
+
height
|
|
162
|
+
} = elementRectForRootMargin;
|
|
163
|
+
if (!skip) {
|
|
164
|
+
onMove();
|
|
165
|
+
}
|
|
166
|
+
if (!width || !height) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const insetTop = floor(top);
|
|
170
|
+
const insetRight = floor(root.clientWidth - (left + width));
|
|
171
|
+
const insetBottom = floor(root.clientHeight - (top + height));
|
|
172
|
+
const insetLeft = floor(left);
|
|
173
|
+
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
174
|
+
const options = {
|
|
175
|
+
rootMargin,
|
|
176
|
+
threshold: max(0, min(1, threshold)) || 1
|
|
177
|
+
};
|
|
178
|
+
let isFirstUpdate = true;
|
|
179
|
+
function handleObserve(entries) {
|
|
180
|
+
const ratio = entries[0].intersectionRatio;
|
|
181
|
+
if (ratio !== threshold) {
|
|
182
|
+
if (!isFirstUpdate) {
|
|
183
|
+
return refresh();
|
|
184
|
+
}
|
|
185
|
+
if (!ratio) {
|
|
186
|
+
// If the reference is clipped, the ratio is 0. Throttle the refresh
|
|
187
|
+
// to prevent an infinite loop of updates.
|
|
188
|
+
timeoutId = setTimeout(() => {
|
|
189
|
+
refresh(false, 1e-7);
|
|
190
|
+
}, 1000);
|
|
191
|
+
} else {
|
|
192
|
+
refresh(false, ratio);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
196
|
+
// It's possible that even though the ratio is reported as 1, the
|
|
197
|
+
// element is not actually fully within the IntersectionObserver's root
|
|
198
|
+
// area anymore. This can happen under performance constraints. This may
|
|
199
|
+
// be a bug in the browser's IntersectionObserver implementation. To
|
|
200
|
+
// work around this, we compare the element's bounding rect now with
|
|
201
|
+
// what it was at the time we created the IntersectionObserver. If they
|
|
202
|
+
// are not equal then the element moved, so we refresh.
|
|
203
|
+
refresh();
|
|
204
|
+
}
|
|
205
|
+
isFirstUpdate = false;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// Older browsers don't support a `document` as the root and will throw an
|
|
209
|
+
// error.
|
|
210
|
+
try {
|
|
211
|
+
io = new IntersectionObserver(handleObserve, {
|
|
212
|
+
...options,
|
|
213
|
+
// Handle <iframe>s
|
|
214
|
+
root: root.ownerDocument
|
|
215
|
+
});
|
|
216
|
+
} catch (e) {
|
|
217
|
+
io = new IntersectionObserver(handleObserve, options);
|
|
218
|
+
}
|
|
219
|
+
io.observe(element);
|
|
220
|
+
}
|
|
221
|
+
refresh(true);
|
|
222
|
+
return cleanup;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Automatically updates the position of the floating element when necessary.
|
|
227
|
+
* Should only be called when the floating element is mounted on the DOM or
|
|
228
|
+
* visible on the screen.
|
|
229
|
+
* @returns cleanup function that should be invoked when the floating element is
|
|
230
|
+
* removed from the DOM or hidden from the screen.
|
|
231
|
+
* @see https://floating-ui.com/docs/autoUpdate
|
|
232
|
+
*/
|
|
233
|
+
function autoUpdate(reference, floating, update, options) {
|
|
234
|
+
if (options === void 0) {
|
|
235
|
+
options = {};
|
|
236
|
+
}
|
|
237
|
+
const {
|
|
238
|
+
ancestorScroll = true,
|
|
239
|
+
ancestorResize = true,
|
|
240
|
+
elementResize = typeof ResizeObserver === 'function',
|
|
241
|
+
layoutShift = typeof IntersectionObserver === 'function',
|
|
242
|
+
animationFrame = false
|
|
243
|
+
} = options;
|
|
244
|
+
const referenceEl = unwrapElement(reference);
|
|
245
|
+
const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
|
|
246
|
+
ancestors.forEach(ancestor => {
|
|
247
|
+
ancestorScroll && ancestor.addEventListener('scroll', update, {
|
|
248
|
+
passive: true
|
|
249
|
+
});
|
|
250
|
+
ancestorResize && ancestor.addEventListener('resize', update);
|
|
251
|
+
});
|
|
252
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
253
|
+
let reobserveFrame = -1;
|
|
254
|
+
let resizeObserver = null;
|
|
255
|
+
if (elementResize) {
|
|
256
|
+
resizeObserver = new ResizeObserver(_ref => {
|
|
257
|
+
let [firstEntry] = _ref;
|
|
258
|
+
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
|
259
|
+
// Prevent update loops when using the `size` middleware.
|
|
260
|
+
// https://github.com/floating-ui/floating-ui/issues/1740
|
|
261
|
+
resizeObserver.unobserve(floating);
|
|
262
|
+
cancelAnimationFrame(reobserveFrame);
|
|
263
|
+
reobserveFrame = requestAnimationFrame(() => {
|
|
264
|
+
var _resizeObserver;
|
|
265
|
+
(_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
update();
|
|
269
|
+
});
|
|
270
|
+
if (referenceEl && !animationFrame) {
|
|
271
|
+
resizeObserver.observe(referenceEl);
|
|
272
|
+
}
|
|
273
|
+
resizeObserver.observe(floating);
|
|
274
|
+
}
|
|
275
|
+
let frameId;
|
|
276
|
+
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
277
|
+
if (animationFrame) {
|
|
278
|
+
frameLoop();
|
|
279
|
+
}
|
|
280
|
+
function frameLoop() {
|
|
281
|
+
const nextRefRect = getBoundingClientRect(reference);
|
|
282
|
+
if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
|
|
283
|
+
update();
|
|
284
|
+
}
|
|
285
|
+
prevRefRect = nextRefRect;
|
|
286
|
+
frameId = requestAnimationFrame(frameLoop);
|
|
287
|
+
}
|
|
288
|
+
update();
|
|
289
|
+
return () => {
|
|
290
|
+
var _resizeObserver2;
|
|
291
|
+
ancestors.forEach(ancestor => {
|
|
292
|
+
ancestorScroll && ancestor.removeEventListener('scroll', update);
|
|
293
|
+
ancestorResize && ancestor.removeEventListener('resize', update);
|
|
294
|
+
});
|
|
295
|
+
cleanupIo == null || cleanupIo();
|
|
296
|
+
(_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
|
|
297
|
+
resizeObserver = null;
|
|
298
|
+
if (animationFrame) {
|
|
299
|
+
cancelAnimationFrame(frameId);
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Modifies the placement by translating the floating element along the
|
|
306
|
+
* specified axes.
|
|
307
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
308
|
+
* object may be passed.
|
|
309
|
+
* @see https://floating-ui.com/docs/offset
|
|
310
|
+
*/
|
|
311
|
+
offset;
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Optimizes the visibility of the floating element by choosing the placement
|
|
315
|
+
* that has the most space available automatically, without needing to specify a
|
|
316
|
+
* preferred placement. Alternative to `flip`.
|
|
317
|
+
* @see https://floating-ui.com/docs/autoPlacement
|
|
318
|
+
*/
|
|
319
|
+
autoPlacement;
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
323
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
324
|
+
* @see https://floating-ui.com/docs/shift
|
|
325
|
+
*/
|
|
326
|
+
shift;
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
330
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
331
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
332
|
+
* @see https://floating-ui.com/docs/flip
|
|
333
|
+
*/
|
|
334
|
+
flip;
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Provides data that allows you to change the size of the floating element —
|
|
338
|
+
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
339
|
+
* width of the reference element.
|
|
340
|
+
* @see https://floating-ui.com/docs/size
|
|
341
|
+
*/
|
|
342
|
+
size;
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
346
|
+
* when it is not in the same clipping context as the reference element.
|
|
347
|
+
* @see https://floating-ui.com/docs/hide
|
|
348
|
+
*/
|
|
349
|
+
hide;
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Provides data to position an inner element of the floating element so that it
|
|
353
|
+
* appears centered to the reference element.
|
|
354
|
+
* @see https://floating-ui.com/docs/arrow
|
|
355
|
+
*/
|
|
356
|
+
arrow;
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Provides improved positioning for inline reference elements that can span
|
|
360
|
+
* over multiple lines, such as hyperlinks or range selections.
|
|
361
|
+
* @see https://floating-ui.com/docs/inline
|
|
362
|
+
*/
|
|
363
|
+
inline;
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
367
|
+
*/
|
|
368
|
+
limitShift;
|
|
369
|
+
|
|
370
|
+
export { autoUpdate };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
function hasWindow() {
|
|
2
|
+
return typeof window !== 'undefined';
|
|
3
|
+
}
|
|
4
|
+
function getNodeName(node) {
|
|
5
|
+
if (isNode(node)) {
|
|
6
|
+
return (node.nodeName || '').toLowerCase();
|
|
7
|
+
}
|
|
8
|
+
// Mocked nodes in testing environments may not be instances of Node. By
|
|
9
|
+
// returning `#document` an infinite loop won't occur.
|
|
10
|
+
// https://github.com/floating-ui/floating-ui/issues/2317
|
|
11
|
+
return '#document';
|
|
12
|
+
}
|
|
13
|
+
function getWindow(node) {
|
|
14
|
+
var _node$ownerDocument;
|
|
15
|
+
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
16
|
+
}
|
|
17
|
+
function getDocumentElement(node) {
|
|
18
|
+
var _ref;
|
|
19
|
+
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
20
|
+
}
|
|
21
|
+
function isNode(value) {
|
|
22
|
+
if (!hasWindow()) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
26
|
+
}
|
|
27
|
+
function isElement(value) {
|
|
28
|
+
if (!hasWindow()) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
32
|
+
}
|
|
33
|
+
function isHTMLElement(value) {
|
|
34
|
+
if (!hasWindow()) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
38
|
+
}
|
|
39
|
+
function isShadowRoot(value) {
|
|
40
|
+
if (!hasWindow() || typeof ShadowRoot === 'undefined') {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
44
|
+
}
|
|
45
|
+
function isOverflowElement(element) {
|
|
46
|
+
const {
|
|
47
|
+
overflow,
|
|
48
|
+
overflowX,
|
|
49
|
+
overflowY,
|
|
50
|
+
display
|
|
51
|
+
} = getComputedStyle(element);
|
|
52
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
|
53
|
+
}
|
|
54
|
+
function isWebKit() {
|
|
55
|
+
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
|
56
|
+
return CSS.supports('-webkit-backdrop-filter', 'none');
|
|
57
|
+
}
|
|
58
|
+
function isLastTraversableNode(node) {
|
|
59
|
+
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
60
|
+
}
|
|
61
|
+
function getComputedStyle(element) {
|
|
62
|
+
return getWindow(element).getComputedStyle(element);
|
|
63
|
+
}
|
|
64
|
+
function getParentNode(node) {
|
|
65
|
+
if (getNodeName(node) === 'html') {
|
|
66
|
+
return node;
|
|
67
|
+
}
|
|
68
|
+
const result =
|
|
69
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
70
|
+
node.assignedSlot ||
|
|
71
|
+
// DOM Element detected.
|
|
72
|
+
node.parentNode ||
|
|
73
|
+
// ShadowRoot detected.
|
|
74
|
+
isShadowRoot(node) && node.host ||
|
|
75
|
+
// Fallback.
|
|
76
|
+
getDocumentElement(node);
|
|
77
|
+
return isShadowRoot(result) ? result.host : result;
|
|
78
|
+
}
|
|
79
|
+
function getNearestOverflowAncestor(node) {
|
|
80
|
+
const parentNode = getParentNode(node);
|
|
81
|
+
if (isLastTraversableNode(parentNode)) {
|
|
82
|
+
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
83
|
+
}
|
|
84
|
+
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
85
|
+
return parentNode;
|
|
86
|
+
}
|
|
87
|
+
return getNearestOverflowAncestor(parentNode);
|
|
88
|
+
}
|
|
89
|
+
function getOverflowAncestors(node, list, traverseIframes) {
|
|
90
|
+
var _node$ownerDocument2;
|
|
91
|
+
if (list === void 0) {
|
|
92
|
+
list = [];
|
|
93
|
+
}
|
|
94
|
+
if (traverseIframes === void 0) {
|
|
95
|
+
traverseIframes = true;
|
|
96
|
+
}
|
|
97
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
98
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
99
|
+
const win = getWindow(scrollableAncestor);
|
|
100
|
+
if (isBody) {
|
|
101
|
+
const frameElement = getFrameElement(win);
|
|
102
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
103
|
+
}
|
|
104
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
105
|
+
}
|
|
106
|
+
function getFrameElement(win) {
|
|
107
|
+
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export { getComputedStyle, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getOverflowAncestors, getParentNode, getWindow, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isWebKit };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom positioning reference element.
|
|
3
|
+
* @see https://floating-ui.com/docs/virtual-elements
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const sides = ['top', 'right', 'bottom', 'left'];
|
|
7
|
+
const alignments = ['start', 'end'];
|
|
8
|
+
const placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []);
|
|
9
|
+
const min = Math.min;
|
|
10
|
+
const max = Math.max;
|
|
11
|
+
const round = Math.round;
|
|
12
|
+
const floor = Math.floor;
|
|
13
|
+
const createCoords = v => ({
|
|
14
|
+
x: v,
|
|
15
|
+
y: v
|
|
16
|
+
});
|
|
17
|
+
const oppositeSideMap = {
|
|
18
|
+
left: 'right',
|
|
19
|
+
right: 'left',
|
|
20
|
+
bottom: 'top',
|
|
21
|
+
top: 'bottom'
|
|
22
|
+
};
|
|
23
|
+
const oppositeAlignmentMap = {
|
|
24
|
+
start: 'end',
|
|
25
|
+
end: 'start'
|
|
26
|
+
};
|
|
27
|
+
function clamp(start, value, end) {
|
|
28
|
+
return max(start, min(value, end));
|
|
29
|
+
}
|
|
30
|
+
function evaluate(value, param) {
|
|
31
|
+
return typeof value === 'function' ? value(param) : value;
|
|
32
|
+
}
|
|
33
|
+
function getSide(placement) {
|
|
34
|
+
return placement.split('-')[0];
|
|
35
|
+
}
|
|
36
|
+
function getAlignment(placement) {
|
|
37
|
+
return placement.split('-')[1];
|
|
38
|
+
}
|
|
39
|
+
function getOppositeAxis(axis) {
|
|
40
|
+
return axis === 'x' ? 'y' : 'x';
|
|
41
|
+
}
|
|
42
|
+
function getAxisLength(axis) {
|
|
43
|
+
return axis === 'y' ? 'height' : 'width';
|
|
44
|
+
}
|
|
45
|
+
function getSideAxis(placement) {
|
|
46
|
+
return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
|
|
47
|
+
}
|
|
48
|
+
function getAlignmentAxis(placement) {
|
|
49
|
+
return getOppositeAxis(getSideAxis(placement));
|
|
50
|
+
}
|
|
51
|
+
function getAlignmentSides(placement, rects, rtl) {
|
|
52
|
+
if (rtl === void 0) {
|
|
53
|
+
rtl = false;
|
|
54
|
+
}
|
|
55
|
+
const alignment = getAlignment(placement);
|
|
56
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
57
|
+
const length = getAxisLength(alignmentAxis);
|
|
58
|
+
let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
|
59
|
+
if (rects.reference[length] > rects.floating[length]) {
|
|
60
|
+
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
61
|
+
}
|
|
62
|
+
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
63
|
+
}
|
|
64
|
+
function getExpandedPlacements(placement) {
|
|
65
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
66
|
+
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
67
|
+
}
|
|
68
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
69
|
+
return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
|
|
70
|
+
}
|
|
71
|
+
function getSideList(side, isStart, rtl) {
|
|
72
|
+
const lr = ['left', 'right'];
|
|
73
|
+
const rl = ['right', 'left'];
|
|
74
|
+
const tb = ['top', 'bottom'];
|
|
75
|
+
const bt = ['bottom', 'top'];
|
|
76
|
+
switch (side) {
|
|
77
|
+
case 'top':
|
|
78
|
+
case 'bottom':
|
|
79
|
+
if (rtl) return isStart ? rl : lr;
|
|
80
|
+
return isStart ? lr : rl;
|
|
81
|
+
case 'left':
|
|
82
|
+
case 'right':
|
|
83
|
+
return isStart ? tb : bt;
|
|
84
|
+
default:
|
|
85
|
+
return [];
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
89
|
+
const alignment = getAlignment(placement);
|
|
90
|
+
let list = getSideList(getSide(placement), direction === 'start', rtl);
|
|
91
|
+
if (alignment) {
|
|
92
|
+
list = list.map(side => side + "-" + alignment);
|
|
93
|
+
if (flipAlignment) {
|
|
94
|
+
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return list;
|
|
98
|
+
}
|
|
99
|
+
function getOppositePlacement(placement) {
|
|
100
|
+
return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
|
|
101
|
+
}
|
|
102
|
+
function expandPaddingObject(padding) {
|
|
103
|
+
return {
|
|
104
|
+
top: 0,
|
|
105
|
+
right: 0,
|
|
106
|
+
bottom: 0,
|
|
107
|
+
left: 0,
|
|
108
|
+
...padding
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function getPaddingObject(padding) {
|
|
112
|
+
return typeof padding !== 'number' ? expandPaddingObject(padding) : {
|
|
113
|
+
top: padding,
|
|
114
|
+
right: padding,
|
|
115
|
+
bottom: padding,
|
|
116
|
+
left: padding
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function rectToClientRect(rect) {
|
|
120
|
+
const {
|
|
121
|
+
x,
|
|
122
|
+
y,
|
|
123
|
+
width,
|
|
124
|
+
height
|
|
125
|
+
} = rect;
|
|
126
|
+
return {
|
|
127
|
+
width,
|
|
128
|
+
height,
|
|
129
|
+
top: y,
|
|
130
|
+
left: x,
|
|
131
|
+
right: x + width,
|
|
132
|
+
bottom: y + height,
|
|
133
|
+
x,
|
|
134
|
+
y
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var React = require('react');
|
|
1
|
+
import '../../../react/index.js';
|
|
2
|
+
import { r as react } from '../../../../_virtual/index.js';
|
|
4
3
|
|
|
5
4
|
var toFnRef = function toFnRef(ref) {
|
|
6
5
|
return !ref || typeof ref === 'function' ? ref : function (value) {
|
|
@@ -34,9 +33,9 @@ function mergeRefs(refA, refB) {
|
|
|
34
33
|
*/
|
|
35
34
|
|
|
36
35
|
function useMergedRefs(refA, refB) {
|
|
37
|
-
return
|
|
36
|
+
return react.exports.useMemo(function () {
|
|
38
37
|
return mergeRefs(refA, refB);
|
|
39
38
|
}, [refA, refB]);
|
|
40
39
|
}
|
|
41
40
|
|
|
42
|
-
|
|
41
|
+
export { useMergedRefs as default, mergeRefs };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import '../../../react/index.js';
|
|
2
|
+
import { r as react } from '../../../../_virtual/index.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Runs an effect only when the dependencies have changed, skipping the
|
|
6
|
+
* initial "on mount" run. Caution, if the dependency list never changes,
|
|
7
|
+
* the effect is **never run**
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* const ref = useRef<HTMLInput>(null);
|
|
11
|
+
*
|
|
12
|
+
* // focuses an element only if the focus changes, and not on mount
|
|
13
|
+
* useUpdateEffect(() => {
|
|
14
|
+
* const element = ref.current?.children[focusedIdx] as HTMLElement
|
|
15
|
+
*
|
|
16
|
+
* element?.focus()
|
|
17
|
+
*
|
|
18
|
+
* }, [focusedIndex])
|
|
19
|
+
* ```
|
|
20
|
+
* @param effect An effect to run on mount
|
|
21
|
+
*
|
|
22
|
+
* @category effects
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
function useUpdateEffect(fn, deps) {
|
|
26
|
+
var isFirst = react.exports.useRef(true);
|
|
27
|
+
react.exports.useEffect(function () {
|
|
28
|
+
if (isFirst.current) {
|
|
29
|
+
isFirst.current = false;
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return fn();
|
|
34
|
+
}, deps);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { useUpdateEffect as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import '../node_modules/react-is/index.js';
|
|
2
|
+
import { r as reactIs$1 } from '../../../_virtual/index5.js';
|
|
3
|
+
|
|
4
|
+
var reactIs = reactIs$1.exports;
|
|
5
|
+
var FORWARD_REF_STATICS = {
|
|
6
|
+
'$$typeof': true,
|
|
7
|
+
render: true,
|
|
8
|
+
defaultProps: true,
|
|
9
|
+
displayName: true,
|
|
10
|
+
propTypes: true
|
|
11
|
+
};
|
|
12
|
+
var MEMO_STATICS = {
|
|
13
|
+
'$$typeof': true,
|
|
14
|
+
compare: true,
|
|
15
|
+
defaultProps: true,
|
|
16
|
+
displayName: true,
|
|
17
|
+
propTypes: true,
|
|
18
|
+
type: true
|
|
19
|
+
};
|
|
20
|
+
var TYPE_STATICS = {};
|
|
21
|
+
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
|
|
22
|
+
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
|