@hh.ru/magritte-ui-alert 3.2.6 → 4.0.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.
package/Alert.js CHANGED
@@ -12,9 +12,10 @@ import { useNoBubbling } from '@hh.ru/magritte-common-use-no-bubbling';
12
12
  import { useSwipe } from '@hh.ru/magritte-common-use-swipe';
13
13
  import { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';
14
14
  import { Layer } from '@hh.ru/magritte-ui-layer';
15
+ import { Placeholder } from '@hh.ru/magritte-ui-placeholder';
15
16
  import { ThemeWrapper } from '@hh.ru/magritte-ui-theme-wrapper';
16
17
 
17
- var styles = {"animation-timeout":"magritte-animation-timeout___cwIwT_3-2-6","animationTimeout":"magritte-animation-timeout___cwIwT_3-2-6","enter-animation-active":"magritte-enter-animation-active___Qti02_3-2-6","enterAnimationActive":"magritte-enter-animation-active___Qti02_3-2-6","exit-animation-active":"magritte-exit-animation-active___deHqY_3-2-6","exitAnimationActive":"magritte-exit-animation-active___deHqY_3-2-6","opacity-animation":"magritte-opacity-animation___m7RYi_3-2-6","opacityAnimation":"magritte-opacity-animation___m7RYi_3-2-6","enter-animation":"magritte-enter-animation___CbUHN_3-2-6","enterAnimation":"magritte-enter-animation___CbUHN_3-2-6","exit-animation":"magritte-exit-animation___d2AJ4_3-2-6","exitAnimation":"magritte-exit-animation___d2AJ4_3-2-6","overlay":"magritte-overlay___hMlKJ_3-2-6","mobile-container":"magritte-mobile-container___dQRCl_3-2-6","mobileContainer":"magritte-mobile-container___dQRCl_3-2-6","desktop-container":"magritte-desktop-container___26vkq_3-2-6","desktopContainer":"magritte-desktop-container___26vkq_3-2-6","main":"magritte-main___iCU-E_3-2-6","icon":"magritte-icon___fLpa-_3-2-6","icon_neutral":"magritte-icon_neutral___Jyl3l_3-2-6","iconNeutral":"magritte-icon_neutral___Jyl3l_3-2-6","icon_accent":"magritte-icon_accent___Nn-T1_3-2-6","iconAccent":"magritte-icon_accent___Nn-T1_3-2-6","icon_positive":"magritte-icon_positive___OU9Zu_3-2-6","iconPositive":"magritte-icon_positive___OU9Zu_3-2-6","icon_warning":"magritte-icon_warning___7BbUi_3-2-6","iconWarning":"magritte-icon_warning___7BbUi_3-2-6","icon_negative":"magritte-icon_negative___s0OA8_3-2-6","iconNegative":"magritte-icon_negative___s0OA8_3-2-6","title":"magritte-title___yG219_3-2-6","description":"magritte-description___KeNoT_3-2-6","buttons":"magritte-buttons___lyxBC_3-2-6","buttons_vertical":"magritte-buttons_vertical___8lPCo_3-2-6","buttonsVertical":"magritte-buttons_vertical___8lPCo_3-2-6"};
18
+ var styles = {"animation-timeout":"magritte-animation-timeout___cwIwT_4-0-0","animationTimeout":"magritte-animation-timeout___cwIwT_4-0-0","enter-animation-active":"magritte-enter-animation-active___Qti02_4-0-0","enterAnimationActive":"magritte-enter-animation-active___Qti02_4-0-0","exit-animation-active":"magritte-exit-animation-active___deHqY_4-0-0","exitAnimationActive":"magritte-exit-animation-active___deHqY_4-0-0","opacity-animation":"magritte-opacity-animation___m7RYi_4-0-0","opacityAnimation":"magritte-opacity-animation___m7RYi_4-0-0","enter-animation":"magritte-enter-animation___CbUHN_4-0-0","enterAnimation":"magritte-enter-animation___CbUHN_4-0-0","exit-animation":"magritte-exit-animation___d2AJ4_4-0-0","exitAnimation":"magritte-exit-animation___d2AJ4_4-0-0","overlay":"magritte-overlay___hMlKJ_4-0-0","mobile-container":"magritte-mobile-container___dQRCl_4-0-0","mobileContainer":"magritte-mobile-container___dQRCl_4-0-0","desktop-container":"magritte-desktop-container___26vkq_4-0-0","desktopContainer":"magritte-desktop-container___26vkq_4-0-0","main":"magritte-main___iCU-E_4-0-0"};
18
19
 
19
20
  const OPACITY_ANIMATION_CLASSES = {
20
21
  enter: classnames(styles.opacityAnimation, styles.enterAnimation),
@@ -72,7 +73,7 @@ const TransformAnimation = ({ animationTimeout, visible, render, onClose, }) =>
72
73
  const eventHandlers = useNoBubbling(swipeHandlers);
73
74
  return (jsx(CSSTransition, { appear: true, classNames: TRANSFORM_ANIMATION_CLASSES, in: visible, mountOnEnter: true, nodeRef: animatedElementRef, onEnter: runTranslateYAnimation, onEntering: resetTranslateY, onExit: resetTranslateY, onExiting: runTranslateYAnimation, onExited: resetSwipeOffset, timeout: animationTimeout, unmountOnExit: true, children: render(animatedElementRef, eventHandlers) }));
74
75
  };
75
- const Alert = ({ iconStyle = 'neutral', layout, icon, title, description, buttons, visible, onClose, returnFocusOnClose = true, }) => {
76
+ const Alert = ({ title, description, buttons, visible, onClose, returnFocusOnClose = true, titleProps, children, 'data-qa': dataQa, ...restProps }) => {
76
77
  const [animationTimeout, setAnimationTimeout] = useState(null);
77
78
  const animationTimeoutExitRef = useRef(animationTimeout?.exit || 0);
78
79
  animationTimeoutExitRef.current = animationTimeout?.exit || 0;
@@ -128,7 +129,13 @@ const Alert = ({ iconStyle = 'neutral', layout, icon, title, description, button
128
129
  if (!animationTimeout || isServerEnv) {
129
130
  return null;
130
131
  }
131
- const content = (jsxs(Fragment, { children: [jsxs("div", { className: styles.main, "data-qa": "magritte-alert", children: [icon && (jsx("div", { className: classnames(styles.icon, { [styles[`icon_${iconStyle}`]]: iconStyle !== 'avatar' }), children: icon })), jsx("div", { className: styles.title, id: labelId, children: title }), description && jsx("div", { className: styles.description, children: description })] }), jsx("div", { className: classnames(styles.buttons, { [styles[`buttons_${layout}`]]: layout }), children: buttons })] }));
132
+ const content = (jsx(Fragment, { children: jsx("div", { className: styles.main, "data-qa": dataQa, children: jsx(Placeholder, { "data-qa": "magritte-alert", titleProps: {
133
+ Element: 'h2',
134
+ 'data-qa': 'magritte-alert-title',
135
+ ...titleProps,
136
+ id: labelId,
137
+ size: 'medium',
138
+ }, title: title, description: description, buttons: buttons, ...restProps, children: children }) }) }));
132
139
  if (isMobile) {
133
140
  return createPortal(jsxs(Fragment, { children: [jsx(OpacityAnimation, { animationTimeout: animationTimeout, visible: visible, render: (animatedElementRef) => (jsx(ThemeWrapper, { children: (themeClass) => (jsx(Layer, { layer: "bottom-sheet", children: jsx("div", { ...eventHandlers, className: classnames(styles.overlay, styles.animationTimeout, themeClass), onClick: onClose, ref: animatedElementRef }) })) })) }), jsx(TransformAnimation, { animationTimeout: animationTimeout, visible: visible, render: (animatedElementRef, eventHandlers) => (jsx(ThemeWrapper, { children: (themeClass) => (jsx(Layer, { layer: "bottom-sheet", children: jsx("div", { ...eventHandlers, className: classnames(styles.mobileContainer, styles.animationTimeout, themeClass), ref: animatedElementRef, children: content }) })) })), onClose: onClose })] }), document.body);
134
141
  }
package/Alert.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.js","sources":["src/Alert.tsx"],"sourcesContent":["import { FC, Fragment, ReactElement, RefObject, useEffect, useId, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { CSSTransition } from 'react-transition-group';\nimport classnames from 'classnames';\n\nimport { useServerEnv } from '@hh.ru/magritte-common-is-server-env';\nimport { keyboardMatch, keyboardKeys, useKeyboardNavigation } from '@hh.ru/magritte-common-keyboard';\nimport { disableScroll, TimeoutCallback } from '@hh.ru/magritte-common-modal-helper';\nimport { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';\nimport { useNoBubbling } from '@hh.ru/magritte-common-use-no-bubbling';\nimport { SwipeEvent, useSwipe } from '@hh.ru/magritte-common-use-swipe';\nimport { AlertProps } from '@hh.ru/magritte-ui-alert/types';\nimport { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';\nimport { Layer } from '@hh.ru/magritte-ui-layer';\nimport { ThemeWrapper } from '@hh.ru/magritte-ui-theme-wrapper';\n\nimport styles from './alert.less';\n\ntype AnimationTimeout = { enter: number; exit: number };\n\ntype AnimationComponentProps = {\n animationTimeout: AnimationTimeout;\n visible: boolean;\n render: (\n animatedElementRef: RefObject<HTMLDivElement>,\n eventHandlers?: JSX.IntrinsicElements['div']\n ) => ReactElement;\n};\n\nconst OPACITY_ANIMATION_CLASSES = {\n enter: classnames(styles.opacityAnimation, styles.enterAnimation),\n enterActive: classnames(styles.enterAnimationActive, styles.opacityAnimation),\n exit: classnames(styles.opacityAnimation, styles.exitAnimation),\n exitActive: classnames(styles.exitAnimationActive, styles.opacityAnimation),\n};\n\nconst TRANSFORM_ANIMATION_CLASSES = {\n enterActive: styles.enterAnimationActive,\n exitActive: styles.exitAnimationActive,\n};\n\nconst VIEWPORT_HEIGHT = (typeof window !== 'undefined' ? window.visualViewport?.height : null) ?? 0;\nconst SWIPE_THRESHOLD_REF = { current: { max: Math.round(VIEWPORT_HEIGHT * 0.8) } };\n\nconst toInteger = (value: string) => {\n const result = parseInt(value, 10);\n return !Number.isNaN(result) ? result : 0;\n};\n\nexport const OpacityAnimation: FC<AnimationComponentProps> = ({ animationTimeout, visible, render }) => {\n const animatedElementRef = useRef<HTMLDivElement | null>(null);\n\n return (\n <CSSTransition\n appear\n classNames={OPACITY_ANIMATION_CLASSES}\n in={visible}\n mountOnEnter\n nodeRef={animatedElementRef}\n timeout={animationTimeout}\n unmountOnExit\n >\n {render(animatedElementRef)}\n </CSSTransition>\n );\n};\n\nexport const TransformAnimation: FC<AnimationComponentProps & { onClose: VoidFunction }> = ({\n animationTimeout,\n visible,\n render,\n onClose,\n}) => {\n const animatedElementRef = useRef<HTMLDivElement | null>(null);\n const swipeOffsetRef = useRef(0);\n\n const runTranslateYAnimation = () => {\n if (animatedElementRef.current !== null && visualViewport !== null) {\n animatedElementRef.current.style.transform = `translateY(${\n visualViewport.height + swipeOffsetRef.current - animatedElementRef.current.getBoundingClientRect().top\n }px)`;\n }\n };\n\n const resetTranslateY = () => {\n if (animatedElementRef.current !== null) {\n animatedElementRef.current.style.transform = `translateY(${swipeOffsetRef.current}px)`;\n }\n };\n\n const resetSwipeOffset = () => {\n swipeOffsetRef.current = 0;\n };\n\n const swipeHandlers = useSwipe({\n thresholdYRef: SWIPE_THRESHOLD_REF,\n onSwipeMove: (event: SwipeEvent) => {\n if (animatedElementRef.current !== null) {\n animatedElementRef.current.style.transform = `translateY(${Math.max(event.distanceY, 0)}px)`;\n }\n },\n onSwipeEnd: (event: SwipeEvent) => {\n swipeOffsetRef.current = event.distanceY;\n onClose();\n },\n onSwipeCancel: () => {\n if (animatedElementRef.current !== null) {\n animatedElementRef.current.style.transform = `translateY(0px)`;\n }\n },\n });\n\n const eventHandlers = useNoBubbling(swipeHandlers);\n\n return (\n <CSSTransition\n appear\n classNames={TRANSFORM_ANIMATION_CLASSES}\n in={visible}\n mountOnEnter\n nodeRef={animatedElementRef}\n onEnter={runTranslateYAnimation}\n onEntering={resetTranslateY}\n onExit={resetTranslateY}\n onExiting={runTranslateYAnimation}\n onExited={resetSwipeOffset}\n timeout={animationTimeout}\n unmountOnExit\n >\n {render(animatedElementRef, eventHandlers)}\n </CSSTransition>\n );\n};\n\nexport const Alert: FC<AlertProps> = ({\n iconStyle = 'neutral',\n layout,\n icon,\n title,\n description,\n buttons,\n visible,\n onClose,\n returnFocusOnClose = true,\n}) => {\n const [animationTimeout, setAnimationTimeout] = useState<AnimationTimeout | null>(null);\n const animationTimeoutExitRef = useRef(animationTimeout?.exit || 0);\n animationTimeoutExitRef.current = animationTimeout?.exit || 0;\n const isServerEnv = useServerEnv();\n const desktopContainerRef = useRef<HTMLDivElement | null>(null);\n const keyboardNavigationRef = useKeyboardNavigation({ enabled: visible && !isServerEnv, mode: 'loop' });\n const desktopContainerRefCallback = useMultipleRefs(desktopContainerRef, keyboardNavigationRef);\n const { isMobile } = useBreakpoint();\n const activatorRef = useRef<HTMLElement | null>(null);\n const labelId = useId();\n\n useEffect(() => {\n const animationTimeoutElement = document.createElement('div');\n animationTimeoutElement.classList.add(styles.animationTimeout);\n document.body.appendChild(animationTimeoutElement);\n const style = window.getComputedStyle(animationTimeoutElement);\n const enter = toInteger(style.getPropertyValue('--enter-animation-duration'));\n const exit = toInteger(style.getPropertyValue('--exit-animation-duration'));\n setAnimationTimeout({ enter, exit });\n document.body.removeChild(animationTimeoutElement);\n }, [setAnimationTimeout]);\n\n useEffect(() => {\n if (visible) {\n if (returnFocusOnClose && document.activeElement instanceof HTMLElement) {\n activatorRef.current = document.activeElement;\n }\n\n let enableScroll: TimeoutCallback | undefined = disableScroll();\n\n if (desktopContainerRef.current && !desktopContainerRef.current.contains(document.activeElement)) {\n desktopContainerRef.current.focus();\n }\n\n return () => {\n enableScroll?.(animationTimeoutExitRef.current);\n enableScroll = undefined;\n\n if (activatorRef.current !== null && document.contains(activatorRef.current)) {\n activatorRef.current.focus();\n activatorRef.current = null;\n }\n };\n }\n\n return void 0;\n }, [returnFocusOnClose, visible]);\n\n const eventHandlers = useNoBubbling({\n onKeyDown: (event) => {\n if (keyboardMatch(event.nativeEvent as KeyboardEvent, keyboardKeys.Escape)) {\n onClose();\n }\n },\n onMouseDown: (event) => {\n if (desktopContainerRef.current && !desktopContainerRef.current.contains(event.target as HTMLElement)) {\n onClose();\n }\n },\n });\n\n if (!animationTimeout || isServerEnv) {\n return null;\n }\n\n const content = (\n <Fragment>\n <div className={styles.main} data-qa=\"magritte-alert\">\n {icon && (\n <div className={classnames(styles.icon, { [styles[`icon_${iconStyle}`]]: iconStyle !== 'avatar' })}>\n {icon}\n </div>\n )}\n <div className={styles.title} id={labelId}>\n {title}\n </div>\n {description && <div className={styles.description}>{description}</div>}\n </div>\n <div className={classnames(styles.buttons, { [styles[`buttons_${layout}`]]: layout })}>{buttons}</div>\n </Fragment>\n );\n\n if (isMobile) {\n return createPortal(\n <Fragment>\n <OpacityAnimation\n animationTimeout={animationTimeout}\n visible={visible}\n render={(animatedElementRef) => (\n <ThemeWrapper>\n {(themeClass) => (\n <Layer layer=\"bottom-sheet\">\n <div\n {...eventHandlers}\n className={classnames(styles.overlay, styles.animationTimeout, themeClass)}\n onClick={onClose}\n ref={animatedElementRef}\n />\n </Layer>\n )}\n </ThemeWrapper>\n )}\n />\n <TransformAnimation\n animationTimeout={animationTimeout}\n visible={visible}\n render={(animatedElementRef, eventHandlers) => (\n <ThemeWrapper>\n {(themeClass) => (\n <Layer layer=\"bottom-sheet\">\n <div\n {...eventHandlers}\n className={classnames(\n styles.mobileContainer,\n styles.animationTimeout,\n themeClass\n )}\n ref={animatedElementRef}\n >\n {content}\n </div>\n </Layer>\n )}\n </ThemeWrapper>\n )}\n onClose={onClose}\n />\n </Fragment>,\n document.body\n );\n }\n\n return createPortal(\n <OpacityAnimation\n animationTimeout={animationTimeout}\n visible={visible}\n render={(animatedElementRef) => (\n <ThemeWrapper>\n {(themeClass) => (\n <Layer layer=\"modal\">\n <div\n {...eventHandlers}\n className={classnames(styles.overlay, themeClass, styles.animationTimeout)}\n ref={animatedElementRef}\n >\n <div\n aria-labelledby={labelId}\n aria-modal={visible && !isServerEnv}\n role=\"alertdialog\"\n tabIndex={-1}\n className={classnames(styles.desktopContainer)}\n ref={desktopContainerRefCallback}\n >\n {content}\n </div>\n </div>\n </Layer>\n )}\n </ThemeWrapper>\n )}\n />,\n document.body\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;AA6BA,MAAM,yBAAyB,GAAG;IAC9B,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,cAAc,CAAC;IACjE,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAAC,gBAAgB,CAAC;IAC7E,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,aAAa,CAAC;IAC/D,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC,gBAAgB,CAAC;CAC9E,CAAC;AAEF,MAAM,2BAA2B,GAAG;IAChC,WAAW,EAAE,MAAM,CAAC,oBAAoB;IACxC,UAAU,EAAE,MAAM,CAAC,mBAAmB;CACzC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,KAAK,CAAC,CA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AC,KAAK,EAAC,cAAc,EAAA,QAAA,EACvBA,gBACQ,aAAa,EACjB,SAAS,EAAE,UAAU,CACjB,MAAM,CAAC,eAAe,EACtB,MAAM,CAAC,gBAAgB,EACvB,UAAU,CACb,EACD,GAAG,EAAE,kBAAkB,EAAA,QAAA,EAEtB,OAAO,EAAA,CACN,EACF,CAAA,CACX,EACU,CAAA,CAClB,EACD,OAAO,EAAE,OAAO,EAAA,CAClB,IACK,EACX,QAAQ,CAAC,IAAI,CAChB,CAAC;KACL;IAED,OAAO,YAAY,CACfA,GAAC,CAAA,gBAAgB,IACb,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,CAAC,kBAAkB,MACvBA,GAAA,CAAC,YAAY,EAAA,EAAA,QAAA,EACR,CAAC,UAAU,MACRA,IAAC,KAAK,EAAA,EAAC,KAAK,EAAC,OAAO,EAAA,QAAA,EAChBA,gBACQ,aAAa,EACjB,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAC1E,GAAG,EAAE,kBAAkB,EAEvB,QAAA,EAAAA,GAAA,CAAA,KAAA,EAAA,EAAA,iBAAA,EACqB,OAAO,EAAA,YAAA,EACZ,OAAO,IAAI,CAAC,WAAW,EACnC,IAAI,EAAC,aAAa,EAClB,QAAQ,EAAE,CAAC,CAAC,EACZ,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAC9C,GAAG,EAAE,2BAA2B,EAE/B,QAAA,EAAA,OAAO,GACN,EACJ,CAAA,EAAA,CACF,CACX,EAAA,CACU,CAClB,EAAA,CACH,EACF,QAAQ,CAAC,IAAI,CAChB,CAAC;AACN;;;;"}
1
+ {"version":3,"file":"Alert.js","sources":["src/Alert.tsx"],"sourcesContent":["import { FC, Fragment, ReactElement, RefObject, useEffect, useId, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { CSSTransition } from 'react-transition-group';\nimport classnames from 'classnames';\n\nimport { useServerEnv } from '@hh.ru/magritte-common-is-server-env';\nimport { keyboardMatch, keyboardKeys, useKeyboardNavigation } from '@hh.ru/magritte-common-keyboard';\nimport { disableScroll, TimeoutCallback } from '@hh.ru/magritte-common-modal-helper';\nimport { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';\nimport { useNoBubbling } from '@hh.ru/magritte-common-use-no-bubbling';\nimport { SwipeEvent, useSwipe } from '@hh.ru/magritte-common-use-swipe';\nimport { AlertProps } from '@hh.ru/magritte-ui-alert/types';\nimport { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';\nimport { Layer } from '@hh.ru/magritte-ui-layer';\nimport { Placeholder } from '@hh.ru/magritte-ui-placeholder';\nimport { ThemeWrapper } from '@hh.ru/magritte-ui-theme-wrapper';\n\nimport styles from './alert.less';\n\ntype AnimationTimeout = { enter: number; exit: number };\n\ntype AnimationComponentProps = {\n animationTimeout: AnimationTimeout;\n visible: boolean;\n render: (\n animatedElementRef: RefObject<HTMLDivElement>,\n eventHandlers?: JSX.IntrinsicElements['div']\n ) => ReactElement;\n};\n\nconst OPACITY_ANIMATION_CLASSES = {\n enter: classnames(styles.opacityAnimation, styles.enterAnimation),\n enterActive: classnames(styles.enterAnimationActive, styles.opacityAnimation),\n exit: classnames(styles.opacityAnimation, styles.exitAnimation),\n exitActive: classnames(styles.exitAnimationActive, styles.opacityAnimation),\n};\n\nconst TRANSFORM_ANIMATION_CLASSES = {\n enterActive: styles.enterAnimationActive,\n exitActive: styles.exitAnimationActive,\n};\n\nconst VIEWPORT_HEIGHT = (typeof window !== 'undefined' ? window.visualViewport?.height : null) ?? 0;\nconst SWIPE_THRESHOLD_REF = { current: { max: Math.round(VIEWPORT_HEIGHT * 0.8) } };\n\nconst toInteger = (value: string) => {\n const result = parseInt(value, 10);\n return !Number.isNaN(result) ? result : 0;\n};\n\nexport const OpacityAnimation: FC<AnimationComponentProps> = ({ animationTimeout, visible, render }) => {\n const animatedElementRef = useRef<HTMLDivElement | null>(null);\n\n return (\n <CSSTransition\n appear\n classNames={OPACITY_ANIMATION_CLASSES}\n in={visible}\n mountOnEnter\n nodeRef={animatedElementRef}\n timeout={animationTimeout}\n unmountOnExit\n >\n {render(animatedElementRef)}\n </CSSTransition>\n );\n};\n\nexport const TransformAnimation: FC<AnimationComponentProps & { onClose: VoidFunction }> = ({\n animationTimeout,\n visible,\n render,\n onClose,\n}) => {\n const animatedElementRef = useRef<HTMLDivElement | null>(null);\n const swipeOffsetRef = useRef(0);\n\n const runTranslateYAnimation = () => {\n if (animatedElementRef.current !== null && visualViewport !== null) {\n animatedElementRef.current.style.transform = `translateY(${\n visualViewport.height + swipeOffsetRef.current - animatedElementRef.current.getBoundingClientRect().top\n }px)`;\n }\n };\n\n const resetTranslateY = () => {\n if (animatedElementRef.current !== null) {\n animatedElementRef.current.style.transform = `translateY(${swipeOffsetRef.current}px)`;\n }\n };\n\n const resetSwipeOffset = () => {\n swipeOffsetRef.current = 0;\n };\n\n const swipeHandlers = useSwipe({\n thresholdYRef: SWIPE_THRESHOLD_REF,\n onSwipeMove: (event: SwipeEvent) => {\n if (animatedElementRef.current !== null) {\n animatedElementRef.current.style.transform = `translateY(${Math.max(event.distanceY, 0)}px)`;\n }\n },\n onSwipeEnd: (event: SwipeEvent) => {\n swipeOffsetRef.current = event.distanceY;\n onClose();\n },\n onSwipeCancel: () => {\n if (animatedElementRef.current !== null) {\n animatedElementRef.current.style.transform = `translateY(0px)`;\n }\n },\n });\n\n const eventHandlers = useNoBubbling(swipeHandlers);\n\n return (\n <CSSTransition\n appear\n classNames={TRANSFORM_ANIMATION_CLASSES}\n in={visible}\n mountOnEnter\n nodeRef={animatedElementRef}\n onEnter={runTranslateYAnimation}\n onEntering={resetTranslateY}\n onExit={resetTranslateY}\n onExiting={runTranslateYAnimation}\n onExited={resetSwipeOffset}\n timeout={animationTimeout}\n unmountOnExit\n >\n {render(animatedElementRef, eventHandlers)}\n </CSSTransition>\n );\n};\n\nexport const Alert: FC<AlertProps> = ({\n title,\n description,\n buttons,\n visible,\n onClose,\n returnFocusOnClose = true,\n titleProps,\n children,\n 'data-qa': dataQa,\n ...restProps\n}) => {\n const [animationTimeout, setAnimationTimeout] = useState<AnimationTimeout | null>(null);\n const animationTimeoutExitRef = useRef(animationTimeout?.exit || 0);\n animationTimeoutExitRef.current = animationTimeout?.exit || 0;\n const isServerEnv = useServerEnv();\n const desktopContainerRef = useRef<HTMLDivElement | null>(null);\n const keyboardNavigationRef = useKeyboardNavigation({ enabled: visible && !isServerEnv, mode: 'loop' });\n const desktopContainerRefCallback = useMultipleRefs(desktopContainerRef, keyboardNavigationRef);\n const { isMobile } = useBreakpoint();\n const activatorRef = useRef<HTMLElement | null>(null);\n const labelId = useId();\n\n useEffect(() => {\n const animationTimeoutElement = document.createElement('div');\n animationTimeoutElement.classList.add(styles.animationTimeout);\n document.body.appendChild(animationTimeoutElement);\n const style = window.getComputedStyle(animationTimeoutElement);\n const enter = toInteger(style.getPropertyValue('--enter-animation-duration'));\n const exit = toInteger(style.getPropertyValue('--exit-animation-duration'));\n setAnimationTimeout({ enter, exit });\n document.body.removeChild(animationTimeoutElement);\n }, [setAnimationTimeout]);\n\n useEffect(() => {\n if (visible) {\n if (returnFocusOnClose && document.activeElement instanceof HTMLElement) {\n activatorRef.current = document.activeElement;\n }\n\n let enableScroll: TimeoutCallback | undefined = disableScroll();\n\n if (desktopContainerRef.current && !desktopContainerRef.current.contains(document.activeElement)) {\n desktopContainerRef.current.focus();\n }\n\n return () => {\n enableScroll?.(animationTimeoutExitRef.current);\n enableScroll = undefined;\n\n if (activatorRef.current !== null && document.contains(activatorRef.current)) {\n activatorRef.current.focus();\n activatorRef.current = null;\n }\n };\n }\n\n return void 0;\n }, [returnFocusOnClose, visible]);\n\n const eventHandlers = useNoBubbling({\n onKeyDown: (event) => {\n if (keyboardMatch(event.nativeEvent as KeyboardEvent, keyboardKeys.Escape)) {\n onClose();\n }\n },\n onMouseDown: (event) => {\n if (desktopContainerRef.current && !desktopContainerRef.current.contains(event.target as HTMLElement)) {\n onClose();\n }\n },\n });\n\n if (!animationTimeout || isServerEnv) {\n return null;\n }\n\n const content = (\n <Fragment>\n <div className={styles.main} data-qa={dataQa}>\n <Placeholder\n data-qa=\"magritte-alert\"\n titleProps={{\n Element: 'h2',\n 'data-qa': 'magritte-alert-title',\n ...titleProps,\n id: labelId,\n size: 'medium',\n }}\n title={title}\n description={description}\n buttons={buttons}\n {...restProps}\n >\n {children}\n </Placeholder>\n </div>\n </Fragment>\n );\n\n if (isMobile) {\n return createPortal(\n <Fragment>\n <OpacityAnimation\n animationTimeout={animationTimeout}\n visible={visible}\n render={(animatedElementRef) => (\n <ThemeWrapper>\n {(themeClass) => (\n <Layer layer=\"bottom-sheet\">\n <div\n {...eventHandlers}\n className={classnames(styles.overlay, styles.animationTimeout, themeClass)}\n onClick={onClose}\n ref={animatedElementRef}\n />\n </Layer>\n )}\n </ThemeWrapper>\n )}\n />\n <TransformAnimation\n animationTimeout={animationTimeout}\n visible={visible}\n render={(animatedElementRef, eventHandlers) => (\n <ThemeWrapper>\n {(themeClass) => (\n <Layer layer=\"bottom-sheet\">\n <div\n {...eventHandlers}\n className={classnames(\n styles.mobileContainer,\n styles.animationTimeout,\n themeClass\n )}\n ref={animatedElementRef}\n >\n {content}\n </div>\n </Layer>\n )}\n </ThemeWrapper>\n )}\n onClose={onClose}\n />\n </Fragment>,\n document.body\n );\n }\n\n return createPortal(\n <OpacityAnimation\n animationTimeout={animationTimeout}\n visible={visible}\n render={(animatedElementRef) => (\n <ThemeWrapper>\n {(themeClass) => (\n <Layer layer=\"modal\">\n <div\n {...eventHandlers}\n className={classnames(styles.overlay, themeClass, styles.animationTimeout)}\n ref={animatedElementRef}\n >\n <div\n aria-labelledby={labelId}\n aria-modal={visible && !isServerEnv}\n role=\"alertdialog\"\n tabIndex={-1}\n className={classnames(styles.desktopContainer)}\n ref={desktopContainerRefCallback}\n >\n {content}\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ACZ,OAAO,IAAI,CAAC,WAAW,EACnC,IAAI,EAAC,aAAa,EAClB,QAAQ,EAAE,CAAC,CAAC,EACZ,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAC9C,GAAG,EAAE,2BAA2B,EAE/B,QAAA,EAAA,OAAO,GACN,EACJ,CAAA,EAAA,CACF,CACX,EAAA,CACU,CAClB,EAAA,CACH,EACF,QAAQ,CAAC,IAAI,CAChB,CAAC;AACN;;;;"}
package/index.css CHANGED
@@ -1,17 +1,5 @@
1
1
  :root{
2
2
  --magritte-color-background-primary-v24-5-0:#ffffff;
3
- --magritte-color-background-secondary-v24-5-0:#F1F4F9;
4
- --magritte-color-background-accent-secondary-v24-5-0:#EDF6FF;
5
- --magritte-color-background-positive-secondary-v24-5-0:#E8F9EC;
6
- --magritte-color-background-negative-secondary-v24-5-0:#FEF2EF;
7
- --magritte-color-background-warning-secondary-v24-5-0:#FFF3E6;
8
- --magritte-color-text-primary-v24-5-0:#000000;
9
- --magritte-color-text-secondary-v24-5-0:#768694;
10
- --magritte-color-icon-tertiary-v24-5-0:#AABBCA;
11
- --magritte-color-icon-accent-v24-5-0:#0070ff;
12
- --magritte-color-icon-positive-v24-5-0:#10b55f;
13
- --magritte-color-icon-negative-v24-5-0:#ff4d3a;
14
- --magritte-color-icon-warning-secondary-v24-5-0:#fdb972;
15
3
  --magritte-color-component-_overlay-background-content-v24-5-0:#20262b99;
16
4
  }
17
5
 
@@ -22,60 +10,44 @@
22
10
 
23
11
  .magritte-night-theme{
24
12
  --magritte-color-background-primary-v24-5-0:#1B1B1B;
25
- --magritte-color-background-secondary-v24-5-0:#303030;
26
- --magritte-color-background-accent-secondary-v24-5-0:#222D3D;
27
- --magritte-color-background-positive-secondary-v24-5-0:#16321F;
28
- --magritte-color-background-negative-secondary-v24-5-0:#3D2622;
29
- --magritte-color-background-warning-secondary-v24-5-0:#3D270E;
30
- --magritte-color-text-primary-v24-5-0:#ffffff;
31
- --magritte-color-text-secondary-v24-5-0:#ABABAB;
32
- --magritte-color-icon-tertiary-v24-5-0:#767676;
33
- --magritte-color-icon-accent-v24-5-0:#5e9eff;
34
- --magritte-color-icon-warning-secondary-v24-5-0:#9c5b03;
35
13
  --magritte-color-component-_overlay-background-content-v24-5-0:#26262699;
36
14
  }
37
-
38
- .magritte-zp-day-theme{
39
- --magritte-color-background-accent-secondary-v24-5-0:#F1F4F7;
40
- --magritte-color-icon-accent-v24-5-0:#7195AF;
41
- --magritte-color-icon-positive-v24-5-0:#0dc267;
42
- }
43
- .magritte-animation-timeout___cwIwT_3-2-6{
15
+ .magritte-animation-timeout___cwIwT_4-0-0{
44
16
  --enter-animation-duration:0ms;
45
17
  --exit-animation-duration:0ms;
46
18
  }
47
19
  @media (prefers-reduced-motion: no-preference){
48
- .magritte-animation-timeout___cwIwT_3-2-6{
20
+ .magritte-animation-timeout___cwIwT_4-0-0{
49
21
  --enter-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v24-5-0);
50
22
  --exit-animation-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v24-5-0);
51
23
  }
52
24
  }
53
- .magritte-enter-animation-active___Qti02_3-2-6{
25
+ .magritte-enter-animation-active___Qti02_4-0-0{
54
26
  transition-property:transform, opacity;
55
27
  transition-duration:var(--enter-animation-duration);
56
28
  transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v24-5-0);
57
29
  }
58
- .magritte-exit-animation-active___deHqY_3-2-6{
30
+ .magritte-exit-animation-active___deHqY_4-0-0{
59
31
  transition-property:transform, opacity;
60
32
  transition-duration:var(--exit-animation-duration);
61
33
  transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v24-5-0);
62
34
  }
63
- .magritte-opacity-animation___m7RYi_3-2-6{
35
+ .magritte-opacity-animation___m7RYi_4-0-0{
64
36
  pointer-events:none;
65
37
  }
66
- .magritte-opacity-animation___m7RYi_3-2-6.magritte-enter-animation___CbUHN_3-2-6{
38
+ .magritte-opacity-animation___m7RYi_4-0-0.magritte-enter-animation___CbUHN_4-0-0{
67
39
  opacity:0;
68
40
  }
69
- .magritte-opacity-animation___m7RYi_3-2-6.magritte-enter-animation-active___Qti02_3-2-6{
41
+ .magritte-opacity-animation___m7RYi_4-0-0.magritte-enter-animation-active___Qti02_4-0-0{
70
42
  opacity:1;
71
43
  }
72
- .magritte-opacity-animation___m7RYi_3-2-6.magritte-exit-animation___d2AJ4_3-2-6{
44
+ .magritte-opacity-animation___m7RYi_4-0-0.magritte-exit-animation___d2AJ4_4-0-0{
73
45
  opacity:1;
74
46
  }
75
- .magritte-opacity-animation___m7RYi_3-2-6.magritte-exit-animation-active___deHqY_3-2-6{
47
+ .magritte-opacity-animation___m7RYi_4-0-0.magritte-exit-animation-active___deHqY_4-0-0{
76
48
  opacity:0;
77
49
  }
78
- .magritte-overlay___hMlKJ_3-2-6{
50
+ .magritte-overlay___hMlKJ_4-0-0{
79
51
  display:flex;
80
52
  align-items:center;
81
53
  justify-content:center;
@@ -83,85 +55,20 @@
83
55
  inset:0;
84
56
  background-color:var(--magritte-color-component-_overlay-background-content-v24-5-0);
85
57
  }
86
- .magritte-mobile-container___dQRCl_3-2-6,
87
- .magritte-desktop-container___26vkq_3-2-6{
58
+ .magritte-mobile-container___dQRCl_4-0-0,
59
+ .magritte-desktop-container___26vkq_4-0-0{
88
60
  background-color:var(--magritte-color-background-primary-v24-5-0);
89
61
  border-radius:24px;
90
62
  }
91
- .magritte-mobile-container___dQRCl_3-2-6{
63
+ .magritte-mobile-container___dQRCl_4-0-0{
92
64
  position:fixed;
93
65
  inset:auto 12px 16px;
94
66
  max-width:400px;
95
67
  margin:auto;
96
68
  }
97
- .magritte-desktop-container___26vkq_3-2-6{
69
+ .magritte-desktop-container___26vkq_4-0-0{
98
70
  width:400px;
99
71
  }
100
- .magritte-main___iCU-E_3-2-6{
101
- display:flex;
102
- flex-direction:column;
103
- align-items:center;
104
- padding:32px 32px 12px;
105
- }
106
- .magritte-icon___fLpa-_3-2-6{
107
- display:flex;
108
- align-items:center;
109
- justify-content:center;
110
- width:48px;
111
- height:48px;
112
- border-radius:50%;
113
- margin-bottom:24px;
114
- }
115
- .magritte-icon_neutral___Jyl3l_3-2-6{
116
- background-color:var(--magritte-color-background-secondary-v24-5-0);
117
- --magritte-ui-icon-color-override:var(--magritte-color-icon-tertiary-v24-5-0);
118
- }
119
- .magritte-icon_accent___Nn-T1_3-2-6{
120
- background-color:var(--magritte-color-background-accent-secondary-v24-5-0);
121
- --magritte-ui-icon-color-override:var(--magritte-color-icon-accent-v24-5-0);
122
- }
123
- .magritte-icon_positive___OU9Zu_3-2-6{
124
- background-color:var(--magritte-color-background-positive-secondary-v24-5-0);
125
- --magritte-ui-icon-color-override:var(--magritte-color-icon-positive-v24-5-0);
126
- }
127
- .magritte-icon_warning___7BbUi_3-2-6{
128
- background-color:var(--magritte-color-background-warning-secondary-v24-5-0);
129
- --magritte-ui-icon-color-override:var(--magritte-color-icon-warning-secondary-v24-5-0);
130
- }
131
- .magritte-icon_negative___s0OA8_3-2-6{
132
- background-color:var(--magritte-color-background-negative-secondary-v24-5-0);
133
- --magritte-ui-icon-color-override:var(--magritte-color-icon-negative-v24-5-0);
134
- }
135
- .magritte-title___yG219_3-2-6{
136
- font-family:"hh sans";
137
- font-weight:500;
138
- line-height:32px;
139
- font-size:22px;
140
- letter-spacing:-0.0075em;
141
- text-indent:0px;
142
- text-transform:none;
143
- text-decoration:none;
144
- color:var(--magritte-color-text-primary-v24-5-0);
145
- text-align:center;
146
- }
147
- .magritte-description___KeNoT_3-2-6{
148
- font-family:"hh sans";
149
- font-weight:400;
150
- line-height:26px;
151
- font-size:16px;
152
- letter-spacing:0.005em;
153
- text-indent:0px;
154
- text-transform:none;
155
- text-decoration:none;
156
- color:var(--magritte-color-text-secondary-v24-5-0);
157
- text-align:center;
158
- margin-top:6px;
159
- }
160
- .magritte-buttons___lyxBC_3-2-6{
161
- display:flex;
162
- gap:12px;
163
- padding:12px;
164
- }
165
- .magritte-buttons_vertical___8lPCo_3-2-6{
166
- flex-direction:column;
72
+ .magritte-main___iCU-E_4-0-0{
73
+ padding:32px 12px 12px;
167
74
  }
package/index.js CHANGED
@@ -13,5 +13,6 @@ import '@hh.ru/magritte-common-use-no-bubbling';
13
13
  import '@hh.ru/magritte-common-use-swipe';
14
14
  import '@hh.ru/magritte-ui-breakpoint';
15
15
  import '@hh.ru/magritte-ui-layer';
16
+ import '@hh.ru/magritte-ui-placeholder';
16
17
  import '@hh.ru/magritte-ui-theme-wrapper';
17
18
  //# sourceMappingURL=index.js.map
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hh.ru/magritte-ui-alert",
3
- "version": "3.2.6",
3
+ "version": "4.0.0",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -29,6 +29,7 @@
29
29
  "@hh.ru/magritte-internal-layer-name": "3.4.1",
30
30
  "@hh.ru/magritte-ui-breakpoint": "6.0.8",
31
31
  "@hh.ru/magritte-ui-layer": "3.2.2",
32
+ "@hh.ru/magritte-ui-placeholder": "11.1.0",
32
33
  "@hh.ru/magritte-ui-theme-wrapper": "1.1.14"
33
34
  },
34
35
  "peerDependencies": {
@@ -40,5 +41,5 @@
40
41
  "publishConfig": {
41
42
  "access": "public"
42
43
  },
43
- "gitHead": "0d147efb00e0803c03ee0ac99525211ce44788e1"
44
+ "gitHead": "47147a437821bf19ff08ca5392ff59ad7e2c579f"
44
45
  }
package/types.d.ts CHANGED
@@ -1,21 +1,13 @@
1
1
  import { ReactNode } from 'react';
2
- export interface AlertProps {
3
- /** Иконка размера 24px (будет отцентрирована на подложке 48x48px), Avatar либо другой компонент размера 48x48px */
4
- icon?: ReactNode;
5
- /** Стиль, определяющий цвет иконки и подложки */
6
- iconStyle?: 'neutral' | 'accent' | 'positive' | 'warning' | 'negative' | 'avatar';
7
- /** Лейаут блока кнопок */
8
- layout: 'horizontal' | 'vertical';
9
- /** Заголовок */
10
- title: ReactNode;
11
- /** Описание */
12
- description?: ReactNode;
13
- /** Кнопки */
14
- buttons: ReactNode;
2
+ import { PlaceholderProps } from '@hh.ru/magritte-ui-placeholder';
3
+ export interface AlertProps extends Omit<PlaceholderProps, 'data-qa' | 'children'> {
15
4
  /** Флаг видимости */
16
5
  visible: boolean;
17
6
  /** Колбек закрытия алерта, должен устанавливать visible в false */
18
7
  onClose: VoidFunction;
19
8
  /** Возвращать ли фокус на активный элемент после закрытия модала с оверлеем, по умолчанию `true` */
20
9
  returnFocusOnClose?: boolean;
10
+ /** Слот для иконки или аватарки размера 48x48px */
11
+ children?: ReactNode;
12
+ 'data-qa'?: string;
21
13
  }