@gravity-ui/navigation 0.3.2 → 0.5.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/CHANGELOG.md +19 -0
- package/README.md +1 -1
- package/build/cjs/index.js +39 -67
- package/build/cjs/index.js.map +1 -1
- package/build/esm/index.js +40 -68
- package/build/esm/index.js.map +1 -1
- package/package.json +5 -5
- package/build/cjs/components/ItemTooltip/ItemTooltip.d.ts +0 -7
- package/build/esm/components/ItemTooltip/ItemTooltip.d.ts +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.5.0](https://github.com/gravity-ui/navigation/compare/v0.4.0...v0.5.0) (2023-05-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* support React 18 in peerDeps ([#44](https://github.com/gravity-ui/navigation/issues/44)) ([400db16](https://github.com/gravity-ui/navigation/commit/400db1601773a1d35f785d4d3adfabea762307d6))
|
|
9
|
+
|
|
10
|
+
## [0.4.0](https://github.com/gravity-ui/navigation/compare/v0.3.2...v0.4.0) (2023-03-06)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* use uikit Tooltip ([#42](https://github.com/gravity-ui/navigation/issues/42)) ([2de0cac](https://github.com/gravity-ui/navigation/commit/2de0cac90c730f40ab41c49312bdd367c4f9cada))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* updated README.md storybook link ([#40](https://github.com/gravity-ui/navigation/issues/40)) ([511abd9](https://github.com/gravity-ui/navigation/commit/511abd9f1051b361e5918d91eaaf3bb1af65f2d3))
|
|
21
|
+
|
|
3
22
|
## [0.3.2](https://github.com/gravity-ui/navigation/compare/v0.3.1...v0.3.2) (2023-02-17)
|
|
4
23
|
|
|
5
24
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @gravity-ui/navigation · [](https://www.npmjs.com/package/@gravity-ui/navigation) [](https://github.com/gravity-ui/navigation/actions/workflows/ci.yml?query=branch:main) [](https://preview.yandexcloud.dev/navigation/)
|
|
2
2
|
|
|
3
|
-
### Aside Header Navigation · [Preview →](preview.yandexcloud.dev/navigation/)
|
|
3
|
+
### Aside Header Navigation · [Preview →](https://preview.yandexcloud.dev/navigation/)
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
package/build/cjs/index.js
CHANGED
|
@@ -114,48 +114,48 @@ function styleInject(css, ref) {
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
var css_248z$
|
|
118
|
-
styleInject(css_248z$
|
|
117
|
+
var css_248z$c = ".ycn-action-bar-group {\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: flex-start;\n margin: 0;\n padding: 0;\n}\n.ycn-action-bar-group_pull_left {\n margin-left: 0;\n margin-right: auto;\n}\n.ycn-action-bar-group_pull_right {\n margin-left: auto;\n margin-right: 0;\n}\n.ycn-action-bar-group_pull_center {\n margin-left: auto;\n margin-right: auto;\n}";
|
|
118
|
+
styleInject(css_248z$c);
|
|
119
119
|
|
|
120
|
-
const b$
|
|
120
|
+
const b$d = block('action-bar-group');
|
|
121
121
|
const ActionBarGroup = ({ children, className, pull }) => {
|
|
122
|
-
return (React__default["default"].createElement("ul", { className: b$
|
|
122
|
+
return (React__default["default"].createElement("ul", { className: b$d({ pull }, className), role: "group" }, children));
|
|
123
123
|
};
|
|
124
124
|
ActionBarGroup.displayName = 'ActionBar.Group';
|
|
125
125
|
|
|
126
|
-
var css_248z$
|
|
127
|
-
styleInject(css_248z$
|
|
126
|
+
var css_248z$b = ".ycn-action-bar-item {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n.ycn-action-bar-item_pull_left {\n margin-left: 0;\n margin-right: auto;\n}\n.ycn-action-bar-item_pull_right {\n margin-left: auto;\n margin-right: 0;\n}\n.ycn-action-bar-item_pull_center {\n margin-left: auto;\n margin-right: auto;\n}\n.ycn-action-bar-item + .ycn-action-bar-item_spacing {\n margin-left: 8px;\n}";
|
|
127
|
+
styleInject(css_248z$b);
|
|
128
128
|
|
|
129
|
-
const b$
|
|
129
|
+
const b$c = block('action-bar-item');
|
|
130
130
|
const ActionBarItem = ({ children, className, pull, spacing = true }) => {
|
|
131
|
-
return React__default["default"].createElement("li", { className: b$
|
|
131
|
+
return React__default["default"].createElement("li", { className: b$c({ pull, spacing }, className) }, children);
|
|
132
132
|
};
|
|
133
133
|
ActionBarItem.displayName = 'ActionBar.Item';
|
|
134
134
|
|
|
135
|
-
var css_248z$
|
|
136
|
-
styleInject(css_248z$
|
|
135
|
+
var css_248z$a = ".ycn-action-bar-section {\n display: flex;\n flex-flow: row nowrap;\n justify-content: flex-start;\n align-items: stretch;\n}\n.ycn-action-bar-section + .ycn-action-bar-section {\n border-left: solid 1px var(--yc-color-line-generic);\n}\n.ycn-action-bar-section_type_primary {\n flex: 1 1 auto;\n padding-left: 20px;\n padding-right: 20px;\n}\n.ycn-action-bar-section_type_secondary {\n padding-left: 6px;\n padding-right: 6px;\n}";
|
|
136
|
+
styleInject(css_248z$a);
|
|
137
137
|
|
|
138
|
-
const b$
|
|
138
|
+
const b$b = block('action-bar-section');
|
|
139
139
|
const ActionBarSection = ({ children, type = 'primary' }) => {
|
|
140
|
-
return React__default["default"].createElement("div", { className: b$
|
|
140
|
+
return React__default["default"].createElement("div", { className: b$b({ type }) }, children);
|
|
141
141
|
};
|
|
142
142
|
ActionBarSection.displayName = 'ActionBar.Section';
|
|
143
143
|
|
|
144
|
-
var css_248z$
|
|
145
|
-
styleInject(css_248z$
|
|
144
|
+
var css_248z$9 = ".ycn-action-bar-separator {\n list-style: none;\n margin: 0;\n padding: 0;\n margin-left: 6px;\n margin-right: 6px;\n border-right: solid 1px var(--yc-color-line-generic);\n height: 40px;\n}";
|
|
145
|
+
styleInject(css_248z$9);
|
|
146
146
|
|
|
147
|
-
const b$
|
|
147
|
+
const b$a = block('action-bar-separator');
|
|
148
148
|
const ActionBarSeparator = () => {
|
|
149
|
-
return React__default["default"].createElement("li", { role: "separator", className: b$
|
|
149
|
+
return React__default["default"].createElement("li", { role: "separator", className: b$a() });
|
|
150
150
|
};
|
|
151
151
|
ActionBarSeparator.displayName = 'ActionBar.Separator';
|
|
152
152
|
|
|
153
|
-
var css_248z$
|
|
154
|
-
styleInject(css_248z$
|
|
153
|
+
var css_248z$8 = ".ycn-action-bar {\n box-sizing: border-box;\n height: 40px;\n border-bottom: solid 1px var(--yc-color-line-generic);\n display: flex;\n flex-flow: row nowrap;\n justify-content: flex-start;\n align-items: stretch;\n}";
|
|
154
|
+
styleInject(css_248z$8);
|
|
155
155
|
|
|
156
|
-
const b$
|
|
156
|
+
const b$9 = block('action-bar');
|
|
157
157
|
const ActionBar = ({ children, className, 'aria-label': ariaLabel }) => {
|
|
158
|
-
return (React__default["default"].createElement("section", { className: b$
|
|
158
|
+
return (React__default["default"].createElement("section", { className: b$9(null, className), "aria-label": ariaLabel }, children));
|
|
159
159
|
};
|
|
160
160
|
ActionBar.displayName = 'ActionBar';
|
|
161
161
|
const PublicActionBar = Object.assign(ActionBar, {
|
|
@@ -3200,15 +3200,15 @@ SwitchTransition.defaultProps = {
|
|
|
3200
3200
|
mode: modes.out
|
|
3201
3201
|
};
|
|
3202
3202
|
|
|
3203
|
-
var css_248z$
|
|
3204
|
-
styleInject(css_248z$
|
|
3203
|
+
var css_248z$7 = ".ycn-drawer__item {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n height: 100%;\n will-change: transform;\n background-color: var(--yc-color-base-background);\n}\n.ycn-drawer__item-transition-enter {\n transform: translate(-100%, 0);\n}\n.ycn-drawer__item-transition-enter-active {\n transform: translate(0, 0);\n transition: transform 300ms;\n}\n.ycn-drawer__item-transition-enter-done {\n filter: blur(0px);\n transform: translateZ(0);\n}\n.ycn-drawer__item-transition-exit {\n transform: translate(0, 0);\n}\n.ycn-drawer__item-transition-exit-active {\n transform: translate(-100%, 0);\n transition: transform 300ms;\n}\n.ycn-drawer__item-transition-exit-done {\n visibility: hidden;\n}\n.ycn-drawer__veil {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n top: 0;\n background-color: var(--yc-color-sfx-veil);\n}\n.ycn-drawer__veil-transition-enter {\n opacity: 0;\n}\n.ycn-drawer__veil-transition-enter-active {\n opacity: 1;\n transition: opacity 300ms;\n}\n.ycn-drawer__veil-transition-exit {\n opacity: 1;\n}\n.ycn-drawer__veil-transition-exit-active {\n opacity: 0;\n transition: opacity 300ms;\n}\n.ycn-drawer__veil-transition-exit-done {\n visibility: hidden;\n}";
|
|
3204
|
+
styleInject(css_248z$7);
|
|
3205
3205
|
|
|
3206
|
-
const b$
|
|
3206
|
+
const b$8 = block('drawer');
|
|
3207
3207
|
const TIMEOUT = 300;
|
|
3208
3208
|
const DrawerItem = ({ visible, content, className }) => {
|
|
3209
3209
|
const itemRef = React__default["default"].useRef(null);
|
|
3210
|
-
return (React__default["default"].createElement(CSSTransition, { in: visible, timeout: TIMEOUT, unmountOnExit: true, classNames: b$
|
|
3211
|
-
React__default["default"].createElement("div", { ref: itemRef, className: b$
|
|
3210
|
+
return (React__default["default"].createElement(CSSTransition, { in: visible, timeout: TIMEOUT, unmountOnExit: true, classNames: b$8('item-transition'), nodeRef: itemRef },
|
|
3211
|
+
React__default["default"].createElement("div", { ref: itemRef, className: b$8('item', className) }, content)));
|
|
3212
3212
|
};
|
|
3213
3213
|
const Drawer = ({ className, children, style, onVeilClick, onEscape, preventScrollBody = true, }) => {
|
|
3214
3214
|
let someItemVisible = false;
|
|
@@ -3266,9 +3266,9 @@ const Drawer = ({ className, children, style, onVeilClick, onEscape, preventScro
|
|
|
3266
3266
|
const veilRef = React__default["default"].useRef(null);
|
|
3267
3267
|
return (React__default["default"].createElement(Transition, { in: someItemVisible, timeout: { enter: 0, exit: TIMEOUT }, mountOnEnter: true, unmountOnExit: true, nodeRef: containerRef }, (state) => {
|
|
3268
3268
|
const childrenVisible = someItemVisible && state === 'entered';
|
|
3269
|
-
return (React__default["default"].createElement("div", { ref: containerRef, className: b$
|
|
3270
|
-
React__default["default"].createElement(CSSTransition, { in: childrenVisible, timeout: TIMEOUT, unmountOnExit: true, classNames: b$
|
|
3271
|
-
React__default["default"].createElement("div", { ref: veilRef, className: b$
|
|
3269
|
+
return (React__default["default"].createElement("div", { ref: containerRef, className: b$8(null, className), style: style },
|
|
3270
|
+
React__default["default"].createElement(CSSTransition, { in: childrenVisible, timeout: TIMEOUT, unmountOnExit: true, classNames: b$8('veil-transition'), nodeRef: veilRef },
|
|
3271
|
+
React__default["default"].createElement("div", { ref: veilRef, className: b$8('veil'), onClick: onVeilClick })),
|
|
3272
3272
|
React__default["default"].Children.map(children, (child) => {
|
|
3273
3273
|
const childElem = child;
|
|
3274
3274
|
if (childElem.type === DrawerItem) {
|
|
@@ -3280,10 +3280,10 @@ const Drawer = ({ className, children, style, onVeilClick, onEscape, preventScro
|
|
|
3280
3280
|
}));
|
|
3281
3281
|
};
|
|
3282
3282
|
|
|
3283
|
-
var css_248z$
|
|
3284
|
-
styleInject(css_248z$
|
|
3283
|
+
var css_248z$6 = ".ycn-logo {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n height: 40px;\n}\n.ycn-logo__logo-btn-place {\n flex-shrink: 0;\n width: var(--aside-header-min-width);\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ycn-logo__btn-logo.yc-button_view_flat.yc-button_size_l {\n --yc-button-height: 38px;\n}\n.ycn-logo__logo {\n font-size: var(--yc-text-body-2-font-size);\n line-height: var(--yc-text-body-2-line-height);\n font-weight: var(--yc-text-body-font-weight);\n vertical-align: middle;\n}\n.ycn-logo__logo-link, .ycn-logo__logo-link:hover, .ycn-logo__logo-link:active, .ycn-logo__logo-link:visited, .ycn-logo__logo-link:focus {\n text-decoration: none;\n outline: none;\n color: inherit;\n}\n.yc-root .ycn-logo__btn-logo.button2_theme_flat.button2_hovered_yes::before {\n background-color: transparent;\n}";
|
|
3284
|
+
styleInject(css_248z$6);
|
|
3285
3285
|
|
|
3286
|
-
const b$
|
|
3286
|
+
const b$7 = block('logo');
|
|
3287
3287
|
const Logo = ({ text, compact, icon, iconSrc, iconClassName, iconSize = 24, textSize = 15, href = '/', wrapper, onClick, }) => {
|
|
3288
3288
|
const hasClickHandler = typeof onClick === 'function';
|
|
3289
3289
|
const hasWrapper = typeof wrapper === 'function';
|
|
@@ -3301,18 +3301,18 @@ const Logo = ({ text, compact, icon, iconSrc, iconClassName, iconSize = 24, text
|
|
|
3301
3301
|
else if (icon) {
|
|
3302
3302
|
buttonIcon = React__default["default"].createElement(uikit.Icon, { data: icon, size: iconSize, className: iconClassName });
|
|
3303
3303
|
}
|
|
3304
|
-
const button = (React__default["default"].createElement(uikit.Button, Object.assign({ view: "flat", size: "l", className: b$
|
|
3304
|
+
const button = (React__default["default"].createElement(uikit.Button, Object.assign({ view: "flat", size: "l", className: b$7('btn-logo'), component: hasWrapper ? 'span' : undefined, onClick: onClick }, linkProps), buttonIcon));
|
|
3305
3305
|
let logo;
|
|
3306
3306
|
if (typeof text === 'function') {
|
|
3307
3307
|
logo = text();
|
|
3308
3308
|
}
|
|
3309
3309
|
else {
|
|
3310
|
-
logo = (React__default["default"].createElement("div", { className: b$
|
|
3310
|
+
logo = (React__default["default"].createElement("div", { className: b$7('logo'), style: { fontSize: textSize } }, text));
|
|
3311
3311
|
}
|
|
3312
|
-
return (React__default["default"].createElement("div", { className: b$
|
|
3313
|
-
React__default["default"].createElement("div", { className: b$
|
|
3312
|
+
return (React__default["default"].createElement("div", { className: b$7() },
|
|
3313
|
+
React__default["default"].createElement("div", { className: b$7('logo-btn-place') }, hasWrapper ? wrapper(button, compact) : button),
|
|
3314
3314
|
!compact &&
|
|
3315
|
-
(hasWrapper ? (React__default["default"].createElement("div", { onClick: onClick }, wrapper(logo, compact))) : (React__default["default"].createElement("a", Object.assign({}, linkProps, { className: b$
|
|
3315
|
+
(hasWrapper ? (React__default["default"].createElement("div", { onClick: onClick }, wrapper(logo, compact))) : (React__default["default"].createElement("a", Object.assign({}, linkProps, { className: b$7('logo-link'), onClick: onClick }), logo)))));
|
|
3316
3316
|
};
|
|
3317
3317
|
|
|
3318
3318
|
var classCallCheck = function (instance, Constructor) {
|
|
@@ -3844,24 +3844,7 @@ function getItemsMinHeight(items) {
|
|
|
3844
3844
|
(pinnedItems.length === items.length ? 0 : ITEM_HEIGHT));
|
|
3845
3845
|
}
|
|
3846
3846
|
|
|
3847
|
-
var css_248z$
|
|
3848
|
-
styleInject(css_248z$6);
|
|
3849
|
-
|
|
3850
|
-
const b$7 = block('item-tooltip');
|
|
3851
|
-
const popupPlacement = ['right'];
|
|
3852
|
-
const ItemTooltip = ({ anchor, text }) => {
|
|
3853
|
-
const anchorRef = React__default["default"].useRef(anchor);
|
|
3854
|
-
React__default["default"].useEffect(() => {
|
|
3855
|
-
anchorRef.current = anchor;
|
|
3856
|
-
}, [anchor]);
|
|
3857
|
-
if (!anchor) {
|
|
3858
|
-
return null;
|
|
3859
|
-
}
|
|
3860
|
-
return (React__default["default"].createElement(uikit.Popup, { className: b$7(), open: true, anchorRef: anchorRef, placement: popupPlacement, disableEscapeKeyDown: true, disableOutsideClick: true, disableLayer: true },
|
|
3861
|
-
React__default["default"].createElement("div", { className: b$7('text') }, text)));
|
|
3862
|
-
};
|
|
3863
|
-
|
|
3864
|
-
var css_248z$5 = ".ycn-composite-bar-item {\n --composite-bar-item-action-size: 36px;\n display: flex;\n width: 100%;\n height: 100%;\n align-items: center;\n cursor: pointer;\n}\n.ycn-composite-bar-item__icon {\n color: var(--yc-color-text-misc);\n}\n.ycn-composite-bar-item__icon-place {\n flex-shrink: 0;\n width: var(--aside-header-min-width);\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n}\n.ycn-composite-bar-item__title {\n display: flex;\n overflow: hidden;\n}\n.ycn-composite-bar-item__title-text {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.ycn-composite-bar-item__title-adornment {\n margin: 0 10px;\n}\n.ycn-composite-bar-item__collapse-item {\n display: flex;\n padding: 0 16px;\n align-items: center;\n width: 100%;\n height: 100%;\n cursor: pointer;\n}\n.ycn-composite-bar-item__collapse-item .ycn-composite-bar-item__title-adornment {\n margin-right: 0;\n}\n.ycn-composite-bar-item__menu-divider {\n margin: 0 8px;\n width: 100%;\n border-top: 1px solid var(--yc-color-line-generic);\n cursor: default;\n}\n.ycn-composite-bar-item__collapse-items-popup-content {\n padding: 4px 0;\n}\n.ycn-composite-bar-item__link {\n display: flex;\n width: 100%;\n height: 100%;\n align-items: center;\n}\n.ycn-composite-bar-item__link, .ycn-composite-bar-item__link:hover, .ycn-composite-bar-item__link:active, .ycn-composite-bar-item__link:visited, .ycn-composite-bar-item__link:focus {\n text-decoration: none;\n outline: none;\n color: inherit;\n}\n.ycn-composite-bar-item__btn-icon {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ycn-composite-bar-item_type_action {\n justify-content: center;\n height: var(--composite-bar-item-action-size);\n margin: 0 10px 8px;\n background: var(--yc-color-base-float);\n box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.03), 0px 5px 6px rgba(0, 0, 0, 0.12);\n border-radius: var(--composite-bar-item-action-size);\n transition: transform 0.1s ease-out, background-color 0.15s linear;\n}\n.ycn-composite-bar-item_type_action:focus {\n box-shadow: 0 0 0 2px var(--yc-color-line-misc);\n}\n.ycn-composite-bar-item_type_action:focus:not(:focus-visible) {\n box-shadow: none;\n}\n.ycn-composite-bar-item_type_action:hover {\n background-color: var(--yc-color-base-float-hover);\n}\n.ycn-composite-bar-item_type_action:active {\n box-shadow: 0 1px 2px var(--yc-color-sfx-shadow);\n transition: none;\n transform: scale(0.96);\n}\n.ycn-composite-bar-item_type_action .ycn-composite-bar-item__icon-place {\n width: var(--composite-bar-item-action-size);\n}\n.ycn-composite-bar-item_type_action .ycn-composite-bar-item__title {\n margin-right: 16px;\n}\n.ycn-composite-bar-item:not(.ycn-composite-bar-item_compact).ycn-composite-bar-item_current.ycn-composite-bar-item_type_regular {\n background-color: var(--yc-color-base-selection);\n}\n.ycn-composite-bar-item:not(.ycn-composite-bar-item_compact):not(.ycn-composite-bar-item_current):hover.ycn-composite-bar-item_type_regular {\n background-color: var(--yc-color-base-simple-hover);\n}\n.ycn-composite-bar-item_compact.ycn-composite-bar-item_type_action {\n width: var(--composite-bar-item-action-size);\n}\n.ycn-composite-bar-item_compact.ycn-composite-bar-item_type_action .ycn-composite-bar-item__title {\n margin: 0;\n}\n.ycn-composite-bar-item_compact.ycn-composite-bar-item_current.ycn-composite-bar-item_type_regular .ycn-composite-bar-item__btn-icon {\n position: relative;\n background-color: transparent;\n}\n.ycn-composite-bar-item_compact.ycn-composite-bar-item_current.ycn-composite-bar-item_type_regular .ycn-composite-bar-item__btn-icon::before {\n content: \"\";\n position: absolute;\n top: 50%;\n left: 50%;\n z-index: -1;\n width: 38px;\n height: 38px;\n margin-top: -19px;\n margin-left: -19px;\n border-radius: 7px;\n}\n.ycn-composite-bar-item_compact.ycn-composite-bar-item_current.ycn-composite-bar-item_type_regular .ycn-composite-bar-item__btn-icon::before {\n background-color: var(--yc-color-base-selection);\n}\n.ycn-composite-bar-item_compact:not(.ycn-composite-bar-item_current):hover.ycn-composite-bar-item_type_regular .ycn-composite-bar-item__btn-icon {\n position: relative;\n background-color: transparent;\n}\n.ycn-composite-bar-item_compact:not(.ycn-composite-bar-item_current):hover.ycn-composite-bar-item_type_regular .ycn-composite-bar-item__btn-icon::before {\n content: \"\";\n position: absolute;\n top: 50%;\n left: 50%;\n z-index: -1;\n width: 38px;\n height: 38px;\n margin-top: -19px;\n margin-left: -19px;\n border-radius: 7px;\n}\n.ycn-composite-bar-item_compact:not(.ycn-composite-bar-item_current):hover.ycn-composite-bar-item_type_regular .ycn-composite-bar-item__btn-icon::before {\n background-color: var(--yc-color-base-simple-hover);\n}";
|
|
3847
|
+
var css_248z$5 = ".ycn-composite-bar-item {\n --composite-bar-item-action-size: 36px;\n display: flex;\n width: 100%;\n height: 100%;\n align-items: center;\n cursor: pointer;\n}\n.ycn-composite-bar-item__icon {\n color: var(--yc-color-text-misc);\n}\n.ycn-composite-bar-item__icon-place {\n flex-shrink: 0;\n width: var(--aside-header-min-width);\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n}\n.ycn-composite-bar-item__title {\n display: flex;\n overflow: hidden;\n}\n.ycn-composite-bar-item__title-text {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.ycn-composite-bar-item__title-adornment {\n margin: 0 10px;\n}\n.ycn-composite-bar-item__collapse-item {\n display: flex;\n padding: 0 16px;\n align-items: center;\n width: 100%;\n height: 100%;\n cursor: pointer;\n}\n.ycn-composite-bar-item__collapse-item .ycn-composite-bar-item__title-adornment {\n margin-right: 0;\n}\n.ycn-composite-bar-item__menu-divider {\n margin: 0 8px;\n width: 100%;\n border-top: 1px solid var(--yc-color-line-generic);\n cursor: default;\n}\n.ycn-composite-bar-item__collapse-items-popup-content {\n padding: 4px 0;\n}\n.ycn-composite-bar-item__link {\n display: flex;\n width: 100%;\n height: 100%;\n align-items: center;\n}\n.ycn-composite-bar-item__link, .ycn-composite-bar-item__link:hover, .ycn-composite-bar-item__link:active, .ycn-composite-bar-item__link:visited, .ycn-composite-bar-item__link:focus {\n text-decoration: none;\n outline: none;\n color: inherit;\n}\n.ycn-composite-bar-item__btn-icon {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ycn-composite-bar-item_type_action {\n justify-content: center;\n height: var(--composite-bar-item-action-size);\n margin: 0 10px 8px;\n background: var(--yc-color-base-float);\n box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.03), 0px 5px 6px rgba(0, 0, 0, 0.12);\n border-radius: var(--composite-bar-item-action-size);\n transition: transform 0.1s ease-out, background-color 0.15s linear;\n}\n.ycn-composite-bar-item_type_action:focus {\n box-shadow: 0 0 0 2px var(--yc-color-line-misc);\n}\n.ycn-composite-bar-item_type_action:focus:not(:focus-visible) {\n box-shadow: none;\n}\n.ycn-composite-bar-item_type_action:hover {\n background-color: var(--yc-color-base-float-hover);\n}\n.ycn-composite-bar-item_type_action:active {\n box-shadow: 0 1px 2px var(--yc-color-sfx-shadow);\n transition: none;\n transform: scale(0.96);\n}\n.ycn-composite-bar-item_type_action .ycn-composite-bar-item__icon-place {\n width: var(--composite-bar-item-action-size);\n}\n.ycn-composite-bar-item_type_action .ycn-composite-bar-item__title {\n margin-right: 16px;\n}\n.ycn-composite-bar-item__icon-tooltip_item-type_action {\n margin-left: 10px;\n}\n.ycn-composite-bar-item:not(.ycn-composite-bar-item_compact).ycn-composite-bar-item_current.ycn-composite-bar-item_type_regular {\n background-color: var(--yc-color-base-selection);\n}\n.ycn-composite-bar-item:not(.ycn-composite-bar-item_compact):not(.ycn-composite-bar-item_current):hover.ycn-composite-bar-item_type_regular {\n background-color: var(--yc-color-base-simple-hover);\n}\n.ycn-composite-bar-item_compact.ycn-composite-bar-item_type_action {\n width: var(--composite-bar-item-action-size);\n}\n.ycn-composite-bar-item_compact.ycn-composite-bar-item_type_action .ycn-composite-bar-item__title {\n margin: 0;\n}\n.ycn-composite-bar-item_compact.ycn-composite-bar-item_current.ycn-composite-bar-item_type_regular .ycn-composite-bar-item__btn-icon {\n position: relative;\n background-color: transparent;\n}\n.ycn-composite-bar-item_compact.ycn-composite-bar-item_current.ycn-composite-bar-item_type_regular .ycn-composite-bar-item__btn-icon::before {\n content: \"\";\n position: absolute;\n top: 50%;\n left: 50%;\n z-index: -1;\n width: 38px;\n height: 38px;\n margin-top: -19px;\n margin-left: -19px;\n border-radius: 7px;\n}\n.ycn-composite-bar-item_compact.ycn-composite-bar-item_current.ycn-composite-bar-item_type_regular .ycn-composite-bar-item__btn-icon::before {\n background-color: var(--yc-color-base-selection);\n}\n.ycn-composite-bar-item_compact:not(.ycn-composite-bar-item_current):hover.ycn-composite-bar-item_type_regular .ycn-composite-bar-item__btn-icon {\n position: relative;\n background-color: transparent;\n}\n.ycn-composite-bar-item_compact:not(.ycn-composite-bar-item_current):hover.ycn-composite-bar-item_type_regular .ycn-composite-bar-item__btn-icon::before {\n content: \"\";\n position: absolute;\n top: 50%;\n left: 50%;\n z-index: -1;\n width: 38px;\n height: 38px;\n margin-top: -19px;\n margin-left: -19px;\n border-radius: 7px;\n}\n.ycn-composite-bar-item_compact:not(.ycn-composite-bar-item_current):hover.ycn-composite-bar-item_type_regular .ycn-composite-bar-item__btn-icon::before {\n background-color: var(--yc-color-base-simple-hover);\n}";
|
|
3865
3848
|
styleInject(css_248z$5);
|
|
3866
3849
|
|
|
3867
3850
|
const b$6 = block('composite-bar-item');
|
|
@@ -3881,7 +3864,6 @@ const Item = (props) => {
|
|
|
3881
3864
|
if (item.type === 'divider') {
|
|
3882
3865
|
return React__default["default"].createElement("div", { className: b$6('menu-divider') });
|
|
3883
3866
|
}
|
|
3884
|
-
const [tooltipAnchor, setTooltipAnchor] = React__default["default"].useState(null);
|
|
3885
3867
|
const [open, toggleOpen] = React__default["default"].useState(false);
|
|
3886
3868
|
const ref = React__default["default"].useRef(null);
|
|
3887
3869
|
const anchorRef = popupAnchor || ref;
|
|
@@ -3909,7 +3891,6 @@ const Item = (props) => {
|
|
|
3909
3891
|
* - onClosePanel calls twice for each popuped item, as result it will prevent opening of panelItems
|
|
3910
3892
|
*/
|
|
3911
3893
|
toggleOpen(!open);
|
|
3912
|
-
setTooltipAnchor(null);
|
|
3913
3894
|
}
|
|
3914
3895
|
else {
|
|
3915
3896
|
onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick(item, false);
|
|
@@ -3923,17 +3904,8 @@ const Item = (props) => {
|
|
|
3923
3904
|
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave();
|
|
3924
3905
|
}
|
|
3925
3906
|
} },
|
|
3926
|
-
React__default["default"].createElement("div", { className: b$6('icon-place') }, compact ? (React__default["default"].createElement(
|
|
3927
|
-
React__default["default"].createElement("div", { onMouseEnter: (
|
|
3928
|
-
if (!open) {
|
|
3929
|
-
setTooltipAnchor(event.currentTarget);
|
|
3930
|
-
}
|
|
3931
|
-
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter();
|
|
3932
|
-
}, onMouseLeave: () => {
|
|
3933
|
-
setTooltipAnchor(null);
|
|
3934
|
-
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave();
|
|
3935
|
-
}, className: b$6('btn-icon') }, iconEl),
|
|
3936
|
-
enableTooltip && (React__default["default"].createElement(ItemTooltip, { anchor: tooltipAnchor, text: tooltipText })))) : (iconEl)),
|
|
3907
|
+
React__default["default"].createElement("div", { className: b$6('icon-place') }, compact ? (React__default["default"].createElement(uikit.Tooltip, { content: tooltipText, disabled: !enableTooltip || (collapsedItem && open), placement: "right", className: b$6('icon-tooltip', { 'item-type': type }) },
|
|
3908
|
+
React__default["default"].createElement("div", { onMouseEnter: () => onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter(), onMouseLeave: () => onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave(), className: b$6('btn-icon') }, iconEl))) : (iconEl)),
|
|
3937
3909
|
React__default["default"].createElement("div", { className: b$6('title'), title: typeof item.title === 'string' ? item.title : undefined }, titleEl),
|
|
3938
3910
|
renderPopupContent && Boolean(anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current) && (React__default["default"].createElement(uikit.Popup, { className: b$6('popup'), open: popupVisible, placement: popupPlacement, offset: popupOffset, anchorRef: anchorRef, onClose: onClose }, renderPopupContent()))));
|
|
3939
3911
|
return item.link ? (React__default["default"].createElement("a", { href: item.link, className: b$6('link') }, createdNode)) : (createdNode);
|