@hh.ru/magritte-ui-tooltip 10.0.15 → 10.1.0

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.
@@ -0,0 +1,3 @@
1
+ import { FC, ImgHTMLAttributes } from 'react';
2
+ export type ImageProps = ImgHTMLAttributes<HTMLImageElement>;
3
+ export declare const ResponsiveImage: FC<ImageProps>;
@@ -0,0 +1,11 @@
1
+ import './index.css';
2
+ import { jsx } from 'react/jsx-runtime';
3
+
4
+ var styles = {"image":"magritte-image___NN7nV_10-1-0"};
5
+
6
+ const ResponsiveImage = ({ src, ...props }) => {
7
+ return jsx("img", { ...props, className: styles.image, src: src });
8
+ };
9
+
10
+ export { ResponsiveImage };
11
+ //# sourceMappingURL=ResponsiveImage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponsiveImage.js","sources":["../src/ResponsiveImage.tsx"],"sourcesContent":["import { FC, ImgHTMLAttributes } from 'react';\n\nimport styles from './image.less';\n\nexport type ImageProps = ImgHTMLAttributes<HTMLImageElement>;\n\nexport const ResponsiveImage: FC<ImageProps> = ({ src, ...props }) => {\n return <img {...props} className={styles.image} src={src} />;\n};\n"],"names":["_jsx"],"mappings":";;;;AAMO,MAAM,eAAe,GAAmB,CAAC,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,KAAI;AACjE,IAAA,OAAOA,GAAS,CAAA,KAAA,EAAA,EAAA,GAAA,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,GAAI,CAAC;AACjE;;;;"}
package/Tooltip.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const Tooltip: import("react").ForwardRefExoticComponent<Omit<import("@hh.ru/magritte-internal-drop-base").DropBasePermanentProps, "role" | "placement" | "children" | "arrowGuardDistance" | "animationTimeout" | "animationClassNames" | "allowShrinkHeightToFitIntoViewport" | "guardDistanceToViewport" | "minHeight"> & import("@hh.ru/magritte-ui-tooltip/types").TooltipOnlyProps & import("react").RefAttributes<HTMLDivElement>>;
1
+ export declare const Tooltip: import("react").ForwardRefExoticComponent<Omit<import("@hh.ru/magritte-internal-drop-base").DropBasePermanentProps, "role" | "children" | "placement" | "arrowGuardDistance" | "animationTimeout" | "animationClassNames" | "allowShrinkHeightToFitIntoViewport" | "guardDistanceToViewport" | "minHeight"> & import("@hh.ru/magritte-ui-tooltip/types").TooltipOnlyProps & import("react").RefAttributes<HTMLDivElement>>;
package/Tooltip.js CHANGED
@@ -11,7 +11,7 @@ import { TooltipArrow } from './TooltipArrow.js';
11
11
  import { Text } from '@hh.ru/magritte-ui-typography';
12
12
  import { BaseText } from '@hh.ru/magritte-ui-typography/BaseText';
13
13
 
14
- var styles = {"medium-tooltip-with-buttons-params":"magritte-medium-tooltip-with-buttons-params___krjlq_10-0-15","mediumTooltipWithButtonsParams":"magritte-medium-tooltip-with-buttons-params___krjlq_10-0-15","medium-tooltip-params":"magritte-medium-tooltip-params___2qZnY_10-0-15","mediumTooltipParams":"magritte-medium-tooltip-params___2qZnY_10-0-15","small-tooltip-params":"magritte-small-tooltip-params___N8y51_10-0-15","smallTooltipParams":"magritte-small-tooltip-params___N8y51_10-0-15","tooltip":"magritte-tooltip___Hxyh2_10-0-15","tooltip-with-buttons":"magritte-tooltip-with-buttons___pQzdt_10-0-15","tooltipWithButtons":"magritte-tooltip-with-buttons___pQzdt_10-0-15","tooltip-with-close":"magritte-tooltip-with-close___2iNPt_10-0-15","tooltipWithClose":"magritte-tooltip-with-close___2iNPt_10-0-15","tooltip-small":"magritte-tooltip-small___W1eTg_10-0-15","tooltipSmall":"magritte-tooltip-small___W1eTg_10-0-15","tooltip-title":"magritte-tooltip-title___s-ekd_10-0-15","tooltipTitle":"magritte-tooltip-title___s-ekd_10-0-15","tooltip-close":"magritte-tooltip-close___B1qWh_10-0-15","tooltipClose":"magritte-tooltip-close___B1qWh_10-0-15","tooltip-enter":"magritte-tooltip-enter___cnped_10-0-15","tooltipEnter":"magritte-tooltip-enter___cnped_10-0-15","css-variables-element":"magritte-css-variables-element___yRnOI_10-0-15","cssVariablesElement":"magritte-css-variables-element___yRnOI_10-0-15","tooltip-enter-active":"magritte-tooltip-enter-active___M8qsm_10-0-15","tooltipEnterActive":"magritte-tooltip-enter-active___M8qsm_10-0-15","tooltip-exit":"magritte-tooltip-exit___IXkNp_10-0-15","tooltipExit":"magritte-tooltip-exit___IXkNp_10-0-15","tooltip-exit-active":"magritte-tooltip-exit-active___QllYr_10-0-15","tooltipExitActive":"magritte-tooltip-exit-active___QllYr_10-0-15","tooltip-buttons":"magritte-tooltip-buttons___kNN5e_10-0-15","tooltipButtons":"magritte-tooltip-buttons___kNN5e_10-0-15","tooltip-arrow":"magritte-tooltip-arrow___7OOYT_10-0-15","tooltipArrow":"magritte-tooltip-arrow___7OOYT_10-0-15"};
14
+ var styles = {"medium-tooltip-with-buttons-params":"magritte-medium-tooltip-with-buttons-params___krjlq_10-1-0","mediumTooltipWithButtonsParams":"magritte-medium-tooltip-with-buttons-params___krjlq_10-1-0","tooltip-with-media-params":"magritte-tooltip-with-media-params___-yhSi_10-1-0","tooltipWithMediaParams":"magritte-tooltip-with-media-params___-yhSi_10-1-0","medium-tooltip-params":"magritte-medium-tooltip-params___2qZnY_10-1-0","mediumTooltipParams":"magritte-medium-tooltip-params___2qZnY_10-1-0","small-tooltip-params":"magritte-small-tooltip-params___N8y51_10-1-0","smallTooltipParams":"magritte-small-tooltip-params___N8y51_10-1-0","tooltip":"magritte-tooltip___Hxyh2_10-1-0","tooltip-with-buttons":"magritte-tooltip-with-buttons___pQzdt_10-1-0","tooltipWithButtons":"magritte-tooltip-with-buttons___pQzdt_10-1-0","tooltip-with-media":"magritte-tooltip-with-media___ZuC8W_10-1-0","tooltipWithMedia":"magritte-tooltip-with-media___ZuC8W_10-1-0","tooltip-with-close":"magritte-tooltip-with-close___2iNPt_10-1-0","tooltipWithClose":"magritte-tooltip-with-close___2iNPt_10-1-0","tooltip-small":"magritte-tooltip-small___W1eTg_10-1-0","tooltipSmall":"magritte-tooltip-small___W1eTg_10-1-0","tooltip-title":"magritte-tooltip-title___s-ekd_10-1-0","tooltipTitle":"magritte-tooltip-title___s-ekd_10-1-0","tooltip-close":"magritte-tooltip-close___B1qWh_10-1-0","tooltipClose":"magritte-tooltip-close___B1qWh_10-1-0","tooltip-media":"magritte-tooltip-media___DC0A9_10-1-0","tooltipMedia":"magritte-tooltip-media___DC0A9_10-1-0","tooltip-media_has-any-under-content":"magritte-tooltip-media_has-any-under-content___a64Lq_10-1-0","tooltipMediaHasAnyUnderContent":"magritte-tooltip-media_has-any-under-content___a64Lq_10-1-0","tooltip-enter":"magritte-tooltip-enter___cnped_10-1-0","tooltipEnter":"magritte-tooltip-enter___cnped_10-1-0","css-variables-element":"magritte-css-variables-element___yRnOI_10-1-0","cssVariablesElement":"magritte-css-variables-element___yRnOI_10-1-0","tooltip-enter-active":"magritte-tooltip-enter-active___M8qsm_10-1-0","tooltipEnterActive":"magritte-tooltip-enter-active___M8qsm_10-1-0","tooltip-exit":"magritte-tooltip-exit___IXkNp_10-1-0","tooltipExit":"magritte-tooltip-exit___IXkNp_10-1-0","tooltip-exit-active":"magritte-tooltip-exit-active___QllYr_10-1-0","tooltipExitActive":"magritte-tooltip-exit-active___QllYr_10-1-0","tooltip-buttons":"magritte-tooltip-buttons___kNN5e_10-1-0","tooltipButtons":"magritte-tooltip-buttons___kNN5e_10-1-0","tooltip-arrow":"magritte-tooltip-arrow___7OOYT_10-1-0","tooltipArrow":"magritte-tooltip-arrow___7OOYT_10-1-0"};
15
15
 
16
16
  const CSS_CLASSES = {
17
17
  enter: styles.tooltipEnter,
@@ -35,7 +35,7 @@ const AVAILABLE_PLACEMENTS_LIST = new Set([
35
35
  ]);
36
36
  // eslint-disable-next-line @typescript-eslint/no-empty-function
37
37
  const noop = () => { };
38
- const Tooltip = forwardRef(({ visible, activatorRef, onClose = noop, maxWidth = 400, title, children, showClose, closeByClickOutside = true, placement, buttons, forcePlacement, 'aria-label-close': ariaLabelClose, role, size = 'medium', ignoreIntersections = true, lockPlacement = true, guardDistanceToActivator: _guardDistanceToActivator, ...props }, ref) => {
38
+ const Tooltip = forwardRef(({ visible, activatorRef, onClose = noop, maxWidth = 400, title, children, showClose, closeByClickOutside = true, placement, buttons, forcePlacement, 'aria-label-close': ariaLabelClose, role, size = 'medium', ignoreIntersections = true, lockPlacement = true, guardDistanceToActivator: _guardDistanceToActivator, media, ...props }, ref) => {
39
39
  const { isMobile } = useBreakpoint();
40
40
  const id = useId();
41
41
  const ariaLabledBy = `tooltip-aria-label-${id}`;
@@ -97,6 +97,7 @@ const Tooltip = forwardRef(({ visible, activatorRef, onClose = noop, maxWidth =
97
97
  }
98
98
  document.body.removeChild(parametersContainer);
99
99
  }, [hasButtons, isSmall]);
100
+ const hasAnyContentUnderTop = !!title || !!children || !!buttons;
100
101
  if (isMobile) {
101
102
  return null;
102
103
  }
@@ -104,9 +105,12 @@ const Tooltip = forwardRef(({ visible, activatorRef, onClose = noop, maxWidth =
104
105
  [styles.tooltipWithButtons]: !isSmall && !!buttons,
105
106
  [styles.tooltipWithClose]: !isSmall && showClose,
106
107
  [styles.tooltipSmall]: isSmall,
108
+ [styles.tooltipWithMedia]: !!media,
107
109
  }), style: {
108
110
  maxWidth: `${maxWidth}px`,
109
- }, children: [title && !isSmall && (jsx("div", { className: styles.tooltipTitle, children: jsx(BaseText, { id: ariaLabledBy, "data-qa": "tooltip-title", Element: "div", style: "primary", typography: "title-5-semibold", children: title }) })), jsx(Text, { typography: isSmall ? 'paragraph-3-regular' : 'paragraph-2-regular', id: ariaDescribedBy, children: children }), buttons && !isSmall && (jsx("div", { className: classnames(styles.tooltipButtons, STRETCHED_WRAPPER_CLASS), children: typeof buttons === 'function' ? buttons(onClose) : buttons })), showClose && !isSmall && (jsx("div", { className: styles.tooltipClose, children: jsx(CrossOutlinedSize24, { padding: 8, borderRadius: "halfHeight", "data-qa": "tooltip-close-action", "aria-label": ariaLabelClose, initialColor: "constant-secondary", onClick: () => onClose?.() }) })), jsx(TooltipArrow, { className: styles.tooltipArrow, size: size })] })) }) }));
111
+ }, children: [media && !isSmall && (jsx("div", { className: classnames(styles.tooltipMedia, {
112
+ [styles.tooltipMediaHasAnyUnderContent]: hasAnyContentUnderTop,
113
+ }), children: media })), title && !isSmall && (jsx("div", { className: styles.tooltipTitle, children: jsx(BaseText, { id: ariaLabledBy, "data-qa": "tooltip-title", Element: "div", style: "primary", typography: "title-5-semibold", children: title }) })), jsx(Text, { typography: isSmall ? 'paragraph-3-regular' : 'paragraph-2-regular', id: ariaDescribedBy, children: children }), buttons && !isSmall && (jsx("div", { className: classnames(styles.tooltipButtons, STRETCHED_WRAPPER_CLASS), children: typeof buttons === 'function' ? buttons(onClose) : buttons })), showClose && !isSmall && (jsx("div", { className: styles.tooltipClose, children: jsx(CrossOutlinedSize24, { padding: 8, borderRadius: "halfHeight", "data-qa": "tooltip-close-action", "aria-label": ariaLabelClose, initialColor: "constant-secondary", onClick: () => onClose?.() }) })), jsx(TooltipArrow, { className: styles.tooltipArrow, size: size })] })) }) }));
110
114
  });
111
115
  Tooltip.displayName = 'Tooltip';
112
116
 
package/Tooltip.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.js","sources":["../src/Tooltip.tsx"],"sourcesContent":["import { type ReactElement, useLayoutEffect, useId, useState, useRef, forwardRef } from 'react';\nimport classnames from 'classnames';\n\nimport { DropBase, type Placement, usePlacement } from '@hh.ru/magritte-internal-drop-base';\nimport { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';\nimport { STRETCHED_WRAPPER_CLASS } from '@hh.ru/magritte-ui-button';\nimport { CrossOutlinedSize24 } from '@hh.ru/magritte-ui-icon/icon';\nimport { Layer } from '@hh.ru/magritte-ui-layer';\nimport { TooltipArrow } from '@hh.ru/magritte-ui-tooltip/TooltipArrow';\nimport { TooltipProps } from '@hh.ru/magritte-ui-tooltip/types';\nimport { Text } from '@hh.ru/magritte-ui-typography';\nimport { BaseText } from '@hh.ru/magritte-ui-typography/BaseText';\n\nimport styles from './tooltip.less';\n\nconst CSS_CLASSES = {\n enter: styles.tooltipEnter,\n enterActive: styles.tooltipEnterActive,\n exit: styles.tooltipExit,\n exitActive: styles.tooltipExitActive,\n};\n\nconst AVAILABLE_PLACEMENTS_LIST: Set<Placement> = new Set([\n 'left-center',\n 'top-center',\n 'right-center',\n 'bottom-center',\n 'left-top',\n 'left-bottom',\n 'top-left',\n 'top-right',\n 'right-bottom',\n 'right-top',\n 'bottom-left',\n 'bottom-right',\n]);\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = () => {};\n\nexport const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(\n (\n {\n visible,\n activatorRef,\n onClose = noop,\n maxWidth = 400,\n title,\n children,\n showClose,\n closeByClickOutside = true,\n placement,\n buttons,\n forcePlacement,\n 'aria-label-close': ariaLabelClose,\n role,\n size = 'medium',\n ignoreIntersections = true,\n lockPlacement = true,\n guardDistanceToActivator: _guardDistanceToActivator,\n ...props\n }: TooltipProps,\n ref\n ): ReactElement | null => {\n const { isMobile } = useBreakpoint();\n const id = useId();\n const ariaLabledBy = `tooltip-aria-label-${id}`;\n const ariaDescribedBy = `tooltip-aria-description-${id}`;\n const [animationTimeout, setAnimationTimeout] = useState(200);\n const [arrowGuardDistance, setArrowGuardDistance] = useState({\n left: { top: 0, bottom: 0, center: 0 },\n right: { top: 0, bottom: 0, center: 0 },\n top: { left: 0, center: 0, right: 0 },\n bottom: { left: 0, center: 0, right: 0 },\n });\n const placementsList = usePlacement(placement, AVAILABLE_PLACEMENTS_LIST, !!forcePlacement);\n const tooltipElementRef = useRef<HTMLDivElement>(null);\n\n const ariaRole = role || (buttons ? 'alertdialog' : 'tooltip');\n const isSmall = size === 'small';\n const hasButtons = !!buttons;\n const guardDistanceToActivator = _guardDistanceToActivator ?? (isSmall ? 11 : 20);\n\n useLayoutEffect(() => {\n const parametersContainer = document.createElement('div');\n parametersContainer.style.display = 'none';\n const cssClass = classnames({\n [styles.mediumTooltipWithButtonsParams]: !isSmall && hasButtons,\n [styles.mediumTooltipParams]: !isSmall && !hasButtons,\n [styles.smallTooltipParams]: isSmall,\n });\n parametersContainer.classList.add(cssClass);\n const style = window.getComputedStyle(parametersContainer);\n document.body.appendChild(parametersContainer);\n const borderRadius = parseInt(style.getPropertyValue('--magritte-tooltip-border-radius'), 10);\n const arrowWidth = parseInt(style.getPropertyValue('--magritte-tooltip-arrow-width'), 10);\n if (Number.isInteger(borderRadius) && Number.isInteger(arrowWidth)) {\n const arrowGap = borderRadius + arrowWidth / 2;\n setArrowGuardDistance({\n left: {\n top: arrowGap,\n bottom: arrowGap,\n center: 0,\n },\n right: {\n top: arrowGap,\n bottom: arrowGap,\n center: 0,\n },\n top: {\n left: arrowGap,\n center: 0,\n right: arrowGap,\n },\n bottom: {\n left: arrowGap,\n center: 0,\n right: arrowGap,\n },\n });\n }\n const animationTimeout = parseInt(style.getPropertyValue('--animation-duration'), 10);\n if (Number.isInteger(animationTimeout)) {\n setAnimationTimeout(animationTimeout);\n }\n document.body.removeChild(parametersContainer);\n }, [hasButtons, isSmall]);\n\n if (isMobile) {\n return null;\n }\n\n return (\n <Layer layer=\"tooltip\">\n <DropBase\n {...props}\n placement={placementsList}\n visible={visible}\n activatorRef={activatorRef}\n arrowGuardDistance={arrowGuardDistance}\n closeByClickOutside={closeByClickOutside}\n onClose={onClose}\n autoFocusWhenOpened={ariaRole !== 'tooltip'}\n guardDistanceToActivator={guardDistanceToActivator}\n guardDistanceToViewport={0}\n allowShrinkHeightToFitIntoViewport={false}\n animationClassNames={CSS_CLASSES}\n animationTimeout={animationTimeout}\n ignoreIntersections={ignoreIntersections}\n role={ariaRole}\n aria-labelledby={title && role !== 'tooltip' ? ariaLabledBy : undefined}\n aria-describedby={role !== 'tooltip' ? ariaDescribedBy : undefined}\n ref={ref}\n lockPlacement={lockPlacement}\n >\n {() => (\n <div\n data-qa=\"tooltip\"\n ref={tooltipElementRef}\n className={classnames(styles.tooltip, {\n [styles.tooltipWithButtons]: !isSmall && !!buttons,\n [styles.tooltipWithClose]: !isSmall && showClose,\n [styles.tooltipSmall]: isSmall,\n })}\n style={{\n maxWidth: `${maxWidth}px`,\n }}\n >\n {title && !isSmall && (\n <div className={styles.tooltipTitle}>\n <BaseText\n id={ariaLabledBy}\n data-qa=\"tooltip-title\"\n Element=\"div\"\n style=\"primary\"\n typography=\"title-5-semibold\"\n >\n {title}\n </BaseText>\n </div>\n )}\n <Text\n typography={isSmall ? 'paragraph-3-regular' : 'paragraph-2-regular'}\n id={ariaDescribedBy}\n >\n {children}\n </Text>\n {buttons && !isSmall && (\n <div className={classnames(styles.tooltipButtons, STRETCHED_WRAPPER_CLASS)}>\n {typeof buttons === 'function' ? buttons(onClose) : buttons}\n </div>\n )}\n {showClose && !isSmall && (\n <div className={styles.tooltipClose}>\n <CrossOutlinedSize24\n padding={8}\n borderRadius=\"halfHeight\"\n data-qa=\"tooltip-close-action\"\n aria-label={ariaLabelClose}\n initialColor=\"constant-secondary\"\n onClick={() => onClose?.()}\n />\n </div>\n )}\n <TooltipArrow className={styles.tooltipArrow} size={size} />\n </div>\n )}\n </DropBase>\n </Layer>\n );\n }\n);\n\nTooltip.displayName = 'Tooltip';\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;AAeA,MAAM,WAAW,GAAG;IAChB,KAAK,EAAE,MAAM,CAAC,YAAY;IAC1B,WAAW,EAAE,MAAM,CAAC,kBAAkB;IACtC,IAAI,EAAE,MAAM,CAAC,WAAW;IACxB,UAAU,EAAE,MAAM,CAAC,iBAAiB;CACvC,CAAC;AAEF,MAAM,yBAAyB,GAAmB,IAAI,GAAG,CAAC;IACtD,aAAa;IACb,YAAY;IACZ,cAAc;IACd,eAAe;IACf,UAAU;IACV,aAAa;IACb,UAAU;IACV,WAAW;IACX,cAAc;IACd,WAAW;IACX,aAAa;IACb,cAAc;AACjB,CAAA,CAAC,CAAC;AAEH;AACA,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AE,MAAM,CAAC,YAAY,EAAA,QAAA,EAC/BA,GAAC,CAAA,QAAQ,IACL,EAAE,EAAE,YAAY,EAAA,SAAA,EACR,eAAe,EACvB,OAAO,EAAC,KAAK,EACb,KAAK,EAAC,SAAS,EACf,UAAU,EAAC,kBAAkB,EAE5B,QAAA,EAAA,KAAK,GACC,EACT,CAAA,CACT,EACDA,GAAA,CAAC,IAAI,EACD,EAAA,UAAU,EAAE,OAAO,GAAG,qBAAqB,GAAG,qBAAqB,EACnE,EAAE,EAAE,eAAe,EAAA,QAAA,EAElB,QAAQ,EAAA,CACN,EACN,OAAO,IAAI,CAAC,OAAO,KAChBA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,cAAc,EAAE,uBAAuB,CAAC,EAAA,QAAA,EACrE,OAAO,OAAO,KAAK,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,EACzD,CAAA,CACT,EACA,SAAS,IAAI,CAAC,OAAO,KAClBA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,YAAY,EAC/B,QAAA,EAAAA,GAAA,CAAC,mBAAmB,EAChB,EAAA,OAAO,EAAE,CAAC,EACV,YAAY,EAAC,YAAY,EACjB,SAAA,EAAA,sBAAsB,gBAClB,cAAc,EAC1B,YAAY,EAAC,oBAAoB,EACjC,OAAO,EAAE,MAAM,OAAO,IAAI,GAC5B,EACA,CAAA,CACT,EACDA,GAAA,CAAC,YAAY,EAAC,EAAA,SAAS,EAAE,MAAM,CAAC,YAAY,EAAE,IAAI,EAAE,IAAI,EAAI,CAAA,CAAA,EAAA,CAC1D,CACT,EACM,CAAA,EAAA,CACP,EACV;AACN,CAAC,EACH;AAEF,OAAO,CAAC,WAAW,GAAG,SAAS;;;;"}
1
+ {"version":3,"file":"Tooltip.js","sources":["../src/Tooltip.tsx"],"sourcesContent":["import { type ReactElement, useLayoutEffect, useId, useState, useRef, forwardRef } from 'react';\nimport classnames from 'classnames';\n\nimport { DropBase, type Placement, usePlacement } from '@hh.ru/magritte-internal-drop-base';\nimport { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';\nimport { STRETCHED_WRAPPER_CLASS } from '@hh.ru/magritte-ui-button';\nimport { CrossOutlinedSize24 } from '@hh.ru/magritte-ui-icon/icon';\nimport { Layer } from '@hh.ru/magritte-ui-layer';\nimport { TooltipArrow } from '@hh.ru/magritte-ui-tooltip/TooltipArrow';\nimport { TooltipProps } from '@hh.ru/magritte-ui-tooltip/types';\nimport { Text } from '@hh.ru/magritte-ui-typography';\nimport { BaseText } from '@hh.ru/magritte-ui-typography/BaseText';\n\nimport styles from './tooltip.less';\n\nconst CSS_CLASSES = {\n enter: styles.tooltipEnter,\n enterActive: styles.tooltipEnterActive,\n exit: styles.tooltipExit,\n exitActive: styles.tooltipExitActive,\n};\n\nconst AVAILABLE_PLACEMENTS_LIST: Set<Placement> = new Set([\n 'left-center',\n 'top-center',\n 'right-center',\n 'bottom-center',\n 'left-top',\n 'left-bottom',\n 'top-left',\n 'top-right',\n 'right-bottom',\n 'right-top',\n 'bottom-left',\n 'bottom-right',\n]);\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = () => {};\n\nexport const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(\n (\n {\n visible,\n activatorRef,\n onClose = noop,\n maxWidth = 400,\n title,\n children,\n showClose,\n closeByClickOutside = true,\n placement,\n buttons,\n forcePlacement,\n 'aria-label-close': ariaLabelClose,\n role,\n size = 'medium',\n ignoreIntersections = true,\n lockPlacement = true,\n guardDistanceToActivator: _guardDistanceToActivator,\n media,\n ...props\n }: TooltipProps,\n ref\n ): ReactElement | null => {\n const { isMobile } = useBreakpoint();\n const id = useId();\n const ariaLabledBy = `tooltip-aria-label-${id}`;\n const ariaDescribedBy = `tooltip-aria-description-${id}`;\n const [animationTimeout, setAnimationTimeout] = useState(200);\n const [arrowGuardDistance, setArrowGuardDistance] = useState({\n left: { top: 0, bottom: 0, center: 0 },\n right: { top: 0, bottom: 0, center: 0 },\n top: { left: 0, center: 0, right: 0 },\n bottom: { left: 0, center: 0, right: 0 },\n });\n const placementsList = usePlacement(placement, AVAILABLE_PLACEMENTS_LIST, !!forcePlacement);\n const tooltipElementRef = useRef<HTMLDivElement>(null);\n\n const ariaRole = role || (buttons ? 'alertdialog' : 'tooltip');\n const isSmall = size === 'small';\n const hasButtons = !!buttons;\n const guardDistanceToActivator = _guardDistanceToActivator ?? (isSmall ? 11 : 20);\n\n useLayoutEffect(() => {\n const parametersContainer = document.createElement('div');\n parametersContainer.style.display = 'none';\n const cssClass = classnames({\n [styles.mediumTooltipWithButtonsParams]: !isSmall && hasButtons,\n [styles.mediumTooltipParams]: !isSmall && !hasButtons,\n [styles.smallTooltipParams]: isSmall,\n });\n parametersContainer.classList.add(cssClass);\n const style = window.getComputedStyle(parametersContainer);\n document.body.appendChild(parametersContainer);\n const borderRadius = parseInt(style.getPropertyValue('--magritte-tooltip-border-radius'), 10);\n const arrowWidth = parseInt(style.getPropertyValue('--magritte-tooltip-arrow-width'), 10);\n if (Number.isInteger(borderRadius) && Number.isInteger(arrowWidth)) {\n const arrowGap = borderRadius + arrowWidth / 2;\n setArrowGuardDistance({\n left: {\n top: arrowGap,\n bottom: arrowGap,\n center: 0,\n },\n right: {\n top: arrowGap,\n bottom: arrowGap,\n center: 0,\n },\n top: {\n left: arrowGap,\n center: 0,\n right: arrowGap,\n },\n bottom: {\n left: arrowGap,\n center: 0,\n right: arrowGap,\n },\n });\n }\n const animationTimeout = parseInt(style.getPropertyValue('--animation-duration'), 10);\n if (Number.isInteger(animationTimeout)) {\n setAnimationTimeout(animationTimeout);\n }\n document.body.removeChild(parametersContainer);\n }, [hasButtons, isSmall]);\n\n const hasAnyContentUnderTop = !!title || !!children || !!buttons;\n\n if (isMobile) {\n return null;\n }\n\n return (\n <Layer layer=\"tooltip\">\n <DropBase\n {...props}\n placement={placementsList}\n visible={visible}\n activatorRef={activatorRef}\n arrowGuardDistance={arrowGuardDistance}\n closeByClickOutside={closeByClickOutside}\n onClose={onClose}\n autoFocusWhenOpened={ariaRole !== 'tooltip'}\n guardDistanceToActivator={guardDistanceToActivator}\n guardDistanceToViewport={0}\n allowShrinkHeightToFitIntoViewport={false}\n animationClassNames={CSS_CLASSES}\n animationTimeout={animationTimeout}\n ignoreIntersections={ignoreIntersections}\n role={ariaRole}\n aria-labelledby={title && role !== 'tooltip' ? ariaLabledBy : undefined}\n aria-describedby={role !== 'tooltip' ? ariaDescribedBy : undefined}\n ref={ref}\n lockPlacement={lockPlacement}\n >\n {() => (\n <div\n data-qa=\"tooltip\"\n ref={tooltipElementRef}\n className={classnames(styles.tooltip, {\n [styles.tooltipWithButtons]: !isSmall && !!buttons,\n [styles.tooltipWithClose]: !isSmall && showClose,\n [styles.tooltipSmall]: isSmall,\n [styles.tooltipWithMedia]: !!media,\n })}\n style={{\n maxWidth: `${maxWidth}px`,\n }}\n >\n {media && !isSmall && (\n <div\n className={classnames(styles.tooltipMedia, {\n [styles.tooltipMediaHasAnyUnderContent]: hasAnyContentUnderTop,\n })}\n >\n {media}\n </div>\n )}\n {title && !isSmall && (\n <div className={styles.tooltipTitle}>\n <BaseText\n id={ariaLabledBy}\n data-qa=\"tooltip-title\"\n Element=\"div\"\n style=\"primary\"\n typography=\"title-5-semibold\"\n >\n {title}\n </BaseText>\n </div>\n )}\n <Text\n typography={isSmall ? 'paragraph-3-regular' : 'paragraph-2-regular'}\n id={ariaDescribedBy}\n >\n {children}\n </Text>\n {buttons && !isSmall && (\n <div className={classnames(styles.tooltipButtons, STRETCHED_WRAPPER_CLASS)}>\n {typeof buttons === 'function' ? buttons(onClose) : buttons}\n </div>\n )}\n {showClose && !isSmall && (\n <div className={styles.tooltipClose}>\n <CrossOutlinedSize24\n padding={8}\n borderRadius=\"halfHeight\"\n data-qa=\"tooltip-close-action\"\n aria-label={ariaLabelClose}\n initialColor=\"constant-secondary\"\n onClick={() => onClose?.()}\n />\n </div>\n )}\n <TooltipArrow className={styles.tooltipArrow} size={size} />\n </div>\n )}\n </DropBase>\n </Layer>\n );\n }\n);\n\nTooltip.displayName = 'Tooltip';\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;AAeA,MAAM,WAAW,GAAG;IAChB,KAAK,EAAE,MAAM,CAAC,YAAY;IAC1B,WAAW,EAAE,MAAM,CAAC,kBAAkB;IACtC,IAAI,EAAE,MAAM,CAAC,WAAW;IACxB,UAAU,EAAE,MAAM,CAAC,iBAAiB;CACvC,CAAC;AAEF,MAAM,yBAAyB,GAAmB,IAAI,GAAG,CAAC;IACtD,aAAa;IACb,YAAY;IACZ,cAAc;IACd,eAAe;IACf,UAAU;IACV,aAAa;IACb,UAAU;IACV,WAAW;IACX,cAAc;IACd,WAAW;IACX,aAAa;IACb,cAAc;AACjB,CAAA,CAAC,CAAC;AAEH;AACA,MAAM,IAAI,GAAG,MAAK,GAAG,CAAC;AAEf,MAAM,OAAO,GAAG,UAAU,CAC7B,CACI,EACI,OAAO,EACP,YAAY,EACZ,OAAO,GAAG,IAAI,EACd,QAAQ,GAAG,GAAG,EACd,KAAK,EACL,QAAQ,EACR,SAAS,EACT,mBAAmB,GAAG,IAAI,EAC1B,SAAS,EACT,OAAO,EACP,cAAc,EACd,kBAAkB,EAAE,cAAc,EAClC,IAAI,EACJ,IAAI,GAAG,QAAQ,EACf,mBAAmB,GAAG,IAAI,EAC1B,aAAa,GAAG,IAAI,EACpB,wBAAwB,EAAE,yBAAyB,EACnD,KAAK,EACL,GAAG,KAAK,EACG,EACf,GAAG,KACkB;AACrB,IAAA,MAAM,EAAE,QAAQ,EAAE,GAAG,aAAa,EAAE,CAAC;AACrC,IAAA,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;AACnB,IAAA,MAAM,YAAY,GAAG,CAAsB,mBAAA,EAAA,EAAE,EAAE,CAAC;AAChD,IAAA,MAAM,eAAe,GAAG,CAA4B,yBAAA,EAAA,EAAE,EAAE,CAA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,OAAO,GAAG,qBAAqB,GAAG,qBAAqB,EACnE,EAAE,EAAE,eAAe,EAAA,QAAA,EAElB,QAAQ,EACN,CAAA,EACN,OAAO,IAAI,CAAC,OAAO,KAChBA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,cAAc,EAAE,uBAAuB,CAAC,EAAA,QAAA,EACrE,OAAO,OAAO,KAAK,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,EAAA,CACzD,CACT,EACA,SAAS,IAAI,CAAC,OAAO,KAClBA,GAAK,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,MAAM,CAAC,YAAY,EAAA,QAAA,EAC/BA,IAAC,mBAAmB,EAAA,EAChB,OAAO,EAAE,CAAC,EACV,YAAY,EAAC,YAAY,EAAA,SAAA,EACjB,sBAAsB,EAClB,YAAA,EAAA,cAAc,EAC1B,YAAY,EAAC,oBAAoB,EACjC,OAAO,EAAE,MAAM,OAAO,IAAI,GAC5B,EACA,CAAA,CACT,EACDA,GAAA,CAAC,YAAY,EAAC,EAAA,SAAS,EAAE,MAAM,CAAC,YAAY,EAAE,IAAI,EAAE,IAAI,EAAI,CAAA,CAAA,EAAA,CAC1D,CACT,EACM,CAAA,EAAA,CACP,EACV;AACN,CAAC,EACH;AAEF,OAAO,CAAC,WAAW,GAAG,SAAS;;;;"}
package/index.css CHANGED
@@ -1,40 +1,47 @@
1
1
  :root{
2
- --magritte-color-component-tooltip-background-content-v23-2-2:#000000;
3
- --magritte-color-component-tooltip-text-content-v23-2-2:#ffffff;
4
- --magritte-color-component-tooltip-stroke-content-v23-2-2:#3B3B3B;
2
+ --magritte-color-component-tooltip-background-content-v23-2-3:#000000;
3
+ --magritte-color-component-tooltip-text-content-v23-2-3:#ffffff;
4
+ --magritte-color-component-tooltip-stroke-content-v23-2-3:#3B3B3B;
5
5
  }
6
6
 
7
7
  :root{
8
- --magritte-semantic-animation-ease-in-out-200-timing-function-v23-2-2:cubic-bezier(0.25, 0.1, 0.25, 1);
9
- --magritte-semantic-animation-ease-in-out-200-duration-v23-2-2:200ms;
8
+ --magritte-semantic-animation-ease-in-out-200-timing-function-v23-2-3:cubic-bezier(0.25, 0.1, 0.25, 1);
9
+ --magritte-semantic-animation-ease-in-out-200-duration-v23-2-3:200ms;
10
10
  }
11
- .magritte-medium-tooltip-with-buttons-params___krjlq_10-0-15{
12
- --animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-2-2);
11
+ .magritte-medium-tooltip-with-buttons-params___krjlq_10-1-0{
12
+ --animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-2-3);
13
13
  --magritte-tooltip-arrow-vertical-gap:calc(24px + 28px / 2 - 12px / 2 - 1px);
14
14
  --magritte-tooltip-border-radius:24px;
15
15
  --magritte-tooltip-arrow-width:28px;
16
16
  --magritte-tooltip-arrow-height:12px;
17
17
  }
18
- .magritte-medium-tooltip-params___2qZnY_10-0-15{
19
- --animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-2-2);
18
+ .magritte-tooltip-with-media-params___-yhSi_10-1-0{
19
+ --animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-2-3);
20
+ --magritte-tooltip-arrow-vertical-gap:calc(28px + 28px / 2 - 12px / 2 - 1px);
21
+ --magritte-tooltip-border-radius:28px;
22
+ --magritte-tooltip-arrow-width:28px;
23
+ --magritte-tooltip-arrow-height:12px;
24
+ }
25
+ .magritte-medium-tooltip-params___2qZnY_10-1-0{
26
+ --animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-2-3);
20
27
  --magritte-tooltip-arrow-vertical-gap:calc(16px + 28px / 2 - 12px / 2 - 1px);
21
28
  --magritte-tooltip-border-radius:16px;
22
29
  --magritte-tooltip-arrow-width:28px;
23
30
  --magritte-tooltip-arrow-height:12px;
24
31
  }
25
- .magritte-small-tooltip-params___N8y51_10-0-15{
26
- --animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-2-2);
32
+ .magritte-small-tooltip-params___N8y51_10-1-0{
33
+ --animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-2-3);
27
34
  --magritte-tooltip-arrow-vertical-gap:calc(12px + 18px / 2 - 12px / 2 - 1px);
28
35
  --magritte-tooltip-border-radius:12px;
29
36
  --magritte-tooltip-arrow-width:18px;
30
37
  --magritte-tooltip-arrow-height:12px;
31
38
  }
32
- .magritte-tooltip___Hxyh2_10-0-15{
39
+ .magritte-tooltip___Hxyh2_10-1-0{
33
40
  position:relative;
34
41
  padding:16px;
35
- background:var(--magritte-color-component-tooltip-background-content-v23-2-2);
42
+ background:var(--magritte-color-component-tooltip-background-content-v23-2-3);
36
43
  border-radius:var(--magritte-tooltip-border-radius);
37
- border:1px solid var(--magritte-color-component-tooltip-stroke-content-v23-2-2);
44
+ border:1px solid var(--magritte-color-component-tooltip-stroke-content-v23-2-3);
38
45
  box-sizing:border-box;
39
46
  word-wrap:break-word;
40
47
  min-height:60px;
@@ -43,130 +50,158 @@
43
50
  word-spacing:normal;
44
51
  direction:ltr;
45
52
  text-decoration:none;
46
- --magritte-ui-text-color-override:var(--magritte-color-component-tooltip-text-content-v23-2-2);
47
- --magritte-ui-tooltip-arrow-fill:var(--magritte-color-component-tooltip-background-content-v23-2-2);
48
- --magritte-ui-tooltip-arrow-stroke:var(--magritte-color-component-tooltip-stroke-content-v23-2-2);
49
- --animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-2-2);
53
+ --magritte-ui-text-color-override:var(--magritte-color-component-tooltip-text-content-v23-2-3);
54
+ --magritte-ui-tooltip-arrow-fill:var(--magritte-color-component-tooltip-background-content-v23-2-3);
55
+ --magritte-ui-tooltip-arrow-stroke:var(--magritte-color-component-tooltip-stroke-content-v23-2-3);
56
+ --animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-2-3);
50
57
  --magritte-tooltip-arrow-vertical-gap:calc(16px + 28px / 2 - 12px / 2 - 1px);
51
58
  --magritte-tooltip-border-radius:16px;
52
59
  --magritte-tooltip-arrow-width:28px;
53
60
  --magritte-tooltip-arrow-height:12px;
54
61
  }
55
- .magritte-tooltip-with-buttons___pQzdt_10-0-15{
62
+ .magritte-tooltip-with-buttons___pQzdt_10-1-0{
56
63
  padding:24px 24px 12px;
57
- --animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-2-2);
64
+ --animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-2-3);
58
65
  --magritte-tooltip-arrow-vertical-gap:calc(24px + 28px / 2 - 12px / 2 - 1px);
59
66
  --magritte-tooltip-border-radius:24px;
60
67
  --magritte-tooltip-arrow-width:28px;
61
68
  --magritte-tooltip-arrow-height:12px;
62
69
  }
63
- .magritte-tooltip-with-close___2iNPt_10-0-15{
70
+ .magritte-tooltip-with-media___ZuC8W_10-1-0{
71
+ padding:16px;
72
+ --animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-2-3);
73
+ --magritte-tooltip-arrow-vertical-gap:calc(28px + 28px / 2 - 12px / 2 - 1px);
74
+ --magritte-tooltip-border-radius:28px;
75
+ --magritte-tooltip-arrow-width:28px;
76
+ --magritte-tooltip-arrow-height:12px;
77
+ }
78
+ .magritte-tooltip-with-close___2iNPt_10-1-0{
64
79
  padding-right:56px;
65
80
  }
66
- .magritte-tooltip-small___W1eTg_10-0-15{
81
+ .magritte-tooltip-small___W1eTg_10-1-0{
67
82
  padding:8px 12px;
68
83
  min-height:0;
69
- --animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-2-2);
84
+ --animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-2-3);
70
85
  --magritte-tooltip-arrow-vertical-gap:calc(12px + 18px / 2 - 12px / 2 - 1px);
71
86
  --magritte-tooltip-border-radius:12px;
72
87
  --magritte-tooltip-arrow-width:18px;
73
88
  --magritte-tooltip-arrow-height:12px;
74
89
  }
75
- .magritte-tooltip-title___s-ekd_10-0-15{
90
+ .magritte-tooltip-title___s-ekd_10-1-0{
76
91
  margin-bottom:4px;
77
92
  }
78
- .magritte-tooltip-close___B1qWh_10-0-15{
93
+ .magritte-tooltip-close___B1qWh_10-1-0{
79
94
  position:absolute;
80
95
  right:9px;
81
96
  top:9px;
82
97
  }
83
- .magritte-tooltip-with-buttons___pQzdt_10-0-15 .magritte-tooltip-close___B1qWh_10-0-15{
98
+ .magritte-tooltip-with-buttons___pQzdt_10-1-0 .magritte-tooltip-close___B1qWh_10-1-0{
84
99
  right:15px;
85
100
  top:15px;
86
101
  }
102
+ .magritte-tooltip-media___DC0A9_10-1-0{
103
+ display:flex;
104
+ border-radius:12px;
105
+ border:1px solid var(--magritte-color-component-tooltip-stroke-content-v23-2-3);
106
+ overflow:hidden;
107
+ }
108
+ .magritte-tooltip-media_has-any-under-content___a64Lq_10-1-0{
109
+ margin-bottom:16px;
110
+ }
87
111
  @media (prefers-reduced-motion: no-preference){
88
- .magritte-tooltip-enter___cnped_10-0-15 .magritte-tooltip___Hxyh2_10-0-15{
112
+ .magritte-tooltip-enter___cnped_10-1-0 .magritte-tooltip___Hxyh2_10-1-0{
89
113
  opacity:0;
90
114
  }
91
- .magritte-css-variables-element___yRnOI_10-0-15,
92
- .magritte-tooltip-enter-active___M8qsm_10-0-15 .magritte-tooltip___Hxyh2_10-0-15{
115
+ .magritte-css-variables-element___yRnOI_10-1-0,
116
+ .magritte-tooltip-enter-active___M8qsm_10-1-0 .magritte-tooltip___Hxyh2_10-1-0{
93
117
  opacity:1;
94
118
  transition-property:opacity, transform;
95
- transition-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-2-2);
96
- transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v23-2-2);
119
+ transition-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-2-3);
120
+ transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v23-2-3);
97
121
  }
98
- .magritte-tooltip-exit___IXkNp_10-0-15 .magritte-tooltip___Hxyh2_10-0-15{
122
+ .magritte-tooltip-exit___IXkNp_10-1-0 .magritte-tooltip___Hxyh2_10-1-0{
99
123
  opacity:1;
100
124
  }
101
- .magritte-tooltip-exit-active___QllYr_10-0-15 .magritte-tooltip___Hxyh2_10-0-15{
125
+ .magritte-tooltip-exit-active___QllYr_10-1-0 .magritte-tooltip___Hxyh2_10-1-0{
102
126
  opacity:0;
103
127
  transition-property:opacity, transform;
104
- transition-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-2-2);
105
- transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v23-2-2);
128
+ transition-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v23-2-3);
129
+ transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v23-2-3);
106
130
  }
107
- .magritte-tooltip-exit-active___QllYr_10-0-15[data-magritte-drop-base-direction='bottom'] .magritte-tooltip___Hxyh2_10-0-15,
108
- .magritte-tooltip-enter___cnped_10-0-15[data-magritte-drop-base-direction='bottom'] .magritte-tooltip___Hxyh2_10-0-15{
131
+ .magritte-tooltip-exit-active___QllYr_10-1-0[data-magritte-drop-base-direction='bottom'] .magritte-tooltip___Hxyh2_10-1-0,
132
+ .magritte-tooltip-enter___cnped_10-1-0[data-magritte-drop-base-direction='bottom'] .magritte-tooltip___Hxyh2_10-1-0{
109
133
  transform:translateY(4px);
110
134
  }
111
- .magritte-tooltip-exit-active___QllYr_10-0-15[data-magritte-drop-base-direction='top'] .magritte-tooltip___Hxyh2_10-0-15,
112
- .magritte-tooltip-enter___cnped_10-0-15[data-magritte-drop-base-direction='top'] .magritte-tooltip___Hxyh2_10-0-15{
135
+ .magritte-tooltip-exit-active___QllYr_10-1-0[data-magritte-drop-base-direction='top'] .magritte-tooltip___Hxyh2_10-1-0,
136
+ .magritte-tooltip-enter___cnped_10-1-0[data-magritte-drop-base-direction='top'] .magritte-tooltip___Hxyh2_10-1-0{
113
137
  transform:translateY(-4px);
114
138
  }
115
- .magritte-tooltip-exit-active___QllYr_10-0-15[data-magritte-drop-base-direction='left'] .magritte-tooltip___Hxyh2_10-0-15,
116
- .magritte-tooltip-enter___cnped_10-0-15[data-magritte-drop-base-direction='left'] .magritte-tooltip___Hxyh2_10-0-15{
139
+ .magritte-tooltip-exit-active___QllYr_10-1-0[data-magritte-drop-base-direction='left'] .magritte-tooltip___Hxyh2_10-1-0,
140
+ .magritte-tooltip-enter___cnped_10-1-0[data-magritte-drop-base-direction='left'] .magritte-tooltip___Hxyh2_10-1-0{
117
141
  transform:translateX(-4px);
118
142
  }
119
- .magritte-tooltip-exit-active___QllYr_10-0-15[data-magritte-drop-base-direction='right'] .magritte-tooltip___Hxyh2_10-0-15,
120
- .magritte-tooltip-enter___cnped_10-0-15[data-magritte-drop-base-direction='right'] .magritte-tooltip___Hxyh2_10-0-15{
143
+ .magritte-tooltip-exit-active___QllYr_10-1-0[data-magritte-drop-base-direction='right'] .magritte-tooltip___Hxyh2_10-1-0,
144
+ .magritte-tooltip-enter___cnped_10-1-0[data-magritte-drop-base-direction='right'] .magritte-tooltip___Hxyh2_10-1-0{
121
145
  transform:translateX(4px);
122
146
  }
123
- .magritte-tooltip-enter-active___M8qsm_10-0-15[data-magritte-drop-base-direction] .magritte-tooltip___Hxyh2_10-0-15{
147
+ .magritte-tooltip-enter-active___M8qsm_10-1-0[data-magritte-drop-base-direction] .magritte-tooltip___Hxyh2_10-1-0{
124
148
  transform:translate(0, 0);
125
149
  }
126
150
  }
127
- .magritte-tooltip-buttons___kNN5e_10-0-15{
151
+ .magritte-tooltip-buttons___kNN5e_10-1-0{
128
152
  display:flex;
129
153
  gap:12px;
130
154
  margin:24px -12px 0;
131
155
  }
132
- .magritte-tooltip-with-close___2iNPt_10-0-15 .magritte-tooltip-buttons___kNN5e_10-0-15{
156
+ .magritte-tooltip-with-close___2iNPt_10-1-0 .magritte-tooltip-buttons___kNN5e_10-1-0{
133
157
  margin-right:-44px;
134
158
  }
135
- .magritte-tooltip-arrow___7OOYT_10-0-15{
159
+ .magritte-tooltip-with-media___ZuC8W_10-1-0 .magritte-tooltip-buttons___kNN5e_10-1-0{
160
+ margin-left:0;
161
+ margin-right:0;
162
+ margin-top:16px;
163
+ }
164
+ .magritte-tooltip-arrow___7OOYT_10-1-0{
136
165
  position:absolute;
137
166
  }
138
- [data-magritte-drop-base-direction='bottom'] .magritte-tooltip-arrow___7OOYT_10-0-15{
167
+ [data-magritte-drop-base-direction='bottom'] .magritte-tooltip-arrow___7OOYT_10-1-0{
139
168
  top:calc(var(--magritte-tooltip-arrow-height) * -1);
140
169
  }
141
- [data-magritte-drop-base-direction='top'] .magritte-tooltip-arrow___7OOYT_10-0-15{
170
+ [data-magritte-drop-base-direction='top'] .magritte-tooltip-arrow___7OOYT_10-1-0{
142
171
  bottom:calc(var(--magritte-tooltip-arrow-height) * -1);
143
172
  transform:rotate(180deg);
144
173
  }
145
- [data-magritte-drop-base-alignment='left'] .magritte-tooltip-arrow___7OOYT_10-0-15{
174
+ [data-magritte-drop-base-alignment='left'] .magritte-tooltip-arrow___7OOYT_10-1-0{
146
175
  left:var(--magritte-tooltip-border-radius);
147
176
  }
148
- [data-magritte-drop-base-direction='top'][data-magritte-drop-base-alignment='center'] .magritte-tooltip-arrow___7OOYT_10-0-15,
149
- [data-magritte-drop-base-direction='bottom'][data-magritte-drop-base-alignment='center'] .magritte-tooltip-arrow___7OOYT_10-0-15{
177
+ [data-magritte-drop-base-direction='top'][data-magritte-drop-base-alignment='center'] .magritte-tooltip-arrow___7OOYT_10-1-0,
178
+ [data-magritte-drop-base-direction='bottom'][data-magritte-drop-base-alignment='center'] .magritte-tooltip-arrow___7OOYT_10-1-0{
150
179
  left:calc(50% - var(--magritte-tooltip-arrow-width) / 2);
151
180
  }
152
- [data-magritte-drop-base-alignment='right'] .magritte-tooltip-arrow___7OOYT_10-0-15{
181
+ [data-magritte-drop-base-alignment='right'] .magritte-tooltip-arrow___7OOYT_10-1-0{
153
182
  right:var(--magritte-tooltip-border-radius);
154
183
  }
155
- [data-magritte-drop-base-direction='left'] .magritte-tooltip-arrow___7OOYT_10-0-15{
184
+ [data-magritte-drop-base-direction='left'] .magritte-tooltip-arrow___7OOYT_10-1-0{
156
185
  right:calc(-1 * (var(--magritte-tooltip-arrow-width) / 2 + var(--magritte-tooltip-arrow-height) / 2));
157
186
  transform:rotate(90deg);
158
187
  }
159
- [data-magritte-drop-base-direction='right'] .magritte-tooltip-arrow___7OOYT_10-0-15{
188
+ [data-magritte-drop-base-direction='right'] .magritte-tooltip-arrow___7OOYT_10-1-0{
160
189
  left:calc(-1 * (var(--magritte-tooltip-arrow-width) / 2 + var(--magritte-tooltip-arrow-height) / 2));
161
190
  transform:rotate(-90deg);
162
191
  }
163
- [data-magritte-drop-base-alignment='top'] .magritte-tooltip-arrow___7OOYT_10-0-15{
192
+ [data-magritte-drop-base-alignment='top'] .magritte-tooltip-arrow___7OOYT_10-1-0{
164
193
  top:var(--magritte-tooltip-arrow-vertical-gap);
165
194
  }
166
- [data-magritte-drop-base-direction='left'][data-magritte-drop-base-alignment='center'] .magritte-tooltip-arrow___7OOYT_10-0-15,
167
- [data-magritte-drop-base-direction='right'][data-magritte-drop-base-alignment='center'] .magritte-tooltip-arrow___7OOYT_10-0-15{
195
+ [data-magritte-drop-base-direction='left'][data-magritte-drop-base-alignment='center'] .magritte-tooltip-arrow___7OOYT_10-1-0,
196
+ [data-magritte-drop-base-direction='right'][data-magritte-drop-base-alignment='center'] .magritte-tooltip-arrow___7OOYT_10-1-0{
168
197
  top:calc(50% - var(--magritte-tooltip-arrow-height) / 2);
169
198
  }
170
- [data-magritte-drop-base-alignment='bottom'] .magritte-tooltip-arrow___7OOYT_10-0-15{
199
+ [data-magritte-drop-base-alignment='bottom'] .magritte-tooltip-arrow___7OOYT_10-1-0{
171
200
  bottom:var(--magritte-tooltip-arrow-vertical-gap);
172
201
  }
202
+
203
+ .magritte-image___NN7nV_10-1-0{
204
+ max-width:100%;
205
+ max-height:100%;
206
+ object-fit:cover;
207
+ }
package/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from '@hh.ru/magritte-ui-tooltip/TooltipHover';
2
2
  export * from '@hh.ru/magritte-ui-tooltip/Tooltip';
3
+ export * from '@hh.ru/magritte-ui-tooltip/ResponsiveImage';
3
4
  export * from '@hh.ru/magritte-ui-tooltip/types';
package/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import './index.css';
2
2
  export { TooltipHover } from './TooltipHover.js';
3
3
  export { Tooltip } from './Tooltip.js';
4
+ export { ResponsiveImage } from './ResponsiveImage.js';
4
5
  import 'react/jsx-runtime';
5
6
  import 'react';
6
7
  import '@hh.ru/magritte-common-use-multiple-refs';
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
package/index.mock.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { ForwardRefExoticComponent } from 'react';
1
+ import { FC, ForwardRefExoticComponent } from 'react';
2
2
  export * from '@hh.ru/magritte-ui-tooltip/types';
3
3
  export declare const Tooltip: ForwardRefExoticComponent<Record<string, unknown>>;
4
+ export declare const ResponsiveImage: FC<Record<string, unknown>>;
4
5
  export declare const TooltipHover: ForwardRefExoticComponent<Record<string, unknown>>;
package/index.mock.js CHANGED
@@ -4,9 +4,12 @@ import { mockComponent } from '@hh.ru/magritte-ui-mock-component';
4
4
  const Tooltip = mockComponent('Tooltip', undefined, {
5
5
  withChildren: true,
6
6
  });
7
+ const ResponsiveImage = mockComponent('ResponsiveImage', undefined, {
8
+ withChildren: true,
9
+ });
7
10
  const TooltipHover = mockComponent('TooltipHover', undefined, {
8
11
  withChildren: true,
9
12
  });
10
13
 
11
- export { Tooltip, TooltipHover };
14
+ export { ResponsiveImage, Tooltip, TooltipHover };
12
15
  //# sourceMappingURL=index.mock.js.map
package/index.mock.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mock.js","sources":["../src/index.mock.ts"],"sourcesContent":["import { ForwardRefExoticComponent } from 'react';\n\nimport { mockComponent } from '@hh.ru/magritte-ui-mock-component';\n\nexport * from '@hh.ru/magritte-ui-tooltip/types';\n\nexport const Tooltip: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent('Tooltip', undefined, {\n withChildren: true,\n});\n\nexport const TooltipHover: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent(\n 'TooltipHover',\n undefined,\n {\n withChildren: true,\n }\n);\n"],"names":[],"mappings":";;MAMa,OAAO,GAAuD,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE;AAC3G,IAAA,YAAY,EAAE,IAAI;AACrB,CAAA,EAAE;MAEU,YAAY,GAAuD,aAAa,CACzF,cAAc,EACd,SAAS,EACT;AACI,IAAA,YAAY,EAAE,IAAI;AACrB,CAAA;;;;"}
1
+ {"version":3,"file":"index.mock.js","sources":["../src/index.mock.ts"],"sourcesContent":["import { FC, ForwardRefExoticComponent } from 'react';\n\nimport { mockComponent } from '@hh.ru/magritte-ui-mock-component';\n\nexport * from '@hh.ru/magritte-ui-tooltip/types';\n\nexport const Tooltip: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent('Tooltip', undefined, {\n withChildren: true,\n});\n\nexport const ResponsiveImage: FC<Record<string, unknown>> = mockComponent('ResponsiveImage', undefined, {\n withChildren: true,\n});\n\nexport const TooltipHover: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent(\n 'TooltipHover',\n undefined,\n {\n withChildren: true,\n }\n);\n"],"names":[],"mappings":";;MAMa,OAAO,GAAuD,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE;AAC3G,IAAA,YAAY,EAAE,IAAI;AACrB,CAAA,EAAE;MAEU,eAAe,GAAgC,aAAa,CAAC,iBAAiB,EAAE,SAAS,EAAE;AACpG,IAAA,YAAY,EAAE,IAAI;AACrB,CAAA,EAAE;MAEU,YAAY,GAAuD,aAAa,CACzF,cAAc,EACd,SAAS,EACT;AACI,IAAA,YAAY,EAAE,IAAI;AACrB,CAAA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hh.ru/magritte-ui-tooltip",
3
- "version": "10.0.15",
3
+ "version": "10.1.0",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -20,15 +20,15 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@hh.ru/magritte-common-use-multiple-refs": "1.1.9",
23
- "@hh.ru/magritte-design-tokens": "23.2.2",
24
- "@hh.ru/magritte-internal-drop-base": "7.1.3",
25
- "@hh.ru/magritte-internal-layer-name": "3.1.0",
23
+ "@hh.ru/magritte-design-tokens": "23.2.3",
24
+ "@hh.ru/magritte-internal-drop-base": "7.1.4",
25
+ "@hh.ru/magritte-internal-layer-name": "3.1.1",
26
26
  "@hh.ru/magritte-ui-breakpoint": "6.0.1",
27
- "@hh.ru/magritte-ui-button": "6.0.13",
28
- "@hh.ru/magritte-ui-icon": "13.1.0",
29
- "@hh.ru/magritte-ui-layer": "3.0.4",
27
+ "@hh.ru/magritte-ui-button": "6.0.14",
28
+ "@hh.ru/magritte-ui-icon": "13.1.1",
29
+ "@hh.ru/magritte-ui-layer": "3.0.5",
30
30
  "@hh.ru/magritte-ui-mock-component": "1.1.5",
31
- "@hh.ru/magritte-ui-typography": "4.2.5"
31
+ "@hh.ru/magritte-ui-typography": "4.2.6"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "classnames": ">=2.3.2",
@@ -37,5 +37,5 @@
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  },
40
- "gitHead": "b01f070fc5e24a45a987ba451165c2f90733a37e"
40
+ "gitHead": "5a4d738d2f8426dd1df99d6c08cada72914bc977"
41
41
  }
package/types.d.ts CHANGED
@@ -18,6 +18,7 @@ export interface TooltipOnlyProps extends PropsWithChildren {
18
18
  'aria-label-close'?: string;
19
19
  /** Aria заголовок, устанавливаем в случае если нет title и role !== 'tooltip' */
20
20
  'aria-label'?: string;
21
+ media?: ReactNode;
21
22
  }
22
23
  export type TooltipProps = Omit<DropBasePermanentProps, 'arrowGuardDistance' | 'children' | 'animationTimeout' | 'animationClassNames' | 'role' | 'placement' | 'allowShrinkHeightToFitIntoViewport' | 'guardDistanceToViewport' | 'minHeight'> & TooltipOnlyProps;
23
24
  export type TooltipHoverProps = Omit<TooltipProps, 'closeByClickOutside' | 'visible' | 'autoFocusWhenOpened'> & {