@hh.ru/magritte-ui-drop 5.1.2 → 6.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  import { type ReactElement, ForwardedRef } from 'react';
2
2
  import { type DropBaseHorizontalPositionWithoutCenter, type DropBaseVerticalPositionWithoutCenter } from '@hh.ru/magritte-internal-drop-base';
3
3
  import type { DropProps } from './types';
4
- declare const Drop: (<T extends DropBaseHorizontalPositionWithoutCenter | DropBaseVerticalPositionWithoutCenter>(props: Omit<import("@hh.ru/magritte-internal-drop-base").DropBasePermanentProps, "arrowGuardDistance" | "children" | "animationTimeout" | "animationClassNames" | "role" | "autoFocusWhenOpened" | "guardDistance" | "occupyAllAvailableViewportHeight"> & T & import("./types").DropPropsOnly & {
4
+ declare const Drop: (<T extends DropBaseHorizontalPositionWithoutCenter | DropBaseVerticalPositionWithoutCenter>(props: Omit<import("@hh.ru/magritte-internal-drop-base").DropBasePermanentProps, "arrowGuardDistance" | "children" | "animationTimeout" | "animationClassNames" | "role" | "guardDistance" | "occupyAllAvailableViewportHeight"> & T & import("./types").DropPropsOnly & {
5
5
  children?: import("react").ReactNode;
6
6
  } & {
7
7
  ref?: ForwardedRef<HTMLElement> | undefined;
package/Drop.js CHANGED
@@ -5,12 +5,12 @@ import classnames from 'classnames';
5
5
  import { DropBase, INITIAL_HEIGHT_VALUE } 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-9868e0d6.js';
8
+ import { s as styles, D as DropContainer } from './DropContainer-a08cd04b.js';
9
9
  import { PureChildren } from './PureChildren.js';
10
10
  import { Layer } from '@hh.ru/magritte-ui-layer';
11
11
  import '@hh.ru/magritte-ui-divider';
12
12
 
13
- const DropComponent = ({ direction, alignment, visible, host, activatorRef, onClose, maxWidth = 320, minHeightForContent = 300, space = 600, children, footer, role = 'dialog', dividerState = 'show', widthEqualToActivator = false, closeByClickOutside = true, 'data-qa': dataQA = 'drop', onAppear, onBeforeExit, onAfterExit, ...props }, ref) => {
13
+ const DropComponent = ({ direction, alignment, visible, host, activatorRef, onClose, maxWidth = 320, minHeightForContent = 300, space = 600, children, footer, role = 'dialog', dividerState = 'show', widthEqualToActivator = false, autoFocusWhenOpened, closeByClickOutside = true, 'data-qa': dataQA = 'drop', onAppear, onBeforeExit, onAfterExit, ...props }, ref) => {
14
14
  const { isMobile } = useBreakpoint();
15
15
  const footerRef = useRef(null);
16
16
  const [animationTimeout, setAnimationTimeout] = useState(200);
@@ -29,7 +29,7 @@ const DropComponent = ({ direction, alignment, visible, host, activatorRef, onCl
29
29
  return null;
30
30
  }
31
31
  const position = { direction, alignment };
32
- return (jsx(Layer, { layer: InternalLayerName.Drop, children: jsx(DropBase, { ...props, ...position, visible: visible, host: host, activatorRef: activatorRef, closeByClickOutside: closeByClickOutside, onClose: onClose, autoFocusWhenOpened: role !== 'status', occupyAllAvailableViewportHeight: true, animationClassNames: {
32
+ return (jsx(Layer, { layer: InternalLayerName.Drop, children: jsx(DropBase, { ...props, ...position, visible: visible, host: host, activatorRef: activatorRef, closeByClickOutside: closeByClickOutside, onClose: onClose, autoFocusWhenOpened: autoFocusWhenOpened ?? role !== 'status', occupyAllAvailableViewportHeight: true, animationClassNames: {
33
33
  enter: styles.dropEnter,
34
34
  enterActive: styles.dropEnterActive,
35
35
  exit: styles.dropExit,
package/Drop.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Drop.js","sources":["../src/Drop.tsx"],"sourcesContent":["import { useRef, useEffect, useState, type ReactElement, ForwardedRef, forwardRef } from 'react';\nimport classnames from 'classnames';\n\nimport {\n DropBase,\n INITIAL_HEIGHT_VALUE,\n type DropBaseHorizontalPositionWithoutCenter,\n type DropBaseVerticalPositionWithoutCenter,\n} 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 } from '@hh.ru/magritte-ui-drop/types';\nimport { Layer } from '@hh.ru/magritte-ui-layer';\n\nimport styles from './drop.less';\n\nconst DropComponent = <T extends DropBaseHorizontalPositionWithoutCenter | DropBaseVerticalPositionWithoutCenter>(\n {\n direction,\n alignment,\n visible,\n host,\n activatorRef,\n onClose,\n maxWidth = 320,\n minHeightForContent = 300,\n space = 600,\n children,\n footer,\n role = 'dialog',\n dividerState = 'show',\n widthEqualToActivator = false,\n closeByClickOutside = true,\n 'data-qa': dataQA = 'drop',\n onAppear,\n onBeforeExit,\n onAfterExit,\n ...props\n }: DropProps<T>,\n ref: ForwardedRef<HTMLElement>\n): ReactElement | null => {\n const { isMobile } = useBreakpoint();\n const footerRef = useRef<HTMLDivElement>(null);\n const [animationTimeout, setAnimationTimeout] = useState(200);\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 if (isMobile) {\n return null;\n }\n\n const position = { direction, alignment } as\n | DropBaseVerticalPositionWithoutCenter\n | DropBaseHorizontalPositionWithoutCenter;\n\n return (\n <Layer layer={InternalLayerName.Drop}>\n <DropBase\n {...props}\n {...position}\n visible={visible}\n host={host}\n activatorRef={activatorRef}\n closeByClickOutside={closeByClickOutside}\n onClose={onClose}\n autoFocusWhenOpened={role !== 'status'}\n occupyAllAvailableViewportHeight\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 ref={ref}\n onAppear={onAppear}\n onBeforeExit={onBeforeExit}\n onAfterExit={onAfterExit}\n >\n {({ direction }, { metrics, dropScrollableContainerRef }) => (\n <div\n className={classnames(`${styles.drop} ${styles[`drop-direction-${direction}`]}`, {\n [styles.dropSpace300]: space === 300,\n [styles.dropSpace400]: space === 400,\n [styles.dropSpace600]: space === 600,\n [styles.dropWithFooter]: !!footer,\n })}\n style={{\n maxWidth: widthEqualToActivator ? 'none' : maxWidth,\n maxHeight: metrics.height === INITIAL_HEIGHT_VALUE ? 'auto' : `${metrics.height}px`,\n }}\n data-qa={dataQA}\n >\n <DropContainer\n height={metrics.height === INITIAL_HEIGHT_VALUE ? undefined : metrics.height}\n dividerState={!footer ? 'hide' : dividerState}\n ref={dropScrollableContainerRef}\n minHeightForContent={minHeightForContent}\n >\n <PureChildren>{children}</PureChildren>\n </DropContainer>\n {footer && (\n <div ref={footerRef} className={styles.dropFooter}>\n <PureChildren>{footer}</PureChildren>\n </div>\n )}\n </div>\n )}\n </DropBase>\n </Layer>\n );\n};\n\nconst Drop = forwardRef(DropComponent) as (<\n T extends DropBaseHorizontalPositionWithoutCenter | DropBaseVerticalPositionWithoutCenter\n>(\n props: DropProps<T> & { ref?: ForwardedRef<HTMLElement> }\n) => ReactElement | null) & { displayName?: string };\n\nDrop.displayName = 'Drop';\n\nexport { Drop };\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;AAkBA,MAAM,aAAa,GAAG,CAClB,EACI,SAAS,EACT,SAAS,EACT,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,QAAQ,GAAG,GAAG,EACd,mBAAmB,GAAG,GAAG,EACzB,KAAK,GAAG,GAAG,EACX,QAAQ,EACR,MAAM,EACN,IAAI,GAAG,QAAQ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AAS,EAAE,OAAO,CAAC,MAAM,KAAK,oBAAoB,GAAG,MAAM,GAAG,GAAG,OAAO,CAAC,MAAM,CAAI,EAAA,CAAA;AACtF,iBAAA,EAAA,SAAA,EACQ,MAAM,EAEf,QAAA,EAAA,CAAAD,GAAA,CAAC,aAAa,EAAA,EACV,MAAM,EAAE,OAAO,CAAC,MAAM,KAAK,oBAAoB,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,EAC5E,YAAY,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,YAAY,EAC7C,GAAG,EAAE,0BAA0B,EAC/B,mBAAmB,EAAE,mBAAmB,EAExC,QAAA,EAAAA,GAAA,CAAC,YAAY,EAAE,EAAA,QAAA,EAAA,QAAQ,EAAgB,CAAA,EAAA,CAC3B,EACf,MAAM,KACHA,GAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,UAAU,EAAA,QAAA,EAC7CA,IAAC,YAAY,EAAA,EAAA,QAAA,EAAE,MAAM,EAAA,CAAgB,GACnC,CACT,CAAA,EAAA,CACC,CACT,EACM,CAAA,EAAA,CACP,EACV;AACN,CAAC,CAAC;AAEF,MAAM,IAAI,GAAG,UAAU,CAAC,aAAa,EAIgB;AAErD,IAAI,CAAC,WAAW,GAAG,MAAM;;;;"}
1
+ {"version":3,"file":"Drop.js","sources":["../src/Drop.tsx"],"sourcesContent":["import { useRef, useEffect, useState, type ReactElement, ForwardedRef, forwardRef } from 'react';\nimport classnames from 'classnames';\n\nimport {\n DropBase,\n INITIAL_HEIGHT_VALUE,\n type DropBaseHorizontalPositionWithoutCenter,\n type DropBaseVerticalPositionWithoutCenter,\n} 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 } from '@hh.ru/magritte-ui-drop/types';\nimport { Layer } from '@hh.ru/magritte-ui-layer';\n\nimport styles from './drop.less';\n\nconst DropComponent = <T extends DropBaseHorizontalPositionWithoutCenter | DropBaseVerticalPositionWithoutCenter>(\n {\n direction,\n alignment,\n visible,\n host,\n activatorRef,\n onClose,\n maxWidth = 320,\n minHeightForContent = 300,\n space = 600,\n children,\n footer,\n role = 'dialog',\n dividerState = 'show',\n widthEqualToActivator = false,\n autoFocusWhenOpened,\n closeByClickOutside = true,\n 'data-qa': dataQA = 'drop',\n onAppear,\n onBeforeExit,\n onAfterExit,\n ...props\n }: DropProps<T>,\n ref: ForwardedRef<HTMLElement>\n): ReactElement | null => {\n const { isMobile } = useBreakpoint();\n const footerRef = useRef<HTMLDivElement>(null);\n const [animationTimeout, setAnimationTimeout] = useState(200);\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 if (isMobile) {\n return null;\n }\n\n const position = { direction, alignment } as\n | DropBaseVerticalPositionWithoutCenter\n | DropBaseHorizontalPositionWithoutCenter;\n\n return (\n <Layer layer={InternalLayerName.Drop}>\n <DropBase\n {...props}\n {...position}\n visible={visible}\n host={host}\n activatorRef={activatorRef}\n closeByClickOutside={closeByClickOutside}\n onClose={onClose}\n autoFocusWhenOpened={autoFocusWhenOpened ?? role !== 'status'}\n occupyAllAvailableViewportHeight\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 ref={ref}\n onAppear={onAppear}\n onBeforeExit={onBeforeExit}\n onAfterExit={onAfterExit}\n >\n {({ direction }, { metrics, dropScrollableContainerRef }) => (\n <div\n className={classnames(`${styles.drop} ${styles[`drop-direction-${direction}`]}`, {\n [styles.dropSpace300]: space === 300,\n [styles.dropSpace400]: space === 400,\n [styles.dropSpace600]: space === 600,\n [styles.dropWithFooter]: !!footer,\n })}\n style={{\n maxWidth: widthEqualToActivator ? 'none' : maxWidth,\n maxHeight: metrics.height === INITIAL_HEIGHT_VALUE ? 'auto' : `${metrics.height}px`,\n }}\n data-qa={dataQA}\n >\n <DropContainer\n height={metrics.height === INITIAL_HEIGHT_VALUE ? undefined : metrics.height}\n dividerState={!footer ? 'hide' : dividerState}\n ref={dropScrollableContainerRef}\n minHeightForContent={minHeightForContent}\n >\n <PureChildren>{children}</PureChildren>\n </DropContainer>\n {footer && (\n <div ref={footerRef} className={styles.dropFooter}>\n <PureChildren>{footer}</PureChildren>\n </div>\n )}\n </div>\n )}\n </DropBase>\n </Layer>\n );\n};\n\nconst Drop = forwardRef(DropComponent) as (<\n T extends DropBaseHorizontalPositionWithoutCenter | DropBaseVerticalPositionWithoutCenter\n>(\n props: DropProps<T> & { ref?: ForwardedRef<HTMLElement> }\n) => ReactElement | null) & { displayName?: string };\n\nDrop.displayName = 'Drop';\n\nexport { Drop };\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;AAkBA,MAAM,aAAa,GAAG,CAClB,EACI,SAAS,EACT,SAAS,EACT,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,QAAQ,GAAG,GAAG,EACd,mBAAmB,GAAG,GAAG,EACzB,KAAK,GAAG,GAAG,EACX,QAAQ,EACR,MAAM,EACN,IAAI,GAAG,QAAQ,EACf,YAAY,GAAG,MAAM,EACrB,qBAAqB,GAAG,KAAK,EAC7B,mBAAmB,EACnB,mBAAmB,GAAG,IAAI,EAC1B,SAAS,EAAE,MAAM,GAAG,MAAM,EAC1B,QAAQ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A,EAAA,SAAA,EACQ,MAAM,EAEf,QAAA,EAAA,CAAAD,GAAA,CAAC,aAAa,EAAA,EACV,MAAM,EAAE,OAAO,CAAC,MAAM,KAAK,oBAAoB,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,EAC5E,YAAY,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,YAAY,EAC7C,GAAG,EAAE,0BAA0B,EAC/B,mBAAmB,EAAE,mBAAmB,EAExC,QAAA,EAAAA,GAAA,CAAC,YAAY,EAAE,EAAA,QAAA,EAAA,QAAQ,EAAgB,CAAA,EAAA,CAC3B,EACf,MAAM,KACHA,GAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,UAAU,EAAA,QAAA,EAC7CA,IAAC,YAAY,EAAA,EAAA,QAAA,EAAE,MAAM,EAAA,CAAgB,GACnC,CACT,CAAA,EAAA,CACC,CACT,EACM,CAAA,EAAA,CACP,EACV;AACN,CAAC,CAAC;AAEF,MAAM,IAAI,GAAG,UAAU,CAAC,aAAa,EAIgB;AAErD,IAAI,CAAC,WAAW,GAAG,MAAM;;;;"}
@@ -0,0 +1,36 @@
1
+ import './index.css';
2
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
+ import { forwardRef, useRef, useEffect } from 'react';
4
+ import { Divider } from '@hh.ru/magritte-ui-divider';
5
+
6
+ var styles = {"drop":"magritte-drop___Z10P4_6-0-1","drop-container":"magritte-drop-container___dbMt9_6-0-1","dropContainer":"magritte-drop-container___dbMt9_6-0-1","drop-footer":"magritte-drop-footer___v8ZEO_6-0-1","dropFooter":"magritte-drop-footer___v8ZEO_6-0-1","drop-space-300":"magritte-drop-space-300___41acH_6-0-1","dropSpace300":"magritte-drop-space-300___41acH_6-0-1","drop-space-400":"magritte-drop-space-400___XX1RM_6-0-1","dropSpace400":"magritte-drop-space-400___XX1RM_6-0-1","drop-padding":"magritte-drop-padding___xBiJO_6-0-1","dropPadding":"magritte-drop-padding___xBiJO_6-0-1","drop-space-600":"magritte-drop-space-600___6B1i0_6-0-1","dropSpace600":"magritte-drop-space-600___6B1i0_6-0-1","drop-with-footer":"magritte-drop-with-footer___CgBIV_6-0-1","dropWithFooter":"magritte-drop-with-footer___CgBIV_6-0-1","drop-enter":"magritte-drop-enter___4vEuH_6-0-1","dropEnter":"magritte-drop-enter___4vEuH_6-0-1","drop-exit":"magritte-drop-exit___brFjz_6-0-1","dropExit":"magritte-drop-exit___brFjz_6-0-1","drop-enter-active":"magritte-drop-enter-active___SQUog_6-0-1","dropEnterActive":"magritte-drop-enter-active___SQUog_6-0-1","drop-exit-active":"magritte-drop-exit-active___GB0ET_6-0-1","dropExitActive":"magritte-drop-exit-active___GB0ET_6-0-1","drop-animation-timeout":"magritte-drop-animation-timeout___uO7LF_6-0-1","dropAnimationTimeout":"magritte-drop-animation-timeout___uO7LF_6-0-1","drop-direction-top":"magritte-drop-direction-top___3CelS_6-0-1","dropDirectionTop":"magritte-drop-direction-top___3CelS_6-0-1","drop-direction-bottom":"magritte-drop-direction-bottom___719rs_6-0-1","dropDirectionBottom":"magritte-drop-direction-bottom___719rs_6-0-1","drop-direction-left":"magritte-drop-direction-left___2PTob_6-0-1","dropDirectionLeft":"magritte-drop-direction-left___2PTob_6-0-1","drop-direction-right":"magritte-drop-direction-right___SPOr1_6-0-1","dropDirectionRight":"magritte-drop-direction-right___SPOr1_6-0-1"};
7
+
8
+ const DropContainer = forwardRef(({ children, height, dividerState, minHeightForContent }, ref) => {
9
+ const dividerRef = useRef(null);
10
+ const showDivider = dividerState !== 'hide';
11
+ useEffect(() => {
12
+ if (showDivider && ref && 'current' in ref && ref?.current !== null && dividerRef.current && !!height) {
13
+ const hasScroll = ref.current.scrollHeight - ref.current.clientHeight > 0;
14
+ dividerRef.current.style.visibility = hasScroll ? 'visible' : 'hidden';
15
+ }
16
+ }, [ref, dividerRef, height, showDivider]);
17
+ const props = showDivider
18
+ ? {
19
+ onScroll: ({ target }) => {
20
+ const scrollableContainer = target;
21
+ if (dividerRef.current && dividerState !== 'showWhenFullyScrolled') {
22
+ const scrollEnded = scrollableContainer.scrollTop +
23
+ scrollableContainer.offsetHeight -
24
+ scrollableContainer.scrollHeight ===
25
+ 0;
26
+ dividerRef.current.style.visibility = scrollEnded ? 'hidden' : 'visible';
27
+ }
28
+ },
29
+ }
30
+ : {};
31
+ return (jsxs(Fragment, { children: [jsx("div", { ref: ref, className: styles.dropContainer, style: { height: height === undefined ? `${minHeightForContent}px` : 'auto' }, ...props, children: children }), showDivider && (jsx("div", { ref: dividerRef, "data-qa": "drop-divider", children: jsx(Divider, {}) }))] }));
32
+ });
33
+ DropContainer.displayName = 'DropContainer';
34
+
35
+ export { DropContainer as D, styles as s };
36
+ //# sourceMappingURL=DropContainer-a08cd04b.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DropContainer-9868e0d6.js","sources":["../src/DropContainer.tsx"],"sourcesContent":["import { useRef, PropsWithChildren, useEffect, forwardRef } from 'react';\n\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 height?: number | string;\n dividerState: DividerState;\n minHeightForContent: number;\n }>\n>(({ children, height, dividerState, minHeightForContent }, ref) => {\n const dividerRef = useRef<HTMLDivElement>(null);\n const showDivider = dividerState !== 'hide';\n\n useEffect(() => {\n if (showDivider && ref && 'current' in ref && ref?.current !== null && dividerRef.current && !!height) {\n const hasScroll = ref.current.scrollHeight - ref.current.clientHeight > 0;\n dividerRef.current.style.visibility = hasScroll ? 'visible' : 'hidden';\n }\n }, [ref, dividerRef, height, showDivider]);\n\n const props = showDivider\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\n ref={ref}\n className={styles.dropContainer}\n style={{ height: height === undefined ? `${minHeightForContent}px` : 'auto' }}\n {...props}\n >\n {children}\n </div>\n {showDivider && (\n <div ref={dividerRef} data-qa=\"drop-divider\">\n <Divider />\n </div>\n )}\n </>\n );\n});\n\nDropContainer.displayName = 'DropContainer';\n"],"names":["_jsxs","_Fragment","_jsx"],"mappings":";;;;;;AAOa,MAAA,aAAa,GAAG,UAAU,CAOrC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,mBAAmB,EAAE,EAAE,GAAG,KAAI;AAC/D,IAAA,MAAM,UAAU,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;AAChD,IAAA,MAAM,WAAW,GAAG,YAAY,KAAK,MAAM,CAAC;IAE5C,SAAS,CAAC,MAAK;QACX,IAAI,WAAW,IAAI,GAAG,IAAI,SAAS,IAAI,GAAG,IAAI,GAAG,EAAE,OAAO,KAAK,IAAI,IAAI,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,EAAE;AACnG,YAAA,MAAM,SAAS,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,GAAG,CAAC,CAAC;AAC1E,YAAA,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAC1E,SAAA;KACJ,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;IAE3C,MAAM,KAAK,GAAG,WAAW;AACrB,UAAE;AACI,YAAA,QAAQ,EAAE,CAAC,EAAE,MAAM,EAA2B,KAAI;gBAC9C,MAAM,mBAAmB,GAAG,MAAwB,CAAC;AAErD,gBAAA,IAAI,UAAU,CAAC,OAAO,IAAI,YAAY,KAAK,uBAAuB,EAAE;AAChE,oBAAA,MAAM,WAAW,GACb,mBAAmB,CAAC,SAAS;AACzB,wBAAA,mBAAmB,CAAC,YAAY;AAChC,wBAAA,mBAAmB,CAAC,YAAY;AACpC,wBAAA,CAAC,CAAC;AAEN,oBAAA,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;AAC5E,iBAAA;aACJ;AACJ,SAAA;UACD,EAAE,CAAC;IAET,QACIA,IACI,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CAAAC,GAAA,CAAA,KAAA,EAAA,EACI,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,MAAM,CAAC,aAAa,EAC/B,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,KAAK,SAAS,GAAG,CAAA,EAAG,mBAAmB,CAAA,EAAA,CAAI,GAAG,MAAM,EAAE,EACzE,GAAA,KAAK,EAER,QAAA,EAAA,QAAQ,EACP,CAAA,EACL,WAAW,KACRA,GAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,UAAU,EAAU,SAAA,EAAA,cAAc,EACxC,QAAA,EAAAA,GAAA,CAAC,OAAO,EAAA,EAAA,CAAG,EACT,CAAA,CACT,CACF,EAAA,CAAA,EACL;AACN,CAAC,EAAE;AAEH,aAAa,CAAC,WAAW,GAAG,eAAe;;;;"}
1
+ {"version":3,"file":"DropContainer-a08cd04b.js","sources":["../src/DropContainer.tsx"],"sourcesContent":["import { useRef, PropsWithChildren, useEffect, forwardRef } from 'react';\n\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 height?: number | string;\n dividerState: DividerState;\n minHeightForContent: number;\n }>\n>(({ children, height, dividerState, minHeightForContent }, ref) => {\n const dividerRef = useRef<HTMLDivElement>(null);\n const showDivider = dividerState !== 'hide';\n\n useEffect(() => {\n if (showDivider && ref && 'current' in ref && ref?.current !== null && dividerRef.current && !!height) {\n const hasScroll = ref.current.scrollHeight - ref.current.clientHeight > 0;\n dividerRef.current.style.visibility = hasScroll ? 'visible' : 'hidden';\n }\n }, [ref, dividerRef, height, showDivider]);\n\n const props = showDivider\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\n ref={ref}\n className={styles.dropContainer}\n style={{ height: height === undefined ? `${minHeightForContent}px` : 'auto' }}\n {...props}\n >\n {children}\n </div>\n {showDivider && (\n <div ref={dividerRef} data-qa=\"drop-divider\">\n <Divider />\n </div>\n )}\n </>\n );\n});\n\nDropContainer.displayName = 'DropContainer';\n"],"names":["_jsxs","_Fragment","_jsx"],"mappings":";;;;;;AAOa,MAAA,aAAa,GAAG,UAAU,CAOrC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,mBAAmB,EAAE,EAAE,GAAG,KAAI;AAC/D,IAAA,MAAM,UAAU,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;AAChD,IAAA,MAAM,WAAW,GAAG,YAAY,KAAK,MAAM,CAAC;IAE5C,SAAS,CAAC,MAAK;QACX,IAAI,WAAW,IAAI,GAAG,IAAI,SAAS,IAAI,GAAG,IAAI,GAAG,EAAE,OAAO,KAAK,IAAI,IAAI,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,EAAE;AACnG,YAAA,MAAM,SAAS,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,GAAG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C,WAAW,GAAG,eAAe;;;;"}
package/DropContainer.js CHANGED
@@ -2,5 +2,5 @@ import './index.css';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import '@hh.ru/magritte-ui-divider';
5
- export { D as DropContainer } from './DropContainer-9868e0d6.js';
5
+ export { D as DropContainer } from './DropContainer-a08cd04b.js';
6
6
  //# sourceMappingURL=DropContainer.js.map
package/index.css CHANGED
@@ -1,126 +1,126 @@
1
1
  :root{
2
- --magritte-color-component-drop-background-content-v18-1-2:#ffffff;
3
- --magritte-shadow-level-2-color-v18-1-2:#7090b03d;
4
- --magritte-shadow-level-2-x-v18-1-2:0px;
5
- --magritte-shadow-level-2-y-v18-1-2:8px;
6
- --magritte-shadow-level-2-blur-v18-1-2:16px;
7
- --magritte-shadow-level-2-spread-v18-1-2:0px;
2
+ --magritte-color-component-drop-background-content-v18-2-0:#ffffff;
3
+ --magritte-shadow-level-2-color-v18-2-0:#7090b03d;
4
+ --magritte-shadow-level-2-x-v18-2-0:0px;
5
+ --magritte-shadow-level-2-y-v18-2-0:8px;
6
+ --magritte-shadow-level-2-blur-v18-2-0:16px;
7
+ --magritte-shadow-level-2-spread-v18-2-0:0px;
8
8
  }
9
9
  :root{
10
- --magritte-semantic-animation-ease-in-out-100-duration-v18-1-2:100ms;
11
- --magritte-semantic-animation-ease-in-out-200-timing-function-v18-1-2:cubic-bezier(0.25, 0.1, 0.25, 1);
12
- --magritte-semantic-animation-ease-in-out-200-duration-v18-1-2:200ms;
13
- --magritte-static-space-300-v18-1-2:12px;
14
- --magritte-static-space-400-v18-1-2:16px;
15
- --magritte-static-space-600-v18-1-2:24px;
16
- --magritte-static-border-radius-600-v18-1-2:24px;
10
+ --magritte-semantic-animation-ease-in-out-100-duration-v18-2-0:100ms;
11
+ --magritte-semantic-animation-ease-in-out-200-timing-function-v18-2-0:cubic-bezier(0.25, 0.1, 0.25, 1);
12
+ --magritte-semantic-animation-ease-in-out-200-duration-v18-2-0:200ms;
13
+ --magritte-static-space-300-v18-2-0:12px;
14
+ --magritte-static-space-400-v18-2-0:16px;
15
+ --magritte-static-space-600-v18-2-0:24px;
16
+ --magritte-static-border-radius-600-v18-2-0:24px;
17
17
  }
18
18
  .magritte-night-theme{
19
- --magritte-color-component-drop-background-content-v18-1-2:#1B1B1B;
20
- --magritte-shadow-level-2-color-v18-1-2:#0000003d;
21
- --magritte-shadow-level-2-x-v18-1-2:0px;
22
- --magritte-shadow-level-2-y-v18-1-2:8px;
23
- --magritte-shadow-level-2-blur-v18-1-2:16px;
24
- --magritte-shadow-level-2-spread-v18-1-2:0px;
19
+ --magritte-color-component-drop-background-content-v18-2-0:#1B1B1B;
20
+ --magritte-shadow-level-2-color-v18-2-0:#0000003d;
21
+ --magritte-shadow-level-2-x-v18-2-0:0px;
22
+ --magritte-shadow-level-2-y-v18-2-0:8px;
23
+ --magritte-shadow-level-2-blur-v18-2-0:16px;
24
+ --magritte-shadow-level-2-spread-v18-2-0:0px;
25
25
  }
26
- .magritte-drop___Z10P4_5-1-2{
26
+ .magritte-drop___Z10P4_6-0-1{
27
27
  position:relative;
28
28
  display:flex;
29
29
  flex-direction:column;
30
- background:var(--magritte-color-component-drop-background-content-v18-1-2);
31
- border-radius:var(--magritte-static-border-radius-600-v18-1-2);
32
- box-shadow:var(--magritte-shadow-level-2-x-v18-1-2) var(--magritte-shadow-level-2-y-v18-1-2) var(--magritte-shadow-level-2-blur-v18-1-2) var(--magritte-shadow-level-2-spread-v18-1-2) var(--magritte-shadow-level-2-color-v18-1-2);
30
+ background:var(--magritte-color-component-drop-background-content-v18-2-0);
31
+ border-radius:var(--magritte-static-border-radius-600-v18-2-0);
32
+ box-shadow:var(--magritte-shadow-level-2-x-v18-2-0) var(--magritte-shadow-level-2-y-v18-2-0) var(--magritte-shadow-level-2-blur-v18-2-0) var(--magritte-shadow-level-2-spread-v18-2-0) var(--magritte-shadow-level-2-color-v18-2-0);
33
33
  box-sizing:border-box;
34
34
  overflow:hidden;
35
35
  }
36
- .magritte-drop-container___dbMt9_5-1-2{
36
+ .magritte-drop-container___dbMt9_6-0-1{
37
37
  display:block;
38
38
  overflow:auto;
39
39
  }
40
- .magritte-drop-footer___v8ZEO_5-1-2{
40
+ .magritte-drop-footer___v8ZEO_6-0-1{
41
41
  display:flex;
42
42
  flex-flow:column;
43
43
  gap:12px;
44
44
  }
45
- .magritte-drop-space-300___41acH_5-1-2 .magritte-drop-container___dbMt9_5-1-2,
46
- .magritte-drop-space-300___41acH_5-1-2 .magritte-drop-footer___v8ZEO_5-1-2{
47
- padding:var(--magritte-static-space-300-v18-1-2);
45
+ .magritte-drop-space-300___41acH_6-0-1 .magritte-drop-container___dbMt9_6-0-1,
46
+ .magritte-drop-space-300___41acH_6-0-1 .magritte-drop-footer___v8ZEO_6-0-1{
47
+ padding:var(--magritte-static-space-300-v18-2-0);
48
48
  }
49
- .magritte-drop-space-400___XX1RM_5-1-2 .magritte-drop-padding___xBiJO_5-1-2,
50
- .magritte-drop-space-400___XX1RM_5-1-2 .magritte-drop-container___dbMt9_5-1-2,
51
- .magritte-drop-space-400___XX1RM_5-1-2 .magritte-drop-footer___v8ZEO_5-1-2{
52
- padding:var(--magritte-static-space-400-v18-1-2);
49
+ .magritte-drop-space-400___XX1RM_6-0-1 .magritte-drop-padding___xBiJO_6-0-1,
50
+ .magritte-drop-space-400___XX1RM_6-0-1 .magritte-drop-container___dbMt9_6-0-1,
51
+ .magritte-drop-space-400___XX1RM_6-0-1 .magritte-drop-footer___v8ZEO_6-0-1{
52
+ padding:var(--magritte-static-space-400-v18-2-0);
53
53
  }
54
- .magritte-drop-space-600___6B1i0_5-1-2 .magritte-drop-padding___xBiJO_5-1-2,
55
- .magritte-drop-space-600___6B1i0_5-1-2 .magritte-drop-container___dbMt9_5-1-2,
56
- .magritte-drop-space-600___6B1i0_5-1-2 .magritte-drop-footer___v8ZEO_5-1-2{
57
- padding:var(--magritte-static-space-600-v18-1-2);
54
+ .magritte-drop-space-600___6B1i0_6-0-1 .magritte-drop-padding___xBiJO_6-0-1,
55
+ .magritte-drop-space-600___6B1i0_6-0-1 .magritte-drop-container___dbMt9_6-0-1,
56
+ .magritte-drop-space-600___6B1i0_6-0-1 .magritte-drop-footer___v8ZEO_6-0-1{
57
+ padding:var(--magritte-static-space-600-v18-2-0);
58
58
  }
59
- .magritte-drop-with-footer___CgBIV_5-1-2 .magritte-drop-container___dbMt9_5-1-2{
59
+ .magritte-drop-with-footer___CgBIV_6-0-1 .magritte-drop-container___dbMt9_6-0-1{
60
60
  padding-bottom:0;
61
61
  }
62
62
  @media (prefers-reduced-motion: no-preference){
63
- .magritte-drop-enter___4vEuH_5-1-2 .magritte-drop___Z10P4_5-1-2{
63
+ .magritte-drop-enter___4vEuH_6-0-1 .magritte-drop___Z10P4_6-0-1{
64
64
  opacity:0;
65
65
  }
66
- .magritte-drop-exit___brFjz_5-1-2 .magritte-drop___Z10P4_5-1-2,
67
- .magritte-drop-enter-active___SQUog_5-1-2 .magritte-drop___Z10P4_5-1-2{
66
+ .magritte-drop-exit___brFjz_6-0-1 .magritte-drop___Z10P4_6-0-1,
67
+ .magritte-drop-enter-active___SQUog_6-0-1 .magritte-drop___Z10P4_6-0-1{
68
68
  opacity:1;
69
69
  }
70
- .magritte-drop-exit-active___GB0ET_5-1-2 .magritte-drop___Z10P4_5-1-2{
70
+ .magritte-drop-exit-active___GB0ET_6-0-1 .magritte-drop___Z10P4_6-0-1{
71
71
  opacity:0;
72
72
  }
73
- .magritte-drop-animation-timeout___uO7LF_5-1-2,
74
- .magritte-drop-enter-active___SQUog_5-1-2 .magritte-drop___Z10P4_5-1-2{
73
+ .magritte-drop-animation-timeout___uO7LF_6-0-1,
74
+ .magritte-drop-enter-active___SQUog_6-0-1 .magritte-drop___Z10P4_6-0-1{
75
75
  transition-property:opacity, transform;
76
- transition-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v18-1-2);
77
- transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v18-1-2);
78
- --animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v18-1-2);
76
+ transition-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v18-2-0);
77
+ transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v18-2-0);
78
+ --animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v18-2-0);
79
79
  }
80
- .magritte-drop-animation-timeout___uO7LF_5-1-2,
81
- .magritte-drop-exit-active___GB0ET_5-1-2 .magritte-drop___Z10P4_5-1-2{
80
+ .magritte-drop-animation-timeout___uO7LF_6-0-1,
81
+ .magritte-drop-exit-active___GB0ET_6-0-1 .magritte-drop___Z10P4_6-0-1{
82
82
  transition-property:opacity, transform;
83
- transition-duration:var(--magritte-semantic-animation-ease-in-out-100-duration-v18-1-2);
84
- transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v18-1-2);
83
+ transition-duration:var(--magritte-semantic-animation-ease-in-out-100-duration-v18-2-0);
84
+ transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v18-2-0);
85
85
  }
86
- .magritte-drop-enter___4vEuH_5-1-2 .magritte-drop-direction-top___3CelS_5-1-2{
86
+ .magritte-drop-enter___4vEuH_6-0-1 .magritte-drop-direction-top___3CelS_6-0-1{
87
87
  transform:translateY(-4px);
88
88
  }
89
- .magritte-drop-exit___brFjz_5-1-2 .magritte-drop-direction-top___3CelS_5-1-2,
90
- .magritte-drop-enter-active___SQUog_5-1-2 .magritte-drop-direction-top___3CelS_5-1-2{
89
+ .magritte-drop-exit___brFjz_6-0-1 .magritte-drop-direction-top___3CelS_6-0-1,
90
+ .magritte-drop-enter-active___SQUog_6-0-1 .magritte-drop-direction-top___3CelS_6-0-1{
91
91
  transform:translateY(0%);
92
92
  }
93
- .magritte-drop-exit-active___GB0ET_5-1-2 .magritte-drop-direction-top___3CelS_5-1-2{
93
+ .magritte-drop-exit-active___GB0ET_6-0-1 .magritte-drop-direction-top___3CelS_6-0-1{
94
94
  transform:translateY(-4px);
95
95
  }
96
- .magritte-drop-enter___4vEuH_5-1-2 .magritte-drop-direction-bottom___719rs_5-1-2{
96
+ .magritte-drop-enter___4vEuH_6-0-1 .magritte-drop-direction-bottom___719rs_6-0-1{
97
97
  transform:translateY(4px);
98
98
  }
99
- .magritte-drop-exit___brFjz_5-1-2 .magritte-drop-direction-bottom___719rs_5-1-2,
100
- .magritte-drop-enter-active___SQUog_5-1-2 .magritte-drop-direction-bottom___719rs_5-1-2{
99
+ .magritte-drop-exit___brFjz_6-0-1 .magritte-drop-direction-bottom___719rs_6-0-1,
100
+ .magritte-drop-enter-active___SQUog_6-0-1 .magritte-drop-direction-bottom___719rs_6-0-1{
101
101
  transform:translateY(0%);
102
102
  }
103
- .magritte-drop-exit-active___GB0ET_5-1-2 .magritte-drop-direction-bottom___719rs_5-1-2{
103
+ .magritte-drop-exit-active___GB0ET_6-0-1 .magritte-drop-direction-bottom___719rs_6-0-1{
104
104
  transform:translateY(4px);
105
105
  }
106
- .magritte-drop-enter___4vEuH_5-1-2 .magritte-drop-direction-left___2PTob_5-1-2{
106
+ .magritte-drop-enter___4vEuH_6-0-1 .magritte-drop-direction-left___2PTob_6-0-1{
107
107
  transform:translateX(-4px);
108
108
  }
109
- .magritte-drop-exit___brFjz_5-1-2 .magritte-drop-direction-left___2PTob_5-1-2,
110
- .magritte-drop-enter-active___SQUog_5-1-2 .magritte-drop-direction-left___2PTob_5-1-2{
109
+ .magritte-drop-exit___brFjz_6-0-1 .magritte-drop-direction-left___2PTob_6-0-1,
110
+ .magritte-drop-enter-active___SQUog_6-0-1 .magritte-drop-direction-left___2PTob_6-0-1{
111
111
  transform:translateX(0%);
112
112
  }
113
- .magritte-drop-exit-active___GB0ET_5-1-2 .magritte-drop-direction-left___2PTob_5-1-2{
113
+ .magritte-drop-exit-active___GB0ET_6-0-1 .magritte-drop-direction-left___2PTob_6-0-1{
114
114
  transform:translateX(4px);
115
115
  }
116
- .magritte-drop-enter___4vEuH_5-1-2 .magritte-drop-direction-right___SPOr1_5-1-2{
116
+ .magritte-drop-enter___4vEuH_6-0-1 .magritte-drop-direction-right___SPOr1_6-0-1{
117
117
  transform:translateX(4px);
118
118
  }
119
- .magritte-drop-exit___brFjz_5-1-2 .magritte-drop-direction-right___SPOr1_5-1-2,
120
- .magritte-drop-enter-active___SQUog_5-1-2 .magritte-drop-direction-right___SPOr1_5-1-2{
119
+ .magritte-drop-exit___brFjz_6-0-1 .magritte-drop-direction-right___SPOr1_6-0-1,
120
+ .magritte-drop-enter-active___SQUog_6-0-1 .magritte-drop-direction-right___SPOr1_6-0-1{
121
121
  transform:translateX(0%);
122
122
  }
123
- .magritte-drop-exit-active___GB0ET_5-1-2 .magritte-drop-direction-right___SPOr1_5-1-2{
123
+ .magritte-drop-exit-active___GB0ET_6-0-1 .magritte-drop-direction-right___SPOr1_6-0-1{
124
124
  transform:translateX(4px);
125
125
  }
126
126
  }
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-9868e0d6.js';
10
+ import './DropContainer-a08cd04b.js';
11
11
  import '@hh.ru/magritte-ui-divider';
12
12
  import './PureChildren.js';
13
13
  import '@hh.ru/magritte-ui-layer';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hh.ru/magritte-ui-drop",
3
- "version": "5.1.2",
3
+ "version": "6.0.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -19,13 +19,13 @@
19
19
  "test": "yarn root:test $(pwd)"
20
20
  },
21
21
  "dependencies": {
22
- "@hh.ru/magritte-design-tokens": "18.1.2",
23
- "@hh.ru/magritte-internal-drop-base": "5.1.1",
22
+ "@hh.ru/magritte-design-tokens": "18.2.0",
23
+ "@hh.ru/magritte-internal-drop-base": "6.0.0",
24
24
  "@hh.ru/magritte-internal-layer-name": "2.1.1",
25
25
  "@hh.ru/magritte-ui-breakpoint": "4.0.2",
26
- "@hh.ru/magritte-ui-divider": "1.1.26",
26
+ "@hh.ru/magritte-ui-divider": "1.1.27",
27
27
  "@hh.ru/magritte-ui-layer": "2.0.4",
28
- "@hh.ru/magritte-ui-theme-provider": "1.1.23"
28
+ "@hh.ru/magritte-ui-theme-provider": "1.1.24"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "classnames": "2.3.2",
@@ -34,5 +34,5 @@
34
34
  "publishConfig": {
35
35
  "access": "public"
36
36
  },
37
- "gitHead": "a72846c6f393720276c3a8abcbd754142906f5d1"
37
+ "gitHead": "2096654db9454114e1dbf70e7a7786d7e5b688b8"
38
38
  }
package/types.d.ts CHANGED
@@ -23,4 +23,4 @@ export interface DropPropsOnly {
23
23
  /** Ширина дропа равна ширине активатора, при установке флага значение пропа maxWidth игнорируется */
24
24
  widthEqualToActivator?: boolean;
25
25
  }
26
- export type DropProps<T extends DropBaseHorizontalPositionWithoutCenter | DropBaseVerticalPositionWithoutCenter> = Omit<DropBasePermanentProps, 'arrowGuardDistance' | 'children' | 'animationTimeout' | 'animationClassNames' | 'role' | 'autoFocusWhenOpened' | 'guardDistance' | 'occupyAllAvailableViewportHeight'> & T & PropsWithChildren<DropPropsOnly>;
26
+ export type DropProps<T extends DropBaseHorizontalPositionWithoutCenter | DropBaseVerticalPositionWithoutCenter> = Omit<DropBasePermanentProps, 'arrowGuardDistance' | 'children' | 'animationTimeout' | 'animationClassNames' | 'role' | 'guardDistance' | 'occupyAllAvailableViewportHeight'> & T & PropsWithChildren<DropPropsOnly>;
@@ -1,36 +0,0 @@
1
- import './index.css';
2
- import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
- import { forwardRef, useRef, useEffect } from 'react';
4
- import { Divider } from '@hh.ru/magritte-ui-divider';
5
-
6
- var styles = {"drop":"magritte-drop___Z10P4_5-1-2","drop-container":"magritte-drop-container___dbMt9_5-1-2","dropContainer":"magritte-drop-container___dbMt9_5-1-2","drop-footer":"magritte-drop-footer___v8ZEO_5-1-2","dropFooter":"magritte-drop-footer___v8ZEO_5-1-2","drop-space-300":"magritte-drop-space-300___41acH_5-1-2","dropSpace300":"magritte-drop-space-300___41acH_5-1-2","drop-space-400":"magritte-drop-space-400___XX1RM_5-1-2","dropSpace400":"magritte-drop-space-400___XX1RM_5-1-2","drop-padding":"magritte-drop-padding___xBiJO_5-1-2","dropPadding":"magritte-drop-padding___xBiJO_5-1-2","drop-space-600":"magritte-drop-space-600___6B1i0_5-1-2","dropSpace600":"magritte-drop-space-600___6B1i0_5-1-2","drop-with-footer":"magritte-drop-with-footer___CgBIV_5-1-2","dropWithFooter":"magritte-drop-with-footer___CgBIV_5-1-2","drop-enter":"magritte-drop-enter___4vEuH_5-1-2","dropEnter":"magritte-drop-enter___4vEuH_5-1-2","drop-exit":"magritte-drop-exit___brFjz_5-1-2","dropExit":"magritte-drop-exit___brFjz_5-1-2","drop-enter-active":"magritte-drop-enter-active___SQUog_5-1-2","dropEnterActive":"magritte-drop-enter-active___SQUog_5-1-2","drop-exit-active":"magritte-drop-exit-active___GB0ET_5-1-2","dropExitActive":"magritte-drop-exit-active___GB0ET_5-1-2","drop-animation-timeout":"magritte-drop-animation-timeout___uO7LF_5-1-2","dropAnimationTimeout":"magritte-drop-animation-timeout___uO7LF_5-1-2","drop-direction-top":"magritte-drop-direction-top___3CelS_5-1-2","dropDirectionTop":"magritte-drop-direction-top___3CelS_5-1-2","drop-direction-bottom":"magritte-drop-direction-bottom___719rs_5-1-2","dropDirectionBottom":"magritte-drop-direction-bottom___719rs_5-1-2","drop-direction-left":"magritte-drop-direction-left___2PTob_5-1-2","dropDirectionLeft":"magritte-drop-direction-left___2PTob_5-1-2","drop-direction-right":"magritte-drop-direction-right___SPOr1_5-1-2","dropDirectionRight":"magritte-drop-direction-right___SPOr1_5-1-2"};
7
-
8
- const DropContainer = forwardRef(({ children, height, dividerState, minHeightForContent }, ref) => {
9
- const dividerRef = useRef(null);
10
- const showDivider = dividerState !== 'hide';
11
- useEffect(() => {
12
- if (showDivider && ref && 'current' in ref && ref?.current !== null && dividerRef.current && !!height) {
13
- const hasScroll = ref.current.scrollHeight - ref.current.clientHeight > 0;
14
- dividerRef.current.style.visibility = hasScroll ? 'visible' : 'hidden';
15
- }
16
- }, [ref, dividerRef, height, showDivider]);
17
- const props = showDivider
18
- ? {
19
- onScroll: ({ target }) => {
20
- const scrollableContainer = target;
21
- if (dividerRef.current && dividerState !== 'showWhenFullyScrolled') {
22
- const scrollEnded = scrollableContainer.scrollTop +
23
- scrollableContainer.offsetHeight -
24
- scrollableContainer.scrollHeight ===
25
- 0;
26
- dividerRef.current.style.visibility = scrollEnded ? 'hidden' : 'visible';
27
- }
28
- },
29
- }
30
- : {};
31
- return (jsxs(Fragment, { children: [jsx("div", { ref: ref, className: styles.dropContainer, style: { height: height === undefined ? `${minHeightForContent}px` : 'auto' }, ...props, children: children }), showDivider && (jsx("div", { ref: dividerRef, "data-qa": "drop-divider", children: jsx(Divider, {}) }))] }));
32
- });
33
- DropContainer.displayName = 'DropContainer';
34
-
35
- export { DropContainer as D, styles as s };
36
- //# sourceMappingURL=DropContainer-9868e0d6.js.map