@teambit/component 0.0.957 → 0.0.959
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/dist/{preview-1673494106850.js → preview-1673666932263.js} +2 -2
- package/dist/ui/menu/menu-nav.d.ts +5 -1
- package/dist/ui/menu/menu-nav.js +9 -5
- package/dist/ui/menu/menu-nav.js.map +1 -1
- package/dist/ui/menu/nav-plugin.d.ts +1 -0
- package/dist/ui/menu/nav-plugin.js.map +1 -1
- package/dist/ui/top-bar-nav/top-bar-nav.d.ts +1 -1
- package/dist/ui/top-bar-nav/top-bar-nav.js +4 -3
- package/dist/ui/top-bar-nav/top-bar-nav.js.map +1 -1
- package/package-tar/teambit-component-0.0.959.tgz +0 -0
- package/package.json +26 -26
- package/ui/menu/menu-nav.tsx +13 -2
- package/ui/menu/nav-plugin.tsx +1 -0
- package/ui/top-bar-nav/top-bar-nav.tsx +10 -2
- package/package-tar/teambit-component-0.0.957.tgz +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@0.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@0.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@0.0.959/dist/component.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@0.0.959/dist/component.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -13,5 +13,9 @@ export declare type MenuNavProps = {
|
|
|
13
13
|
widgetSlot?: OrderedNavigationSlot;
|
|
14
14
|
navPlugins?: [string, NavPlugin][];
|
|
15
15
|
widgetPlugins?: [string, NavPlugin][];
|
|
16
|
+
/**
|
|
17
|
+
* A className to pass to the secondary nav, i.e dropdown
|
|
18
|
+
*/
|
|
19
|
+
secondaryNavClassName?: string;
|
|
16
20
|
} & React.HTMLAttributes<HTMLElement>;
|
|
17
|
-
export declare function CollapsibleMenuNav({ navigationSlot, widgetSlot, navPlugins, widgetPlugins, className, }: MenuNavProps): JSX.Element;
|
|
21
|
+
export declare function CollapsibleMenuNav({ navigationSlot, widgetSlot, navPlugins, widgetPlugins, className, secondaryNavClassName, children, }: MenuNavProps): JSX.Element;
|
package/dist/ui/menu/menu-nav.js
CHANGED
|
@@ -65,7 +65,9 @@ function CollapsibleMenuNav({
|
|
|
65
65
|
widgetSlot,
|
|
66
66
|
navPlugins = [],
|
|
67
67
|
widgetPlugins = [],
|
|
68
|
-
className
|
|
68
|
+
className,
|
|
69
|
+
secondaryNavClassName,
|
|
70
|
+
children
|
|
69
71
|
}) {
|
|
70
72
|
const plugins = (0, _react().useMemo)(() => {
|
|
71
73
|
const _navPlugins = navPlugins.length > 0 ? navPlugins : navigationSlot === null || navigationSlot === void 0 ? void 0 : navigationSlot.toArray();
|
|
@@ -88,23 +90,25 @@ function CollapsibleMenuNav({
|
|
|
88
90
|
isInMenu
|
|
89
91
|
}) {
|
|
90
92
|
const widgetDisplayText = menuItem.props.displayName && isInMenu && menuItem.props.displayName;
|
|
91
|
-
return /*#__PURE__*/_react().default.createElement(_topBarNav().TopBarNav, (0, _extends2().default)({
|
|
93
|
+
return /*#__PURE__*/_react().default.createElement(_topBarNav().TopBarNav, (0, _extends2().default)({}, menuItem.props, {
|
|
92
94
|
className: (0, _classnames().default)(menuItem.props.className, _menuModule().default.topBarNav, isInMenu && _menuModule().default.noBorder),
|
|
93
95
|
key: id
|
|
94
|
-
}
|
|
96
|
+
}), widgetDisplayText || menuItem.props.children);
|
|
95
97
|
},
|
|
96
|
-
style: _objectSpread(_objectSpread({}, firstWidgetStyle), lastPluginStyle)
|
|
98
|
+
style: _objectSpread(_objectSpread({}, firstWidgetStyle), lastPluginStyle),
|
|
99
|
+
className: menuItem.props.className
|
|
97
100
|
};
|
|
98
101
|
});
|
|
99
102
|
return /*#__PURE__*/_react().default.createElement(_designNavigation().ResponsiveNavbar, {
|
|
100
103
|
navClassName: (0, _classnames().default)(_menuModule().default.tab, className),
|
|
104
|
+
secondaryNavClassName: secondaryNavClassName,
|
|
101
105
|
style: {
|
|
102
106
|
width: '100%',
|
|
103
107
|
height: '100%'
|
|
104
108
|
},
|
|
105
109
|
priority: "none",
|
|
106
110
|
tabs: links
|
|
107
|
-
});
|
|
111
|
+
}, children);
|
|
108
112
|
}
|
|
109
113
|
function sortFn([, {
|
|
110
114
|
order: first
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CollapsibleMenuNav","navigationSlot","widgetSlot","navPlugins","widgetPlugins","className","plugins","useMemo","_navPlugins","length","toArray","sort","sortFn","widgets","_widgetPlugins","links","map","id","menuItem","index","lastPluginStyle","marginRight","firstWidgetStyle","marginLeft","component","TopBarNavComponent","isInMenu","widgetDisplayText","props","displayName","classnames","styles","topBarNav","noBorder","
|
|
1
|
+
{"version":3,"names":["CollapsibleMenuNav","navigationSlot","widgetSlot","navPlugins","widgetPlugins","className","secondaryNavClassName","children","plugins","useMemo","_navPlugins","length","toArray","sort","sortFn","widgets","_widgetPlugins","links","map","id","menuItem","index","lastPluginStyle","marginRight","firstWidgetStyle","marginLeft","component","TopBarNavComponent","isInMenu","widgetDisplayText","props","displayName","classnames","styles","topBarNav","noBorder","style","tab","width","height","order","first","second"],"sources":["menu-nav.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport classnames from 'classnames';\nimport { ResponsiveNavbar } from '@teambit/design.navigation.responsive-navbar';\nimport type { TabProps } from '@teambit/design.navigation.responsive-navbar';\nimport { TopBarNav } from '../top-bar-nav';\nimport styles from './menu.module.scss';\nimport { NavPlugin, OrderedNavigationSlot } from './nav-plugin';\n\nexport type MenuNavProps = {\n /**\n * @deprecated\n * use @property navPlugins\n */\n navigationSlot?: OrderedNavigationSlot;\n /**\n * @deprecated\n * use @property widgetPlugins\n */\n widgetSlot?: OrderedNavigationSlot;\n navPlugins?: [string, NavPlugin][];\n widgetPlugins?: [string, NavPlugin][];\n /**\n * A className to pass to the secondary nav, i.e dropdown\n */\n secondaryNavClassName?: string;\n} & React.HTMLAttributes<HTMLElement>;\n\nexport function CollapsibleMenuNav({\n navigationSlot,\n widgetSlot,\n navPlugins = [],\n widgetPlugins = [],\n className,\n secondaryNavClassName,\n children,\n}: MenuNavProps) {\n const plugins = useMemo(() => {\n const _navPlugins = navPlugins.length > 0 ? navPlugins : navigationSlot?.toArray();\n return (_navPlugins || []).sort(sortFn);\n }, [navigationSlot, navPlugins]);\n const widgets = useMemo(() => {\n const _widgetPlugins = widgetPlugins.length > 0 ? widgetPlugins : widgetSlot?.toArray();\n return (_widgetPlugins || []).sort(sortFn);\n }, [widgetSlot, widgetPlugins]);\n\n const links = [...plugins, ...widgets].map(([id, menuItem], index) => {\n // these styles keep plugins to the left and widgets to the right.\n const lastPluginStyle = plugins.length - 1 === index ? { marginRight: 'auto' } : {};\n\n const firstWidgetStyle = plugins.length === index ? { marginLeft: 'auto' } : {};\n\n return {\n component: function TopBarNavComponent({ isInMenu }: TabProps) {\n const widgetDisplayText = menuItem.props.displayName && isInMenu && menuItem.props.displayName;\n return (\n <TopBarNav\n {...menuItem.props}\n className={classnames(menuItem.props.className, styles.topBarNav, isInMenu && styles.noBorder)}\n key={id}\n >\n {widgetDisplayText || menuItem.props.children}\n </TopBarNav>\n );\n },\n style: { ...firstWidgetStyle, ...lastPluginStyle },\n className: menuItem.props.className,\n };\n });\n\n return (\n <ResponsiveNavbar\n navClassName={classnames(styles.tab, className)}\n secondaryNavClassName={secondaryNavClassName}\n style={{ width: '100%', height: '100%' }}\n priority=\"none\"\n tabs={links}\n >\n {children}\n </ResponsiveNavbar>\n );\n}\n\nfunction sortFn([, { order: first }]: [string, NavPlugin], [, { order: second }]: [string, NavPlugin]) {\n // 0 - equal\n // <0 - first < second\n // >0 - first > second\n\n return (first ?? 0) - (second ?? 0);\n}\n\n// // this is the aspect-oriented and serialize-able way to sort plugins.\n// const pluginOrder = ['teambit.docs/docs', 'teambit.compositions/compositions', 'teambit.docs/docs'];\n// export function toSortedArray<T>(slot: SlotRegistry<T>, order: string[]) {\n// // sort items according to the order\n// const sorted = order.map((x) => [x, slot.get(x)]).filter(([, val]) => !!val) as [string, T][];\n//\n// // add all other items\n// const unsorted = slot.toArray().filter(([id]) => order.indexOf(id) < 0);\n//\n// return sorted.concat(unsorted);\n// }\n"],"mappings":"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"}
|
|
@@ -5,6 +5,7 @@ import { LaneModel } from '@teambit/lanes.ui.models.lanes-model';
|
|
|
5
5
|
import { ComponentModel } from '../../ui';
|
|
6
6
|
export declare type NavPluginProps = {
|
|
7
7
|
displayName?: string;
|
|
8
|
+
ignoreQueryParams?: boolean;
|
|
8
9
|
} & LinkProps;
|
|
9
10
|
export declare type NavPlugin = {
|
|
10
11
|
props: NavPluginProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["nav-plugin.tsx"],"sourcesContent":["import { SlotRegistry } from '@teambit/harmony';\nimport type { LinkProps } from '@teambit/base-react.navigation.link';\nimport type { ConsumeMethod } from '@teambit/ui-foundation.ui.use-box.menu';\nimport { LaneModel } from '@teambit/lanes.ui.models.lanes-model';\nimport { ComponentModel } from '../../ui';\n\nexport type NavPluginProps = {\n displayName?: string;\n} & LinkProps;\n\nexport type NavPlugin = {\n props: NavPluginProps;\n order?: number;\n};\n\nexport type OrderedNavigationSlot = SlotRegistry<NavPlugin>;\nexport type ConsumePluginOptions = {\n currentLane?: LaneModel;\n};\n\nexport type ConsumePlugin = (\n componentModel: ComponentModel,\n options?: ConsumePluginOptions\n) => ConsumeMethod | undefined;\n\nexport type ConsumeMethodSlot = SlotRegistry<ConsumePlugin[]>;\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["nav-plugin.tsx"],"sourcesContent":["import { SlotRegistry } from '@teambit/harmony';\nimport type { LinkProps } from '@teambit/base-react.navigation.link';\nimport type { ConsumeMethod } from '@teambit/ui-foundation.ui.use-box.menu';\nimport { LaneModel } from '@teambit/lanes.ui.models.lanes-model';\nimport { ComponentModel } from '../../ui';\n\nexport type NavPluginProps = {\n displayName?: string;\n ignoreQueryParams?: boolean;\n} & LinkProps;\n\nexport type NavPlugin = {\n props: NavPluginProps;\n order?: number;\n};\n\nexport type OrderedNavigationSlot = SlotRegistry<NavPlugin>;\nexport type ConsumePluginOptions = {\n currentLane?: LaneModel;\n};\n\nexport type ConsumePlugin = (\n componentModel: ComponentModel,\n options?: ConsumePluginOptions\n) => ConsumeMethod | undefined;\n\nexport type ConsumeMethodSlot = SlotRegistry<ConsumePlugin[]>;\n"],"mappings":""}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { NavPluginProps } from '../menu/nav-plugin';
|
|
3
|
-
export declare function TopBarNav({ href, className, activeClassName, children, displayName, ...rest }: NavPluginProps): JSX.Element;
|
|
3
|
+
export declare function TopBarNav({ href, className, activeClassName, children, displayName, ignoreQueryParams, ...rest }: NavPluginProps): JSX.Element;
|
|
@@ -61,9 +61,10 @@ function TopBarNav(_ref) {
|
|
|
61
61
|
className,
|
|
62
62
|
activeClassName,
|
|
63
63
|
children,
|
|
64
|
-
displayName
|
|
64
|
+
displayName,
|
|
65
|
+
ignoreQueryParams
|
|
65
66
|
} = _ref,
|
|
66
|
-
rest = (0, _objectWithoutProperties2().default)(_ref, ["href", "className", "activeClassName", "children", "displayName"]);
|
|
67
|
+
rest = (0, _objectWithoutProperties2().default)(_ref, ["href", "className", "activeClassName", "children", "displayName", "ignoreQueryParams"]);
|
|
67
68
|
const {
|
|
68
69
|
search
|
|
69
70
|
} = (0, _reactRouterDom().useLocation)(); // sticky query params
|
|
@@ -73,7 +74,7 @@ function TopBarNav(_ref) {
|
|
|
73
74
|
// but not for regular menu links (overview, compositions, etc).
|
|
74
75
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
75
76
|
const preventPassingDisplayNameToLink = displayName;
|
|
76
|
-
const target = href && `${href}${search}
|
|
77
|
+
const target = href && !ignoreQueryParams && `${href}${search}` || href;
|
|
77
78
|
return /*#__PURE__*/_react().default.createElement(_baseReactNavigation().Link, (0, _extends2().default)({}, rest, {
|
|
78
79
|
className: (0, _classnames().default)(className, _topBarNavModule().default.topBarLink),
|
|
79
80
|
activeClassName: (0, _classnames().default)(activeClassName, _topBarNavModule().default.active),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TopBarNav","href","className","activeClassName","children","displayName","rest","search","useLocation","preventPassingDisplayNameToLink","target","classnames","styles","topBarLink","active"],"sources":["top-bar-nav.tsx"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport { useLocation } from 'react-router-dom';\nimport { Link } from '@teambit/base-react.navigation.link';\nimport { NavPluginProps } from '../menu/nav-plugin';\n\nimport styles from './top-bar-nav.module.scss';\n\nexport function TopBarNav({
|
|
1
|
+
{"version":3,"names":["TopBarNav","href","className","activeClassName","children","displayName","ignoreQueryParams","rest","search","useLocation","preventPassingDisplayNameToLink","target","classnames","styles","topBarLink","active"],"sources":["top-bar-nav.tsx"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport { useLocation } from 'react-router-dom';\nimport { Link } from '@teambit/base-react.navigation.link';\nimport { NavPluginProps } from '../menu/nav-plugin';\n\nimport styles from './top-bar-nav.module.scss';\n\nexport function TopBarNav({\n href,\n className,\n activeClassName,\n children,\n displayName,\n ignoreQueryParams,\n ...rest\n}: NavPluginProps) {\n const { search } = useLocation(); // sticky query params\n\n // @hack - this is so that the displayName will not pass to the link and cause a warning in the console.\n // it is used for component page nav link widgets (code, aspects etc),\n // but not for regular menu links (overview, compositions, etc).\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const preventPassingDisplayNameToLink = displayName;\n\n const target = (href && !ignoreQueryParams && `${href}${search}`) || href;\n\n return (\n <Link\n {...rest}\n className={classnames(className, styles.topBarLink)}\n activeClassName={classnames(activeClassName, styles.active)}\n href={target}\n >\n <div>{children}</div>\n </Link>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,SAASA,SAAS,OAQN;EAAA,IARO;MACxBC,IAAI;MACJC,SAAS;MACTC,eAAe;MACfC,QAAQ;MACRC,WAAW;MACXC;IAEc,CAAC;IADZC,IAAI;EAEP,MAAM;IAAEC;EAAO,CAAC,GAAG,IAAAC,6BAAW,GAAE,CAAC,CAAC;;EAElC;EACA;EACA;EACA;EACA,MAAMC,+BAA+B,GAAGL,WAAW;EAEnD,MAAMM,MAAM,GAAIV,IAAI,IAAI,CAACK,iBAAiB,IAAK,GAAEL,IAAK,GAAEO,MAAO,EAAC,IAAKP,IAAI;EAEzE,oBACE,+BAAC,2BAAI,+BACCM,IAAI;IACR,SAAS,EAAE,IAAAK,qBAAU,EAACV,SAAS,EAAEW,0BAAM,CAACC,UAAU,CAAE;IACpD,eAAe,EAAE,IAAAF,qBAAU,EAACT,eAAe,EAAEU,0BAAM,CAACE,MAAM,CAAE;IAC5D,IAAI,EAAEJ;EAAO,iBAEb,4CAAMP,QAAQ,CAAO,CAChB;AAEX"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/component",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.959",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/component/component",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "component",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.959"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@teambit/any-fs": "0.0.5",
|
|
@@ -27,47 +27,47 @@
|
|
|
27
27
|
"@teambit/documenter.ui.heading": "4.1.1",
|
|
28
28
|
"@teambit/documenter.ui.separator": "4.1.1",
|
|
29
29
|
"@teambit/explorer.ui.command-bar": "2.0.3",
|
|
30
|
-
"@teambit/design.navigation.responsive-navbar": "0.0.2",
|
|
31
30
|
"@teambit/base-ui.layout.breakpoints": "1.0.0",
|
|
32
31
|
"@teambit/component-id": "0.0.425",
|
|
33
32
|
"@teambit/ui-foundation.ui.menu-widget-icon": "0.0.497",
|
|
34
|
-
"@teambit/aspect-loader": "0.0.
|
|
35
|
-
"@teambit/graph": "0.0.
|
|
33
|
+
"@teambit/aspect-loader": "0.0.959",
|
|
34
|
+
"@teambit/graph": "0.0.959",
|
|
36
35
|
"@teambit/legacy-bit-id": "0.0.421",
|
|
37
36
|
"@teambit/toolbox.path.match-patterns": "0.0.9",
|
|
38
37
|
"@teambit/toolbox.string.capitalize": "0.0.490",
|
|
39
|
-
"@teambit/cli": "0.0.
|
|
40
|
-
"@teambit/express": "0.0.
|
|
41
|
-
"@teambit/graphql": "0.0.
|
|
38
|
+
"@teambit/cli": "0.0.643",
|
|
39
|
+
"@teambit/express": "0.0.741",
|
|
40
|
+
"@teambit/graphql": "0.0.959",
|
|
42
41
|
"@teambit/bit-error": "0.0.402",
|
|
43
|
-
"@teambit/command-bar": "0.0.
|
|
44
|
-
"@teambit/component.ui.deprecation-icon": "0.0.
|
|
45
|
-
"@teambit/preview": "0.0.
|
|
46
|
-
"@teambit/pubsub": "0.0.
|
|
47
|
-
"@teambit/react-router": "0.0.
|
|
42
|
+
"@teambit/command-bar": "0.0.959",
|
|
43
|
+
"@teambit/component.ui.deprecation-icon": "0.0.504",
|
|
44
|
+
"@teambit/preview": "0.0.959",
|
|
45
|
+
"@teambit/pubsub": "0.0.959",
|
|
46
|
+
"@teambit/react-router": "0.0.959",
|
|
48
47
|
"@teambit/ui-foundation.ui.is-browser": "0.0.495",
|
|
49
48
|
"@teambit/ui-foundation.ui.main-dropdown": "0.0.497",
|
|
50
49
|
"@teambit/ui-foundation.ui.react-router.slot-router": "0.0.501",
|
|
51
|
-
"@teambit/ui-foundation.ui.use-box.menu": "0.0.
|
|
52
|
-
"@teambit/ui": "0.0.
|
|
53
|
-
"@teambit/component-issues": "0.0.
|
|
50
|
+
"@teambit/ui-foundation.ui.use-box.menu": "0.0.132",
|
|
51
|
+
"@teambit/ui": "0.0.959",
|
|
52
|
+
"@teambit/component-issues": "0.0.85",
|
|
54
53
|
"@teambit/ui-foundation.ui.hooks.use-data-query": "0.0.500",
|
|
55
54
|
"@teambit/cli-table": "0.0.41",
|
|
56
|
-
"@teambit/component-descriptor": "0.0.
|
|
55
|
+
"@teambit/component-descriptor": "0.0.212",
|
|
57
56
|
"@teambit/ui-foundation.ui.react-router.use-query": "0.0.496",
|
|
58
|
-
"@teambit/design.ui.empty-box": "0.0.
|
|
57
|
+
"@teambit/design.ui.empty-box": "0.0.364",
|
|
59
58
|
"@teambit/harmony.ui.aspect-box": "0.0.497",
|
|
59
|
+
"@teambit/compositions": "0.0.959",
|
|
60
|
+
"@teambit/deprecation": "0.0.959",
|
|
61
|
+
"@teambit/envs": "0.0.959",
|
|
62
|
+
"@teambit/legacy-component-log": "0.0.399",
|
|
60
63
|
"@teambit/design.ui.pages.not-found": "0.0.366",
|
|
61
64
|
"@teambit/design.ui.pages.server-error": "0.0.366",
|
|
62
65
|
"@teambit/design.ui.styles.ellipsis": "0.0.357",
|
|
63
66
|
"@teambit/envs.ui.env-icon": "0.0.495",
|
|
64
|
-
"@teambit/
|
|
65
|
-
"@teambit/
|
|
66
|
-
"@teambit/
|
|
67
|
-
"@teambit/
|
|
68
|
-
"@teambit/component.ui.version-dropdown": "0.0.707",
|
|
69
|
-
"@teambit/lanes.hooks.use-lanes": "0.0.105",
|
|
70
|
-
"@teambit/lanes.ui.models.lanes-model": "0.0.67",
|
|
67
|
+
"@teambit/design.navigation.responsive-navbar": "0.0.4",
|
|
68
|
+
"@teambit/component.ui.version-dropdown": "0.0.709",
|
|
69
|
+
"@teambit/lanes.hooks.use-lanes": "0.0.106",
|
|
70
|
+
"@teambit/lanes.ui.models.lanes-model": "0.0.68",
|
|
71
71
|
"@teambit/ui-foundation.ui.full-loader": "0.0.495",
|
|
72
72
|
"@teambit/ui-foundation.ui.use-box.dropdown": "0.0.131"
|
|
73
73
|
},
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"peerDependencies": {
|
|
89
89
|
"react-router-dom": "^6.0.0",
|
|
90
90
|
"@apollo/client": "^3.6.0",
|
|
91
|
-
"@teambit/legacy": "1.0.
|
|
91
|
+
"@teambit/legacy": "1.0.424",
|
|
92
92
|
"react": "^16.8.0 || ^17.0.0",
|
|
93
93
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
94
94
|
},
|
package/ui/menu/menu-nav.tsx
CHANGED
|
@@ -19,6 +19,10 @@ export type MenuNavProps = {
|
|
|
19
19
|
widgetSlot?: OrderedNavigationSlot;
|
|
20
20
|
navPlugins?: [string, NavPlugin][];
|
|
21
21
|
widgetPlugins?: [string, NavPlugin][];
|
|
22
|
+
/**
|
|
23
|
+
* A className to pass to the secondary nav, i.e dropdown
|
|
24
|
+
*/
|
|
25
|
+
secondaryNavClassName?: string;
|
|
22
26
|
} & React.HTMLAttributes<HTMLElement>;
|
|
23
27
|
|
|
24
28
|
export function CollapsibleMenuNav({
|
|
@@ -27,6 +31,8 @@ export function CollapsibleMenuNav({
|
|
|
27
31
|
navPlugins = [],
|
|
28
32
|
widgetPlugins = [],
|
|
29
33
|
className,
|
|
34
|
+
secondaryNavClassName,
|
|
35
|
+
children,
|
|
30
36
|
}: MenuNavProps) {
|
|
31
37
|
const plugins = useMemo(() => {
|
|
32
38
|
const _navPlugins = navPlugins.length > 0 ? navPlugins : navigationSlot?.toArray();
|
|
@@ -48,24 +54,29 @@ export function CollapsibleMenuNav({
|
|
|
48
54
|
const widgetDisplayText = menuItem.props.displayName && isInMenu && menuItem.props.displayName;
|
|
49
55
|
return (
|
|
50
56
|
<TopBarNav
|
|
57
|
+
{...menuItem.props}
|
|
51
58
|
className={classnames(menuItem.props.className, styles.topBarNav, isInMenu && styles.noBorder)}
|
|
52
59
|
key={id}
|
|
53
|
-
{...menuItem.props}
|
|
54
60
|
>
|
|
55
61
|
{widgetDisplayText || menuItem.props.children}
|
|
56
62
|
</TopBarNav>
|
|
57
63
|
);
|
|
58
64
|
},
|
|
59
65
|
style: { ...firstWidgetStyle, ...lastPluginStyle },
|
|
66
|
+
className: menuItem.props.className,
|
|
60
67
|
};
|
|
61
68
|
});
|
|
69
|
+
|
|
62
70
|
return (
|
|
63
71
|
<ResponsiveNavbar
|
|
64
72
|
navClassName={classnames(styles.tab, className)}
|
|
73
|
+
secondaryNavClassName={secondaryNavClassName}
|
|
65
74
|
style={{ width: '100%', height: '100%' }}
|
|
66
75
|
priority="none"
|
|
67
76
|
tabs={links}
|
|
68
|
-
|
|
77
|
+
>
|
|
78
|
+
{children}
|
|
79
|
+
</ResponsiveNavbar>
|
|
69
80
|
);
|
|
70
81
|
}
|
|
71
82
|
|
package/ui/menu/nav-plugin.tsx
CHANGED
|
@@ -6,7 +6,15 @@ import { NavPluginProps } from '../menu/nav-plugin';
|
|
|
6
6
|
|
|
7
7
|
import styles from './top-bar-nav.module.scss';
|
|
8
8
|
|
|
9
|
-
export function TopBarNav({
|
|
9
|
+
export function TopBarNav({
|
|
10
|
+
href,
|
|
11
|
+
className,
|
|
12
|
+
activeClassName,
|
|
13
|
+
children,
|
|
14
|
+
displayName,
|
|
15
|
+
ignoreQueryParams,
|
|
16
|
+
...rest
|
|
17
|
+
}: NavPluginProps) {
|
|
10
18
|
const { search } = useLocation(); // sticky query params
|
|
11
19
|
|
|
12
20
|
// @hack - this is so that the displayName will not pass to the link and cause a warning in the console.
|
|
@@ -15,7 +23,7 @@ export function TopBarNav({ href, className, activeClassName, children, displayN
|
|
|
15
23
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16
24
|
const preventPassingDisplayNameToLink = displayName;
|
|
17
25
|
|
|
18
|
-
const target = href && `${href}${search}
|
|
26
|
+
const target = (href && !ignoreQueryParams && `${href}${search}`) || href;
|
|
19
27
|
|
|
20
28
|
return (
|
|
21
29
|
<Link
|
|
Binary file
|