@hh.ru/magritte-ui-floating-button 3.0.47 → 3.0.49
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.d.ts +3 -3
- package/FloatingButton.js +101 -43
- package/FloatingButton.js.map +1 -1
- package/FloatingButtonStack.d.ts +2 -2
- package/FloatingButtonStack.js +42 -6
- package/FloatingButtonStack.js.map +1 -1
- package/FloatingButtonStackContext.d.ts +1 -1
- package/FloatingButtonStackContext.js +39 -37
- package/FloatingButtonStackContext.js.map +1 -1
- package/FloatingButtonStackItem.d.ts +2 -2
- package/FloatingButtonStackItem.js +41 -19
- package/FloatingButtonStackItem.js.map +1 -1
- package/FloatingButtonStackItems.js +13 -7
- package/FloatingButtonStackItems.js.map +1 -1
- package/FloatingButtonStackUpButton.d.ts +1 -1
- package/FloatingButtonStackUpButton.js +38 -11
- package/FloatingButtonStackUpButton.js.map +1 -1
- package/floating-button-stack-Bxv4YYAQ.js +5 -0
- package/floating-button-stack-Bxv4YYAQ.js.map +1 -0
- package/index.css +261 -261
- package/index.d.ts +3 -3
- package/index.js +1 -1
- package/index.mock.d.ts +1 -1
- package/index.mock.js +7 -7
- package/index.mock.js.map +1 -1
- package/package.json +7 -7
- package/floating-button-stack-WhsvBzIP.js +0 -5
- package/floating-button-stack-WhsvBzIP.js.map +0 -1
|
@@ -2,16 +2,22 @@ import './index.css';
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { useFloatingButtonStack } from './FloatingButtonStackContext.js';
|
|
5
|
-
import { s as styles } from './floating-button-stack-
|
|
5
|
+
import { s as styles } from './floating-button-stack-Bxv4YYAQ.js';
|
|
6
6
|
import 'react';
|
|
7
7
|
|
|
8
8
|
const FloatingButtonStackItems = ({ children }) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
const { visibleButtons, animationsEnabled, style, disabled } = useFloatingButtonStack();
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
className: classnames(styles.floatingButtons, styles[`floating-buttons_${style}`], {
|
|
14
|
+
[styles.disabled]: disabled,
|
|
15
|
+
[styles.visibled]: visibleButtons.size > 0,
|
|
16
|
+
[styles.animated]: animationsEnabled
|
|
17
|
+
}),
|
|
18
|
+
children
|
|
19
|
+
}
|
|
20
|
+
);
|
|
15
21
|
};
|
|
16
22
|
|
|
17
23
|
export { FloatingButtonStackItems };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingButtonStackItems.js","sources":["src/FloatingButtonStackItems.tsx"],"sourcesContent":["import { type FC, type PropsWithChildren } from 'react';\nimport classnames from 'classnames';\n\nimport { useFloatingButtonStack } from '@hh.ru/magritte-ui-floating-button/FloatingButtonStackContext';\n\nimport styles from './floating-button-stack.less';\n\nexport const FloatingButtonStackItems: FC<PropsWithChildren> = ({ children }) => {\n const { visibleButtons, animationsEnabled, style, disabled } = useFloatingButtonStack();\n return (\n <div\n className={classnames(styles.floatingButtons, styles[`floating-buttons_${style}`], {\n [styles.disabled]: disabled,\n [styles.visibled]: visibleButtons.size > 0,\n [styles.animated]: animationsEnabled,\n })}\n >\n {children}\n </div>\n );\n};\n"],"names":[
|
|
1
|
+
{"version":3,"file":"FloatingButtonStackItems.js","sources":["src/FloatingButtonStackItems.tsx"],"sourcesContent":["import { type FC, type PropsWithChildren } from 'react';\nimport classnames from 'classnames';\n\nimport { useFloatingButtonStack } from '@hh.ru/magritte-ui-floating-button/FloatingButtonStackContext';\n\nimport styles from './floating-button-stack.less';\n\nexport const FloatingButtonStackItems: FC<PropsWithChildren> = ({ children }) => {\n const { visibleButtons, animationsEnabled, style, disabled } = useFloatingButtonStack();\n return (\n <div\n className={classnames(styles.floatingButtons, styles[`floating-buttons_${style}`], {\n [styles.disabled]: disabled,\n [styles.visibled]: visibleButtons.size > 0,\n [styles.animated]: animationsEnabled,\n })}\n >\n {children}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;AAOO,MAAM,wBAAkD,GAAA,CAAC,EAAE,QAAA,EAAe,KAAA;AAC7E,EAAA,MAAM,EAAE,cAAgB,EAAA,iBAAA,EAAmB,KAAO,EAAA,QAAA,KAAa,sBAAuB,EAAA,CAAA;AACtF,EACI,uBAAA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACG,SAAA,EAAW,WAAW,MAAO,CAAA,eAAA,EAAiB,OAAO,CAAoB,iBAAA,EAAA,KAAK,EAAE,CAAG,EAAA;AAAA,QAC/E,CAAC,MAAO,CAAA,QAAQ,GAAG,QAAA;AAAA,QACnB,CAAC,MAAA,CAAO,QAAQ,GAAG,eAAe,IAAO,GAAA,CAAA;AAAA,QACzC,CAAC,MAAO,CAAA,QAAQ,GAAG,iBAAA;AAAA,OACtB,CAAA;AAAA,MAEA,QAAA;AAAA,KAAA;AAAA,GACL,CAAA;AAER;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type FC } from 'react';
|
|
2
|
-
import type { FloatingButtonStackProps } from '
|
|
2
|
+
import type { FloatingButtonStackProps } from './types';
|
|
3
3
|
type FloatingButtonStackUpButtonProps = Pick<FloatingButtonStackProps, 'upButtonVisible' | 'disabled' | 'onUpButtonClick' | 'data-qa'>;
|
|
4
4
|
export declare const FloatingButtonStackUpButton: FC<FloatingButtonStackUpButtonProps>;
|
|
5
5
|
export {};
|
|
@@ -6,18 +6,45 @@ import CoreTokens from '@hh.ru/magritte-design-tokens/core-tokens';
|
|
|
6
6
|
import { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';
|
|
7
7
|
import { useFloatingButtonStack } from './FloatingButtonStackContext.js';
|
|
8
8
|
import { ArrowUpOutlinedSize24 } from '@hh.ru/magritte-ui-icon/variants/icon';
|
|
9
|
-
import { s as styles } from './floating-button-stack-
|
|
9
|
+
import { s as styles } from './floating-button-stack-Bxv4YYAQ.js';
|
|
10
10
|
|
|
11
|
-
const FloatingButtonStackUpButton = ({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
const FloatingButtonStackUpButton = ({
|
|
12
|
+
upButtonVisible,
|
|
13
|
+
disabled = false,
|
|
14
|
+
onUpButtonClick,
|
|
15
|
+
"data-qa": dataQa
|
|
16
|
+
}) => {
|
|
17
|
+
const { animationsEnabled } = useFloatingButtonStack();
|
|
18
|
+
const { isMobile } = useBreakpoint();
|
|
19
|
+
const upButtonRef = useRef(null);
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
21
|
+
CSSTransition,
|
|
22
|
+
{
|
|
23
|
+
in: upButtonVisible,
|
|
24
|
+
enter: animationsEnabled,
|
|
25
|
+
exit: animationsEnabled,
|
|
26
|
+
classNames: {
|
|
27
|
+
enter: styles.enterUpButtonAnimation,
|
|
28
|
+
enterActive: styles.enterUpButtonAnimationActive,
|
|
29
|
+
exit: styles.exitUpButtonAnimation,
|
|
30
|
+
exitActive: styles.exitUpButtonAnimationActive
|
|
31
|
+
},
|
|
32
|
+
nodeRef: upButtonRef,
|
|
33
|
+
timeout: CoreTokens["magritte-semantic-animation-time-s"].duration,
|
|
34
|
+
unmountOnExit: true,
|
|
35
|
+
children: /* @__PURE__ */ jsx("div", { ref: upButtonRef, className: styles.upButton, children: /* @__PURE__ */ jsx(
|
|
36
|
+
ArrowUpOutlinedSize24,
|
|
37
|
+
{
|
|
38
|
+
padding: isMobile ? 16 : 24,
|
|
39
|
+
onClick: onUpButtonClick,
|
|
40
|
+
backgroundStyle: "secondary",
|
|
41
|
+
borderRadius: "halfHeight",
|
|
42
|
+
disabled,
|
|
43
|
+
"data-qa": `${dataQa}-up-button`
|
|
44
|
+
}
|
|
45
|
+
) })
|
|
46
|
+
}
|
|
47
|
+
);
|
|
21
48
|
};
|
|
22
49
|
|
|
23
50
|
export { FloatingButtonStackUpButton };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingButtonStackUpButton.js","sources":["src/FloatingButtonStackUpButton.tsx"],"sourcesContent":["import { useRef, type FC } from 'react';\nimport { CSSTransition } from 'react-transition-group';\n\nimport CoreTokens from '@hh.ru/magritte-design-tokens/core-tokens';\nimport { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';\nimport { useFloatingButtonStack } from '@hh.ru/magritte-ui-floating-button/FloatingButtonStackContext';\nimport type { FloatingButtonStackProps } from '@hh.ru/magritte-ui-floating-button/types';\nimport { ArrowUpOutlinedSize24 } from '@hh.ru/magritte-ui-icon/variants/icon';\n\nimport styles from './floating-button-stack.less';\n\ntype FloatingButtonStackUpButtonProps = Pick<\n FloatingButtonStackProps,\n 'upButtonVisible' | 'disabled' | 'onUpButtonClick' | 'data-qa'\n>;\n\nexport const FloatingButtonStackUpButton: FC<FloatingButtonStackUpButtonProps> = ({\n upButtonVisible,\n disabled = false,\n onUpButtonClick,\n 'data-qa': dataQa,\n}) => {\n const { animationsEnabled } = useFloatingButtonStack();\n const { isMobile } = useBreakpoint();\n const upButtonRef = useRef<HTMLDivElement>(null);\n\n return (\n <CSSTransition\n in={upButtonVisible}\n enter={animationsEnabled}\n exit={animationsEnabled}\n classNames={{\n enter: styles.enterUpButtonAnimation,\n enterActive: styles.enterUpButtonAnimationActive,\n exit: styles.exitUpButtonAnimation,\n exitActive: styles.exitUpButtonAnimationActive,\n }}\n nodeRef={upButtonRef}\n timeout={CoreTokens['magritte-semantic-animation-time-s'].duration}\n unmountOnExit\n >\n <div ref={upButtonRef} className={styles.upButton}>\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 </CSSTransition>\n );\n};\n"],"names":[
|
|
1
|
+
{"version":3,"file":"FloatingButtonStackUpButton.js","sources":["src/FloatingButtonStackUpButton.tsx"],"sourcesContent":["import { useRef, type FC } from 'react';\nimport { CSSTransition } from 'react-transition-group';\n\nimport CoreTokens from '@hh.ru/magritte-design-tokens/core-tokens';\nimport { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';\nimport { useFloatingButtonStack } from '@hh.ru/magritte-ui-floating-button/FloatingButtonStackContext';\nimport type { FloatingButtonStackProps } from '@hh.ru/magritte-ui-floating-button/types';\nimport { ArrowUpOutlinedSize24 } from '@hh.ru/magritte-ui-icon/variants/icon';\n\nimport styles from './floating-button-stack.less';\n\ntype FloatingButtonStackUpButtonProps = Pick<\n FloatingButtonStackProps,\n 'upButtonVisible' | 'disabled' | 'onUpButtonClick' | 'data-qa'\n>;\n\nexport const FloatingButtonStackUpButton: FC<FloatingButtonStackUpButtonProps> = ({\n upButtonVisible,\n disabled = false,\n onUpButtonClick,\n 'data-qa': dataQa,\n}) => {\n const { animationsEnabled } = useFloatingButtonStack();\n const { isMobile } = useBreakpoint();\n const upButtonRef = useRef<HTMLDivElement>(null);\n\n return (\n <CSSTransition\n in={upButtonVisible}\n enter={animationsEnabled}\n exit={animationsEnabled}\n classNames={{\n enter: styles.enterUpButtonAnimation,\n enterActive: styles.enterUpButtonAnimationActive,\n exit: styles.exitUpButtonAnimation,\n exitActive: styles.exitUpButtonAnimationActive,\n }}\n nodeRef={upButtonRef}\n timeout={CoreTokens['magritte-semantic-animation-time-s'].duration}\n unmountOnExit\n >\n <div ref={upButtonRef} className={styles.upButton}>\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 </CSSTransition>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAgBO,MAAM,8BAAoE,CAAC;AAAA,EAC9E,eAAA;AAAA,EACA,QAAW,GAA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v4PFa_3-0-49","left":"magritte-left___JXzpq_3-0-49","center":"magritte-center___rV3kK_3-0-49","up-button":"magritte-up-button___M-Jgi_3-0-49","upButton":"magritte-up-button___M-Jgi_3-0-49","enter-up-button-animation":"magritte-enter-up-button-animation___-n3rG_3-0-49","enterUpButtonAnimation":"magritte-enter-up-button-animation___-n3rG_3-0-49","enter-up-button-animation-active":"magritte-enter-up-button-animation-active___8pejQ_3-0-49","enterUpButtonAnimationActive":"magritte-enter-up-button-animation-active___8pejQ_3-0-49","exit-up-button-animation":"magritte-exit-up-button-animation___80DEE_3-0-49","exitUpButtonAnimation":"magritte-exit-up-button-animation___80DEE_3-0-49","exit-up-button-animation-active":"magritte-exit-up-button-animation-active___f1LjL_3-0-49","exitUpButtonAnimationActive":"magritte-exit-up-button-animation-active___f1LjL_3-0-49","floating-buttons":"magritte-floating-buttons___oi9Yx_3-0-49","floatingButtons":"magritte-floating-buttons___oi9Yx_3-0-49","animated":"magritte-animated___z--5Y_3-0-49","visibled":"magritte-visibled___hHvF6_3-0-49","floating-buttons_neutral":"magritte-floating-buttons_neutral___LCnTQ_3-0-49","floatingButtonsNeutral":"magritte-floating-buttons_neutral___LCnTQ_3-0-49","disabled":"magritte-disabled___XSSqS_3-0-49","floating-buttons_inverse":"magritte-floating-buttons_inverse___xhm17_3-0-49","floatingButtonsInverse":"magritte-floating-buttons_inverse___xhm17_3-0-49","floating-button-wrapper":"magritte-floating-button-wrapper___HlTzE_3-0-49","floatingButtonWrapper":"magritte-floating-button-wrapper___HlTzE_3-0-49","enter-floating-button-animation":"magritte-enter-floating-button-animation___nke2I_3-0-49","enterFloatingButtonAnimation":"magritte-enter-floating-button-animation___nke2I_3-0-49","enter-floating-button-animation-active":"magritte-enter-floating-button-animation-active___AayrW_3-0-49","enterFloatingButtonAnimationActive":"magritte-enter-floating-button-animation-active___AayrW_3-0-49","exit-floating-button-animation":"magritte-exit-floating-button-animation___dXSTW_3-0-49","exitFloatingButtonAnimation":"magritte-exit-floating-button-animation___dXSTW_3-0-49","exit-floating-button-animation-active":"magritte-exit-floating-button-animation-active___DhIfE_3-0-49","exitFloatingButtonAnimationActive":"magritte-exit-floating-button-animation-active___DhIfE_3-0-49"};
|
|
3
|
+
|
|
4
|
+
export { styles as s };
|
|
5
|
+
//# sourceMappingURL=floating-button-stack-Bxv4YYAQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"floating-button-stack-Bxv4YYAQ.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|