@hh.ru/magritte-ui-floating-button 1.0.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- import type { PolymorphicForwardRefRenderFunc } from '@hh.ru/magritte-types';
1
+ import type { PolymorphicComponentWithRef } from '@hh.ru/magritte-types';
2
2
  import type { FloatingButtonProps } from '@hh.ru/magritte-ui-floating-button/types';
3
- export declare const FloatingButton: PolymorphicForwardRefRenderFunc<FloatingButtonProps, 'button'>;
3
+ export declare const FloatingButton: PolymorphicComponentWithRef<FloatingButtonProps, "button">;
package/FloatingButton.js CHANGED
@@ -1,17 +1,35 @@
1
1
  import './index.css';
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
+ import { forwardRef, useRef, useState, useLayoutEffect } from 'react';
3
4
  import { createPortal } from 'react-dom';
5
+ import { CSSTransition } from 'react-transition-group';
4
6
  import classnames from 'classnames';
5
7
  import { useServerEnv } from '@hh.ru/magritte-common-is-server-env';
8
+ import { ComponentWithBadge } from '@hh.ru/magritte-ui-badge';
9
+ import { Layer } from '@hh.ru/magritte-ui-layer';
6
10
  import { Loader } from '@hh.ru/magritte-ui-loader';
7
11
  import { Text } from '@hh.ru/magritte-ui-typography';
8
12
 
9
- var styles = {"button":"magritte-button___nL-Hn_1-0-3","loading":"magritte-loading___C0oPZ_1-0-3","postfix":"magritte-postfix___r0EZ6_1-0-3","icon":"magritte-icon___VpqJt_1-0-3","label":"magritte-label___EPgvj_1-0-3","border-radius":"magritte-border-radius___ObLLb_1-0-3","borderRadius":"magritte-border-radius___ObLLb_1-0-3","content":"magritte-content___JNpTZ_1-0-3","withLabel":"magritte-withLabel___3gZML_1-0-3","loader":"magritte-loader___EPezG_1-0-3","button_style-neutral":"magritte-button_style-neutral___bPUwu_1-0-3","buttonStyleNeutral":"magritte-button_style-neutral___bPUwu_1-0-3","button_style-inverse":"magritte-button_style-inverse___Xgf26_1-0-3","buttonStyleInverse":"magritte-button_style-inverse___Xgf26_1-0-3"};
13
+ var styles = {"wrapper":"magritte-wrapper___7m9lC_1-1-0","animation-timeout":"magritte-animation-timeout___NL8n0_1-1-0","animationTimeout":"magritte-animation-timeout___NL8n0_1-1-0","button":"magritte-button___nL-Hn_1-1-0","loading":"magritte-loading___C0oPZ_1-1-0","right":"magritte-right___3n0Rz_1-1-0","content":"magritte-content___JNpTZ_1-1-0","left":"magritte-left___GnzU7_1-1-0","center":"magritte-center___MdA40_1-1-0","textless":"magritte-textless___IbYgp_1-1-0","postfix":"magritte-postfix___r0EZ6_1-1-0","label":"magritte-label___EPgvj_1-1-0","withPostfix":"magritte-withPostfix___PmQAz_1-1-0","hideLabel":"magritte-hideLabel___K79XM_1-1-0","withLabelOnHover":"magritte-withLabelOnHover___1oktd_1-1-0","icon":"magritte-icon___VpqJt_1-1-0","border-radius":"magritte-border-radius___ObLLb_1-1-0","borderRadius":"magritte-border-radius___ObLLb_1-1-0","loader":"magritte-loader___EPezG_1-1-0","enter-animation":"magritte-enter-animation___2sPz3_1-1-0","enterAnimation":"magritte-enter-animation___2sPz3_1-1-0","enter-animation-active":"magritte-enter-animation-active___Lq9eq_1-1-0","enterAnimationActive":"magritte-enter-animation-active___Lq9eq_1-1-0","exit-animation":"magritte-exit-animation___h2-7a_1-1-0","exitAnimation":"magritte-exit-animation___h2-7a_1-1-0","exit-animation-active":"magritte-exit-animation-active___w0F1a_1-1-0","exitAnimationActive":"magritte-exit-animation-active___w0F1a_1-1-0","button_style-neutral":"magritte-button_style-neutral___bPUwu_1-1-0","buttonStyleNeutral":"magritte-button_style-neutral___bPUwu_1-1-0","button_style-inverse":"magritte-button_style-inverse___Xgf26_1-1-0","buttonStyleInverse":"magritte-button_style-inverse___Xgf26_1-1-0"};
10
14
 
11
- const FloatingButton = (props) => {
12
- const { Element = 'button', style = 'neutral', disabled, borderRadius, icon: IconComponent, postfix, loading, host, children, className, inlineStyle, } = props;
15
+ const ALLOWED_BADGE_SIZES = ['small'];
16
+ const FloatingButtonComponent = (props, ref) => {
17
+ const { Element = 'button', style = 'neutral', disabled, borderRadius, icon: IconComponent, postfix, loading, host, children, className, inlineStyle, visible, labelOnHover, hideLabel, badge, position = 'right', } = props;
13
18
  let additionalAttributes;
14
19
  const isServerEnv = useServerEnv();
20
+ const wrapperRef = useRef(null);
21
+ const [animationTimeout, setAnimationTimeout] = useState(0);
22
+ useLayoutEffect(() => {
23
+ const animationTimeoutElement = document.createElement('div');
24
+ animationTimeoutElement.classList.add(styles.animationTimeout);
25
+ document.body.appendChild(animationTimeoutElement);
26
+ const style = window.getComputedStyle(animationTimeoutElement);
27
+ const animationTimeout = parseInt(style.getPropertyValue(`--animation-duration`), 10);
28
+ if (Number.isInteger(animationTimeout)) {
29
+ setAnimationTimeout(animationTimeout);
30
+ }
31
+ document.body.removeChild(animationTimeoutElement);
32
+ }, []);
15
33
  if (Element === 'button') {
16
34
  additionalAttributes = {
17
35
  type: 'button',
@@ -24,15 +42,34 @@ const FloatingButton = (props) => {
24
42
  'aria-disabled': disabled,
25
43
  };
26
44
  }
45
+ additionalAttributes.ref = ref;
27
46
  if (isServerEnv) {
28
47
  return null;
29
48
  }
30
- return createPortal(jsx(Element, { ...additionalAttributes, disabled: !!disabled, className: classnames(styles.button, styles[`button_style-${style}`], {
31
- [styles.borderRadius]: borderRadius,
32
- [styles.withLabel]: !!children,
33
- [styles.loading]: loading,
34
- }, className), style: inlineStyle, children: jsxs("span", { className: styles.content, children: [IconComponent && (jsx("span", { className: styles.icon, children: jsx(IconComponent, {}) })), children && (jsx("span", { className: styles.label, children: jsx(Text, { typography: 'subtitle-1-semibold', children: children }) })), postfix && (jsx("span", { className: styles.postfix, children: jsx(Text, { typography: 'subtitle-1-semibold', children: postfix }) })), loading && (jsx("span", { className: styles.loader, children: jsx(Loader, { size: 24 }) }))] }) }), host?.current || document.body);
49
+ let button = (jsx(Element, { ...additionalAttributes, disabled: !!disabled, className: classnames(styles.button, styles[`button_style-${style}`], {
50
+ [styles.borderRadius]: !!borderRadius,
51
+ [styles.loading]: !!loading,
52
+ [styles.withLabelOnHover]: !!labelOnHover,
53
+ [styles.hideLabel]: !!hideLabel,
54
+ [styles.withPostfix]: !!postfix,
55
+ [styles.textless]: !postfix && (!children || !!hideLabel),
56
+ }, className), children: jsxs("span", { className: styles.content, children: [IconComponent && (jsx("span", { className: styles.icon, children: jsx(IconComponent, {}) })), children && (jsx("span", { className: styles.label, children: jsx(Text, { typography: 'subtitle-1-semibold', children: children }) })), postfix && (jsx("span", { className: styles.postfix, children: jsx(Text, { typography: 'subtitle-1-semibold', children: postfix }) })), loading && (jsx("span", { className: styles.loader, children: jsx(Loader, { size: 24 }) }))] }) }));
57
+ if (badge && !disabled) {
58
+ button = (jsx(ComponentWithBadge, { allowedSizes: ALLOWED_BADGE_SIZES, badge: badge, offset: 4, noClip: true, children: button }));
59
+ }
60
+ if (isServerEnv) {
61
+ return null;
62
+ }
63
+ return createPortal(jsx(CSSTransition, { appear: true, in: !!visible && !isServerEnv, nodeRef: wrapperRef, classNames: {
64
+ appear: styles.enterAnimation,
65
+ appearActive: styles.enterAnimationActive,
66
+ enter: styles.enterAnimation,
67
+ enterActive: styles.enterAnimationActive,
68
+ exit: styles.exitAnimation,
69
+ exitActive: styles.exitAnimationActive,
70
+ }, timeout: animationTimeout, unmountOnExit: true, children: jsx(Layer, { layer: "floating-button", children: jsx("div", { className: classnames(styles.wrapper, styles[`${position}`]), ref: wrapperRef, style: inlineStyle, children: button }) }) }), host?.current || document.body);
35
71
  };
72
+ const FloatingButton = forwardRef(FloatingButtonComponent);
36
73
 
37
74
  export { FloatingButton };
38
75
  //# sourceMappingURL=FloatingButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FloatingButton.js","sources":["../src/FloatingButton.tsx"],"sourcesContent":["import React from 'react';\nimport { createPortal } from 'react-dom';\nimport classnames from 'classnames';\n\nimport { useServerEnv } from '@hh.ru/magritte-common-is-server-env';\nimport type { PolymorphicForwardRefRenderFunc } from '@hh.ru/magritte-types';\nimport type { FloatingButtonProps } from '@hh.ru/magritte-ui-floating-button/types';\nimport { Loader } from '@hh.ru/magritte-ui-loader';\nimport { Text } from '@hh.ru/magritte-ui-typography';\n\nimport styles from './floating-button.less';\n\nexport const FloatingButton: PolymorphicForwardRefRenderFunc<FloatingButtonProps, 'button'> = (props) => {\n const {\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 } = props;\n let additionalAttributes: Record<string, unknown>;\n const isServerEnv = useServerEnv();\n\n if (Element === 'button') {\n additionalAttributes = {\n type: 'button',\n };\n } else {\n additionalAttributes = {\n role: 'button',\n tabIndex: disabled ? -1 : 0,\n 'aria-disabled': disabled,\n };\n }\n\n if (isServerEnv) {\n return null;\n }\n\n return createPortal(\n <Element\n {...additionalAttributes}\n disabled={!!disabled}\n className={classnames(\n styles.button,\n styles[`button_style-${style}`],\n {\n [styles.borderRadius]: borderRadius,\n [styles.withLabel]: !!children,\n [styles.loading]: loading,\n },\n className\n )}\n style={inlineStyle}\n >\n <span className={styles.content}>\n {IconComponent && (\n <span className={styles.icon}>\n <IconComponent />\n </span>\n )}\n {children && (\n <span className={styles.label}>\n <Text typography={'subtitle-1-semibold'}>{children}</Text>\n </span>\n )}\n {postfix && (\n <span className={styles.postfix}>\n <Text typography={'subtitle-1-semibold'}>{postfix}</Text>\n </span>\n )}\n {loading && (\n <span className={styles.loader}>\n <Loader size={24} />\n </span>\n )}\n </span>\n </Element>,\n host?.current || document.body\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;AAYa,MAAA,cAAc,GAAmE,CAAC,KAAK,KAAI;AACpG,IAAA,MAAM,EACF,OAAO,GAAG,QAAQ,EAClB,KAAK,GAAG,SAAS,EACjB,QAAQ,EACR,YAAY,EACZ,IAAI,EAAE,aAAa,EACnB,OAAO,EACP,OAAO,EACP,IAAI,EACJ,QAAQ,EACR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A,GAAA,CAAC,IAAI,EAAA,EAAC,UAAU,EAAE,qBAAqB,EAAG,QAAA,EAAA,QAAQ,EAAQ,CAAA,EAAA,CACvD,CACV,EACA,OAAO,KACJA,cAAM,SAAS,EAAE,MAAM,CAAC,OAAO,EAC3B,QAAA,EAAAA,GAAA,CAAC,IAAI,EAAA,EAAC,UAAU,EAAE,qBAAqB,EAAG,QAAA,EAAA,OAAO,EAAQ,CAAA,EAAA,CACtD,CACV,EACA,OAAO,KACJA,GAAM,CAAA,MAAA,EAAA,EAAA,SAAS,EAAE,MAAM,CAAC,MAAM,EAC1B,QAAA,EAAAA,GAAA,CAAC,MAAM,EAAC,EAAA,IAAI,EAAE,EAAE,EAAI,CAAA,EAAA,CACjB,CACV,CACE,EAAA,CAAA,EAAA,CACD,EACV,IAAI,EAAE,OAAO,IAAI,QAAQ,CAAC,IAAI,CACjC,CAAC;AACN;;;;"}
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'> = (props, ref) => {\n const {\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,\n hideLabel,\n badge,\n position = 'right',\n } = props;\n\n let additionalAttributes: Record<string, unknown>;\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 (Element === 'button') {\n additionalAttributes = {\n type: 'button',\n };\n } else {\n additionalAttributes = {\n role: 'button',\n tabIndex: disabled ? -1 : 0,\n '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 disabled={!!disabled}\n className={classnames(\n styles.button,\n styles[`button_style-${style}`],\n {\n [styles.borderRadius]: !!borderRadius,\n [styles.loading]: !!loading,\n [styles.withLabelOnHover]: !!labelOnHover,\n [styles.hideLabel]: !!hideLabel,\n [styles.withPostfix]: !!postfix,\n [styles.textless]: !postfix && (!children || !!hideLabel),\n },\n className\n )}\n >\n <span className={styles.content}>\n {IconComponent && (\n <span className={styles.icon}>\n <IconComponent />\n </span>\n )}\n\n {children && (\n <span className={styles.label}>\n <Text typography={'subtitle-1-semibold'}>{children}</Text>\n </span>\n )}\n {postfix && (\n <span className={styles.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 className={classnames(styles.wrapper, styles[`${position}`])} ref={wrapperRef} style={inlineStyle}>\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,CAAC,KAAK,EAAE,GAAG,KAAI;AAC3G,IAAA,MAAM,EACF,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,EACZ,SAAS,EACT,KAAK,EACL,QAAQ,GAAG,OAAO,GACrB,GAAG,KAAK,CAAC;AAEV,IAAA,IAAI,oBAA6C,CAAC;AAClD,IAAA,MAAM,WAAW,GAAG,YAAY,EAAE,CAAC;AACnC,IAAA,MAAM,UAAU,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAChD,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE5D,eAAe,CAAC,MAAK;QACjB,MAAM,uBAAuB,GAAG,QAAQ,CAAC,aAAa,CAAC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kB,IAAC,YAAY,EAAE,mBAAmB,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EACjF,IAAA,EAAA,QAAA,EAAA,MAAM,EACU,CAAA,CACxB,CAAC;KACL;IAED,IAAI,WAAW,EAAE;AACb,QAAA,OAAO,IAAI,CAAC;KACf;IAED,OAAO,YAAY,CACfA,GAAC,CAAA,aAAa,IACV,MAAM,EAAA,IAAA,EACN,EAAE,EAAE,CAAC,CAAC,OAAO,IAAI,CAAC,WAAW,EAC7B,OAAO,EAAE,UAAU,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,EAC1B,QAAA,EAAAA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA,EAAG,QAAQ,CAAE,CAAA,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EACjG,QAAA,EAAA,MAAM,GACL,EACF,CAAA,EAAA,CACI,EAChB,IAAI,EAAE,OAAO,IAAI,QAAQ,CAAC,IAAI,CACjC,CAAC;AACN,CAAC,CAAC;MAEW,cAAc,GAAG,UAAU,CAAC,uBAAuB;;;;"}
package/index.css CHANGED
@@ -37,6 +37,11 @@
37
37
  --magritte-shadow-level-1-spread-v23-2-2:0px;
38
38
  }
39
39
 
40
+ :root{
41
+ --magritte-semantic-animation-time-s-duration-v23-2-2:200ms;
42
+ --magritte-semantic-animation-ease-base-timing-function-v23-2-2:cubic-bezier(0.4, 0.24, 0, 1);
43
+ }
44
+
40
45
  .magritte-night-theme{
41
46
  --magritte-color-component-button-background-neutral-v23-2-2:#ffffff;
42
47
  --magritte-color-component-button-background-inverse-v23-2-2:#303030;
@@ -65,57 +70,157 @@
65
70
  --magritte-shadow-level-2-color-v23-2-2:#0000003d;
66
71
  --magritte-shadow-level-1-color-v23-2-2:#00000029;
67
72
  }
68
- .magritte-button___nL-Hn_1-0-3{
73
+ .magritte-wrapper___7m9lC_1-1-0{
69
74
  display:inline-block;
70
- padding:12px;
71
- border-radius:24px;
72
75
  position:fixed;
76
+ }
77
+ .magritte-wrapper___7m9lC_1-1-0,
78
+ .magritte-animation-timeout___NL8n0_1-1-0{
79
+ --animation-duration:0;
80
+ }
81
+ @media (prefers-reduced-motion: no-preference){
82
+ .magritte-wrapper___7m9lC_1-1-0,
83
+ .magritte-animation-timeout___NL8n0_1-1-0{
84
+ --animation-duration:var(--magritte-semantic-animation-time-s-duration-v23-2-2);
85
+ }
86
+ }
87
+ .magritte-button___nL-Hn_1-1-0{
88
+ display:inline-block;
89
+ padding:12px 16px;
90
+ border-radius:24px;
91
+ }
92
+ .magritte-button___nL-Hn_1-1-0:disabled,
93
+ .magritte-button___nL-Hn_1-1-0.magritte-loading___C0oPZ_1-1-0{
94
+ pointer-events:none;
95
+ cursor:not-allowed;
96
+ }
97
+ .magritte-right___3n0Rz_1-1-0{
73
98
  right:16px;
74
99
  bottom:20px;
75
100
  }
76
101
  @media (min-width: 1020px){
77
- body.magritte-old-layout .magritte-button___nL-Hn_1-0-3{
102
+ body.magritte-old-layout .magritte-right___3n0Rz_1-1-0{
78
103
  right:36px;
79
104
  bottom:32px;
80
105
  }
81
106
  }
82
107
  @media (min-width: 1024px){
83
- body:not(.magritte-old-layout) .magritte-button___nL-Hn_1-0-3{
108
+ body:not(.magritte-old-layout) .magritte-right___3n0Rz_1-1-0{
84
109
  right:36px;
85
110
  bottom:32px;
86
111
  }
87
112
  }
88
- .magritte-button___nL-Hn_1-0-3:disabled,
89
- .magritte-button___nL-Hn_1-0-3.magritte-loading___C0oPZ_1-0-3{
90
- pointer-events:none;
91
- cursor:not-allowed;
113
+ .magritte-right___3n0Rz_1-1-0 .magritte-content___JNpTZ_1-1-0{
114
+ justify-content:end;
92
115
  }
93
- .magritte-loading___C0oPZ_1-0-3 .magritte-postfix___r0EZ6_1-0-3,
94
- .magritte-loading___C0oPZ_1-0-3 .magritte-icon___VpqJt_1-0-3,
95
- .magritte-loading___C0oPZ_1-0-3 .magritte-label___EPgvj_1-0-3{
96
- visibility:hidden;
116
+ .magritte-left___GnzU7_1-1-0{
117
+ left:16px;
118
+ bottom:20px;
97
119
  }
98
- .magritte-border-radius___ObLLb_1-0-3{
99
- border-radius:12px;
120
+ @media (min-width: 1020px){
121
+ body.magritte-old-layout .magritte-left___GnzU7_1-1-0{
122
+ left:36px;
123
+ bottom:32px;
124
+ }
125
+ }
126
+ @media (min-width: 1024px){
127
+ body:not(.magritte-old-layout) .magritte-left___GnzU7_1-1-0{
128
+ left:36px;
129
+ bottom:32px;
130
+ }
131
+ }
132
+ .magritte-left___GnzU7_1-1-0 .magritte-content___JNpTZ_1-1-0{
133
+ justify-content:start;
134
+ }
135
+ .magritte-center___MdA40_1-1-0{
136
+ left:50%;
137
+ bottom:20px;
138
+ transform:translateX(-50%);
139
+ }
140
+ @media (min-width: 1020px){
141
+ body.magritte-old-layout .magritte-center___MdA40_1-1-0{
142
+ bottom:32px;
143
+ }
144
+ }
145
+ @media (min-width: 1024px){
146
+ body:not(.magritte-old-layout) .magritte-center___MdA40_1-1-0{
147
+ bottom:32px;
148
+ }
149
+ }
150
+ .magritte-center___MdA40_1-1-0 .magritte-content___JNpTZ_1-1-0{
151
+ justify-content:space-between;
152
+ }
153
+ .magritte-textless___IbYgp_1-1-0{
154
+ padding:12px;
155
+ }
156
+ .magritte-postfix___r0EZ6_1-1-0{
157
+ margin-left:8px;
158
+ }
159
+ .magritte-label___EPgvj_1-1-0{
160
+ text-align:left;
161
+ padding-left:8px;
162
+ overflow:hidden;
163
+ transition-property:padding;
164
+ transition-duration:var(--animation-duration);
165
+ transition-timing-function:var(--magritte-semantic-animation-ease-base-timing-function-v23-2-2);
166
+ }
167
+ .magritte-content___JNpTZ_1-1-0{
168
+ display:inline-grid;
169
+ justify-content:flex-end;
170
+ grid-template-columns:max-content 1fr;
171
+ transition-property:grid-template-columns;
172
+ min-height:24px;
173
+ transition-duration:var(--animation-duration);
174
+ transition-timing-function:var(--magritte-semantic-animation-ease-base-timing-function-v23-2-2);
175
+ }
176
+ .magritte-withPostfix___PmQAz_1-1-0 .magritte-content___JNpTZ_1-1-0{
177
+ grid-template-columns:max-content 1fr max-content;
100
178
  }
101
- .magritte-content___JNpTZ_1-0-3{
102
- display:flex;
103
- position:relative;
179
+ .magritte-hideLabel___K79XM_1-1-0 .magritte-content___JNpTZ_1-1-0{
180
+ grid-template-columns:max-content 0fr;
104
181
  }
105
- .magritte-withLabel___3gZML_1-0-3 .magritte-icon___VpqJt_1-0-3{
106
- padding-left:4px;
182
+ .magritte-hideLabel___K79XM_1-1-0 .magritte-label___EPgvj_1-1-0{
183
+ padding:0;
107
184
  }
108
- .magritte-label___EPgvj_1-0-3{
109
- padding:1px 4px;
185
+ .magritte-hideLabel___K79XM_1-1-0.magritte-withPostfix___PmQAz_1-1-0 .magritte-content___JNpTZ_1-1-0{
186
+ grid-template-columns:max-content 0fr max-content;
110
187
  }
111
- .magritte-postfix___r0EZ6_1-0-3{
112
- padding:1px 4px;
188
+ .magritte-withLabelOnHover___1oktd_1-1-0:not(.magritte-hideLabel___K79XM_1-1-0){
189
+ padding:12px;
190
+ }
191
+ .magritte-withLabelOnHover___1oktd_1-1-0:not(.magritte-hideLabel___K79XM_1-1-0).magritte-withPostfix___PmQAz_1-1-0{
192
+ padding:12px 16px;
193
+ }
194
+ .magritte-withLabelOnHover___1oktd_1-1-0:not(.magritte-hideLabel___K79XM_1-1-0) .magritte-content___JNpTZ_1-1-0{
195
+ grid-template-columns:max-content 0fr;
196
+ }
197
+ .magritte-withLabelOnHover___1oktd_1-1-0:not(.magritte-hideLabel___K79XM_1-1-0).magritte-withPostfix___PmQAz_1-1-0 .magritte-content___JNpTZ_1-1-0{
198
+ grid-template-columns:max-content 0fr max-content;
199
+ }
200
+ .magritte-withLabelOnHover___1oktd_1-1-0:not(.magritte-hideLabel___K79XM_1-1-0) .magritte-label___EPgvj_1-1-0{
201
+ padding:0;
202
+ }
203
+ .magritte-withLabelOnHover___1oktd_1-1-0:not(.magritte-hideLabel___K79XM_1-1-0):hover:not(:disabled):not([aria-disabled='true']){
204
+ padding:12px 16px;
205
+ }
206
+ .magritte-withLabelOnHover___1oktd_1-1-0:not(.magritte-hideLabel___K79XM_1-1-0):hover:not(:disabled):not([aria-disabled='true']) .magritte-content___JNpTZ_1-1-0{
207
+ grid-template-columns:max-content 1fr;
208
+ }
209
+ .magritte-withLabelOnHover___1oktd_1-1-0:not(.magritte-hideLabel___K79XM_1-1-0):hover:not(:disabled):not([aria-disabled='true']).magritte-withPostfix___PmQAz_1-1-0 .magritte-content___JNpTZ_1-1-0{
210
+ grid-template-columns:max-content 1fr max-content;
113
211
  }
114
- .magritte-icon___VpqJt_1-0-3 + .magritte-label___EPgvj_1-0-3,
115
- .magritte-icon___VpqJt_1-0-3 + .magritte-postfix___r0EZ6_1-0-3{
212
+ .magritte-withLabelOnHover___1oktd_1-1-0:not(.magritte-hideLabel___K79XM_1-1-0):hover:not(:disabled):not([aria-disabled='true']) .magritte-label___EPgvj_1-1-0{
116
213
  padding-left:8px;
117
214
  }
118
- .magritte-loader___EPezG_1-0-3{
215
+ .magritte-loading___C0oPZ_1-1-0 .magritte-postfix___r0EZ6_1-1-0,
216
+ .magritte-loading___C0oPZ_1-1-0 .magritte-icon___VpqJt_1-1-0,
217
+ .magritte-loading___C0oPZ_1-1-0 .magritte-label___EPgvj_1-1-0{
218
+ visibility:hidden;
219
+ }
220
+ .magritte-border-radius___ObLLb_1-1-0{
221
+ border-radius:12px;
222
+ }
223
+ .magritte-loader___EPezG_1-1-0{
119
224
  position:absolute;
120
225
  left:50%;
121
226
  top:50%;
@@ -123,73 +228,91 @@
123
228
  line-height:0;
124
229
  overflow:hidden;
125
230
  }
126
- .magritte-button_style-neutral___bPUwu_1-0-3{
231
+ .magritte-enter-animation___2sPz3_1-1-0{
232
+ opacity:0;
233
+ }
234
+ .magritte-enter-animation-active___Lq9eq_1-1-0{
235
+ opacity:1;
236
+ transition-property:opacity;
237
+ transition-duration:var(--animation-duration);
238
+ transition-timing-function:var(--magritte-semantic-animation-ease-base-timing-function-v23-2-2);
239
+ }
240
+ .magritte-exit-animation___h2-7a_1-1-0{
241
+ opacity:1;
242
+ }
243
+ .magritte-exit-animation-active___w0F1a_1-1-0{
244
+ opacity:0;
245
+ transition-property:opacity;
246
+ transition-duration:var(--animation-duration);
247
+ transition-timing-function:var(--magritte-semantic-animation-ease-base-timing-function-v23-2-2);
248
+ }
249
+ .magritte-button_style-neutral___bPUwu_1-1-0{
127
250
  background:var(--magritte-color-component-button-background-neutral-v23-2-2);
128
251
  --magritte-ui-text-color-override:var(--magritte-color-component-button-text-neutral-v23-2-2);
129
252
  --magritte-ui-icon-color-override:var(--magritte-color-component-button-icon-neutral-v23-2-2);
130
253
  box-shadow:var(--magritte-shadow-level-2-x-v23-2-2) var(--magritte-shadow-level-2-y-v23-2-2) var(--magritte-shadow-level-2-blur-v23-2-2) var(--magritte-shadow-level-2-spread-v23-2-2) var(--magritte-shadow-level-2-color-v23-2-2);
131
254
  --magritte-ui-loader-color-override:var(--magritte-color-component-button-loader-icon-neutral-v23-2-2);
132
255
  }
133
- .magritte-button_style-neutral___bPUwu_1-0-3 .magritte-postfix___r0EZ6_1-0-3{
256
+ .magritte-button_style-neutral___bPUwu_1-1-0 .magritte-postfix___r0EZ6_1-1-0{
134
257
  --magritte-ui-text-color-override:var(--magritte-color-component-button-postfix-text-neutral-v23-2-2);
135
258
  }
136
- .magritte-button_style-neutral___bPUwu_1-0-3.focus-visible{
259
+ .magritte-button_style-neutral___bPUwu_1-1-0.focus-visible{
137
260
  outline:4px solid var(--magritte-color-component-button-stroke-state-neutral-focused-accessible-v23-2-2);
138
261
  background:var(--magritte-color-component-button-background-state-neutral-focused-v23-2-2);
139
262
  }
140
- .magritte-button_style-neutral___bPUwu_1-0-3:not(:disabled):active{
263
+ .magritte-button_style-neutral___bPUwu_1-1-0:not(:disabled):active{
141
264
  background:var(--magritte-color-component-button-background-state-neutral-pressed-v23-2-2);
142
265
  }
143
- .magritte-button_style-neutral___bPUwu_1-0-3:disabled{
266
+ .magritte-button_style-neutral___bPUwu_1-1-0:disabled{
144
267
  background:var(--magritte-color-component-button-background-state-neutral-disabled-v23-2-2);
145
268
  --magritte-ui-text-color-override:var(--magritte-color-component-button-text-state-neutral-disabled-v23-2-2);
146
269
  --magritte-ui-icon-color-override:var(--magritte-color-component-button-icon-state-neutral-disabled-v23-2-2);
147
270
  }
148
- .magritte-button_style-neutral___bPUwu_1-0-3:disabled .magritte-postfix___r0EZ6_1-0-3{
271
+ .magritte-button_style-neutral___bPUwu_1-1-0:disabled .magritte-postfix___r0EZ6_1-1-0{
149
272
  --magritte-ui-text-color-override:var(--magritte-color-component-button-postfix-text-state-neutral-disabled-v23-2-2);
150
273
  }
151
274
  @media (min-width: 1020px){
152
- body.magritte-old-layout .magritte-button_style-neutral___bPUwu_1-0-3:hover:not(:active):not(:disabled):not([aria-disabled='true']){
275
+ body.magritte-old-layout .magritte-button_style-neutral___bPUwu_1-1-0:hover:not(:active):not(:disabled):not([aria-disabled='true']){
153
276
  background:var(--magritte-color-component-button-background-state-neutral-hovered-v23-2-2);
154
277
  }
155
278
  }
156
279
  @media (min-width: 1024px){
157
- body:not(.magritte-old-layout) .magritte-button_style-neutral___bPUwu_1-0-3:hover:not(:active):not(:disabled):not([aria-disabled='true']){
280
+ body:not(.magritte-old-layout) .magritte-button_style-neutral___bPUwu_1-1-0:hover:not(:active):not(:disabled):not([aria-disabled='true']){
158
281
  background:var(--magritte-color-component-button-background-state-neutral-hovered-v23-2-2);
159
282
  }
160
283
  }
161
- .magritte-button_style-inverse___Xgf26_1-0-3{
284
+ .magritte-button_style-inverse___Xgf26_1-1-0{
162
285
  background:var(--magritte-color-component-button-background-inverse-v23-2-2);
163
286
  --magritte-ui-text-color-override:var(--magritte-color-component-button-text-inverse-v23-2-2);
164
287
  --magritte-ui-icon-color-override:var(--magritte-color-component-button-icon-inverse-v23-2-2);
165
288
  box-shadow:var(--magritte-shadow-level-1-x-v23-2-2) var(--magritte-shadow-level-1-y-v23-2-2) var(--magritte-shadow-level-1-blur-v23-2-2) var(--magritte-shadow-level-1-spread-v23-2-2) var(--magritte-shadow-level-1-color-v23-2-2);
166
289
  --magritte-ui-loader-color-override:var(--magritte-color-component-button-loader-icon-inverse-v23-2-2);
167
290
  }
168
- .magritte-button_style-inverse___Xgf26_1-0-3 .magritte-postfix___r0EZ6_1-0-3{
291
+ .magritte-button_style-inverse___Xgf26_1-1-0 .magritte-postfix___r0EZ6_1-1-0{
169
292
  --magritte-ui-text-color-override:var(--magritte-color-component-button-postfix-text-inverse-v23-2-2);
170
293
  }
171
- .magritte-button_style-inverse___Xgf26_1-0-3.focus-visible{
294
+ .magritte-button_style-inverse___Xgf26_1-1-0.focus-visible{
172
295
  outline:4px solid var(--magritte-color-component-button-stroke-state-inverse-focused-accessible-v23-2-2);
173
296
  background:var(--magritte-color-component-button-background-state-inverse-focused-v23-2-2);
174
297
  }
175
- .magritte-button_style-inverse___Xgf26_1-0-3:not(:disabled):active{
298
+ .magritte-button_style-inverse___Xgf26_1-1-0:not(:disabled):active{
176
299
  background:var(--magritte-color-component-button-background-state-inverse-pressed-v23-2-2);
177
300
  }
178
- .magritte-button_style-inverse___Xgf26_1-0-3:disabled{
301
+ .magritte-button_style-inverse___Xgf26_1-1-0:disabled{
179
302
  background:var(--magritte-color-component-button-background-state-inverse-disabled-v23-2-2);
180
303
  --magritte-ui-text-color-override:var(--magritte-color-component-button-text-state-inverse-disabled-v23-2-2);
181
304
  --magritte-ui-icon-color-override:var(--magritte-color-component-button-icon-state-inverse-disabled-v23-2-2);
182
305
  }
183
- .magritte-button_style-inverse___Xgf26_1-0-3:disabled .magritte-postfix___r0EZ6_1-0-3{
306
+ .magritte-button_style-inverse___Xgf26_1-1-0:disabled .magritte-postfix___r0EZ6_1-1-0{
184
307
  --magritte-ui-text-color-override:var(--magritte-color-component-button-postfix-text-state-inverse-disabled-v23-2-2);
185
308
  }
186
309
  @media (min-width: 1020px){
187
- body.magritte-old-layout .magritte-button_style-inverse___Xgf26_1-0-3:hover:not(:active):not(:disabled):not([aria-disabled='true']){
310
+ body.magritte-old-layout .magritte-button_style-inverse___Xgf26_1-1-0:hover:not(:active):not(:disabled):not([aria-disabled='true']){
188
311
  background:var(--magritte-color-component-button-background-state-inverse-hovered-v23-2-2);
189
312
  }
190
313
  }
191
314
  @media (min-width: 1024px){
192
- body:not(.magritte-old-layout) .magritte-button_style-inverse___Xgf26_1-0-3:hover:not(:active):not(:disabled):not([aria-disabled='true']){
315
+ body:not(.magritte-old-layout) .magritte-button_style-inverse___Xgf26_1-1-0:hover:not(:active):not(:disabled):not([aria-disabled='true']){
193
316
  background:var(--magritte-color-component-button-background-state-inverse-hovered-v23-2-2);
194
317
  }
195
318
  }
package/index.js CHANGED
@@ -1,9 +1,13 @@
1
1
  import './index.css';
2
2
  export { FloatingButton } from './FloatingButton.js';
3
3
  import 'react/jsx-runtime';
4
+ import 'react';
4
5
  import 'react-dom';
6
+ import 'react-transition-group';
5
7
  import 'classnames';
6
8
  import '@hh.ru/magritte-common-is-server-env';
9
+ import '@hh.ru/magritte-ui-badge';
10
+ import '@hh.ru/magritte-ui-layer';
7
11
  import '@hh.ru/magritte-ui-loader';
8
12
  import '@hh.ru/magritte-ui-typography';
9
13
  //# 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-floating-button",
3
- "version": "1.0.3",
3
+ "version": "1.1.0",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -22,18 +22,20 @@
22
22
  "@hh.ru/magritte-common-is-server-env": "1.0.7",
23
23
  "@hh.ru/magritte-design-tokens": "23.2.2",
24
24
  "@hh.ru/magritte-types": "5.0.4",
25
- "@hh.ru/magritte-ui-badge": "3.1.4",
25
+ "@hh.ru/magritte-ui-badge": "3.2.0",
26
26
  "@hh.ru/magritte-ui-breakpoint": "6.0.1",
27
- "@hh.ru/magritte-ui-loader": "2.0.8",
27
+ "@hh.ru/magritte-ui-layer": "3.0.4",
28
+ "@hh.ru/magritte-ui-loader": "2.0.9",
28
29
  "@hh.ru/magritte-ui-typography": "4.2.3"
29
30
  },
30
31
  "peerDependencies": {
31
32
  "classnames": ">=2.3.2",
32
33
  "react": ">=18.2.0",
33
- "react-dom": ">=18.2.0"
34
+ "react-dom": ">=18.2.0",
35
+ "react-transition-group": ">=4.4.5"
34
36
  },
35
37
  "publishConfig": {
36
38
  "access": "public"
37
39
  },
38
- "gitHead": "b2ab15b73592666625ff3b84e10f3cc1bcee9cbc"
40
+ "gitHead": "8ca374027f73643dd942a6d0a2d23ec870924a20"
39
41
  }
package/types.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { CSSProperties, PropsWithChildren, ReactElement, ReactNode, type RefObject } from 'react';
2
2
  import { IconWrapperComponentSize24 } from '@hh.ru/magritte-ui-icon';
3
3
  export type FloatingButtonStyle = 'neutral' | 'inverse';
4
+ export type FloatingButtonPosition = 'left' | 'right' | 'center';
4
5
  export interface FloatingButtonProps extends PropsWithChildren {
5
6
  /** Кастомный компонент 'a', 'button', 'span' или функция */
6
7
  Element?: 'a' | 'button' | 'span';
@@ -22,4 +23,11 @@ export interface FloatingButtonProps extends PropsWithChildren {
22
23
  className?: string;
23
24
  /** инлайн стили для позиционирования кнопки */
24
25
  inlineStyle?: CSSProperties;
26
+ visible?: boolean;
27
+ /** Показывать ли лейбл только при ховере */
28
+ labelOnHover?: boolean;
29
+ /** Скрыть ли лейбл */
30
+ hideLabel?: boolean;
31
+ /** Позиция */
32
+ position?: FloatingButtonPosition;
25
33
  }