@hh.ru/magritte-ui-drop 7.2.2 → 7.2.4
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/Drop.d.ts +1 -2
- package/Drop.js +1 -1
- package/Drop.js.map +1 -1
- package/{DropContainer-BtzDPRuE.js → DropContainer-DR1_Weix.js} +2 -2
- package/{DropContainer-BtzDPRuE.js.map → DropContainer-DR1_Weix.js.map} +1 -1
- package/DropContainer.d.ts +1 -2
- package/DropContainer.js +1 -1
- package/index.css +67 -67
- package/index.js +1 -1
- package/package.json +7 -7
package/Drop.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
declare const Drop: import("react").ForwardRefExoticComponent<Omit<import("@hh.ru/magritte-internal-drop-base").DropBasePermanentProps, "role" | "children" | "arrowGuardDistance" | "animationTimeout" | "animationClassNames" | "guardDistanceToActivator" | "placement" | "allowShrinkHeightToFitIntoViewport" | "minHeight" | "guardDistanceToViewport" | "ignoreIntersections"> & import("@hh.ru/magritte-ui-drop/types").DropPropsOnly & {
|
|
3
|
-
children?: import("react").ReactNode;
|
|
2
|
+
children?: import("react").ReactNode | undefined;
|
|
4
3
|
} & import("react").RefAttributes<HTMLElement>>;
|
|
5
4
|
export { Drop };
|
package/Drop.js
CHANGED
|
@@ -5,7 +5,7 @@ import classnames from 'classnames';
|
|
|
5
5
|
import { DropBase } from '@hh.ru/magritte-internal-drop-base';
|
|
6
6
|
import { InternalLayerName } from '@hh.ru/magritte-internal-layer-name';
|
|
7
7
|
import { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';
|
|
8
|
-
import { s as styles, D as DropContainer } from './DropContainer-
|
|
8
|
+
import { s as styles, D as DropContainer } from './DropContainer-DR1_Weix.js';
|
|
9
9
|
import { PureChildren } from './PureChildren.js';
|
|
10
10
|
import { Layer } from '@hh.ru/magritte-ui-layer';
|
|
11
11
|
import '@hh.ru/magritte-common-use-multiple-refs';
|
package/Drop.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drop.js","sources":["../src/Drop.tsx"],"sourcesContent":["import {\n useMemo,\n useEffect,\n useState,\n type ReactElement,\n ForwardedRef,\n forwardRef,\n useRef,\n RefObject,\n CSSProperties,\n type FocusEvent,\n} from 'react';\nimport classnames from 'classnames';\n\nimport { DropBase, type Placement } from '@hh.ru/magritte-internal-drop-base';\nimport { InternalLayerName } from '@hh.ru/magritte-internal-layer-name';\nimport { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';\nimport { DropContainer } from '@hh.ru/magritte-ui-drop/DropContainer';\nimport { PureChildren } from '@hh.ru/magritte-ui-drop/PureChildren';\nimport type { DropProps, DropPlacement } from '@hh.ru/magritte-ui-drop/types';\nimport { Layer } from '@hh.ru/magritte-ui-layer';\n\nimport styles from './drop.less';\n\nconst PLACEMENTS_LIST: Placement[] = [\n 'left-top',\n 'left-bottom',\n 'right-top',\n 'right-bottom',\n 'top-left',\n 'top-right',\n 'bottom-left',\n 'bottom-right',\n];\n\nconst isKeyboardInput = (element: HTMLElement): boolean => {\n const tagName = element.tagName.toLowerCase();\n const keyboardInputTypes = ['text', 'password', 'email', 'number', 'tel', 'url', 'search'];\n return (\n (tagName === 'input' && keyboardInputTypes.includes((element as HTMLInputElement).type)) ||\n tagName === 'textarea' ||\n element.hasAttribute('contenteditable')\n );\n};\n\nconst DropComponent = (\n {\n visible,\n activatorRef,\n onClose,\n maxWidth = 320,\n minHeight = 200,\n width,\n space = 600,\n children,\n footer,\n role = 'dialog',\n dividerState = 'show',\n widthEqualToActivator = false,\n allowShrinkHeightToFitIntoViewport = true,\n autoFocusWhenOpened,\n closeByClickOutside = true,\n 'data-qa': dataQA = 'drop',\n onAppear,\n onBeforeExit,\n onAfterExit,\n placement,\n forcePlacement,\n ignoreIntersections,\n ...props\n }: DropProps,\n ref: ForwardedRef<HTMLElement>\n): ReactElement | null => {\n const { isMobile } = useBreakpoint();\n const [animationTimeout, setAnimationTimeout] = useState(200);\n const [isPlacementLocked, setPlacementLocked] = useState(false);\n const forceUpdateDropMetricsRef = useRef<VoidFunction>();\n\n const actualIgnoreIntersections =\n ignoreIntersections === undefined ? !allowShrinkHeightToFitIntoViewport : ignoreIntersections;\n\n const placementsList = useMemo(() => {\n const placementsArray: DropPlacement[] = Array.isArray(placement) ? placement : [placement];\n return (\n forcePlacement\n ? placementsArray\n : [...placementsArray, ...PLACEMENTS_LIST.filter((place) => !placement.includes(place))]\n ) as Placement[];\n }, [placement, forcePlacement]);\n\n useEffect(() => {\n const animationTimeoutElement = document.createElement('div');\n animationTimeoutElement.classList.add(styles.dropAnimationTimeout);\n document.body.appendChild(animationTimeoutElement);\n const style = window.getComputedStyle(animationTimeoutElement);\n const animationTimeout = parseInt(style.getPropertyValue(`--animation-duration`), 10);\n if (Number.isInteger(animationTimeout)) {\n setAnimationTimeout(animationTimeout);\n }\n document.body.removeChild(animationTimeoutElement);\n }, []);\n\n useEffect(() => {\n forceUpdateDropMetricsRef.current?.();\n }, [maxWidth, space, footer]);\n\n const focusHandler = (event: Event | FocusEvent) => {\n const target = event.target;\n if (!target || !isKeyboardInput(target as HTMLElement)) {\n return;\n }\n setPlacementLocked(true);\n };\n const blurHandler = () => setPlacementLocked(false);\n\n useEffect(() => {\n if (!visible || isMobile || !activatorRef.current) {\n return void 0;\n }\n\n const activatorElement = activatorRef.current;\n activatorElement.addEventListener('focus', focusHandler);\n activatorElement.addEventListener('blur', blurHandler);\n return () => {\n activatorElement.removeEventListener('focus', focusHandler);\n activatorElement.removeEventListener('blur', blurHandler);\n };\n }, [visible, activatorRef, isMobile]);\n\n if (isMobile) {\n return null;\n }\n\n let widthStyle: CSSProperties;\n if (widthEqualToActivator) {\n widthStyle = { width: '100%' };\n } else {\n widthStyle = width ? { width } : { maxWidth };\n }\n\n return (\n <Layer layer={InternalLayerName.Drop}>\n <DropBase\n {...props}\n visible={visible}\n placement={placementsList}\n activatorRef={activatorRef}\n closeByClickOutside={closeByClickOutside}\n onClose={onClose}\n autoFocusWhenOpened={autoFocusWhenOpened ?? role !== 'status'}\n animationClassNames={{\n enter: styles.dropEnter,\n enterActive: styles.dropEnterActive,\n exit: styles.dropExit,\n exitActive: styles.dropExitActive,\n }}\n animationTimeout={animationTimeout}\n widthEqualToActivator={widthEqualToActivator}\n allowShrinkHeightToFitIntoViewport={allowShrinkHeightToFitIntoViewport}\n ignoreIntersections={actualIgnoreIntersections}\n minHeight={minHeight}\n ref={ref}\n onAppear={onAppear}\n onBeforeExit={onBeforeExit}\n onAfterExit={onAfterExit}\n forceDropMetricsUpdate={forceUpdateDropMetricsRef as RefObject<VoidFunction>}\n lockPlacement={isPlacementLocked}\n >\n {(resizeRefCallbackFactory) => (\n <div\n className={classnames(styles.drop, {\n [styles.dropSpace300]: space === 300,\n [styles.dropSpace400]: space === 400,\n [styles.dropSpace600]: space === 600,\n [styles.dropWithFooter]: !!footer,\n })}\n style={widthStyle}\n data-qa={dataQA}\n key=\"drop-outer-container\"\n onFocus={focusHandler}\n onBlur={blurHandler}\n >\n <DropContainer\n key=\"drop-container\"\n dividerState={!footer ? 'hide' : dividerState}\n ref={resizeRefCallbackFactory('scroll-container', false, true)}\n >\n <div ref={resizeRefCallbackFactory('drop-content')}>\n <PureChildren>{children}</PureChildren>\n </div>\n </DropContainer>\n {footer && (\n <div ref={resizeRefCallbackFactory('drop-footer')} className={styles.dropFooter}>\n <PureChildren>{footer}</PureChildren>\n </div>\n )}\n </div>\n )}\n </DropBase>\n </Layer>\n );\n};\n\nconst Drop = forwardRef<HTMLElement, DropProps>(DropComponent);\nexport { Drop };\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;AAwBA,MAAM,eAAe,GAAgB;IACjC,UAAU;IACV,aAAa;IACb,WAAW;IACX,cAAc;IACd,UAAU;IACV,WAAW;IACX,aAAa;IACb,cAAc;CACjB,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,OAAoB,KAAa;IACt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C,aAAa,EAAA,EAEV,YAAY,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,YAAY,EAC7C,GAAG,EAAE,wBAAwB,CAAC,kBAAkB,EAAE,KAAK,EAAE,IAAI,CAAC,EAAA,QAAA,EAE9DA,aAAK,GAAG,EAAE,wBAAwB,CAAC,cAAc,CAAC,EAC9C,QAAA,EAAAA,GAAA,CAAC,YAAY,EAAE,EAAA,QAAA,EAAA,QAAQ,GAAgB,EACrC,CAAA,EAAA,EANF,gBAAgB,CAOR,EACf,MAAM,KACHA,aAAK,GAAG,EAAE,wBAAwB,CAAC,aAAa,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,UAAU,EAC3E,QAAA,EAAAA,GAAA,CAAC,YAAY,EAAE,EAAA,QAAA,EAAA,MAAM,GAAgB,EACnC,CAAA,CACT,KAjBG,sBAAsB,CAkBxB,CACT,EACM,CAAA,EAAA,CACP,EACV;AACN,CAAC,CAAC;AAEF,MAAM,IAAI,GAAG,UAAU,CAAyB,aAAa;;;;"}
|
|
1
|
+
{"version":3,"file":"Drop.js","sources":["../src/Drop.tsx"],"sourcesContent":["import {\n useMemo,\n useEffect,\n useState,\n type ReactElement,\n ForwardedRef,\n forwardRef,\n useRef,\n RefObject,\n CSSProperties,\n type FocusEvent,\n} from 'react';\nimport classnames from 'classnames';\n\nimport { DropBase, type Placement } from '@hh.ru/magritte-internal-drop-base';\nimport { InternalLayerName } from '@hh.ru/magritte-internal-layer-name';\nimport { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';\nimport { DropContainer } from '@hh.ru/magritte-ui-drop/DropContainer';\nimport { PureChildren } from '@hh.ru/magritte-ui-drop/PureChildren';\nimport type { DropProps, DropPlacement } from '@hh.ru/magritte-ui-drop/types';\nimport { Layer } from '@hh.ru/magritte-ui-layer';\n\nimport styles from './drop.less';\n\nconst PLACEMENTS_LIST: Placement[] = [\n 'left-top',\n 'left-bottom',\n 'right-top',\n 'right-bottom',\n 'top-left',\n 'top-right',\n 'bottom-left',\n 'bottom-right',\n];\n\nconst isKeyboardInput = (element: HTMLElement): boolean => {\n const tagName = element.tagName.toLowerCase();\n const keyboardInputTypes = ['text', 'password', 'email', 'number', 'tel', 'url', 'search'];\n return (\n (tagName === 'input' && keyboardInputTypes.includes((element as HTMLInputElement).type)) ||\n tagName === 'textarea' ||\n element.hasAttribute('contenteditable')\n );\n};\n\nconst DropComponent = (\n {\n visible,\n activatorRef,\n onClose,\n maxWidth = 320,\n minHeight = 200,\n width,\n space = 600,\n children,\n footer,\n role = 'dialog',\n dividerState = 'show',\n widthEqualToActivator = false,\n allowShrinkHeightToFitIntoViewport = true,\n autoFocusWhenOpened,\n closeByClickOutside = true,\n 'data-qa': dataQA = 'drop',\n onAppear,\n onBeforeExit,\n onAfterExit,\n placement,\n forcePlacement,\n ignoreIntersections,\n ...props\n }: DropProps,\n ref: ForwardedRef<HTMLElement>\n): ReactElement | null => {\n const { isMobile } = useBreakpoint();\n const [animationTimeout, setAnimationTimeout] = useState(200);\n const [isPlacementLocked, setPlacementLocked] = useState(false);\n const forceUpdateDropMetricsRef = useRef<VoidFunction>();\n\n const actualIgnoreIntersections =\n ignoreIntersections === undefined ? !allowShrinkHeightToFitIntoViewport : ignoreIntersections;\n\n const placementsList = useMemo(() => {\n const placementsArray: DropPlacement[] = Array.isArray(placement) ? placement : [placement];\n return (\n forcePlacement\n ? placementsArray\n : [...placementsArray, ...PLACEMENTS_LIST.filter((place) => !placement.includes(place))]\n ) as Placement[];\n }, [placement, forcePlacement]);\n\n useEffect(() => {\n const animationTimeoutElement = document.createElement('div');\n animationTimeoutElement.classList.add(styles.dropAnimationTimeout);\n document.body.appendChild(animationTimeoutElement);\n const style = window.getComputedStyle(animationTimeoutElement);\n const animationTimeout = parseInt(style.getPropertyValue(`--animation-duration`), 10);\n if (Number.isInteger(animationTimeout)) {\n setAnimationTimeout(animationTimeout);\n }\n document.body.removeChild(animationTimeoutElement);\n }, []);\n\n useEffect(() => {\n forceUpdateDropMetricsRef.current?.();\n }, [maxWidth, space, footer]);\n\n const focusHandler = (event: Event | FocusEvent) => {\n const target = event.target;\n if (!target || !isKeyboardInput(target as HTMLElement)) {\n return;\n }\n setPlacementLocked(true);\n };\n const blurHandler = () => setPlacementLocked(false);\n\n useEffect(() => {\n if (!visible || isMobile || !activatorRef.current) {\n return void 0;\n }\n\n const activatorElement = activatorRef.current;\n activatorElement.addEventListener('focus', focusHandler);\n activatorElement.addEventListener('blur', blurHandler);\n return () => {\n activatorElement.removeEventListener('focus', focusHandler);\n activatorElement.removeEventListener('blur', blurHandler);\n };\n }, [visible, activatorRef, isMobile]);\n\n if (isMobile) {\n return null;\n }\n\n let widthStyle: CSSProperties;\n if (widthEqualToActivator) {\n widthStyle = { width: '100%' };\n } else {\n widthStyle = width ? { width } : { maxWidth };\n }\n\n return (\n <Layer layer={InternalLayerName.Drop}>\n <DropBase\n {...props}\n visible={visible}\n placement={placementsList}\n activatorRef={activatorRef}\n closeByClickOutside={closeByClickOutside}\n onClose={onClose}\n autoFocusWhenOpened={autoFocusWhenOpened ?? role !== 'status'}\n animationClassNames={{\n enter: styles.dropEnter,\n enterActive: styles.dropEnterActive,\n exit: styles.dropExit,\n exitActive: styles.dropExitActive,\n }}\n animationTimeout={animationTimeout}\n widthEqualToActivator={widthEqualToActivator}\n allowShrinkHeightToFitIntoViewport={allowShrinkHeightToFitIntoViewport}\n ignoreIntersections={actualIgnoreIntersections}\n minHeight={minHeight}\n ref={ref}\n onAppear={onAppear}\n onBeforeExit={onBeforeExit}\n onAfterExit={onAfterExit}\n forceDropMetricsUpdate={forceUpdateDropMetricsRef as RefObject<VoidFunction>}\n lockPlacement={isPlacementLocked}\n >\n {(resizeRefCallbackFactory) => (\n <div\n className={classnames(styles.drop, {\n [styles.dropSpace300]: space === 300,\n [styles.dropSpace400]: space === 400,\n [styles.dropSpace600]: space === 600,\n [styles.dropWithFooter]: !!footer,\n })}\n style={widthStyle}\n data-qa={dataQA}\n key=\"drop-outer-container\"\n onFocus={focusHandler}\n onBlur={blurHandler}\n >\n <DropContainer\n key=\"drop-container\"\n dividerState={!footer ? 'hide' : dividerState}\n ref={resizeRefCallbackFactory('scroll-container', false, true)}\n >\n <div ref={resizeRefCallbackFactory('drop-content')}>\n <PureChildren>{children}</PureChildren>\n </div>\n </DropContainer>\n {footer && (\n <div ref={resizeRefCallbackFactory('drop-footer')} className={styles.dropFooter}>\n <PureChildren>{footer}</PureChildren>\n </div>\n )}\n </div>\n )}\n </DropBase>\n </Layer>\n );\n};\n\nconst Drop = forwardRef<HTMLElement, DropProps>(DropComponent);\nexport { Drop };\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;AAwBA,MAAM,eAAe,GAAgB;IACjC,UAAU;IACV,aAAa;IACb,WAAW;IACX,cAAc;IACd,UAAU;IACV,WAAW;IACX,aAAa;IACb,cAAc;CACjB,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,OAAoB,KAAa;IACtD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;AAC9C,IAAA,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC3F,IAAA,QACI,CAAC,OAAO,KAAK,OAAO,IAAI,kBAAkB,CAAC,QAAQ,CAAE,OAA4B,CAAC,IAAI,CAAC;AACvF,QAAA,OAAO,KAAK,UAAU;AACtB,QAAA,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC,EACzC;AACN,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAClB,EACI,OAAO,EACP,YAAY,EACZ,OAAO,EACP,QAAQ,GAAG,GAAG,EACd,SAAS,GAAG,GAAG,EACf,KAAK,EACL,KAAK,GAAG,GAAG,EACX,QAAQ,EACR,MAAM,EACN,IAAI,GAAG,QAAQ,EACf,YAAY,GAAG,MAAM,EACrB,qBAAqB,GAAG,KAAK,EAC7B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4
|
import { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';
|
|
5
5
|
import { Divider } from '@hh.ru/magritte-ui-divider';
|
|
6
6
|
|
|
7
|
-
var styles = {"drop":"magritte-drop___Z10P4_7-2-
|
|
7
|
+
var styles = {"drop":"magritte-drop___Z10P4_7-2-4","drop-container":"magritte-drop-container___dbMt9_7-2-4","dropContainer":"magritte-drop-container___dbMt9_7-2-4","divider-container":"magritte-divider-container___ZCdDW_7-2-4","dividerContainer":"magritte-divider-container___ZCdDW_7-2-4","drop-footer":"magritte-drop-footer___v8ZEO_7-2-4","dropFooter":"magritte-drop-footer___v8ZEO_7-2-4","drop-space-300":"magritte-drop-space-300___41acH_7-2-4","dropSpace300":"magritte-drop-space-300___41acH_7-2-4","drop-space-400":"magritte-drop-space-400___XX1RM_7-2-4","dropSpace400":"magritte-drop-space-400___XX1RM_7-2-4","drop-padding":"magritte-drop-padding___xBiJO_7-2-4","dropPadding":"magritte-drop-padding___xBiJO_7-2-4","drop-space-600":"magritte-drop-space-600___6B1i0_7-2-4","dropSpace600":"magritte-drop-space-600___6B1i0_7-2-4","drop-with-footer":"magritte-drop-with-footer___CgBIV_7-2-4","dropWithFooter":"magritte-drop-with-footer___CgBIV_7-2-4","drop-enter":"magritte-drop-enter___4vEuH_7-2-4","dropEnter":"magritte-drop-enter___4vEuH_7-2-4","drop-exit":"magritte-drop-exit___brFjz_7-2-4","dropExit":"magritte-drop-exit___brFjz_7-2-4","drop-enter-active":"magritte-drop-enter-active___SQUog_7-2-4","dropEnterActive":"magritte-drop-enter-active___SQUog_7-2-4","drop-exit-active":"magritte-drop-exit-active___GB0ET_7-2-4","dropExitActive":"magritte-drop-exit-active___GB0ET_7-2-4","drop-animation-timeout":"magritte-drop-animation-timeout___uO7LF_7-2-4","dropAnimationTimeout":"magritte-drop-animation-timeout___uO7LF_7-2-4"};
|
|
8
8
|
|
|
9
9
|
const DropContainer = forwardRef(({ children, dividerState }, ref) => {
|
|
10
10
|
const dividerRef = useRef(null);
|
|
@@ -55,4 +55,4 @@ const DropContainer = forwardRef(({ children, dividerState }, ref) => {
|
|
|
55
55
|
DropContainer.displayName = 'DropContainer';
|
|
56
56
|
|
|
57
57
|
export { DropContainer as D, styles as s };
|
|
58
|
-
//# sourceMappingURL=DropContainer-
|
|
58
|
+
//# sourceMappingURL=DropContainer-DR1_Weix.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropContainer-
|
|
1
|
+
{"version":3,"file":"DropContainer-DR1_Weix.js","sources":["../src/DropContainer.tsx"],"sourcesContent":["import { useRef, type PropsWithChildren, useEffect, useCallback, forwardRef } from 'react';\n\nimport { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';\nimport { Divider } from '@hh.ru/magritte-ui-divider';\nimport type { DividerState } from '@hh.ru/magritte-ui-drop/types';\n\nimport styles from './drop.less';\n\nexport const DropContainer = forwardRef<\n HTMLDivElement,\n PropsWithChildren<{\n dividerState: DividerState;\n }>\n>(({ children, dividerState }, ref) => {\n const dividerRef = useRef<HTMLDivElement>(null);\n const showDividerRef = useRef(false);\n showDividerRef.current = dividerState !== 'hide';\n const contentContainerRef = useRef<HTMLDivElement>(null);\n const contentContainerRefMulti = useMultipleRefs(contentContainerRef, ref);\n\n const updateDividerVisibility = useCallback(\n (showDivider: boolean) => {\n if (!contentContainerRef.current || !dividerRef.current) {\n return;\n }\n if (!showDivider) {\n dividerRef.current.style.visibility = 'hidden';\n return;\n }\n if (contentContainerRef?.current !== null && dividerRef.current) {\n const hasScroll =\n contentContainerRef.current.scrollHeight - contentContainerRef.current.clientHeight > 0;\n dividerRef.current.style.visibility = hasScroll ? 'visible' : 'hidden';\n }\n },\n [contentContainerRef, dividerRef]\n );\n\n useEffect(() => {\n const observer = new ResizeObserver(() => {\n updateDividerVisibility(showDividerRef.current);\n });\n observer.observe(contentContainerRef.current as Element);\n return () => observer.disconnect();\n }, [updateDividerVisibility]);\n\n useEffect(() => {\n updateDividerVisibility(showDividerRef.current);\n // eslint-disable-next-line disable-autofix/react-hooks/exhaustive-deps\n }, [updateDividerVisibility, showDividerRef.current]);\n\n const props = showDividerRef.current\n ? {\n onScroll: ({ target }: { target: EventTarget }) => {\n const scrollableContainer = target as HTMLDivElement;\n\n if (dividerRef.current && dividerState !== 'showWhenFullyScrolled') {\n const scrollEnded =\n scrollableContainer.scrollTop +\n scrollableContainer.offsetHeight -\n scrollableContainer.scrollHeight ===\n 0;\n\n dividerRef.current.style.visibility = scrollEnded ? 'hidden' : 'visible';\n }\n },\n }\n : {};\n\n return (\n <>\n <div ref={contentContainerRefMulti} className={styles.dropContainer} {...props}>\n {children}\n </div>\n <div ref={dividerRef} className={styles.dividerContainer} data-qa=\"drop-divider\">\n <Divider />\n </div>\n </>\n );\n});\n\nDropContainer.displayName = 'DropContainer';\n"],"names":["_jsxs","_Fragment","_jsx"],"mappings":";;;;;;;AAQO,MAAM,aAAa,GAAG,UAAU,CAKrC,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,GAAG,KAAI;AAClC,IAAA,MAAM,UAAU,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;AAChD,IAAA,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AACrC,IAAA,cAAc,CAAC,OAAO,GAAG,YAAY,KAAK,MAAM,CAAC;AACjD,IAAA,MAAM,mBAAmB,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IACzD,MAAM,wBAAwB,GAAG,eAAe,CAAC,mBAAmB,EAAE,GAAG,CAAC,CAAC;AAE3E,IAAA,MAAM,uBAAuB,GAAG,WAAW,CACvC,CAAC,WAAoB,KAAI;QACrB,IAAI,CAAC,mBAAmB,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE;YACrD,OAAO;SACV;QACD,IAAI,CAAC,WAAW,EAAE;YACd,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC;YAC/C,OAAO;SAC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CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;iBAC5E;aACJ;AACJ,SAAA;UACD,EAAE,CAAC;AAET,IAAA,QACIA,IACI,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CAAAC,GAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,CAAC,aAAa,EAAA,GAAM,KAAK,EAAA,QAAA,EACzE,QAAQ,EACP,CAAA,EACNA,GAAK,CAAA,KAAA,EAAA,EAAA,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,CAAC,gBAAgB,EAAU,SAAA,EAAA,cAAc,YAC5EA,GAAC,CAAA,OAAO,KAAG,EACT,CAAA,CAAA,EAAA,CACP,EACL;AACN,CAAC,EAAE;AAEH,aAAa,CAAC,WAAW,GAAG,eAAe;;;;"}
|
package/DropContainer.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { DividerState } from '@hh.ru/magritte-ui-drop/types';
|
|
3
2
|
export declare const DropContainer: import("react").ForwardRefExoticComponent<{
|
|
4
3
|
dividerState: DividerState;
|
|
5
4
|
} & {
|
|
6
|
-
children?: import("react").ReactNode;
|
|
5
|
+
children?: import("react").ReactNode | undefined;
|
|
7
6
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
package/DropContainer.js
CHANGED
|
@@ -3,5 +3,5 @@ import 'react/jsx-runtime';
|
|
|
3
3
|
import 'react';
|
|
4
4
|
import '@hh.ru/magritte-common-use-multiple-refs';
|
|
5
5
|
import '@hh.ru/magritte-ui-divider';
|
|
6
|
-
export { D as DropContainer } from './DropContainer-
|
|
6
|
+
export { D as DropContainer } from './DropContainer-DR1_Weix.js';
|
|
7
7
|
//# sourceMappingURL=DropContainer.js.map
|
package/index.css
CHANGED
|
@@ -1,130 +1,130 @@
|
|
|
1
1
|
:root{
|
|
2
|
-
--magritte-color-component-drop-background-content-v19-1-
|
|
3
|
-
--magritte-shadow-level-2-color-v19-1-
|
|
4
|
-
--magritte-shadow-level-2-x-v19-1-
|
|
5
|
-
--magritte-shadow-level-2-y-v19-1-
|
|
6
|
-
--magritte-shadow-level-2-blur-v19-1-
|
|
7
|
-
--magritte-shadow-level-2-spread-v19-1-
|
|
2
|
+
--magritte-color-component-drop-background-content-v19-1-2:#ffffff;
|
|
3
|
+
--magritte-shadow-level-2-color-v19-1-2:#7090b03d;
|
|
4
|
+
--magritte-shadow-level-2-x-v19-1-2:0px;
|
|
5
|
+
--magritte-shadow-level-2-y-v19-1-2:8px;
|
|
6
|
+
--magritte-shadow-level-2-blur-v19-1-2:16px;
|
|
7
|
+
--magritte-shadow-level-2-spread-v19-1-2:0px;
|
|
8
8
|
}
|
|
9
9
|
:root{
|
|
10
|
-
--magritte-semantic-animation-ease-in-out-100-duration-v19-1-
|
|
11
|
-
--magritte-semantic-animation-ease-in-out-200-timing-function-v19-1-
|
|
12
|
-
--magritte-semantic-animation-ease-in-out-200-duration-v19-1-
|
|
13
|
-
--magritte-static-space-300-v19-1-
|
|
14
|
-
--magritte-static-space-400-v19-1-
|
|
15
|
-
--magritte-static-space-600-v19-1-
|
|
16
|
-
--magritte-static-border-radius-600-v19-1-
|
|
10
|
+
--magritte-semantic-animation-ease-in-out-100-duration-v19-1-2:100ms;
|
|
11
|
+
--magritte-semantic-animation-ease-in-out-200-timing-function-v19-1-2:cubic-bezier(0.25, 0.1, 0.25, 1);
|
|
12
|
+
--magritte-semantic-animation-ease-in-out-200-duration-v19-1-2:200ms;
|
|
13
|
+
--magritte-static-space-300-v19-1-2:12px;
|
|
14
|
+
--magritte-static-space-400-v19-1-2:16px;
|
|
15
|
+
--magritte-static-space-600-v19-1-2:24px;
|
|
16
|
+
--magritte-static-border-radius-600-v19-1-2:24px;
|
|
17
17
|
}
|
|
18
18
|
.magritte-night-theme{
|
|
19
|
-
--magritte-color-component-drop-background-content-v19-1-
|
|
20
|
-
--magritte-shadow-level-2-color-v19-1-
|
|
21
|
-
--magritte-shadow-level-2-x-v19-1-
|
|
22
|
-
--magritte-shadow-level-2-y-v19-1-
|
|
23
|
-
--magritte-shadow-level-2-blur-v19-1-
|
|
24
|
-
--magritte-shadow-level-2-spread-v19-1-
|
|
19
|
+
--magritte-color-component-drop-background-content-v19-1-2:#1B1B1B;
|
|
20
|
+
--magritte-shadow-level-2-color-v19-1-2:#0000003d;
|
|
21
|
+
--magritte-shadow-level-2-x-v19-1-2:0px;
|
|
22
|
+
--magritte-shadow-level-2-y-v19-1-2:8px;
|
|
23
|
+
--magritte-shadow-level-2-blur-v19-1-2:16px;
|
|
24
|
+
--magritte-shadow-level-2-spread-v19-1-2:0px;
|
|
25
25
|
}
|
|
26
|
-
.magritte-drop___Z10P4_7-2-
|
|
26
|
+
.magritte-drop___Z10P4_7-2-4{
|
|
27
27
|
position:relative;
|
|
28
28
|
display:flex;
|
|
29
29
|
flex-direction:column;
|
|
30
|
-
background:var(--magritte-color-component-drop-background-content-v19-1-
|
|
31
|
-
border-radius:var(--magritte-static-border-radius-600-v19-1-
|
|
32
|
-
box-shadow:var(--magritte-shadow-level-2-x-v19-1-
|
|
30
|
+
background:var(--magritte-color-component-drop-background-content-v19-1-2);
|
|
31
|
+
border-radius:var(--magritte-static-border-radius-600-v19-1-2);
|
|
32
|
+
box-shadow:var(--magritte-shadow-level-2-x-v19-1-2) var(--magritte-shadow-level-2-y-v19-1-2) var(--magritte-shadow-level-2-blur-v19-1-2) var(--magritte-shadow-level-2-spread-v19-1-2) var(--magritte-shadow-level-2-color-v19-1-2);
|
|
33
33
|
box-sizing:border-box;
|
|
34
34
|
height:100%;
|
|
35
35
|
overflow:hidden;
|
|
36
36
|
}
|
|
37
|
-
.magritte-drop-container___dbMt9_7-2-
|
|
37
|
+
.magritte-drop-container___dbMt9_7-2-4{
|
|
38
38
|
display:block;
|
|
39
39
|
overflow:auto;
|
|
40
40
|
}
|
|
41
|
-
.magritte-divider-container___ZCdDW_7-2-
|
|
41
|
+
.magritte-divider-container___ZCdDW_7-2-4{
|
|
42
42
|
visibility:hidden;
|
|
43
43
|
}
|
|
44
|
-
.magritte-drop-footer___v8ZEO_7-2-
|
|
44
|
+
.magritte-drop-footer___v8ZEO_7-2-4{
|
|
45
45
|
display:flex;
|
|
46
46
|
flex-flow:column;
|
|
47
47
|
gap:12px;
|
|
48
48
|
}
|
|
49
|
-
.magritte-drop-space-300___41acH_7-2-
|
|
50
|
-
.magritte-drop-space-300___41acH_7-2-
|
|
51
|
-
padding:var(--magritte-static-space-300-v19-1-
|
|
49
|
+
.magritte-drop-space-300___41acH_7-2-4 .magritte-drop-container___dbMt9_7-2-4,
|
|
50
|
+
.magritte-drop-space-300___41acH_7-2-4 .magritte-drop-footer___v8ZEO_7-2-4{
|
|
51
|
+
padding:var(--magritte-static-space-300-v19-1-2);
|
|
52
52
|
}
|
|
53
|
-
.magritte-drop-space-400___XX1RM_7-2-
|
|
54
|
-
.magritte-drop-space-400___XX1RM_7-2-
|
|
55
|
-
.magritte-drop-space-400___XX1RM_7-2-
|
|
56
|
-
padding:var(--magritte-static-space-400-v19-1-
|
|
53
|
+
.magritte-drop-space-400___XX1RM_7-2-4 .magritte-drop-padding___xBiJO_7-2-4,
|
|
54
|
+
.magritte-drop-space-400___XX1RM_7-2-4 .magritte-drop-container___dbMt9_7-2-4,
|
|
55
|
+
.magritte-drop-space-400___XX1RM_7-2-4 .magritte-drop-footer___v8ZEO_7-2-4{
|
|
56
|
+
padding:var(--magritte-static-space-400-v19-1-2);
|
|
57
57
|
}
|
|
58
|
-
.magritte-drop-space-600___6B1i0_7-2-
|
|
59
|
-
.magritte-drop-space-600___6B1i0_7-2-
|
|
60
|
-
.magritte-drop-space-600___6B1i0_7-2-
|
|
61
|
-
padding:var(--magritte-static-space-600-v19-1-
|
|
58
|
+
.magritte-drop-space-600___6B1i0_7-2-4 .magritte-drop-padding___xBiJO_7-2-4,
|
|
59
|
+
.magritte-drop-space-600___6B1i0_7-2-4 .magritte-drop-container___dbMt9_7-2-4,
|
|
60
|
+
.magritte-drop-space-600___6B1i0_7-2-4 .magritte-drop-footer___v8ZEO_7-2-4{
|
|
61
|
+
padding:var(--magritte-static-space-600-v19-1-2);
|
|
62
62
|
}
|
|
63
|
-
.magritte-drop-with-footer___CgBIV_7-2-
|
|
63
|
+
.magritte-drop-with-footer___CgBIV_7-2-4 .magritte-drop-container___dbMt9_7-2-4{
|
|
64
64
|
padding-bottom:0;
|
|
65
65
|
}
|
|
66
66
|
@media (prefers-reduced-motion: no-preference){
|
|
67
|
-
.magritte-drop-enter___4vEuH_7-2-
|
|
67
|
+
.magritte-drop-enter___4vEuH_7-2-4 .magritte-drop___Z10P4_7-2-4{
|
|
68
68
|
opacity:0;
|
|
69
69
|
}
|
|
70
|
-
.magritte-drop-exit___brFjz_7-2-
|
|
71
|
-
.magritte-drop-enter-active___SQUog_7-2-
|
|
70
|
+
.magritte-drop-exit___brFjz_7-2-4 .magritte-drop___Z10P4_7-2-4,
|
|
71
|
+
.magritte-drop-enter-active___SQUog_7-2-4 .magritte-drop___Z10P4_7-2-4{
|
|
72
72
|
opacity:1;
|
|
73
73
|
}
|
|
74
|
-
.magritte-drop-exit-active___GB0ET_7-2-
|
|
74
|
+
.magritte-drop-exit-active___GB0ET_7-2-4 .magritte-drop___Z10P4_7-2-4{
|
|
75
75
|
opacity:0;
|
|
76
76
|
}
|
|
77
|
-
.magritte-drop-animation-timeout___uO7LF_7-2-
|
|
78
|
-
.magritte-drop-enter-active___SQUog_7-2-
|
|
77
|
+
.magritte-drop-animation-timeout___uO7LF_7-2-4,
|
|
78
|
+
.magritte-drop-enter-active___SQUog_7-2-4 .magritte-drop___Z10P4_7-2-4{
|
|
79
79
|
transition-property:opacity, transform;
|
|
80
|
-
transition-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v19-1-
|
|
81
|
-
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v19-1-
|
|
82
|
-
--animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v19-1-
|
|
80
|
+
transition-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v19-1-2);
|
|
81
|
+
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v19-1-2);
|
|
82
|
+
--animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v19-1-2);
|
|
83
83
|
}
|
|
84
|
-
.magritte-drop-animation-timeout___uO7LF_7-2-
|
|
85
|
-
.magritte-drop-exit-active___GB0ET_7-2-
|
|
84
|
+
.magritte-drop-animation-timeout___uO7LF_7-2-4,
|
|
85
|
+
.magritte-drop-exit-active___GB0ET_7-2-4 .magritte-drop___Z10P4_7-2-4{
|
|
86
86
|
transition-property:opacity, transform;
|
|
87
|
-
transition-duration:var(--magritte-semantic-animation-ease-in-out-100-duration-v19-1-
|
|
88
|
-
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v19-1-
|
|
87
|
+
transition-duration:var(--magritte-semantic-animation-ease-in-out-100-duration-v19-1-2);
|
|
88
|
+
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v19-1-2);
|
|
89
89
|
}
|
|
90
|
-
.magritte-drop-enter___4vEuH_7-2-
|
|
90
|
+
.magritte-drop-enter___4vEuH_7-2-4[data-magritte-drop-base-direction='top'] .magritte-drop___Z10P4_7-2-4{
|
|
91
91
|
transform:translateY(-4px);
|
|
92
92
|
}
|
|
93
|
-
.magritte-drop-exit-active___GB0ET_7-2-
|
|
93
|
+
.magritte-drop-exit-active___GB0ET_7-2-4[data-magritte-drop-base-direction='top'] .magritte-drop___Z10P4_7-2-4{
|
|
94
94
|
transform:translateY(-4px);
|
|
95
95
|
}
|
|
96
|
-
.magritte-drop-enter___4vEuH_7-2-
|
|
96
|
+
.magritte-drop-enter___4vEuH_7-2-4[data-magritte-drop-base-direction='bottom'] .magritte-drop___Z10P4_7-2-4{
|
|
97
97
|
transform:translateY(4px);
|
|
98
98
|
}
|
|
99
|
-
.magritte-drop-exit-active___GB0ET_7-2-
|
|
99
|
+
.magritte-drop-exit-active___GB0ET_7-2-4[data-magritte-drop-base-direction='bottom'] .magritte-drop___Z10P4_7-2-4{
|
|
100
100
|
transform:translateY(4px);
|
|
101
101
|
}
|
|
102
|
-
.magritte-drop-enter___4vEuH_7-2-
|
|
102
|
+
.magritte-drop-enter___4vEuH_7-2-4[data-magritte-drop-base-direction='left'] .magritte-drop___Z10P4_7-2-4{
|
|
103
103
|
transform:translateX(-4px);
|
|
104
104
|
}
|
|
105
|
-
.magritte-drop-exit-active___GB0ET_7-2-
|
|
105
|
+
.magritte-drop-exit-active___GB0ET_7-2-4[data-magritte-drop-base-direction='left'] .magritte-drop___Z10P4_7-2-4{
|
|
106
106
|
transform:translateX(4px);
|
|
107
107
|
}
|
|
108
|
-
.magritte-drop-enter___4vEuH_7-2-
|
|
108
|
+
.magritte-drop-enter___4vEuH_7-2-4[data-magritte-drop-base-direction='right'] .magritte-drop___Z10P4_7-2-4{
|
|
109
109
|
transform:translateX(4px);
|
|
110
110
|
}
|
|
111
|
-
.magritte-drop-exit-active___GB0ET_7-2-
|
|
111
|
+
.magritte-drop-exit-active___GB0ET_7-2-4[data-magritte-drop-base-direction='right'] .magritte-drop___Z10P4_7-2-4{
|
|
112
112
|
transform:translateX(4px);
|
|
113
113
|
}
|
|
114
|
-
.magritte-drop-exit___brFjz_7-2-
|
|
115
|
-
.magritte-drop-enter-active___SQUog_7-2-
|
|
114
|
+
.magritte-drop-exit___brFjz_7-2-4[data-magritte-drop-base-direction='left'] .magritte-drop___Z10P4_7-2-4,
|
|
115
|
+
.magritte-drop-enter-active___SQUog_7-2-4[data-magritte-drop-base-direction='left'] .magritte-drop___Z10P4_7-2-4{
|
|
116
116
|
transform:translateX(0%);
|
|
117
117
|
}
|
|
118
|
-
.magritte-drop-exit___brFjz_7-2-
|
|
119
|
-
.magritte-drop-enter-active___SQUog_7-2-
|
|
118
|
+
.magritte-drop-exit___brFjz_7-2-4[data-magritte-drop-base-direction='bottom'] .magritte-drop___Z10P4_7-2-4,
|
|
119
|
+
.magritte-drop-enter-active___SQUog_7-2-4[data-magritte-drop-base-direction='bottom'] .magritte-drop___Z10P4_7-2-4{
|
|
120
120
|
transform:translateY(0%);
|
|
121
121
|
}
|
|
122
|
-
.magritte-drop-exit___brFjz_7-2-
|
|
123
|
-
.magritte-drop-enter-active___SQUog_7-2-
|
|
122
|
+
.magritte-drop-exit___brFjz_7-2-4[data-magritte-drop-base-direction='right'] .magritte-drop___Z10P4_7-2-4,
|
|
123
|
+
.magritte-drop-enter-active___SQUog_7-2-4[data-magritte-drop-base-direction='right'] .magritte-drop___Z10P4_7-2-4{
|
|
124
124
|
transform:translateX(0%);
|
|
125
125
|
}
|
|
126
|
-
.magritte-drop-exit___brFjz_7-2-
|
|
127
|
-
.magritte-drop-enter-active___SQUog_7-2-
|
|
126
|
+
.magritte-drop-exit___brFjz_7-2-4[data-magritte-drop-base-direction='top'] .magritte-drop___Z10P4_7-2-4,
|
|
127
|
+
.magritte-drop-enter-active___SQUog_7-2-4[data-magritte-drop-base-direction='top'] .magritte-drop___Z10P4_7-2-4{
|
|
128
128
|
transform:translateY(0%);
|
|
129
129
|
}
|
|
130
130
|
}
|
package/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import 'classnames';
|
|
|
7
7
|
import '@hh.ru/magritte-internal-drop-base';
|
|
8
8
|
import '@hh.ru/magritte-internal-layer-name';
|
|
9
9
|
import '@hh.ru/magritte-ui-breakpoint';
|
|
10
|
-
import './DropContainer-
|
|
10
|
+
import './DropContainer-DR1_Weix.js';
|
|
11
11
|
import '@hh.ru/magritte-common-use-multiple-refs';
|
|
12
12
|
import '@hh.ru/magritte-ui-divider';
|
|
13
13
|
import './PureChildren.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hh.ru/magritte-ui-drop",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.4",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@hh.ru/magritte-common-use-multiple-refs": "1.1.4",
|
|
24
|
-
"@hh.ru/magritte-design-tokens": "19.1.
|
|
25
|
-
"@hh.ru/magritte-internal-drop-base": "7.0.
|
|
24
|
+
"@hh.ru/magritte-design-tokens": "19.1.2",
|
|
25
|
+
"@hh.ru/magritte-internal-drop-base": "7.0.8",
|
|
26
26
|
"@hh.ru/magritte-internal-layer-name": "2.2.0",
|
|
27
|
-
"@hh.ru/magritte-ui-breakpoint": "4.0
|
|
28
|
-
"@hh.ru/magritte-ui-divider": "1.1.
|
|
27
|
+
"@hh.ru/magritte-ui-breakpoint": "4.1.0",
|
|
28
|
+
"@hh.ru/magritte-ui-divider": "1.1.35",
|
|
29
29
|
"@hh.ru/magritte-ui-layer": "2.1.0",
|
|
30
|
-
"@hh.ru/magritte-ui-theme-provider": "1.1.
|
|
30
|
+
"@hh.ru/magritte-ui-theme-provider": "1.1.31"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"classnames": "2.3.2",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "4adeae453af768d9a43f23cd7f9f43bb54676a3b"
|
|
40
40
|
}
|