@hh.ru/magritte-ui-floating-button 1.2.8 → 1.3.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/FloatingButton.js +12 -11
- package/FloatingButton.js.map +1 -1
- package/FloatingButtonStack.d.ts +3 -0
- package/FloatingButtonStack.js +45 -0
- package/FloatingButtonStack.js.map +1 -0
- package/index.css +254 -83
- package/index.d.ts +1 -0
- package/index.js +3 -0
- package/index.js.map +1 -1
- package/index.mock.d.ts +1 -0
- package/index.mock.js +4 -1
- package/index.mock.js.map +1 -1
- package/package.json +5 -4
- package/types.d.ts +22 -1
package/FloatingButton.js
CHANGED
|
@@ -10,18 +10,15 @@ import { Layer } from '@hh.ru/magritte-ui-layer';
|
|
|
10
10
|
import { Loader } from '@hh.ru/magritte-ui-loader';
|
|
11
11
|
import { Text } from '@hh.ru/magritte-ui-typography';
|
|
12
12
|
|
|
13
|
-
var styles = {"wrapper":"magritte-wrapper___7m9lC_1-
|
|
13
|
+
var styles = {"wrapper":"magritte-wrapper___7m9lC_1-3-0","animation-timeout":"magritte-animation-timeout___NL8n0_1-3-0","animationTimeout":"magritte-animation-timeout___NL8n0_1-3-0","button":"magritte-button___nL-Hn_1-3-0","loading":"magritte-loading___C0oPZ_1-3-0","withIconAndLabel":"magritte-withIconAndLabel___Qa-lU_1-3-0","right":"magritte-right___3n0Rz_1-3-0","content":"magritte-content___JNpTZ_1-3-0","left":"magritte-left___GnzU7_1-3-0","center":"magritte-center___MdA40_1-3-0","postfix":"magritte-postfix___r0EZ6_1-3-0","icon":"magritte-icon___VpqJt_1-3-0","textless":"magritte-textless___IbYgp_1-3-0","label":"magritte-label___EPgvj_1-3-0","withPostfix":"magritte-withPostfix___PmQAz_1-3-0","hideLabel":"magritte-hideLabel___K79XM_1-3-0","withLabelOnHover":"magritte-withLabelOnHover___1oktd_1-3-0","border-radius":"magritte-border-radius___ObLLb_1-3-0","borderRadius":"magritte-border-radius___ObLLb_1-3-0","loader":"magritte-loader___EPezG_1-3-0","enter-animation":"magritte-enter-animation___2sPz3_1-3-0","enterAnimation":"magritte-enter-animation___2sPz3_1-3-0","enter-animation-active":"magritte-enter-animation-active___Lq9eq_1-3-0","enterAnimationActive":"magritte-enter-animation-active___Lq9eq_1-3-0","exit-animation":"magritte-exit-animation___h2-7a_1-3-0","exitAnimation":"magritte-exit-animation___h2-7a_1-3-0","exit-animation-active":"magritte-exit-animation-active___w0F1a_1-3-0","exitAnimationActive":"magritte-exit-animation-active___w0F1a_1-3-0","button_style-neutral":"magritte-button_style-neutral___bPUwu_1-3-0","buttonStyleNeutral":"magritte-button_style-neutral___bPUwu_1-3-0","stackMode":"magritte-stackMode___RdOTJ_1-3-0","button_style-inverse":"magritte-button_style-inverse___Xgf26_1-3-0","buttonStyleInverse":"magritte-button_style-inverse___Xgf26_1-3-0"};
|
|
14
14
|
|
|
15
15
|
const ALLOWED_BADGE_SIZES = ['small'];
|
|
16
|
-
const FloatingButtonComponent = ({ Element = 'button', style = 'neutral', disabled, borderRadius, icon: IconComponent, postfix, loading, host, children, className, inlineStyle, visible, labelOnHover: _labelOnHover, hideLabel: _hideLabel, badge, position = 'right', 'data-qa': dataQa = 'floating-button', ...restProps }, ref) => {
|
|
16
|
+
const FloatingButtonComponent = ({ Element = 'button', style = 'neutral', disabled, borderRadius, icon: IconComponent, postfix, loading, host, children, className, inlineStyle, visible, labelOnHover: _labelOnHover, hideLabel: _hideLabel, badge, position = 'right', 'data-qa': dataQa = 'floating-button', stackMode = false, ...restProps }, ref) => {
|
|
17
17
|
const labelOnHover = _labelOnHover && !!IconComponent;
|
|
18
18
|
const hideLabel = _hideLabel && !!IconComponent;
|
|
19
19
|
const isServerEnv = useServerEnv();
|
|
20
20
|
const wrapperRef = useRef(null);
|
|
21
21
|
const [animationTimeout, setAnimationTimeout] = useState(0);
|
|
22
|
-
const additionalAttributes = {
|
|
23
|
-
'data-qa': dataQa,
|
|
24
|
-
};
|
|
25
22
|
useLayoutEffect(() => {
|
|
26
23
|
const animationTimeoutElement = document.createElement('div');
|
|
27
24
|
animationTimeoutElement.classList.add(styles.animationTimeout);
|
|
@@ -33,6 +30,12 @@ const FloatingButtonComponent = ({ Element = 'button', style = 'neutral', disabl
|
|
|
33
30
|
}
|
|
34
31
|
document.body.removeChild(animationTimeoutElement);
|
|
35
32
|
}, []);
|
|
33
|
+
if (isServerEnv) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
const additionalAttributes = {
|
|
37
|
+
'data-qa': dataQa,
|
|
38
|
+
};
|
|
36
39
|
if (Element === 'button') {
|
|
37
40
|
additionalAttributes.type = 'button';
|
|
38
41
|
}
|
|
@@ -41,9 +44,6 @@ const FloatingButtonComponent = ({ Element = 'button', style = 'neutral', disabl
|
|
|
41
44
|
additionalAttributes['aria-disabled'] = disabled;
|
|
42
45
|
}
|
|
43
46
|
additionalAttributes.ref = ref;
|
|
44
|
-
if (isServerEnv) {
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
47
|
let button = (jsx(Element, { ...additionalAttributes, ...restProps, disabled: !!disabled, tabIndex: disabled || loading ? -1 : 0, className: classnames(styles.button, styles[`button_style-${style}`], {
|
|
48
48
|
[styles.borderRadius]: !!borderRadius,
|
|
49
49
|
[styles.loading]: !!loading,
|
|
@@ -52,12 +52,13 @@ const FloatingButtonComponent = ({ Element = 'button', style = 'neutral', disabl
|
|
|
52
52
|
[styles.withPostfix]: !!postfix,
|
|
53
53
|
[styles.textless]: !postfix && (!children || !!hideLabel),
|
|
54
54
|
[styles.withIconAndLabel]: !!IconComponent && !!children && !hideLabel,
|
|
55
|
+
[styles.stackMode]: !!stackMode,
|
|
55
56
|
}), children: jsxs("span", { className: styles.content, children: [IconComponent && (jsx("span", { className: styles.icon, children: jsx(IconComponent, { "data-qa": `${dataQa}-icon` }) })), jsx("span", { className: styles.label, "data-qa": `${dataQa}-label`, children: jsx(Text, { typography: 'subtitle-1-semibold', children: children }) }), postfix && (jsx("span", { className: styles.postfix, "data-qa": `${dataQa}-postfix`, children: jsx(Text, { typography: 'subtitle-1-semibold', children: postfix }) })), loading && (jsx("span", { className: styles.loader, children: jsx(Loader, { size: 24 }) }))] }) }));
|
|
56
57
|
if (badge && !disabled) {
|
|
57
|
-
button = (jsx(ComponentWithBadge, { allowedSizes: ALLOWED_BADGE_SIZES, badge: badge, offset: 4, noClip: true, children: button }));
|
|
58
|
+
button = (jsx(ComponentWithBadge, { allowedSizes: ALLOWED_BADGE_SIZES, badge: badge, offset: stackMode ? 12 : 4, noClip: true, children: button }));
|
|
58
59
|
}
|
|
59
|
-
if (
|
|
60
|
-
return
|
|
60
|
+
if (stackMode) {
|
|
61
|
+
return button;
|
|
61
62
|
}
|
|
62
63
|
return createPortal(jsx(CSSTransition, { appear: true, in: !!visible && !isServerEnv, nodeRef: wrapperRef, classNames: {
|
|
63
64
|
appear: styles.enterAnimation,
|
package/FloatingButton.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingButton.js","sources":["../src/FloatingButton.tsx"],"sourcesContent":["import React, { forwardRef, useLayoutEffect, 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 type { PolymorphicComponentWithRef, PolymorphicForwardRefRenderFunc } from '@hh.ru/magritte-types';\nimport { BadgeSize, ComponentWithBadge } from '@hh.ru/magritte-ui-badge';\nimport type { FloatingButtonProps } from '@hh.ru/magritte-ui-floating-button/types';\nimport { Layer } from '@hh.ru/magritte-ui-layer';\nimport { Loader } from '@hh.ru/magritte-ui-loader';\nimport { Text } from '@hh.ru/magritte-ui-typography';\n\nimport styles from './floating-button.less';\n\nconst ALLOWED_BADGE_SIZES: BadgeSize[] = ['small'];\n\nconst FloatingButtonComponent: PolymorphicForwardRefRenderFunc<FloatingButtonProps, 'button'> = (\n {\n Element = 'button',\n style = 'neutral',\n disabled,\n borderRadius,\n icon: IconComponent,\n postfix,\n loading,\n host,\n children,\n className,\n inlineStyle,\n visible,\n labelOnHover: _labelOnHover,\n hideLabel: _hideLabel,\n badge,\n position = 'right',\n 'data-qa': dataQa = 'floating-button',\n ...restProps\n },\n ref\n) => {\n const labelOnHover = _labelOnHover && !!IconComponent;\n const hideLabel = _hideLabel && !!IconComponent;\n const isServerEnv = useServerEnv();\n const wrapperRef = useRef<HTMLDivElement>(null);\n const [animationTimeout, setAnimationTimeout] = useState(0);\n\n const additionalAttributes: Record<string, unknown> = {\n 'data-qa': dataQa,\n };\n\n useLayoutEffect(() => {\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 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 (Element === 'button') {\n additionalAttributes.type = 'button';\n } else {\n additionalAttributes.role = Element !== 'a' ? 'button' : undefined;\n additionalAttributes['aria-disabled'] = disabled;\n }\n\n additionalAttributes.ref = ref;\n\n if (isServerEnv) {\n return null;\n }\n let button = (\n <Element\n {...additionalAttributes}\n {...restProps}\n disabled={!!disabled}\n tabIndex={disabled || loading ? -1 : 0}\n className={classnames(styles.button, styles[`button_style-${style}`], {\n [styles.borderRadius]: !!borderRadius,\n [styles.loading]: !!loading,\n [styles.withLabelOnHover]: !!labelOnHover,\n [styles.hideLabel]: !!hideLabel || !children,\n [styles.withPostfix]: !!postfix,\n [styles.textless]: !postfix && (!children || !!hideLabel),\n [styles.withIconAndLabel]: !!IconComponent && !!children && !hideLabel,\n })}\n >\n <span className={styles.content}>\n {IconComponent && (\n <span className={styles.icon}>\n <IconComponent data-qa={`${dataQa}-icon`} />\n </span>\n )}\n <span className={styles.label} data-qa={`${dataQa}-label`}>\n <Text typography={'subtitle-1-semibold'}>{children}</Text>\n </span>\n {postfix && (\n <span className={styles.postfix} data-qa={`${dataQa}-postfix`}>\n <Text typography={'subtitle-1-semibold'}>{postfix}</Text>\n </span>\n )}\n\n {loading && (\n <span className={styles.loader}>\n <Loader size={24} />\n </span>\n )}\n </span>\n </Element>\n );\n\n if (badge && !disabled) {\n button = (\n <ComponentWithBadge allowedSizes={ALLOWED_BADGE_SIZES} badge={badge} offset={4} noClip>\n {button}\n </ComponentWithBadge>\n );\n }\n\n if (isServerEnv) {\n return null;\n }\n\n return createPortal(\n <CSSTransition\n appear\n in={!!visible && !isServerEnv}\n nodeRef={wrapperRef}\n classNames={{\n appear: styles.enterAnimation,\n appearActive: styles.enterAnimationActive,\n enter: styles.enterAnimation,\n enterActive: styles.enterAnimationActive,\n exit: styles.exitAnimation,\n exitActive: styles.exitAnimationActive,\n }}\n timeout={animationTimeout}\n unmountOnExit\n >\n <Layer layer=\"floating-button\">\n <div\n className={classnames(styles.wrapper, styles[`${position}`], className)}\n ref={wrapperRef}\n style={inlineStyle}\n data-qa={`${dataQa}-wrapper`}\n >\n {button}\n </div>\n </Layer>\n </CSSTransition>,\n host?.current || document.body\n );\n};\n\nexport const FloatingButton = forwardRef(FloatingButtonComponent) as PolymorphicComponentWithRef<\n FloatingButtonProps,\n 'button'\n>;\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;AAeA,MAAM,mBAAmB,GAAgB,CAAC,OAAO,CAAC,CAAC;AAEnD,MAAM,uBAAuB,GAAmE,CAC5F,EACI,OAAO,GAAG,QAAQ,EAClB,KAAK,GAAG,SAAS,EACjB,QAAQ,EACR,YAAY,EACZ,IAAI,EAAE,aAAa,EACnB,OAAO,EACP,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,WAAW,EACX,OAAO,EACP,YAAY,EAAE,aAAa,EAC3B,SAAS,EAAE,UAAU,EACrB,KAAK,EACL,QAAQ,GAAG,OAAO,EAClB,SAAS,EA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,EACnB,UAAU,EAAE;YACR,MAAM,EAAE,MAAM,CAAC,cAAc;YAC7B,YAAY,EAAE,MAAM,CAAC,oBAAoB;YACzC,KAAK,EAAE,MAAM,CAAC,cAAc;YAC5B,WAAW,EAAE,MAAM,CAAC,oBAAoB;YACxC,IAAI,EAAE,MAAM,CAAC,aAAa;YAC1B,UAAU,EAAE,MAAM,CAAC,mBAAmB;SACzC,EACD,OAAO,EAAE,gBAAgB,EACzB,aAAa,EAEb,IAAA,EAAA,QAAA,EAAAA,GAAA,CAAC,KAAK,EAAA,EAAC,KAAK,EAAC,iBAAiB,EAAA,QAAA,EAC1BA,aACI,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAG,EAAA,QAAQ,CAAE,CAAA,CAAC,EAAE,SAAS,CAAC,EACvE,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,WAAW,EACT,SAAA,EAAA,CAAA,EAAG,MAAM,CAAA,QAAA,CAAU,EAE3B,QAAA,EAAA,MAAM,EACL,CAAA,EAAA,CACF,EACI,CAAA,EAChB,IAAI,EAAE,OAAO,IAAI,QAAQ,CAAC,IAAI,CACjC,CAAC;AACN,CAAC,CAAC;MAEW,cAAc,GAAG,UAAU,CAAC,uBAAuB;;;;"}
|
|
1
|
+
{"version":3,"file":"FloatingButton.js","sources":["../src/FloatingButton.tsx"],"sourcesContent":["import React, { forwardRef, useLayoutEffect, 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 type { PolymorphicComponentWithRef, PolymorphicForwardRefRenderFunc } from '@hh.ru/magritte-types';\nimport { BadgeSize, ComponentWithBadge } from '@hh.ru/magritte-ui-badge';\nimport type { FloatingButtonProps } from '@hh.ru/magritte-ui-floating-button/types';\nimport { Layer } from '@hh.ru/magritte-ui-layer';\nimport { Loader } from '@hh.ru/magritte-ui-loader';\nimport { Text } from '@hh.ru/magritte-ui-typography';\n\nimport styles from './floating-button.less';\n\nconst ALLOWED_BADGE_SIZES: BadgeSize[] = ['small'];\n\nconst FloatingButtonComponent: PolymorphicForwardRefRenderFunc<FloatingButtonProps, 'button'> = (\n {\n Element = 'button',\n style = 'neutral',\n disabled,\n borderRadius,\n icon: IconComponent,\n postfix,\n loading,\n host,\n children,\n className,\n inlineStyle,\n visible,\n labelOnHover: _labelOnHover,\n hideLabel: _hideLabel,\n badge,\n position = 'right',\n 'data-qa': dataQa = 'floating-button',\n stackMode = false,\n ...restProps\n },\n ref\n) => {\n const labelOnHover = _labelOnHover && !!IconComponent;\n const hideLabel = _hideLabel && !!IconComponent;\n const isServerEnv = useServerEnv();\n const wrapperRef = useRef<HTMLDivElement>(null);\n const [animationTimeout, setAnimationTimeout] = useState(0);\n\n useLayoutEffect(() => {\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 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 (isServerEnv) {\n return null;\n }\n\n const additionalAttributes: Record<string, unknown> = {\n 'data-qa': dataQa,\n };\n if (Element === 'button') {\n additionalAttributes.type = 'button';\n } else {\n additionalAttributes.role = Element !== 'a' ? 'button' : undefined;\n additionalAttributes['aria-disabled'] = disabled;\n }\n additionalAttributes.ref = ref;\n\n let button = (\n <Element\n {...additionalAttributes}\n {...restProps}\n disabled={!!disabled}\n tabIndex={disabled || loading ? -1 : 0}\n className={classnames(styles.button, styles[`button_style-${style}`], {\n [styles.borderRadius]: !!borderRadius,\n [styles.loading]: !!loading,\n [styles.withLabelOnHover]: !!labelOnHover,\n [styles.hideLabel]: !!hideLabel || !children,\n [styles.withPostfix]: !!postfix,\n [styles.textless]: !postfix && (!children || !!hideLabel),\n [styles.withIconAndLabel]: !!IconComponent && !!children && !hideLabel,\n [styles.stackMode]: !!stackMode,\n })}\n >\n <span className={styles.content}>\n {IconComponent && (\n <span className={styles.icon}>\n <IconComponent data-qa={`${dataQa}-icon`} />\n </span>\n )}\n <span className={styles.label} data-qa={`${dataQa}-label`}>\n <Text typography={'subtitle-1-semibold'}>{children}</Text>\n </span>\n {postfix && (\n <span className={styles.postfix} data-qa={`${dataQa}-postfix`}>\n <Text typography={'subtitle-1-semibold'}>{postfix}</Text>\n </span>\n )}\n\n {loading && (\n <span className={styles.loader}>\n <Loader size={24} />\n </span>\n )}\n </span>\n </Element>\n );\n\n if (badge && !disabled) {\n button = (\n <ComponentWithBadge allowedSizes={ALLOWED_BADGE_SIZES} badge={badge} offset={stackMode ? 12 : 4} noClip>\n {button}\n </ComponentWithBadge>\n );\n }\n\n if (stackMode) {\n return button;\n }\n\n return createPortal(\n <CSSTransition\n appear\n in={!!visible && !isServerEnv}\n nodeRef={wrapperRef}\n classNames={{\n appear: styles.enterAnimation,\n appearActive: styles.enterAnimationActive,\n enter: styles.enterAnimation,\n enterActive: styles.enterAnimationActive,\n exit: styles.exitAnimation,\n exitActive: styles.exitAnimationActive,\n }}\n timeout={animationTimeout}\n unmountOnExit\n >\n <Layer layer=\"floating-button\">\n <div\n className={classnames(styles.wrapper, styles[`${position}`], className)}\n ref={wrapperRef}\n style={inlineStyle}\n data-qa={`${dataQa}-wrapper`}\n >\n {button}\n </div>\n </Layer>\n </CSSTransition>,\n host?.current || document.body\n );\n};\n\nexport const FloatingButton = forwardRef(FloatingButtonComponent) as PolymorphicComponentWithRef<\n FloatingButtonProps,\n 'button'\n>;\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;AAeA,MAAM,mBAAmB,GAAgB,CAAC,OAAO,CAAC,CAAC;AAEnD,MAAM,uBAAuB,GAAmE,CAC5F,EACI,OAAO,GAAG,QAAQ,EAClB,KAAK,GAAG,SA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|
|
3
|
+
import { forwardRef, Children, isValidElement, cloneElement } from 'react';
|
|
4
|
+
import { createPortal } from 'react-dom';
|
|
5
|
+
import classnames from 'classnames';
|
|
6
|
+
import { useServerEnv } from '@hh.ru/magritte-common-is-server-env';
|
|
7
|
+
import { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';
|
|
8
|
+
import { ArrowUpOutlinedSize24 } from '@hh.ru/magritte-ui-icon/variants/icon';
|
|
9
|
+
import { Layer } from '@hh.ru/magritte-ui-layer';
|
|
10
|
+
|
|
11
|
+
var styles = {"stack":"magritte-stack___v7QhJ_1-3-0","right":"magritte-right___v4PFa_1-3-0","left":"magritte-left___JXzpq_1-3-0","center":"magritte-center___rV3kK_1-3-0","up-button":"magritte-up-button___M-Jgi_1-3-0","upButton":"magritte-up-button___M-Jgi_1-3-0","visible":"magritte-visible___lDPdq_1-3-0","has-visibled-children":"magritte-has-visibled-children___rA8xx_1-3-0","hasVisibledChildren":"magritte-has-visibled-children___rA8xx_1-3-0","floating-buttons":"magritte-floating-buttons___oi9Yx_1-3-0","floatingButtons":"magritte-floating-buttons___oi9Yx_1-3-0","floating-buttons_neutral":"magritte-floating-buttons_neutral___LCnTQ_1-3-0","floatingButtonsNeutral":"magritte-floating-buttons_neutral___LCnTQ_1-3-0","disabled":"magritte-disabled___XSSqS_1-3-0","floating-buttons_inverse":"magritte-floating-buttons_inverse___xhm17_1-3-0","floatingButtonsInverse":"magritte-floating-buttons_inverse___xhm17_1-3-0","floating-button-wrapper":"magritte-floating-button-wrapper___HlTzE_1-3-0","floatingButtonWrapper":"magritte-floating-button-wrapper___HlTzE_1-3-0"};
|
|
12
|
+
|
|
13
|
+
const FloatingButtonStack = forwardRef(({ style = 'neutral', host, children, className, inlineStyle, upButtonVisible, disabled = false, position = 'right', onUpButtonClick, 'data-qa': dataQa = 'floating-button-stack', }, ref) => {
|
|
14
|
+
const isServerEnv = useServerEnv();
|
|
15
|
+
const { isMobile } = useBreakpoint();
|
|
16
|
+
if (isServerEnv) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
const preparedChildren = Children.toArray(children)
|
|
20
|
+
.filter((isValidElement))
|
|
21
|
+
.map((child) => cloneElement(child, {
|
|
22
|
+
style,
|
|
23
|
+
disabled,
|
|
24
|
+
stackMode: true,
|
|
25
|
+
children: null,
|
|
26
|
+
postfix: null,
|
|
27
|
+
}));
|
|
28
|
+
const hasVisibledChildren = preparedChildren.filter((floatingButton) => floatingButton.props.visible).length > 0;
|
|
29
|
+
return createPortal(jsx(Layer, { layer: "floating-button", children: jsxs("div", { ref: ref, className: classnames(styles.stack, styles[`${position}`], className), style: inlineStyle, "data-qa": dataQa, children: [jsx("div", { className: classnames(styles.upButton, {
|
|
30
|
+
[styles.visible]: upButtonVisible,
|
|
31
|
+
[styles.hasVisibledChildren]: hasVisibledChildren,
|
|
32
|
+
}), children: jsx(ArrowUpOutlinedSize24, { padding: isMobile ? 16 : 24, onClick: onUpButtonClick, backgroundStyle: "secondary", borderRadius: 'halfHeight', disabled: disabled, "data-qa": `${dataQa}-up-button` }) }), jsx("div", { className: classnames(styles.floatingButtons, styles[`floating-buttons_${style}`], {
|
|
33
|
+
[styles.disabled]: disabled,
|
|
34
|
+
[styles.hasVisibledChildren]: hasVisibledChildren,
|
|
35
|
+
}), children: preparedChildren.map((floatingButton) => {
|
|
36
|
+
const visible = floatingButton.props.visible;
|
|
37
|
+
return (jsx("div", { className: classnames(styles.floatingButtonWrapper, {
|
|
38
|
+
[styles.visible]: visible,
|
|
39
|
+
}), children: floatingButton }, floatingButton.key));
|
|
40
|
+
}) })] }) }), host?.current || document.body);
|
|
41
|
+
});
|
|
42
|
+
FloatingButtonStack.displayName = 'FloatingButtonStack';
|
|
43
|
+
|
|
44
|
+
export { FloatingButtonStack };
|
|
45
|
+
//# sourceMappingURL=FloatingButtonStack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloatingButtonStack.js","sources":["../src/FloatingButtonStack.tsx"],"sourcesContent":["import React, { Children, cloneElement, isValidElement, forwardRef, type LegacyRef } from 'react';\nimport { createPortal } from 'react-dom';\nimport classnames from 'classnames';\n\nimport { useServerEnv } from '@hh.ru/magritte-common-is-server-env';\nimport { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';\nimport type { FloatingButtonStackProps, FloatingButtonProps } from '@hh.ru/magritte-ui-floating-button/types';\nimport { ArrowUpOutlinedSize24 } from '@hh.ru/magritte-ui-icon/variants/icon';\nimport { Layer } from '@hh.ru/magritte-ui-layer';\n\nimport styles from './floating-button-stack.less';\n\nexport const FloatingButtonStack = forwardRef<HTMLDivElement, FloatingButtonStackProps>(\n (\n {\n style = 'neutral',\n host,\n children,\n className,\n inlineStyle,\n upButtonVisible,\n disabled = false,\n position = 'right',\n onUpButtonClick,\n 'data-qa': dataQa = 'floating-button-stack',\n },\n ref\n ) => {\n const isServerEnv = useServerEnv();\n const { isMobile } = useBreakpoint();\n\n if (isServerEnv) {\n return null;\n }\n\n const preparedChildren = Children.toArray(children)\n .filter(isValidElement<FloatingButtonProps>)\n .map((child) =>\n cloneElement(child, {\n style,\n disabled,\n stackMode: true,\n children: null,\n postfix: null,\n })\n );\n const hasVisibledChildren =\n preparedChildren.filter((floatingButton) => floatingButton.props.visible).length > 0;\n\n return createPortal(\n <Layer layer=\"floating-button\">\n <div\n ref={ref as LegacyRef<HTMLDivElement>}\n className={classnames(styles.stack, styles[`${position}`], className)}\n style={inlineStyle}\n data-qa={dataQa}\n >\n <div\n className={classnames(styles.upButton, {\n [styles.visible]: upButtonVisible,\n [styles.hasVisibledChildren]: hasVisibledChildren,\n })}\n >\n <ArrowUpOutlinedSize24\n padding={isMobile ? 16 : 24}\n onClick={onUpButtonClick}\n backgroundStyle=\"secondary\"\n borderRadius={'halfHeight'}\n disabled={disabled}\n data-qa={`${dataQa}-up-button`}\n />\n </div>\n <div\n className={classnames(styles.floatingButtons, styles[`floating-buttons_${style}`], {\n [styles.disabled]: disabled,\n [styles.hasVisibledChildren]: hasVisibledChildren,\n })}\n >\n {preparedChildren.map((floatingButton) => {\n const visible = floatingButton.props.visible;\n return (\n <div\n key={floatingButton.key as React.Key}\n className={classnames(styles.floatingButtonWrapper, {\n [styles.visible]: visible,\n })}\n >\n {floatingButton}\n </div>\n );\n })}\n </div>\n </div>\n </Layer>,\n host?.current || document.body\n );\n }\n);\n\nFloatingButtonStack.displayName = 'FloatingButtonStack';\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;AAYa,MAAA,mBAAmB,GAAG,UAAU,CACzC,CACI,EACI,KAAK,GAAG,SAAS,EACjB,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,WAAW,EACX,eAAe,EACf,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,OAAO,EAClB,eAAe,EACf,SAAS,EAAE,MAAM,GAAG,uBAAuB,GAC9C,EACD,GAAG,KACH;AACA,IAAA,MAAM,WAAW,GAAG,YAAY,EAAE,CAAC;AACnC,IAAA,MAAM,EAAE,QAAQ,EAAE,GAAG,aAAa,EAAE,CAAC;IAErC,IAAI,WAAW,EAAE;AACb,QAAA,OAAO,IAAI,CAAC;KACf;AAED,IAAA,MAAM,gBAAgB,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC;AAC9C,SAAA,MAAM,EAAC,cAAmC,EAAC;SAC3C,GAAG,CAAC,CAAC,KAAK,KACP,YAAY,CAAC,KAAK,EAAE;QAChB,KAAK;QACL,QAAQ;AACR,QAAA,SAAS,EAAE,IAAI;AACf,QAAA,QAAQ,EAAE,IAAI;AACd,QAAA,OAAO,EAAE,IAAI;AAChB,KAAA,CAAC,CACL,CAAC;IACN,MAAM,mBAAmB,GACrB,gBAAgB,CAAC,MAAM,CAAC,CAAC,cAAc,KAAK,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IAEzF,OAAO,YAAY,CACfA,GAAC,CAAA,KAAK,IAAC,KAAK,EAAC,iBAAi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,EAED,cAAc,EALV,EAAA,cAAc,CAAC,GAAgB,CAMlC,EACR;AACN,qBAAC,CAAC,EAAA,CACA,CACJ,EAAA,CAAA,EAAA,CACF,EACR,IAAI,EAAE,OAAO,IAAI,QAAQ,CAAC,IAAI,CACjC,CAAC;AACN,CAAC,EACH;AAEF,mBAAmB,CAAC,WAAW,GAAG,qBAAqB;;;;"}
|
package/index.css
CHANGED
|
@@ -74,21 +74,21 @@
|
|
|
74
74
|
--magritte-shadow-level-2-color-v24-0-1:#0000003d;
|
|
75
75
|
--magritte-shadow-level-1-color-v24-0-1:#00000029;
|
|
76
76
|
}
|
|
77
|
-
.magritte-wrapper___7m9lC_1-
|
|
77
|
+
.magritte-wrapper___7m9lC_1-3-0{
|
|
78
78
|
display:inline-block;
|
|
79
79
|
position:fixed;
|
|
80
80
|
}
|
|
81
|
-
.magritte-wrapper___7m9lC_1-
|
|
82
|
-
.magritte-animation-timeout___NL8n0_1-
|
|
81
|
+
.magritte-wrapper___7m9lC_1-3-0,
|
|
82
|
+
.magritte-animation-timeout___NL8n0_1-3-0{
|
|
83
83
|
--animation-duration:0;
|
|
84
84
|
}
|
|
85
85
|
@media (prefers-reduced-motion: no-preference){
|
|
86
|
-
.magritte-wrapper___7m9lC_1-
|
|
87
|
-
.magritte-animation-timeout___NL8n0_1-
|
|
86
|
+
.magritte-wrapper___7m9lC_1-3-0,
|
|
87
|
+
.magritte-animation-timeout___NL8n0_1-3-0{
|
|
88
88
|
--animation-duration:var(--magritte-semantic-animation-time-s-duration-v24-0-1);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
.magritte-button___nL-Hn_1-
|
|
91
|
+
.magritte-button___nL-Hn_1-3-0{
|
|
92
92
|
display:inline-block;
|
|
93
93
|
padding:12px;
|
|
94
94
|
border-radius:24px;
|
|
@@ -96,87 +96,87 @@
|
|
|
96
96
|
transition-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v24-0-1);
|
|
97
97
|
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v24-0-1);
|
|
98
98
|
}
|
|
99
|
-
.magritte-button___nL-Hn_1-
|
|
100
|
-
.magritte-button___nL-Hn_1-
|
|
101
|
-
.magritte-button___nL-Hn_1-
|
|
99
|
+
.magritte-button___nL-Hn_1-3-0:disabled,
|
|
100
|
+
.magritte-button___nL-Hn_1-3-0[aria-disabled='true'],
|
|
101
|
+
.magritte-button___nL-Hn_1-3-0.magritte-loading___C0oPZ_1-3-0{
|
|
102
102
|
pointer-events:none;
|
|
103
103
|
cursor:not-allowed;
|
|
104
104
|
}
|
|
105
|
-
.magritte-button___nL-Hn_1-
|
|
106
|
-
.magritte-button___nL-Hn_1-
|
|
105
|
+
.magritte-button___nL-Hn_1-3-0:not(:disabled):active,
|
|
106
|
+
.magritte-button___nL-Hn_1-3-0:not([aria-disabled='true']):active{
|
|
107
107
|
transform:scale(0.96);
|
|
108
108
|
transition-duration:var(--magritte-semantic-animation-ease-in-out-100-duration-v24-0-1);
|
|
109
109
|
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-100-timing-function-v24-0-1);
|
|
110
110
|
}
|
|
111
|
-
.magritte-withIconAndLabel___Qa-lU_1-
|
|
111
|
+
.magritte-withIconAndLabel___Qa-lU_1-3-0{
|
|
112
112
|
padding:12px 16px;
|
|
113
113
|
}
|
|
114
|
-
.magritte-right___3n0Rz_1-
|
|
114
|
+
.magritte-right___3n0Rz_1-3-0{
|
|
115
115
|
right:16px;
|
|
116
116
|
bottom:20px;
|
|
117
117
|
}
|
|
118
118
|
@media (min-width: 1020px){
|
|
119
|
-
body.magritte-old-layout .magritte-right___3n0Rz_1-
|
|
119
|
+
body.magritte-old-layout .magritte-right___3n0Rz_1-3-0{
|
|
120
120
|
right:36px;
|
|
121
121
|
bottom:32px;
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
@media (min-width: 1024px){
|
|
125
|
-
body:not(.magritte-old-layout) .magritte-right___3n0Rz_1-
|
|
125
|
+
body:not(.magritte-old-layout) .magritte-right___3n0Rz_1-3-0{
|
|
126
126
|
right:36px;
|
|
127
127
|
bottom:32px;
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
.magritte-right___3n0Rz_1-
|
|
130
|
+
.magritte-right___3n0Rz_1-3-0 .magritte-content___JNpTZ_1-3-0{
|
|
131
131
|
justify-content:end;
|
|
132
132
|
}
|
|
133
|
-
.magritte-left___GnzU7_1-
|
|
133
|
+
.magritte-left___GnzU7_1-3-0{
|
|
134
134
|
left:16px;
|
|
135
135
|
bottom:20px;
|
|
136
136
|
}
|
|
137
137
|
@media (min-width: 1020px){
|
|
138
|
-
body.magritte-old-layout .magritte-left___GnzU7_1-
|
|
138
|
+
body.magritte-old-layout .magritte-left___GnzU7_1-3-0{
|
|
139
139
|
left:36px;
|
|
140
140
|
bottom:32px;
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
@media (min-width: 1024px){
|
|
144
|
-
body:not(.magritte-old-layout) .magritte-left___GnzU7_1-
|
|
144
|
+
body:not(.magritte-old-layout) .magritte-left___GnzU7_1-3-0{
|
|
145
145
|
left:36px;
|
|
146
146
|
bottom:32px;
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
-
.magritte-left___GnzU7_1-
|
|
149
|
+
.magritte-left___GnzU7_1-3-0 .magritte-content___JNpTZ_1-3-0{
|
|
150
150
|
justify-content:start;
|
|
151
151
|
}
|
|
152
|
-
.magritte-center___MdA40_1-
|
|
152
|
+
.magritte-center___MdA40_1-3-0{
|
|
153
153
|
left:50%;
|
|
154
154
|
bottom:20px;
|
|
155
155
|
transform:translateX(-50%);
|
|
156
156
|
}
|
|
157
157
|
@media (min-width: 1020px){
|
|
158
|
-
body.magritte-old-layout .magritte-center___MdA40_1-
|
|
158
|
+
body.magritte-old-layout .magritte-center___MdA40_1-3-0{
|
|
159
159
|
bottom:32px;
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
@media (min-width: 1024px){
|
|
163
|
-
body:not(.magritte-old-layout) .magritte-center___MdA40_1-
|
|
163
|
+
body:not(.magritte-old-layout) .magritte-center___MdA40_1-3-0{
|
|
164
164
|
bottom:32px;
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
-
.magritte-center___MdA40_1-
|
|
167
|
+
.magritte-center___MdA40_1-3-0 .magritte-content___JNpTZ_1-3-0{
|
|
168
168
|
justify-content:space-between;
|
|
169
169
|
}
|
|
170
|
-
.magritte-postfix___r0EZ6_1-
|
|
170
|
+
.magritte-postfix___r0EZ6_1-3-0{
|
|
171
171
|
padding:0 4px;
|
|
172
172
|
}
|
|
173
|
-
.magritte-icon___VpqJt_1-
|
|
173
|
+
.magritte-icon___VpqJt_1-3-0{
|
|
174
174
|
margin-right:4px;
|
|
175
175
|
}
|
|
176
|
-
.magritte-textless___IbYgp_1-
|
|
176
|
+
.magritte-textless___IbYgp_1-3-0 .magritte-icon___VpqJt_1-3-0{
|
|
177
177
|
margin:0;
|
|
178
178
|
}
|
|
179
|
-
.magritte-label___EPgvj_1-
|
|
179
|
+
.magritte-label___EPgvj_1-3-0{
|
|
180
180
|
text-align:left;
|
|
181
181
|
overflow:hidden;
|
|
182
182
|
transition-property:padding;
|
|
@@ -184,7 +184,7 @@
|
|
|
184
184
|
transition-timing-function:var(--magritte-semantic-animation-ease-base-timing-function-v24-0-1);
|
|
185
185
|
padding:0 4px;
|
|
186
186
|
}
|
|
187
|
-
.magritte-content___JNpTZ_1-
|
|
187
|
+
.magritte-content___JNpTZ_1-3-0{
|
|
188
188
|
display:inline-grid;
|
|
189
189
|
justify-content:flex-end;
|
|
190
190
|
grid-template-columns:max-content 1fr;
|
|
@@ -193,76 +193,76 @@
|
|
|
193
193
|
transition-duration:var(--animation-duration);
|
|
194
194
|
transition-timing-function:var(--magritte-semantic-animation-ease-base-timing-function-v24-0-1);
|
|
195
195
|
}
|
|
196
|
-
.magritte-withPostfix___PmQAz_1-
|
|
196
|
+
.magritte-withPostfix___PmQAz_1-3-0 .magritte-content___JNpTZ_1-3-0{
|
|
197
197
|
grid-template-columns:max-content 1fr max-content;
|
|
198
198
|
}
|
|
199
|
-
.magritte-hideLabel___K79XM_1-
|
|
199
|
+
.magritte-hideLabel___K79XM_1-3-0 .magritte-content___JNpTZ_1-3-0{
|
|
200
200
|
grid-template-columns:max-content 0fr;
|
|
201
201
|
}
|
|
202
|
-
.magritte-hideLabel___K79XM_1-
|
|
202
|
+
.magritte-hideLabel___K79XM_1-3-0 .magritte-label___EPgvj_1-3-0{
|
|
203
203
|
padding:0;
|
|
204
204
|
}
|
|
205
|
-
.magritte-hideLabel___K79XM_1-
|
|
205
|
+
.magritte-hideLabel___K79XM_1-3-0.magritte-withPostfix___PmQAz_1-3-0 .magritte-content___JNpTZ_1-3-0{
|
|
206
206
|
grid-template-columns:max-content 0fr max-content;
|
|
207
207
|
}
|
|
208
|
-
.magritte-withLabelOnHover___1oktd_1-
|
|
208
|
+
.magritte-withLabelOnHover___1oktd_1-3-0:not(.magritte-hideLabel___K79XM_1-3-0).magritte-withIconAndLabel___Qa-lU_1-3-0{
|
|
209
209
|
padding:12px;
|
|
210
210
|
}
|
|
211
|
-
.magritte-withLabelOnHover___1oktd_1-
|
|
211
|
+
.magritte-withLabelOnHover___1oktd_1-3-0:not(.magritte-hideLabel___K79XM_1-3-0):not(.magritte-withPostfix___PmQAz_1-3-0) .magritte-icon___VpqJt_1-3-0{
|
|
212
212
|
margin:0;
|
|
213
213
|
}
|
|
214
|
-
.magritte-withLabelOnHover___1oktd_1-
|
|
214
|
+
.magritte-withLabelOnHover___1oktd_1-3-0:not(.magritte-hideLabel___K79XM_1-3-0) .magritte-content___JNpTZ_1-3-0{
|
|
215
215
|
grid-template-columns:max-content 0fr;
|
|
216
216
|
}
|
|
217
|
-
.magritte-withLabelOnHover___1oktd_1-
|
|
217
|
+
.magritte-withLabelOnHover___1oktd_1-3-0:not(.magritte-hideLabel___K79XM_1-3-0).magritte-withPostfix___PmQAz_1-3-0 .magritte-content___JNpTZ_1-3-0{
|
|
218
218
|
grid-template-columns:max-content 0fr max-content;
|
|
219
219
|
}
|
|
220
|
-
.magritte-withLabelOnHover___1oktd_1-
|
|
220
|
+
.magritte-withLabelOnHover___1oktd_1-3-0:not(.magritte-hideLabel___K79XM_1-3-0) .magritte-label___EPgvj_1-3-0{
|
|
221
221
|
padding:0;
|
|
222
222
|
}
|
|
223
223
|
@media (min-width: 1020px){
|
|
224
|
-
body.magritte-old-layout .magritte-withLabelOnHover___1oktd_1-
|
|
224
|
+
body.magritte-old-layout .magritte-withLabelOnHover___1oktd_1-3-0:not(.magritte-hideLabel___K79XM_1-3-0):hover:not(:disabled):not([aria-disabled='true']).magritte-withIconAndLabel___Qa-lU_1-3-0{
|
|
225
225
|
padding:12px 16px;
|
|
226
226
|
}
|
|
227
|
-
body.magritte-old-layout .magritte-withLabelOnHover___1oktd_1-
|
|
227
|
+
body.magritte-old-layout .magritte-withLabelOnHover___1oktd_1-3-0:not(.magritte-hideLabel___K79XM_1-3-0):hover:not(:disabled):not([aria-disabled='true']) .magritte-icon___VpqJt_1-3-0{
|
|
228
228
|
margin-right:4px;
|
|
229
229
|
}
|
|
230
|
-
body.magritte-old-layout .magritte-withLabelOnHover___1oktd_1-
|
|
230
|
+
body.magritte-old-layout .magritte-withLabelOnHover___1oktd_1-3-0:not(.magritte-hideLabel___K79XM_1-3-0):hover:not(:disabled):not([aria-disabled='true']) .magritte-content___JNpTZ_1-3-0{
|
|
231
231
|
grid-template-columns:max-content 1fr;
|
|
232
232
|
}
|
|
233
|
-
body.magritte-old-layout .magritte-withLabelOnHover___1oktd_1-
|
|
233
|
+
body.magritte-old-layout .magritte-withLabelOnHover___1oktd_1-3-0:not(.magritte-hideLabel___K79XM_1-3-0):hover:not(:disabled):not([aria-disabled='true']).magritte-withPostfix___PmQAz_1-3-0 .magritte-content___JNpTZ_1-3-0{
|
|
234
234
|
grid-template-columns:max-content 1fr max-content;
|
|
235
235
|
}
|
|
236
|
-
body.magritte-old-layout .magritte-withLabelOnHover___1oktd_1-
|
|
236
|
+
body.magritte-old-layout .magritte-withLabelOnHover___1oktd_1-3-0:not(.magritte-hideLabel___K79XM_1-3-0):hover:not(:disabled):not([aria-disabled='true']) .magritte-label___EPgvj_1-3-0{
|
|
237
237
|
padding:0 4px;
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
@media (min-width: 1024px){
|
|
241
|
-
body:not(.magritte-old-layout) .magritte-withLabelOnHover___1oktd_1-
|
|
241
|
+
body:not(.magritte-old-layout) .magritte-withLabelOnHover___1oktd_1-3-0:not(.magritte-hideLabel___K79XM_1-3-0):hover:not(:disabled):not([aria-disabled='true']).magritte-withIconAndLabel___Qa-lU_1-3-0{
|
|
242
242
|
padding:12px 16px;
|
|
243
243
|
}
|
|
244
|
-
body:not(.magritte-old-layout) .magritte-withLabelOnHover___1oktd_1-
|
|
244
|
+
body:not(.magritte-old-layout) .magritte-withLabelOnHover___1oktd_1-3-0:not(.magritte-hideLabel___K79XM_1-3-0):hover:not(:disabled):not([aria-disabled='true']) .magritte-icon___VpqJt_1-3-0{
|
|
245
245
|
margin-right:4px;
|
|
246
246
|
}
|
|
247
|
-
body:not(.magritte-old-layout) .magritte-withLabelOnHover___1oktd_1-
|
|
247
|
+
body:not(.magritte-old-layout) .magritte-withLabelOnHover___1oktd_1-3-0:not(.magritte-hideLabel___K79XM_1-3-0):hover:not(:disabled):not([aria-disabled='true']) .magritte-content___JNpTZ_1-3-0{
|
|
248
248
|
grid-template-columns:max-content 1fr;
|
|
249
249
|
}
|
|
250
|
-
body:not(.magritte-old-layout) .magritte-withLabelOnHover___1oktd_1-
|
|
250
|
+
body:not(.magritte-old-layout) .magritte-withLabelOnHover___1oktd_1-3-0:not(.magritte-hideLabel___K79XM_1-3-0):hover:not(:disabled):not([aria-disabled='true']).magritte-withPostfix___PmQAz_1-3-0 .magritte-content___JNpTZ_1-3-0{
|
|
251
251
|
grid-template-columns:max-content 1fr max-content;
|
|
252
252
|
}
|
|
253
|
-
body:not(.magritte-old-layout) .magritte-withLabelOnHover___1oktd_1-
|
|
253
|
+
body:not(.magritte-old-layout) .magritte-withLabelOnHover___1oktd_1-3-0:not(.magritte-hideLabel___K79XM_1-3-0):hover:not(:disabled):not([aria-disabled='true']) .magritte-label___EPgvj_1-3-0{
|
|
254
254
|
padding:0 4px;
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
.magritte-loading___C0oPZ_1-
|
|
258
|
-
.magritte-loading___C0oPZ_1-
|
|
259
|
-
.magritte-loading___C0oPZ_1-
|
|
257
|
+
.magritte-loading___C0oPZ_1-3-0 .magritte-postfix___r0EZ6_1-3-0,
|
|
258
|
+
.magritte-loading___C0oPZ_1-3-0 .magritte-icon___VpqJt_1-3-0,
|
|
259
|
+
.magritte-loading___C0oPZ_1-3-0 .magritte-label___EPgvj_1-3-0{
|
|
260
260
|
visibility:hidden;
|
|
261
261
|
}
|
|
262
|
-
.magritte-border-radius___ObLLb_1-
|
|
262
|
+
.magritte-border-radius___ObLLb_1-3-0{
|
|
263
263
|
border-radius:12px;
|
|
264
264
|
}
|
|
265
|
-
.magritte-loader___EPezG_1-
|
|
265
|
+
.magritte-loader___EPezG_1-3-0{
|
|
266
266
|
position:absolute;
|
|
267
267
|
left:50%;
|
|
268
268
|
top:50%;
|
|
@@ -270,97 +270,268 @@
|
|
|
270
270
|
line-height:0;
|
|
271
271
|
overflow:hidden;
|
|
272
272
|
}
|
|
273
|
-
.magritte-enter-animation___2sPz3_1-
|
|
273
|
+
.magritte-enter-animation___2sPz3_1-3-0{
|
|
274
274
|
opacity:0;
|
|
275
275
|
}
|
|
276
|
-
.magritte-enter-animation-active___Lq9eq_1-
|
|
276
|
+
.magritte-enter-animation-active___Lq9eq_1-3-0{
|
|
277
277
|
opacity:1;
|
|
278
278
|
transition-property:opacity;
|
|
279
279
|
transition-duration:var(--animation-duration);
|
|
280
280
|
transition-timing-function:var(--magritte-semantic-animation-ease-base-timing-function-v24-0-1);
|
|
281
281
|
}
|
|
282
|
-
.magritte-exit-animation___h2-7a_1-
|
|
282
|
+
.magritte-exit-animation___h2-7a_1-3-0{
|
|
283
283
|
opacity:1;
|
|
284
284
|
}
|
|
285
|
-
.magritte-exit-animation-active___w0F1a_1-
|
|
285
|
+
.magritte-exit-animation-active___w0F1a_1-3-0{
|
|
286
286
|
opacity:0;
|
|
287
287
|
transition-property:opacity;
|
|
288
288
|
transition-duration:var(--animation-duration);
|
|
289
289
|
transition-timing-function:var(--magritte-semantic-animation-ease-base-timing-function-v24-0-1);
|
|
290
290
|
}
|
|
291
|
-
.magritte-button_style-neutral___bPUwu_1-
|
|
291
|
+
.magritte-button_style-neutral___bPUwu_1-3-0{
|
|
292
292
|
background:var(--magritte-color-component-button-background-neutral-v24-0-1);
|
|
293
293
|
--magritte-ui-text-color-override:var(--magritte-color-component-button-text-neutral-v24-0-1);
|
|
294
294
|
--magritte-ui-icon-color-override:var(--magritte-color-component-button-icon-neutral-v24-0-1);
|
|
295
295
|
box-shadow:var(--magritte-shadow-level-2-x-v24-0-1) var(--magritte-shadow-level-2-y-v24-0-1) var(--magritte-shadow-level-2-blur-v24-0-1) var(--magritte-shadow-level-2-spread-v24-0-1) var(--magritte-shadow-level-2-color-v24-0-1);
|
|
296
296
|
--magritte-ui-loader-color-override:var(--magritte-color-component-button-loader-icon-neutral-v24-0-1);
|
|
297
297
|
}
|
|
298
|
-
.magritte-button_style-neutral___bPUwu_1-
|
|
298
|
+
.magritte-button_style-neutral___bPUwu_1-3-0 .magritte-postfix___r0EZ6_1-3-0{
|
|
299
299
|
--magritte-ui-text-color-override:var(--magritte-color-component-button-postfix-text-neutral-v24-0-1);
|
|
300
300
|
}
|
|
301
|
-
.magritte-button_style-neutral___bPUwu_1-
|
|
301
|
+
.magritte-button_style-neutral___bPUwu_1-3-0.magritte-stackMode___RdOTJ_1-3-0{
|
|
302
|
+
box-shadow:none;
|
|
303
|
+
}
|
|
304
|
+
.magritte-button_style-neutral___bPUwu_1-3-0.focus-visible{
|
|
302
305
|
outline:4px solid var(--magritte-color-component-button-stroke-state-neutral-focused-accessible-v24-0-1);
|
|
303
306
|
background:var(--magritte-color-component-button-background-state-neutral-focused-v24-0-1);
|
|
304
307
|
}
|
|
305
|
-
.magritte-button_style-neutral___bPUwu_1-
|
|
306
|
-
.magritte-button_style-neutral___bPUwu_1-
|
|
308
|
+
.magritte-button_style-neutral___bPUwu_1-3-0:not(:disabled):active,
|
|
309
|
+
.magritte-button_style-neutral___bPUwu_1-3-0:not([aria-disabled='true']):active{
|
|
307
310
|
background:var(--magritte-color-component-button-background-state-neutral-pressed-v24-0-1);
|
|
308
311
|
}
|
|
309
|
-
.magritte-button_style-neutral___bPUwu_1-
|
|
310
|
-
.magritte-button_style-neutral___bPUwu_1-
|
|
312
|
+
.magritte-button_style-neutral___bPUwu_1-3-0:disabled,
|
|
313
|
+
.magritte-button_style-neutral___bPUwu_1-3-0[aria-disabled='true']{
|
|
311
314
|
background:var(--magritte-color-component-button-background-state-neutral-disabled-v24-0-1);
|
|
312
315
|
--magritte-ui-text-color-override:var(--magritte-color-component-button-text-state-neutral-disabled-v24-0-1);
|
|
313
316
|
--magritte-ui-icon-color-override:var(--magritte-color-component-button-icon-state-neutral-disabled-v24-0-1);
|
|
314
317
|
}
|
|
315
|
-
.magritte-button_style-neutral___bPUwu_1-
|
|
316
|
-
.magritte-button_style-neutral___bPUwu_1-
|
|
318
|
+
.magritte-button_style-neutral___bPUwu_1-3-0:disabled .magritte-postfix___r0EZ6_1-3-0,
|
|
319
|
+
.magritte-button_style-neutral___bPUwu_1-3-0[aria-disabled='true'] .magritte-postfix___r0EZ6_1-3-0{
|
|
317
320
|
--magritte-ui-text-color-override:var(--magritte-color-component-button-postfix-text-state-neutral-disabled-v24-0-1);
|
|
318
321
|
}
|
|
319
322
|
@media (min-width: 1020px){
|
|
320
|
-
body.magritte-old-layout .magritte-button_style-neutral___bPUwu_1-
|
|
321
|
-
background:var(--magritte-color-component-button-background-state-neutral-hovered-v24-0-1);
|
|
323
|
+
body.magritte-old-layout .magritte-button_style-neutral___bPUwu_1-3-0:hover:not(:active):not(:disabled):not([aria-disabled='true']){
|
|
324
|
+
background:var(--magritte-ui-flb-background-color-hovered-override, var(--magritte-color-component-button-background-state-neutral-hovered-v24-0-1));
|
|
322
325
|
}
|
|
323
326
|
}
|
|
324
327
|
@media (min-width: 1024px){
|
|
325
|
-
body:not(.magritte-old-layout) .magritte-button_style-neutral___bPUwu_1-
|
|
326
|
-
background:var(--magritte-color-component-button-background-state-neutral-hovered-v24-0-1);
|
|
328
|
+
body:not(.magritte-old-layout) .magritte-button_style-neutral___bPUwu_1-3-0:hover:not(:active):not(:disabled):not([aria-disabled='true']){
|
|
329
|
+
background:var(--magritte-ui-flb-background-color-hovered-override, var(--magritte-color-component-button-background-state-neutral-hovered-v24-0-1));
|
|
327
330
|
}
|
|
328
331
|
}
|
|
329
|
-
.magritte-button_style-inverse___Xgf26_1-
|
|
332
|
+
.magritte-button_style-inverse___Xgf26_1-3-0{
|
|
330
333
|
background:var(--magritte-color-component-button-background-inverse-v24-0-1);
|
|
331
334
|
--magritte-ui-text-color-override:var(--magritte-color-component-button-text-inverse-v24-0-1);
|
|
332
335
|
--magritte-ui-icon-color-override:var(--magritte-color-component-button-icon-inverse-v24-0-1);
|
|
333
336
|
box-shadow:var(--magritte-shadow-level-1-x-v24-0-1) var(--magritte-shadow-level-1-y-v24-0-1) var(--magritte-shadow-level-1-blur-v24-0-1) var(--magritte-shadow-level-1-spread-v24-0-1) var(--magritte-shadow-level-1-color-v24-0-1);
|
|
334
337
|
--magritte-ui-loader-color-override:var(--magritte-color-component-button-loader-icon-inverse-v24-0-1);
|
|
335
338
|
}
|
|
336
|
-
.magritte-button_style-inverse___Xgf26_1-
|
|
339
|
+
.magritte-button_style-inverse___Xgf26_1-3-0 .magritte-postfix___r0EZ6_1-3-0{
|
|
337
340
|
--magritte-ui-text-color-override:var(--magritte-color-component-button-postfix-text-inverse-v24-0-1);
|
|
338
341
|
}
|
|
339
|
-
.magritte-button_style-inverse___Xgf26_1-
|
|
342
|
+
.magritte-button_style-inverse___Xgf26_1-3-0.magritte-stackMode___RdOTJ_1-3-0{
|
|
343
|
+
box-shadow:none;
|
|
344
|
+
}
|
|
345
|
+
.magritte-button_style-inverse___Xgf26_1-3-0.focus-visible{
|
|
340
346
|
outline:4px solid var(--magritte-color-component-button-stroke-state-inverse-focused-accessible-v24-0-1);
|
|
341
347
|
background:var(--magritte-color-component-button-background-state-inverse-focused-v24-0-1);
|
|
342
348
|
}
|
|
343
|
-
.magritte-button_style-inverse___Xgf26_1-
|
|
344
|
-
.magritte-button_style-inverse___Xgf26_1-
|
|
349
|
+
.magritte-button_style-inverse___Xgf26_1-3-0:not(:disabled):active,
|
|
350
|
+
.magritte-button_style-inverse___Xgf26_1-3-0:not([aria-disabled='true']):active{
|
|
345
351
|
background:var(--magritte-color-component-button-background-state-inverse-pressed-v24-0-1);
|
|
346
352
|
}
|
|
347
|
-
.magritte-button_style-inverse___Xgf26_1-
|
|
348
|
-
.magritte-button_style-inverse___Xgf26_1-
|
|
353
|
+
.magritte-button_style-inverse___Xgf26_1-3-0:disabled,
|
|
354
|
+
.magritte-button_style-inverse___Xgf26_1-3-0[aria-disabled='true']{
|
|
349
355
|
background:var(--magritte-color-component-button-background-state-inverse-disabled-v24-0-1);
|
|
350
356
|
--magritte-ui-text-color-override:var(--magritte-color-component-button-text-state-inverse-disabled-v24-0-1);
|
|
351
357
|
--magritte-ui-icon-color-override:var(--magritte-color-component-button-icon-state-inverse-disabled-v24-0-1);
|
|
352
358
|
}
|
|
353
|
-
.magritte-button_style-inverse___Xgf26_1-
|
|
354
|
-
.magritte-button_style-inverse___Xgf26_1-
|
|
359
|
+
.magritte-button_style-inverse___Xgf26_1-3-0:disabled .magritte-postfix___r0EZ6_1-3-0,
|
|
360
|
+
.magritte-button_style-inverse___Xgf26_1-3-0[aria-disabled='true'] .magritte-postfix___r0EZ6_1-3-0{
|
|
355
361
|
--magritte-ui-text-color-override:var(--magritte-color-component-button-postfix-text-state-inverse-disabled-v24-0-1);
|
|
356
362
|
}
|
|
357
363
|
@media (min-width: 1020px){
|
|
358
|
-
body.magritte-old-layout .magritte-button_style-inverse___Xgf26_1-
|
|
359
|
-
background:var(--magritte-color-component-button-background-state-inverse-hovered-v24-0-1);
|
|
364
|
+
body.magritte-old-layout .magritte-button_style-inverse___Xgf26_1-3-0:hover:not(:active):not(:disabled):not([aria-disabled='true']){
|
|
365
|
+
background:var(--magritte-ui-flb-background-color-hovered-override, var(--magritte-color-component-button-background-state-inverse-hovered-v24-0-1));
|
|
360
366
|
}
|
|
361
367
|
}
|
|
362
368
|
@media (min-width: 1024px){
|
|
363
|
-
body:not(.magritte-old-layout) .magritte-button_style-inverse___Xgf26_1-
|
|
364
|
-
background:var(--magritte-color-component-button-background-state-inverse-hovered-v24-0-1);
|
|
369
|
+
body:not(.magritte-old-layout) .magritte-button_style-inverse___Xgf26_1-3-0:hover:not(:active):not(:disabled):not([aria-disabled='true']){
|
|
370
|
+
background:var(--magritte-ui-flb-background-color-hovered-override, var(--magritte-color-component-button-background-state-inverse-hovered-v24-0-1));
|
|
365
371
|
}
|
|
366
372
|
}
|
|
373
|
+
|
|
374
|
+
:root{
|
|
375
|
+
--magritte-color-component-button-background-neutral-v24-0-1:#000000;
|
|
376
|
+
--magritte-color-component-button-background-inverse-v24-0-1:#ffffff;
|
|
377
|
+
--magritte-color-component-button-background-state-neutral-disabled-v24-0-1:#DCE3EB;
|
|
378
|
+
--magritte-color-component-button-background-state-inverse-disabled-v24-0-1:#ffffff;
|
|
379
|
+
--magritte-shadow-level-2-color-v24-0-1:#7090b03d;
|
|
380
|
+
--magritte-shadow-level-2-x-v24-0-1:0px;
|
|
381
|
+
--magritte-shadow-level-2-y-v24-0-1:8px;
|
|
382
|
+
--magritte-shadow-level-2-blur-v24-0-1:16px;
|
|
383
|
+
--magritte-shadow-level-2-spread-v24-0-1:0px;
|
|
384
|
+
--magritte-shadow-level-1-color-v24-0-1:#7090b029;
|
|
385
|
+
--magritte-shadow-level-1-x-v24-0-1:0px;
|
|
386
|
+
--magritte-shadow-level-1-y-v24-0-1:4px;
|
|
387
|
+
--magritte-shadow-level-1-blur-v24-0-1:12px;
|
|
388
|
+
--magritte-shadow-level-1-spread-v24-0-1:0px;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
:root{
|
|
392
|
+
--magritte-semantic-animation-time-s-duration-v24-0-1:200ms;
|
|
393
|
+
--magritte-semantic-animation-ease-base-timing-function-v24-0-1:cubic-bezier(0.4, 0.24, 0, 1);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.magritte-night-theme{
|
|
397
|
+
--magritte-color-component-button-background-neutral-v24-0-1:#ffffff;
|
|
398
|
+
--magritte-color-component-button-background-inverse-v24-0-1:#303030;
|
|
399
|
+
--magritte-color-component-button-background-state-neutral-disabled-v24-0-1:#303030;
|
|
400
|
+
--magritte-color-component-button-background-state-inverse-disabled-v24-0-1:#262626;
|
|
401
|
+
--magritte-shadow-level-2-color-v24-0-1:#0000003d;
|
|
402
|
+
--magritte-shadow-level-1-color-v24-0-1:#00000029;
|
|
403
|
+
}
|
|
404
|
+
.magritte-stack___v7QhJ_1-3-0{
|
|
405
|
+
display:inline-flex;
|
|
406
|
+
position:fixed;
|
|
407
|
+
flex-direction:column;
|
|
408
|
+
}
|
|
409
|
+
.magritte-right___v4PFa_1-3-0{
|
|
410
|
+
right:16px;
|
|
411
|
+
bottom:20px;
|
|
412
|
+
}
|
|
413
|
+
@media (min-width: 1020px){
|
|
414
|
+
body.magritte-old-layout .magritte-right___v4PFa_1-3-0{
|
|
415
|
+
right:36px;
|
|
416
|
+
bottom:32px;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
@media (min-width: 1024px){
|
|
420
|
+
body:not(.magritte-old-layout) .magritte-right___v4PFa_1-3-0{
|
|
421
|
+
right:36px;
|
|
422
|
+
bottom:32px;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
.magritte-left___JXzpq_1-3-0{
|
|
426
|
+
left:16px;
|
|
427
|
+
bottom:20px;
|
|
428
|
+
}
|
|
429
|
+
@media (min-width: 1020px){
|
|
430
|
+
body.magritte-old-layout .magritte-left___JXzpq_1-3-0{
|
|
431
|
+
left:36px;
|
|
432
|
+
bottom:32px;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
@media (min-width: 1024px){
|
|
436
|
+
body:not(.magritte-old-layout) .magritte-left___JXzpq_1-3-0{
|
|
437
|
+
left:36px;
|
|
438
|
+
bottom:32px;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
.magritte-center___rV3kK_1-3-0{
|
|
442
|
+
left:50%;
|
|
443
|
+
bottom:20px;
|
|
444
|
+
transform:translateX(-50%);
|
|
445
|
+
}
|
|
446
|
+
@media (min-width: 1020px){
|
|
447
|
+
body.magritte-old-layout .magritte-center___rV3kK_1-3-0{
|
|
448
|
+
bottom:32px;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
@media (min-width: 1024px){
|
|
452
|
+
body:not(.magritte-old-layout) .magritte-center___rV3kK_1-3-0{
|
|
453
|
+
bottom:32px;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
.magritte-up-button___M-Jgi_1-3-0{
|
|
457
|
+
opacity:0;
|
|
458
|
+
height:0;
|
|
459
|
+
transition:height var(--magritte-semantic-animation-time-s-duration-v24-0-1) var(--magritte-semantic-animation-ease-base-timing-function-v24-0-1), opacity var(--magritte-semantic-animation-time-s-duration-v24-0-1) var(--magritte-semantic-animation-ease-base-timing-function-v24-0-1);
|
|
460
|
+
}
|
|
461
|
+
.magritte-up-button___M-Jgi_1-3-0.magritte-visible___lDPdq_1-3-0{
|
|
462
|
+
height:56px;
|
|
463
|
+
opacity:1;
|
|
464
|
+
}
|
|
465
|
+
.magritte-up-button___M-Jgi_1-3-0.magritte-visible___lDPdq_1-3-0.magritte-has-visibled-children___rA8xx_1-3-0{
|
|
466
|
+
margin-bottom:12px;
|
|
467
|
+
}
|
|
468
|
+
@media (min-width: 1020px){
|
|
469
|
+
body.magritte-old-layout .magritte-up-button___M-Jgi_1-3-0.magritte-visible___lDPdq_1-3-0{
|
|
470
|
+
height:72px;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
@media (min-width: 1024px){
|
|
474
|
+
body:not(.magritte-old-layout) .magritte-up-button___M-Jgi_1-3-0.magritte-visible___lDPdq_1-3-0{
|
|
475
|
+
height:72px;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
.magritte-floating-buttons___oi9Yx_1-3-0{
|
|
479
|
+
display:flex;
|
|
480
|
+
flex-direction:column;
|
|
481
|
+
padding:0 4px;
|
|
482
|
+
opacity:0;
|
|
483
|
+
border-radius:40px;
|
|
484
|
+
overflow:hidden;
|
|
485
|
+
transition:opacity var(--magritte-semantic-animation-time-s-duration-v24-0-1) var(--magritte-semantic-animation-ease-base-timing-function-v24-0-1), padding var(--magritte-semantic-animation-time-s-duration-v24-0-1) var(--magritte-semantic-animation-ease-base-timing-function-v24-0-1);
|
|
486
|
+
z-index:1;
|
|
487
|
+
}
|
|
488
|
+
.magritte-floating-buttons___oi9Yx_1-3-0.magritte-has-visibled-children___rA8xx_1-3-0{
|
|
489
|
+
padding:4px;
|
|
490
|
+
opacity:1;
|
|
491
|
+
}
|
|
492
|
+
@media (min-width: 1020px){
|
|
493
|
+
body.magritte-old-layout .magritte-floating-buttons___oi9Yx_1-3-0{
|
|
494
|
+
padding:0 12px;
|
|
495
|
+
}
|
|
496
|
+
body.magritte-old-layout .magritte-floating-buttons___oi9Yx_1-3-0.magritte-has-visibled-children___rA8xx_1-3-0{
|
|
497
|
+
padding:12px;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
@media (min-width: 1024px){
|
|
501
|
+
body:not(.magritte-old-layout) .magritte-floating-buttons___oi9Yx_1-3-0{
|
|
502
|
+
padding:0 12px;
|
|
503
|
+
}
|
|
504
|
+
body:not(.magritte-old-layout) .magritte-floating-buttons___oi9Yx_1-3-0.magritte-has-visibled-children___rA8xx_1-3-0{
|
|
505
|
+
padding:12px;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
.magritte-floating-buttons_neutral___LCnTQ_1-3-0{
|
|
509
|
+
background-color:var(--magritte-color-component-button-background-neutral-v24-0-1);
|
|
510
|
+
box-shadow:var(--magritte-shadow-level-2-x-v24-0-1) var(--magritte-shadow-level-2-y-v24-0-1) var(--magritte-shadow-level-2-blur-v24-0-1) var(--magritte-shadow-level-2-spread-v24-0-1) var(--magritte-shadow-level-2-color-v24-0-1);
|
|
511
|
+
--magritte-ui-flb-background-color-hovered-override:var(--magritte-color-component-button-background-neutral-v24-0-1);
|
|
512
|
+
--magritte-ui-badge-border-color-override:var(--magritte-color-component-button-background-neutral-v24-0-1);
|
|
513
|
+
}
|
|
514
|
+
.magritte-floating-buttons_neutral___LCnTQ_1-3-0.magritte-disabled___XSSqS_1-3-0{
|
|
515
|
+
background-color:var(--magritte-color-component-button-background-state-neutral-disabled-v24-0-1);
|
|
516
|
+
}
|
|
517
|
+
.magritte-floating-buttons_inverse___xhm17_1-3-0{
|
|
518
|
+
background-color:var(--magritte-color-component-button-background-inverse-v24-0-1);
|
|
519
|
+
box-shadow:var(--magritte-shadow-level-1-x-v24-0-1) var(--magritte-shadow-level-1-y-v24-0-1) var(--magritte-shadow-level-1-blur-v24-0-1) var(--magritte-shadow-level-1-spread-v24-0-1) var(--magritte-shadow-level-1-color-v24-0-1);
|
|
520
|
+
--magritte-ui-flb-background-color-hovered-override:var(--magritte-color-component-button-background-inverse-v24-0-1);
|
|
521
|
+
--magritte-ui-badge-border-color-override:var(--magritte-color-component-button-background-inverse-v24-0-1);
|
|
522
|
+
}
|
|
523
|
+
.magritte-floating-buttons_inverse___xhm17_1-3-0.magritte-disabled___XSSqS_1-3-0{
|
|
524
|
+
background-color:var(--magritte-color-component-button-background-state-inverse-disabled-v24-0-1);
|
|
525
|
+
}
|
|
526
|
+
.magritte-floating-button-wrapper___HlTzE_1-3-0{
|
|
527
|
+
overflow:hidden;
|
|
528
|
+
height:0;
|
|
529
|
+
opacity:0;
|
|
530
|
+
padding:4px;
|
|
531
|
+
margin:-4px;
|
|
532
|
+
transition:height var(--magritte-semantic-animation-time-s-duration-v24-0-1) var(--magritte-semantic-animation-ease-base-timing-function-v24-0-1), opacity var(--magritte-semantic-animation-time-s-duration-v24-0-1) var(--magritte-semantic-animation-ease-base-timing-function-v24-0-1);
|
|
533
|
+
}
|
|
534
|
+
.magritte-floating-button-wrapper___HlTzE_1-3-0.magritte-visible___lDPdq_1-3-0{
|
|
535
|
+
height:48px;
|
|
536
|
+
opacity:1;
|
|
537
|
+
}
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
export { FloatingButton } from './FloatingButton.js';
|
|
3
|
+
export { FloatingButtonStack } from './FloatingButtonStack.js';
|
|
3
4
|
import 'react/jsx-runtime';
|
|
4
5
|
import 'react';
|
|
5
6
|
import 'react-dom';
|
|
@@ -10,4 +11,6 @@ import '@hh.ru/magritte-ui-badge';
|
|
|
10
11
|
import '@hh.ru/magritte-ui-layer';
|
|
11
12
|
import '@hh.ru/magritte-ui-loader';
|
|
12
13
|
import '@hh.ru/magritte-ui-typography';
|
|
14
|
+
import '@hh.ru/magritte-ui-breakpoint';
|
|
15
|
+
import '@hh.ru/magritte-ui-icon/variants/icon';
|
|
13
16
|
//# 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/index.mock.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export * from '@hh.ru/magritte-ui-floating-button/types';
|
|
2
2
|
export declare const FloatingButton: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
|
3
|
+
export declare const FloatingButtonStack: import("react").ForwardRefExoticComponent<Record<string, unknown>>;
|
package/index.mock.js
CHANGED
|
@@ -4,6 +4,9 @@ import { mockComponent } from '@hh.ru/magritte-ui-mock-component';
|
|
|
4
4
|
const FloatingButton = mockComponent('FloatingButton', undefined, {
|
|
5
5
|
withChildren: true,
|
|
6
6
|
});
|
|
7
|
+
const FloatingButtonStack = mockComponent('FloatingButtonStack', undefined, {
|
|
8
|
+
withChildren: true,
|
|
9
|
+
});
|
|
7
10
|
|
|
8
|
-
export { FloatingButton };
|
|
11
|
+
export { FloatingButton, FloatingButtonStack };
|
|
9
12
|
//# 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 { mockComponent } from '@hh.ru/magritte-ui-mock-component';\n\nexport * from '@hh.ru/magritte-ui-floating-button/types';\n\nexport const FloatingButton = mockComponent('FloatingButton', undefined, {\n withChildren: true,\n});\n"],"names":[],"mappings":";;MAIa,cAAc,GAAG,aAAa,CAAC,gBAAgB,EAAE,SAAS,EAAE;AACrE,IAAA,YAAY,EAAE,IAAI;AACrB,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.mock.js","sources":["../src/index.mock.ts"],"sourcesContent":["import { mockComponent } from '@hh.ru/magritte-ui-mock-component';\n\nexport * from '@hh.ru/magritte-ui-floating-button/types';\n\nexport const FloatingButton = mockComponent('FloatingButton', undefined, {\n withChildren: true,\n});\n\nexport const FloatingButtonStack = mockComponent('FloatingButtonStack', undefined, {\n withChildren: true,\n});\n"],"names":[],"mappings":";;MAIa,cAAc,GAAG,aAAa,CAAC,gBAAgB,EAAE,SAAS,EAAE;AACrE,IAAA,YAAY,EAAE,IAAI;AACrB,CAAA,EAAE;MAEU,mBAAmB,GAAG,aAAa,CAAC,qBAAqB,EAAE,SAAS,EAAE;AAC/E,IAAA,YAAY,EAAE,IAAI;AACrB,CAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hh.ru/magritte-ui-floating-button",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -22,10 +22,11 @@
|
|
|
22
22
|
"@hh.ru/magritte-common-is-server-env": "1.0.7",
|
|
23
23
|
"@hh.ru/magritte-design-tokens": "24.0.1",
|
|
24
24
|
"@hh.ru/magritte-types": "5.0.5",
|
|
25
|
-
"@hh.ru/magritte-ui-badge": "3.
|
|
25
|
+
"@hh.ru/magritte-ui-badge": "3.3.0",
|
|
26
26
|
"@hh.ru/magritte-ui-breakpoint": "6.0.1",
|
|
27
|
+
"@hh.ru/magritte-ui-icon": "13.3.1",
|
|
27
28
|
"@hh.ru/magritte-ui-layer": "3.0.5",
|
|
28
|
-
"@hh.ru/magritte-ui-loader": "2.0.
|
|
29
|
+
"@hh.ru/magritte-ui-loader": "2.0.18",
|
|
29
30
|
"@hh.ru/magritte-ui-mock-component": "1.1.5",
|
|
30
31
|
"@hh.ru/magritte-ui-typography": "4.3.0"
|
|
31
32
|
},
|
|
@@ -38,5 +39,5 @@
|
|
|
38
39
|
"publishConfig": {
|
|
39
40
|
"access": "public"
|
|
40
41
|
},
|
|
41
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "756f4e95cbdb7bd4ec0b72e3311cd5c0ec16e526"
|
|
42
43
|
}
|
package/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CSSProperties, PropsWithChildren, ReactElement, ReactNode, type RefObject } from 'react';
|
|
2
|
-
import { IconWrapperComponentSize24 } from '@hh.ru/magritte-ui-icon';
|
|
2
|
+
import { IconWrapperComponentSize24, IconProps } from '@hh.ru/magritte-ui-icon';
|
|
3
3
|
export type FloatingButtonStyle = 'neutral' | 'inverse';
|
|
4
4
|
export type FloatingButtonPosition = 'left' | 'right' | 'center';
|
|
5
5
|
export interface FloatingButtonProps extends PropsWithChildren {
|
|
@@ -32,4 +32,25 @@ export interface FloatingButtonProps extends PropsWithChildren {
|
|
|
32
32
|
/** Хост для отрисовки */
|
|
33
33
|
host?: RefObject<HTMLElement>;
|
|
34
34
|
'data-qa'?: string;
|
|
35
|
+
/** Флаг, включающий stack режим для кнопки (отключает тени, меняется позиция badge) */
|
|
36
|
+
stackMode?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface FloatingButtonStackProps extends PropsWithChildren {
|
|
39
|
+
/** Стилизация компонента */
|
|
40
|
+
style?: FloatingButtonStyle;
|
|
41
|
+
/** Расположение компонента */
|
|
42
|
+
position?: FloatingButtonPosition;
|
|
43
|
+
/** Флаг видимости кнопки Наверх */
|
|
44
|
+
upButtonVisible?: boolean;
|
|
45
|
+
/** Css-класс для позиционирования кнопки */
|
|
46
|
+
className?: string;
|
|
47
|
+
/** Инлайн стили для позиционирования кнопки */
|
|
48
|
+
inlineStyle?: CSSProperties;
|
|
49
|
+
/** Хост для отрисовки */
|
|
50
|
+
host?: RefObject<HTMLElement>;
|
|
51
|
+
'data-qa'?: string;
|
|
52
|
+
/** Заблокирована ли кнопка */
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
/** Обработчик события клика кнопки Наверх */
|
|
55
|
+
onUpButtonClick?: IconProps['onClick'];
|
|
35
56
|
}
|