@gravity-ui/navigation 3.3.1 → 3.3.3-beta.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/README.md +16 -1
- package/build/cjs/components/ActionBar/ActionBar.d.ts +1 -1
- package/build/cjs/components/ActionBar/Group/ActionBarGroup.d.ts +2 -1
- package/build/cjs/components/ActionBar/__stories__/ActionBar.stories.d.ts +6 -0
- package/build/cjs/components/ActionBar/__stories__/ActionBarStretchGroupShowcase.d.ts +2 -0
- package/build/cjs/{index-DJSaylQb.js → index-Bh8tV34w.js} +16 -7
- package/build/cjs/index-Bh8tV34w.js.map +1 -0
- package/build/cjs/{index-BgcyfriO.js → index-DI64hfWr.js} +2 -2
- package/build/cjs/{index-BgcyfriO.js.map → index-DI64hfWr.js.map} +1 -1
- package/build/cjs/index.js +1 -1
- package/build/esm/components/ActionBar/ActionBar.d.ts +1 -1
- package/build/esm/components/ActionBar/Group/ActionBarGroup.d.ts +2 -1
- package/build/esm/components/ActionBar/__stories__/ActionBar.stories.d.ts +6 -0
- package/build/esm/components/ActionBar/__stories__/ActionBarStretchGroupShowcase.d.ts +2 -0
- package/build/esm/{index-BaNchdQv.js → index-Bs6JJPIU.js} +2 -2
- package/build/esm/{index-BaNchdQv.js.map → index-Bs6JJPIU.js.map} +1 -1
- package/build/esm/{index-Ct_a9Lq8.js → index-Du2Q9-2w.js} +16 -7
- package/build/esm/index-Du2Q9-2w.js.map +1 -0
- package/build/esm/index.js +1 -1
- package/package.json +2 -2
- package/build/cjs/index-DJSaylQb.js.map +0 -1
- package/build/esm/index-Ct_a9Lq8.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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.
|
|
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.gravity-ui.com/navigation/)
|
|
2
2
|
|
|
3
3
|
### Aside Header Navigation · [Preview →](https://preview.yandexcloud.dev/navigation/)
|
|
4
4
|
|
|
@@ -16,6 +16,21 @@ Ensure that peer dependencies are installed in your project
|
|
|
16
16
|
npm install --dev @gravity-ui/uikit@^6.15.0 @gravity-ui/icons@2.2.0 @gravity-ui/components@3.0.0 @bem-react/classname@1.6.0 react@^18.0.0 react-dom@18.0.0
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
+
## Sandboxes
|
|
20
|
+
|
|
21
|
+
Basic
|
|
22
|
+
https://codesandbox.io/p/devbox/navigation-demo-simple-x9k5sd
|
|
23
|
+
|
|
24
|
+
Advanced
|
|
25
|
+
https://codesandbox.io/p/devbox/recursing-dawn-6kc9vh
|
|
26
|
+
|
|
27
|
+
## Roadmap 2025
|
|
28
|
+
|
|
29
|
+
1. Support SSR
|
|
30
|
+
2. Add more docs, examples to [Gravity UI](https://gravity-ui.com/ru/components/navigation/aside-header)
|
|
31
|
+
3. Support Navigation at UIKit themer
|
|
32
|
+
4. Unify subheaderItem, menuItem, footerItem API
|
|
33
|
+
|
|
19
34
|
## Components
|
|
20
35
|
|
|
21
36
|
- [AsideHeader](https://github.com/gravity-ui/navigation/tree/main/src/components/AsideHeader/README.md)
|
|
@@ -13,7 +13,7 @@ declare const PublicActionBar: {
|
|
|
13
13
|
displayName: string;
|
|
14
14
|
};
|
|
15
15
|
Group: {
|
|
16
|
-
({ children, className, pull }: import(".").ActionBarGroupProps): React.JSX.Element;
|
|
16
|
+
({ children, className, pull, stretchContainer }: import(".").ActionBarGroupProps): React.JSX.Element;
|
|
17
17
|
displayName: string;
|
|
18
18
|
};
|
|
19
19
|
Item: {
|
|
@@ -3,8 +3,9 @@ import { PropsWithPull } from '../types';
|
|
|
3
3
|
import './ActionBarGroup.scss';
|
|
4
4
|
export type Props = PropsWithChildren<PropsWithPull<{
|
|
5
5
|
className?: string;
|
|
6
|
+
stretchContainer?: boolean;
|
|
6
7
|
}>>;
|
|
7
8
|
export declare const ActionBarGroup: {
|
|
8
|
-
({ children, className, pull }: Props): React.JSX.Element;
|
|
9
|
+
({ children, className, pull, stretchContainer }: Props): React.JSX.Element;
|
|
9
10
|
displayName: string;
|
|
10
11
|
};
|
|
@@ -15,3 +15,9 @@ export declare const SingleSection: import("@storybook/csf").AnnotatedStoryFn<im
|
|
|
15
15
|
} & {
|
|
16
16
|
children?: React.ReactNode | undefined;
|
|
17
17
|
}>;
|
|
18
|
+
export declare const StretchGroup: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
19
|
+
'aria-label'?: string;
|
|
20
|
+
className?: string;
|
|
21
|
+
} & {
|
|
22
|
+
children?: React.ReactNode | undefined;
|
|
23
|
+
}>;
|
|
@@ -140,7 +140,7 @@ function styleInject(css, ref) {
|
|
|
140
140
|
var css_248z$u = ".g-root{--gn-aside-top-panel-height:0px}.gn-aside-header{--gn-aside-header-min-width:56px;--_--item-icon-background-size:38px;--_--background-color:var(--g-color-base-background);--_--decoration-collapsed-background-color:var(--g-color-base-warning-light);--_--decoration-expanded-background-color:var(--g-color-base-warning-light);--_--vertical-divider-line-color:var(--g-color-line-generic);--_--horizontal-divider-line-color:var(--g-color-line-generic);background-color:var(--g-color-base-background);height:100%;position:relative;width:100%}.gn-aside-header__aside{background-color:var(--gn-aside-header-expanded-background-color,var(--gn-aside-header-background-color,var(--_--background-color)));box-sizing:border-box;display:flex;flex-direction:column;height:100vh;left:0;margin-top:var(--gn-top-alert-height,0);max-height:calc(100vh - var(--gn-top-alert-height, 0));position:sticky;top:var(--gn-top-alert-height,0);width:inherit;z-index:var(--gn-aside-header-z-index,100)}.gn-aside-header__aside:after{background-color:var(--gn-aside-header-divider-vertical-color,var(--_--vertical-divider-line-color));content:\"\";height:100%;position:absolute;right:0;top:0;width:1px;z-index:2}.gn-aside-header__aside-popup-anchor{inset:0;position:absolute;z-index:1}.gn-aside-header__aside-content{--gradient-height:334px;display:flex;flex-direction:column;height:inherit;overflow-x:hidden;padding-top:var(--gn-aside-header-padding-top);position:relative;user-select:none;width:inherit;z-index:2}.gn-aside-header__aside-content>.gn-aside-header-logo{margin:8px 0}.gn-aside-header__aside-content_with-decoration{background:linear-gradient(180deg,var(--gn-aside-header-decoration-expanded-background-color,var(--_--decoration-expanded-background-color)) calc(var(--gradient-height)*.33),transparent calc(var(--gradient-height)*.88))}.gn-aside-header__aside-custom-background{bottom:0;display:flex;position:absolute;top:0;width:var(--gn-aside-header-size);z-index:-1}.gn-aside-header_compact .gn-aside-header__aside{background-color:var(--gn-aside-header-collapsed-background-color,var(--gn-aside-header-background-color,var(--_--background-color)))}.gn-aside-header_compact .gn-aside-header__aside-content{background:transparent}.gn-aside-header__header{--gn-aside-header-header-divider-height:29px;box-sizing:border-box;flex:none;padding-bottom:22px;padding-top:8px;position:relative;width:100%;z-index:1}.gn-aside-header__header .gn-aside-header__header-divider{bottom:0;color:var(--gn-aside-header-decoration-collapsed-background-color,var(--_--decoration-collapsed-background-color));display:none;left:0;position:absolute;z-index:-2}.gn-aside-header__header_with-decoration:before{background-color:var(--gn-aside-header-decoration-collapsed-background-color,var(--_--decoration-collapsed-background-color));content:\"\";display:none;height:calc(100% - var(--gn-aside-header-header-divider-height));left:0;position:absolute;top:0;width:100%;z-index:-2}.gn-aside-header__header:after{background-color:var(--gn-aside-header-divider-horizontal-color,var(--_--horizontal-divider-line-color));bottom:12px;content:\"\";height:1px;left:0;position:absolute;width:100%;z-index:-2}.gn-aside-header_compact .gn-aside-header__header:before,.gn-aside-header_compact .gn-aside-header__header_with-decoration .gn-aside-header__header-divider{display:block}.gn-aside-header_compact .gn-aside-header__header_with-decoration:after{display:none}.gn-aside-header__logo-button .gn-aside-header__logo-icon-place{height:var(--gn-aside-header-item-icon-background-size,var(--_--item-icon-background-size));width:var(--gn-aside-header-min-width)}.gn-aside-header__menu-items{flex-grow:1}.gn-aside-header__footer{display:flex;flex-direction:column;flex-shrink:0;margin:8px 0;width:100%}.gn-aside-header__panels{inset:var(--gn-top-alert-height,0) 0 0;max-height:calc(100vh - var(--gn-top-alert-height, 0));overflow:auto;position:fixed;z-index:var(--gn-aside-header-panel-z-index,98)}.gn-aside-header__panel{height:100%}.gn-aside-header__pane-container{display:flex;flex-direction:row;outline:none;overflow:visible;user-select:text}.gn-aside-header__top-alert{background:var(--g-color-base-background);position:fixed;top:0;width:100%;z-index:var(--gn-aside-header-pane-top-z-index,98)}.gn-aside-header__content{margin-top:var(--gn-top-alert-height,0);width:calc(100% - var(--gn-aside-header-size));z-index:var(--gn-aside-header-content-z-index,95)}";
|
|
141
141
|
styleInject(css_248z$u);
|
|
142
142
|
|
|
143
|
-
const TopAlert$1 = React.lazy(() => Promise.resolve().then(function () { return require('./index-
|
|
143
|
+
const TopAlert$1 = React.lazy(() => Promise.resolve().then(function () { return require('./index-DI64hfWr.js'); }).then((module) => ({ default: module.TopAlert })));
|
|
144
144
|
const Layout = ({ compact, className, children, topAlert }) => {
|
|
145
145
|
const size = compact ? ASIDE_HEADER_COMPACT_WIDTH : ASIDE_HEADER_EXPANDED_WIDTH;
|
|
146
146
|
const asideHeaderContextValue = React.useMemo(() => ({ size, compact }), [compact, size]);
|
|
@@ -1567,6 +1567,15 @@ const Item$1 = (props) => {
|
|
|
1567
1567
|
}
|
|
1568
1568
|
onClosePopup === null || onClosePopup === undefined ? undefined : onClosePopup();
|
|
1569
1569
|
}, [onClosePopup]);
|
|
1570
|
+
const handleOpenChangePopup = React.useCallback((open, event, reason) => {
|
|
1571
|
+
var _a;
|
|
1572
|
+
if (event instanceof MouseEvent &&
|
|
1573
|
+
event.target &&
|
|
1574
|
+
((_a = ref.current) === null || _a === undefined ? undefined : _a.contains(event.target))) {
|
|
1575
|
+
return;
|
|
1576
|
+
}
|
|
1577
|
+
onOpenChangePopup === null || onOpenChangePopup === undefined ? undefined : onOpenChangePopup(open, event, reason);
|
|
1578
|
+
}, [onClosePopup]);
|
|
1570
1579
|
if (item.type === 'divider') {
|
|
1571
1580
|
return React.createElement("div", { className: b$r('menu-divider') });
|
|
1572
1581
|
}
|
|
@@ -1603,7 +1612,7 @@ const Item$1 = (props) => {
|
|
|
1603
1612
|
} }),
|
|
1604
1613
|
React.createElement("div", { className: b$r('icon-place'), ref: highlightedRef }, makeIconNode(iconEl)),
|
|
1605
1614
|
React.createElement("div", { className: b$r('title'), title: typeof item.title === 'string' ? item.title : undefined }, titleEl)),
|
|
1606
|
-
renderPopupContent && Boolean(anchorRef === null || anchorRef === undefined ? undefined : anchorRef.current) && (React.createElement(uikit.Popup, { strategy: "fixed", open: popupVisible, keepMounted: popupKeepMounted, placement: popupPlacement, offset: popupOffset, anchorRef: anchorRef, onClose: handleClosePopup, onOpenChange:
|
|
1615
|
+
renderPopupContent && Boolean(anchorRef === null || anchorRef === undefined ? undefined : anchorRef.current) && (React.createElement(uikit.Popup, { strategy: "fixed", open: popupVisible, keepMounted: popupKeepMounted, placement: popupPlacement, offset: popupOffset, anchorRef: anchorRef, onClose: handleClosePopup, onOpenChange: handleOpenChangePopup }, renderPopupContent()))));
|
|
1607
1616
|
return createdNode;
|
|
1608
1617
|
};
|
|
1609
1618
|
const iconNode = icon ? (React.createElement(uikit.Icon, { qa: iconQa, data: icon, size: iconSize, className: b$r('icon') })) : null;
|
|
@@ -4576,12 +4585,12 @@ const AsideFallback = ({ headerDecoration, subheaderItemsCount = 0, qa }) => {
|
|
|
4576
4585
|
React.createElement("div", { style: { flex: 1 } }))));
|
|
4577
4586
|
};
|
|
4578
4587
|
|
|
4579
|
-
var css_248z$j = ".gn-action-bar-group{align-items:center;display:flex;flex-flow:row nowrap;
|
|
4588
|
+
var css_248z$j = ".gn-action-bar-group{align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;margin:0;padding:0}.gn-action-bar-group_pull_left{justify-content:flex-start;margin-left:0;margin-right:auto}.gn-action-bar-group_pull_left-grow{flex-grow:1}.gn-action-bar-group_pull_right{justify-content:flex-end;margin-left:auto;margin-right:0}.gn-action-bar-group_pull_right-grow{flex-grow:1}.gn-action-bar-group_pull_center{justify-content:center;margin-left:auto;margin-right:auto}.gn-action-bar-group_pull_center-grow,.gn-action-bar-group_stretch-container{flex-grow:1}";
|
|
4580
4589
|
styleInject(css_248z$j);
|
|
4581
4590
|
|
|
4582
4591
|
const b$k = block('action-bar-group');
|
|
4583
|
-
const ActionBarGroup = ({ children, className, pull }) => {
|
|
4584
|
-
return (React.createElement("ul", { className: b$k({ pull }, className), role: "group" }, children));
|
|
4592
|
+
const ActionBarGroup = ({ children, className, pull, stretchContainer }) => {
|
|
4593
|
+
return (React.createElement("ul", { className: b$k({ pull, 'stretch-container': stretchContainer }, className), role: "group" }, children));
|
|
4585
4594
|
};
|
|
4586
4595
|
ActionBarGroup.displayName = 'ActionBar.Group';
|
|
4587
4596
|
|
|
@@ -5538,7 +5547,7 @@ const OverlapPanel = ({ title, renderContent, className, onClose, action, closeT
|
|
|
5538
5547
|
var css_248z$4 = ".gn-mobile-header{--mobile-header-min-heigth:50px;--mobile-header-icon-size:20px;background-color:var(--g-color-base-background)}.gn-mobile-header__header-container{background-color:var(--g-color-base-background);position:sticky;top:0;z-index:var(--gn-mobile-header-z-index,100)}.gn-mobile-header__header{align-items:center;border-bottom:1px solid var(--g-color-line-generic);box-sizing:border-box;display:flex;justify-content:space-between;padding:0 10px}.gn-mobile-header__burger{padding:12px}.gn-mobile-header__panel-item{--gn-drawer-item-position:var(--gn-mobile-header-panel-position,absolute)}.gn-mobile-header__burger-menu,.gn-mobile-header__panel-item{background-color:var(--g-color-base-background);max-height:100%;max-width:90vw;width:320px}.gn-mobile-header__user-menu{overflow-y:auto}.gn-mobile-header__overlap-panel,.gn-mobile-header__panels{z-index:var(--gn-mobile-header-panel-z-index,98)}.gn-mobile-header__panels{inset:var(--mobile-header-min-heigth) 0 0;overflow:hidden;position:fixed}.gn-mobile-header__panel-item{top:unset}.gn-mobile-header__content{overflow:auto}";
|
|
5539
5548
|
styleInject(css_248z$4);
|
|
5540
5549
|
|
|
5541
|
-
const TopAlert = React.lazy(() => Promise.resolve().then(function () { return require('./index-
|
|
5550
|
+
const TopAlert = React.lazy(() => Promise.resolve().then(function () { return require('./index-DI64hfWr.js'); }).then((module) => ({ default: module.TopAlert })));
|
|
5542
5551
|
const b$4 = block('mobile-header');
|
|
5543
5552
|
const MobileHeader = React.forwardRef(({ logo, burgerMenu, burgerCloseTitle = i18n('burger_button_close'), burgerOpenTitle = i18n('burger_button_open'), panelItems = [], renderContent, sideItemRenderContent, onClosePanel, onEvent, className, contentClassName, overlapPanel, topAlert, }, ref) => {
|
|
5544
5553
|
const targetRef = useForwardRef(ref);
|
|
@@ -5854,4 +5863,4 @@ exports.styleInject = styleInject;
|
|
|
5854
5863
|
exports.useAsideHeaderContext = useAsideHeaderContext;
|
|
5855
5864
|
exports.useSettingsContext = useSettingsContext;
|
|
5856
5865
|
exports.useSettingsSelectionContext = useSettingsSelectionContext;
|
|
5857
|
-
//# sourceMappingURL=index-
|
|
5866
|
+
//# sourceMappingURL=index-Bh8tV34w.js.map
|