@alfalab/core-components-navigation-bar-private 0.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.
Files changed (92) hide show
  1. package/Component.d.ts +5 -0
  2. package/Component.js +165 -0
  3. package/components/back-arrow-addon/Component.d.ts +26 -0
  4. package/components/back-arrow-addon/Component.js +35 -0
  5. package/components/back-arrow-addon/index.css +76 -0
  6. package/components/back-arrow-addon/index.d.ts +1 -0
  7. package/components/back-arrow-addon/index.js +9 -0
  8. package/components/closer/Component.d.ts +35 -0
  9. package/components/closer/Component.js +32 -0
  10. package/components/closer/index.css +48 -0
  11. package/components/closer/index.d.ts +1 -0
  12. package/components/closer/index.js +9 -0
  13. package/cssm/Component.d.ts +5 -0
  14. package/cssm/Component.js +164 -0
  15. package/cssm/components/back-arrow-addon/Component.d.ts +26 -0
  16. package/cssm/components/back-arrow-addon/Component.js +34 -0
  17. package/cssm/components/back-arrow-addon/index.d.ts +1 -0
  18. package/cssm/components/back-arrow-addon/index.js +9 -0
  19. package/cssm/components/back-arrow-addon/index.module.css +75 -0
  20. package/cssm/components/closer/Component.d.ts +35 -0
  21. package/cssm/components/closer/Component.js +31 -0
  22. package/cssm/components/closer/index.d.ts +1 -0
  23. package/cssm/components/closer/index.js +9 -0
  24. package/cssm/components/closer/index.module.css +47 -0
  25. package/cssm/index.d.ts +2 -0
  26. package/cssm/index.js +9 -0
  27. package/cssm/index.module.css +108 -0
  28. package/cssm/shared/index.d.ts +2 -0
  29. package/cssm/shared/index.js +11 -0
  30. package/cssm/types.d.ts +118 -0
  31. package/cssm/types.js +2 -0
  32. package/cssm/vars.css +20 -0
  33. package/esm/Component.d.ts +5 -0
  34. package/esm/Component.js +155 -0
  35. package/esm/components/back-arrow-addon/Component.d.ts +26 -0
  36. package/esm/components/back-arrow-addon/Component.js +26 -0
  37. package/esm/components/back-arrow-addon/index.css +76 -0
  38. package/esm/components/back-arrow-addon/index.d.ts +1 -0
  39. package/esm/components/back-arrow-addon/index.js +1 -0
  40. package/esm/components/closer/Component.d.ts +35 -0
  41. package/esm/components/closer/Component.js +23 -0
  42. package/esm/components/closer/index.css +48 -0
  43. package/esm/components/closer/index.d.ts +1 -0
  44. package/esm/components/closer/index.js +1 -0
  45. package/esm/index.css +108 -0
  46. package/esm/index.d.ts +2 -0
  47. package/esm/index.js +1 -0
  48. package/esm/shared/index.d.ts +2 -0
  49. package/esm/shared/index.js +2 -0
  50. package/esm/types.d.ts +118 -0
  51. package/esm/types.js +1 -0
  52. package/index.css +108 -0
  53. package/index.d.ts +2 -0
  54. package/index.js +9 -0
  55. package/modern/Component.d.ts +5 -0
  56. package/modern/Component.js +160 -0
  57. package/modern/components/back-arrow-addon/Component.d.ts +26 -0
  58. package/modern/components/back-arrow-addon/Component.js +23 -0
  59. package/modern/components/back-arrow-addon/index.css +76 -0
  60. package/modern/components/back-arrow-addon/index.d.ts +1 -0
  61. package/modern/components/back-arrow-addon/index.js +1 -0
  62. package/modern/components/closer/Component.d.ts +35 -0
  63. package/modern/components/closer/Component.js +20 -0
  64. package/modern/components/closer/index.css +48 -0
  65. package/modern/components/closer/index.d.ts +1 -0
  66. package/modern/components/closer/index.js +1 -0
  67. package/modern/index.css +108 -0
  68. package/modern/index.d.ts +2 -0
  69. package/modern/index.js +1 -0
  70. package/modern/shared/index.d.ts +2 -0
  71. package/modern/shared/index.js +2 -0
  72. package/modern/types.d.ts +118 -0
  73. package/modern/types.js +1 -0
  74. package/package.json +27 -0
  75. package/shared/index.d.ts +2 -0
  76. package/shared/index.js +11 -0
  77. package/shared/package.json +3 -0
  78. package/src/Component.tsx +284 -0
  79. package/src/components/back-arrow-addon/Component.tsx +79 -0
  80. package/src/components/back-arrow-addon/index.module.css +69 -0
  81. package/src/components/back-arrow-addon/index.ts +1 -0
  82. package/src/components/closer/Component.tsx +80 -0
  83. package/src/components/closer/index.module.css +32 -0
  84. package/src/components/closer/index.ts +1 -0
  85. package/src/index.module.css +118 -0
  86. package/src/index.ts +2 -0
  87. package/src/shared/index.ts +2 -0
  88. package/src/shared/package.json +3 -0
  89. package/src/types.ts +143 -0
  90. package/src/vars.css +9 -0
  91. package/types.d.ts +118 -0
  92. package/types.js +2 -0
@@ -0,0 +1,155 @@
1
+ import { __assign } from 'tslib';
2
+ import React, { forwardRef, useState, useRef, useEffect } from 'react';
3
+ import mergeRefs from 'react-merge-refs';
4
+ import cn from 'classnames';
5
+ import { getDataTestId } from '@alfalab/core-components-shared/esm';
6
+ import { useLayoutEffect_SAFE_FOR_SSR } from '@alfalab/hooks';
7
+ import { BackArrowAddon } from './components/back-arrow-addon/Component.js';
8
+ import { Closer } from './components/closer/Component.js';
9
+
10
+ var styles = {"header":"navigation-bar-private__header_16jqi","backgroundImage":"navigation-bar-private__backgroundImage_16jqi","mainLine":"navigation-bar-private__mainLine_16jqi","mainLineSticky":"navigation-bar-private__mainLineSticky_16jqi","mainLineWithImageBg":"navigation-bar-private__mainLineWithImageBg_16jqi","content":"navigation-bar-private__content_16jqi","withBothAddons":"navigation-bar-private__withBothAddons_16jqi","withCompactTitle":"navigation-bar-private__withCompactTitle_16jqi","children":"navigation-bar-private__children_16jqi","title":"navigation-bar-private__title_16jqi","contentOnBotDesktop":"navigation-bar-private__contentOnBotDesktop_16jqi","contentOnBotMobile":"navigation-bar-private__contentOnBotMobile_16jqi","subtitle":"navigation-bar-private__subtitle_16jqi","addonsWrapper":"navigation-bar-private__addonsWrapper_16jqi","rightAddons":"navigation-bar-private__rightAddons_16jqi","addon":"navigation-bar-private__addon_16jqi","bottomAddons":"navigation-bar-private__bottomAddons_16jqi","closer":"navigation-bar-private__closer_16jqi","left":"navigation-bar-private__left_16jqi","center":"navigation-bar-private__center_16jqi","trim":"navigation-bar-private__trim_16jqi"};
11
+ require('./index.css')
12
+
13
+ var ADDONS_HEIGHT = 48;
14
+ var NavigationBarPrivate = forwardRef(function (_a, ref) {
15
+ var _b, _c, _d;
16
+ var addonClassName = _a.addonClassName, className = _a.className, contentClassName = _a.contentClassName, closerClassName = _a.closerClassName, leftAddons = _a.leftAddons, rightAddons = _a.rightAddons, bottomAddons = _a.bottomAddons, bottomAddonsClassName = _a.bottomAddonsClassName, children = _a.children, _e = _a.align, align = _e === void 0 ? 'left' : _e, _f = _a.trim, trim = _f === void 0 ? true : _f, title = _a.title, _g = _a.titleSize, titleSize = _g === void 0 ? 'default' : _g, subtitle = _a.subtitle, hasCloser = _a.hasCloser, hasBackButton = _a.hasBackButton, backButtonClassName = _a.backButtonClassName, backButtonProps = _a.backButtonProps, dataTestId = _a.dataTestId, imageUrl = _a.imageUrl, closerIcon = _a.closerIcon, onClose = _a.onClose, view = _a.view, scrollableParentRef = _a.scrollableParentRef, sticky = _a.sticky, onBack = _a.onBack;
17
+ var _h = useState(0), scrollTop = _h[0], setScrollTop = _h[1];
18
+ var _j = useState({ left: 0, right: 0 }), titleMargin = _j[0], setTitleMargin = _j[1];
19
+ var bottomContentRef = useRef(null);
20
+ var headerRef = useRef(null);
21
+ var mainLinePaddingTopRef = useRef('0px');
22
+ var leftAddonsRef = useRef(null);
23
+ var rightAddonsRef = useRef(null);
24
+ var compactTitle = view === 'mobile' && titleSize === 'compact';
25
+ var hasLeftPart = Boolean(leftAddons || hasBackButton);
26
+ var hasRightPart = Boolean(rightAddons || hasCloser);
27
+ var hasContent = Boolean(title || children);
28
+ var withAnimation = Boolean(view === 'mobile' && hasLeftPart && sticky && !compactTitle);
29
+ var showContentOnTop = hasContent && (compactTitle || !hasLeftPart);
30
+ var showContentOnBot = hasContent && !compactTitle && hasLeftPart;
31
+ var showStaticContentOnTop = !withAnimation && showContentOnTop;
32
+ var showStaticContentOnBot = !withAnimation && showContentOnBot;
33
+ var showAnimatedContentOnTop = withAnimation && showContentOnBot && scrollTop > ADDONS_HEIGHT;
34
+ var showAnimatedContentOnBot = withAnimation && showContentOnBot;
35
+ var headerPaddingTop = mainLinePaddingTopRef.current;
36
+ useLayoutEffect_SAFE_FOR_SSR(function () {
37
+ var _a, _b;
38
+ if (align === 'center' && (showStaticContentOnTop || showAnimatedContentOnTop)) {
39
+ var leftAddonsWidth = ((_a = leftAddonsRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) || 0;
40
+ var rightAddonsWidth = ((_b = rightAddonsRef.current) === null || _b === void 0 ? void 0 : _b.offsetWidth) || 0;
41
+ var marginSize_1 = Math.abs(rightAddonsWidth - leftAddonsWidth);
42
+ var shouldAddLeftMargin_1 = rightAddonsWidth - leftAddonsWidth > 0;
43
+ setTitleMargin(function (prev) {
44
+ var newState = shouldAddLeftMargin_1
45
+ ? { left: marginSize_1, right: 0 }
46
+ : { left: 0, right: marginSize_1 };
47
+ var isStateChanged = prev.left !== newState.left || prev.right !== newState.right;
48
+ return isStateChanged ? newState : prev;
49
+ });
50
+ }
51
+ }, [
52
+ align,
53
+ showStaticContentOnTop,
54
+ showAnimatedContentOnTop,
55
+ leftAddons,
56
+ rightAddons,
57
+ hasBackButton,
58
+ hasCloser,
59
+ ]);
60
+ useEffect(function () {
61
+ var parent = scrollableParentRef === null || scrollableParentRef === void 0 ? void 0 : scrollableParentRef.current;
62
+ var handleScroll = function (ev) {
63
+ var divElement = ev.target;
64
+ setScrollTop(divElement.scrollTop);
65
+ };
66
+ if (withAnimation && headerRef.current) {
67
+ mainLinePaddingTopRef.current = getComputedStyle(headerRef.current).paddingTop;
68
+ }
69
+ if (withAnimation && parent) {
70
+ parent.addEventListener('scroll', handleScroll);
71
+ }
72
+ return function () { return parent === null || parent === void 0 ? void 0 : parent.removeEventListener('scroll', handleScroll); };
73
+ }, [scrollableParentRef, withAnimation]);
74
+ var renderBackButton = function () {
75
+ var textOpacity = 1;
76
+ if (withAnimation) {
77
+ var height = hasContent ? ADDONS_HEIGHT : ADDONS_HEIGHT / 2;
78
+ textOpacity = Math.max(0, 1 - scrollTop / height);
79
+ }
80
+ else if (compactTitle) {
81
+ textOpacity = 0;
82
+ }
83
+ return (React.createElement("div", { className: cn(styles.addon, backButtonClassName) },
84
+ React.createElement(BackArrowAddon, __assign({ "data-test-id": getDataTestId(dataTestId, 'back-button') }, backButtonProps, { textOpacity: textOpacity, view: view, onClick: onBack }))));
85
+ };
86
+ var renderContent = function (args) {
87
+ var _a;
88
+ if (args === void 0) { args = {}; }
89
+ var extraClassName = args.extraClassName, wrapperRef = args.wrapperRef, style = args.style, hidden = args.hidden;
90
+ return (React.createElement("div", { style: __assign(__assign({}, style), { visibility: hidden ? 'hidden' : 'visible' }), ref: wrapperRef, className: cn(styles.content, extraClassName, contentClassName, styles[align], (_a = {},
91
+ _a[styles.trim] = trim,
92
+ _a[styles.withCompactTitle] = view === 'mobile' && compactTitle && hasContent,
93
+ _a)), "aria-hidden": hidden },
94
+ children && React.createElement("div", { className: styles.children }, children),
95
+ title && (React.createElement("div", { className: styles.title, "data-test-id": hidden ? undefined : getDataTestId(dataTestId, 'title') }, title)),
96
+ compactTitle && subtitle && React.createElement("div", { className: styles.subtitle }, subtitle)));
97
+ };
98
+ var renderCloser = function () { return (React.createElement("div", { className: cn(styles.addon, styles.closer, closerClassName) },
99
+ React.createElement(Closer, { view: view, icon: closerIcon, dataTestId: getDataTestId(dataTestId, 'closer'), onClose: onClose }))); };
100
+ return (React.createElement("div", { ref: mergeRefs([ref, headerRef]), className: cn(styles.header, className, (_b = {}, _b[styles.backgroundImage] = imageUrl, _b)), "data-test-id": getDataTestId(dataTestId), style: __assign(__assign({}, (imageUrl && { backgroundImage: "url(".concat(imageUrl, ")") })), (withAnimation &&
101
+ bottomContentRef.current && {
102
+ top: -bottomContentRef.current.scrollHeight,
103
+ })) },
104
+ React.createElement("div", { className: cn(styles.mainLine, (_c = {},
105
+ _c[styles.mainLineSticky] = withAnimation,
106
+ _c[styles.mainLineWithImageBg] = imageUrl,
107
+ _c)), style: __assign({}, (withAnimation
108
+ ? {
109
+ marginTop: "-".concat(headerPaddingTop),
110
+ paddingTop: headerPaddingTop,
111
+ }
112
+ : null)) },
113
+ hasLeftPart && (React.createElement("div", { className: styles.addonsWrapper, ref: leftAddonsRef },
114
+ hasBackButton && renderBackButton(),
115
+ leftAddons && (React.createElement("div", { className: cn(styles.addon, addonClassName) }, leftAddons)))),
116
+ showStaticContentOnTop &&
117
+ renderContent(__assign({}, (align === 'center'
118
+ ? {
119
+ style: {
120
+ marginLeft: titleMargin.left,
121
+ marginRight: titleMargin.right,
122
+ },
123
+ }
124
+ : null))),
125
+ showAnimatedContentOnTop &&
126
+ renderContent({
127
+ extraClassName: styles.withBothAddons,
128
+ style: __assign({ opacity: Math.min(1, (scrollTop - ADDONS_HEIGHT) / ADDONS_HEIGHT) }, (align === 'center'
129
+ ? {
130
+ marginLeft: titleMargin.left,
131
+ marginRight: titleMargin.right,
132
+ }
133
+ : null)),
134
+ }),
135
+ hasRightPart && (React.createElement("div", { className: cn(styles.addonsWrapper, styles.rightAddons), ref: rightAddonsRef },
136
+ rightAddons && (React.createElement("div", { className: cn(styles.addon, addonClassName) }, rightAddons)),
137
+ hasCloser && renderCloser()))),
138
+ showAnimatedContentOnBot &&
139
+ renderContent({
140
+ wrapperRef: bottomContentRef,
141
+ extraClassName: styles.underAddons,
142
+ style: { opacity: Math.max(0, 1 - scrollTop / ADDONS_HEIGHT) },
143
+ hidden: scrollTop / ADDONS_HEIGHT > 1,
144
+ }),
145
+ showStaticContentOnBot &&
146
+ renderContent({
147
+ extraClassName: cn((_d = {},
148
+ _d[styles.contentOnBotDesktop] = view === 'desktop',
149
+ _d[styles.contentOnBotMobile] = view === 'mobile',
150
+ _d)),
151
+ }),
152
+ bottomAddons && (React.createElement("div", { className: cn(styles.bottomAddons, bottomAddonsClassName) }, bottomAddons))));
153
+ });
154
+
155
+ export { NavigationBarPrivate };
@@ -0,0 +1,26 @@
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ interface BackArrowAddonProps extends React.HTMLAttributes<HTMLButtonElement> {
4
+ /**
5
+ * Текст после иконки
6
+ */
7
+ text?: string | null;
8
+ /**
9
+ * Дополнительный класс
10
+ */
11
+ className?: string;
12
+ /**
13
+ * Вид компонента
14
+ */
15
+ view: 'mobile' | 'desktop';
16
+ /**
17
+ * Прозрачность текста
18
+ */
19
+ textOpacity?: number;
20
+ /**
21
+ * Обработчик клика
22
+ */
23
+ onClick?: () => void;
24
+ }
25
+ declare const BackArrowAddon: React.FC<BackArrowAddonProps>;
26
+ export { BackArrowAddonProps, BackArrowAddon };
@@ -0,0 +1,26 @@
1
+ import { __rest, __assign } from 'tslib';
2
+ import React from 'react';
3
+ import cn from 'classnames';
4
+ import { ButtonDesktop } from '@alfalab/core-components-button/esm/desktop';
5
+ import { Typography } from '@alfalab/core-components-typography/esm';
6
+ import { ArrowLeftMediumMIcon } from '@alfalab/icons-glyph/ArrowLeftMediumMIcon';
7
+ import { ArrowLeftMIcon } from '@alfalab/icons-glyph/ArrowLeftMIcon';
8
+
9
+ var styles = {"component":"navigation-bar-private__component_rqdd8","mobileComponent":"navigation-bar-private__mobileComponent_rqdd8","flex":"navigation-bar-private__flex_rqdd8","iconWrapper":"navigation-bar-private__iconWrapper_rqdd8","text":"navigation-bar-private__text_rqdd8","mobileWrapper":"navigation-bar-private__mobileWrapper_rqdd8"};
10
+ require('./index.css')
11
+
12
+ var BackArrowAddon = function (_a) {
13
+ var _b, _c;
14
+ var _d = _a.text, text = _d === void 0 ? 'Назад' : _d, onClick = _a.onClick, className = _a.className, _e = _a.textOpacity, textOpacity = _e === void 0 ? 1 : _e, view = _a.view, htmlAttributes = __rest(_a, ["text", "onClick", "className", "textOpacity", "view"]);
15
+ var Icon = view === 'desktop' ? ArrowLeftMediumMIcon : ArrowLeftMIcon;
16
+ var isMobileView = view === 'mobile';
17
+ return (React.createElement(ButtonDesktop, __assign({ view: 'text', size: isMobileView ? 'xxs' : 's', onClick: onClick, "aria-label": '\u043D\u0430\u0437\u0430\u0434', className: cn(styles.component, (_b = {}, _b[styles.mobileComponent] = isMobileView, _b), className) }, htmlAttributes),
18
+ React.createElement("div", { className: styles.flex },
19
+ React.createElement("div", { className: cn(styles.iconWrapper, (_c = {},
20
+ _c[styles.mobileWrapper] = isMobileView,
21
+ _c)) },
22
+ React.createElement(Icon, null)),
23
+ textOpacity > 0 && text && (React.createElement(Typography.Text, { className: styles.text, view: view === 'desktop' ? 'primary-large' : 'component', weight: 'medium', style: { opacity: textOpacity } }, text)))));
24
+ };
25
+
26
+ export { BackArrowAddon };
@@ -0,0 +1,76 @@
1
+ /* hash: 1pg68 */
2
+ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
+ } /* deprecated */ :root {
4
+ --color-light-neutral-1500: #121213;
5
+ --color-light-neutral-1500-hover: #3f3f45;
6
+ --color-light-neutral-1500-press: #5f5f66;
7
+ --color-light-neutral-translucent-100: rgba(38, 55, 88, 0.06);
8
+ --color-light-neutral-translucent-700: rgba(4, 4, 21, 0.47); /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
9
+ --color-light-bg-primary-alpha-40: rgba(255, 255, 255, 0.4);
10
+ } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
11
+ } :root {
12
+ } :root {
13
+
14
+ /* Hard */
15
+
16
+ /* Up */
17
+
18
+ /* Hard up */
19
+ } :root {
20
+ --border-radius-circle: 50%;
21
+ --border-radius-pill: 99px;
22
+ } :root {
23
+ --gap-xs: 8px;
24
+ --gap-s: 12px;
25
+ } :root {
26
+ } :root {
27
+ } :root {
28
+ /* closer-mobile */
29
+
30
+ /* back-arrow */
31
+ --navigation-bar-back-arrow-mobile-fill: var(--color-light-neutral-translucent-700);
32
+ } .navigation-bar-private__component_rqdd8 {
33
+ height: 100%;
34
+ background: var(--color-light-bg-primary-alpha-40);
35
+ -webkit-backdrop-filter: blur(10px);
36
+ backdrop-filter: blur(10px);
37
+ border-radius: var(--border-radius-pill);
38
+ min-width: 48px
39
+ } .navigation-bar-private__component_rqdd8 svg > path {
40
+ transition: fill 0.2s ease;
41
+ fill: var(--color-light-neutral-1500);
42
+ } .navigation-bar-private__component_rqdd8:hover svg > path {
43
+ fill: var(--color-light-neutral-1500-hover);
44
+ } .navigation-bar-private__component_rqdd8:active svg > path {
45
+ fill: var(--color-light-neutral-1500-press);
46
+ } .navigation-bar-private__mobileComponent_rqdd8 {
47
+ height: 32px;
48
+ min-width: 32px;
49
+ margin: 0 var(--gap-xs);
50
+ -webkit-backdrop-filter: none;
51
+ backdrop-filter: none;
52
+ background: none;
53
+ } .navigation-bar-private__flex_rqdd8 {
54
+ display: flex;
55
+ align-items: center;
56
+ } .navigation-bar-private__iconWrapper_rqdd8 {
57
+ display: inline-flex;
58
+ align-items: center;
59
+ justify-content: center;
60
+ height: 48px;
61
+ margin: 0 var(--gap-xs) 0 var(--gap-s);
62
+ border-radius: var(--border-radius-circle)
63
+ } .navigation-bar-private__iconWrapper_rqdd8 + .navigation-bar-private__text_rqdd8 {
64
+ margin-right: var(--gap-s);
65
+ } .navigation-bar-private__mobileWrapper_rqdd8 {
66
+ width: 32px;
67
+ height: 32px;
68
+ background: var(--color-light-neutral-translucent-100);
69
+ -webkit-backdrop-filter: blur(10px);
70
+ backdrop-filter: blur(10px);
71
+ margin: 0
72
+ } .navigation-bar-private__mobileWrapper_rqdd8 + .navigation-bar-private__text_rqdd8 {
73
+ margin: 0 var(--gap-s) 0 var(--gap-xs);
74
+ } .navigation-bar-private__mobileWrapper_rqdd8 svg > path {
75
+ fill: var(--navigation-bar-back-arrow-mobile-fill);
76
+ }
@@ -0,0 +1 @@
1
+ export * from "./Component";
@@ -0,0 +1 @@
1
+ export { BackArrowAddon } from './Component.js';
@@ -0,0 +1,35 @@
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ import { ButtonHTMLAttributes, ElementType, FC } from "react";
4
+ interface CloserProps extends ButtonHTMLAttributes<HTMLButtonElement> {
5
+ /**
6
+ * Вид компонента
7
+ */
8
+ view: 'desktop' | 'mobile';
9
+ /**
10
+ * Дополнительный класс
11
+ */
12
+ className?: string;
13
+ /**
14
+ * Позиция крестика
15
+ */
16
+ align?: 'left' | 'right';
17
+ /**
18
+ * Фиксирует крестик
19
+ */
20
+ sticky?: boolean;
21
+ /**
22
+ * Иконка
23
+ */
24
+ icon?: ElementType;
25
+ /**
26
+ * Идентификатор для систем автоматизированного тестирования
27
+ */
28
+ dataTestId?: string;
29
+ /**
30
+ * Коллбэк закрытия.
31
+ */
32
+ onClose?: (event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>, reason?: 'backdropClick' | 'escapeKeyDown' | 'closerClick') => void;
33
+ }
34
+ declare const Closer: FC<CloserProps>;
35
+ export { CloserProps, Closer };
@@ -0,0 +1,23 @@
1
+ import { __rest, __assign } from 'tslib';
2
+ import React from 'react';
3
+ import cn from 'classnames';
4
+ import { IconButton } from '@alfalab/core-components-icon-button/esm';
5
+ import { CrossHeavyMIcon } from '@alfalab/icons-glyph/CrossHeavyMIcon';
6
+ import { CrossMIcon } from '@alfalab/icons-glyph/CrossMIcon';
7
+
8
+ var styles = {"closer":"navigation-bar-private__closer_1bwy4","button":"navigation-bar-private__button_1bwy4","mobile":"navigation-bar-private__mobile_1bwy4","sticky":"navigation-bar-private__sticky_1bwy4"};
9
+ require('./index.css')
10
+
11
+ var Closer = function (_a) {
12
+ var _b, _c;
13
+ var view = _a.view, className = _a.className, sticky = _a.sticky, _d = _a.icon, icon = _d === void 0 ? view === 'desktop' ? CrossHeavyMIcon : CrossMIcon : _d, dataTestId = _a.dataTestId, onClose = _a.onClose, restProps = __rest(_a, ["view", "className", "sticky", "icon", "dataTestId", "onClose"]);
14
+ var handleClick = function (event) {
15
+ onClose === null || onClose === void 0 ? void 0 : onClose(event, 'closerClick');
16
+ };
17
+ return (React.createElement("div", { className: cn(styles.closer, className, (_b = {},
18
+ _b[styles.sticky] = sticky,
19
+ _b)) },
20
+ React.createElement(IconButton, __assign({ size: view === 'desktop' ? 's' : 'xs', className: cn(styles.button, (_c = {}, _c[styles.mobile] = view === 'mobile', _c)), "aria-label": '\u0437\u0430\u043A\u0440\u044B\u0442\u044C', onClick: handleClick, icon: icon, dataTestId: dataTestId }, restProps))));
21
+ };
22
+
23
+ export { Closer };
@@ -0,0 +1,48 @@
1
+ /* hash: auqb3 */
2
+ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
+ } /* deprecated */ :root {
4
+ --color-light-neutral-1500: #121213;
5
+ --color-light-neutral-translucent-100: rgba(38, 55, 88, 0.06);
6
+ --color-light-neutral-translucent-700: rgba(4, 4, 21, 0.47); /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
7
+ --color-light-bg-primary-alpha-40: rgba(255, 255, 255, 0.4);
8
+ } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
9
+ } :root {
10
+ } :root {
11
+
12
+ /* Hard */
13
+
14
+ /* Up */
15
+
16
+ /* Hard up */
17
+ } :root {
18
+ --border-radius-circle: 50%;
19
+ } :root {
20
+ } :root {
21
+ } :root {
22
+ } :root {
23
+ /* closer-mobile */
24
+ --navigation-bar-closer-mobile-color: var(--color-light-neutral-translucent-700);
25
+
26
+ /* back-arrow */
27
+ } .navigation-bar-private__closer_1bwy4 {
28
+ flex-shrink: 0;
29
+ width: 48px;
30
+ height: 48px;
31
+ margin-left: auto;
32
+ display: flex;
33
+ align-items: center;
34
+ justify-content: center;
35
+ } .navigation-bar-private__button_1bwy4 {
36
+ background: var(--color-light-bg-primary-alpha-40);
37
+ -webkit-backdrop-filter: blur(10px);
38
+ backdrop-filter: blur(10px);
39
+ color: var(--color-light-neutral-1500)
40
+ } .navigation-bar-private__button_1bwy4.navigation-bar-private__mobile_1bwy4 {
41
+ background: var(--color-light-neutral-translucent-100);
42
+ color: var(--navigation-bar-closer-mobile-color);
43
+ } .navigation-bar-private__button_1bwy4.navigation-bar-private__button_1bwy4 {
44
+ border-radius: var(--border-radius-circle);
45
+ } .navigation-bar-private__sticky_1bwy4 {
46
+ position: sticky;
47
+ top: 0;
48
+ }
@@ -0,0 +1 @@
1
+ export * from "./Component";
@@ -0,0 +1 @@
1
+ export { Closer } from './Component.js';
package/esm/index.css ADDED
@@ -0,0 +1,108 @@
1
+ /* hash: 21se8 */
2
+ :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
3
+ } /* deprecated */ :root {
4
+ --color-light-text-primary: rgba(3, 3, 6, 0.88);
5
+ --color-light-text-secondary: rgba(4, 4, 19, 0.55); /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
6
+ } :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
7
+ } :root {
8
+ } :root {
9
+
10
+ /* Hard */
11
+
12
+ /* Up */
13
+
14
+ /* Hard up */
15
+ } :root {
16
+ } :root {
17
+ --gap-2xs: 4px;
18
+ --gap-s: 12px;
19
+ } :root {
20
+ } :root {
21
+ } .navigation-bar-private__header_16jqi {
22
+ width: 100%;
23
+ box-sizing: border-box;
24
+ transition: box-shadow 0.2s ease, background 0.2s ease
25
+ } .navigation-bar-private__header_16jqi.navigation-bar-private__header_16jqi.navigation-bar-private__backgroundImage_16jqi {
26
+ background-repeat: no-repeat;
27
+ background-position: center;
28
+ background-size: cover;
29
+ } .navigation-bar-private__mainLine_16jqi {
30
+ display: flex;
31
+ align-items: stretch;
32
+ justify-content: space-between;
33
+ z-index: 1;
34
+ background-color: inherit;
35
+ } .navigation-bar-private__mainLineSticky_16jqi {
36
+ position: sticky;
37
+ top: 0;
38
+ } .navigation-bar-private__mainLineWithImageBg_16jqi {
39
+ background-color: initial;
40
+ } .navigation-bar-private__content_16jqi {
41
+ color: var(--color-light-text-primary);
42
+ display: flex;
43
+ flex-flow: column nowrap;
44
+ justify-content: center;
45
+ flex-grow: 1;
46
+ align-self: baseline;
47
+ box-sizing: border-box;
48
+ min-height: 48px
49
+ } .navigation-bar-private__content_16jqi.navigation-bar-private__withBothAddons_16jqi,
50
+ .navigation-bar-private__content_16jqi.navigation-bar-private__withCompactTitle_16jqi {
51
+ font-size: 16px;
52
+ line-height: 20px;
53
+ font-weight: 500;
54
+ align-self: center;
55
+ padding-top: var(--gap-2xs);
56
+ padding-bottom: var(--gap-2xs)
57
+ } .navigation-bar-private__content_16jqi.navigation-bar-private__withBothAddons_16jqi > .navigation-bar-private__children_16jqi,
58
+ .navigation-bar-private__content_16jqi.navigation-bar-private__withBothAddons_16jqi > .navigation-bar-private__title_16jqi,
59
+ .navigation-bar-private__content_16jqi.navigation-bar-private__withCompactTitle_16jqi > .navigation-bar-private__children_16jqi,
60
+ .navigation-bar-private__content_16jqi.navigation-bar-private__withCompactTitle_16jqi > .navigation-bar-private__title_16jqi {
61
+ -webkit-line-clamp: 1;
62
+ word-break: break-all;
63
+ } .navigation-bar-private__content_16jqi.navigation-bar-private__contentOnBotDesktop_16jqi.navigation-bar-private__contentOnBotDesktop_16jqi {
64
+ padding-top: var(--gap-s);
65
+ } .navigation-bar-private__content_16jqi.navigation-bar-private__contentOnBotMobile_16jqi.navigation-bar-private__contentOnBotMobile_16jqi {
66
+ padding-top: var(--gap-s);
67
+ } .navigation-bar-private__title_16jqi {
68
+ word-break: break-word;
69
+ } .navigation-bar-private__subtitle_16jqi {
70
+ font-size: 14px;
71
+ line-height: 20px;
72
+ font-weight: 400;
73
+ -webkit-line-clamp: 1;
74
+ display: -webkit-box;
75
+ -webkit-box-orient: vertical;
76
+ overflow: hidden;
77
+
78
+ color: var(--color-light-text-secondary);
79
+ word-break: break-all;
80
+ } .navigation-bar-private__addonsWrapper_16jqi {
81
+ display: flex;
82
+ } .navigation-bar-private__rightAddons_16jqi {
83
+ margin-left: auto;
84
+ } .navigation-bar-private__addon_16jqi {
85
+ min-width: 48px;
86
+ height: 48px;
87
+ display: flex;
88
+ justify-content: center;
89
+ align-items: center;
90
+ flex-shrink: 0;
91
+ pointer-events: all;
92
+ } .navigation-bar-private__bottomAddons_16jqi {
93
+ pointer-events: all;
94
+ } .navigation-bar-private__closer_16jqi {
95
+ margin-left: auto;
96
+ } .navigation-bar-private__left_16jqi {
97
+ text-align: left;
98
+ } .navigation-bar-private__center_16jqi {
99
+ text-align: center;
100
+ } .navigation-bar-private__trim_16jqi {
101
+ overflow: hidden
102
+ } .navigation-bar-private__trim_16jqi .navigation-bar-private__title_16jqi,
103
+ .navigation-bar-private__trim_16jqi .navigation-bar-private__children_16jqi {
104
+ -webkit-line-clamp: 2;
105
+ display: -webkit-box;
106
+ -webkit-box-orient: vertical;
107
+ overflow: hidden;
108
+ }
package/esm/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./Component";
2
+ export type { NavigationBarPrivateProps } from "./types";
package/esm/index.js ADDED
@@ -0,0 +1 @@
1
+ export { NavigationBarPrivate } from './Component.js';
@@ -0,0 +1,2 @@
1
+ export * from "../components/closer/index";
2
+ export * from "../components/back-arrow-addon/index";
@@ -0,0 +1,2 @@
1
+ export { Closer } from '../components/closer/Component.js';
2
+ export { BackArrowAddon } from '../components/back-arrow-addon/Component.js';